• 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.

Attack damage based ability

Status
Not open for further replies.
Level 2
Joined
Mar 25, 2009
Messages
13
Hey, i was wondering if there's any way to create an ability that deals damage based on the unit's current attack damage. I considered either creating illusions of the unit to check attack damage (no good because illusions don't retain buffs) or building an integer by cycling through the buffs the unit has, the items it's carrying and what it's stats are (this would not only be tedious, but i am unsure of the order in which % damage buffs are applied) but neither seemed viable.

I'd prefer a solution in GUI as i am just beginning to learn JASS, but if the only solution is in JASS then don't hesitate to tell me. I'm decently versed in programming in general and spent some time working with Python (very similar to JASS) but i haven't gotten JASS down as a language of its own yet.
 
Level 4
Joined
Sep 18, 2007
Messages
104
Maybe use a Damage Detection System, and when the unit attacks another unit, store the damage into an integer, then when he casts the ability use the integer variable to determine how much damage, this will be reduced by armor and what not, and this is probably not even close to the best way of doing this.

Maybe only overwrite the integer value if the damage is higher, to get closest to his actual damage output. For example when he levels up.
 
Level 2
Joined
Mar 11, 2009
Messages
26
Another way to do it would be to make a formula that sets an integer to the value of (base damage + dice*die + main attribute of the hero), this should put the integer to the hero's top damage. Oh and if you have changed the constants of attack damage per main attribute you want to change the main attribute of the hero to that number.
 
Level 7
Joined
Oct 14, 2008
Messages
340
How exactly? A function that makes checks for each item/ability that would add damage on his map? Of course if his map lacks these, this wouldn't be a problem :p
 
Level 2
Joined
Mar 25, 2009
Messages
13
At this point it looks like the best idea would be a formula that simply calculated a likely attack damage when the ability is cast. It would be tedious but I could probably write a script that just added base damage+main stat and then checked for items with+ damage and modified the number accordingly, as well as checking for buffs that could increase damage. My only problem here is that there are auras which increase attack damage by a %, and i don't know whether those effect the base attack damage or the attack damage after bonuses.

Edit: Actually i was thinking about Chaoslord's idea and it might also be possible to use an attack damage detection system and then have a number which was the average damage of all his attacks (though there is probably some way to exploit this that can't think of right now)

Thanks for all the help!
 
Last edited:
Status
Not open for further replies.
Top