• 🏆 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] I have failed at remaking my previous posted ability using Dynamic Index technique

Status
Not open for further replies.
Level 3
Joined
Apr 1, 2017
Messages
47
  • Hand of Protection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hand Of Protection
    • Actions
      • Set SB_Index = (SB_Index + 1)
      • Set Caster[SB_Index] = (Triggering unit)
      • Set Target[SB_Index] = (Target unit of ability being cast)
      • Set ZLVL[SB_Index] = (Level of Hand Of Protection for Caster[SB_Index])
      • Set Timer[SB_Index] = 0.00
      • Unit - Make Target[SB_Index] Invulnerable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SB_Index Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ZLVL[SB_Index] Equal to 1
            • Then - Actions
              • Trigger - Turn on T1 <gen>
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ZLVL[SB_Index] Equal to 2
                • Then - Actions
                  • Trigger - Turn on T2 <gen>
                • Else - Actions
                  • Trigger - Turn on T3 <gen>
            • Else - Actions
        • Else - Actions

  • T1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SB_Loop) from 1 to SB_Index, do (Actions)
        • Loop - Actions
          • Set Timer[SB_Loop] = (Timer[SB_Loop] + 1.00)
          • Game - Display to (All players) the text: (String(Timer[SB_Loop]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Timer[SB_Loop] Greater than or equal to 15.00
            • Then - Actions
              • Unit - Make Target[SB_Index] Vulnerable
              • Set Caster[SB_Loop] = Caster[SB_Index]
              • Set Target[SB_Loop] = Target[SB_Index]
              • Set Timer[SB_Loop] = Timer[SB_Index]
              • Set SB_Index = (SB_Index - 1)
              • Set SB_Loop = (SB_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SB_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

  • T1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SB_Loop) from 1 to SB_Index, do (Actions)
        • Loop - Actions
          • Set Timer[SB_Loop] = (Timer[SB_Loop] + 1.00)
          • Game - Display to (All players) the text: (String(Timer[SB_Loop]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Timer[SB_Loop] Greater than or equal to 30.00
            • Then - Actions
              • Unit - Make Target[SB_Index] Vulnerable
              • Set Caster[SB_Loop] = Caster[SB_Index]
              • Set Target[SB_Loop] = Target[SB_Index]
              • Set Timer[SB_Loop] = Timer[SB_Index]
              • Set SB_Index = (SB_Index - 1)
              • Set SB_Loop = (SB_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SB_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

  • T1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SB_Loop) from 1 to SB_Index, do (Actions)
        • Loop - Actions
          • Set Timer[SB_Loop] = (Timer[SB_Loop] + 1.00)
          • Game - Display to (All players) the text: (String(Timer[SB_Loop]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Timer[SB_Loop] Greater than or equal to 45.00
            • Then - Actions
              • Unit - Make Target[SB_Index] Vulnerable
              • Set Caster[SB_Loop] = Caster[SB_Index]
              • Set Target[SB_Loop] = Target[SB_Index]
              • Set Timer[SB_Loop] = Timer[SB_Index]
              • Set SB_Index = (SB_Index - 1)
              • Set SB_Loop = (SB_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SB_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

T1, T2, T3 are turned off by default.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Dont decrease the loop integer when the timer is done also with using muailtiple loop integers that use the same integer will cause issues

You only need 1 of the looping trigger and change the condition to timer greater than or =to 15 x zlvl [sb_loop]
 
Status
Not open for further replies.
Top