• 🏆 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] Spell for +5 agi on %

Status
Not open for further replies.
Level 8
Joined
Aug 3, 2008
Messages
257
Hey so i'm workin on a spell that will on hit have a 10% chance on the first lvl 15% chance on the 2nd and 20% chance on the 3rd lvl. what it does is stack to 5. and for each stack it adds +5 agility and lasts only 10 seconds. uhm does anyone know how to set the trigger on this i've tried a few ways.

  • Advance Agility
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • 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
              • ((Attacking unit) has buff Advance Agility ) Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to False
            • Then - Actions
              • Set ASUnit = (Attacking unit)
              • Set ASAgi = (Agility of ASUnit (Exclude bonuses))
              • Hero - Modify Agility of ASUnit: Add 5
              • Trigger - Turn on Reset AS <gen>
            • Else - Actions
              • Wait 10.00 seconds
              • Hero - Modify Agility of ASUnit: Set to ASAgi
              • Trigger - Turn off (This trigger)
My friend came up with that and it doesn't work. Its messy and yeah it doesn't work lol but if u got any ideas or know how that'd be cool thanks.
 
You have two huge problems:

1. There's no multi-unit support. If there is more than one hero weilding this, the variable will point back and forth between the two and you'll see some whacky bugs.

2. This system can be hacked by spamming "a+click" on a unit then "s", so that a player can launch ten attacks in a split second and get himself a LOT of free agility.
 
Your wait period is causing problems of its own. If you "wait" on each hit, the system's not going to reset itself properly. You need to have a way to cancel previous "waits" because you've basically added a queue that will mess everything up. The best way to do it is by using a Timer instead of a wait, that way you're just restarting the same timer and don't have any weird complications.
 
Status
Not open for further replies.
Top