Recently, I was working to make a spell. This spell upon cast, will calls down 3 lightning to strike on caster, the caster then focuses the energy to send 1(2 actually, but stacked up to make it look like 1) focused lightning beam to targeted enemy, dealing damage to it. But it happens to crash the game if i casts it several time. I'll post the triggers, can anyone out there help me to take a look it it has any leak?
-
Thunder Bolt Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Thunder Bolt
-
Actions
- Set TB_Caster = (Triggering unit)
- Set TB_Target = (Target unit of ability being cast)
- Set TB_Point = (Position of TB_Caster)
- Set TB_TempPoint = (TB_Point offset by (Random real number between 50.00 and 225.00) towards ((Facing of TB_Caster) + (Random real number between 90.00 and 270.00)) degrees)
- Set TB_Dmg = (((Real((Intelligence of TB_Caster (Include bonuses)))) x 1.20) + ((Real((Agility of TB_Caster (Include bonuses)))) x 0.80))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Less than or equal to 35
-
Then - Actions
- Set TB_Dmg = (TB_Dmg x 3.35)
- Else - Actions
-
If - Conditions
- Set TB_Dmg = (TB_Dmg / 2.00)
-
For each (Integer B) from 1 to 3, do (Actions)
-
Loop - Actions
- Unit - Create 1 Dummy [High] for (Owner of TB_Caster) at TB_TempPoint facing Default building facing degrees
- Unit - Add Thunder Bolt Dummy Effect to (Last created unit)
- Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TB_Caster
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_TB_TempPoint)
- Custom script: call SetUnitAnimationByIndex( gg_unit_H003_0004, 4 )
-
For each (Integer B) from 1 to 2, do (Actions)
-
Loop - Actions
- Set TB_TempPoint = (TB_Point offset by 50.00 towards ((Facing of TB_Caster) - 90.00) degrees)
- Unit - Create 1 Dummy for (Owner of TB_Caster) at TB_TempPoint facing Default building facing degrees
- Unit - Add Thunder Bolt Dummy Effect to (Last created unit)
- Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TB_Target
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Unit - Cause TB_Caster to damage TB_Target, dealing TB_Dmg damage of attack type Spells and damage type Normal
- Custom script: call RemoveLocation(udg_TB_TempPoint)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_TB_Point)
-
Events