• 🏆 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 do I change the attack damage?

Status
Not open for further replies.
Level 13
Joined
Oct 25, 2009
Messages
995
Change the attack damage with using trigger?
I never see can change attack damage in the trigger,
it need using Jass?

Edit:why cannot use object editor?Create some upgrade and using trigger to upgrade the units of the attack damage every X seconds?
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
create custom abilities based on Item Damage Bonus and add it to your unit

if you want to change the damage seamlessly you will have to create abilities with values 1 2 4 8 16 32 64 and so on because you can sum up any value with these by adding the right abilities
Examples:
15 = 8 + 4 + 2 + 1
23 = 16 + 4 + 2 + 1

make abilites and save them:
ability[0] = +1 dmg
ability[1] = +2 dmg
ability[2] = +4 dmg
ability[3] = +8 dmg
ability[4] = +16 dmg

you calculate it like this:
Bonus = 23
counter = 4

if 2^counter >= bonus
add ability[counter]
set bonus = bonus - 2^counter
set counter = counter - 1


if 2^counter >= bonus
add ability[counter]
set bonus = bonus - 2^counter
set counter = counter - 1

and so on.....
 
Status
Not open for further replies.
Top