• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Thrash & Bash (Need help understanding what to do)

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
So, basically. What this spell is suppose to do:

EDIT: The timer does not appear to work. When it reaches ~30 on the timer, it doesn't do what it's suppose to do.

Which is remove the attack speed bonus, deindex the unit, and if the unit hasn't done any knockback yet it doesn't allow that to happen until the ability is cast again.

But that doesn't happen. /EDIT

1. Hero activates it.
1a. Hero attacks #% faster for the next three attacks.
2. Next three attacks do #% extra damage.
3. The third attack also knocks back the target being attacked.
4. This ability has 30 seconds to perform the attacks, otherwise it's just wasted mana.

For this spell, I am using two systems.

GUI Friendly Damage Detection System
Paladon's Lightning Strike (Ripped the Knockback system out of it)

Here are my Triggers:


  • ThrashBash Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Thrash & Bash
          • (Unit-type of (Triggering unit)) Equal to Grandmaster of Arms
        • Then - Actions
          • Set TBMaxIndex = (TBMaxIndex + 1)
          • Set TBCaster[TBMaxIndex] = (Triggering unit)
          • Set TBHitCount[TBMaxIndex] = 0
          • Set TBTimer[TBMaxIndex] = 0
          • Set TBAbilityStarted[TBMaxIndex] = True
          • Set TBCurrentCaster[TBMaxIndex] = (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Thrash & Bash for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Add T&B Attack Speed Bonus (Level 1) to (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Thrash & Bash for (Triggering unit)) Equal to 2
                • Then - Actions
                  • Unit - Add T&B Attack Speed Bonus (Level 2) to (Triggering unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Thrash & Bash for (Triggering unit)) Equal to 3
                    • Then - Actions
                      • Unit - Add T&B Attack Speed Bonus (Level 3) to (Triggering unit)
                    • Else - Actions
          • Trigger - Turn on ThrashBash Calc <gen>
          • Trigger - Turn on ThrashBash GetDamageAmount <gen>
          • Trigger - Turn on ThrashBash Knockback <gen>
        • Else - Actions


  • ThrashBash Knockback
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • For each (Integer TBInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to TBCaster[TBInit]
              • TBTimer[TBInit] Less than or equal to 165
            • Then - Actions
              • Set TBCurrentCaster[TBInit] = (Attacking unit)
              • Set TBHitCount[TBInit] = (TBHitCount[TBInit] + 1)
              • Set TBTargetUnit[TBInit] = (Attacked unit)
              • Set TBTargetPoint[TBInit] = (Position of (Attacking unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TBHitCount[TBInit] Equal to 3
                • Then - Actions
                  • Set TBAbilityStarted[TBInit] = False
                  • Unit - Remove T&B Attack Speed Bonus (Level 1) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 2) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 3) from TBCaster[TBInit]
                  • Set KBA_Caster = TBCaster[TBInit]
                  • Set KBA_TargetUnit = TBTargetUnit[TBInit]
                  • Set KBA_StartingPosition = TBTargetPoint[TBInit]
                  • Set KBA_Level = 0
                  • Set KBA_Speed = 20.00
                  • Set KBA_DistancePerLevel = 400.00
                  • Set KBA_SpecialEffects[1] = <Empty String>
                  • Set KBA_SpecialEffects[2] = <Empty String>
                  • Set KBA_DestroyTrees = False
                  • Trigger - Run Cast A Knockback <gen> (checking conditions)
                  • -------- DEINDEX --------
                  • Set TBUnitDeIndexer[TBInit] = TBCaster[TBInit]
                  • Trigger - Run ThrashBash Deindex <gen> (checking conditions)
                • Else - Actions
            • Else - Actions


  • ThrashBash GetDamageAmount
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • For each (Integer TBDamageInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GDD_DamageSource Equal to TBCaster[TBDamageInit]
              • TBAbilityStarted[TBDamageInit] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Thrash & Bash for TBCaster[TBInit]) Equal to 1
                • Then - Actions
                  • Set TBDamageAmount[TBDamageInit] = (GDD_Damage x 0.25)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Thrash & Bash for TBCaster[TBInit]) Equal to 2
                    • Then - Actions
                      • Set TBDamageAmount[TBDamageInit] = (GDD_Damage x 0.50)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Thrash & Bash for TBCaster[TBInit]) Equal to 3
                        • Then - Actions
                          • Set TBDamageAmount[TBDamageInit] = (GDD_Damage x 0.75)
                        • Else - Actions
              • Trigger - Turn off (This trigger)
              • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing TBDamageAmount[TBDamageInit] damage of attack type Normal and damage type Normal
              • Trigger - Turn on (This trigger)
            • Else - Actions


  • ThrashBash Calc
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TBTimerInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TBCaster[TBTimerInit] Equal to TBCurrentCaster[TBTimerInit]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TBTimer[TBTimerInit] Less than or equal to 164
                • Then - Actions
                  • Set TBTimer[TBTimerInit] = (TBTimer[TBTimerInit] + 1)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TBTimer[TBTimerInit] Greater than or equal to 165
                • Then - Actions
                  • -------- DEINDEX --------
                  • Unit - Remove T&B Attack Speed Bonus (Level 1) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 2) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 3) from TBCaster[TBInit]
                  • Set TBAbilityStarted[TBTimerInit] = False
                  • Set TBUnitDeIndexer[TBTimerInit] = TBCaster[TBTimerInit]
                  • Trigger - Run ThrashBash Deindex <gen> (checking conditions)
                • Else - Actions
            • Else - Actions


  • ThrashBash Deindex
    • Events
    • Conditions
    • Actions
      • For each (Integer TBDeindexInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TBCaster[TBDeindexInit] Equal to TBUnitDeIndexer[TBDeindexInit]
            • Then - Actions
              • Set TBCaster[TBDeindexInit] = TBCaster[TBMaxIndex]
              • Set TBCaster[TBMaxIndex] = No unit
              • Set TBHitCount[TBDeindexInit] = TBHitCount[TBMaxIndex]
              • Set TBHitCount[TBMaxIndex] = 0
              • Set TBTimer[TBDeindexInit] = TBTimer[TBMaxIndex]
              • Set TBTimer[TBMaxIndex] = 0
              • Set TBAbilityStarted[TBDeindexInit] = TBAbilityStarted[TBMaxIndex]
              • Set TBAbilityStarted[TBMaxIndex] = False
              • Set TBTargetUnit[TBDeindexInit] = TBTargetUnit[TBMaxIndex]
              • Set TBTargetUnit[TBMaxIndex] = No unit
              • Set TBTargetPoint[TBDeindexInit] = TBTargetPoint[TBMaxIndex]
              • Custom script: set udg_TBTargetPoint[udg_TBMaxIndex] = null
              • Set TBMaxIndex = (TBMaxIndex - 1)
            • Else - Actions


After this, I have no idea what to do...Maybe someone can help me learn how I can reduce the number of triggers here?
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
Er, sorry. Forgot to mention my issue.

The timer does not appear to work. When it reaches ~30 on the timer, it doesn't do what it's suppose to do.

Which is remove the attack speed bonus, deindex the unit, and if the unit hasn't done any knockback yet it doesn't allow that to happen until the ability is cast again.

But that doesn't happen.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If you want to shortening spell, if your damage bonus is constant you can add a damage bonus ability with your attack speed ability and remove them together so you can get rid of Extra Damage trigger.


TB Calc trigger

  • If - Conditions
    • TBCaster[TBTimerInit] Equal to TBCurrentCaster[TBTimerInit]
I would say this condition is pointless because TBCaster is always equal to TBCurrentCaster...


  • If - Conditions
    • TBTimer[TBTimerInit] Less than or equal to 164
This trigger is running every 0.03 seconds.You are incrementing TBTimer variable by +1 every 0.03 seconds = ~+33 at every second.Currently this is counting 5 seconds, to counting 30 seconds this should be TBTimer less than or equal to 1000.(0.03 * 1000 = 30 anyways)


  • Unit - Remove T&B Attack Speed Bonus (Level 1) from TBCaster[TBInit]
  • Unit - Remove T&B Attack Speed Bonus (Level 2) from TBCaster[TBInit]
  • Unit - Remove T&B Attack Speed Bonus (Level 3) from TBCaster[TBInit]
These TBInits must be TBTimerInit


Also you should make your deindexing stuff inside TB Calc trigger because this makes it easier to code.Extra trigger for it actually okey but the main problem is you are complicating deindexing by adding another variable loop.If you need more please post last version of Calc trigger.
 
Level 12
Joined
May 20, 2009
Messages
822
Actually, I forgot I changed it to 5 seconds. The 165 is intentional for ~5 seconds...

These are the changes made. I will test them in a few moments.

  • ThrashBash Knockback
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • For each (Integer TBInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to TBCaster[TBInit]
              • TBTimer[TBInit] Less than or equal to 165
            • Then - Actions
              • Set TBCurrentCaster[TBInit] = (Attacking unit)
              • Set TBHitCount[TBInit] = (TBHitCount[TBInit] + 1)
              • Set TBTargetUnit[TBInit] = (Attacked unit)
              • Set TBTargetPoint[TBInit] = (Position of (Attacking unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TBHitCount[TBInit] Equal to 3
                • Then - Actions
                  • Set TBAbilityStarted[TBInit] = False
                  • Unit - Remove T&B Attack Speed Bonus (Level 1) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 2) from TBCaster[TBInit]
                  • Unit - Remove T&B Attack Speed Bonus (Level 3) from TBCaster[TBInit]
                  • Set KBA_Caster = TBCaster[TBInit]
                  • Set KBA_TargetUnit = TBTargetUnit[TBInit]
                  • Set KBA_StartingPosition = TBTargetPoint[TBInit]
                  • Set KBA_Level = 0
                  • Set KBA_Speed = 20.00
                  • Set KBA_DistancePerLevel = 400.00
                  • Set KBA_SpecialEffects[1] = <Empty String>
                  • Set KBA_SpecialEffects[2] = <Empty String>
                  • Set KBA_DestroyTrees = False
                  • Trigger - Run Cast A Knockback <gen> (checking conditions)
                  • -------- DEINDEX --------
                  • Set TBUnitDeIndexer[TBInit] = TBCaster[TBInit]
                  • Trigger - Run ThrashBash Calc <gen> (ignoring conditions)
                • Else - Actions
            • Else - Actions
  • ThrashBash Calc
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TBTimerInit) from 1 to TBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TBTimer[TBTimerInit] Less than or equal to 164
            • Then - Actions
              • Set TBTimer[TBTimerInit] = (TBTimer[TBTimerInit] + 1)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TBTimer[TBTimerInit] Greater than or equal to 165
            • Then - Actions
              • -------- DEINDEX --------
              • Unit - Remove T&B Attack Speed Bonus (Level 1) from TBCaster[TBTimerInit]
              • Unit - Remove T&B Attack Speed Bonus (Level 2) from TBCaster[TBTimerInit]
              • Unit - Remove T&B Attack Speed Bonus (Level 3) from TBCaster[TBTimerInit]
              • Set TBAbilityStarted[TBTimerInit] = False
              • Set TBUnitDeIndexer[TBTimerInit] = TBCaster[TBTimerInit]
              • Set TBCaster[TBDeindexInit] = TBCaster[TBMaxIndex]
              • Set TBCaster[TBMaxIndex] = No unit
              • Set TBHitCount[TBDeindexInit] = TBHitCount[TBMaxIndex]
              • Set TBHitCount[TBMaxIndex] = 0
              • Set TBTimer[TBDeindexInit] = TBTimer[TBMaxIndex]
              • Set TBTimer[TBMaxIndex] = 0
              • Set TBAbilityStarted[TBDeindexInit] = TBAbilityStarted[TBMaxIndex]
              • Set TBAbilityStarted[TBMaxIndex] = False
              • Set TBTargetUnit[TBDeindexInit] = TBTargetUnit[TBMaxIndex]
              • Set TBTargetUnit[TBMaxIndex] = No unit
              • Set TBTargetPoint[TBDeindexInit] = TBTargetPoint[TBMaxIndex]
              • Custom script: set udg_TBTargetPoint[udg_TBMaxIndex] = null
              • Set TBMaxIndex = (TBMaxIndex - 1)
            • Else - Actions
Solu9 said:
Where is the "Cast A Knockback" trigger?
The "Cast A Knockback" trigger is Paladon's Knockback system. Here it is, if you think it's important:


  • Cast A Knockback
    • 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_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 GetKnockback <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 GetKnockback <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KBA_Level Equal to 0
        • Then - Actions
          • Set KBA_Level = 1
        • Else - Actions
      • Set KB_CountBuffs = (KB_CountBuffs + 1)
      • Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
      • Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
      • 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
      • 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] )
  • GetKnockback
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • 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
              • (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - 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_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)
                  • 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
                      • (Random integer number between 1 and 5) Equal to 1
                    • Then - Actions
                      • 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
                      • (Random integer number between 1 and 7) Equal to 1
                    • Then - Actions
                      • 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



As a little added thing, these are the changes I made to Paladon's Jump system. I added a LandEvent to his system, so you can always pick up exactly when a unit lands from jumping, and then continue your spell from that point on.

  • Jump System 2
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer JD_Integers[3]) from 1 to JD_Integers[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (JD_Unit[JD_Integers[3]] is in JD_Group) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
                • Then - Actions
                  • Animation - Queue JD_Unit[JD_Integers[3]]'s JD_Animations[JD_Integers[3]] animation
                  • Set JD_TempPoint[1] = (Position of JD_Unit[JD_Integers[3]])
                  • Set JD_TempPoint[2] = (JD_TempPoint[1] offset by JD_SpeedUnits[JD_Integers[3]] towards JD_Angle[JD_Integers[3]] degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • JD_TreesDestroy[JD_Integers[3]] Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within 150.00 of JD_TempPoint[2] and do (Destructible - Kill (Picked destructible))
                    • Else - Actions
                  • Unit - Move JD_Unit[JD_Integers[3]] instantly to JD_TempPoint[2]
                  • Set JD_ReachedDistance[JD_Integers[3]] = (JD_ReachedDistance[JD_Integers[3]] + JD_SpeedUnits[JD_Integers[3]])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 5) Equal to 1
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the chest of JD_Unit[JD_Integers[3]] using JD_Effect[JD_Integers[3]]
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • Set JD_RealTimer[JD_Integers[3]] = (JD_RealTimer[JD_Integers[3]] + (180.00 / (JD_Distances[JD_Integers[3]] / JD_SpeedUnits[JD_Integers[3]])))
                  • Set JD_JumpHigh[JD_Integers[3]] = ((Sin(JD_RealTimer[JD_Integers[3]])) x JD_HighSettings[JD_Integers[3]])
                  • Animation - Change JD_Unit[JD_Integers[3]] flying height to JD_JumpHigh[JD_Integers[3]] at 1000000000.00
                  • Custom script: call RemoveLocation (udg_JD_TempPoint[1])
                  • Custom script: call RemoveLocation (udg_JD_TempPoint[2])
                • Else - Actions
                  • Set JD_LandEventArray[JD_Integers[3]] = 1.00 //Here is where I added things. These 7 extra lines of code create a new event.
                  • Set JD_LandedCache = JD_LandingUnit
                  • Set JD_LandingUnit = JD_Unit[JD_Integers[3]]
                  • Set JD_LandEvent = 1.00
                  • Set JD_LandEvent = 0.00
                  • Set JD_LandEventArray[JD_Integers[3]] = 0.00
                  • Set JD_LandingUnit = JD_LandedCache //Here is where the added things stop.
                  • Unit - Turn collision for JD_Unit[JD_Integers[3]] On
                  • Unit Group - Remove JD_Unit[JD_Integers[3]] from JD_Group
                  • Animation - Change JD_Unit[JD_Integers[3]]'s animation speed to 100.00% of its original speed
                  • Animation - Reset JD_Unit[JD_Integers[3]]'s animation
                  • Set JD_RealTimer[JD_Integers[3]] = 0.00
                  • Set JD_Integers[1] = (JD_Integers[1] - 1)
                  • -------- Spell-Specific Code --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • JD_Integers[1] Equal to 0
                    • Then - Actions
                      • Set JD_Integers[2] = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
            • Else - Actions
To use the Event, you do "Game - JD_LandEvent becomes Equal to 1.00" I don't think you can use Triggering Unit for this, though. Just use the "JD_LandingUnit"
 
Status
Not open for further replies.
Top