- Joined
- Aug 3, 2004
- Messages
- 2,906
I need to check if the target unit is in water and deny the cast if it is not. Typically I have a separate trigger for this but the cast on this seems to be instant.
"locals are only supported at the top of the function"
"locals are only supported at the top of the function"
-
Dematerialize Copy
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Dematerialize
-
-
Actions
-
Set ErrorPlayer = (Owner of (Triggering unit))
-
Set Dematerialize_Terrain_Point = (Position of (Target unit of ability being cast))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Terrain pathing at Dematerialize_Terrain_Point of type Floatability is off) Equal to True
-
-
Then - Actions
-
Unit - Order (Triggering unit) to Stop
-
Set ErrorMessage = Not enough water at target location.
-
Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-
Else - Actions
-
Custom script: local unit Dematerialize_Unit_A = GetTriggerUnit()
-
Custom script: local unit Dematerialize_Unit_B = GetSpellTargetUnit()
-
Custom script: set udg_Dematerialize_Point = GetUnitLoc(Dematerialize_Unit_B)
-
Custom script: set udg_Dematerialize_Point_B = GetUnitLoc(Dematerialize_Unit_A)
-
Custom script: call SetUnitX(Dematerialize_Unit_A, GetUnitX(Dematerialize_Unit_B) + 100)
-
Custom script: call SetUnitY(Dematerialize_Unit_A, GetUnitY(Dematerialize_Unit_B) + 100)
-
Unit - Create 1 Dummy (Dematerialize) for Neutral Passive at Dematerialize_Point_B facing Default building facing degrees
-
Set Dematerialize_Unit = (Last created unit)
-
Unit - Add a 1.00 second Generic expiration timer to Dematerialize_Unit
-
Custom script: call RemoveLocation(udg_Dematerialize_Point)
-
Custom script: call RemoveLocation(udg_Dematerialize_Point_B)
-
Custom script: set Dematerialize_Unit_A = null
-
Custom script: set Dematerialize_Unit_B = null
-
-
-
Custom script: call RemoveLocation(udg_Dematerialize_Terrain_Point)
-
-