Difference between revisions of "EVENT TYPE DAMAGED"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (|sourcefile=script.ldf)
(an inconsistancy I just came across)
Line 1: Line 1:
 +
{{needs review}}
 +
 
{{event
 
{{event
 
|sourcefile=script.ldf
 
|sourcefile=script.ldf
Line 11: Line 13:
 
|int1desc= type of damage dealt
 
|int1desc= type of damage dealt
 
}}
 
}}
 +
 +
Note: placeable_h has different parameters.
 +
 +
<dascript>
 +
object oDamager = GetEventCreator(ev);
 +
float fDamage  = GetEventFloat(ev, 0);
 +
int nDamageType = GetEventInteger(ev, 0);
 +
</dascript>
  
 
[[Category:Event types|DAMAGED]]
 
[[Category:Event types|DAMAGED]]

Revision as of 00:31, 1 August 2009

The documentation on this page is incomplete, obsolete, or otherwise in need of a thorough review. The current content may provide a good starting point for this, but do not rely on its accuracy when using it to design content.

Source:
script.ldf
Sent when:
an object loses 1 hit point or more
Sent from:
scripts
Sent to:
creatures, placeables
Parameters:
  • Creator: creature dealing the damage
  • Integer 0: Amount of damage dealt
  • Integer 1: type of damage dealt

Usage

case EVENT_TYPE_DAMAGED:
{
object oAttacker = GetEventCreator(ev); // creature dealing the damage
int nDamage = GetEventInteger(ev, 0); // Amount of damage dealt
int nDamageType = GetEventInteger(ev, 1); // type of damage dealt

// insert event-handling code here

break;
}

Note: placeable_h has different parameters.

object oDamager = GetEventCreator(ev);
float fDamage   = GetEventFloat(ev, 0);
int nDamageType = GetEventInteger(ev, 0);