GetDamageDealtByType(int)

Determines the amount of damage of a specific type dealt to an object.

int GetDamageDealtByType(
    int nDamageType
);

Parameters

nDamageType

DAMAGE_TYPE_*


Description

Returns the amount of damage of type nDamageType that has been dealt to the caller. When called from the OnDamaged event, this function returns only the damage which was caused during that event. This function only works with creatures, when called from a placeable it always returns 0.

nDamageType can be assigned to OR-ed values from the constant group DAMAGE_TYPE_*.

For example, GetDamageDealtByType(DAMAGE_TYPE_PIERCING | DAMAGE_TYPE_SLASHING) would return the damage dealt by piercing and slashing attacks.



Known Bugs

Using DAMAGE_TYPE_SLASHING, DAMAGE_TYPE_PIERCING, DAMAGE_TYPE_BLUDGEONING, DAMAGE_TYPE_SONIC, or DAMAGE_TYPE_FIRE will not return damage dealt by physical attacks (instead returns -1). It will return damage dealt by the aforementioned types only when they are used in conjunction with the EffectDamage() function.


Version

1.29

See Also

categories: Combat Information Functions | Get Data from Creature Functions
constants: DAMAGE_TYPE_* Constants


 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Peter Westergaard, Jassper, Undivine, NetRacer56, Ryan Workman
 Send comments on this topic.