| 06-13-2004, 04:03 AM | #1 |
Is there anyway using jass or some other advanced custom script to recall a unit's current damage in a trigger? I'd like to be able to use this in a triggered spell, like unit damage in area based on attack damage of casting unit. Anyone know how or if this can be done? |
| 06-13-2004, 12:29 PM | #2 |
I'm not sure what you mean. Do you mean total damage, or damage they just recieved from being attacked? If its total damage, you can just get that by subtracting their current life from their total life. For the other one, though, I'm pretty sure there's no GUI trigger, but this JASS looks promising: constant GetEventDamage takes nothing returns real I honestly have no idea what it does, but it certainly looks like it returns how much damage from the event. |
| 06-13-2004, 03:13 PM | #3 | |
Quote:
I was referring to attack damage of the casting unit. Think of a triggered aoe spell that would do damage based on how much damage the casting unit's physical attack does. |
| 06-13-2004, 03:41 PM | #4 |
Ooooooooooooooooooh. My bad. In that case, it looks like there is nothing that will return how much damage your guy can do, probably because most units do a range of damage. Instead, you should probably calcuate it via triggers. |
| 06-13-2004, 06:02 PM | #5 |
Yes, but how could i calculate it via trigger? There is no function in a trigger that would help me, like base damage, number of dice, sides per die, etc. Hence my looking for a way in jass. I'm by no means an expert in what can be done from advanced programming, as i've just started to use it to create projectile special effects. Was just wondering if there is ANY way to get an estimate on the current damage of a unit. |
| 06-13-2004, 06:24 PM | #6 |
Well, if it's a hero, just check for every buff/item that may boost his dmg and his primary attribute, add the average value of his dice and you have an average of his damage at the moment. |
| 06-13-2004, 09:07 PM | #7 |
I played a map where a "Indicator Unit" came and walked past your towers and the more dmg u did to it, the more points u collected. The more points u had, the more hp the monsters that came to the other team had. So obviously there is a way to count damage taken. However, i don't remember the maps name and i don't have it hear since i played it at an Internet Café. I'm just saying there is a way. |
| 06-14-2004, 03:40 AM | #8 |
Damage taken is easy, just use the "unit takes damage" event if i remember correctly. Damage done can be done the same way. As far as getting the "Damage unit can do if he attacks" without manually getting him to attack soemthing or calculating it based on buffs/stats/etc, i think you're out of luck |
| 06-14-2004, 06:38 AM | #9 |
There is a specific unit event - Unit takes damage. To use this for any unit in the game, then anytime a unit was made, you'd need to add an event to the trigger that "Last Created Unit (or whatever) takes damage." Your best bet is to keep track of the unit. Knowing its starting combat statistics, stat points, primary stat, buffs, and equipped items. |
