It doesn't qork, why?
Cold Slam
Cold Slam
Code:
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Cold Slam
Actions
Set CasterLocation = (Position of (Triggering unit))
Set UnitsInRange = (Units within 600.00 of CasterLocation matching (((Triggering unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set EffectCount = 0
Unit Group - Pick every unit in UnitsInRange and do (Actions)
Loop - Actions
Set PickedLocation = (Position of (Picked unit))
Set DistanceBetweenPoints = (Distance between CasterLocation and PickedLocation)
Set EffectOffset = (EffectOffset + 100.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DistanceBetweenPoints Less than or equal to 50.00
Then - Actions
Set AngleBetweenPoints = (Angle from CasterLocation to PickedLocation)
Set EffectCount = (EffectCount + 1)
Set EffectLocation = (CasterLocation offset by DistanceBetweenPoints towards AngleBetweenPoints degrees)
Special Effect - Create a special effect at EffectLocation using Abilities\Spells\Other\BreathOfFrost\BreathOfFrostTarget.mdl
Set Effect[EffectCount] = (Last created special effect)
Custom script: call RemoveLocation( udg_EffectLocation)
Else - Actions
Custom script: call RemoveLocation( udg_PickedLocation)
Wait 0.40 seconds
For each (Integer A) from 1 to EffectCount, do (Special Effect - Destroy Effect[(Integer A)])
Custom script: call RemoveLocation( udg_CasterLocation)
Custom script: call DestroyGroup( udg_UnitsInRange)