- Joined
- Jul 19, 2007
- Messages
- 856
Well I've been posting this bug before but didn't get some clear help to find out what was wrong with this spell because it seems to for some unknown reason pick a random unit doesn't matter if it's allied, enemy or self it just picks a random unit in the target area and stunning it forever until it's killed. The spell is meant to knockback enemy units in the targeted area and stunning the during the short time they are knocked back and it seems to work fine except the mysterious perma stunning bug which doesn't happening everytime the spell is casted it actually happening only some few times during a gameplay like 15% times the spell is casted but still it's very annoying and ruins the gameplay alot... I just don't get how it can perma stunning the allies and even the casting hero
The spell is meant to only pick and target enemy units in the targeted area so why does it for some unknown reason still sometimes like 15% times the spell is casted, picking an allied unit or self if it's in the targeted area of the spell and perma stunning it forever until it's killed?? I haven't made this spell by myself and I'm kinda noobish at triggering :-/ So what could be the cause of this mysterious perma stunning bug? Please someone help! This gotta be solve for once...
This is the triggers of the spell.
This is the triggers of the spell.
-
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 350.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
-
((Picked unit) is A structure) 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 Magic
-
-------- 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
-
-
-
-
Custom script: call RemoveLocation(udg_TempLoc1)
-
-
-
Knockback Initialize
-
Events
-
Time - Elapsed game time is 0.00 seconds
-
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set Knockback_Hash = (Last created hashtable)
-
-------- -------------------- --------
-
-------- -------------------- --------
-
-------- How long the knockback lasts in seconds --------
-
-------- -------------------- --------
-
Set Knockback_Time = 1.00
-
-------- -------------------- --------
-
-------- Initial speed of the knockback --------
-
-------- -------------------- --------
-
Set Knockback_Speed = 30.00
-
-------- -------------------- --------
-
-------- Does the spell do damage over time --------
-
-------- -------------------- --------
-
Set Knockback_DoT = False
-
-------- -------------------- --------
-
-------- Does the ability add special effect on the unit --------
-
-------- -------------------- --------
-
Set Knockback_Effect = False
-
-------- -------------------- --------
-
-------- Do units rotate while knocked back --------
-
-------- -------------------- --------
-
Set Knockback_Rotate = True
-
-------- -------------------- --------
-
-------- If this is true, the spell pushes, if false, it pulls --------
-
-------- -------------------- --------
-
Set Knockback_Push = True
-
-------- -------------------- --------
-
-------- -------------------- --------
-
-
-
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 (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 (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
-
-
-------- -------------------- --------
-
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
-
-
-
-
-
-
-
-
ST Loop
-
Events
-
Time - Every 0.00 seconds of game time
-
-
Conditions
-
(Remaining time for ST_Timer) Equal to 0.00
-
-
Actions
-
For each (Integer ST_Loop) from 1 to ST_IndexMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(ST_Unit[ST_Loop] has buff PC_ConfStunBuff) Equal to False
-
-
Then - Actions
-
Unit - Order ST_Stunner to Human Mountain King - Storm Bolt ST_Unit[ST_Loop]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_Duration[ST_Loop] Greater than 0.00
-
-
Then - Actions
-
Set ST_Duration[ST_Loop] = (ST_Duration[ST_Loop] - 0.03)
-
-
Else - Actions
-
Unit - Remove PC_ConfStunBuff buff from ST_Unit[ST_Loop]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_Loop Not equal to ST_IndexMax
-
-
Then - Actions
-
Set ST_Duration[ST_Loop] = ST_Duration[ST_IndexMax]
-
Set ST_Unit[ST_Loop] = ST_Unit[ST_IndexMax]
-
-
Else - Actions
-
-
Set ST_IndexMax = (ST_IndexMax - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_IndexMax Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Set ST_Loop = (ST_Loop - 1)
-
-
-
-
-
-
-
Countdown Timer - Start ST_Timer as a One-shot timer that will expire in 0.03 seconds
-
-