• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How do I change the attack damage?

Status
Not open for further replies.
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