- Joined
- Jul 19, 2007
- Messages
- 855
Hi there. I have a problem with a sleep spell which should cause an enemy unit to lose the level of the spell % it's maximum helath but the problem is that the kill does not go the the caster if the enemy unit dies of it. Is there any way to do it? Here is the triggers for the spell.
-
Sleep
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Sleep (Grima)
-
-
Actions
-
Hashtable - Save ((Level of Sleep (Grima) for (Casting unit)) x 5) as 0 of (Key (Target unit of ability being cast)) in Sleep_hashtable
-
Unit Group - Add (Target unit of ability being cast) to Sleeping_units
-
Set Sleep_damage = (((Level of (Ability being cast) for (Triggering unit)) x (Integer((Max life of (Target unit of ability being cast))))) / 100)
-
Set Sleep_caster = (Triggering unit)
-
-
-
Sleep Loop
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Sleeping_units and do (Actions)
-
Loop - Actions
-
Set Sleep_time = (Load 0 of (Key (Picked unit)) from Sleep_hashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Sleep_time Greater than 0
-
-
Then - Actions
-
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Real(Sleep_damage)))
-
Hashtable - Save (Sleep_time - 1) as 0 of (Key (Picked unit)) in Sleep_hashtable
-
-
Else - Actions
-
Unit Group - Remove (Picked unit) from Sleeping_units
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Sleep_hashtable
-
Unit - Cause Sleep_caster to damage (Picked unit), dealing 0.01 damage of attack type Spells and damage type Normal
-
-
-
-
-
-