HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Trigger Trouble

01-16-2004, 03:06 AM#1
Imbrifer
I'm having trouble making a spell called 'Spell Thrust' which creates a 'spirit' next to the target unit which takes an extra percent damage, and applies it to the target unit when the target unit's stun time is over. As the trigger is now, the 'spirit' is created, but when it dies the damage is not applied to the target unit.

Spirit Thrust


- Events

-- Unit - A unit Starts the effect of an ability


- Conditions

--(Ability being cast) Equal to Spirit Thrust


- Actions

-- Unit - Create 1 Spirit for Neutral Extra at ((Position of (Target unit of ability being cast)) offset by 50.00 towards (Random real number between 0.00 and 359.00) degrees) facing Default building facing degrees

-- Set UnitThrusted = (Last created unit)

-- Unit - Set life of UnitThrusted to (Life of (Target unit of ability being cast))

-- Set RealThrusted = (Life of (Target unit of ability being cast))

-- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
--- If - Conditions
---- (Level of Spirit Thrust for (Casting unit)) Equal to 1
--- Then - Actions
---- If (((Target unit of ability being cast) is A Hero) Equal to True) then do (Wait 3.00 seconds) else do (Wait 6.00 seconds)
--- Else - Actions
--- Do Nothing

-- Unit - Order UnitThrusted to Move To (Position of (Target unit of ability being cast))

-- Wait 0.50 seconds

-- If ((UnitThrusted is alive) Equal to True) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - ((RealThrusted - (Life of UnitThrusted)) x (((Real((Level of Spirit Thrust for (Casting unit)))) x 0.50) + 0.50)))) else do (Do nothing)

-- Unit - Kill UnitThrusted


Any help would be greatly appreciated. Thank you.
01-16-2004, 04:32 AM#2
Shvegait
There's a bug that causes "Target Unit of Ability Being Cast" to be forgotten by the game after a Wait action. You will have to set it equal to a variable before the first Wait action, then reference the variable instead of that for the rest of the trigger.
01-16-2004, 05:47 AM#3
Imbrifer
Thanks a heap! Ended up figuring it out myself through a grueling process though...

Live and learn :)