- Joined
- Dec 6, 2009
- Messages
- 168
Hello! I have 2 questions. Why doesn't my spell deal damage to every unit? And does it leak?
Here are the triggers:
Thanks!
Here are the triggers:
-
Stone Throw
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Stone Throw
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SH_Size Equal to 0
-
Then - Actions
- Trigger - Turn on Stone Throw Loop <gen>
- Else - Actions
-
If - Conditions
- Set SH_Size = (SH_Size + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SH_Size Greater than SH_MaxSize
-
Then - Actions
- Set SH_Index[SH_Size] = SH_Size
- Set SH_MaxSize = SH_Size
- Else - Actions
-
If - Conditions
- Set TempInt = SH_Index[SH_Size]
- Set TempLoc = (Position of (Triggering unit))
- Set TempLoc2 = (Target point of ability being cast)
- Set SH_Caster[TempInt] = (Triggering unit)
- Unit - Create 1 SH_Dummy for (Owner of SH_Caster[TempInt]) at (Position of SH_Caster[TempInt]) facing (Angle from TempLoc to TempLoc2) degrees
- Set SH_Dummy[TempInt] = (Last created unit)
- Set SH_Angle[TempInt] = (Angle from TempLoc to TempLoc2)
- Set SH_Dur[TempInt] = 5.00
- Set SH_Damage[TempInt] = ((Real((Level of Stone Throw for SH_Caster[TempInt]))) x 200.00)
- Set SH_Speed[TempInt] = 10.00
- Set SH_AOE[TempInt] = 200.00
- Custom script: call RemoveLocation(udg_TempLoc)
- Custom script: call RemoveLocation(udg_TempLoc2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Stone Throw Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer SH_Loop) from 1 to SH_Size, do (Actions)
-
Loop - Actions
- Set TempInt = SH_Index[SH_Loop]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SH_Dur[TempInt] Greater than 0.00
-
Then - Actions
- Set TempLoc = ((Position of SH_Dummy[TempInt]) offset by SH_Speed[TempInt] towards SH_Angle[TempInt] degrees)
- Unit - Move SH_Dummy[TempInt] instantly to TempLoc, facing SH_Angle[TempInt] degrees
- Special Effect - Create a special effect at TempLoc using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
- Special Effect - Destroy (Last created special effect)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at TempLoc of type Walkability is off) Equal to True
-
Then - Actions
-
Unit Group - Pick every unit in (Units within SH_AOE[TempInt] of TempLoc) and do (Actions)
-
Loop - Actions
- Set SH_TempUnit[TempInt] = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (SH_TempUnit[TempInt] belongs to an enemy of (Owner of SH_Caster[TempInt])) Equal to True
- (SH_TempUnit[TempInt] is alive) Equal to True
- (SH_TempUnit[TempInt] is A structure) Equal to False
- (SH_TempUnit[TempInt] is A flying unit) Equal to False
-
Then - Actions
- Unit - Cause SH_Caster[TempInt] to damage SH_TempUnit[TempInt], dealing SH_Damage[TempInt] damage of attack type Chaos and damage type Normal
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Set SH_Dur[TempInt] = 0.00
-
Unit Group - Pick every unit in (Units within SH_AOE[TempInt] of TempLoc) and do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: set bj_wantDestroyGroup=true
-
Unit Group - Pick every unit in (Units within SH_AOE[TempInt] of TempLoc) and do (Actions)
-
Loop - Actions
- Set SH_TempUnit[TempInt] = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (SH_TempUnit[TempInt] belongs to an enemy of (Owner of SH_Caster[TempInt])) Equal to True
- (SH_TempUnit[TempInt] is alive) Equal to True
- (SH_TempUnit[TempInt] is A structure) Equal to False
- (SH_TempUnit[TempInt] is A flying unit) Equal to False
-
Then - Actions
- Unit - Cause SH_Caster[TempInt] to damage SH_TempUnit[TempInt], dealing SH_Damage[TempInt] damage of attack type Chaos and damage type Normal
- Set SH_Dur[TempInt] = 0.00
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Set SH_Dur[TempInt] = (SH_Dur[TempInt] - 0.03)
- Custom script: call RemoveLocation(udg_TempLoc)
-
Else - Actions
- Unit - Kill SH_Dummy[TempInt]
- Set SH_Index[SH_Loop] = SH_Index[SH_Size]
- Set SH_Index[SH_Size] = TempInt
- Set SH_Size = (SH_Size - 1)
- Set SH_Loop = (SH_Loop - 1)
- -------- Turn the trigger again off if the index_size is below 0... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SH_Size Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Skip remaining actions
- Else - Actions
-
If - Conditions
-
If - Conditions
-
Loop - Actions
-
For each (Integer SH_Loop) from 1 to SH_Size, do (Actions)
-
Events
- Unit - Cause SH_Caster[TempInt] to damage SH_TempUnit[TempInt], dealing SH_Damage[TempInt] damage of attack type Chaos and damage type Normal
Thanks!