- Joined
- Jul 19, 2007
- Messages
- 824
I can't find the problem why this triggered ability gets bugged sometimes.
Projects a powerful magical blast in a targeted area, dealing 1x/2x/3x/4x intelligence damage and knocks back enemy land units with the distance of 250.
The bug doesn't happening everytime I'm casting the spell it just happening sometimes but it really needs to be solved.. The bug causes the spell to randomly pick an unit within the AOE of the spell and stunning until something kills it and it can even be happening on the casting unit too! The spell is mean't to only damage and knockback enemy units and it does work like it should when it doesn't make the mysterious stunning-bug..
Here is the triggers.
Projects a powerful magical blast in a targeted area, dealing 1x/2x/3x/4x intelligence damage and knocks back enemy land units with the distance of 250.
The bug doesn't happening everytime I'm casting the spell it just happening sometimes but it really needs to be solved.. The bug causes the spell to randomly pick an unit within the AOE of the spell and stunning until something kills it and it can even be happening on the casting unit too! The spell is mean't to only damage and knockback enemy units and it does work like it should when it doesn't make the mysterious stunning-bug..
Here is the triggers.
-
Invisible Force
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Invisible Force
-
Actions
- Set TempLoc1 = (Target point of ability being cast)
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 400,00 of TempLoc1) 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 (Triggering player)) Equal to True
- ((Picked unit) is Magic Immune) Equal to False
- ((Picked unit) is dead) Equal to False
-
Then - Actions
- Set TempUnit1 = (Picked unit)
- Set TempLoc2 = (Position of TempUnit1)
- Custom script: set udg_TempInt1 = GetHandleId(udg_TempUnit1)
- -------- Deal Damage --------
- Unit - Cause (Triggering unit) to damage TempUnit1, dealing (Real(((Level of Invisible Force for (Triggering unit)) x (Intelligence of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal
- -------- Stun Unit --------
- Set SS_Unit_Target = TempUnit1
- Set SS_Real_Duration = 1,00
- Set SS_Boolean_Stack = False
- Set SS_Real_Distance = (Random real number between 1,00 and 300,00)
- Custom script: call ExecuteFunc("StunSystem_Run")
- -------- Add Knockback --------
- Special Effect - Create a special effect attached to the origin of TempUnit1 using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
- Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of TempInt1 in Knockback_Hash
- Hashtable - Save 0,00 as (Key loop) of TempInt1 in Knockback_Hash
- Hashtable - Save 0,00 as (Key offset) of TempInt1 in Knockback_Hash
- Hashtable - Save (Angle from TempLoc1 to TempLoc2) as (Key angle) of TempInt1 in Knockback_Hash
- Unit Group - Add TempUnit1 to Knockback_Group
- Custom script: call RemoveLocation(udg_TempLoc2)
- Trigger - Turn on Knockback <gen>
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_TempLoc1)
-
Events
-
Knockback
-
Events
- Time - Every 0,03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Knockback_Group and do (Actions)
-
Loop - Actions
- Set Temp_Unit_1 = (Picked unit)
- Set Temp_Real_1 = (Load (Key loop) of (Key (Picked unit)) from Knockback_Hash)
- -------- -------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Temp_Real_1 Less than or equal to (Knockback_Time x (1,00 / 0,03))
-
Then - Actions
- Set Temp_Loc_1 = (Position of Temp_Unit_1)
- -------- -------------------- --------
- Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from Knockback_Hash)
- -------- -------------------- --------
- Set Temp_Real_3 = (Knockback_Speed x (Power(0,90, Temp_Real_1)))
- -------- -------------------- --------
- Set Temp_Real_4 = (X of Temp_Loc_1)
- Set Temp_Real_5 = (Y of Temp_Loc_1)
- -------- -------------------- --------
- Set Temp_Real_4 = ((X of Temp_Loc_1) + (Temp_Real_3 x (Cos(Temp_Real_2))))
- Set Temp_Real_5 = ((Y of Temp_Loc_1) + (Temp_Real_3 x (Sin(Temp_Real_2))))
- -------- -------------------- --------
- Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5))
- -------- -------------------- --------
- Custom script: set udg_Boolean = IsTerrainWalkable(udg_Temp_Loc_2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Boolean Equal to True
-
Then - Actions
- Custom script: call SetUnitX(udg_Temp_Unit_1, udg_Temp_Real_4)
- Custom script: call SetUnitY(udg_Temp_Unit_1, udg_Temp_Real_5)
- Else - Actions
-
If - Conditions
- -------- -------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Knockback_Rotate Equal to True
- (Random integer number between 1 and 4) Equal to 1
-
Then - Actions
- Unit - Make Temp_Unit_1 face ((Facing of Temp_Unit_1) - 180,00) over 0,00 seconds
- Else - Actions
-
If - Conditions
- -------- -------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Knockback_DoT Equal to True
-
Then - Actions
- Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Knockback_Hash)
- Set Temp_Real_2 = (Load (Key dmg) of (Key (Picked unit)) from Knockback_Hash)
- Unit - Cause Temp_Unit_2 to damage Temp_Unit_1, dealing Temp_Real_2 damage of attack type Spells and damage type Normal
- Else - Actions
-
If - Conditions
- -------- -------------------- --------
- Hashtable - Save (Temp_Real_1 + 1,00) as (Key loop) of (Key (Picked unit)) in Knockback_Hash
- -------- -------------------- --------
- Custom script: call RemoveLocation(udg_Temp_Loc_1)
- Custom script: call RemoveLocation(udg_Temp_Loc_2)
-
Else - Actions
- -------- -------------------- --------
- Special Effect - Destroy (Load (Key effect_1) of (Key (Picked unit)) in Knockback_Hash)
- -------- -------------------- --------
- Unit Group - Remove Temp_Unit_1 from Knockback_Group
- -------- -------------------- --------
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Knockback_Hash
- -------- -------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in Knockback_Group) Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in Knockback_Group and do (Actions)
-
Events
Last edited: