NWNX:EE  8193.36.12
nwnx_damage.nss
Go to the documentation of this file.
1 #include "nwnx"
6 
7 const string NWNX_Damage = "NWNX_Damage";
8 
12 {
13  object oDamager;
15  int iPierce;
16  int iSlash;
17  int iMagical;
18  int iAcid;
19  int iCold;
20  int iDivine;
22  int iFire;
23  int iNegative;
24  int iPositive;
25  int iSonic;
26  int iBase;
27  int iCustom1;
28  int iCustom2;
29  int iCustom3;
30  int iCustom4;
31  int iCustom5;
32  int iCustom6;
33  int iCustom7;
34  int iCustom8;
35  int iCustom9;
36  int iCustom10;
37  int iCustom11;
38  int iCustom12;
39  int iCustom13;
40  int iCustom14;
41  int iCustom15;
42  int iCustom16;
43  int iCustom17;
44  int iCustom18;
45  int iCustom19;
46  int iSpellId;
47 };
48 
52 {
53  object oTarget;
55  int iPierce;
56  int iSlash;
57  int iMagical;
58  int iAcid;
59  int iCold;
60  int iDivine;
62  int iFire;
63  int iNegative;
64  int iPositive;
65  int iSonic;
66  int iBase;
67  int iCustom1;
68  int iCustom2;
69  int iCustom3;
70  int iCustom4;
71  int iCustom5;
72  int iCustom6;
73  int iCustom7;
74  int iCustom8;
75  int iCustom9;
76  int iCustom10;
77  int iCustom11;
78  int iCustom12;
79  int iCustom13;
80  int iCustom14;
81  int iCustom15;
82  int iCustom16;
83  int iCustom17;
84  int iCustom18;
85  int iCustom19;
92  int iToHitRoll;
94 };
95 
99 {
101  int iPierce;
102  int iSlash;
103  int iMagical;
104  int iAcid;
105  int iCold;
106  int iDivine;
108  int iFire;
109  int iNegative;
110  int iPositive;
111  int iSonic;
112  int iCustom1;
113  int iCustom2;
114  int iCustom3;
115  int iCustom4;
116  int iCustom5;
117  int iCustom6;
118  int iCustom7;
119  int iCustom8;
120  int iCustom9;
121  int iCustom10;
122  int iCustom11;
123  int iCustom12;
124  int iCustom13;
125  int iCustom14;
126  int iCustom15;
127  int iCustom16;
128  int iCustom17;
129  int iCustom18;
130  int iCustom19;
131  int iPower;
132 };
133 
137 void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner = OBJECT_INVALID);
138 
143 
148 
152 void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner = OBJECT_INVALID);
153 
158 
164 
171 void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource = OBJECT_SELF, int iRanged = FALSE);
172 
174 
175 void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID)
176 {
177  string sFunc = "SetEventScript";
178 
179  NWNX_PushArgumentObject(oOwner);
180  NWNX_PushArgumentString(sScript);
181  NWNX_PushArgumentString("DAMAGE");
182 
183  NWNX_CallFunction(NWNX_Damage, sFunc);
184 }
185 
187 {
188  string sFunc = "GetDamageEventData";
189  struct NWNX_Damage_DamageEventData data;
190 
191  NWNX_CallFunction(NWNX_Damage, sFunc);
192 
198  data.iAcid = NWNX_GetReturnValueInt();
199  data.iCold = NWNX_GetReturnValueInt();
202  data.iFire = NWNX_GetReturnValueInt();
206  data.iBase = NWNX_GetReturnValueInt();
227 
228  return data;
229 }
230 
232 {
233  string sFunc = "SetDamageEventData";
234 
267 
268  NWNX_CallFunction(NWNX_Damage, sFunc);
269 }
270 
271 void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID)
272 {
273  string sFunc = "SetEventScript";
274 
275  NWNX_PushArgumentObject(oOwner);
276  NWNX_PushArgumentString(sScript);
277  NWNX_PushArgumentString("ATTACK");
278 
279  NWNX_CallFunction(NWNX_Damage, sFunc);
280 }
281 
283 {
284  string sFunc = "GetAttackEventData";
285  struct NWNX_Damage_AttackEventData data;
286 
287  NWNX_CallFunction(NWNX_Damage, sFunc);
288 
294  data.iAcid = NWNX_GetReturnValueInt();
295  data.iCold = NWNX_GetReturnValueInt();
298  data.iFire = NWNX_GetReturnValueInt();
302  data.iBase = NWNX_GetReturnValueInt();
330 
331  return data;
332 }
333 
335 {
336  string sFunc = "SetAttackEventData";
337 
372 
373  NWNX_CallFunction(NWNX_Damage, sFunc);
374 }
375 
376 void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource, int iRanged = FALSE)
377 {
378  string sFunc = "DealDamage";
379 
380  NWNX_PushArgumentInt(iRanged);
401  NWNX_PushArgumentInt(0);// Padding for Base Damage
415  NWNX_PushArgumentObject(oSource);
416 
417  NWNX_CallFunction(NWNX_Damage, sFunc);
418 }
NWNX_Damage_DamageData::iCustom1
int iCustom1
Custom1 damage.
Definition: nwnx_damage.nss:112
NWNX_Damage_DamageEventData::iCustom19
int iCustom19
Custom19 damage.
Definition: nwnx_damage.nss:45
NWNX_Damage_DamageEventData::iCustom10
int iCustom10
Custom10 damage.
Definition: nwnx_damage.nss:36
NWNX_Damage_DamageEventData::iCustom5
int iCustom5
Custom5 damage.
Definition: nwnx_damage.nss:31
NWNX_Damage_AttackEventData::iAttackNumber
int iAttackNumber
1-based index of the attack in current combat round
Definition: nwnx_damage.nss:86
NWNX_Damage_AttackEventData::iCustom12
int iCustom12
Custom12 damage.
Definition: nwnx_damage.nss:78
NWNX_Damage_DamageData::iAcid
int iAcid
Acid damage.
Definition: nwnx_damage.nss:104
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_Damage_DamageEventData::iCustom2
int iCustom2
Custom2 damage.
Definition: nwnx_damage.nss:28
NWNX_Damage_DamageData::iSonic
int iSonic
Sonic damage.
Definition: nwnx_damage.nss:111
NWNX_Damage_AttackEventData::iToHitRoll
int iToHitRoll
The to hit roll of the attack.
Definition: nwnx_damage.nss:92
NWNX_Damage_DamageData::iCustom6
int iCustom6
Custom6 damage.
Definition: nwnx_damage.nss:117
NWNX_Damage_DamageEventData::iCustom3
int iCustom3
Custom3 damage.
Definition: nwnx_damage.nss:29
NWNX_Damage_AttackEventData::iPositive
int iPositive
Positive damage.
Definition: nwnx_damage.nss:64
NWNX_Damage_DamageData
Used for DealDamage.
Definition: nwnx_damage.nss:98
NWNX_Damage_DamageData::iCustom18
int iCustom18
Custom18 damage.
Definition: nwnx_damage.nss:129
NWNX_Damage_AttackEventData::iSneakAttack
int iSneakAttack
0=neither, 1=sneak attack, 2=death attack, 3=both
Definition: nwnx_damage.nss:89
NWNX_Damage_DamageData::iNegative
int iNegative
Negative damage.
Definition: nwnx_damage.nss:109
NWNX_Damage_AttackEventData::iSlash
int iSlash
Slashing damage.
Definition: nwnx_damage.nss:56
NWNX_Damage_DamageData::iBludgeoning
int iBludgeoning
Bludgeoning damage.
Definition: nwnx_damage.nss:100
NWNX_Damage_AttackEventData::iCustom15
int iCustom15
Custom15 damage.
Definition: nwnx_damage.nss:81
NWNX_Damage_DamageEventData::iDivine
int iDivine
Divine damage.
Definition: nwnx_damage.nss:20
NWNX_Damage_DamageEventData::iCustom11
int iCustom11
Custom11 damage.
Definition: nwnx_damage.nss:37
NWNX_Damage_AttackEventData::iCustom19
int iCustom19
Custom19 damage.
Definition: nwnx_damage.nss:85
NWNX_Damage_DamageEventData::iCustom16
int iCustom16
Custom16 damage.
Definition: nwnx_damage.nss:42
NWNX_Damage_AttackEventData::oTarget
object oTarget
The target who took the damage.
Definition: nwnx_damage.nss:53
NWNX_Damage_SetDamageEventData
void NWNX_Damage_SetDamageEventData(struct NWNX_Damage_DamageEventData data)
Set Damage Event Data.
Definition: nwnx_damage.nss:231
NWNX_Damage_DamageEventData::iCustom12
int iCustom12
Custom12 damage.
Definition: nwnx_damage.nss:38
NWNX_Damage_DamageData::iCustom9
int iCustom9
Custom9 damage.
Definition: nwnx_damage.nss:120
NWNX_Damage_AttackEventData::iCustom8
int iCustom8
Custom8 damage.
Definition: nwnx_damage.nss:74
NWNX_Damage_AttackEventData::iCustom11
int iCustom11
Custom11 damage.
Definition: nwnx_damage.nss:77
NWNX_Damage_DamageEventData::iSonic
int iSonic
Sonic damage.
Definition: nwnx_damage.nss:25
NWNX_Damage_DealDamage
void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource=OBJECT_SELF, int iRanged=FALSE)
Deal damage to a target.
Definition: nwnx_damage.nss:376
NWNX_Damage_DamageData::iCustom16
int iCustom16
Custom16 damage.
Definition: nwnx_damage.nss:127
NWNX_Damage_AttackEventData::iCustom9
int iCustom9
Custom9 damage.
Definition: nwnx_damage.nss:75
NWNX_Damage_AttackEventData::iBase
int iBase
Base damage.
Definition: nwnx_damage.nss:66
NWNX_Damage_DamageData::iElectrical
int iElectrical
Electrical damage.
Definition: nwnx_damage.nss:107
NWNX_Damage_DamageEventData::iCustom6
int iCustom6
Custom6 damage.
Definition: nwnx_damage.nss:32
NWNX_Damage_AttackEventData::iCustom4
int iCustom4
Custom4 damage.
Definition: nwnx_damage.nss:70
NWNX_Damage_AttackEventData::bKillingBlow
int bKillingBlow
TRUE if the hit is a killing blow.
Definition: nwnx_damage.nss:91
NWNX_Damage_AttackEventData
Attack Event Data.
Definition: nwnx_damage.nss:51
NWNX_Damage_DamageEventData::iCustom18
int iCustom18
Custom18 damage.
Definition: nwnx_damage.nss:44
NWNX_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
NWNX_Damage_DamageData::iCustom11
int iCustom11
Custom11 damage.
Definition: nwnx_damage.nss:122
NWNX_Damage_SetAttackEventData
void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data)
Set Attack Event Data.
Definition: nwnx_damage.nss:334
NWNX_Damage_DamageEventData::iBludgeoning
int iBludgeoning
Bludgeoning damage.
Definition: nwnx_damage.nss:14
NWNX_Damage_AttackEventData::iWeaponAttackType
int iWeaponAttackType
1=main hand, 2=offhand, 3-5=creature, 6=extra(haste), 7=unarmed, 8=unarmed extra
Definition: nwnx_damage.nss:88
NWNX_Damage_DamageEventData::iBase
int iBase
Base damage.
Definition: nwnx_damage.nss:26
NWNX_Damage_DamageEventData::iCustom9
int iCustom9
Custom9 damage.
Definition: nwnx_damage.nss:35
NWNX_Damage_GetDamageEventData
struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData()
Get Damage Event Data.
Definition: nwnx_damage.nss:186
NWNX_Damage_AttackEventData::iToHitModifier
int iToHitModifier
The to hit modifier of the attack.
Definition: nwnx_damage.nss:93
NWNX_Damage_DamageEventData::iCustom13
int iCustom13
Custom13 damage.
Definition: nwnx_damage.nss:39
NWNX_Damage_AttackEventData::iNegative
int iNegative
Negative damage.
Definition: nwnx_damage.nss:63
NWNX_Damage_DamageEventData::iPositive
int iPositive
Positive damage.
Definition: nwnx_damage.nss:24
NWNX_Damage_DamageData::iDivine
int iDivine
Divine damage.
Definition: nwnx_damage.nss:106
NWNX_Damage_DamageEventData::iCold
int iCold
Cold damage.
Definition: nwnx_damage.nss:19
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_Damage_DamageEventData::iFire
int iFire
Fire damage.
Definition: nwnx_damage.nss:22
NWNX_Damage_DamageData::iCustom10
int iCustom10
Custom10 damage.
Definition: nwnx_damage.nss:121
NWNX_Damage_DamageData::iSlash
int iSlash
Slashing damage.
Definition: nwnx_damage.nss:102
NWNX_Damage_DamageData::iCustom13
int iCustom13
Custom13 damage.
Definition: nwnx_damage.nss:124
NWNX_Damage_DamageData::iCustom17
int iCustom17
Custom17 damage.
Definition: nwnx_damage.nss:128
NWNX_Damage_DamageData::iCustom12
int iCustom12
Custom12 damage.
Definition: nwnx_damage.nss:123
NWNX_Damage_AttackEventData::iPierce
int iPierce
Piercing damage.
Definition: nwnx_damage.nss:55
NWNX_Damage_DamageData::iCustom7
int iCustom7
Custom7 damage.
Definition: nwnx_damage.nss:118
NWNX_PushArgumentObject
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:69
NWNX_Damage_AttackEventData::iBludgeoning
int iBludgeoning
Bludgeoning damage.
Definition: nwnx_damage.nss:54
NWNX_Damage_DamageEventData::iAcid
int iAcid
Acid damage.
Definition: nwnx_damage.nss:18
NWNX_Damage_DamageEventData::iSpellId
int iSpellId
The spell id associated with the damage or -1 if not known.
Definition: nwnx_damage.nss:46
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
NWNX_Damage_AttackEventData::iCustom6
int iCustom6
Custom6 damage.
Definition: nwnx_damage.nss:72
NWNX_Damage_DamageData::iPierce
int iPierce
Piercing damage.
Definition: nwnx_damage.nss:101
NWNX_Damage_DamageData::iCustom4
int iCustom4
Custom4 damage.
Definition: nwnx_damage.nss:115
NWNX_Damage_SetAttackEventScript
void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID)
Sets the script to run with an attack event.
Definition: nwnx_damage.nss:271
NWNX_Damage_DamageData::iCustom3
int iCustom3
Custom3 damage.
Definition: nwnx_damage.nss:114
NWNX_Damage_AttackEventData::iCustom1
int iCustom1
Custom1 damage.
Definition: nwnx_damage.nss:67
NWNX_Damage_AttackEventData::iCold
int iCold
Cold damage.
Definition: nwnx_damage.nss:59
NWNX_Damage_AttackEventData::iCustom14
int iCustom14
Custom14 damage.
Definition: nwnx_damage.nss:80
NWNX_Damage_AttackEventData::iCustom18
int iCustom18
Custom18 damage.
Definition: nwnx_damage.nss:84
NWNX_Damage_AttackEventData::iCustom10
int iCustom10
Custom10 damage.
Definition: nwnx_damage.nss:76
NWNX_Damage_AttackEventData::iCustom16
int iCustom16
Custom16 damage.
Definition: nwnx_damage.nss:82
NWNX_Damage_DamageEventData::oDamager
object oDamager
The object that inflicted the damage.
Definition: nwnx_damage.nss:13
NWNX_Damage_DamageData::iCustom2
int iCustom2
Custom2 damage.
Definition: nwnx_damage.nss:113
NWNX_Damage_DamageData::iCustom14
int iCustom14
Custom14 damage.
Definition: nwnx_damage.nss:125
NWNX_Damage_AttackEventData::iMagical
int iMagical
Magical damage.
Definition: nwnx_damage.nss:57
NWNX_Damage_DamageData::iMagical
int iMagical
Magical damage.
Definition: nwnx_damage.nss:103
NWNX_Damage_SetDamageEventScript
void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID)
Sets the script to run with a damage event.
Definition: nwnx_damage.nss:175
NWNX_Damage_DamageData::iCustom15
int iCustom15
Custom15 damage.
Definition: nwnx_damage.nss:126
NWNX_Damage_DamageEventData::iMagical
int iMagical
Magical damage.
Definition: nwnx_damage.nss:17
NWNX_Damage_AttackEventData::iDivine
int iDivine
Divine damage.
Definition: nwnx_damage.nss:60
NWNX_Damage_DamageData::iCustom8
int iCustom8
Custom8 damage.
Definition: nwnx_damage.nss:119
NWNX_Damage_DamageEventData::iElectrical
int iElectrical
Electrical damage.
Definition: nwnx_damage.nss:21
NWNX_Damage_GetAttackEventData
struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData()
Get Attack Event Data.
Definition: nwnx_damage.nss:282
NWNX_Damage_AttackEventData::iFire
int iFire
Fire damage.
Definition: nwnx_damage.nss:62
NWNX_GetReturnValueObject
object NWNX_GetReturnValueObject()
Returns the specified type from the c++ side.
Definition: nwnx.nss:104
NWNX_Damage_AttackEventData::iAttackType
int iAttackType
65002=Attack of Opportunity, 65003=Riposte or a FeatID like KnockDown or some other special attack.
Definition: nwnx_damage.nss:90
NWNX_Damage_DamageData::iFire
int iFire
Fire damage.
Definition: nwnx_damage.nss:108
NWNX_Damage_DamageEventData::iSlash
int iSlash
Slashing damage.
Definition: nwnx_damage.nss:16
NWNX_Damage_AttackEventData::iCustom17
int iCustom17
Custom17 damage.
Definition: nwnx_damage.nss:83
NWNX_Damage_DamageEventData::iCustom1
int iCustom1
Custom1 damage.
Definition: nwnx_damage.nss:27
NWNX_Damage_DamageEventData::iCustom14
int iCustom14
Custom14 damage.
Definition: nwnx_damage.nss:40
NWNX_Damage_DamageData::iCustom5
int iCustom5
Custom5 damage.
Definition: nwnx_damage.nss:116
NWNX_Damage_DamageData::iPower
int iPower
For overcoming DR.
Definition: nwnx_damage.nss:131
NWNX_Damage_AttackEventData::iCustom13
int iCustom13
Custom13 damage.
Definition: nwnx_damage.nss:79
NWNX_Damage_DamageEventData::iCustom17
int iCustom17
Custom17 damage.
Definition: nwnx_damage.nss:43
NWNX_Damage_AttackEventData::iAcid
int iAcid
Acid damage.
Definition: nwnx_damage.nss:58
NWNX_Damage_DamageEventData::iCustom15
int iCustom15
Custom15 damage.
Definition: nwnx_damage.nss:41
NWNX_Damage_AttackEventData::iCustom7
int iCustom7
Custom7 damage.
Definition: nwnx_damage.nss:73
NWNX_Damage_DamageData::iCustom19
int iCustom19
Custom19 damage.
Definition: nwnx_damage.nss:130
NWNX_Damage_DamageData::iCold
int iCold
Cold damage.
Definition: nwnx_damage.nss:105
NWNX_Damage_DamageEventData::iCustom8
int iCustom8
Custom8 damage.
Definition: nwnx_damage.nss:34
NWNX_Damage_AttackEventData::iCustom2
int iCustom2
Custom2 damage.
Definition: nwnx_damage.nss:68
NWNX_Damage_AttackEventData::iAttackResult
int iAttackResult
1=hit, 2=parried, 3=critical hit, 4=miss, 5=resisted, 7=automatic hit, 8=concealed,...
Definition: nwnx_damage.nss:87
NWNX_Damage_AttackEventData::iCustom3
int iCustom3
Custom3 damage.
Definition: nwnx_damage.nss:69
NWNX_Damage_DamageEventData
Damage Event Data.
Definition: nwnx_damage.nss:11
NWNX_Damage_DamageEventData::iNegative
int iNegative
Negative damage.
Definition: nwnx_damage.nss:23
NWNX_Damage_DamageEventData::iCustom4
int iCustom4
Custom4 damage.
Definition: nwnx_damage.nss:30
NWNX_Damage_AttackEventData::iSonic
int iSonic
Sonic damage.
Definition: nwnx_damage.nss:65
NWNX_Damage_DamageEventData::iCustom7
int iCustom7
Custom7 damage.
Definition: nwnx_damage.nss:33
NWNX_Damage_DamageEventData::iPierce
int iPierce
Piercing damage.
Definition: nwnx_damage.nss:15
NWNX_Damage_AttackEventData::iElectrical
int iElectrical
Electrical damage.
Definition: nwnx_damage.nss:61
NWNX_Damage_AttackEventData::iCustom5
int iCustom5
Custom5 damage.
Definition: nwnx_damage.nss:71
NWNX_Damage_DamageData::iPositive
int iPositive
Positive damage.
Definition: nwnx_damage.nss:110