• 🏆 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] Then actions inside loop are always running

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hi Hivers, I'm currently working on a simple trigger that creates a dummy and casts forked lightning based on your agility, however for some reason my loop if/el/then statement seems to trigger all the time, even when not meeting conditions (so I assume). My character has 10 agility, but seems to trigger all 10 loops, meaning it should only trigger the first loop. Can anyone see the problem?

(Ignore the game display actions I was using that to try figure out what was wrong)

  • Artifact Sword Scorn
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Random integer number between 1 and 3) Equal to 1
      • (DamageEventSource has an item of type |c00FF7F00Winters Scorn|r) Equal to True
    • Actions
      • Set abilityloc = (Position of DamageEventSource)
      • Unit - Create 1 Dummy Unit for (Owner of DamageEventSource) at abilityloc facing Default building facing degrees
      • Set abilitydummy = (Last created unit)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Agility of DamageEventSource (Include bonuses)) Greater than abilityarklightningagility[(abilityarklightningagility[(Integer A)] - 1)]
              • (Agility of DamageEventSource (Include bonuses)) Less than or equal to abilityarklightningagility[(Integer A)]
            • Then - Actions
              • Game - Display to (All players) the text: (String(abilityarklightningagility[((Integer A) - 1)]))
              • Game - Display to (All players) the text: (String((Agility of DamageEventSource (Include bonuses))))
              • Game - Display to (All players) the text: (String(abilityarklightningagility[(Integer A)]))
              • Unit - Add abilityarklightning[(Integer A)] to abilitydummy
            • Else - Actions
      • Unit - Add a 0.25 second Generic expiration timer to abilitydummy
      • Unit - Order abilitydummy to Neutral Naga Sea Witch - Forked Lightning DamageEventTarget
      • Custom script: call RemoveLocation(udg_abilityloc)
      • Set abilitydummy = No unit

  • Ability Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set abilityarklightning[1] = Ark Lightning (1-20)
      • Set abilityarklightning[2] = Ark Lightning (21-40)
      • Set abilityarklightning[3] = Ark Lightning (41-60)
      • Set abilityarklightning[4] = Ark Lightning (61-80)
      • Set abilityarklightning[5] = Ark Lightning (81-100)
      • Set abilityarklightning[6] = Ark Lightning (101-120)
      • Set abilityarklightning[7] = Ark Lightning (121-140)
      • Set abilityarklightning[8] = Ark Lightning (141-160)
      • Set abilityarklightning[9] = Ark Lightning (161-180)
      • Set abilityarklightning[10] = Ark Lightning (181-200)
      • Set abilityarklightningagility[0] = 0
      • Set abilityarklightningagility[1] = 20
      • Set abilityarklightningagility[2] = 40
      • Set abilityarklightningagility[3] = 60
      • Set abilityarklightningagility[4] = 80
      • Set abilityarklightningagility[5] = 100
      • Set abilityarklightningagility[6] = 120
      • Set abilityarklightningagility[7] = 140
      • Set abilityarklightningagility[8] = 160
      • Set abilityarklightningagility[9] = 180
      • Set abilityarklightningagility[10] = 200

Any help on the matter would be appreciated
 
Last edited:
Status
Not open for further replies.
Top