- Joined
- Aug 3, 2004
- Messages
- 2,909
I have a system that successfully cancels an ability being cast by a unit. This means the mana is not spent and the cooldown is not started. When I apply this to a building it does not work. Why are spells cast by buildings different?
-
Unit Cannon Try
-

Events
-


Unit - A unit Begins casting an ability
-
-

Conditions
-


(Ability being cast) Equal to Cannon Fodder
-
-

Actions
-


Set Unit_Cannon_Pos = (Target point of ability being cast)
-


Set Unit_Cannon_Pos_B = (Position of (Triggering unit))
-


Custom script: set udg_Unit_Cannon_AoE=GetLocationZ(udg_Unit_Cannon_Pos)
-


Set ErrorPlayer = (Owner of (Triggering unit))
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Distance between Unit_Cannon_Pos and Unit_Cannon_Pos_B) Less than 1500.00
-
-



Then - Actions
-




Unit - Order (Triggering unit) to Stop
-




Set ErrorMessage = Target is inside minimum range.
-




Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-



Else - Actions
-
-


Destructible - Pick every destructible within 450.00 of Unit_Cannon_Pos and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Destructible-type of (Picked destructible)) Equal to Unit Cannon Deep Sea Blocker (Small)
-
-





Then - Actions
-






Unit - Order (Triggering unit) to Stop
-






Set ErrorMessage = Unable to target deep water.
-






Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-





Else - Actions
-
-
-
-


Destructible - Pick every destructible within 800.00 of Unit_Cannon_Pos and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Destructible-type of (Picked destructible)) Equal to Unit Cannon Deep Sea Blocker (Large)
-
-





Then - Actions
-






Unit - Order (Triggering unit) to Stop
-






Set ErrorMessage = Unable to target deep water.
-






Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-





Else - Actions
-
-
-
-


Destructible - Pick every destructible within 300.00 of Unit_Cannon_Pos and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Or - Any (Conditions) are true
-







Conditions
-








(Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
-








(Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
-








(Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
-








(Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
-








(Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Winter Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall (Normal)
-








(Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
-








(Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Village Tree Wall
-








(Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall (Pathing Blocker)
-








(Destructible-type of (Picked destructible)) Equal to Pathing Blocker [Outer]
-
-
-
-





Then - Actions
-






Unit - Order (Triggering unit) to Stop
-






Set ErrorMessage = Target area is obstructed.
-






Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Unit_Cannon_Pos is masked for (Owner of (Triggering unit))) Equal to True
-
-



Then - Actions
-




Unit - Order (Triggering unit) to Stop
-




Set ErrorMessage = Target area must be visible.
-




Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
-
-



Else - Actions
-
-


Custom script: call RemoveLocation(udg_Unit_Cannon_Pos)
-


Custom script: call RemoveLocation(udg_Unit_Cannon_Pos_B)
-
-



