Uncle
Warcraft Moderator
- Joined
- Aug 10, 2018
- Messages
- 7,866
Hello, here are two triggers that I was hoping would work. I have custom variables for each attribute and I want to adjust these when a unit acquires/loses an item, levels up, etc.
However, it seems that there is a delay between when the "Loses an item" event fires and when a unit's stats actually update. So when I "Set Stats_SpellDamage[TempInteger1] = ((Real((Intelligence of TempUnit1 (Include bonuses)))) x 1.00)" after losing an item-let's say a Mantle of Intelligence +3, it's still including the +3 Intelligence from the item in the equation even though it's no longer equipped. I was wondering if anyone knew a way around this without having to detect every single item type and manually adding/removing attributes via triggers.
EDIT SOLUTION: I added the unit to a UG and then ran a 0.00 second timer, adjusting the stats of every unit in that UG after the timer expired.
However, it seems that there is a delay between when the "Loses an item" event fires and when a unit's stats actually update. So when I "Set Stats_SpellDamage[TempInteger1] = ((Real((Intelligence of TempUnit1 (Include bonuses)))) x 1.00)" after losing an item-let's say a Mantle of Intelligence +3, it's still including the +3 Intelligence from the item in the equation even though it's no longer equipped. I was wondering if anyone knew a way around this without having to detect every single item type and manually adding/removing attributes via triggers.
-
Set Attributes
-
Events
-
Unit - A unit Gains a level
-
Unit - A unit Acquires an item
-
Unit - A unit Loses an item
-
-
Conditions
-
Actions
-
Set TempUnit1 = (Triggering unit)
-
Trigger - Run Set Attributes Run <gen> (ignoring conditions)
-
-
-
Set Attributes Run
-
Events
-
Conditions
-
Actions
-
Set TempInteger1 = (Custom value of TempUnit1)
-
Set Stats_SpellDamage[TempInteger1] = ((Real((Intelligence of TempUnit1 (Include bonuses)))) x 1.00)
-
Game - Display to (All players) for 30.00 seconds the text: (String(Stats_SpellDamage[TempInteger1]))
-
-
EDIT SOLUTION: I added the unit to a UG and then ran a 0.00 second timer, adjusting the stats of every unit in that UG after the timer expired.
Last edited: