HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting Unit Damage

12-13-2009, 07:41 AM#1
SmileyJeff
Is there a trigger to get Unit damage? Say i have a footman doing 10-11 damage. I want to get the damage of the footman and apply it into a custom spell.

Eg: Unit Damage x 2 + Strength.

Thanks in advance!
12-13-2009, 07:56 AM#2
Veev
No. You could only get the damage returned using the specific unit event, "Unit takes damage." You could just store the damage range into some variable for every unit or something. Or attach it to the unit itself. etc etc.

EDIT: I mean, of course, if your custom spell triggers off of a normal attack then you can definitely do that easily... But if it's just some spell you cast, then you'll need to store the damage range somewhere, somehow.
12-13-2009, 08:14 AM#3
HyperActive
http://www.wc3c.net/showthread.php?t=108314
12-13-2009, 08:37 PM#4
Mr.Malte
http://www.wc3c.net/showthread.php?t=108314

or

http://www.wc3c.net/showthread.php?t=108319

Chose what you prefer.
12-14-2009, 07:36 AM#5
Tot
or you recalculate it with GetEventDamage() and some scrips (dusk's armorutils and some other)
12-14-2009, 09:26 AM#6
Fledermaus
That still doesn't factor in Damage and Armor types, so isn't very accurate.
12-14-2009, 12:58 PM#7
Tot
Quote:
Originally Posted by Fledermaus
That still doesn't factor in Damage and Armor types, so isn't very accurate.


oops...but can be a problem

--> make all damage and armor factors equal to 1.00
12-14-2009, 02:29 PM#8
Viikuna-
Or then you need to know that stuff, so you can calculate the original damage amount by taking those types and armor values and resistances in account.

It would probably be easier to use that object daat thingy to get base damage and some bonus system to handel all the sources of bonus damage and keeping the track of it or sumthing.
12-14-2009, 02:39 PM#9
Rising_Dusk
Quote:
Originally Posted by Viikuna-
It would probably be easier to use that object daat thingy to get base damage and some bonus system to handel all the sources of bonus damage and keeping the track of it or sumthing.
This. Just use Poot's thing, get base damage, and then use BonusMod for bonuses to your damage. Done.