• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to increase percent damage through item

Status
Not open for further replies.
Level 2
Joined
Sep 11, 2022
Messages
14
Hello, I am trying to Use trigger to create a command aura-like effect in an item. When the hero holds this item, I want this item to detect the hero's current attack damage and add 100% bonus damage (green txt) on it, just like the command aura. I've tried Set unit weapon integer field, however this only changes the white base damage. I also tried to use the command aura directly on the item, but the icon of aura cannot be hidden and the hero cannot accept another command aura. How to use trigger to achieve this effect?
 
Level 2
Joined
Sep 11, 2022
Messages
14
Well, the solution is to use Command Aura and accept that there will be a buff Icon. Buffs will stack as long as they have different ids, at least on version 1.30+ if I recall correctly. So simply give it a unique buff.
I tried, but I just wish to hide the buff icon without occupying an aura buff region(8 for total), so now I just wish to use trigger to finish it
 
In the old days, when we wanted a trigger function to "Add X green damage to unit," we would achieve this by creating an array of many Item Attack Damage Bonus abilities that each added a progressive power of 2 of damage. Then, using a change of base for example if you were going to add +100 damage, we would find that this was the binary number 00000000 00000000 00000000 01100100 so then basically just like how we can store any number in a computer with these 32 on/off switches, we would add any green damage bonus using 32 abilities. So in that example above, the 3rd, 6th, and 7th bits are on in the binary number... so we would add those abilities to the unit and remove all the other of the 32 bonus abilities.

Then the unit would see +100 damage, even though he really had a +4 damage, +32 damage and +64 damage skill added to achieve this result. If you do this, you could add any number up to +4294967295 damage by only making 32 abilities in the Ability Editor which is not too bad.

If you google search up the "BonusMod" system for Warcraft 3, somebody probably has all these abilities and the "AddGreenDamage" function already available in some jass library somewhere from 15 years ago.

If you are familiar with Two's complement - Wikipedia binary representation, you may note that you can also subtract any red damage amount without making more abilities just by using the system above but changing the 32nd of the 32 abilities to subtract instead of adding its damage. Then the other abilities can add back any amount of damage to produce any negative damage bonus, without otherwise changing the system.
 
Level 39
Joined
Feb 27, 2007
Messages
5,014
Such an approach as Vendro laid out is not necessary any more; the functions to modify the data fields of abilities have deprecated it. Now you just set the value of the field properly and then increment + decrement the level so it refreshes.
  • Ability - Set Ability: (Unit: (Triggering Unit)'s Ability with Ability Code: Banish)'s Integer Level Field: Attack Bonus ('Iatt') of Level: 0 to 50
If this can't modify the item ability directly you'll have to add the attack bonus ability to the units that pick up the item and remove it from those that drop it. There is one more consideration: units have a range of damage values for their basic attack (shows as like "12-23"), so which number should be doubled? The max? The min? The average? Some weighted average?
 
Level 2
Joined
Sep 11, 2022
Messages
14
Such an approach as Vendro laid out is not necessary any more; the functions to modify the data fields of abilities have deprecated it. Now you just set the value of the field properly and then increment + decrement the level so it refreshes.
  • Ability - Set Ability: (Unit: (Triggering Unit)'s Ability with Ability Code: Banish)'s Integer Level Field: Attack Bonus ('Iatt') of Level: 0 to 50
If this can't modify the item ability directly you'll have to add the attack bonus ability to the units that pick up the item and remove it from those that drop it. There is one more consideration: units have a range of damage values for their basic attack (shows as like "12-23"), so which number should be doubled? The max? The min? The average? Some weighted average?
I wish to make a command aura-like effect so I will say its average
 
Level 19
Joined
Feb 27, 2019
Messages
590
Did you manage to make the triggers yet?

If no, do you want the item to be stackable? If non-stackable, does the item have an upgrade that should also not stack with the original item?
 
Status
Not open for further replies.
Top