- Joined
- Jun 13, 2008
- Messages
- 350
Hi guys...I made a spell which works only if there are any enemies in front of the hero, but if there are not, it gives error message, I've done that but making the hero to not to cast that spell is kinda tough for me...because I tried every way and it always consume mana and cast it...with giving the error message again...here's the triggers.
-
Frost Strike
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Frost Strike
-
Actions
- Set FSCaster = (Triggering unit)
- Set FSDummy_Point = (Position of FSCaster)
- Set FStrike_Point = ((Position of FSCaster) offset by 100.00 towards (Facing of FSCaster) degrees)
- Set FS_Group = (Units within 100.00 of FStrike_Point)
- Set ErrorMessage = There are no enemy to strike!
- Set ErrorPlayer = (Owner of FSCaster)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in FS_Group) Greater than 0
-
Then - Actions
- Unit - Create 1 Dummy for (Owner of FSCaster) at FSDummy_Point facing (Facing of FSCaster) degrees
- Set FS_Dummy = (Last created unit)
- Unit - Add Obliterate Dummy to FS_Dummy
- Unit - Set level of Obliterate Dummy for FS_Dummy to (Level of Frost Strike for FSCaster)
- Unit - Add a 1.00 second Generic expiration timer to FS_Dummy
- Unit - Order FS_Dummy to Neutral - Breath Of Frost FStrike_Point
-
Unit Group - Pick every unit in FS_Group and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) belongs to an enemy of (Owner of FSCaster)) Equal to True
- ((Picked unit) is alive) Equal to True
-
Then - Actions
- Set FS_Target = (Picked unit)
- Unit - Cause FSCaster to damage FS_Target, dealing ((20.00 + (10.00 x (Real((Level of Frost Strike for FSCaster))))) + ((Real((Level of Frost Strike for FSCaster))) x (Real((Strength of FSCaster (Include bonuses)))))) damage of attack type Spells and damage type Cold
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Else - Actions
- Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
- Unit - Pause FSCaster
- Unit - Order FSCaster to Stop
- Unit - Unpause FSCaster
-
If - Conditions
- Custom script: call RemoveLocation(udg_FStrike_Point)
- Custom script: call DestroyGroup(udg_FS_Group)
-
Events