• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger For %Attribute Increases Not Running

Level 1
Joined
Apr 29, 2025
Messages
2
Hi, I'm currently stumped on why this trigger isn't working. Currently it doesn't modify any attributes, despite the units having the buff.
Ideally its a passive aura that increases other heroes Strength and Agility by 10%

Below this trigger is a spellbook which has the passive aura (Blessing of Might)
  • Blessing of Might Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Retribution Paladin Passive Abilities
    • Actions
      • Set BlessingOfMightSourceUnit = (Learning Hero)
      • Unit Group - Add BlessingOfMightSourceUnit to BlessingOfMightSourceGroup
      • Trigger - Turn on Blessing of Might Loop <gen>
Loop Trigger (initially off)
  • Blessing of Might Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Blessing of Might ) Equal to True
            • Then - Actions
              • Set CurrentAgility = (Agility of (Picked unit) (Include bonuses))
              • Set CurrentStrength = (Strength of (Picked unit) (Include bonuses))
              • Set BonusAgility = (CurrentAgility x (Integer(1.10)))
              • Set BonusStrength = (CurrentStrength x (Integer(1.10)))
              • Hero - Modify Agility of (Picked unit): Add BonusAgility.
              • Hero - Modify Strength of (Picked unit): Add BonusStrength.
              • Unit Group - Add (Picked unit) to BlessingOfMightTargetGroup
            • Else - Actions
      • Destroy BlessingOfMightSourceGroup
      • Destroy BlessingOfMightTargetGroup
I haven't made a removal trigger yet, figuring I'd want to get the initial loop trigger working first. Appreciate any ideas what I'm doing wrong.
Thx!
 
You might want to check our spells & systems section for an aura system: Custom Warcraft 3 Spells & Systems GUI / JASS / Lua

And potentially a "BonusMod" for giving the bonus agility and strength (that way it'll appear as a green bonus, e.g. "+7").

Both those systems are rather complex. For the aura system, you have to track when units "enter" range and "leave" range to apply/remove the buff and benefits--which can be a bit tricky to manage without some advanced triggers. But if your aura has an infinite range, it might not be as bad to trigger it manually. As for the "BonusMod"--that is optional--but it is a nice UI feature that'll allow your players to see what benefits the aura is granting. :)

As for your trigger, I'm not sure why it isn't working exactly--but you should try adding some game messages to it (Game - Text Message) to make sure that it is running the way you expect. If the code is running correctly, I expect it would keep increasing the agility/strength infinitely because the code isn't tracking which units have already received the bonus.

I can try giving an example if you'd like, just let me know exactly how you want the aura to behave. (i.e. should the aura have infinite range?)
 
First off: you should do prints to ensure that the looping starts.
If it doesn't maybe you have the wrong skill somewhere (either on unit or on trigger)?

  • Set CurrentAgility = (Agility of (Picked unit) (Include bonuses))
  • Set CurrentStrength = (Strength of (Picked unit) (Include bonuses))
  • Set BonusAgility = (CurrentAgility x (Integer(1.10)))
  • Set BonusStrength = (CurrentStrength x (Integer(1.10)))
  • Hero - Modify Agility of (Picked unit): Add BonusAgility.
  • Hero - Modify Strength of (Picked unit): Add BonusStrength.
There are issues here. Right now, you will gain bonus equal to current (without +10%). In other words: it will double.

What you're doing currently is: BonusAgility = 1 * CurrentAgility.
What you need to do is: Real to Integer (Arithmetics ( Integer to Real (CurrentAgility ) x (0.1) )
The reason is that Integer-to-real of both 1.99 and 1.01 will both give 1 as result, and you ADD bonus so you only want to get what you're supposed to ADD (not what the total should become).

The math in GUI is pretty annoying imo, so I often do custom scripts for it, but some people think custom script is scary.
set udg_BonusAgility = R2I(udg_CurrentAgility * 0.1) would be the the custom script

Edit: Also, you'll need to track the amount per unit and also update it from time to time. If the unit get bonuses from other sources or from levels later, I guess you want them to increase, right? Then you'll need to update the bonus.
 
Top