Trying to make a script to change stoneskin defense value

Official forum of the Wake of Gods mod to Heroes of Might and Magic III.
Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Trying to make a script to change stoneskin defense value

Unread postby Pollo2002 » 01 Dec 2007, 23:52

I know that i can change this easly.
But i want to make it work based on teh caster spellpower.
In the following lines i can make stonesking to give any creature +50 defense
The problem relies on that i don't know how to follow the script so that bonus wears off when stoneskin is gone, no matter if it was removed with dispell magic, from a dragonfly or just because it's power weared off.
Any help is appreciated.


ZVSE
!?BG0;
!!BG:A?y1;
!!BG|y1=1:S?y2;
!!IF|y2=46:V40/1;


!?BG0&40=1;
!!BG:D?y1;
!!BU:Ey1/?v5000;
!!BMv5000:+D50;
!!IF:V40/0;

viewtopic.php?t=1581&postdays=0&postorder=asc&start=0

I already touched the subject a while ago there. But until know i couldn't solve the problem.

User avatar
Qurqirish Dragon
Genie
Genie
Posts: 1011
Joined: 06 Jan 2006
Location: Flying the skies of Ohlam

Unread postby Qurqirish Dragon » 02 Dec 2007, 16:56

It may not be the best way, but I would use a function that triggers wheever a spell is cast, and at the start of each round. In this function, check to see if stoneskin is active on each unit. if not, reset the defense skill. You may want to use a variable to keep track of which stacks have the bonus already, to make things easier (a single variable for each side can track all 21 stacks, if you are comfortable with bit-setting.)

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Unread postby Pollo2002 » 03 Dec 2007, 00:13

could you write down an example? i'm not that smart


Return to “Wake of Gods”

Who is online

Users browsing this forum: No registered users and 10 guests