ok so my problem is .. i made this spell that basically makes the unit trapped inside this hurricane. Problem is .. When the hurricane will also drag the units over the mountain.. i know what the problem is but i dont know an alternative way.
heres the spell
heres the spell
Code:
FinishingTouchCasting
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (==) FinishingTouch [|cffffff00Q|r]
Actions
Set Cloud_TrigUnit = (Triggering unit)
Set Cloud_DMG = ((Real((Level of FinishingTouch [|cffffff00Q|r] for (Triggering unit)))) x 10.00)
Set Cloud_Loc = (Position of Cloud_TrigUnit)
Set Cloud_SpellLoc = (Target point of ability being cast)
Set Cloud_Angle = (Angle from Cloud_Loc to Cloud_SpellLoc)
Set Cloud_Size = 100.00
Unit - Create 1 HurricaneDummy for (Owner of Cloud_TrigUnit) at Cloud_Loc facing Default building facing (270.0) degrees
Set Cloud_D = (Last created unit)
Custom script: call RemoveLocation (udg_Cloud_Loc)
Set Cloud_Distance[1] = 0
Set Cloud_Distance[2] = 1400
Animation - Play Cloud_TrigUnit's Attack Slam animation
Custom script: call RemoveLocation (udg_Cloud_SpellLoc)
Trigger - Turn on FinishingTouchDummyMoving <gen>
Trigger - Turn on FininshTouchDamage <gen>
Code:
FinishingTouchDummyMoving
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Set Cloud_Distance[1] = (Cloud_Distance[1] + 20)
Set Cloud_DP = (Position of Cloud_D)
Set Cloud_offset = (Cloud_DP offset by 20.00 towards Cloud_Angle degrees)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Cloud_Distance[1] Greater than or equal to (>=) Cloud_Distance[2]
Then - Actions
Trigger - Turn off (This trigger)
Special Effect - Create a special effect at Cloud_DP using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove Cloud_D from the game
Unit Group - Pick every unit in Cloud_TargetGroup[2] and do (Actions)
Loop - Actions
Set Cloud_Locs[1] = (Position of (Picked unit))
Set Cloud_Locs[2] = (Cloud_Locs[1] offset by 125.00 towards (Random angle) degrees)
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call DestroyGroup (udg_Cloud_TargetGroup[2])
Custom script: call RemoveLocation (udg_Cloud_DP)
Custom script: call RemoveLocation (udg_Cloud_offset)
Custom script: call RemoveLocation (udg_Cloud_Locs[1])
Custom script: call RemoveLocation (udg_Cloud_Locs[2])
Else - Actions
Unit - Move Cloud_D instantly to Cloud_offset
Set Cloud_TargetGroup[1] = (Units within 200.00 of Cloud_DP matching ((((Matching unit) is A structure) Equal to (==) False) and ((((Matching unit) belongs to an enemy of (Owner of Cloud_TrigUnit)) Equal to (==) True) and (((Matching unit) is in Cloud_TargetGroup[2]) Equal to (==) Fals
Unit Group - Pick every unit in Cloud_TargetGroup[1] and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to Cloud_TargetGroup[2]
Unit Group - Pick every unit in (Units within 200.00 of Cloud_DP matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) belongs to an enemy of (Owner of Cloud_TrigUnit)) Equal to (==) True))) and do (Actions)
Loop - Actions
Custom script: local location random111
Custom script: set random111 = PolarProjectionBJ(udg_Cloud_DP, 50.00, GetRandomDirectionDeg())
Unit - Move (Picked unit) instantly to (random111)
Unit Group - Add (Picked unit) to Cloud_TargetGroup[2]
Custom script: call RemoveLocation(random111)
Custom script: set random111 = null
Custom script: call DestroyGroup (bj_lastCreatedGroup)
Custom script: call RemoveLocation(udg_Cloud_offset)
Custom script: call DestroyGroup (udg_Cloud_TargetGroup[1])
Code:
FininshTouchDamage
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units within 200.00 of Cloud_DP matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) belongs to an enemy of (Owner of Cloud_TrigUnit)) Equal to (==) True))) and do (Actions)
Loop - Actions
Unit - Cause Cloud_TrigUnit to damage (Picked unit), dealing Cloud_DMG damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup(bj_lastCreatedGroup)