Jump to content

Scripting the berserk state


Drew

Recommended Posts

Before I get started on a little project, I was hoping to find out how possible what I'm trying to do will be. I'd like to set up Berserker Enrage, Minsc's Rage, and possibly the Barbarian Rage to all cause something similar to the in-game Berserk state. To whit, I want the innates to cause the player to lose control of the character -- the character will use a melee weapon to attack the nearest enemy, moving onto the next only after the current one has been killed, fled the map, or turned invisible. The character won't use potions, but would occasionally use High Level Abilities like Whirlwind or Critical Strike if they are available. Most importantly, though, I don't want the Character attacking the party at any time during combat.

 

The other thing I'd like to do (which is, quite frankly less important to me -- but would be neat if it could be pulled off) is use scripting to override the standard berserk state for barbarians and berserkers with the modified version spelled out above in the event they are ever affected by a spell or cursed item that would ordinarily cause them to go berserk.

 

Specific lines of scripting and/or code would obviously be great, but I'm really not in asking anyone to do all my work or research for me. Simply telling me whether what I want to do is possible (and how "hacky" it would be) and advising me on where I should start would be just as well appreciated. :party:

Link to comment

You could probably do this with opcode #82 (set AI script). I can think of two major drawbacks to it though:

 

1) Not sure what happens when the duration wears off - if the script slot gets set back to what it was or just cleared

2) It'll do nothing for party members if the party AI lantern is off

 

The other option would be to mess with baldur.bcs, but that's even more "hacky" in my opinion.

Link to comment

Thanks. So, uh, would it be possible to use the scorched-earth tactic of altering the berserk state itself? In other words, could I simply rewrite the berserk state to make anyone thus afflicted to attack the nearest target with a melee weapon and never use healing items?

Link to comment
So, uh, would it be possible to use the scorched-earth tactic of altering the berserk state itself? In other words, could I simply rewrite the berserk state to make anyone thus afflicted to attack the nearest target with a melee weapon and never use healing items?
I think that might be tough (or even impossible) for a master EXE-hacker like Taimon, because you probably couldn't do it with a patch of the same length. You might be able to do something similar with enough effects stacked on the existing spells. Unfortunately, the Attack Nearest Creature opcode (247) does not seem to accept a parameter that distinguishes between enemies and non-enemies. You could certainly disable the quickslots for the duration though, so the berserked couldn't use potions (opcode 144). You could try using 82 (Set AI Script) then messing with opcode 293 (Enable Offscreen AI) to see if it still runs when party AI is off - kinda doubt it but it's worth a shot. Just edit the spell (like spin117.spl) in DLTCEP or NI for now - you can worry about patching it with WeiDU later (if and when you get something working).
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...