• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Slow System not working correctly

Status
Not open for further replies.
Level 5
Joined
May 12, 2014
Messages
133
So in an effort to make things easier on myself and cleaner in the future, I attempted to make a slow system that revolves around adding custom Tornado Slow (Auras) to a unit

and then removing that custom Tornado Slow after x time.
Unfortunately, the system doesn't work as I hoped.
1) Sometimes the wrong debuff will be given to the unit.
2) Sometimes the wrong unit is given the special effect.
3) Sometimes a special effect doesn't get destroyed at the end when the unit is de-indexed.
4) Sometimes a unit doesn't get de-indexed at all when their slow should end.
5) When hitting multiple units at once (ex. War Stomp) and trying to use this, everything above occurs in the worst cases.
This is where I was adding custom tornado slows and their respective (de)buffs.
  • Slows and Debuffs Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- BEL - SPIRIT TOUCH --------
      • Set Slow_Spell[1] = Bel (Spirit Touch Debuff)
      • Set Slow_Debuff[1] = Spirit Touch Debuff
      • -------- CHARON - SHADOW CANNON --------
      • Set Slow_Spell[2] = Charon (Shadow Cannon Slow) [NEW]
      • Set Slow_Debuff[2] = Shadow Cannon (Tornado Slow)
      • -------- TRINITY - IMMENSE STRENGTH --------
      • Set Slow_Spell[3] = Charon (Shadow Cannon Slow) [NEW]
      • Set Slow_Debuff[3] = Shadow Cannon (Tornado Slow)
  • Slows and Debuffs
    • Events
      • Game - Slow_Event becomes Equal to 1.00
    • Conditions
    • Actions
      • Set Slow_Event = 0.00
      • Game - Display to (All players) the text: REGISTERED
      • Unit - Add Slow_Spell[SlowApp_Type] to SlowApp_T
      • Custom script: call UnitMakeAbilityPermanent(udg_SlowApp_T, true, udg_Slow_Spell[udg_SlowApp_Type])
      • Set Slow_Loop_Max = (Slow_Loop_Max + 1)
      • Set Slow_T[Slow_Loop_Max] = SlowApp_T
      • Set Slow_Timer[Slow_Loop_Max] = SlowApp_Timer
      • Set Slow_FX[Slow_Loop_Max] = SlowApp_FX
      • Set Slow_Type[Slow_Loop_Max] = SlowApp_Type
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Slow_Loop_Max Equal to 1
        • Then - Actions
          • Trigger - Turn on Slows and Debuffs Loop <gen>
        • Else - Actions
  • Slows and Debuffs Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Slow_Loop) from 1 to Slow_Loop_Max, do (Actions)
        • Loop - Actions
          • Set Slow_Timer[Slow_Loop] = (Slow_Timer[Slow_Loop] - 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Slow_T[Slow_Loop] is alive) Not equal to True
                  • Slow_Timer[Slow_Loop] Less than or equal to 0.00
            • Then - Actions
              • -------- RUN REAL EVENT HERE --------
              • Set Slow_Event_T = Slow_T[Slow_Loop]
              • Set Slow_Event_Type = Slow_Type[Slow_Loop]
              • Set Slow_Event = 2.00
              • Set Slow_Event = 0.00
              • -------- ------------------------------------------ --------
              • -------- REMOVE BUFF AND SPELL EFFECTS --------
              • Custom script: call UnitMakeAbilityPermanent(udg_Slow_T[udg_Slow_Loop], false, udg_Slow_Spell[udg_Slow_Type[udg_Slow_Loop]])
              • Unit - Remove Slow_Spell[Slow_Type[Slow_Loop]] from Slow_T[Slow_Loop]
              • Unit - Remove Slow_Debuff[Slow_Type[Slow_Loop]] buff from Slow_T[Slow_Loop]
              • Special Effect - Destroy Slow_FX[Slow_Loop]
              • -------- --------------------------------------------------------------- --------
              • -------- DE-INDEX --------
              • Game - Display to (All players) the text: DE-INDEX
              • Set Slow_Debuff[Slow_Loop] = Slow_Debuff[Slow_Loop_Max]
              • Set Slow_FX[Slow_Loop] = Slow_FX[Slow_Loop_Max]
              • Set Slow_Spell[Slow_Loop] = Slow_Spell[Slow_Loop_Max]
              • Set Slow_T[Slow_Loop] = Slow_T[Slow_Loop_Max]
              • Set Slow_Timer[Slow_Loop] = Slow_Timer[Slow_Loop_Max]
              • Set Slow_Type[Slow_Loop] = Slow_Type[Slow_Loop_Max]
              • -------- ----------------- --------
              • Set Slow_Loop = (Slow_Loop - 1)
              • Set Slow_Loop_Max = (Slow_Loop_Max - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Slow_Loop_Max Less than or equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: OFF
                  • Trigger - Turn off Slows and Debuffs Loop <gen>
                • Else - Actions
            • Else - Actions
Can someone help me to fix this so that I can use it properly? At the moment, there are only 3 created spells for this system to be used (They already have their own working spells, but I want to be able to merge everything into one triggers so that only one loop ever runs for slows). Every slow within my map is probably going to run off of this.
Notes:
- Slow_Event = 2.00 is used to extend into additional triggers if a slow has another effect after it has worn off. (Happens every time a unit is de-indexed)
- Slow_Event = 1.00 is used to register the unit into the system.

system.

"Bel's attacks and spells apply Spirit Touch to enemies for 7 seconds. Damaging an enemy affected by Spirit Touch will remove it, further damaging the enemy and healing Bel's mana."
  • Spirit Touch NEW
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (Unit-type of PDD_source) Equal to Hazy Spirit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Bel (Spirit Touch Debuff) for PDD_target) Equal to 1
        • Then - Actions
          • Set PDD_amount = (PDD_amount + (100.00 + (((Real((Agility of PDD_source (Include bonuses)))) x 0.10) + ((Real((Strength of PDD_source (Include bonuses)))) x 0.10))))
          • Unit - Set mana of PDD_source to ((Mana of PDD_source) + (10.00 + (((Max mana of PDD_source) - (Mana of PDD_source)) x 0.05)))
          • Special Effect - Create a special effect attached to the origin of PDD_target using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the chest of PDD_source using Abilities\Spells\Undead\ReplenishMana\SpiritTouchTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • For each (Integer Slow_Loop) from 1 to Slow_Loop_Max, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PDD_target Equal to Slow_T[Slow_Loop]
                • Then - Actions
                  • Set Slow_Timer[Slow_Loop] = 0.00
                • Else - Actions
        • Else - Actions
          • -------- THIS IS WHERE THE UNIT SHOULD GET THE SLOW/DEBUFF --------
          • Set SlowApp_T = PDD_target
          • Set SlowApp_Timer = 7.00
          • Special Effect - Create a special effect attached to the chest of PDD_target using Abilities\Spells\Orc\SpiritLink\SpiritLinkTarget.mdl
          • Set SlowApp_FX = (Last created special effect)
          • Set SlowApp_Type = 1
          • Set Slow_Event = 1.00
          • -------- --------------------------------------------------------------------------------------------------------- --------
 
Level 5
Joined
May 12, 2014
Messages
133
Lmao that works. Picked up Bannar's system and things are much easier now. Forgot my cruddy triggering xD
 
Status
Not open for further replies.
Top