• 🏆 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!

[Trigger] Include item bonuses for ability

Level 11
Joined
Aug 11, 2009
Messages
594
I just have a basic ability that should increase damage by 50% for 10s. However, the problem is to also include item bonuses in this. Is there a way through triggers to do it? The ability (Battle Roar) currently looks like this:

  • Zoro Ult
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to King of Hell (Zoro)
    • Actions
      • Set VariableSet U_Ult = (Triggering unit)
      • Set VariableSet Real_AbilityDamage = (0.50 x (Real((Base Damage of U_Ult for weapon index 0))))
      • Ability - Set Ability: (Unit: U_Ult's Ability with Ability Code: King of Hell (Zoro))'s Real Level Field: Damage Increase ('Nbr1') of Level: 0 to Real_AbilityDamage
One way to solve it would be to make triggers that changes a heroes base damage when he picks up/drops an item that has damage on it. But when i tried that the damage from items was removed when using a morph spell and i dont know how to solve that xD

EDIT: I changed the item level of all items that gave damage to the value of damage they give. Then changed triggers to this below. It works but maybe there is a better way to do it?

  • Zoro Ult
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to King of Hell (Zoro)
    • Actions
      • Set VariableSet U_Ult = (Triggering unit)
      • Set VariableSet Real_AbilityDamage = (Real((Base Damage of U_Ult for weapon index 0)))
      • For each (Integer Loop_Ult) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item level of (Item carried by U_Ult in slot Loop_Ult)) Greater than 0
              • (Current life of (Item carried by U_Ult in slot Loop_Ult)) Not equal to 6.00
            • Then - Actions
              • Set VariableSet Real_AbilityDamage = (Real_AbilityDamage + (Real((Item level of (Item carried by U_Ult in slot Loop_Ult)))))
            • Else - Actions
      • Set VariableSet Real_AbilityDamage = (Real_AbilityDamage / 2.00)
      • Ability - Set Ability: (Unit: U_Ult's Ability with Ability Code: King of Hell (Zoro))'s Real Level Field: Damage Increase ('Nbr1') of Level: 0 to Real_AbilityDamage

Thanks for any advice on this!
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,576
Nope, that's basically how you have to do it. Of course, if you don't want to rely on random object editor fields then you can use a Hashtable/Item Indexing to manage the data entirely in the trigger editor. This would be more work of course but it would allow for near infinite data to be attached to an item.
 
Level 11
Joined
Aug 11, 2009
Messages
594
if you dont care about the ui display you could give the unit the ability demolish for the buff duration 'ANde' or the ability elune 'Aegr' both have the power to increase dealt damage of attacks by % and clones of this abilities stack.
Oh, that is good to know :D

Do you know if they affect triggered damage aswell? Or are they limited to auto attacks only?
 
Top