Difference between revisions of "Osiris/API/CharacterReceivedDamage"

From Divinity Engine Wiki
Jump to: navigation, search
m
m
 
(9 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
===== Parameters =====
 
===== Parameters =====
 
* '''_Character''': The character that was damaged.
 
* '''_Character''': The character that was damaged.
* '''_Percentage''': The percentage of vitality/hit points that was removed by this damage event.
+
* ''(new in DOS2 Patch 5)'' '''_Percentage''': The percentage of vitality/hit points that was removed by this damage event.
* '''_Source''': The GUID of the character or item that caused the damage. In case the damage is caused by a surface, this will be the creator of said surface (can be NULL if the game cannot determine the party responsible, e.g. if you are damaged by a static fire surface that was painted in the editor).
+
* ''(new in DOS2 Patch 5)'' '''_Source''': The GUID of the character or item that caused the damage. In case the damage is caused by a surface, this will be the creator of said surface (can be NULL if the game cannot determine the party responsible, e.g. if you are damaged by a static fire surface that was painted in the editor).
 
===== Notes =====
 
===== Notes =====
* This event is thrown even if '''_Percentage''' 0.0, i.e., if all damage was blocked by armor or because '''_Character''' is immune to the damage type.
+
* This event is thrown even when '''_Percentage''' is 0.0, i.e., all damage was blocked by armor or '''_Character''' was immune to the damage type.
* This event is ''not'' thrown if the "damage" healed '''_Character'''; in that case, a corresponding HEAL status will be applied to '''_Character''' instead.
+
* This event is ''not'' thrown if the "damage" healed '''_Character''' (e.g. poison damage to a zombie); in that case, a corresponding HEAL status will be applied to '''_Character''' instead.
 +
* One such event gets thrown per "hit", so if a hit does e.g. both physical and poison damage, the '''_Percentage''' parameter represents sum of the individual damages (or difference, in case of an undead). Conversely, [[Osiris/API/AttackedByObject|AttackedByObject]] will be called for each individual damage component.
 
===== See Also =====
 
===== See Also =====
* /
+
* [[Osiris/API/AttackedByObject|AttackedByObject]]
+
* [[Osiris/API/CharacterStatusAttempt|CharacterStatusAttempt]]
[[Category:Osiris Events]]
+
* [[Osiris/API/CharacterStatusApplied|CharacterStatusApplied]]
 +
* [[Osiris/API/CharacterVitalityChanged|CharacterVitalityChanged]]
 +
 
 +
[[Category:Osiris Events|CharacterReceivedDamage]]

Latest revision as of 11:56, 15 February 2020

Full Definition(s)
  • event CharacterReceivedDamage((CHARACTERGUID)_Character, (INTEGER)_Percentage, (GUIDSTRING)_Source)
Description

Thrown when a character receives damage from an attack or an environmental effect such as a surface.

Parameters
  • _Character: The character that was damaged.
  • (new in DOS2 Patch 5) _Percentage: The percentage of vitality/hit points that was removed by this damage event.
  • (new in DOS2 Patch 5) _Source: The GUID of the character or item that caused the damage. In case the damage is caused by a surface, this will be the creator of said surface (can be NULL if the game cannot determine the party responsible, e.g. if you are damaged by a static fire surface that was painted in the editor).
Notes
  • This event is thrown even when _Percentage is 0.0, i.e., all damage was blocked by armor or _Character was immune to the damage type.
  • This event is not thrown if the "damage" healed _Character (e.g. poison damage to a zombie); in that case, a corresponding HEAL status will be applied to _Character instead.
  • One such event gets thrown per "hit", so if a hit does e.g. both physical and poison damage, the _Percentage parameter represents sum of the individual damages (or difference, in case of an undead). Conversely, AttackedByObject will be called for each individual damage component.
See Also