I'm working on my first mod, which allows the player to sell Skooma to NPCs via dialogue.
I've got a number of randomly generated responses lined up, including a "Frenzied Junkie" response. The idea is that when you try to sell to beggars/servants/other poor folks, there is a chance that they are (secretly) a junkie who will try to kill you for your stash.
My first solution:
NPCs flagged with "ClothingPoor" have a chance to activate the following fragment:
akSpeaker.StartCombat(Game.GetPlayer())
This works great. Amren's Wife, for example, freaks out and starts attacking you.
The problem is that Cowardly/Unaggressive NPCs (I'm looking at you, Gerda) initiate combate, then immediately flee. This is not very junkielike. I want my Skooma-heads hopped up and aggressive!
My next solution:
akSpeaker.StartCombat(Game.GetPlayer())Getplayer().DoCombatSpellApply(Frenzy, akSpeaker)
This gets me the desired effect (Skooma-crazed assault) but is horribly inelegant. It counts as a spellcast, so the Player launches a spell projectile, and levels illusion. Not exactly what I'm looking for; I want my junkies to be crazy because they heard me say "Skooma," and not because I forced the Player to cast a spell.
My question is this:
How can I script a change in an NPC's AI package? I'm looking for help making the following code:
akSpeaker.StartCombat(Game.GetPlayer())Line Of Code That changes akSpeaker's AI Attributes to Aggressive/Foolhardy
I'd like to avoid changing the NPC's base values in the CK, and am hoping you guys can help me find a scripted solution to my cowardly junkie problem.
There's a free bottle of Skooma in it for anyone who helps out!
Cheers, and Thanks.