Difference between revisions of "EVENT TYPE ATTACK IMPACT"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (remove redundant category)
m (A couple of the integers aren't acurate.)
Line 7: Line 7:
 
|sortkey=ATTACK_IMPACT
 
|sortkey=ATTACK_IMPACT
 
|creatordesc=attacker
 
|creatordesc=attacker
|int0name=nResult
+
|int0name=nHitResult
 
|int0desc=hit result (hit, miss, critical etc')
 
|int0desc=hit result (hit, miss, critical etc')
|int1name=nDamage
+
|int1name=nEffectId
|int1desc=damage
+
|int1desc=Effect ID
|int2name=nProjectileType
+
|int2desc=See [[PRJ base.xls]]
+
 
|object0name=oAttacker
 
|object0name=oAttacker
 
|object0desc=attacker
 
|object0desc=attacker
Line 21: Line 19:
 
|location1name=lMissile
 
|location1name=lMissile
 
|location1desc=orientation
 
|location1desc=orientation
 +
<dascript>
 +
effect  eImpactEffect = GetAttackImpactDamageEffect(oAttacker,nEffectId);
 +
object oWeapon = GetEffectObject(eImpactEffect,0);
 +
int nApp = GetAppearanceType(oAttacker);
 +
int nAbility = GetEffectInteger(eImpactEffect,1);
 +
float fDamage = GetEffectFloat(eImpactEffect,0);
 +
int nVfx = GetEffectInteger(eImpactEffect,0);
 +
int nDamageType = GetEffectInteger(eImpactEffect, 2);
 +
</dascript>
 
}}
 
}}
  
 
An attack has impacted the target. This can be melee (sword hit), ranged (arrow hit) or spell (fireball explodes). Used for applying damage, and handling abilities that function on hit (Berserk etc').
 
An attack has impacted the target. This can be melee (sword hit), ranged (arrow hit) or spell (fireball explodes). Used for applying damage, and handling abilities that function on hit (Berserk etc').

Revision as of 23:19, 1 May 2011

Source:
script.ldf
Sent when:
Exact moment of impact
Sent from:
Engine
Sent to:
Attacking creature or player
Parameters:

Usage

case EVENT_TYPE_ATTACK_IMPACT:
{
int nHitResult = GetEventInteger(ev, 0); // hit result (hit, miss, critical etc')
int nEffectId = GetEventInteger(ev, 1); // Effect ID
object oAttacker = GetEventObject(ev, 0); // attacker
object oTarget = GetEventObject(ev, 1); // target
location lImpact = GetEventLocation(ev, 0); // position
location lMissile = GetEventLocation(ev, 1); // orientation
effect  eImpactEffect = GetAttackImpactDamageEffect(oAttacker,nEffectId);
object oWeapon = GetEffectObject(eImpactEffect,0);
int nApp = GetAppearanceType(oAttacker);
int nAbility = GetEffectInteger(eImpactEffect,1);
float fDamage = GetEffectFloat(eImpactEffect,0);
int nVfx = GetEffectInteger(eImpactEffect,0);
int nDamageType = GetEffectInteger(eImpactEffect, 2);


// insert event-handling code here

break;
}

An attack has impacted the target. This can be melee (sword hit), ranged (arrow hit) or spell (fireball explodes). Used for applying damage, and handling abilities that function on hit (Berserk etc').