- Joined
- Jul 25, 2009
- Messages
- 194
Anyone see anything suspicious with this knockback system? I noticed someone desynced while a unit was getting knockbacked against a wall. Thanks!
-
Events
-
Conditions
-
Actions
-

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-


If - Conditions
-



(KBA_TargetUnit is in KB_KnockbackedUnits) Equal to True
-
-


Then - Actions
-



Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
-



Set KB_CountBuffs = (KB_CountBuffs - 1)
-



For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
-




Loop - Actions
-





If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-






If - Conditions
-







KB_Units[KB_GeneralIntegers[1]] Equal to KBA_TargetUnit
-
-






Then - Actions
-







Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
-







Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
-
-






Else - Actions
-
-
-
-



If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-




If - Conditions
-





KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
-
-




Then - Actions
-





Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
-





Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
-





Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
-





Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
-





Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
-





Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
-





Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
-





Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
-





Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
-





Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
-





Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
-





Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
-





Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
-
-




Else - Actions
-
-



Set KB_Units[KB_TotalKnockUnits] = No unit
-



Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
-



If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-




If - Conditions
-





KB_CountBuffs Equal to 0
-
-




Then - Actions
-





Set KB_TotalKnockUnits = 0
-





Trigger - Turn off Get Knockback <gen>
-
-




Else - Actions
-
-
-


Else - Actions
-
-

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-


If - Conditions
-



KB_CountBuffs Equal to 0
-
-


Then - Actions
-



Trigger - Turn on Get Knockback <gen>
-
-


Else - Actions
-
-

Set KB_CountBuffs = (KB_CountBuffs + 1)
-

Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
-

Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
-

Set KB_Max[KB_TotalKnockUnits] = 0
-

Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
-

Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
-

Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
-

Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
-

Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
-

Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
-

Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
-

Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
-

Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
-

Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
-

Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
-

Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
-

Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
-

Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
-

Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
-

Custom script: call RemoveLocation (udg_KBA_StartingPosition)
-

Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
-

Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
-
-
Events
-

Time - Every 0.02 seconds of game time
-
-
Conditions
-
Actions
-

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-


If - Conditions
-



Debug_Mode Equal to True
-
-


Then - Actions
-



Set Spell_Running[35] = True
-
-


Else - Actions
-
-

For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
-


Loop - Actions
-



If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-




If - Conditions
-




Then - Actions
-





If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-






If - Conditions
-







Or - Any (Conditions) are true
-








Conditions
-









KB_ReachedDistance[KB_GeneralIntegers[1]] Greater than or equal to KB_MaxDistance[KB_GeneralIntegers[1]]
-
-
-
-






Then - Actions
-







Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
-







Set KB_CountBuffs = (KB_CountBuffs - 1)
-







If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-








If - Conditions
-









KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
-
-








Then - Actions
-









Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
-









Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
-









Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
-









Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
-









Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
-









Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
-









Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
-









Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
-









Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
-









Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
-









Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
-









Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
-









Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
-
-








Else - Actions
-
-







Set KB_Units[KB_TotalKnockUnits] = No unit
-







Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
-







If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-








If - Conditions
-









KB_CountBuffs Equal to 0
-
-








Then - Actions
-









Set KB_TotalKnockUnits = 0
-









Trigger - Turn off (This trigger)
-
-








Else - Actions
-
-
-






Else - Actions
-







Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
-







Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
-







Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
-







Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
-







Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
-







Set KB_EffectCounter[KB_GeneralIntegers[1]] = (KB_EffectCounter[KB_GeneralIntegers[1]] + 1)
-







Set KB_EffectCounter2[KB_GeneralIntegers[1]] = (KB_EffectCounter2[KB_GeneralIntegers[1]] + 1)
-







If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-








If - Conditions
-









KB_DestroyTrees[KB_GeneralIntegers[1]] Equal to True
-
-








Then - Actions
-









Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
-










Loop - Actions
-











Destructible - Kill (Picked destructible)
-
-
-
-








Else - Actions
-
-







If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-








If - Conditions
-









KB_EffectCounter[KB_GeneralIntegers[1]] Equal to 6
-
-








Then - Actions
-









Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
-









Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
-









Special Effect - Destroy (Last created special effect)
-
-








Else - Actions
-
-







If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-








If - Conditions
-









KB_EffectCounter2[KB_GeneralIntegers[1]] Equal to 8
-
-








Then - Actions
-









Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
-









Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
-









Special Effect - Destroy (Last created special effect)
-
-








Else - Actions
-
-







Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
-







Custom script: call RemoveLocation (udg_KB_TempPoint[1])
-







Custom script: call RemoveLocation (udg_KB_TempPoint[2])
-







Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
-
-
-
-




Else - Actions
-
-
-
-
