NWNX:EE  8193.36.12
nwnx_weapon.nss
Go to the documentation of this file.
1 #include "nwnx"
6 
7 const string NWNX_Weapon = "NWNX_Weapon";
8 
16 
18 // Get Event Data Constants
19 const int NWNX_WEAPON_GETDATA_DC = 0;
20 
21 // Set Event Data Constants
23 
26 {
27  object oWeapon;
28  object oTarget;
29  int nDamage;
30 };
31 
35 void NWNX_Weapon_SetWeaponFocusFeat(int nBaseItem, int nFeat);
36 
40 void NWNX_Weapon_SetWeaponFinesseSize(int nBaseItem, int nSize);
41 
44 int NWNX_Weapon_GetWeaponFinesseSize(int nBaseItem);
45 
48 void NWNX_Weapon_SetWeaponUnarmed(int nBaseItem);
49 
53 void NWNX_Weapon_SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat);
54 
58 void NWNX_Weapon_SetWeaponSpecializationFeat(int nBaseItem, int nFeat);
59 
63 void NWNX_Weapon_SetEpicWeaponFocusFeat(int nBaseItem, int nFeat);
64 
68 void NWNX_Weapon_SetEpicWeaponSpecializationFeat(int nBaseItem, int nFeat);
69 
73 void NWNX_Weapon_SetEpicWeaponOverwhelmingCriticalFeat(int nBaseItem, int nFeat);
74 
78 void NWNX_Weapon_SetEpicWeaponDevastatingCriticalFeat(int nBaseItem, int nFeat);
79 
83 void NWNX_Weapon_SetWeaponOfChoiceFeat(int nBaseItem, int nFeat);
84 
88 void NWNX_Weapon_SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat);
89 
93 void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat);
94 
98 void NWNX_Weapon_SetWeaponIsMonkWeapon(int nBaseItem);
99 
103 void NWNX_Weapon_SetOption(int nOption, int nVal);
104 
108 
113 
117 
122 void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist = FALSE);
123 
128 
135 void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred);
136 
138 
139 void NWNX_Weapon_SetWeaponFocusFeat(int nBaseItem, int nFeat)
140 {
141  string sFunc = "SetWeaponFocusFeat";
142 
143  NWNX_PushArgumentInt(nFeat);
144  NWNX_PushArgumentInt(nBaseItem);
145 
146  NWNX_CallFunction(NWNX_Weapon, sFunc);
147 }
148 
149 void NWNX_Weapon_SetEpicWeaponFocusFeat(int nBaseItem, int nFeat)
150 {
151  string sFunc = "SetEpicWeaponFocusFeat";
152 
153  NWNX_PushArgumentInt(nFeat);
154  NWNX_PushArgumentInt(nBaseItem);
155 
156  NWNX_CallFunction(NWNX_Weapon, sFunc);
157 }
158 
159 void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat)
160 {
161  string sFunc = "SetGreaterWeaponFocusFeat";
162 
163  NWNX_PushArgumentInt(nFeat);
164  NWNX_PushArgumentInt(nBaseItem);
165 
166  NWNX_CallFunction(NWNX_Weapon, sFunc);
167 }
168 
169 void NWNX_Weapon_SetWeaponFinesseSize(int nBaseItem, int nSize)
170 {
171  string sFunc = "SetWeaponFinesseSize";
172 
173  NWNX_PushArgumentInt(nSize);
174  NWNX_PushArgumentInt(nBaseItem);
175 
176  NWNX_CallFunction(NWNX_Weapon, sFunc);
177 }
178 
180 {
181  string sFunc = "GetWeaponFinesseSize";
182 
183  NWNX_PushArgumentInt(nBaseItem);
184 
185  NWNX_CallFunction(NWNX_Weapon, sFunc);
186 
187  return NWNX_GetReturnValueInt();
188 }
189 
190 void NWNX_Weapon_SetWeaponUnarmed(int nBaseItem)
191 {
192  string sFunc = "SetWeaponUnarmed";
193 
194  NWNX_PushArgumentInt(nBaseItem);
195 
196  NWNX_CallFunction(NWNX_Weapon, sFunc);
197 }
198 
200 {
201  WriteTimestampedLogEntry("NWNX_Weapon_SetWeaponIsMonkWeapon() is deprecated. Please use baseitems.2da instead.");
202 
203  string sFunc = "SetWeaponIsMonkWeapon";
204 
205  NWNX_PushArgumentInt(nBaseItem);
206 
207  NWNX_CallFunction(NWNX_Weapon, sFunc);
208 }
209 
210 void NWNX_Weapon_SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat)
211 {
212  string sFunc = "SetWeaponImprovedCriticalFeat";
213 
214  NWNX_PushArgumentInt(nFeat);
215  NWNX_PushArgumentInt(nBaseItem);
216 
217  NWNX_CallFunction(NWNX_Weapon, sFunc);
218 }
219 
220 void NWNX_Weapon_SetWeaponSpecializationFeat(int nBaseItem, int nFeat)
221 {
222  string sFunc = "SetWeaponSpecializationFeat";
223 
224  NWNX_PushArgumentInt(nFeat);
225  NWNX_PushArgumentInt(nBaseItem);
226 
227  NWNX_CallFunction(NWNX_Weapon, sFunc);
228 }
229 
231 {
232  string sFunc = "SetGreaterWeaponSpecializationFeat";
233 
234  NWNX_PushArgumentInt(nFeat);
235  NWNX_PushArgumentInt(nBaseItem);
236 
237  NWNX_CallFunction(NWNX_Weapon, sFunc);
238 }
239 
240 void NWNX_Weapon_SetEpicWeaponSpecializationFeat(int nBaseItem, int nFeat)
241 {
242  string sFunc = "SetEpicWeaponSpecializationFeat";
243 
244  NWNX_PushArgumentInt(nFeat);
245  NWNX_PushArgumentInt(nBaseItem);
246 
247  NWNX_CallFunction(NWNX_Weapon, sFunc);
248 }
249 
251 {
252  string sFunc = "SetEpicWeaponOverwhelmingCriticalFeat";
253 
254  NWNX_PushArgumentInt(nFeat);
255  NWNX_PushArgumentInt(nBaseItem);
256 
257  NWNX_CallFunction(NWNX_Weapon, sFunc);
258 }
259 
261 {
262  string sFunc = "SetEpicWeaponDevastatingCriticalFeat";
263 
264  NWNX_PushArgumentInt(nFeat);
265  NWNX_PushArgumentInt(nBaseItem);
266 
267  NWNX_CallFunction(NWNX_Weapon, sFunc);
268 }
269 
270 void NWNX_Weapon_SetWeaponOfChoiceFeat(int nBaseItem, int nFeat)
271 {
272  string sFunc = "SetWeaponOfChoiceFeat";
273 
274  NWNX_PushArgumentInt(nFeat);
275  NWNX_PushArgumentInt(nBaseItem);
276 
277  NWNX_CallFunction(NWNX_Weapon, sFunc);
278 }
279 
280 void NWNX_Weapon_SetOption(int nOption, int nVal)
281 {
282  string sFunc = "SetOption";
283 
284  NWNX_PushArgumentInt(nVal);
285  NWNX_PushArgumentInt(nOption);
286 
287  NWNX_CallFunction(NWNX_Weapon, sFunc);
288 }
289 
291 {
292  string sFunc = "SetDevastatingCriticalEventScript";
293 
294  NWNX_PushArgumentString(sScript);
295 
296  NWNX_CallFunction(NWNX_Weapon, sFunc);
297 }
298 
300 {
301  string sFunc = "SetEventData";
302 
305 
306  NWNX_CallFunction(NWNX_Weapon, sFunc);
307 }
308 
310 {
311  string sFunc = "GetEventData";
313 
315  NWNX_CallFunction(NWNX_Weapon, sFunc);
316 
320 
321  return data;
322 }
323 
324 void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist = FALSE)
325 {
326  string sFunc = "SetOneHalfStrength";
327  NWNX_PushArgumentInt(bPersist);
328  NWNX_PushArgumentInt(nEnable);
330  NWNX_CallFunction(NWNX_Weapon, sFunc);
331 }
332 
334 {
335  string sFunc = "GetOneHalfStrength";
337  NWNX_CallFunction(NWNX_Weapon, sFunc);
338 
339  return NWNX_GetReturnValueInt();
340 }
341 
342 void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred)
343 {
344  string sFunc = "SetMaxRangedAttackDistanceOverride";
345 
346  NWNX_PushArgumentFloat(fPreferred);
347  NWNX_PushArgumentFloat(fMaxPassive);
349  NWNX_PushArgumentInt(nBaseItem);
350  NWNX_CallFunction(NWNX_Weapon, sFunc);
351 }
NWNX_Weapon_BypassDevastatingCritical
void NWNX_Weapon_BypassDevastatingCritical()
Bypass Devastating Critical.
Definition: nwnx_weapon.nss:299
NWNX_Weapon_SetGreaterWeaponFocusFeat
void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat)
Set a feat as greater weapon focus for a base item.
Definition: nwnx_weapon.nss:159
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_Weapon_SetWeaponSpecializationFeat
void NWNX_Weapon_SetWeaponSpecializationFeat(int nBaseItem, int nFeat)
Set a feat as weapon specialization for a base item.
Definition: nwnx_weapon.nss:220
NWNX_Weapon_SetWeaponIsMonkWeapon
void NWNX_Weapon_SetWeaponIsMonkWeapon(int nBaseItem)
Set base item as monk weapon.
Definition: nwnx_weapon.nss:199
NWNX_Weapon_SetEpicWeaponOverwhelmingCriticalFeat
void NWNX_Weapon_SetEpicWeaponOverwhelmingCriticalFeat(int nBaseItem, int nFeat)
Set a feat as epic weapon overwhelming critical for a base item.
Definition: nwnx_weapon.nss:250
NWNX_Weapon_SetWeaponUnarmed
void NWNX_Weapon_SetWeaponUnarmed(int nBaseItem)
Set weapon base item to be considered as unarmed for weapon finesse feat.
Definition: nwnx_weapon.nss:190
NWNX_Weapon_SetOption
void NWNX_Weapon_SetOption(int nOption, int nVal)
Set plugin options.
Definition: nwnx_weapon.nss:280
NWNX_Weapon_DevastatingCriticalEvent_Data::nDamage
int nDamage
The damage points delivered.
Definition: nwnx_weapon.nss:29
NWNX_Weapon_SetEpicWeaponSpecializationFeat
void NWNX_Weapon_SetEpicWeaponSpecializationFeat(int nBaseItem, int nFeat)
Set a feat as epic weapon specialization for a base item.
Definition: nwnx_weapon.nss:240
NWNX_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
NWNX_Weapon_SetWeaponOfChoiceFeat
void NWNX_Weapon_SetWeaponOfChoiceFeat(int nBaseItem, int nFeat)
Set a feat as weapon of choice for a base item.
Definition: nwnx_weapon.nss:270
NWNX_Weapon_SetMaxRangedAttackDistanceOverride
void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred)
Override the max attack distance of ranged weapons.
Definition: nwnx_weapon.nss:342
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_Weapon_GetOneHalfStrength
int NWNX_Weapon_GetOneHalfStrength(object oWeapon)
Gets if the weapon is set to gain addition .5 strength bonus.
Definition: nwnx_weapon.nss:333
NWNX_Weapon_GetDevastatingCriticalEventData
struct NWNX_Weapon_DevastatingCriticalEvent_Data NWNX_Weapon_GetDevastatingCriticalEventData()
Get Devastating Critical Event Data.
Definition: nwnx_weapon.nss:309
NWNX_Weapon_DevastatingCriticalEvent_Data::oTarget
object oTarget
The target hit with a devastating critical.
Definition: nwnx_weapon.nss:28
NWNX_PushArgumentObject
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:69
NWNX_Weapon_SetDevastatingCriticalEventScript
void NWNX_Weapon_SetDevastatingCriticalEventScript(string sScript)
Set Devastating Critical Event Script.
Definition: nwnx_weapon.nss:290
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
NWNX_Weapon_SetGreaterWeaponSpecializationFeat
void NWNX_Weapon_SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat)
Set a feat as greater weapon specialization for a base item.
Definition: nwnx_weapon.nss:230
NWNX_WEAPON_OPT_GRTFOCUS_AB_BONUS
const int NWNX_WEAPON_OPT_GRTFOCUS_AB_BONUS
Greater Focus Attack Bonus.
Definition: nwnx_weapon.nss:14
NWNX_WEAPON_GETDATA_DC
const int NWNX_WEAPON_GETDATA_DC
Get Devastating Critical Data.
Definition: nwnx_weapon.nss:19
NWNX_Weapon_GetWeaponFinesseSize
int NWNX_Weapon_GetWeaponFinesseSize(int nBaseItem)
Get required creature size for a weapon base item to be finessable.
Definition: nwnx_weapon.nss:179
NWNX_GetReturnValueObject
object NWNX_GetReturnValueObject()
Returns the specified type from the c++ side.
Definition: nwnx.nss:104
NWNX_Weapon_SetWeaponFinesseSize
void NWNX_Weapon_SetWeaponFinesseSize(int nBaseItem, int nSize)
Set required creature size for a weapon base item to be finessable.
Definition: nwnx_weapon.nss:169
NWNX_Weapon_SetWeaponImprovedCriticalFeat
void NWNX_Weapon_SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat)
Set a feat as weapon improved critical for a base item.
Definition: nwnx_weapon.nss:210
NWNX_Weapon_DevastatingCriticalEvent_Data
Devastating critical event data.
Definition: nwnx_weapon.nss:25
NWNX_Weapon_SetEpicWeaponFocusFeat
void NWNX_Weapon_SetEpicWeaponFocusFeat(int nBaseItem, int nFeat)
Set a feat as epic weapon focus for a base item.
Definition: nwnx_weapon.nss:149
NWNX_PushArgumentFloat
void NWNX_PushArgumentFloat(float value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:64
NWNX_WEAPON_OPT_GRTSPEC_DAM_BONUS
const int NWNX_WEAPON_OPT_GRTSPEC_DAM_BONUS
Greater Specialization Damage Bonus.
Definition: nwnx_weapon.nss:15
NWNX_Weapon_SetEpicWeaponDevastatingCriticalFeat
void NWNX_Weapon_SetEpicWeaponDevastatingCriticalFeat(int nBaseItem, int nFeat)
Set a feat as epic weapon devastating critical for a base item.
Definition: nwnx_weapon.nss:260
NWNX_Weapon_DevastatingCriticalEvent_Data::oWeapon
object oWeapon
The weapon used to cause the event.
Definition: nwnx_weapon.nss:27
NWNX_Weapon_SetWeaponFocusFeat
void NWNX_Weapon_SetWeaponFocusFeat(int nBaseItem, int nFeat)
Set nFeat as weapon focus feat for a base item.
Definition: nwnx_weapon.nss:139
NWNX_WEAPON_SETDATA_DC_BYPASS
const int NWNX_WEAPON_SETDATA_DC_BYPASS
Set Devastating Critical Bypass.
Definition: nwnx_weapon.nss:22
NWNX_Weapon_SetOneHalfStrength
void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist=FALSE)
Sets weapon to gain .5 strength bonus.
Definition: nwnx_weapon.nss:324