6 const string NWNX_Damage =
"NWNX_Damage";
176 NWNXPushObject(oOwner);
177 NWNXPushString(sScript);
178 NWNXPushString(
"DAMAGE");
179 NWNXCall(NWNX_Damage,
"SetEventScript");
185 NWNXCall(NWNX_Damage,
"GetDamageEventData");
186 data.oDamager = NWNXPopObject();
187 data.iBludgeoning = NWNXPopInt();
188 data.iPierce = NWNXPopInt();
189 data.iSlash = NWNXPopInt();
190 data.iMagical = NWNXPopInt();
191 data.iAcid = NWNXPopInt();
192 data.iCold = NWNXPopInt();
193 data.iDivine = NWNXPopInt();
194 data.iElectrical = NWNXPopInt();
195 data.iFire = NWNXPopInt();
196 data.iNegative = NWNXPopInt();
197 data.iPositive = NWNXPopInt();
198 data.iSonic = NWNXPopInt();
199 data.iBase = NWNXPopInt();
200 data.iCustom1 = NWNXPopInt();
201 data.iCustom2 = NWNXPopInt();
202 data.iCustom3 = NWNXPopInt();
203 data.iCustom4 = NWNXPopInt();
204 data.iCustom5 = NWNXPopInt();
205 data.iCustom6 = NWNXPopInt();
206 data.iCustom7 = NWNXPopInt();
207 data.iCustom8 = NWNXPopInt();
208 data.iCustom9 = NWNXPopInt();
209 data.iCustom10 = NWNXPopInt();
210 data.iCustom11 = NWNXPopInt();
211 data.iCustom12 = NWNXPopInt();
212 data.iCustom13 = NWNXPopInt();
213 data.iCustom14 = NWNXPopInt();
214 data.iCustom15 = NWNXPopInt();
215 data.iCustom16 = NWNXPopInt();
216 data.iCustom17 = NWNXPopInt();
217 data.iCustom18 = NWNXPopInt();
218 data.iCustom19 = NWNXPopInt();
219 data.iSpellId = NWNXPopInt();
244 NWNXPushInt(data.
iBase);
248 NWNXPushInt(data.
iFire);
251 NWNXPushInt(data.
iCold);
252 NWNXPushInt(data.
iAcid);
258 NWNXCall(NWNX_Damage,
"SetDamageEventData");
263 NWNXPushObject(oOwner);
264 NWNXPushString(sScript);
265 NWNXPushString(
"ATTACK");
266 NWNXCall(NWNX_Damage,
"SetEventScript");
272 NWNXCall(NWNX_Damage,
"GetAttackEventData");
273 data.oTarget = NWNXPopObject();
274 data.iBludgeoning = NWNXPopInt();
275 data.iPierce = NWNXPopInt();
276 data.iSlash = NWNXPopInt();
277 data.iMagical = NWNXPopInt();
278 data.iAcid = NWNXPopInt();
279 data.iCold = NWNXPopInt();
280 data.iDivine = NWNXPopInt();
281 data.iElectrical = NWNXPopInt();
282 data.iFire = NWNXPopInt();
283 data.iNegative = NWNXPopInt();
284 data.iPositive = NWNXPopInt();
285 data.iSonic = NWNXPopInt();
286 data.iBase = NWNXPopInt();
287 data.iCustom1 = NWNXPopInt();
288 data.iCustom2 = NWNXPopInt();
289 data.iCustom3 = NWNXPopInt();
290 data.iCustom4 = NWNXPopInt();
291 data.iCustom5 = NWNXPopInt();
292 data.iCustom6 = NWNXPopInt();
293 data.iCustom7 = NWNXPopInt();
294 data.iCustom8 = NWNXPopInt();
295 data.iCustom9 = NWNXPopInt();
296 data.iCustom10 = NWNXPopInt();
297 data.iCustom11 = NWNXPopInt();
298 data.iCustom12 = NWNXPopInt();
299 data.iCustom13 = NWNXPopInt();
300 data.iCustom14 = NWNXPopInt();
301 data.iCustom15 = NWNXPopInt();
302 data.iCustom16 = NWNXPopInt();
303 data.iCustom17 = NWNXPopInt();
304 data.iCustom18 = NWNXPopInt();
305 data.iCustom19 = NWNXPopInt();
306 data.iAttackNumber = NWNXPopInt();
307 data.iAttackResult = NWNXPopInt();
308 data.iWeaponAttackType = NWNXPopInt();
309 data.iSneakAttack = NWNXPopInt();
310 data.bKillingBlow = NWNXPopInt();
311 data.iAttackType = NWNXPopInt();
312 data.iToHitRoll = NWNXPopInt();
313 data.iToHitModifier = NWNXPopInt();
340 NWNXPushInt(data.
iBase);
344 NWNXPushInt(data.
iFire);
347 NWNXPushInt(data.
iCold);
348 NWNXPushInt(data.
iAcid);
353 NWNXCall(NWNX_Damage,
"SetAttackEventData");
358 NWNXPushInt(iRanged);
383 NWNXPushInt(data.
iFire);
386 NWNXPushInt(data.
iCold);
387 NWNXPushInt(data.
iAcid);
393 NWNXPushObject(oSource);
394 NWNXCall(NWNX_Damage,
"DealDamage");
void NWNX_Damage_SetDamageEventData(struct NWNX_Damage_DamageEventData data)
Set Damage Event Data.
struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData()
Get Attack Event Data.
struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData()
Get Damage Event Data.
void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID)
Sets the script to run with an attack event.
void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource=OBJECT_SELF, int iRanged=FALSE)
Deal damage to a target.
void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data)
Set Attack Event Data.
void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID)
Sets the script to run with a damage event.
int iMagical
Magical damage.
int iAttackType
65002=Attack of Opportunity, 65003=Riposte or a FeatID like KnockDown or some other special attack.
int iCustom14
Custom14 damage.
int iSneakAttack
0=neither, 1=sneak attack, 2=death attack, 3=both
int iCustom5
Custom5 damage.
int iToHitRoll
The to hit roll of the attack.
int iCustom3
Custom3 damage.
int iCustom11
Custom11 damage.
int iAttackResult
1=hit, 2=parried, 3=critical hit, 4=miss, 5=resisted, 7=automatic hit, 8=concealed,...
int iCustom6
Custom6 damage.
int iCustom4
Custom4 damage.
int iCustom10
Custom10 damage.
int iSlash
Slashing damage.
int iCustom7
Custom7 damage.
int iCustom18
Custom18 damage.
int iCustom8
Custom8 damage.
int iPierce
Piercing damage.
int iCustom2
Custom2 damage.
int iCustom19
Custom19 damage.
int bKillingBlow
TRUE if the hit is a killing blow.
int iWeaponAttackType
1=main hand, 2=offhand, 3-5=creature, 6=extra(haste), 7=unarmed, 8=unarmed extra
int iCustom15
Custom15 damage.
int iAttackNumber
1-based index of the attack in current combat round
int iDivine
Divine damage.
int iCustom16
Custom16 damage.
int iPositive
Positive damage.
int iCustom12
Custom12 damage.
int iCustom13
Custom13 damage.
int iNegative
Negative damage.
int iCustom1
Custom1 damage.
int iBludgeoning
Bludgeoning damage.
int iCustom9
Custom9 damage.
int iElectrical
Electrical damage.
int iCustom17
Custom17 damage.
object oTarget
The target who took the damage.
int iToHitModifier
The to hit modifier of the attack.
int iCustom7
Custom7 damage.
int iPower
For overcoming DR.
int iCustom15
Custom15 damage.
int iMagical
Magical damage.
int iCustom1
Custom1 damage.
int iCustom4
Custom4 damage.
int iCustom12
Custom12 damage.
int iDivine
Divine damage.
int iCustom14
Custom14 damage.
int iElectrical
Electrical damage.
int iCustom18
Custom18 damage.
int iCustom17
Custom17 damage.
int iCustom10
Custom10 damage.
int iPositive
Positive damage.
int iNegative
Negative damage.
int iCustom16
Custom16 damage.
int iSlash
Slashing damage.
int iCustom19
Custom19 damage.
int iBludgeoning
Bludgeoning damage.
int iCustom3
Custom3 damage.
int iCustom2
Custom2 damage.
int iCustom13
Custom13 damage.
int iCustom6
Custom6 damage.
int iPierce
Piercing damage.
int iCustom5
Custom5 damage.
int iCustom11
Custom11 damage.
int iCustom9
Custom9 damage.
int iCustom8
Custom8 damage.
int iCustom14
Custom14 damage.
int iDivine
Divine damage.
int iCustom11
Custom11 damage.
int iCustom13
Custom13 damage.
int iCustom15
Custom15 damage.
int iBludgeoning
Bludgeoning damage.
int iCustom2
Custom2 damage.
int iMagical
Magical damage.
int iCustom4
Custom4 damage.
int iCustom9
Custom9 damage.
int iCustom19
Custom19 damage.
int iCustom5
Custom5 damage.
int iPierce
Piercing damage.
int iCustom18
Custom18 damage.
int iCustom6
Custom6 damage.
int iNegative
Negative damage.
int iCustom7
Custom7 damage.
int iSpellId
The spell id associated with the damage or -1 if not known.
int iCustom16
Custom16 damage.
int iElectrical
Electrical damage.
int iCustom8
Custom8 damage.
int iCustom10
Custom10 damage.
int iCustom3
Custom3 damage.
int iCustom17
Custom17 damage.
object oDamager
The object that inflicted the damage.
int iCustom12
Custom12 damage.
int iSlash
Slashing damage.
int iPositive
Positive damage.
int iCustom1
Custom1 damage.