- Joined
- Feb 23, 2015
- Messages
- 243
Hi
I've made a spell that drains mana from every enemy unit in the area and transfers it to the caster. Problem is, that the actions in 'unit group' part doesn't happen - spell creates special effect in the point and after the time lightning appear between targeted location and caster, but there is no effect on enemy units. Here are triggers:
I've made a spell that drains mana from every enemy unit in the area and transfers it to the caster. Problem is, that the actions in 'unit group' part doesn't happen - spell creates special effect in the point and after the time lightning appear between targeted location and caster, but there is no effect on enemy units. Here are triggers:
-
WCast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equals to W_Ability
-
-
Actions
-
Set W_LightningIndex = 0
-
Set W_Caster = (Triggering unit)
-
Set W_Point = (Target point of ability being cast)
-
Set W_Level = (Level of W_Ability for W_Caster)
-
Special Effect - Create a special effect at W_Point using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
-
Set W_Effect = (Last created special effect)
-
Unit Group - Add all units of (Units within W_Range of W_Point matching ((Owner of (Matching unit)) Equals to (Random player from (All enemies of (Owner of W_Caster))))) to W_Group
-
Unit Group - Pick every unit in W_Group and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Mana of (Picked unit)) Greater than 0.00
-
-
To - Actions
-
Lightning - Create a Chain Lightning - Secondary Bolt lightning effect from source (Position of (Picked unit)) to target W_Point
-
Set W_Lightning[W_LightningIndex] = (Last created lightning effect)
-
Set W_LightningIndex = (W_LightningIndex + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Mana of (Picked unit)) Greater or equal to W_ManaAmount[(W_Level - 1)]
-
-
To - Actions
-
Set W_StolenMana = (W_StolenMana + W_ManaAmount[(W_Level - 1)])
-
Unit - Cause W_Caster to damage (Picked unit), dealing (W_DamageMultiplier[(W_Level - 1)] x W_ManaAmount[(W_Level - 1)]) damage of attack type Spells and damage type Magic
-
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - W_ManaAmount[(W_Level - 1)])
-
-
Else - Actions
-
Set W_StolenMana = (W_StolenMana + (Mana of (Picked unit)))
-
Unit - Cause W_Caster to damage (Picked unit), dealing (W_DamageMultiplier[(W_Level - 1)] x (Mana of (Picked unit))) damage of attack type Spells and damage type Magic
-
Unit - Set mana of (Picked unit) to 0.00
-
-
-
-
Else - Actions
-
-
-
-
Wait 0.50 seconds
-
For each (Integer A) from W_LightningIndex to 0, do (Actions)
-
Loop - Actions
-
Lightning - Destroy W_Lightning[W_LightningIndex]
-
Set W_LightningIndex = (W_LightningIndex - 1)
-
-
-
Lightning - Create a Chain Lightning - Primary Bolt lightning effect from source W_Point to target (Position of W_Caster)
-
Wait 0.10 seconds
-
Lightning - Destroy (Last created lightning effect)
-
Unit - Set mana of W_Caster to ((Mana of W_Caster) + W_StolenMana)
-
Set W_StolenMana = 0.00
-
Set W_Group = (Random 0 units from W_Group)
-
Special Effect - Destroy W_Effect
-
Custom script: call RemoveLocation(udg_W_Point)
-
-