• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Spell doing a percentage of attack damage

Status
Not open for further replies.
Level 2
Joined
Feb 27, 2013
Messages
17
Hello guys i'm here to ask you about something that i could not find an answer for anywhere.
I need to create a spell in my map that is like this: When the ability it's used on an enemy by my hero, i spawn a dummy that do damage to the target equal to 200% of my hero melee damage. I looked for everywhere in the trigger editor but i came out with the conclusion that this thing is impossibile in GUI.
Maybe a Damage Engine can help me with this? (even if i don't know how to use one)

Thanks in advance!
 
Level 7
Joined
Jun 14, 2009
Messages
235
I think you would have to save the unit's attack damage as an integer, and adjust it when the unit's attack damage was changed.

This would mean when the hero acquired items, gained levels, gained main stat from any other sources, or changed from abilities. As far as I know, there isn't any way to get a unit's attack damage from the game.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hello guys i'm here to ask you about something that i could not find an answer for anywhere.
I need to create a spell in my map that is like this: When the ability it's used on an enemy by my hero, i spawn a dummy that do damage to the target equal to 200% of my hero melee damage. I looked for everywhere in the trigger editor but i came out with the conclusion that this thing is impossibile in GUI.
Maybe a Damage Engine can help me with this? (even if i don't know how to use one)

Thanks in advance!

maybe use hashtable for save at map init the default damage with 0 str for that heroes what could get this ability also save the damage for items, when u cast then u load that number and calculate ur unit damage.

another wat create a same unit type than ur hero, set same lv yo created unit than ur hero and add same item than ur hero, hide with animation - vertex color 100% transparency, order the hidden unit for attack once wait a short time and remove it
 
Level 2
Joined
Feb 27, 2013
Messages
17
maybe use hashtable for save at map init the default damage with 0 str for that heroes what could get this ability also save the damage for items, when u cast then u load that number and calculate ur unit damage.

another wat create a same unit type than ur hero, set same lv yo created unit than ur hero and add same item than ur hero, hide with animation - vertex color 100% transparency, order the hidden unit for attack once wait a short time and remove it

I like the second one, i'll try to see if it works.
I already thought of using variables but it would require to take track of EVERYTHING that would change the damage of my hero, which is unpratical and too long to do.
Thanks for the hints anyway!
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
another wat create a same unit type than ur hero, set same lv yo created unit than ur hero and add same item than ur hero, hide with animation - vertex color 100% transparency, order the hidden unit for attack once wait a short time and remove it

This only works if your heroes have damage values with low variance, so the error is small (the amount of damage dealt is random). For example if your hero has the values:
Damage: 49 - 227 + 32
then the mean value of damage dealt is 170 (so you want your spell to deal 170*2 = 340 damage). But if you are unlucky you can get values like 80 or 250, and the spell deals between 160 and 500 damage.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
This only works if your heroes have damage values with low variance, so the error is small (the amount of damage dealt is random). For example if your hero has the values:
Damage: 49 - 227 + 32
then the mean value of damage dealt is 170 (so you want your spell to deal 170*2 = 340 damage). But if you are unlucky you can get values like 80 or 250, and the spell deals between 160 and 500 damage.

still i dont watched hero with that much difference between min and max damage also with higher str this difference is lower %, example mostly have maybe 15 damage difference between min and max damage, when hero have 50 str, so 50 vs 65 then 15 pretty noticeable difference but wehn hero got item + more str then could be 1050-1065 where kinda unnoticeable the difference, also spell based on normal damage not on last dealed normal damage so could be random between the potentional damage range
 
Status
Not open for further replies.
Top