Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

Detecting Overdamage No New Posts Coding Help

Started by

0 Members and 1 Guest are viewing this topic.

Detecting Overdamage
on: June 22, 2015, 12:34:17 PM

Is there a way to detect the amount of damage that a spell or attack does beyond the lethal part?
Example: Spell does 300 damage. Target has 100 life and no damage reduction towards spell damage. Difference is 200, this is what I need.
In a scenario where units have different damage reductions this will be kind of complicated.
I was thinking about dealing a little damage (A), getting the actual damage done (B) and calculating the reduction from the quotient (A-B) / A. Then one could calculate the damage needed to kill this unit and thus get the difference. I wonder if there's a more efficient way though, because these seems rather complicated. Help please :)

EDIT: Cannot remove my own post. I know how it's done. /thread
« Last Edit: June 22, 2015, 04:40:56 PM by NaughtySmurf »

Re: Detecting Overdamage
Reply #1 on: July 11, 2015, 11:17:04 AM

Just for information for other users, this can be done with a damage detection system or giving a good use of GetEventDamage function, with the event TriggerRegisterUnitEvent.

Re: Detecting Overdamage
Reply #2 on: July 25, 2015, 05:57:00 AM

Since you are talking about Damage Detection. I think it is so hard to decide which one to use because there are so many out there, and some are not finished or just not effective anymore. Could you recommend a decent one? I'm looking for a system with the possibility of a little customization (like damage block, different damage types detected) but also don't want to create 10 abilities myself and look for 5 different libraries to make it work.


Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...