[Spell] Attribute bonus per kill with [green] damage

Level 15
Joined
Sep 11, 2013
Messages
557
Greetings!
I've made a new passive spell that gives bonus attribute to the killer.
This passive works great, but I want to see the bonus attribute and bonus damage with green.
How can I do that?

Right now, the bonus attribute and bonus damage from that bonus attribute are not with +green.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Paladin
      • ((Dying unit) is A structure) Equal to False
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit)).) Equal to True
    • Actions
      • Game - Display to (All players) the text: weee
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Devotion Aura for (Killing unit)) Equal to 1
        • Then - Actions
          • Hero - Modify Agility of (Killing unit): Add 10.
          • Hero - Modify Intelligence of (Killing unit): Add 10.
          • Hero - Modify Strength of (Killing unit): Add 10.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Devotion Aura for (Killing unit)) Equal to 2
        • Then - Actions
          • Hero - Modify Agility of (Killing unit): Add 20.
          • Hero - Modify Intelligence of (Killing unit): Add 20.
          • Hero - Modify Strength of (Killing unit): Add 20.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Devotion Aura for (Killing unit)) Equal to 3
        • Then - Actions
          • Hero - Modify Agility of (Killing unit): Add 30.
          • Hero - Modify Intelligence of (Killing unit): Add 30.
          • Hero - Modify Strength of (Killing unit): Add 30.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Devotion Aura for (Killing unit)) Equal to 4
        • Then - Actions
          • Hero - Modify Agility of (Killing unit): Add 40.
          • Hero - Modify Intelligence of (Killing unit): Add 40.
          • Hero - Modify Strength of (Killing unit): Add 40.
        • Else - Actions
The help will be appreciated! :peasant-bowing:
 

Attachments

If you are on 1.31+, then you can use custom version of the Attribute Bonus ability, as that does exactly what you want: increase stats as +green and use triggers to modify the bonus this ability gives.
Do the following:
  • Create a custom version of Attribute Bonus ability
  • Set it as non-hero ability, give it only a single level and set all three bonuses to 0. You can also hide it by setting "Data - Hide Button" to true
  • Give this ability to your hero. There are no side effects, since you've set the ability to give no bonuses.
  • In your trigger when unit dies to the Paladin, you can load current bonus the attribute ability gives you and increase the amount by some value.

Example (I named the custom version of Attribute Bonus as "Attr Bonus"):
  • Bonus
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Paladin
      • (Level of Devotion Aura for (Killing unit)) Greater than 0
      • ((Triggering unit) is A structure) Equal to False
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit)).) Equal to True
    • Actions
      • Set VariableSet attrAbility = (Unit: (Killing unit)'s Ability with Ability Code: Attr Bonus )
      • Set VariableSet bonus = (Ability: attrAbility's Integer Level Field Agility Bonus ('Iagi'), of Level: 0)
      • Set VariableSet bonus = (bonus + (10 x (Level of Devotion Aura for (Killing unit))))
      • Ability - Set Ability: attrAbility's Integer Level Field: Agility Bonus ('Iagi') of Level: 0 to bonus
      • Ability - Set Ability: attrAbility's Integer Level Field: Intelligence Bonus ('Iint') of Level: 0 to bonus
      • Ability - Set Ability: attrAbility's Integer Level Field: Strength Bonus ('Istr') of Level: 0 to bonus
 
If you are on 1.31+, then you can use custom version of the Attribute Bonus ability, as that does exactly what you want: increase stats as +green and use triggers to modify the bonus this ability gives.
Do the following:
  • Create a custom version of Attribute Bonus ability
  • Set it as non-hero ability, give it only a single level and set all three bonuses to 0. You can also hide it by setting "Data - Hide Button" to true
  • Give this ability to your hero. There are no side effects, since you've set the ability to give no bonuses.
  • In your trigger when unit dies to the Paladin, you can load current bonus the attribute ability gives you and increase the amount by some value.

Example (I named the custom version of Attribute Bonus as "Attr Bonus"):
  • Bonus
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Paladin
      • (Level of Devotion Aura for (Killing unit)) Greater than 0
      • ((Triggering unit) is A structure) Equal to False
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit)).) Equal to True
    • Actions
      • Set VariableSet attrAbility = (Unit: (Killing unit)'s Ability with Ability Code: Attr Bonus )
      • Set VariableSet bonus = (Ability: attrAbility's Integer Level Field Agility Bonus ('Iagi'), of Level: 0)
      • Set VariableSet bonus = (bonus + (10 x (Level of Devotion Aura for (Killing unit))))
      • Ability - Set Ability: attrAbility's Integer Level Field: Agility Bonus ('Iagi') of Level: 0 to bonus
      • Ability - Set Ability: attrAbility's Integer Level Field: Intelligence Bonus ('Iint') of Level: 0 to bonus
      • Ability - Set Ability: attrAbility's Integer Level Field: Strength Bonus ('Istr') of Level: 0 to bonus
Thank you very much!
It works perfectly!

However, I don't understand why this line is here.:peasant-thinking:
  • Set VariableSet bonus = (Ability: attrAbility's Integer Level Field Agility Bonus ('Iagi'), of Level: 0)
I disable that line, and the trigger still works perfectly.
 
That reads the value of "Agility bonus" field from the ability and assigns that value to variable called "bonus".
You can omit that if only a single unit in the entire game can get the bonus and if you don't re-use the "bonus" variable anywhere else. But if you want your spell to be MUI, then you will need to keep the action to get given unit's actual bonus.
 
That reads the value of "Agility bonus" field from the ability and assigns that value to variable called "bonus".
You can omit that if only a single unit in the entire game can get the bonus and if you don't re-use the "bonus" variable anywhere else. But if you want your spell to be MUI, then you will need to keep the action to get given unit's actual bonus.
Oh, thank you for the explanation. Yes, in my map 4 heroes can have this passive at the same time, so the trigger must be MUI.
 
Back
Top