Your trigger is amazing! Finally a simple one xD But I have some questions about it:First we create an Integer (Array). This will store the desired abilities base damage per level.
Then when we cast the ability we calculate the amount of damage it should deal referencing the BreathOfFire_Damage variable. We also use some arithmetic to add in the bonus Attribute damage.
Breath of Fire Setup
Events
Map initialization
Conditions
Actions
Set VariableSet BreathOfFire_Damage[1] = 100.00
Set VariableSet BreathOfFire_Damage[2] = 200.00
Set VariableSet BreathOfFire_Damage[3] = 300.00
So I'm changing the casting unit's Breath of Fire ability to deal the base damage + (5 * Agility). If the Ability is Level 3 then it will reference BreathOfFire_Damage[3] and deal the appropriate amount of damage.
Breath of Fire Cast
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Breath of Fire
Actions
Set VariableSet Level = (Level of (Ability being cast) for (Triggering unit))
Set VariableSet Amount = (BreathOfFire_Damage[Level] + (5.00 x (Real((Agility of (Triggering unit) (Include bonuses))))))
Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Breath of Fire)'s Real Level Field: Damage ('Ucs1') of Level: (Level - 1) to Amount
Notice that I convert the Hero Attribute to a Real, this is required as Attributes are Integers but the Damage field is a Real.
Also, the Level field is actually indexed starting at 0. That's why I subtract 1 from Level. In other words, putting 0 in the "Level:" field is actually going to reference Ability Level 1.
0 = Level 1
1 = Level 2
2 = Level 3
etc
Finally, make sure that you use the correct version of "Damage". See how it has the code next to it's name: 'Ucs1'. You can view these codes in the Object Editor by pressing Control + D (Display Values As Raw Data). In Breath of Fire's case it uses Damage ('Ucs1'). See the picture I attached for an example.
So this trigger references the Object Editor data for the given ability and replaces one of it's fields with a new value. This is useful if you want to customize Blizzard's spells beyond the limitations of the Object Editor.
Those variables are purely optional. If you really wanted to you could do everything inside of the Ability function:Your trigger is amazing! Finally a simple one xD But I have some questions about it:
Do I have to create those global varibales (Amount & Level) for every other spell? Or can I use them for every hero and spell?
Okay thanks for your answer. Have a good night mateThose variables are purely optional. If you really wanted to you could do everything inside of the Ability function:
But as you can see that's not very pretty.
Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Breath of Fire)'s Real Level Field: Damage ('Ucs1') of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1) to (BreathOfFire_Damage[(Level of (Ability being cast) for (Triggering unit)] + (5.00 x (Real((Agility of (Triggering unit) (Include bonuses))))))
And yes, you can use them for every hero and spell.
Is this MUI?First we create an Integer (Array). This will store the desired abilities base damage per level.
Then when we cast the ability we calculate the amount of damage it should deal referencing the BreathOfFire_Damage variable. We also use some arithmetic to add in the bonus Attribute damage.
Breath of Fire Setup
Events
Map initialization
Conditions
Actions
Set VariableSet BreathOfFire_Damage[1] = 100.00
Set VariableSet BreathOfFire_Damage[2] = 200.00
Set VariableSet BreathOfFire_Damage[3] = 300.00
So I'm changing the casting unit's Breath of Fire ability to deal the base damage + (5 * Agility). If the Ability is Level 3 then it will reference BreathOfFire_Damage[3] and deal the appropriate amount of damage.
Breath of Fire Cast
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Breath of Fire
Actions
Set VariableSet Level = (Level of (Ability being cast) for (Triggering unit))
Set VariableSet Amount = (BreathOfFire_Damage[Level] + (5.00 x (Real((Agility of (Triggering unit) (Include bonuses))))))
Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Breath of Fire)'s Real Level Field: Damage ('Ucs1') of Level: (Level - 1) to Amount
Notice that I convert the Hero Attribute to a Real, this is required as Attributes are Integers but the Damage field is a Real.
Also, the Level field is actually indexed starting at 0. That's why I subtract 1 from Level. In other words, putting 0 in the "Level:" field is actually going to reference Ability Level 1.
0 = Level 1
1 = Level 2
2 = Level 3
etc
Finally, make sure that you use the correct version of "Damage". See how it has the code next to it's name: 'Ucs1'. You can view these codes in the Object Editor by pressing Control + D (Display Values As Raw Data). In Breath of Fire's case it uses Damage ('Ucs1'). See the picture I attached for an example.
So this trigger references the Object Editor data for the given ability and replaces one of it's fields with a new value. This is useful if you want to customize Blizzard's spells beyond the limitations of the Object Editor.
Yes, you're adjusting the Unit's copy of the ability, not the "global" Ability itself.Is this MUI?
That'll never happen here. Here's how triggers execute (basically):Oh true.
Well I was worried if multiple players are spamming it, maybe the "level" variable could get used in the wrong player's trigger. still don't fully understand how that works. if triggers run one-at-a-time or not.