Updated TLK for PRC8 update
Updated TLK for PRC8 update. Added placeable house blueprints. Updated NWNxEE. Full compile.
This commit is contained in:
143
_module/nss/array_example.nss
Normal file
143
_module/nss/array_example.nss
Normal file
@@ -0,0 +1,143 @@
|
||||
//#include "inc_array"
|
||||
#include "nwnx_time"
|
||||
|
||||
// nwnx_data also includes inc_array, so don't double dip.
|
||||
#include "nwnx_data"
|
||||
|
||||
void Log(string msg)
|
||||
{
|
||||
WriteTimestampedLogEntry(msg);
|
||||
}
|
||||
|
||||
void TestArrayOnModule()
|
||||
{
|
||||
|
||||
string array = "test";
|
||||
|
||||
// By default, temporary arrays are created on the module.
|
||||
Array_PushBack_Str(array, "BItem1");
|
||||
Array_PushBack_Str(array, "AItem2");
|
||||
Array_PushBack_Str(array, "AItem3");
|
||||
Array_PushBack_Str(array, "BItem2");
|
||||
Array_Debug_Dump(array, "After first load");
|
||||
|
||||
int foo = Array_Find_Str(array, "AItem3");
|
||||
Log("Found element AItem3 at index = " + IntToString(foo));
|
||||
|
||||
Array_Set_Str(array, 2, "Suck it up...");
|
||||
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
|
||||
|
||||
Array_Erase(array, 1);
|
||||
Array_Debug_Dump(array, "After delete 1");
|
||||
|
||||
Array_PushBack_Str(array, "MItem1");
|
||||
Array_PushBack_Str(array, "QItem2");
|
||||
Array_PushBack_Str(array, "NItem3");
|
||||
Array_PushBack_Str(array, "KItem2");
|
||||
|
||||
Array_Debug_Dump(array, "After add more");
|
||||
Array_SortAscending(array);
|
||||
|
||||
Array_Debug_Dump(array, "After sort");
|
||||
|
||||
Array_Shuffle(array);
|
||||
Array_Debug_Dump(array, "After shuffle");
|
||||
|
||||
Log( (Array_Contains_Str(array, "NItem3")) ? "Passed.. found it" : "Failed.. should have found it" );
|
||||
Log( (Array_Contains_Str(array, "KItem2")) ? "Passed.. found it" : "Failed.. should have found it" );
|
||||
Log( (Array_Contains_Str(array, "xxxxxx")) ? "Failed.. not found" : "Passed.. should not exist" );
|
||||
|
||||
Array_Clear(array);
|
||||
// Load up the array with 100 entries
|
||||
int i;
|
||||
|
||||
struct NWNX_Time_HighResTimestamp b;
|
||||
b = NWNX_Time_GetHighResTimeStamp();
|
||||
Log("Start Time: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
|
||||
for (i=0; i<1000; i++)
|
||||
{
|
||||
Array_PushBack_Str(array, IntToString(d100()) + " xxx " + IntToString(i));
|
||||
}
|
||||
b = NWNX_Time_GetHighResTimeStamp();
|
||||
Log("Loaded 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
|
||||
Array_Shuffle(array);
|
||||
b = NWNX_Time_GetHighResTimeStamp();
|
||||
Log("Shuffled 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
|
||||
for (i=5; i<995; i++)
|
||||
{
|
||||
// Delete the third entry a bunch of times
|
||||
Array_Erase(array, 3);
|
||||
}
|
||||
b = NWNX_Time_GetHighResTimeStamp();
|
||||
Log("Delete ~990: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
|
||||
Array_Debug_Dump(array, "After mass insert/delete");
|
||||
|
||||
}
|
||||
|
||||
void TestArrayOnChicken()
|
||||
{
|
||||
string array="chicken";
|
||||
// Let's create an array "on" our favorite creature: the deadly nw_chicken
|
||||
// Note - arrays aren't really attached to the item, but the module, and they
|
||||
// are tagged with the objects string representation.
|
||||
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
|
||||
if (!GetIsObjectValid(oCreature))
|
||||
{
|
||||
Log("NWNX_Creature test: Failed to create creature");
|
||||
return;
|
||||
}
|
||||
|
||||
Array_PushBack_Str(array, "BItem1", oCreature);
|
||||
Array_PushBack_Str(array, "AItem2", oCreature);
|
||||
Array_PushBack_Str(array, "AItem3", oCreature);
|
||||
Array_PushBack_Str(array, "BItem2", oCreature);
|
||||
Array_Debug_Dump(array, "After Chicken array load", oCreature);
|
||||
|
||||
}
|
||||
|
||||
void TestNWNXArray()
|
||||
{
|
||||
Log("");
|
||||
Log("Start NWNX_Data test.");
|
||||
string array = "test2";
|
||||
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem1");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem2");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem3");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem2");
|
||||
Array_Debug_Dump(array, "After first load");
|
||||
|
||||
int foo = NWNX_Data_Array_Find_Str(GetModule(), array, "ZItem3");
|
||||
Log("Found element AItem3 at index = " + IntToString(foo));
|
||||
|
||||
NWNX_Data_Array_Set_Str(GetModule(), array, 2, "Suck it up...");
|
||||
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
|
||||
|
||||
NWNX_Data_Array_Erase(NWNX_DATA_TYPE_STRING, GetModule(), array, 1);
|
||||
Array_Debug_Dump(array, "After delete 1");
|
||||
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "MItem1");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "QItem2");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "NItem3");
|
||||
NWNX_Data_Array_PushBack_Str(GetModule(), array, "KItem2");
|
||||
|
||||
Array_Debug_Dump(array, "After add more");
|
||||
NWNX_Data_Array_SortAscending(NWNX_DATA_TYPE_STRING, GetModule(), array);
|
||||
|
||||
Array_Debug_Dump(array, "After sort");
|
||||
|
||||
}
|
||||
|
||||
// Uncomment and assign to some event click.
|
||||
/* */
|
||||
void main()
|
||||
{
|
||||
Log("Start");
|
||||
|
||||
TestArrayOnModule();
|
||||
|
||||
TestArrayOnChicken();
|
||||
|
||||
TestNWNXArray();
|
||||
}
|
||||
/* */
|
33
_module/nss/codi_attacked.nss
Normal file
33
_module/nss/codi_attacked.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_attacked
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnAttacked event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnAttacked script
|
||||
ExecuteScript("no_ai_atk", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnAttacked script
|
||||
//ExecuteScript("nw_c2_default5", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnAttacked script
|
||||
ExecuteScript("prc_npc_physatt", OBJECT_SELF);
|
||||
}
|
24
_module/nss/codi_endcombat.nss
Normal file
24
_module/nss/codi_endcombat.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_endcombat
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC EndCombatRound event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Execute the CODI AI NPC OnCombatRoundEnd script
|
||||
ExecuteScript("no_ai_cmb", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnCombatRoundEnd script
|
||||
//ExecuteScript("nw_c2_default3", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnCombatRoundEnd script
|
||||
ExecuteScript("prc_npc_combat", OBJECT_SELF);
|
||||
}
|
65
_module/nss/codi_heartbeat.nss
Normal file
65
_module/nss/codi_heartbeat.nss
Normal file
@@ -0,0 +1,65 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_heartbeat
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC Heartbeat event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oNPC = OBJECT_SELF;
|
||||
object oAttacker;
|
||||
string sResRef = GetResRef(oNPC);
|
||||
|
||||
//:: Runs special swarm HB
|
||||
// if (sResRef == "ds_repbatswrm001" ||
|
||||
// sResRef == "ds_minkankswrm01" ||
|
||||
// sResRef == "ds_locustswarm01" ||
|
||||
// sResRef == "ar_berzwasp001" ||
|
||||
// sResRef == "ar_berzwasp002" )
|
||||
// {
|
||||
// ExecuteScript("cr_locust_hb", oNPC);
|
||||
// }
|
||||
|
||||
//:: Equips best armor
|
||||
if ((!GetIsInCombat(oNPC) && (GetItemInSlot(INVENTORY_SLOT_CHEST) == OBJECT_INVALID)))
|
||||
DelayCommand(0.5f, ActionEquipMostEffectiveArmor());
|
||||
|
||||
//:: Handles Vampire's Gaseous form death.
|
||||
if(sResRef == "ra_vamp_gas_form")
|
||||
{
|
||||
//:: Get nearest alive PC.
|
||||
oAttacker = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oNPC, 1, CREATURE_TYPE_IS_ALIVE, TRUE);
|
||||
|
||||
//:: Set destroyable.
|
||||
SetIsDestroyable(TRUE, FALSE, FALSE);
|
||||
|
||||
//:: Remove plot/immoral/lootable flags JUST in case.
|
||||
SetPlotFlag(oNPC, FALSE);
|
||||
SetImmortal(oNPC, FALSE);
|
||||
SetLootable(oNPC, FALSE);
|
||||
|
||||
//:: Clear Actions & run away
|
||||
ClearAllActions();
|
||||
ActionMoveAwayFromObject(oAttacker, TRUE, 300.0f);
|
||||
|
||||
//:: Destroy ourselves after fleeing the scene
|
||||
DelayCommand(10.0f, DestroyObject(oNPC));
|
||||
}
|
||||
|
||||
//:: Execute the CODI NPC OnHeartbeat script
|
||||
ExecuteScript("no_ai_hrt", oNPC);
|
||||
|
||||
//:: Execute the default NPC OnHeartbeat script
|
||||
//ExecuteScript("nw_c2_default1", oNPC);
|
||||
|
||||
//:: Execute the PRC NPC OnHeartbeat script
|
||||
ExecuteScript("prc_npc_hb", oNPC);
|
||||
}
|
21
_module/nss/codi_onblocked.nss
Normal file
21
_module/nss/codi_onblocked.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_onblocked
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnBlocked event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Execute the CODI AI NPC OnBlocked script
|
||||
ExecuteScript("no_ai_blk", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnBlocked script
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
}
|
25
_module/nss/codi_onconv.nss
Normal file
25
_module/nss/codi_onconv.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_onconv
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnConversation event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Execute the CODI AI NPC OnConversation script
|
||||
ExecuteScript("no_ai_cnv", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnConversation script
|
||||
//ExecuteScript("nw_c2_default4", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnConversation script
|
||||
ExecuteScript("prc_npc_conv", OBJECT_SELF);
|
||||
}
|
54
_module/nss/codi_ondamage.nss
Normal file
54
_module/nss/codi_ondamage.nss
Normal file
@@ -0,0 +1,54 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_ondamage
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDamaged event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
int nTotalDamage = GetTotalDamageDealt();
|
||||
int nFireDamage = 0;
|
||||
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Handles healing from fire damage
|
||||
if(sResRef == "BLEAKBORN001" || sResRef == "BLEAKBORN002")
|
||||
{
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) != -1)
|
||||
{
|
||||
nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
|
||||
//DelayCommand(0.0f, SpeakString("Fire Damage: " + IntToString(nFireDamage)));
|
||||
}
|
||||
|
||||
effect eHeal = EffectTemporaryHitpoints(nFireDamage/3);
|
||||
//DelayCommand(0.0f, SpeakString("Subdual damage healed: " + IntToString(nSubDmg)));
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF, 0.0f);
|
||||
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnDamaged script
|
||||
ExecuteScript("no_ai_dam", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnDamaged script
|
||||
//ExecuteScript("nw_c2_default6", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnDamaged script
|
||||
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
|
||||
}
|
111
_module/nss/codi_ondeath.nss
Normal file
111
_module/nss/codi_ondeath.nss
Normal file
@@ -0,0 +1,111 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_ondeath
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDeath event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_combmove"
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oNPC = OBJECT_SELF;
|
||||
object oPC = GetLastKiller();
|
||||
|
||||
//int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG");
|
||||
|
||||
string sTagSelf = GetTag(oNPC);
|
||||
//string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET");
|
||||
|
||||
string sResRef = GetResRef(oNPC);
|
||||
|
||||
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE);
|
||||
|
||||
//:: End any active grapple from Improved Grab
|
||||
EndGrapple(oNPC, GetGrappleTarget(oNPC));
|
||||
|
||||
int nBalor = GetStringLeft(GetTag(OBJECT_SELF), 9) == "POA_BALOR" ? TRUE : FALSE;
|
||||
if(nBalor)
|
||||
{
|
||||
DelayCommand(0.0f, ExecuteScript("nw_s3_balordeth",OBJECT_SELF));
|
||||
}
|
||||
|
||||
|
||||
int nInsanity = GetLocalInt(OBJECT_SELF,"INSANITY");
|
||||
if(nInsanity)
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = GetLastKiller();
|
||||
effect eConfuse = EffectConfused();
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eLink = EffectLinkEffects(eMind, eConfuse);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = SupernaturalEffect(eLink);
|
||||
|
||||
// Get oCaster's DC
|
||||
int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster);
|
||||
int nCreHD = GetHitDice (oCaster);
|
||||
int nDC = (10 + (nCreHD/2) + nCreCHAMod);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
|
||||
|
||||
if ( !PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oCaster))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
|
||||
AssignCommand(oTarget,SpeakString("*The "+GetName(oCaster)+" has driven you insane!*"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//:: Vampire's Gaseous Form onDeath
|
||||
if(sResRef == "ra_vampspawn01" || sResRef == "ra_vampspawn02")
|
||||
{
|
||||
effect eVFX;
|
||||
object oSpawn;
|
||||
location lSelf = GetLocation(OBJECT_SELF);
|
||||
|
||||
//:: Apply some visual effects & unload the model.
|
||||
eVFX = EffectVisualEffect(VFX_COM_UNLOAD_MODEL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_COM_BLOOD_CRT_RED);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(491);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
|
||||
//:: Spawn Gaseous Form.
|
||||
eVFX = EffectVisualEffect(133);
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ra_vamp_gas_form", GetLocation(oNPC));
|
||||
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSpawn));;
|
||||
|
||||
}
|
||||
|
||||
//:: Execute CODI AI NPC OnDeath script
|
||||
DelayCommand(0.0f, ExecuteScript("no_ai_dth", OBJECT_SELF));
|
||||
|
||||
//:: Execute NWN NPC OnDeath script
|
||||
//ExecuteScript("nw_c2_default7", OBJECT_SELF);
|
||||
|
||||
//:: Execute PWFXP XP script
|
||||
//DelayCommand(0.0f, ExecuteScript("pwfxp", OBJECT_SELF));
|
||||
|
||||
//:: Execute PRC NPC OnDeath script
|
||||
DelayCommand(0.0f, ExecuteScript("prc_npc_death", OBJECT_SELF));
|
||||
|
||||
//:: Execute PRC PW OnDeath scripts
|
||||
DelayCommand(0.0f, ExecuteScript("prc_pwondeath", OBJECT_SELF));
|
||||
}
|
24
_module/nss/codi_ondisturb.nss
Normal file
24
_module/nss/codi_ondisturb.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_ondisturb
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDisturbed event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Execute the CODI AI NPC OnDisturbed script
|
||||
ExecuteScript("no_ai_dis", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnDisturbed script
|
||||
//ExecuteScript("nw_c2_default8", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnDisturbed script
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
}
|
27
_module/nss/codi_percept.nss
Normal file
27
_module/nss/codi_percept.nss
Normal file
@@ -0,0 +1,27 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_percept
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnPerception event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 202400331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oPC = GetLastPerceived();
|
||||
|
||||
//:: Execute the CODI AI NPC OnPerception script
|
||||
ExecuteScript("no_ai_per", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnPerception script
|
||||
//ExecuteScript("nw_c2_default2", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnPerception script
|
||||
ExecuteScript("prc_npc_percep", OBJECT_SELF);
|
||||
}
|
25
_module/nss/codi_rested.nss
Normal file
25
_module/nss/codi_rested.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_rested
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnRested event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Execute the CODI AI NPC OnRested script
|
||||
ExecuteScript("no_ai_rst", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnRested script
|
||||
//ExecuteScript("nw_c2_defaulta", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnRested script
|
||||
ExecuteScript("prc_npc_rested", OBJECT_SELF);
|
||||
}
|
608
_module/nss/codi_spawn.nss
Normal file
608
_module/nss/codi_spawn.nss
Normal file
@@ -0,0 +1,608 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_spawn
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnSpawn event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
2003-07-28: Georg Zoeller:
|
||||
|
||||
If you set a ninteger on the creature named
|
||||
"X2_USERDEFINED_ONSPAWN_EVENTS"
|
||||
The creature will fire a pre and a post-spawn
|
||||
event on itself, depending on the value of that
|
||||
variable
|
||||
1 - Fire Userdefined Event 1510 (pre spawn)
|
||||
2 - Fire Userdefined Event 1511 (post spawn)
|
||||
3 - Fire both events
|
||||
|
||||
2007-12-31: Deva Winblood
|
||||
Modified to look for X3_HORSE_OWNER_TAG and if
|
||||
it is defined look for an NPC with that tag
|
||||
nearby or in the module (checks near first).
|
||||
It will make that NPC this horse's master.
|
||||
|
||||
20221201: Jaysyn
|
||||
Modified to read desired CODI AI spawner
|
||||
from string var "SPAWN_TYPE" set on the NPC,
|
||||
defaults to fighter.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Keith Warner, Georg Zoeller
|
||||
//:: Created On: June 11/03
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
|
||||
#include "ms_name_inc"
|
||||
#include "x2_inc_switches"
|
||||
|
||||
void Embiggen(object oNPC, float fIncrease);
|
||||
|
||||
void Embiggen(object oNPC, float fIncrease)
|
||||
{
|
||||
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, fIncrease);
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: User defined OnSpawn event requested?
|
||||
int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
|
||||
|
||||
//:: Pre Spawn Event requested
|
||||
if (nSpecEvent == 1 || nSpecEvent == 3 )
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
|
||||
}
|
||||
|
||||
//:: Declare major variables
|
||||
object oNPC;
|
||||
|
||||
string sTag;
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
string sSpawnType = "no_spn_ftr";
|
||||
|
||||
sSpawnType = GetLocalString(OBJECT_SELF,"SPAWN_TYPE");
|
||||
|
||||
if (sSpawnType == "")
|
||||
{
|
||||
sSpawnType = "no_spn_ftr";
|
||||
}
|
||||
|
||||
sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
|
||||
if (GetStringLength(sTag)>0)
|
||||
{ // look for master
|
||||
oNPC=GetNearestObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // look in module
|
||||
oNPC=GetObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
DeleteLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
|
||||
} // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
} // look in module
|
||||
} // look for master
|
||||
|
||||
|
||||
//:: Handles various Aura effects
|
||||
int nAtropal = GetTag(OBJECT_SELF) == "ATROPAL001" ? TRUE : FALSE;
|
||||
if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF);
|
||||
|
||||
int AtropalScion = GetTag(OBJECT_SELF) == "ATROPALSCION001" ? TRUE : FALSE;
|
||||
if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF);
|
||||
|
||||
int nBleakborn = GetStringLeft(GetTag(OBJECT_SELF), 9) == "BLEAKBORN" ? TRUE : FALSE;
|
||||
if(nBleakborn)ExecuteScript("bleakaura",OBJECT_SELF);
|
||||
|
||||
int nCryptChanter = GetStringLeft(GetTag(OBJECT_SELF), 12) == "CRYPTCHANTER" ? TRUE : FALSE;
|
||||
if(nCryptChanter)ExecuteScript("drainingmelody",OBJECT_SELF);
|
||||
|
||||
int nNWalker = GetStringLeft(GetTag(OBJECT_SELF), 11) == "NIGHTWALKER" ? TRUE : FALSE;
|
||||
if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF);
|
||||
|
||||
int nNCrawler = GetStringLeft(GetTag(OBJECT_SELF), 12) == "NIGHTCRAWLER" ? TRUE : FALSE;
|
||||
if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF);
|
||||
|
||||
int nVoidWraith = GetStringLeft(GetTag(OBJECT_SELF), 10) == "VOIDWRAITH" ? TRUE : FALSE;
|
||||
if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF);
|
||||
|
||||
int nGhast1 = GetStringLeft(GetTag(OBJECT_SELF), 5) == "GHAST" ? TRUE : FALSE;
|
||||
if(nGhast1)ExecuteScript("ghast_stench",OBJECT_SELF);
|
||||
if(nGhast1)ExecuteScript("zombie_feed",OBJECT_SELF);
|
||||
|
||||
int nGhast2 = GetStringLeft(GetTag(OBJECT_SELF), 8) == "NW_GHAST" ? TRUE : FALSE;
|
||||
if(nGhast2)ExecuteScript("ghast_stench",OBJECT_SELF);
|
||||
if(nGhast2)ExecuteScript("zombie_feed",OBJECT_SELF);
|
||||
|
||||
int nGhoul = GetStringLeft(GetTag(OBJECT_SELF), 5) == "GHOUL" ? TRUE : FALSE;
|
||||
if(nGhoul)ExecuteScript("zombie_feed",OBJECT_SELF);
|
||||
|
||||
int nGhoul2 = GetStringLeft(GetTag(OBJECT_SELF), 8) == "NW_GHOUL" ? TRUE : FALSE;
|
||||
if(nGhoul2)ExecuteScript("zombie_feed",OBJECT_SELF);
|
||||
|
||||
int nZombie = GetStringLeft(GetTag(OBJECT_SELF), 7) == "NW_ZOMB" ? TRUE : FALSE;
|
||||
if(nZombie)ExecuteScript("zombie_feed",OBJECT_SELF);
|
||||
|
||||
int nDecay = GetStringLeft(GetTag(OBJECT_SELF), 12) == "ANGELOFDECAY" ? TRUE : FALSE;
|
||||
if(nDecay)ExecuteScript("rotura",OBJECT_SELF);
|
||||
|
||||
int nDecay1 = GetStringLeft(GetTag(OBJECT_SELF), 13) == "DS_YELMUSKCRP" ? TRUE : FALSE;
|
||||
if(nDecay1)ExecuteScript("consume_int",OBJECT_SELF);
|
||||
|
||||
int nPrisma = GetStringLeft(GetTag(OBJECT_SELF), 12) == "PRISMASAURUS" ? TRUE : FALSE;
|
||||
if(nPrisma)ExecuteScript("prism_aura",OBJECT_SELF);
|
||||
|
||||
int nDream = GetStringLeft(GetTag(OBJECT_SELF), 12) == "DREAMVESTIGE" ? TRUE : FALSE;
|
||||
if(nDream)ExecuteScript("desecrating_aura",OBJECT_SELF);
|
||||
|
||||
int nWinter = GetStringLeft(GetTag(OBJECT_SELF), 11) == "WINTERWIGHT" ? TRUE : FALSE;
|
||||
if(nWinter)ExecuteScript("ww_aura",OBJECT_SELF);
|
||||
|
||||
int nPlague = GetStringLeft(GetTag(OBJECT_SELF), 12) == "PLAGUEBLIGHT" ? TRUE : FALSE;
|
||||
if(nPlague)ExecuteScript("plagueaura",OBJECT_SELF);
|
||||
|
||||
int nHunefer = GetStringLeft(GetTag(OBJECT_SELF), 7) == "HUNEFER" ? TRUE : FALSE;
|
||||
if(nHunefer)ExecuteScript("fear2_aura",OBJECT_SELF);
|
||||
|
||||
|
||||
//:: Make a creature a little bigger.
|
||||
int nEmbiggen = GetLocalInt(OBJECT_SELF,"EMBIGGEN");
|
||||
if (nEmbiggen > 0)
|
||||
{
|
||||
float fIncrease = (IntToFloat(nEmbiggen)+100.0) / 100.0;
|
||||
DelayCommand(0.0f, Embiggen(OBJECT_SELF, fIncrease));
|
||||
}
|
||||
|
||||
//:: Handle various onspawn immunities & buffs
|
||||
|
||||
//:: Shadows should be unaffected by darkness
|
||||
int nShadow1 = GetStringLeft(GetTag(OBJECT_SELF), 9) == "NW_SHADOW" ? TRUE : FALSE;
|
||||
if(nShadow1)
|
||||
{
|
||||
effect eUltraVis = EffectUltravision();
|
||||
eUltraVis = SupernaturalEffect(eUltraVis);
|
||||
eUltraVis = ExtraordinaryEffect(eUltraVis);
|
||||
eUltraVis = UnyieldingEffect(eUltraVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eUltraVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nShadow2 = GetStringLeft(GetTag(OBJECT_SELF), 6) == "SHADOW" ? TRUE : FALSE;
|
||||
if(nShadow2)
|
||||
{
|
||||
effect eUltraVis = EffectUltravision();
|
||||
eUltraVis = SupernaturalEffect(eUltraVis);
|
||||
eUltraVis = ExtraordinaryEffect(eUltraVis);
|
||||
eUltraVis = UnyieldingEffect(eUltraVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eUltraVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoStun = GetLocalInt(OBJECT_SELF,"NOSTUN");
|
||||
if (nNoStun > 0)
|
||||
{
|
||||
effect eNoStun = EffectImmunity(IMMUNITY_TYPE_STUN);
|
||||
eNoStun = SupernaturalEffect(eNoStun);
|
||||
eNoStun = ExtraordinaryEffect(eNoStun);
|
||||
eNoStun = UnyieldingEffect(eNoStun);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoStun,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNatInvis1 = GetLocalInt(OBJECT_SELF,"NATURAL_INVIS");
|
||||
if (nNatInvis1 == 1)
|
||||
{
|
||||
effect eNatInvis = EffectInvisibility(4);
|
||||
eNatInvis = SupernaturalEffect(eNatInvis);
|
||||
//eNatInvis = ExtraordinaryEffect(eNatInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNatInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNatInvis2 = GetLocalInt(OBJECT_SELF,"NATURAL_INVIS");
|
||||
if (nNatInvis2 == 2)
|
||||
{
|
||||
effect eNatInvis = EffectInvisibility(4);
|
||||
eNatInvis = SupernaturalEffect(eNatInvis);
|
||||
eNatInvis = ExtraordinaryEffect(eNatInvis);
|
||||
eNatInvis = UnyieldingEffect(eNatInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNatInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nSeeInvis = GetLocalInt(OBJECT_SELF,"SEE_INVIS");
|
||||
if (nSeeInvis > 0)
|
||||
{
|
||||
effect eSeeInvis = EffectSeeInvisible();
|
||||
eSeeInvis = SupernaturalEffect(eSeeInvis);
|
||||
eSeeInvis = ExtraordinaryEffect(eSeeInvis);
|
||||
eSeeInvis = UnyieldingEffect(eSeeInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSeeInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoSleep = GetLocalInt(OBJECT_SELF,"NOSLEEP");
|
||||
if (nNoSleep > 0)
|
||||
{
|
||||
effect eNoSleep = EffectImmunity(IMMUNITY_TYPE_SLEEP);
|
||||
eNoSleep = SupernaturalEffect(eNoSleep);
|
||||
eNoSleep = ExtraordinaryEffect(eNoSleep);
|
||||
eNoSleep = UnyieldingEffect(eNoSleep);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoSleep,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoDaze = GetLocalInt(OBJECT_SELF,"NODAZE");
|
||||
if (nNoDaze > 0)
|
||||
{
|
||||
effect eNoDaze = EffectImmunity(IMMUNITY_TYPE_DAZED);
|
||||
eNoDaze = SupernaturalEffect(eNoDaze);
|
||||
eNoDaze = ExtraordinaryEffect(eNoDaze);
|
||||
eNoDaze = UnyieldingEffect(eNoDaze);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoDaze,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoBlind = GetLocalInt(OBJECT_SELF,"NOBLIND");
|
||||
if (nNoBlind > 0)
|
||||
{
|
||||
effect eNoBlind = EffectImmunity(IMMUNITY_TYPE_BLINDNESS);
|
||||
eNoBlind = SupernaturalEffect(eNoBlind);
|
||||
eNoBlind = ExtraordinaryEffect(eNoBlind);
|
||||
eNoBlind = UnyieldingEffect(eNoBlind);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoBlind,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoDeaf = GetLocalInt(OBJECT_SELF,"NODEAF");
|
||||
if (nNoDeaf > 0)
|
||||
{
|
||||
effect eNoDeaf = EffectImmunity(IMMUNITY_TYPE_DEAFNESS);
|
||||
eNoDeaf = SupernaturalEffect(eNoDeaf);
|
||||
eNoDeaf = ExtraordinaryEffect(eNoDeaf);
|
||||
eNoDeaf = UnyieldingEffect(eNoDeaf);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoDeaf,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nDeaf = GetLocalInt(OBJECT_SELF,"IS_DEAF");
|
||||
if (nDeaf > 0)
|
||||
{
|
||||
effect eDeaf = EffectDeaf();
|
||||
eDeaf = SupernaturalEffect(eDeaf);
|
||||
eDeaf = ExtraordinaryEffect(eDeaf);
|
||||
eDeaf = UnyieldingEffect(eDeaf);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDeaf,OBJECT_SELF));
|
||||
}
|
||||
|
||||
/* Fix for the new golems to reduce their number of attacks */
|
||||
|
||||
int nNumber = GetLocalInt(OBJECT_SELF,CREATURE_VAR_NUMBER_OF_ATTACKS);
|
||||
if (nNumber >0 )
|
||||
{
|
||||
SetBaseAttackBonus(nNumber);
|
||||
}
|
||||
|
||||
int nVFX = GetLocalInt(OBJECT_SELF,"SpawnVFX");
|
||||
if(nVFX)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(nVFX)),OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nRegen = GetLocalInt(OBJECT_SELF,"FAST_HEALING");
|
||||
if(nRegen)
|
||||
{
|
||||
effect eRegen = EffectRegenerate(nRegen, 6.0f);
|
||||
eRegen = SupernaturalEffect(eRegen);
|
||||
eRegen = ExtraordinaryEffect(eRegen);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRegen, OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY");
|
||||
if (nShadowy)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nStony = GetLocalInt(OBJECT_SELF,"STONY");
|
||||
if (nStony)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
int nFirey = GetLocalInt(OBJECT_SELF,"FIREY");
|
||||
if (nFirey)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_INFERNO_NO_SOUND);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
int nWoody = GetLocalInt(OBJECT_SELF,"WOODY");
|
||||
if (nWoody)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_BARKSKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nConcealed20 = GetLocalInt(OBJECT_SELF,"CONCEALED20");
|
||||
if (nConcealed20)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(20, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nConcealed50 = GetLocalInt(OBJECT_SELF,"CONCEALED50");
|
||||
if (nConcealed50)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(50, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nIcy = GetLocalInt(OBJECT_SELF,"ICY");
|
||||
if (nIcy)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ICESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nSR = GetLocalInt(OBJECT_SELF,"SPELL_RESISTANCE");
|
||||
if ( nSR )
|
||||
{
|
||||
effect eSR = EffectSpellResistanceIncrease(nSR);
|
||||
eSR = SupernaturalEffect(eSR);
|
||||
eSR = ExtraordinaryEffect(eSR);
|
||||
eSR = UnyieldingEffect(eSR);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSR,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nAttackBonus = GetLocalInt(OBJECT_SELF,"ATTACK_BONUS");
|
||||
if ( nAttackBonus )
|
||||
{
|
||||
effect eAttack = EffectAttackIncrease(nAttackBonus);
|
||||
eAttack = SupernaturalEffect(eAttack);
|
||||
eAttack = ExtraordinaryEffect(eAttack);
|
||||
eAttack = UnyieldingEffect(eAttack);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eAttack,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nIceShield = GetLocalInt(OBJECT_SELF,"FROST_SHIELD");
|
||||
if ( nIceShield )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_COLD);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
eShield = UnyieldingEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nAcidShield = GetLocalInt(OBJECT_SELF,"ACID_SHIELD");
|
||||
if ( nAcidShield )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d8,DAMAGE_TYPE_ACID);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
eShield = UnyieldingEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nSerratedEdge = GetLocalInt(OBJECT_SELF,"SERRATED_EDGE");
|
||||
if ( nSerratedEdge )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_SLASHING);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
eShield = UnyieldingEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nSpikedArmor = GetLocalInt(OBJECT_SELF,"SPIKED_ARMOR");
|
||||
if ( nSpikedArmor )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d4,DAMAGE_TYPE_PIERCING);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
eShield = UnyieldingEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
//:: OnSpawn Glow effects
|
||||
int nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR");
|
||||
if (nGlow == 1)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 2)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 3)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 4)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 5)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 6)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 7)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 8)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 9)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 10)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 11)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 12)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 13)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 14)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 15)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 16)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
eVis = UnyieldingEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
//:: If Incorporeal, apply changes
|
||||
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
|
||||
{
|
||||
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
|
||||
eConceal = ExtraordinaryEffect(eConceal);
|
||||
effect eGhost = EffectCutsceneGhost();
|
||||
eGhost = ExtraordinaryEffect(eGhost);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
|
||||
}
|
||||
|
||||
//:: Execute OnSpawn script.
|
||||
int nSpider = GetStringLeft(GetTag(OBJECT_SELF), 12) == "MONST_SPIDER" ? TRUE : FALSE;
|
||||
if(nSpider)
|
||||
{
|
||||
//:: Execute drop in from above spawn.
|
||||
ExecuteScript("nw_c2_dropin9", OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
//:: Execute CODI AI OnSpawn script.
|
||||
ExecuteScript(sSpawnType, OBJECT_SELF);
|
||||
|
||||
//:: Execute default OnSpawn script.
|
||||
//ExecuteScript("nw_c2_default9", OBJECT_SELF);
|
||||
}
|
||||
|
||||
//:: Set or Randomize name
|
||||
ms_Nomenclature(OBJECT_SELF);
|
||||
|
||||
//:: Execute PRC OnSpawn script.
|
||||
ExecuteScript("prc_npc_spawn", OBJECT_SELF);
|
||||
|
||||
|
||||
//:: Post Spawn event requested
|
||||
if (nSpecEvent == 2 || nSpecEvent == 3)
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
|
||||
}
|
||||
|
||||
}
|
33
_module/nss/codi_spellcast.nss
Normal file
33
_module/nss/codi_spellcast.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_spellcast
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnSpellCastAt event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnSpellCastAt script
|
||||
ExecuteScript("no_ai_spt", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnSpellCastAt script
|
||||
//ExecuteScript("nw_c2_defaultb", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnSpellCastAt script
|
||||
ExecuteScript("prc_npc_spellat", OBJECT_SELF);
|
||||
}
|
170
_module/nss/codi_userdef.nss
Normal file
170
_module/nss/codi_userdef.nss
Normal file
@@ -0,0 +1,170 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name codi_userdef
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnUserDefined event script caller to run
|
||||
CODI AI & PRC events.
|
||||
|
||||
May need to actually disable most of this for
|
||||
the CODI AI.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
int nUser = GetUserDefinedEventNumber();
|
||||
int nFireDamage = 0;
|
||||
int nAcidDamage = 0;
|
||||
int nColdDamage = 0;
|
||||
int nDivineDamage = 0;
|
||||
int nElectricalDamage = 0;
|
||||
int nPositiveDamage = 0;
|
||||
int nNegativeDamage = 0;
|
||||
int nMagicalDamage = 0;
|
||||
int nSonicDamage = 0;
|
||||
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
|
||||
effect eSleep = EffectSleep();
|
||||
effect eSlow = EffectSlow();
|
||||
|
||||
if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
|
||||
{
|
||||
if(sResRef == "ra_troll001" || sResRef == "TROLL_FEDORLA")
|
||||
{
|
||||
if(GetLocalInt(OBJECT_SELF, "nSubDual") > 0)
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "nSubDual", GetLocalInt(OBJECT_SELF, "nSubDual") - 5);
|
||||
|
||||
if(GetLocalInt(OBJECT_SELF, "nSubDual") < GetCurrentHitPoints(OBJECT_SELF))
|
||||
{
|
||||
RemoveEffect(OBJECT_SELF, eSleep);
|
||||
}
|
||||
//SpeakString("My Subdual is now " + IntToString(GetLocalInt(OBJECT_SELF, "nSubDual")));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(nUser == EVENT_PERCEIVE) // PERCEIVE
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_ATTACKED) // ATTACKED
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DAMAGED) // DAMAGED
|
||||
{
|
||||
//:: Handles swarm immunity to physical weapons
|
||||
if(sResRef == "ds_minkankswrm01" || sResRef == "ds_locustswarm01")
|
||||
{
|
||||
int nTotalDamage = GetTotalDamageDealt();
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) > 0)
|
||||
{
|
||||
nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_ACID) > 0)
|
||||
{
|
||||
nAcidDamage = GetDamageDealtByType(DAMAGE_TYPE_ACID);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_COLD) > 0)
|
||||
{
|
||||
nColdDamage = GetDamageDealtByType(DAMAGE_TYPE_COLD);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_DIVINE) > 0)
|
||||
{
|
||||
nDivineDamage = GetDamageDealtByType(DAMAGE_TYPE_DIVINE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL) > 0)
|
||||
{
|
||||
nElectricalDamage = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_MAGICAL) > 0)
|
||||
{
|
||||
nMagicalDamage = GetDamageDealtByType(DAMAGE_TYPE_MAGICAL);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE) > 0)
|
||||
{
|
||||
nNegativeDamage = GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_POSITIVE) > 0)
|
||||
{
|
||||
nPositiveDamage = GetDamageDealtByType(DAMAGE_TYPE_POSITIVE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_SONIC) > 0)
|
||||
{
|
||||
nSonicDamage = GetDamageDealtByType(DAMAGE_TYPE_SONIC);
|
||||
}
|
||||
|
||||
|
||||
int nSubDmg = nTotalDamage - (nFireDamage
|
||||
+ nAcidDamage
|
||||
+ nColdDamage
|
||||
+ nDivineDamage
|
||||
+ nElectricalDamage
|
||||
+ nMagicalDamage
|
||||
+ nNegativeDamage
|
||||
+ nPositiveDamage
|
||||
+ nSonicDamage);
|
||||
|
||||
int nActDmg = (nFireDamage + nAcidDamage
|
||||
+ nColdDamage
|
||||
+ nDivineDamage
|
||||
+ nElectricalDamage
|
||||
+ nMagicalDamage
|
||||
+ nNegativeDamage
|
||||
+ nPositiveDamage
|
||||
+ nSonicDamage);
|
||||
|
||||
effect eHeal = EffectHeal(nSubDmg);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF, 0.0f);
|
||||
|
||||
}
|
||||
}
|
||||
else if(nUser == 1007) // DEATH - do not use for critical code, does not fire reliably all the time
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DISTURBED) // DISTURBED
|
||||
{
|
||||
|
||||
}
|
||||
else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
|
||||
{
|
||||
|
||||
}
|
||||
else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//:: Execute the PRC NPC OnUserDef script
|
||||
ExecuteScript("prc_npc_userdef", OBJECT_SELF);
|
||||
|
||||
}
|
||||
|
||||
|
512
_module/nss/inc_array.nss
Normal file
512
_module/nss/inc_array.nss
Normal file
@@ -0,0 +1,512 @@
|
||||
/// @addtogroup data Data
|
||||
/// @brief Provides a number of data structures for NWN code to use (simulated arrays)
|
||||
/// @{
|
||||
/// @file nwnx_data.nss
|
||||
|
||||
const int INVALID_INDEX = -1;
|
||||
const int TYPE_FLOAT = 0;
|
||||
const int TYPE_INTEGER = 1;
|
||||
const int TYPE_OBJECT = 2;
|
||||
const int TYPE_STRING = 3;
|
||||
|
||||
/// @defgroup data_array_at Array At
|
||||
/// @brief Returns the element at the index.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @return The element of associated type.
|
||||
/// @{
|
||||
string Array_At_Str(string tag, int index, object obj=OBJECT_INVALID);
|
||||
float Array_At_Flt(string tag, int index, object obj=OBJECT_INVALID);
|
||||
int Array_At_Int(string tag, int index, object obj=OBJECT_INVALID);
|
||||
object Array_At_Obj(string tag, int index, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
|
||||
/// Clears the entire array, such that size==0.
|
||||
void Array_Clear(string tag, object obj=OBJECT_INVALID);
|
||||
|
||||
/// @defgroup data_array_contains Array Contains
|
||||
/// @brief Checks if array contains the element.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @return TRUE if the collection contains the element.
|
||||
/// @{
|
||||
int Array_Contains_Flt(string tag, float element, object obj=OBJECT_INVALID);
|
||||
int Array_Contains_Int(string tag, int element, object obj=OBJECT_INVALID);
|
||||
int Array_Contains_Obj(string tag, object element, object obj=OBJECT_INVALID);
|
||||
int Array_Contains_Str(string tag, string element, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
/// Copies the array of name otherTag over the array of name tag.
|
||||
void Array_Copy(string tag, string otherTag, object obj=OBJECT_INVALID);
|
||||
|
||||
/// Erases the element at index, and shuffles any elements from index size-1 to index + 1 left.
|
||||
void Array_Erase(string tag, int index, object obj=OBJECT_INVALID);
|
||||
|
||||
/// @defgroup data_array_find Array Find
|
||||
/// @brief Get the index at which the element is located.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @return Returns the index at which the element is located, or ARRAY_INVALID_INDEX.
|
||||
/// @{
|
||||
int Array_Find_Flt(string tag, float element, object obj=OBJECT_INVALID);
|
||||
int Array_Find_Int(string tag, int element, object obj=OBJECT_INVALID);
|
||||
int Array_Find_Obj(string tag, object element, object obj=OBJECT_INVALID);
|
||||
int Array_Find_Str(string tag, string element, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
/// @defgroup data_array_insert Array Insert
|
||||
/// @brief Inserts the element at the index, where size > index >= 0.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void Array_Insert_Flt(string tag, int index, float element, object obj=OBJECT_INVALID);
|
||||
void Array_Insert_Int(string tag, int index, int element, object obj=OBJECT_INVALID);
|
||||
void Array_Insert_Obj(string tag, int index, object element, object obj=OBJECT_INVALID);
|
||||
void Array_Insert_Str(string tag, int index, string element, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
/// @defgroup data_array_pushback Array Pushback
|
||||
/// @brief Pushes an element to the back of the collection.
|
||||
/// @remark Functionally identical to an insert at index size-1.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void Array_PushBack_Flt(string tag, float element, object obj=OBJECT_INVALID);
|
||||
void Array_PushBack_Int(string tag, int element, object obj=OBJECT_INVALID);
|
||||
void Array_PushBack_Obj(string tag, object element, object obj=OBJECT_INVALID);
|
||||
void Array_PushBack_Str(string tag, string element, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
/// Resizes the array. If the array is shrinking, it chops off elements at the ned.
|
||||
void Array_Resize(string tag, int size, object obj=OBJECT_INVALID);
|
||||
|
||||
/// Reorders the array such each possible permutation of elements has equal probability of appearance.
|
||||
void Array_Shuffle(string tag, object obj=OBJECT_INVALID);
|
||||
|
||||
/// Returns the size of the array.
|
||||
int Array_Size(string tag, object obj=OBJECT_INVALID);
|
||||
|
||||
/// Sorts the collection based on descending order.
|
||||
void Array_SortAscending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID);
|
||||
|
||||
/// Sorts the collection based on descending order.
|
||||
void Array_SortDescending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID);
|
||||
|
||||
/// @defgroup data_array_set Array Set
|
||||
/// @brief Sets the element at the index, where size > index >= 0.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void Array_Set_Flt(string tag, int index, float element, object obj=OBJECT_INVALID);
|
||||
void Array_Set_Int(string tag, int index, int element, object obj=OBJECT_INVALID);
|
||||
void Array_Set_Obj(string tag, int index, object element, object obj=OBJECT_INVALID);
|
||||
void Array_Set_Str(string tag, int index, string element, object obj=OBJECT_INVALID);
|
||||
/// @}
|
||||
|
||||
/// @}
|
||||
|
||||
//
|
||||
// Local Utility Functions.
|
||||
//
|
||||
string GetTableName(string tag, object obj=OBJECT_INVALID, int bare=FALSE) {
|
||||
if (obj == OBJECT_INVALID)
|
||||
obj = GetModule();
|
||||
|
||||
string sName = "array_" + ObjectToString(obj) + "_" + tag;
|
||||
// Remove invalid characters from the tag rather than failing.
|
||||
string sCleansed = RegExpReplace("[^A-Za-z0-9_\$@#]", sName, "");
|
||||
// But provide some feedback.
|
||||
if (GetStringLength(sName) != GetStringLength(sCleansed) || GetStringLength(sCleansed) == 0) {
|
||||
WriteTimestampedLogEntry("WARNING: Invalid table name detected for array with tag <" + tag + ">. Only characters (a-zA-Z0-9), _, @, $ and # are allowed. Using <"+sCleansed+"> instead.");
|
||||
|
||||
}
|
||||
|
||||
// BARE returns just the table name with no wrapping.
|
||||
if (bare == TRUE) {
|
||||
return sCleansed;
|
||||
}
|
||||
|
||||
// Table name wraped in quotes to avoid token expansion.
|
||||
return "\""+sCleansed+"\"";
|
||||
}
|
||||
|
||||
string GetTableCreateString(string tag, object obj=OBJECT_INVALID) {
|
||||
// for simplicity sake, everything is turned into a string. Possible enhancement
|
||||
// to create specific tables for int/float/whatever.
|
||||
return "CREATE TABLE IF NOT EXISTS " + GetTableName(tag, obj) + " ( ind INTEGER, value TEXT )";
|
||||
}
|
||||
|
||||
int TableExists(string tag, object obj=OBJECT_INVALID) {
|
||||
string stmt = "SELECT name FROM sqlite_master WHERE type = 'table' AND name = @tablename;";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindString(sqlQuery, "@tablename", GetTableName(tag, obj, TRUE));
|
||||
return SqlStep(sqlQuery);
|
||||
}
|
||||
|
||||
void ExecuteStatement(string statement, object obj=OBJECT_INVALID) {
|
||||
if (obj == OBJECT_INVALID)
|
||||
obj = GetModule();
|
||||
// There's no direct "execute this.." everything has to be prepared then executed.
|
||||
//WriteTimestampedLogEntry("SQL: " + statement);
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), statement);
|
||||
SqlStep(sqlQuery);
|
||||
}
|
||||
|
||||
void CreateArrayTable(string tag, object obj=OBJECT_INVALID) {
|
||||
string createStatement = GetTableCreateString(tag, obj);
|
||||
ExecuteStatement(createStatement, obj);
|
||||
}
|
||||
|
||||
// Get the table row count. Returns -1 on error (0 is a valid number of rows in a table)
|
||||
int GetRowCount(string tag, object obj=OBJECT_INVALID) {
|
||||
if (obj == OBJECT_INVALID)
|
||||
obj = GetModule();
|
||||
CreateArrayTable(tag, obj);
|
||||
string stmt = "SELECT COUNT(1) FROM " + GetTableName(tag, obj);
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
if ( SqlStep(sqlQuery) ) {
|
||||
return SqlGetInt(sqlQuery, 0);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// return the value contained in location "index"
|
||||
string Array_At_Str(string tag, int index, object obj=OBJECT_INVALID)
|
||||
{
|
||||
// Just "create if not exists" to ensure it exists for the insert.
|
||||
CreateArrayTable(tag, obj);
|
||||
|
||||
string stmt = "SELECT value FROM " + GetTableName(tag, obj) + " WHERE ind = @ind";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", index);
|
||||
if ( SqlStep(sqlQuery) ) {
|
||||
return SqlGetString(sqlQuery, 0);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
float Array_At_Flt(string tag, int index, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string st = Array_At_Str(tag, index, obj);
|
||||
if (st == "") {
|
||||
return 0.0;
|
||||
}
|
||||
return StringToFloat(st);
|
||||
}
|
||||
|
||||
int Array_At_Int(string tag, int index, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string st = Array_At_Str(tag, index, obj);
|
||||
if (st == "") {
|
||||
return 0;
|
||||
}
|
||||
return StringToInt(st);
|
||||
}
|
||||
|
||||
object Array_At_Obj(string tag, int index, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string st = Array_At_Str(tag, index, obj);
|
||||
if (st == "") {
|
||||
return OBJECT_INVALID;
|
||||
}
|
||||
return StringToObject(st);
|
||||
}
|
||||
|
||||
void Array_Clear(string tag, object obj=OBJECT_INVALID)
|
||||
{
|
||||
ExecuteStatement("delete from "+GetTableName(tag, obj), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return true/value (1/0) if the array contains the value "element"
|
||||
int Array_Contains_Str(string tag, string element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
CreateArrayTable(tag, obj);
|
||||
string stmt = "SELECT COUNT(1) FROM "+GetTableName(tag, obj)+" WHERE value = @element";
|
||||
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindString(sqlQuery, "@element", element);
|
||||
|
||||
int pos = -1;
|
||||
if ( SqlStep(sqlQuery) ) {
|
||||
pos = SqlGetInt(sqlQuery, 0);
|
||||
if (pos > 0) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int Array_Contains_Flt(string tag, float element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Contains_Str(tag, FloatToString(element), obj);
|
||||
}
|
||||
|
||||
int Array_Contains_Int(string tag, int element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Contains_Str(tag, IntToString(element), obj);
|
||||
}
|
||||
|
||||
int Array_Contains_Obj(string tag, object element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Contains_Str(tag, ObjectToString(element), obj);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Array_Copy(string tag, string otherTag, object obj=OBJECT_INVALID)
|
||||
{
|
||||
CreateArrayTable(otherTag, obj);
|
||||
ExecuteStatement("INSERT INTO "+GetTableName(otherTag, obj)+" SELECT * FROM "+GetTableName(tag, obj), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Array_Erase(string tag, int index, object obj=OBJECT_INVALID)
|
||||
{
|
||||
int rows = GetRowCount(tag, obj);
|
||||
// Silently fail if "index" is outside the range of valid indicies.
|
||||
if (index >= 0 && index < rows) {
|
||||
string stmt = "DELETE FROM "+GetTableName(tag, obj)+" WHERE ind = @ind";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", index);
|
||||
SqlStep(sqlQuery);
|
||||
|
||||
stmt = "UPDATE "+GetTableName(tag, obj)+" SET ind = ind - 1 WHERE ind > @ind";
|
||||
sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", index);
|
||||
SqlStep(sqlQuery);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// return the index in the array containing "element"
|
||||
// if not found, return INVALID_INDEX
|
||||
int Array_Find_Str(string tag, string element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string stmt;
|
||||
sqlquery sqlQuery;
|
||||
|
||||
// Just create it before trying to select in case it doesn't exist yet.
|
||||
CreateArrayTable(tag, obj);
|
||||
|
||||
stmt = "SELECT IFNULL(MIN(ind),@invalid_index) FROM "+GetTableName(tag, obj)+" WHERE value = @element";
|
||||
sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
|
||||
SqlBindInt(sqlQuery, "@invalid_index", INVALID_INDEX);
|
||||
SqlBindString(sqlQuery, "@element", element);
|
||||
if ( SqlStep(sqlQuery) ) {
|
||||
return SqlGetInt(sqlQuery, 0);
|
||||
}
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
|
||||
int Array_Find_Flt(string tag, float element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Find_Str(tag, FloatToString(element), obj);
|
||||
}
|
||||
|
||||
int Array_Find_Int(string tag, int element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Find_Str(tag, IntToString(element), obj);
|
||||
}
|
||||
|
||||
int Array_Find_Obj(string tag, object element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return Array_Find_Str(tag, ObjectToString(element), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Insert a new element into position 'index'. If index is beyond the number of rows in the array,
|
||||
// this will quietly fail. This could be changed if you wanted to support sparse
|
||||
// arrays.
|
||||
void Array_Insert_Str(string tag, int index, string element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
int rows = GetRowCount(tag, obj);
|
||||
// Index numbers are off by one, much like C arrays, so for "rows=10" - values are 0-9.
|
||||
// It's not unreasonable to fail if you try to insert ind=10 into an array who's indexes
|
||||
// only go to 9, but I guess it doesn't hurt as long as we're not allowing gaps in
|
||||
// index numbers.
|
||||
if (index >= 0 && index <= rows) {
|
||||
// index is passed as an integer, so immune (as far as I know) to SQL injection for a one shot query.
|
||||
ExecuteStatement("UPDATE "+GetTableName(tag, obj)+" SET ind = ind + 1 WHERE ind >= "+IntToString(index), obj);
|
||||
// Element, however, is not.
|
||||
string stmt = "INSERT INTO "+GetTableName(tag, obj)+" VALUES ( @ind, @element )";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", index);
|
||||
SqlBindString(sqlQuery, "@element", element);
|
||||
SqlStep(sqlQuery);
|
||||
}
|
||||
}
|
||||
|
||||
void Array_Insert_Flt(string tag, int index, float element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Insert_Str(tag, index, FloatToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_Insert_Int(string tag, int index, int element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Insert_Str(tag, index, IntToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_Insert_Obj(string tag, int index, object element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Insert_Str(tag, index, ObjectToString(element), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Insert a new element at the end of the array.
|
||||
void Array_PushBack_Str(string tag, string element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
// Create it before trhing to INSERT into it. If it already exists, this is a no-op.
|
||||
CreateArrayTable(tag, obj);
|
||||
|
||||
// If rowCount = 10, indexes are from 0 to 9, so this becomes the 11th entry at index 10.
|
||||
int rowCount = GetRowCount(tag, obj);
|
||||
|
||||
string stmt = "INSERT INTO "+GetTableName(tag, obj)+" VALUES ( @ind, @element )";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", rowCount);
|
||||
SqlBindString(sqlQuery, "@element", element);
|
||||
SqlStep(sqlQuery);
|
||||
}
|
||||
|
||||
void Array_PushBack_Flt(string tag, float element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_PushBack_Str(tag, FloatToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_PushBack_Int(string tag, int element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_PushBack_Str(tag, IntToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_PushBack_Obj(string tag, object element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_PushBack_Str(tag, ObjectToString(element), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Cuts the array off at size 'size'. Elements beyond size are removed.
|
||||
void Array_Resize(string tag, int size, object obj=OBJECT_INVALID)
|
||||
{
|
||||
// Int immune to sql injection so easier to one-shot it.
|
||||
ExecuteStatement("DELETE FROM "+GetTableName(tag, obj)+" WHERE ind >= " + IntToString(size), obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Array_Shuffle(string tag, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string table = GetTableName(tag, obj, TRUE);
|
||||
ExecuteStatement("CREATE TABLE " +table+ "_temp AS SELECT ROW_NUMBER() OVER(ORDER BY RANDOM())-1, value FROM " +table, obj);
|
||||
ExecuteStatement("DELETE FROM " +table , obj);
|
||||
ExecuteStatement("INSERT INTO " +table+ " SELECT * FROM " +table+ "_temp", obj);
|
||||
ExecuteStatement("DROP TABLE " +table+ "_TEMP", obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Array_Size(string tag, object obj=OBJECT_INVALID)
|
||||
{
|
||||
return GetRowCount(tag, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sort the array by value according to 'direction' (ASC or DESC).
|
||||
// Supplying a type allows for correct numerical sorting of integers or floats.
|
||||
void Array_Sort(string tag, string dir="ASC", int type=TYPE_STRING, object obj=OBJECT_INVALID)
|
||||
{
|
||||
string table = GetTableName(tag, obj, TRUE);
|
||||
string direction = GetStringUpperCase(dir);
|
||||
|
||||
if ( ! (direction == "ASC" || direction == "DESC") ) {
|
||||
WriteTimestampedLogEntry("WARNING: Invalid sort direction <" + direction + "> supplied. Defaulting to ASC.");
|
||||
direction = "ASC";
|
||||
}
|
||||
|
||||
// default orderBy for strings.
|
||||
string orderBy = "ORDER BY value " + direction;
|
||||
switch(type) {
|
||||
case TYPE_INTEGER:
|
||||
orderBy = "ORDER BY CAST(value AS INTEGER)" + direction;
|
||||
break;
|
||||
case TYPE_FLOAT:
|
||||
orderBy = "ORDER BY CAST(value AS DECIMAL)" + direction;
|
||||
break;
|
||||
}
|
||||
ExecuteStatement("CREATE TABLE " +table+ "_temp AS SELECT ROW_NUMBER() OVER(" + orderBy + ")-1, value FROM " +table, obj);
|
||||
ExecuteStatement("DELETE FROM " +table, obj);
|
||||
ExecuteStatement("INSERT INTO " +table+ " SELECT * FROM " +table+ "_temp", obj);
|
||||
ExecuteStatement("DROP TABLE " +table+ "_temp", obj);
|
||||
}
|
||||
|
||||
void Array_SortAscending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Sort(tag, "ASC", type, obj);
|
||||
}
|
||||
|
||||
void Array_SortDescending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Sort(tag, "DESC", type, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the value of array index 'index' to a 'element'
|
||||
// This will quietly eat values if index > array size
|
||||
void Array_Set_Str(string tag, int index, string element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
int rows = GetRowCount(tag, obj);
|
||||
if (index >= 0 && index <= rows) {
|
||||
string stmt = "UPDATE "+GetTableName(tag, obj)+" SET value = @element WHERE ind = @ind";
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
SqlBindInt(sqlQuery, "@ind", index);
|
||||
SqlBindString(sqlQuery, "@element", element);
|
||||
SqlStep(sqlQuery);
|
||||
}
|
||||
}
|
||||
|
||||
void Array_Set_Flt(string tag, int index, float element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Set_Str(tag, index, FloatToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_Set_Int(string tag, int index, int element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Set_Str(tag, index, IntToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_Set_Obj(string tag, int index, object element, object obj=OBJECT_INVALID)
|
||||
{
|
||||
Array_Set_Str(tag, index, ObjectToString(element), obj);
|
||||
}
|
||||
|
||||
void Array_Debug_Dump(string tag, string title = "xxx", object obj=OBJECT_INVALID) {
|
||||
if (title != "xxx") {
|
||||
WriteTimestampedLogEntry("== " + title + " ======================================");
|
||||
}
|
||||
WriteTimestampedLogEntry("Table name = " + GetTableName(tag, obj));
|
||||
string stmt = "SELECT ind, value FROM " + GetTableName(tag, obj);
|
||||
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
|
||||
int ind = -1;
|
||||
string value = "";
|
||||
while ( SqlStep(sqlQuery) ) {
|
||||
ind = SqlGetInt(sqlQuery, 0);
|
||||
value = SqlGetString(sqlQuery, 1);
|
||||
WriteTimestampedLogEntry(tag + "[" + IntToString(ind) + "] = " + value);
|
||||
}
|
||||
}
|
68
_module/nss/inc_sqlite_time.nss
Normal file
68
_module/nss/inc_sqlite_time.nss
Normal file
@@ -0,0 +1,68 @@
|
||||
/// @addtogroup time Time
|
||||
/// @brief Provides various time related functions.
|
||||
/// @{
|
||||
/// @file inc_sqlite_time.nss
|
||||
|
||||
/// @brief Returns the current time formatted according to the provided sqlite date time format string.
|
||||
/// @param format Format string as used by sqlites STRFTIME().
|
||||
/// @return The current time in the requested format. Empty string on error.
|
||||
string SQLite_GetFormattedSystemTime(string format);
|
||||
|
||||
/// @return Returns the number of seconds since midnight on January 1, 1970.
|
||||
int SQLite_GetTimeStamp();
|
||||
|
||||
/// @brief A millisecond timestamp
|
||||
struct SQLite_MillisecondTimeStamp
|
||||
{
|
||||
int seconds; ///< Seconds since epoch
|
||||
int milliseconds; ///< Milliseconds
|
||||
};
|
||||
|
||||
/// @remark For mircosecond timestamps use NWNX_Utility_GetHighResTimeStamp().
|
||||
/// @return Returns the number of milliseconds since midnight on January 1, 1970.
|
||||
struct SQLite_MillisecondTimeStamp SQLite_GetMillisecondTimeStamp();
|
||||
|
||||
/// @brief Returns the current date.
|
||||
/// @return The date in the format (mm/dd/yyyy).
|
||||
string SQLite_GetSystemDate();
|
||||
|
||||
/// @brief Returns current time.
|
||||
/// @return The current time in the format (24:mm:ss).
|
||||
string SQLite_GetSystemTime();
|
||||
|
||||
/// @}
|
||||
|
||||
string SQLite_GetFormattedSystemTime(string format)
|
||||
{
|
||||
sqlquery query = SqlPrepareQueryObject(GetModule(), "SELECT STRFTIME(@format, 'now', 'localtime')");
|
||||
SqlBindString(query, "@format", format);
|
||||
SqlStep(query); // sqlite returns NULL for invalid format in STRFTIME()
|
||||
return SqlGetString(query, 0);
|
||||
}
|
||||
|
||||
int SQLite_GetTimeStamp()
|
||||
{
|
||||
sqlquery query = SqlPrepareQueryObject(GetModule(), "SELECT STRFTIME('%s', 'now')");
|
||||
SqlStep(query);
|
||||
return SqlGetInt(query, 0);
|
||||
}
|
||||
|
||||
struct SQLite_MillisecondTimeStamp SQLite_GetMillisecondTimeStamp()
|
||||
{
|
||||
sqlquery query = SqlPrepareQueryObject(GetModule(), "SELECT STRFTIME('%s', 'now'), SUBSTR(STRFTIME('%f', 'now'), 4)");
|
||||
SqlStep(query);
|
||||
struct SQLite_MillisecondTimeStamp t;
|
||||
t.seconds = SqlGetInt(query, 0);
|
||||
t.milliseconds = SqlGetInt(query, 1);
|
||||
return t;
|
||||
}
|
||||
|
||||
string SQLite_GetSystemDate()
|
||||
{
|
||||
return SQLite_GetFormattedSystemTime("%m/%d/%Y");
|
||||
}
|
||||
|
||||
string SQLite_GetSystemTime()
|
||||
{
|
||||
return SQLite_GetFormattedSystemTime("%H:%M:%S");
|
||||
}
|
37
_module/nss/nw_c2_vampireg9.nss
Normal file
37
_module/nss/nw_c2_vampireg9.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: NW_C2_VAMPIREG9.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Vampire gas, when spawned in tries to
|
||||
move coffin with same name as self
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: January 2002
|
||||
//:://////////////////////////////////////////////
|
||||
void main()
|
||||
{
|
||||
// * search for nearest coffin
|
||||
int bFound = FALSE;
|
||||
int nCount = 0;
|
||||
while (bFound == FALSE)
|
||||
{
|
||||
object oCoffin = GetObjectByTag(GetTag(OBJECT_SELF),nCount);
|
||||
nCount++;
|
||||
if (GetIsObjectValid(oCoffin) && (GetObjectType(oCoffin) == OBJECT_TYPE_PLACEABLE))
|
||||
{
|
||||
bFound = TRUE;
|
||||
ActionMoveToObject(oCoffin, FALSE, 3.0); //* moving this number too close will make this break
|
||||
ActionDoCommand(SignalEvent(OBJECT_SELF, EventUserDefined(7777)));
|
||||
SetCommandable(FALSE);
|
||||
}
|
||||
else
|
||||
// * if no coffin then destroy self
|
||||
if (GetIsObjectValid(oCoffin) == FALSE)
|
||||
{
|
||||
bFound = TRUE;
|
||||
DestroyObject(OBJECT_SELF, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,111 +3,135 @@
|
||||
/// @{
|
||||
/// @file nwnx.nss
|
||||
|
||||
const string NWNX_Core = "NWNX_Core"; ///< @private
|
||||
|
||||
/// @brief Scripting interface to NWNX.
|
||||
/// @param pluginName The plugin name.
|
||||
/// @param functionName The function name (do not include NWNX_Plugin_).
|
||||
void NWNX_CallFunction(string pluginName, string functionName);
|
||||
/// @brief Pushes the specified type to the c++ side
|
||||
/// @param pluginName The plugin name.
|
||||
/// @param functionName The function name (do not include NWNX_Plugin_).
|
||||
/// @param value The value of specified type to push.
|
||||
void NWNX_PushArgumentInt(string pluginName, string functionName, int value);
|
||||
void NWNX_PushArgumentInt(int value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentFloat(string pluginName, string functionName, float value);
|
||||
void NWNX_PushArgumentFloat(float value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentObject(string pluginName, string functionName, object value);
|
||||
void NWNX_PushArgumentObject(object value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentString(string pluginName, string functionName, string value);
|
||||
void NWNX_PushArgumentString(string value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentEffect(string pluginName, string functionName, effect value);
|
||||
void NWNX_PushArgumentEffect(effect value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentItemProperty(string pluginName, string functionName, itemproperty value);
|
||||
void NWNX_PushArgumentItemProperty(itemproperty value);
|
||||
/// @copydoc NWNX_PushArgumentInt()
|
||||
void NWNX_PushArgumentJson(json value);
|
||||
/// @brief Returns the specified type from the c++ side
|
||||
/// @param pluginName The plugin name.
|
||||
/// @param functionName The function name (do not include NWNX_Plugin_).
|
||||
/// @return The value of specified type.
|
||||
int NWNX_GetReturnValueInt(string pluginName, string functionName);
|
||||
int NWNX_GetReturnValueInt();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
float NWNX_GetReturnValueFloat(string pluginName, string functionName);
|
||||
float NWNX_GetReturnValueFloat();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
object NWNX_GetReturnValueObject(string pluginName, string functionName);
|
||||
object NWNX_GetReturnValueObject();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
string NWNX_GetReturnValueString(string pluginName, string functionName);
|
||||
string NWNX_GetReturnValueString();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
effect NWNX_GetReturnValueEffect(string pluginName, string functionName);
|
||||
effect NWNX_GetReturnValueEffect();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
itemproperty NWNX_GetReturnValueItemProperty(string pluginName, string functionName);
|
||||
itemproperty NWNX_GetReturnValueItemProperty();
|
||||
/// @copydoc NWNX_GetReturnValueInt()
|
||||
json NWNX_GetReturnValueJson();
|
||||
|
||||
/// @brief Determines if the given plugin exists and is enabled.
|
||||
/// @param sPlugin The name of the plugin to check. This is the case sensitive plugin name as used by NWNX_CallFunction, NWNX_PushArgumentX
|
||||
/// @note Example usage: NWNX_PluginExists("NWNX_Creature");
|
||||
/// @return TRUE if the plugin exists and is enabled, otherwise FALSE.
|
||||
int NWNX_PluginExists(string sPlugin);
|
||||
|
||||
/// @private
|
||||
string NWNX_INTERNAL_BuildString(string pluginName, string functionName, string operation)
|
||||
{
|
||||
return "NWNXEE!ABIv2!" + pluginName + "!" + functionName + "!" + operation;
|
||||
}
|
||||
const string NWNX_PUSH = "NWNXEE!ABIv2!X!Y!PUSH";
|
||||
const string NWNX_POP = "NWNXEE!ABIv2!X!Y!POP";
|
||||
/// @}
|
||||
|
||||
void NWNX_CallFunction(string pluginName, string functionName)
|
||||
{
|
||||
PlaySound(NWNX_INTERNAL_BuildString(pluginName, functionName, "CALL"));
|
||||
PlaySound("NWNXEE!ABIv2!" + pluginName + "!" + functionName + "!CALL");
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentInt(string pluginName, string functionName, int value)
|
||||
void NWNX_PushArgumentInt(int value)
|
||||
{
|
||||
SetLocalInt(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
|
||||
SetLocalInt(OBJECT_INVALID, NWNX_PUSH, value);
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentFloat(string pluginName, string functionName, float value)
|
||||
void NWNX_PushArgumentFloat(float value)
|
||||
{
|
||||
SetLocalFloat(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
|
||||
SetLocalFloat(OBJECT_INVALID, NWNX_PUSH, value);
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentObject(string pluginName, string functionName, object value)
|
||||
void NWNX_PushArgumentObject(object value)
|
||||
{
|
||||
SetLocalObject(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
|
||||
SetLocalObject(OBJECT_INVALID, NWNX_PUSH, value);
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentString(string pluginName, string functionName, string value)
|
||||
void NWNX_PushArgumentString(string value)
|
||||
{
|
||||
SetLocalString(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
|
||||
SetLocalString(OBJECT_INVALID, NWNX_PUSH, value);
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentEffect(string pluginName, string functionName, effect value)
|
||||
void NWNX_PushArgumentEffect(effect value)
|
||||
{
|
||||
TagEffect(value, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"));
|
||||
TagEffect(value, NWNX_PUSH);
|
||||
}
|
||||
|
||||
void NWNX_PushArgumentItemProperty(string pluginName, string functionName, itemproperty value)
|
||||
void NWNX_PushArgumentItemProperty(itemproperty value)
|
||||
{
|
||||
TagItemProperty(value, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"));
|
||||
TagItemProperty(value, NWNX_PUSH);
|
||||
}
|
||||
|
||||
int NWNX_GetReturnValueInt(string pluginName, string functionName)
|
||||
void NWNX_PushArgumentJson(json value)
|
||||
{
|
||||
return GetLocalInt(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
SetLocalJson(OBJECT_INVALID, NWNX_PUSH, value);
|
||||
}
|
||||
|
||||
float NWNX_GetReturnValueFloat(string pluginName, string functionName)
|
||||
int NWNX_GetReturnValueInt()
|
||||
{
|
||||
return GetLocalFloat(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
return GetLocalInt(OBJECT_INVALID, NWNX_POP);
|
||||
}
|
||||
|
||||
object NWNX_GetReturnValueObject(string pluginName, string functionName)
|
||||
float NWNX_GetReturnValueFloat()
|
||||
{
|
||||
return GetLocalObject(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
return GetLocalFloat(OBJECT_INVALID, NWNX_POP);
|
||||
}
|
||||
|
||||
string NWNX_GetReturnValueString(string pluginName, string functionName)
|
||||
object NWNX_GetReturnValueObject()
|
||||
{
|
||||
return GetLocalString(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
return GetLocalObject(OBJECT_INVALID, NWNX_POP);
|
||||
}
|
||||
|
||||
effect NWNX_GetReturnValueEffect(string pluginName, string functionName)
|
||||
string NWNX_GetReturnValueString()
|
||||
{
|
||||
return GetLocalString(OBJECT_INVALID, NWNX_POP);
|
||||
}
|
||||
|
||||
effect NWNX_GetReturnValueEffect()
|
||||
{
|
||||
effect e;
|
||||
return TagEffect(e, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
return TagEffect(e, NWNX_POP);
|
||||
}
|
||||
|
||||
itemproperty NWNX_GetReturnValueItemProperty(string pluginName, string functionName)
|
||||
itemproperty NWNX_GetReturnValueItemProperty()
|
||||
{
|
||||
itemproperty ip;
|
||||
return TagItemProperty(ip, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
|
||||
return TagItemProperty(ip, NWNX_POP);
|
||||
}
|
||||
|
||||
json NWNX_GetReturnValueJson()
|
||||
{
|
||||
return GetLocalJson(OBJECT_INVALID, NWNX_POP);
|
||||
}
|
||||
|
||||
int NWNX_PluginExists(string sPlugin)
|
||||
{
|
||||
string sFunc = "PluginExists";
|
||||
NWNX_PushArgumentString(sPlugin);
|
||||
NWNX_CallFunction(NWNX_Core, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
@@ -10,16 +10,16 @@ const string NWNX_Administration = "NWNX_Administration"; ///< @private
|
||||
/// @anchor admin_opts
|
||||
///
|
||||
/// @{
|
||||
const int NWNX_ADMINISTRATION_OPTION_ALL_KILLABLE = 0; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_NON_PARTY_KILLABLE = 1; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_REQUIRE_RESURRECTION = 2; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_STOLEN_ITEMS = 3; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS = 4; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP = 5; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD = 6; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD_NUM = 7;
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP_NUM = 8;
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS_NUM = 9;
|
||||
const int NWNX_ADMINISTRATION_OPTION_ALL_KILLABLE = 0; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_NON_PARTY_KILLABLE = 1; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_REQUIRE_RESURRECTION = 2; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_STOLEN_ITEMS = 3; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS = 4; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP = 5; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD = 6; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD_NUM = 7; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP_NUM = 8; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS_NUM = 9; // DOES NOT DO ANYTHING
|
||||
const int NWNX_ADMINISTRATION_OPTION_PVP_SETTING = 10; // 0 = No PVP, 1 = Party PVP, 2 = Full PVP
|
||||
const int NWNX_ADMINISTRATION_OPTION_PAUSE_AND_PLAY = 11; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_ONE_PARTY_ONLY = 12; // TRUE/FALSE
|
||||
@@ -37,6 +37,8 @@ const int NWNX_ADMINISTRATION_OPTION_USE_MAX_HITPOINTS = 23; // TRUE/FA
|
||||
const int NWNX_ADMINISTRATION_OPTION_RESTORE_SPELLS_USES = 24; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_RESET_ENCOUNTER_SPAWN_POOL = 25; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_HIDE_HITPOINTS_GAINED = 26; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_PLAYER_PARTY_CONTROL = 27; // TRUE/FALSE
|
||||
const int NWNX_ADMINISTRATION_OPTION_SHOW_PLAYER_JOIN_MESSAGES = 28; // TRUE/FALSE
|
||||
/// @}
|
||||
|
||||
/// @name Administration Debug Types
|
||||
@@ -156,6 +158,23 @@ void NWNX_Administration_SetDebugValue(int type, int state);
|
||||
/// @warning DANGER, DRAGONS. Bad things may or may not happen.
|
||||
void NWNX_Administration_ReloadRules();
|
||||
|
||||
/// @brief Get the servers minimum level.
|
||||
/// @return The minimum level for the server.
|
||||
int NWNX_Administration_GetMinLevel();
|
||||
|
||||
/// @brief Set the servers minimum level.
|
||||
/// @param nLevel The minimum level for the server.
|
||||
void NWNX_Administration_SetMinLevel(int nLevel);
|
||||
|
||||
/// @brief Get the servers maximum level.
|
||||
/// @return The maximum level for the server.
|
||||
int NWNX_Administration_GetMaxLevel();
|
||||
|
||||
/// @brief Set the servers maximum level.
|
||||
/// @note Attention when using this and the MaxLevel plugin. They both change the same value.
|
||||
/// @param nLevel The maximum level for the server.
|
||||
void NWNX_Administration_SetMaxLevel(int nLevel);
|
||||
|
||||
/// @}
|
||||
|
||||
string NWNX_Administration_GetPlayerPassword()
|
||||
@@ -163,14 +182,14 @@ string NWNX_Administration_GetPlayerPassword()
|
||||
string sFunc = "GetPlayerPassword";
|
||||
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetPlayerPassword(string password)
|
||||
{
|
||||
string sFunc = "SetPlayerPassword";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, password);
|
||||
NWNX_PushArgumentString(password);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -186,14 +205,14 @@ string NWNX_Administration_GetDMPassword()
|
||||
string sFunc = "GetDMPassword";
|
||||
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetDMPassword(string password)
|
||||
{
|
||||
string sFunc = "SetDMPassword";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, password);
|
||||
NWNX_PushArgumentString(password);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -208,9 +227,9 @@ void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup =
|
||||
{
|
||||
string sFunc = "DeletePlayerCharacter";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, sKickMessage);
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, bPreserveBackup);
|
||||
NWNX_PushArgumentObject(NWNX_Administration, sFunc, oPC);
|
||||
NWNX_PushArgumentString(sKickMessage);
|
||||
NWNX_PushArgumentInt(bPreserveBackup);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -218,42 +237,42 @@ void NWNX_Administration_AddBannedIP(string ip)
|
||||
{
|
||||
string sFunc = "AddBannedIP";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, ip);
|
||||
NWNX_PushArgumentString(ip);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
void NWNX_Administration_RemoveBannedIP(string ip)
|
||||
{
|
||||
string sFunc = "RemoveBannedIP";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, ip);
|
||||
NWNX_PushArgumentString(ip);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
void NWNX_Administration_AddBannedCDKey(string key)
|
||||
{
|
||||
string sFunc = "AddBannedCDKey";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, key);
|
||||
NWNX_PushArgumentString(key);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
void NWNX_Administration_RemoveBannedCDKey(string key)
|
||||
{
|
||||
string sFunc = "RemoveBannedCDKey";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, key);
|
||||
NWNX_PushArgumentString(key);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
void NWNX_Administration_AddBannedPlayerName(string playerName)
|
||||
{
|
||||
string sFunc = "AddBannedPlayerName";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
|
||||
NWNX_PushArgumentString(playerName);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
void NWNX_Administration_RemoveBannedPlayerName(string playerName)
|
||||
{
|
||||
string sFunc = "RemoveBannedPlayerName";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
|
||||
NWNX_PushArgumentString(playerName);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
string NWNX_Administration_GetBannedList()
|
||||
@@ -261,14 +280,14 @@ string NWNX_Administration_GetBannedList()
|
||||
string sFunc = "GetBannedList";
|
||||
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetModuleName(string name)
|
||||
{
|
||||
string sFunc = "SetModuleName";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, name);
|
||||
NWNX_PushArgumentString(name);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -276,7 +295,7 @@ void NWNX_Administration_SetServerName(string name)
|
||||
{
|
||||
string sFunc = "SetServerName";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, name);
|
||||
NWNX_PushArgumentString(name);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -284,25 +303,25 @@ string NWNX_Administration_GetServerName()
|
||||
{
|
||||
string sFunc = "GetServerName";
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Administration_GetPlayOption(int option)
|
||||
{
|
||||
string sFunc = "GetPlayOption";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, option);
|
||||
NWNX_PushArgumentInt(option);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetPlayOption(int option, int value)
|
||||
{
|
||||
string sFunc = "SetPlayOption";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, option);
|
||||
NWNX_PushArgumentInt(value);
|
||||
NWNX_PushArgumentInt(option);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -310,29 +329,29 @@ int NWNX_Administration_DeleteTURD(string playerName, string characterName)
|
||||
{
|
||||
string sFunc = "DeleteTURD";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, characterName);
|
||||
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
|
||||
NWNX_PushArgumentString(characterName);
|
||||
NWNX_PushArgumentString(playerName);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Administration_GetDebugValue(int type)
|
||||
{
|
||||
string sFunc = "GetDebugValue";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, type);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetDebugValue(int type, int state)
|
||||
{
|
||||
string sFunc = "SetDebugValue";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, state);
|
||||
NWNX_PushArgumentInt(NWNX_Administration, sFunc, type);
|
||||
NWNX_PushArgumentInt(state);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
@@ -342,3 +361,31 @@ void NWNX_Administration_ReloadRules()
|
||||
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Administration_GetMinLevel()
|
||||
{
|
||||
string sFunc = "GetMinLevel";
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetMinLevel(int nLevel)
|
||||
{
|
||||
string sFunc = "SetMinLevel";
|
||||
NWNX_PushArgumentInt(nLevel);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Administration_GetMaxLevel()
|
||||
{
|
||||
string sFunc = "GetMaxLevel";
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Administration_SetMaxLevel(int nLevel)
|
||||
{
|
||||
string sFunc = "SetMaxLevel";
|
||||
NWNX_PushArgumentInt(nLevel);
|
||||
NWNX_CallFunction(NWNX_Administration, sFunc);
|
||||
}
|
||||
|
@@ -51,10 +51,10 @@ void NWNX_Appearance_SetOverride(object oPlayer, object oCreature, int nType, in
|
||||
{
|
||||
string sFunc = "SetOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Appearance, sFunc, nValue);
|
||||
NWNX_PushArgumentInt(NWNX_Appearance, sFunc, nType);
|
||||
NWNX_PushArgumentObject(NWNX_Appearance, sFunc, oCreature);
|
||||
NWNX_PushArgumentObject(NWNX_Appearance, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nValue);
|
||||
NWNX_PushArgumentInt(nType);
|
||||
NWNX_PushArgumentObject(oCreature);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Appearance, sFunc);
|
||||
}
|
||||
@@ -63,11 +63,11 @@ int NWNX_Appearance_GetOverride(object oPlayer, object oCreature, int nType)
|
||||
{
|
||||
string sFunc = "GetOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Appearance, sFunc, nType);
|
||||
NWNX_PushArgumentObject(NWNX_Appearance, sFunc, oCreature);
|
||||
NWNX_PushArgumentObject(NWNX_Appearance, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nType);
|
||||
NWNX_PushArgumentObject(oCreature);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Appearance, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Appearance, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
@@ -50,6 +50,15 @@ struct NWNX_Area_TileInfo
|
||||
int nGridY; ///< The tile's grid y position
|
||||
};
|
||||
|
||||
/// @brief Area wind info struct
|
||||
struct NWNX_Area_AreaWind
|
||||
{
|
||||
vector vDirection; ///< Wind's direction
|
||||
float fMagnitude; ///< Wind's magnitude
|
||||
float fYaw; ///< Wind's yaw
|
||||
float fPitch; ///< Wind's pitch
|
||||
};
|
||||
|
||||
/// @brief Gets the number of players in area.
|
||||
/// @param area The area object.
|
||||
/// @return The player count for the area.
|
||||
@@ -268,54 +277,126 @@ struct NWNX_Area_TileInfo NWNX_Area_GetTileInfo(object oArea, float fTileX, floa
|
||||
/// @return TRUE if exported successfully, FALSE if not.
|
||||
int NWNX_Area_ExportARE(object oArea, string sFileName, string sNewName = "", string sNewTag = "", string sAlias = "NWNX");
|
||||
|
||||
/// @brief Get the ambient sound playing in an area during the day.
|
||||
/// @param oArea The area to get the sound of.
|
||||
/// @return The ambient soundtrack. See ambientsound.2da.
|
||||
int NWNX_Area_GetAmbientSoundDay(object oArea);
|
||||
|
||||
/// @brief Get the ambient sound playing in an area during the night.
|
||||
/// @param oArea The area to get the sound of.
|
||||
/// @return The ambient soundtrack. See ambientsound.2da.
|
||||
int NWNX_Area_GetAmbientSoundNight(object oArea);
|
||||
|
||||
/// @brief Get the volume of the ambient sound playing in an area during the day.
|
||||
/// @param oArea The area to get the sound volume of.
|
||||
/// @return The volume.
|
||||
int NWNX_Area_GetAmbientSoundDayVolume(object oArea);
|
||||
|
||||
/// @brief Get the volume of the ambient sound playing in an area during the night.
|
||||
/// @param oArea The area to get the sound volume of.
|
||||
/// @return The volume.
|
||||
int NWNX_Area_GetAmbientSoundNightVolume(object oArea);
|
||||
|
||||
/// @brief Create a sound object.
|
||||
/// @param oArea The area where to create the sound object.
|
||||
/// @param vPosition The area position where to create the sound object.
|
||||
/// @param sResRef The ResRef of the sound object.
|
||||
/// @return The sound object.
|
||||
object NWNX_Area_CreateSoundObject(object oArea, vector vPosition, string sResRef);
|
||||
|
||||
/// @brief Rotates an existing area, including all objects within (excluding PCs).
|
||||
/// @note Functions while clients are in the area, but not recommended as tiles/walkmesh only updates on area load, and this may result in unexpected clientside results.
|
||||
/// @param oArea The area to be rotated
|
||||
/// @param nRotation How many 90 degrees clockwise to rotate (1-3).
|
||||
void NWNX_Area_RotateArea(object oArea, int nRotation);
|
||||
|
||||
/// @brief Get the tile info of the tile at nIndex in the tile array.
|
||||
/// @param oArea The area.
|
||||
/// @param nIndex The index of the tile.
|
||||
/// @return A NWNX_Area_TileInfo struct with tile info.
|
||||
struct NWNX_Area_TileInfo NWNX_Area_GetTileInfoByTileIndex(object oArea, int nIndex);
|
||||
|
||||
/// @brief Check if there is a path between two positions in an area.
|
||||
/// @note Does not care about doors or placeables, only checks tile path nodes.
|
||||
/// @param oArea The area.
|
||||
/// @param vStartPosition The start position.
|
||||
/// @param vEndPosition The end position.
|
||||
/// @param nMaxDepth The max depth of the DFS tree. A good value is AreaWidth * AreaHeight.
|
||||
/// @return TRUE if there is a path between vStartPosition and vEndPosition, FALSE if not or on error.
|
||||
int NWNX_Area_GetPathExists(object oArea, vector vStartPosition, vector vEndPosition, int nMaxDepth);
|
||||
|
||||
/// @brief Get oArea's flags, interior/underground etc.
|
||||
/// @param oArea The area.
|
||||
/// @return The raw flags bitmask or -1 on error.
|
||||
int NWNX_Area_GetAreaFlags(object oArea);
|
||||
|
||||
/// @brief Set oArea's raw flags bitmask.
|
||||
/// @note You'll have to do any bitwise operations yourself.
|
||||
/// @note Requires clients to reload the area to get any updated flags.
|
||||
/// @param oArea The area.
|
||||
/// @param nFlags The flags.
|
||||
void NWNX_Area_SetAreaFlags(object oArea, int nFlags);
|
||||
|
||||
/// @brief Get oArea's detailed win data.
|
||||
/// @note vDirection returns [0.0, 0.0, 0.0] if not set previously with SetAreaWind nwscript function.
|
||||
/// @param oArea The area.
|
||||
struct NWNX_Area_AreaWind NWNX_Area_GetAreaWind(object oArea);
|
||||
|
||||
/// @brief Set the default discoverability mask for objects in an area.
|
||||
/// @param oArea The area or OBJECT_INVALID to set a global mask for all areas. Per area masks will override the global mask.
|
||||
/// @param nObjectTypes A mask of OBJECT_TYPE_* constants or OBJECT_TYPE_ALL for all suitable object types. Currently only works on Creatures, Doors (Hilite only), Items and Useable Placeables.
|
||||
/// @param nMask A mask of OBJECT_UI_DISCOVERY_*
|
||||
/// @param bForceUpdate If TRUE, will update the discovery mask of ALL objects in the area or module(if oArea == OBJECT_INVALID), according to the current mask. Use with care.
|
||||
void NWNX_Area_SetDefaultObjectUiDiscoveryMask(object oArea, int nObjectTypes, int nMask, int bForceUpdate = FALSE);
|
||||
|
||||
/// @}
|
||||
|
||||
int NWNX_Area_GetNumberOfPlayersInArea(object area)
|
||||
{
|
||||
string sFunc = "GetNumberOfPlayersInArea";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
object NWNX_Area_GetLastEntered(object area)
|
||||
{
|
||||
string sFunc = "GetLastEntered";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
object NWNX_Area_GetLastLeft(object area)
|
||||
{
|
||||
string sFunc = "GetLastLeft";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetPVPSetting(object area)
|
||||
{
|
||||
string sFunc = "GetPVPSetting";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetPVPSetting(object area, int pvpSetting)
|
||||
{
|
||||
string sFunc = "SetPVPSetting";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, pvpSetting);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(pvpSetting);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -323,18 +404,18 @@ int NWNX_Area_GetAreaSpotModifier(object area)
|
||||
{
|
||||
string sFunc = "GetAreaSpotModifier";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetAreaSpotModifier(object area, int spotModifier)
|
||||
{
|
||||
string sFunc = "SetAreaSpotModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, spotModifier);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(spotModifier);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -342,18 +423,18 @@ int NWNX_Area_GetAreaListenModifier(object area)
|
||||
{
|
||||
string sFunc = "GetAreaListenModifier";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetAreaListenModifier(object area, int listenModifier)
|
||||
{
|
||||
string sFunc = "SetAreaListenModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, listenModifier);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(listenModifier);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -361,18 +442,18 @@ int NWNX_Area_GetNoRestingAllowed(object area)
|
||||
{
|
||||
string sFunc = "GetNoRestingAllowed";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetNoRestingAllowed(object area, int bNoRestingAllowed)
|
||||
{
|
||||
string sFunc = "SetNoRestingAllowed";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bNoRestingAllowed);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(bNoRestingAllowed);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -380,18 +461,18 @@ int NWNX_Area_GetWindPower(object area)
|
||||
{
|
||||
string sFunc = "GetWindPower";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetWindPower(object area, int windPower)
|
||||
{
|
||||
string sFunc = "SetWindPower";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, windPower);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(windPower);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -399,20 +480,20 @@ int NWNX_Area_GetWeatherChance(object area, int type)
|
||||
{
|
||||
string sFunc = "GetWeatherChance";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetWeatherChance(object area, int type, int chance)
|
||||
{
|
||||
string sFunc = "SetWeatherChance";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, chance);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(chance);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -420,18 +501,18 @@ float NWNX_Area_GetFogClipDistance(object area)
|
||||
{
|
||||
string sFunc = "GetFogClipDistance";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueFloat(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueFloat();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetFogClipDistance(object area, float distance)
|
||||
{
|
||||
string sFunc = "SetFogClipDistance";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, distance);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentFloat(distance);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -439,18 +520,18 @@ int NWNX_Area_GetShadowOpacity(object area)
|
||||
{
|
||||
string sFunc = "GetShadowOpacity";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetShadowOpacity(object area, int shadowOpacity)
|
||||
{
|
||||
string sFunc = "SetShadowOpacity";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, shadowOpacity);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(shadowOpacity);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -459,18 +540,18 @@ int NWNX_Area_GetDayNightCycle(object area)
|
||||
{
|
||||
string sFunc = "GetDayNightCycle";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetDayNightCycle(object area, int type)
|
||||
{
|
||||
string sFunc = "SetDayNightCycle";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -478,20 +559,20 @@ int NWNX_Area_GetSunMoonColors(object area, int type)
|
||||
{
|
||||
string sFunc = "GetSunMoonColors";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetSunMoonColors(object area, int type, int color)
|
||||
{
|
||||
string sFunc = "SetSunMoonColors";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, color);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentInt(color);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -499,41 +580,41 @@ object NWNX_Area_CreateTransition(object area, object target, float x, float y,
|
||||
{
|
||||
string sFunc = "CreateTransition";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, tag);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, size);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, z);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, y);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, x);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, target);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
|
||||
NWNX_PushArgumentString(tag);
|
||||
NWNX_PushArgumentFloat(size);
|
||||
NWNX_PushArgumentFloat(z);
|
||||
NWNX_PushArgumentFloat(y);
|
||||
NWNX_PushArgumentFloat(x);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop)
|
||||
{
|
||||
string sFunc = "GetTileAnimationLoop";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, nAnimLoop);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(nAnimLoop);
|
||||
NWNX_PushArgumentFloat(fTileY);
|
||||
NWNX_PushArgumentFloat(fTileX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop, int bEnabled)
|
||||
{
|
||||
string sFunc = "SetTileAnimationLoop";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bEnabled);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, nAnimLoop);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(bEnabled);
|
||||
NWNX_PushArgumentInt(nAnimLoop);
|
||||
NWNX_PushArgumentFloat(fTileY);
|
||||
NWNX_PushArgumentFloat(fTileX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
@@ -541,64 +622,64 @@ void NWNX_Area_SetTileAnimationLoop(object oArea, float fTileX, float fTileY, in
|
||||
string NWNX_Area_GetTileModelResRef(object oArea, float fTileX, float fTileY)
|
||||
{
|
||||
string sFunc = "GetTileModelResRef";
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentFloat(fTileY);
|
||||
NWNX_PushArgumentFloat(fTileX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Area_TestDirectLine(object oArea, float fStartX, float fStartY, float fEndX, float fEndY, float fPerSpace, float fHeight, int bIgnoreDoors=FALSE)
|
||||
{
|
||||
string sFunc = "TestDirectLine";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bIgnoreDoors);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fHeight);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fPerSpace);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fEndY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fEndX);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fStartY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fStartX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(bIgnoreDoors);
|
||||
NWNX_PushArgumentFloat(fHeight);
|
||||
NWNX_PushArgumentFloat(fPerSpace);
|
||||
NWNX_PushArgumentFloat(fEndY);
|
||||
NWNX_PushArgumentFloat(fEndX);
|
||||
NWNX_PushArgumentFloat(fStartY);
|
||||
NWNX_PushArgumentFloat(fStartX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetMusicIsPlaying(object oArea, int bBattleMusic = FALSE)
|
||||
{
|
||||
string sFunc = "GetMusicIsPlaying";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bBattleMusic);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(bBattleMusic);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
object NWNX_Area_CreateGenericTrigger(object oArea, float fX, float fY, float fZ, string sTag = "", float fSize = 1.0f)
|
||||
{
|
||||
string sFunc = "CreateGenericTrigger";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fSize);
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sTag);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fZ);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentFloat(fSize);
|
||||
NWNX_PushArgumentString(sTag);
|
||||
NWNX_PushArgumentFloat(fZ);
|
||||
NWNX_PushArgumentFloat(fY);
|
||||
NWNX_PushArgumentFloat(fX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Area_AddObjectToExclusionList(object oObject)
|
||||
{
|
||||
string sFunc = "AddObjectToExclusionList";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -606,7 +687,7 @@ void NWNX_Area_RemoveObjectFromExclusionList(object oObject)
|
||||
{
|
||||
string sFunc = "RemoveObjectFromExclusionList";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
@@ -614,33 +695,33 @@ int NWNX_Area_ExportGIT(object oArea, string sFileName = "", int bExportVarTable
|
||||
{
|
||||
string sFunc = "ExportGIT";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sAlias);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, nObjectFilter);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bExportUUID);
|
||||
NWNX_PushArgumentInt(NWNX_Area, sFunc, bExportVarTable);
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sFileName);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_PushArgumentInt(nObjectFilter);
|
||||
NWNX_PushArgumentInt(bExportUUID);
|
||||
NWNX_PushArgumentInt(bExportVarTable);
|
||||
NWNX_PushArgumentString(sFileName);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_Area_TileInfo NWNX_Area_GetTileInfo(object oArea, float fTileX, float fTileY)
|
||||
{
|
||||
string sFunc = "GetTileInfo";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileY);
|
||||
NWNX_PushArgumentFloat(NWNX_Area, sFunc, fTileX);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentFloat(fTileY);
|
||||
NWNX_PushArgumentFloat(fTileX);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
struct NWNX_Area_TileInfo str;
|
||||
|
||||
str.nGridY = NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
str.nGridX = NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
str.nOrientation = NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
str.nHeight = NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
str.nID = NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
str.nGridY = NWNX_GetReturnValueInt();
|
||||
str.nGridX = NWNX_GetReturnValueInt();
|
||||
str.nOrientation = NWNX_GetReturnValueInt();
|
||||
str.nHeight = NWNX_GetReturnValueInt();
|
||||
str.nID = NWNX_GetReturnValueInt();
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -649,12 +730,159 @@ int NWNX_Area_ExportARE(object oArea, string sFileName, string sNewName = "", st
|
||||
{
|
||||
string sFunc = "ExportARE";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sAlias);
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sNewTag);
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sNewName);
|
||||
NWNX_PushArgumentString(NWNX_Area, sFunc, sFileName);
|
||||
NWNX_PushArgumentObject(NWNX_Area, sFunc, oArea);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_PushArgumentString(sNewTag);
|
||||
NWNX_PushArgumentString(sNewName);
|
||||
NWNX_PushArgumentString(sFileName);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetAmbientSoundDay(object oArea)
|
||||
{
|
||||
string sFunc = "GetAmbientSoundDay";
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetAmbientSoundNight(object oArea)
|
||||
{
|
||||
string sFunc = "GetAmbientSoundNight";
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetAmbientSoundDayVolume(object oArea)
|
||||
{
|
||||
string sFunc = "GetAmbientSoundDayVolume";
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetAmbientSoundNightVolume(object oArea)
|
||||
{
|
||||
string sFunc = "GetAmbientSoundNightVolume";
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
object NWNX_Area_CreateSoundObject(object oArea, vector vPosition, string sResRef)
|
||||
{
|
||||
string sFunc = "CreateSoundObject";
|
||||
|
||||
NWNX_PushArgumentString(sResRef);
|
||||
NWNX_PushArgumentFloat(vPosition.z);
|
||||
NWNX_PushArgumentFloat(vPosition.y);
|
||||
NWNX_PushArgumentFloat(vPosition.x);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Area_RotateArea(object oArea, int nRotation)
|
||||
{
|
||||
string sFunc = "RotateArea";
|
||||
|
||||
NWNX_PushArgumentInt(nRotation);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
struct NWNX_Area_TileInfo NWNX_Area_GetTileInfoByTileIndex(object oArea, int nIndex)
|
||||
{
|
||||
string sFunc = "GetTileInfoByTileIndex";
|
||||
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
struct NWNX_Area_TileInfo str;
|
||||
|
||||
str.nGridY = NWNX_GetReturnValueInt();
|
||||
str.nGridX = NWNX_GetReturnValueInt();
|
||||
str.nOrientation = NWNX_GetReturnValueInt();
|
||||
str.nHeight = NWNX_GetReturnValueInt();
|
||||
str.nID = NWNX_GetReturnValueInt();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int NWNX_Area_GetPathExists(object oArea, vector vStartPosition, vector vEndPosition, int nMaxDepth)
|
||||
{
|
||||
string sFunc = "GetPathExists";
|
||||
|
||||
NWNX_PushArgumentInt(nMaxDepth);
|
||||
NWNX_PushArgumentFloat(vEndPosition.y);
|
||||
NWNX_PushArgumentFloat(vEndPosition.x);
|
||||
NWNX_PushArgumentFloat(vStartPosition.y);
|
||||
NWNX_PushArgumentFloat(vStartPosition.x);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Area_GetAreaFlags(object oArea)
|
||||
{
|
||||
string sFunc = "GetAreaFlags";
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Area_SetAreaFlags(object oArea, int nFlags)
|
||||
{
|
||||
string sFunc = "SetAreaFlags";
|
||||
|
||||
NWNX_PushArgumentInt(nFlags);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
||||
struct NWNX_Area_AreaWind NWNX_Area_GetAreaWind(object oArea)
|
||||
{
|
||||
string sFunc = "GetAreaWind";
|
||||
struct NWNX_Area_AreaWind data;
|
||||
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
|
||||
data.fPitch = NWNX_GetReturnValueFloat();
|
||||
data.fYaw = NWNX_GetReturnValueFloat();
|
||||
data.fMagnitude = NWNX_GetReturnValueFloat();
|
||||
data.vDirection.x = NWNX_GetReturnValueFloat();
|
||||
data.vDirection.y = NWNX_GetReturnValueFloat();
|
||||
data.vDirection.z = NWNX_GetReturnValueFloat();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void NWNX_Area_SetDefaultObjectUiDiscoveryMask(object oArea, int nObjectTypes, int nMask, int bForceUpdate = FALSE)
|
||||
{
|
||||
string sFunc = "SetDefaultObjectUiDiscoveryMask";
|
||||
|
||||
NWNX_PushArgumentInt(bForceUpdate);
|
||||
NWNX_PushArgumentInt(nMask);
|
||||
NWNX_PushArgumentInt(nObjectTypes);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_Area, sFunc);
|
||||
}
|
||||
|
@@ -82,19 +82,19 @@ int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SE
|
||||
{
|
||||
string sFunc = "SendMessage";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Chat, sFunc, target);
|
||||
NWNX_PushArgumentObject(NWNX_Chat, sFunc, sender);
|
||||
NWNX_PushArgumentString(NWNX_Chat, sFunc, message);
|
||||
NWNX_PushArgumentInt(NWNX_Chat, sFunc, channel);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentObject(sender);
|
||||
NWNX_PushArgumentString(message);
|
||||
NWNX_PushArgumentInt(channel);
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Chat_RegisterChatScript(string script)
|
||||
{
|
||||
string sFunc = "RegisterChatScript";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Chat, sFunc, script);
|
||||
NWNX_PushArgumentString(script);
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ int NWNX_Chat_GetChannel()
|
||||
string sFunc = "GetChannel";
|
||||
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Chat_GetMessage()
|
||||
@@ -118,7 +118,7 @@ string NWNX_Chat_GetMessage()
|
||||
string sFunc = "GetMessage";
|
||||
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
object NWNX_Chat_GetSender()
|
||||
@@ -126,7 +126,7 @@ object NWNX_Chat_GetSender()
|
||||
string sFunc = "GetSender";
|
||||
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueObject(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
object NWNX_Chat_GetTarget()
|
||||
@@ -134,16 +134,16 @@ object NWNX_Chat_GetTarget()
|
||||
string sFunc = "GetTarget";
|
||||
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueObject(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Chat_SetChatHearingDistance(float distance, object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK)
|
||||
{
|
||||
string sFunc = "SetChatHearingDistance";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Chat, sFunc, channel);
|
||||
NWNX_PushArgumentObject(NWNX_Chat, sFunc, listener);
|
||||
NWNX_PushArgumentFloat(NWNX_Chat, sFunc, distance);
|
||||
NWNX_PushArgumentInt(channel);
|
||||
NWNX_PushArgumentObject(listener);
|
||||
NWNX_PushArgumentFloat(distance);
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int cha
|
||||
{
|
||||
string sFunc = "GetChatHearingDistance";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Chat, sFunc, channel);
|
||||
NWNX_PushArgumentObject(NWNX_Chat, sFunc, listener);
|
||||
NWNX_PushArgumentInt(channel);
|
||||
NWNX_PushArgumentObject(listener);
|
||||
NWNX_CallFunction(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueFloat(NWNX_Chat, sFunc);
|
||||
return NWNX_GetReturnValueFloat();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,26 @@ struct NWNX_Damage_DamageEventData
|
||||
int iPositive; ///< Positive damage
|
||||
int iSonic; ///< Sonic damage
|
||||
int iBase; ///< Base damage
|
||||
int iCustom1; ///< Custom1 damage
|
||||
int iCustom2; ///< Custom2 damage
|
||||
int iCustom3; ///< Custom3 damage
|
||||
int iCustom4; ///< Custom4 damage
|
||||
int iCustom5; ///< Custom5 damage
|
||||
int iCustom6; ///< Custom6 damage
|
||||
int iCustom7; ///< Custom7 damage
|
||||
int iCustom8; ///< Custom8 damage
|
||||
int iCustom9; ///< Custom9 damage
|
||||
int iCustom10; ///< Custom10 damage
|
||||
int iCustom11; ///< Custom11 damage
|
||||
int iCustom12; ///< Custom12 damage
|
||||
int iCustom13; ///< Custom13 damage
|
||||
int iCustom14; ///< Custom14 damage
|
||||
int iCustom15; ///< Custom15 damage
|
||||
int iCustom16; ///< Custom16 damage
|
||||
int iCustom17; ///< Custom17 damage
|
||||
int iCustom18; ///< Custom18 damage
|
||||
int iCustom19; ///< Custom19 damage
|
||||
int iSpellId; ///< The spell id associated with the damage or -1 if not known.
|
||||
};
|
||||
|
||||
/// @struct NWNX_Damage_AttackEventData
|
||||
@@ -44,10 +64,33 @@ struct NWNX_Damage_AttackEventData
|
||||
int iPositive; ///< Positive damage
|
||||
int iSonic; ///< Sonic damage
|
||||
int iBase; ///< Base damage
|
||||
int iCustom1; ///< Custom1 damage
|
||||
int iCustom2; ///< Custom2 damage
|
||||
int iCustom3; ///< Custom3 damage
|
||||
int iCustom4; ///< Custom4 damage
|
||||
int iCustom5; ///< Custom5 damage
|
||||
int iCustom6; ///< Custom6 damage
|
||||
int iCustom7; ///< Custom7 damage
|
||||
int iCustom8; ///< Custom8 damage
|
||||
int iCustom9; ///< Custom9 damage
|
||||
int iCustom10; ///< Custom10 damage
|
||||
int iCustom11; ///< Custom11 damage
|
||||
int iCustom12; ///< Custom12 damage
|
||||
int iCustom13; ///< Custom13 damage
|
||||
int iCustom14; ///< Custom14 damage
|
||||
int iCustom15; ///< Custom15 damage
|
||||
int iCustom16; ///< Custom16 damage
|
||||
int iCustom17; ///< Custom17 damage
|
||||
int iCustom18; ///< Custom18 damage
|
||||
int iCustom19; ///< Custom19 damage
|
||||
int iAttackNumber; ///< 1-based index of the attack in current combat round
|
||||
int iAttackResult; ///< 1=hit, 3=critical hit, 4=miss, 8=concealed
|
||||
int iAttackType; ///< 1=main hand, 2=offhand, 3-5=creature, 6=haste
|
||||
int iSneakAttack; ///< 0=neither, 1=sneak attack, 2=death attack, 3=both
|
||||
int iAttackResult; ///< 1=hit, 2=parried, 3=critical hit, 4=miss, 5=resisted, 7=automatic hit, 8=concealed, 9=miss chance, 10=devastating crit
|
||||
int iWeaponAttackType; ///< 1=main hand, 2=offhand, 3-5=creature, 6=extra(haste), 7=unarmed, 8=unarmed extra
|
||||
int iSneakAttack; ///< 0=neither, 1=sneak attack, 2=death attack, 3=both
|
||||
int iAttackType; ///< 65002=Attack of Opportunity, 65003=Riposte or a FeatID like KnockDown or some other special attack.
|
||||
int bKillingBlow; ///< TRUE if the hit is a killing blow
|
||||
int iToHitRoll; ///< The to hit roll of the attack
|
||||
int iToHitModifier; ///< The to hit modifier of the attack
|
||||
};
|
||||
|
||||
/// @struct NWNX_Damage_DamageData
|
||||
@@ -66,13 +109,32 @@ struct NWNX_Damage_DamageData
|
||||
int iNegative; ///< Negative damage
|
||||
int iPositive; ///< Positive damage
|
||||
int iSonic; ///< Sonic damage
|
||||
int iCustom1; ///< Custom1 damage
|
||||
int iCustom2; ///< Custom2 damage
|
||||
int iCustom3; ///< Custom3 damage
|
||||
int iCustom4; ///< Custom4 damage
|
||||
int iCustom5; ///< Custom5 damage
|
||||
int iCustom6; ///< Custom6 damage
|
||||
int iCustom7; ///< Custom7 damage
|
||||
int iCustom8; ///< Custom8 damage
|
||||
int iCustom9; ///< Custom9 damage
|
||||
int iCustom10; ///< Custom10 damage
|
||||
int iCustom11; ///< Custom11 damage
|
||||
int iCustom12; ///< Custom12 damage
|
||||
int iCustom13; ///< Custom13 damage
|
||||
int iCustom14; ///< Custom14 damage
|
||||
int iCustom15; ///< Custom15 damage
|
||||
int iCustom16; ///< Custom16 damage
|
||||
int iCustom17; ///< Custom17 damage
|
||||
int iCustom18; ///< Custom18 damage
|
||||
int iCustom19; ///< Custom19 damage
|
||||
int iPower; ///< For overcoming DR
|
||||
};
|
||||
|
||||
/// @brief Sets the script to run with a damage event.
|
||||
/// @param sScript The script that will handle the damage event.
|
||||
/// @param oOwner An object if only executing for a specific object or OBJECT_INVALID for global.
|
||||
void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID);
|
||||
void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner = OBJECT_INVALID);
|
||||
|
||||
/// @brief Get Damage Event Data
|
||||
/// @return A NWNX_Damage_DamageEventData struct.
|
||||
@@ -87,7 +149,7 @@ void NWNX_Damage_SetDamageEventData(struct NWNX_Damage_DamageEventData data);
|
||||
/// @brief Sets the script to run with an attack event.
|
||||
/// @param sScript The script that will handle the attack event.
|
||||
/// @param oOwner An object if only executing for a specific object or OBJECT_INVALID for global.
|
||||
void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID);
|
||||
void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner = OBJECT_INVALID);
|
||||
|
||||
/// @brief Get Attack Event Data
|
||||
/// @return A NWNX_Damage_AttackEventData struct.
|
||||
@@ -97,6 +159,7 @@ struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData();
|
||||
/// @brief Set Attack Event Data
|
||||
/// @param data A NWNX_Damage_AttackEventData struct.
|
||||
/// @note To use only in the Attack Event Script.
|
||||
/// @note Setting iSneakAttack will only change the attack roll message and floating text feedback. Immunities and damage will have already been resolved by the time the attack event script is ran.
|
||||
void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data);
|
||||
|
||||
/// @brief Deal damage to a target.
|
||||
@@ -105,7 +168,7 @@ void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data);
|
||||
/// @param oTarget The target object on whom the damage is dealt.
|
||||
/// @param oSource The source of the damage.
|
||||
/// @param iRanged Whether the attack should be treated as ranged by the engine (for example when considering damage inflicted by Acid Sheath and other such effects)
|
||||
void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource=OBJECT_SELF, int iRanged = FALSE);
|
||||
void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource = OBJECT_SELF, int iRanged = FALSE);
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -113,9 +176,9 @@ void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVAL
|
||||
{
|
||||
string sFunc = "SetEventScript";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oOwner);
|
||||
NWNX_PushArgumentString(NWNX_Damage, sFunc, sScript);
|
||||
NWNX_PushArgumentString(NWNX_Damage, sFunc, "DAMAGE");
|
||||
NWNX_PushArgumentObject(oOwner);
|
||||
NWNX_PushArgumentString(sScript);
|
||||
NWNX_PushArgumentString("DAMAGE");
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
}
|
||||
@@ -127,20 +190,40 @@ struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData()
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
|
||||
data.oDamager = NWNX_GetReturnValueObject(NWNX_Damage, sFunc);
|
||||
data.iBludgeoning = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iPierce = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iSlash = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iMagical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iAcid = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iCold = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iDivine = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iElectrical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iFire = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iNegative = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iPositive = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iSonic = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iBase = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.oDamager = NWNX_GetReturnValueObject();
|
||||
data.iBludgeoning = NWNX_GetReturnValueInt();
|
||||
data.iPierce = NWNX_GetReturnValueInt();
|
||||
data.iSlash = NWNX_GetReturnValueInt();
|
||||
data.iMagical = NWNX_GetReturnValueInt();
|
||||
data.iAcid = NWNX_GetReturnValueInt();
|
||||
data.iCold = NWNX_GetReturnValueInt();
|
||||
data.iDivine = NWNX_GetReturnValueInt();
|
||||
data.iElectrical = NWNX_GetReturnValueInt();
|
||||
data.iFire = NWNX_GetReturnValueInt();
|
||||
data.iNegative = NWNX_GetReturnValueInt();
|
||||
data.iPositive = NWNX_GetReturnValueInt();
|
||||
data.iSonic = NWNX_GetReturnValueInt();
|
||||
data.iBase = NWNX_GetReturnValueInt();
|
||||
data.iCustom1 = NWNX_GetReturnValueInt();
|
||||
data.iCustom2 = NWNX_GetReturnValueInt();
|
||||
data.iCustom3 = NWNX_GetReturnValueInt();
|
||||
data.iCustom4 = NWNX_GetReturnValueInt();
|
||||
data.iCustom5 = NWNX_GetReturnValueInt();
|
||||
data.iCustom6 = NWNX_GetReturnValueInt();
|
||||
data.iCustom7 = NWNX_GetReturnValueInt();
|
||||
data.iCustom8 = NWNX_GetReturnValueInt();
|
||||
data.iCustom9 = NWNX_GetReturnValueInt();
|
||||
data.iCustom10 = NWNX_GetReturnValueInt();
|
||||
data.iCustom11 = NWNX_GetReturnValueInt();
|
||||
data.iCustom12 = NWNX_GetReturnValueInt();
|
||||
data.iCustom13 = NWNX_GetReturnValueInt();
|
||||
data.iCustom14 = NWNX_GetReturnValueInt();
|
||||
data.iCustom15 = NWNX_GetReturnValueInt();
|
||||
data.iCustom16 = NWNX_GetReturnValueInt();
|
||||
data.iCustom17 = NWNX_GetReturnValueInt();
|
||||
data.iCustom18 = NWNX_GetReturnValueInt();
|
||||
data.iCustom19 = NWNX_GetReturnValueInt();
|
||||
data.iSpellId = NWNX_GetReturnValueInt();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -149,19 +232,38 @@ void NWNX_Damage_SetDamageEventData(struct NWNX_Damage_DamageEventData data)
|
||||
{
|
||||
string sFunc = "SetDamageEventData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iBase);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSonic);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPositive);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iNegative);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iFire);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iElectrical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iDivine);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iCold);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iAcid);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iMagical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSlash);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPierce);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iBludgeoning);
|
||||
NWNX_PushArgumentInt(data.iCustom19);
|
||||
NWNX_PushArgumentInt(data.iCustom18);
|
||||
NWNX_PushArgumentInt(data.iCustom17);
|
||||
NWNX_PushArgumentInt(data.iCustom16);
|
||||
NWNX_PushArgumentInt(data.iCustom15);
|
||||
NWNX_PushArgumentInt(data.iCustom14);
|
||||
NWNX_PushArgumentInt(data.iCustom13);
|
||||
NWNX_PushArgumentInt(data.iCustom12);
|
||||
NWNX_PushArgumentInt(data.iCustom11);
|
||||
NWNX_PushArgumentInt(data.iCustom10);
|
||||
NWNX_PushArgumentInt(data.iCustom9);
|
||||
NWNX_PushArgumentInt(data.iCustom8);
|
||||
NWNX_PushArgumentInt(data.iCustom7);
|
||||
NWNX_PushArgumentInt(data.iCustom6);
|
||||
NWNX_PushArgumentInt(data.iCustom5);
|
||||
NWNX_PushArgumentInt(data.iCustom4);
|
||||
NWNX_PushArgumentInt(data.iCustom3);
|
||||
NWNX_PushArgumentInt(data.iCustom2);
|
||||
NWNX_PushArgumentInt(data.iCustom1);
|
||||
NWNX_PushArgumentInt(data.iBase);
|
||||
NWNX_PushArgumentInt(data.iSonic);
|
||||
NWNX_PushArgumentInt(data.iPositive);
|
||||
NWNX_PushArgumentInt(data.iNegative);
|
||||
NWNX_PushArgumentInt(data.iFire);
|
||||
NWNX_PushArgumentInt(data.iElectrical);
|
||||
NWNX_PushArgumentInt(data.iDivine);
|
||||
NWNX_PushArgumentInt(data.iCold);
|
||||
NWNX_PushArgumentInt(data.iAcid);
|
||||
NWNX_PushArgumentInt(data.iMagical);
|
||||
NWNX_PushArgumentInt(data.iSlash);
|
||||
NWNX_PushArgumentInt(data.iPierce);
|
||||
NWNX_PushArgumentInt(data.iBludgeoning);
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
}
|
||||
@@ -170,9 +272,9 @@ void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVAL
|
||||
{
|
||||
string sFunc = "SetEventScript";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oOwner);
|
||||
NWNX_PushArgumentString(NWNX_Damage, sFunc, sScript);
|
||||
NWNX_PushArgumentString(NWNX_Damage, sFunc, "ATTACK");
|
||||
NWNX_PushArgumentObject(oOwner);
|
||||
NWNX_PushArgumentString(sScript);
|
||||
NWNX_PushArgumentString("ATTACK");
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
}
|
||||
@@ -184,24 +286,47 @@ struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData()
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
|
||||
data.oTarget = NWNX_GetReturnValueObject(NWNX_Damage, sFunc);
|
||||
data.iBludgeoning = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iPierce = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iSlash = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iMagical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iAcid = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iCold = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iDivine = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iElectrical = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iFire = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iNegative = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iPositive = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iSonic = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iBase = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iAttackNumber = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iAttackResult = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iAttackType = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.iSneakAttack = NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
|
||||
data.oTarget = NWNX_GetReturnValueObject();
|
||||
data.iBludgeoning = NWNX_GetReturnValueInt();
|
||||
data.iPierce = NWNX_GetReturnValueInt();
|
||||
data.iSlash = NWNX_GetReturnValueInt();
|
||||
data.iMagical = NWNX_GetReturnValueInt();
|
||||
data.iAcid = NWNX_GetReturnValueInt();
|
||||
data.iCold = NWNX_GetReturnValueInt();
|
||||
data.iDivine = NWNX_GetReturnValueInt();
|
||||
data.iElectrical = NWNX_GetReturnValueInt();
|
||||
data.iFire = NWNX_GetReturnValueInt();
|
||||
data.iNegative = NWNX_GetReturnValueInt();
|
||||
data.iPositive = NWNX_GetReturnValueInt();
|
||||
data.iSonic = NWNX_GetReturnValueInt();
|
||||
data.iBase = NWNX_GetReturnValueInt();
|
||||
data.iCustom1 = NWNX_GetReturnValueInt();
|
||||
data.iCustom2 = NWNX_GetReturnValueInt();
|
||||
data.iCustom3 = NWNX_GetReturnValueInt();
|
||||
data.iCustom4 = NWNX_GetReturnValueInt();
|
||||
data.iCustom5 = NWNX_GetReturnValueInt();
|
||||
data.iCustom6 = NWNX_GetReturnValueInt();
|
||||
data.iCustom7 = NWNX_GetReturnValueInt();
|
||||
data.iCustom8 = NWNX_GetReturnValueInt();
|
||||
data.iCustom9 = NWNX_GetReturnValueInt();
|
||||
data.iCustom10 = NWNX_GetReturnValueInt();
|
||||
data.iCustom11 = NWNX_GetReturnValueInt();
|
||||
data.iCustom12 = NWNX_GetReturnValueInt();
|
||||
data.iCustom13 = NWNX_GetReturnValueInt();
|
||||
data.iCustom14 = NWNX_GetReturnValueInt();
|
||||
data.iCustom15 = NWNX_GetReturnValueInt();
|
||||
data.iCustom16 = NWNX_GetReturnValueInt();
|
||||
data.iCustom17 = NWNX_GetReturnValueInt();
|
||||
data.iCustom18 = NWNX_GetReturnValueInt();
|
||||
data.iCustom19 = NWNX_GetReturnValueInt();
|
||||
data.iAttackNumber = NWNX_GetReturnValueInt();
|
||||
data.iAttackResult = NWNX_GetReturnValueInt();
|
||||
data.iWeaponAttackType = NWNX_GetReturnValueInt();
|
||||
data.iSneakAttack = NWNX_GetReturnValueInt();
|
||||
data.bKillingBlow = NWNX_GetReturnValueInt();
|
||||
data.iAttackType = NWNX_GetReturnValueInt();
|
||||
data.iToHitRoll = NWNX_GetReturnValueInt();
|
||||
data.iToHitModifier = NWNX_GetReturnValueInt();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -210,20 +335,40 @@ void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data)
|
||||
{
|
||||
string sFunc = "SetAttackEventData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iAttackResult);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iBase);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSonic);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPositive);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iNegative);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iFire);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iElectrical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iDivine);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iCold);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iAcid);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iMagical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSlash);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPierce);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iBludgeoning);
|
||||
NWNX_PushArgumentInt(data.iSneakAttack);
|
||||
NWNX_PushArgumentInt(data.iAttackResult);
|
||||
NWNX_PushArgumentInt(data.iCustom19);
|
||||
NWNX_PushArgumentInt(data.iCustom18);
|
||||
NWNX_PushArgumentInt(data.iCustom17);
|
||||
NWNX_PushArgumentInt(data.iCustom16);
|
||||
NWNX_PushArgumentInt(data.iCustom15);
|
||||
NWNX_PushArgumentInt(data.iCustom14);
|
||||
NWNX_PushArgumentInt(data.iCustom13);
|
||||
NWNX_PushArgumentInt(data.iCustom12);
|
||||
NWNX_PushArgumentInt(data.iCustom11);
|
||||
NWNX_PushArgumentInt(data.iCustom10);
|
||||
NWNX_PushArgumentInt(data.iCustom9);
|
||||
NWNX_PushArgumentInt(data.iCustom8);
|
||||
NWNX_PushArgumentInt(data.iCustom7);
|
||||
NWNX_PushArgumentInt(data.iCustom6);
|
||||
NWNX_PushArgumentInt(data.iCustom5);
|
||||
NWNX_PushArgumentInt(data.iCustom4);
|
||||
NWNX_PushArgumentInt(data.iCustom3);
|
||||
NWNX_PushArgumentInt(data.iCustom2);
|
||||
NWNX_PushArgumentInt(data.iCustom1);
|
||||
NWNX_PushArgumentInt(data.iBase);
|
||||
NWNX_PushArgumentInt(data.iSonic);
|
||||
NWNX_PushArgumentInt(data.iPositive);
|
||||
NWNX_PushArgumentInt(data.iNegative);
|
||||
NWNX_PushArgumentInt(data.iFire);
|
||||
NWNX_PushArgumentInt(data.iElectrical);
|
||||
NWNX_PushArgumentInt(data.iDivine);
|
||||
NWNX_PushArgumentInt(data.iCold);
|
||||
NWNX_PushArgumentInt(data.iAcid);
|
||||
NWNX_PushArgumentInt(data.iMagical);
|
||||
NWNX_PushArgumentInt(data.iSlash);
|
||||
NWNX_PushArgumentInt(data.iPierce);
|
||||
NWNX_PushArgumentInt(data.iBludgeoning);
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
}
|
||||
@@ -232,22 +377,42 @@ void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget,
|
||||
{
|
||||
string sFunc = "DealDamage";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, iRanged);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPower);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSonic);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPositive);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iNegative);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iFire);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iElectrical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iDivine);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iCold);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iAcid);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iMagical);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iSlash);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iPierce);
|
||||
NWNX_PushArgumentInt(NWNX_Damage, sFunc, data.iBludgeoning);
|
||||
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oTarget);
|
||||
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oSource);
|
||||
NWNX_PushArgumentInt(iRanged);
|
||||
NWNX_PushArgumentInt(data.iPower);
|
||||
NWNX_PushArgumentInt(data.iCustom19);
|
||||
NWNX_PushArgumentInt(data.iCustom18);
|
||||
NWNX_PushArgumentInt(data.iCustom17);
|
||||
NWNX_PushArgumentInt(data.iCustom16);
|
||||
NWNX_PushArgumentInt(data.iCustom15);
|
||||
NWNX_PushArgumentInt(data.iCustom14);
|
||||
NWNX_PushArgumentInt(data.iCustom13);
|
||||
NWNX_PushArgumentInt(data.iCustom12);
|
||||
NWNX_PushArgumentInt(data.iCustom11);
|
||||
NWNX_PushArgumentInt(data.iCustom10);
|
||||
NWNX_PushArgumentInt(data.iCustom9);
|
||||
NWNX_PushArgumentInt(data.iCustom8);
|
||||
NWNX_PushArgumentInt(data.iCustom7);
|
||||
NWNX_PushArgumentInt(data.iCustom6);
|
||||
NWNX_PushArgumentInt(data.iCustom5);
|
||||
NWNX_PushArgumentInt(data.iCustom4);
|
||||
NWNX_PushArgumentInt(data.iCustom3);
|
||||
NWNX_PushArgumentInt(data.iCustom2);
|
||||
NWNX_PushArgumentInt(data.iCustom1);
|
||||
NWNX_PushArgumentInt(0);// Padding for Base Damage
|
||||
NWNX_PushArgumentInt(data.iSonic);
|
||||
NWNX_PushArgumentInt(data.iPositive);
|
||||
NWNX_PushArgumentInt(data.iNegative);
|
||||
NWNX_PushArgumentInt(data.iFire);
|
||||
NWNX_PushArgumentInt(data.iElectrical);
|
||||
NWNX_PushArgumentInt(data.iDivine);
|
||||
NWNX_PushArgumentInt(data.iCold);
|
||||
NWNX_PushArgumentInt(data.iAcid);
|
||||
NWNX_PushArgumentInt(data.iMagical);
|
||||
NWNX_PushArgumentInt(data.iSlash);
|
||||
NWNX_PushArgumentInt(data.iPierce);
|
||||
NWNX_PushArgumentInt(data.iBludgeoning);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
NWNX_PushArgumentObject(oSource);
|
||||
|
||||
NWNX_CallFunction(NWNX_Damage, sFunc);
|
||||
}
|
||||
|
351
_module/nss/nwnx_data.nss
Normal file
351
_module/nss/nwnx_data.nss
Normal file
@@ -0,0 +1,351 @@
|
||||
/// @addtogroup data Data
|
||||
/// @brief Provides a number of data structures for NWN code to use (simulated arrays)
|
||||
/// @{
|
||||
/// @file nwnx_data.nss
|
||||
|
||||
#include "inc_array"
|
||||
|
||||
// All these calls just pass through to the Array code in inc_array to provide
|
||||
// an NWNX_Data compatible API for ease of transition.
|
||||
|
||||
const int NWNX_DATA_INVALID_INDEX = INVALID_INDEX;
|
||||
const int NWNX_DATA_TYPE_FLOAT = TYPE_FLOAT;
|
||||
const int NWNX_DATA_TYPE_INTEGER = TYPE_INTEGER;
|
||||
const int NWNX_DATA_TYPE_OBJECT = TYPE_OBJECT;
|
||||
const int NWNX_DATA_TYPE_STRING = TYPE_STRING;
|
||||
|
||||
/// @defgroup data_array_at Array At
|
||||
/// @brief Returns the element at the index.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @return The element of associated type.
|
||||
/// @{
|
||||
string NWNX_Data_Array_At_Str(object obj, string tag, int index);
|
||||
float NWNX_Data_Array_At_Flt(object obj, string tag, int index);
|
||||
int NWNX_Data_Array_At_Int(object obj, string tag, int index);
|
||||
object NWNX_Data_Array_At_Obj(object obj, string tag, int index);
|
||||
/// @}
|
||||
|
||||
|
||||
/// Clears the entire array, such that size==0.
|
||||
void NWNX_Data_Array_Clear(int type, object obj, string tag);
|
||||
|
||||
/// @defgroup data_array_contains Array Contains
|
||||
/// @brief Checks if array contains the element.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @return TRUE if the collection contains the element.
|
||||
/// @{
|
||||
int NWNX_Data_Array_Contains_Flt(object obj, string tag, float element);
|
||||
int NWNX_Data_Array_Contains_Int(object obj, string tag, int element);
|
||||
int NWNX_Data_Array_Contains_Obj(object obj, string tag, object element);
|
||||
int NWNX_Data_Array_Contains_Str(object obj, string tag, string element);
|
||||
/// @}
|
||||
|
||||
/// Copies the array of name otherTag over the array of name tag.
|
||||
void NWNX_Data_Array_Copy(int type, object obj, string tag, string otherTag);
|
||||
|
||||
/// Erases the element at index, and shuffles any elements from index size-1 to index + 1 left.
|
||||
void NWNX_Data_Array_Erase(int type, object obj, string tag, int index);
|
||||
|
||||
/// @defgroup data_array_find Array Find
|
||||
/// @brief Get the index at which the element is located.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @return Returns the index at which the element is located, or ARRAY_INVALID_INDEX.
|
||||
/// @{
|
||||
int NWNX_Data_Array_Find_Flt(object obj, string tag, float element);
|
||||
int NWNX_Data_Array_Find_Int(object obj, string tag, int element);
|
||||
int NWNX_Data_Array_Find_Obj(object obj, string tag, object element);
|
||||
int NWNX_Data_Array_Find_Str(object obj, string tag, string element);
|
||||
/// @}
|
||||
|
||||
/// @defgroup data_array_insert Array Insert
|
||||
/// @brief Inserts the element at the index, where size > index >= 0.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void NWNX_Data_Array_Insert_Flt(object obj, string tag, int index, float element);
|
||||
void NWNX_Data_Array_Insert_Int(object obj, string tag, int index, int element);
|
||||
void NWNX_Data_Array_Insert_Obj(object obj, string tag, int index, object element);
|
||||
void NWNX_Data_Array_Insert_Str(object obj, string tag, int index, string element);
|
||||
/// @}
|
||||
|
||||
/// @defgroup data_array_pushback Array Pushback
|
||||
/// @brief Pushes an element to the back of the collection.
|
||||
/// @remark Functionally identical to an insert at index size-1.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void NWNX_Data_Array_PushBack_Flt(object obj, string tag, float element);
|
||||
void NWNX_Data_Array_PushBack_Int(object obj, string tag, int element);
|
||||
void NWNX_Data_Array_PushBack_Obj(object obj, string tag, object element);
|
||||
void NWNX_Data_Array_PushBack_Str(object obj, string tag, string element);
|
||||
/// @}
|
||||
|
||||
/// Resizes the array. If the array is shrinking, it chops off elements at the ned.
|
||||
void NWNX_Data_Array_Resize(int type, object obj, string tag, int size);
|
||||
|
||||
/// Reorders the array such each possible permutation of elements has equal probability of appearance.
|
||||
void NWNX_Data_Array_Shuffle(int type, object obj, string tag);
|
||||
|
||||
/// Returns the size of the array.
|
||||
int NWNX_Data_Array_Size(int type, object obj, string tag);
|
||||
|
||||
/// Sorts the collection based on descending order.
|
||||
void NWNX_Data_Array_SortAscending(int type, object obj, string tag);
|
||||
|
||||
/// Sorts the collection based on descending order.
|
||||
void NWNX_Data_Array_SortDescending(int type, object obj, string tag);
|
||||
|
||||
/// @defgroup data_array_set Array Set
|
||||
/// @brief Sets the element at the index, where size > index >= 0.
|
||||
/// @ingroup data
|
||||
/// @param obj The object.
|
||||
/// @param tag The tag.
|
||||
/// @param index The index.
|
||||
/// @param element The element.
|
||||
/// @{
|
||||
void NWNX_Data_Array_Set_Flt(object obj, string tag, int index, float element);
|
||||
void NWNX_Data_Array_Set_Int(object obj, string tag, int index, int element);
|
||||
void NWNX_Data_Array_Set_Obj(object obj, string tag, int index, object element);
|
||||
void NWNX_Data_Array_Set_Str(object obj, string tag, int index, string element);
|
||||
/// @}
|
||||
|
||||
/// @}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// return the value contained in location "index"
|
||||
string NWNX_Data_Array_At_Str(object obj, string tag, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_At_Str(tag, index, obj);
|
||||
}
|
||||
|
||||
float NWNX_Data_Array_At_Flt(object obj, string tag, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_At_Flt(tag, index, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_At_Int(object obj, string tag, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_At_Int(tag, index, obj);
|
||||
}
|
||||
|
||||
object NWNX_Data_Array_At_Obj(object obj, string tag, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_At_Obj(tag, index, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Clear(int type, object obj, string tag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Clear(tag, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return true/value (1/0) if the array contains the value "element"
|
||||
int NWNX_Data_Array_Contains_Str(object obj, string tag, string element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Contains_Str(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Contains_Flt(object obj, string tag, float element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Contains_Flt(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Contains_Int(object obj, string tag, int element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Contains_Int(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Contains_Obj(object obj, string tag, object element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Contains_Obj(tag, element, obj);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void NWNX_Data_Array_Copy(int type, object obj, string tag, string otherTag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Copy(tag, otherTag, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void NWNX_Data_Array_Erase(int type, object obj, string tag, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Erase(tag, index, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// return the index in the array containing "element"
|
||||
// if not found, return NWNX_DATA_INVALID_INDEX
|
||||
int NWNX_Data_Array_Find_Str(object obj, string tag, string element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Find_Str(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Find_Flt(object obj, string tag, float element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Find_Flt(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Find_Int(object obj, string tag, int element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Find_Int(tag, element, obj);
|
||||
}
|
||||
|
||||
int NWNX_Data_Array_Find_Obj(object obj, string tag, object element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Find_Obj(tag, element, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Insert a new element into position 'index'. If index is beyond the number of rows in the array,
|
||||
// this will quietly fail. This could be changed if you wanted to support sparse
|
||||
// arrays.
|
||||
void NWNX_Data_Array_Insert_Str(object obj, string tag, int index, string element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Insert_Str(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Insert_Flt(object obj, string tag, int index, float element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Insert_Flt(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Insert_Int(object obj, string tag, int index, int element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Insert_Int(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Insert_Obj(object obj, string tag, int index, object element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Insert_Obj(tag, index, element, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Insert a new element at the end of the array.
|
||||
void NWNX_Data_Array_PushBack_Str(object obj, string tag, string element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_PushBack_Str(tag, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_PushBack_Flt(object obj, string tag, float element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_PushBack_Flt(tag, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_PushBack_Int(object obj, string tag, int element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_PushBack_Int(tag, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_PushBack_Obj(object obj, string tag, object element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_PushBack_Obj(tag, element, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Cuts the array off at size 'size'. Elements beyond size are removed.
|
||||
void NWNX_Data_Array_Resize(int type, object obj, string tag, int size)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Resize(tag, size, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void NWNX_Data_Array_Shuffle(int type, object obj, string tag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Shuffle(tag, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int NWNX_Data_Array_Size(int type, object obj, string tag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
return Array_Size(tag, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sort the array by value according to 'direciton' (ASC or DESC)
|
||||
// Note that this is a lexical sort, so sorting an array of ints or floats will have
|
||||
// odd results
|
||||
void NWNX_Data_Array_Sort(object obj, string tag, string direction)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Sort(tag, direction, TYPE_STRING, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_SortAscending(int type, object obj, string tag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_SortAscending(tag, TYPE_STRING, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_SortDescending(int type, object obj, string tag)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_SortDescending(tag, TYPE_STRING, obj);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the value of array index 'index' to a 'element'
|
||||
// This will quietly eat values if index > array size
|
||||
void NWNX_Data_Array_Set_Str(object obj, string tag, int index, string element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Set_Str(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Set_Flt(object obj, string tag, int index, float element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Set_Flt(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Set_Int(object obj, string tag, int index, int element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Set_Int(tag, index, element, obj);
|
||||
}
|
||||
|
||||
void NWNX_Data_Array_Set_Obj(object obj, string tag, int index, object element)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Data is deprecated. You should migrate to Array (see inc_array)");
|
||||
Array_Set_Obj(tag, index, element, obj);
|
||||
}
|
483
_module/nss/nwnx_deprecated.nss
Normal file
483
_module/nss/nwnx_deprecated.nss
Normal file
@@ -0,0 +1,483 @@
|
||||
// The following functions have been removed from NWNX, please replace them with their basegame implementation!
|
||||
// To use this file, include it to nwnx.nss and recompile all your scripts.
|
||||
|
||||
// *** NWNX_Creature
|
||||
|
||||
/// @name Cleric Domains
|
||||
/// @anchor cleric_domains
|
||||
///
|
||||
/// The clerical domains.
|
||||
/// @{
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_AIR = 0;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_ANIMAL = 1;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_DEATH = 3;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_DESTRUCTION = 4;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_EARTH = 5;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_EVIL = 6;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_FIRE = 7;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_GOOD = 8;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_HEALING = 9;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_KNOWLEDGE = 10;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_MAGIC = 13;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_PLANT = 14;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_PROTECTION = 15;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_STRENGTH = 16;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_SUN = 17;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_TRAVEL = 18;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_TRICKERY = 19;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_WAR = 20;
|
||||
const int NWNX_CREATURE_CLERIC_DOMAIN_WATER = 21;
|
||||
/// @}
|
||||
|
||||
/// @struct NWNX_Creature_MemorisedSpell
|
||||
/// @brief A memorised spell structure.
|
||||
struct NWNX_Creature_MemorisedSpell
|
||||
{
|
||||
int id; ///< Spell ID
|
||||
int ready; ///< Whether the spell can be cast
|
||||
int meta; ///< Metamagic type, if any
|
||||
int domain; ///< Clerical domain, if any
|
||||
};
|
||||
|
||||
/// @brief Gets the count of memorised spells for a creature's class at a level.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @return The memorised spell count.
|
||||
int NWNX_Creature_GetMemorisedSpellCountByLevel(object creature, int class, int level);
|
||||
|
||||
/// @brief Gets the memorised spell at a class level's index.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetMemorisedSpellCountByLevel().
|
||||
/// @return An NWNX_Creature_MemorisedSpell() struct.
|
||||
struct NWNX_Creature_MemorisedSpell NWNX_Creature_GetMemorisedSpell(object creature, int class, int level, int index);
|
||||
|
||||
/// @brief Sets the memorised spell at a class level's index.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetMemorisedSpellCountByLevel().
|
||||
/// @param spell An NWNX_Creature_MemorisedSpell() struct.
|
||||
void NWNX_Creature_SetMemorisedSpell(object creature, int class, int level, int index, struct NWNX_Creature_MemorisedSpell spell);
|
||||
|
||||
/// @brief Gets the known spell count (innate casting) at a class level.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @return The known spell count.
|
||||
int NWNX_Creature_GetKnownSpellCount(object creature, int class, int level);
|
||||
|
||||
/// @brief Gets the known spell at a class level's index.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetKnownSpellCount().
|
||||
/// @return The spell id.
|
||||
int NWNX_Creature_GetKnownSpell(object creature, int class, int level, int index);
|
||||
|
||||
/// @brief Clear a specific spell from the creature's spellbook for class
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param spellId The spell to clear.
|
||||
void NWNX_Creature_ClearMemorisedKnownSpells(object creature, int class, int spellId);
|
||||
|
||||
/// @brief Clear the memorised spell of the creature for the class, level and index.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param level The spell level.
|
||||
/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetMemorisedSpellCountByLevel().
|
||||
void NWNX_Creature_ClearMemorisedSpell(object creature, int class, int level, int index);
|
||||
|
||||
/// @brief Get the soundset index for creature.
|
||||
/// @param creature The creature object.
|
||||
/// @return The soundset used by the creature.
|
||||
int NWNX_Creature_GetSoundset(object creature);
|
||||
|
||||
/// @brief Set the soundset index for creature.
|
||||
/// @param creature The creature object.
|
||||
/// @param soundset The soundset index.
|
||||
void NWNX_Creature_SetSoundset(object creature, int soundset);
|
||||
|
||||
/// @brief Sets the creature gender.
|
||||
/// @param creature The creature object.
|
||||
/// @param gender The GENDER_ constant.
|
||||
void NWNX_Creature_SetGender(object creature, int gender);
|
||||
|
||||
/// @brief Restore all creature spells per day for given level.
|
||||
/// @param creature The creature object.
|
||||
/// @param level The level to restore. If -1, all spells are restored.
|
||||
void NWNX_Creature_RestoreSpells(object creature, int level = -1);
|
||||
|
||||
/// @brief Gets one of creature's domains.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @param index The first or second domain.
|
||||
/// @deprecated Use GetDomain(). This will be removed in future NWNX releases.
|
||||
int NWNX_Creature_GetDomain(object creature, int class, int index);
|
||||
|
||||
/// @brief Gets the creature's specialist school.
|
||||
/// @param creature The creature object.
|
||||
/// @param class The class id from classes.2da. (Not class index 0-2)
|
||||
/// @deprecated Use GetSpecialization(). This will be removed in future NWNX releases.
|
||||
int NWNX_Creature_GetSpecialization(object creature, int class);
|
||||
|
||||
/// @brief Get the number of uses left of a spell.
|
||||
/// @note This function is for caster classes that don't need to memorize spells.
|
||||
/// @param oCreature The creature.
|
||||
/// @param nSpellID The spell ID.
|
||||
/// @param nMultiClass The position of the class to check, 0-2
|
||||
/// @param nDomainLevel The domain level if checking a domain spell.
|
||||
/// @param nMetaMagic A METAMAGIC_* constant.
|
||||
/// @return The number of spell uses left or 0 on error.
|
||||
int NWNX_Creature_GetSpellUsesLeft(object oCreature, int nSpellID, int nMultiClass, int nDomainLevel = 0, int nMetaMagic = METAMAGIC_NONE);
|
||||
|
||||
/// @brief Get the number of memorized ready spells by spellid.
|
||||
/// @note This function is for caster classes that need to memorize spells.
|
||||
/// @param oCreature The creature.
|
||||
/// @param nSpellID The spell ID.
|
||||
/// @param nMultiClass The position of the class to check, 0-2
|
||||
/// @param nMetaMagic A METAMAGIC_* constant.
|
||||
/// @return The number of spell uses left or 0 on error.
|
||||
int NWNX_Creature_GetMemorizedSpellReadyCount(object oCreature, int nSpellID, int nMultiClass, int nMetaMagic = METAMAGIC_NONE);
|
||||
|
||||
/// @brief Set whether an effect icon is flashing or not.
|
||||
/// @param oCreature The target creature.
|
||||
/// @param nIconId The icon id, see effecticons.2da.
|
||||
/// @param bFlashing TRUE for flashing, FALSE for not flashing.
|
||||
void NWNX_Creature_SetEffectIconFlashing(object oCreature, int nIconId, int bFlashing);
|
||||
|
||||
int NWNX_Creature_GetMemorisedSpellCountByLevel(object creature, int class, int level)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorisedSpellCountByLevel");
|
||||
return GetMemorizedSpellCountByLevel(creature, class, level);
|
||||
}
|
||||
|
||||
struct NWNX_Creature_MemorisedSpell NWNX_Creature_GetMemorisedSpell(object creature, int class, int level, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorisedSpell");
|
||||
struct NWNX_Creature_MemorisedSpell spell;
|
||||
spell.domain = GetMemorizedSpellIsDomainSpell(creature, class, level, index);
|
||||
spell.meta = GetMemorizedSpellMetaMagic(creature, class, level, index);
|
||||
spell.ready = GetMemorizedSpellReady(creature, class, level, index);
|
||||
spell.id = GetMemorizedSpellId(creature, class, level, index);
|
||||
return spell;
|
||||
}
|
||||
|
||||
void NWNX_Creature_SetMemorisedSpell(object creature, int class, int level, int index, struct NWNX_Creature_MemorisedSpell spell)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetMemorisedSpell");
|
||||
SetMemorizedSpell(creature, class, level, index, spell.id, spell.ready, spell.meta, spell.domain);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetKnownSpellCount(object creature, int class, int level)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetKnownSpellCount");
|
||||
return GetKnownSpellCount(creature, class, level);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetKnownSpell(object creature, int class, int level, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetKnownSpell");
|
||||
return GetKnownSpellId(creature, class, level, index);
|
||||
}
|
||||
|
||||
void NWNX_Creature_ClearMemorisedKnownSpells(object creature, int class, int spellId)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_ClearMemorisedKnownSpells");
|
||||
ClearMemorizedSpellBySpellId(creature, class, spellId);
|
||||
}
|
||||
|
||||
void NWNX_Creature_ClearMemorisedSpell(object creature, int class, int level, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_ClearMemorisedSpell");
|
||||
ClearMemorizedSpell(creature, class, level, index);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetSoundset(object creature)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSoundset");
|
||||
return GetSoundset(creature);
|
||||
}
|
||||
|
||||
void NWNX_Creature_SetSoundset(object creature, int soundset)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetSoundset");
|
||||
SetSoundset(creature, soundset);
|
||||
}
|
||||
|
||||
void NWNX_Creature_SetGender(object creature, int gender)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetGender");
|
||||
SetGender(creature, gender);
|
||||
}
|
||||
|
||||
void NWNX_Creature_RestoreSpells(object creature, int level = -1)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_RestoreSpells");
|
||||
if (level == -1)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
ReadySpellLevel(creature, i);
|
||||
}
|
||||
}
|
||||
else
|
||||
ReadySpellLevel(creature, level);
|
||||
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetDomain(object creature, int class, int index)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetDomain");
|
||||
return GetDomain(creature, index, class);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetSpecialization(object creature, int class)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSpecialization");
|
||||
return GetSpecialization(creature, class);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetSpellUsesLeft(object oCreature, int nSpellID, int nMultiClass, int nDomainLevel = 0, int nMetaMagic = METAMAGIC_NONE)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSpellUsesLeft");
|
||||
return GetSpellUsesLeft(oCreature, GetClassByPosition(nMultiClass + 1), nSpellID, nMetaMagic, nDomainLevel);
|
||||
}
|
||||
|
||||
int NWNX_Creature_GetMemorizedSpellReadyCount(object oCreature, int nSpellID, int nMultiClass, int nMetaMagic = METAMAGIC_NONE)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorizedSpellReadyCount");
|
||||
return GetSpellUsesLeft(oCreature, GetClassByPosition(nMultiClass + 1), nSpellID, nMetaMagic);
|
||||
}
|
||||
|
||||
void NWNX_Creature_SetEffectIconFlashing(object oCreature, int nIconId, int bFlashing)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetEffectIconFlashing");
|
||||
SetEffectIconFlashing(oCreature, nIconId, bFlashing);
|
||||
}
|
||||
|
||||
// *** NWNX_Effect
|
||||
|
||||
/// @brief Set a script with optional data that runs when an effect expires
|
||||
/// @param e The effect.
|
||||
/// @param script The script to run when the effect expires.
|
||||
/// @param data Any other data you wish to send back to the script.
|
||||
/// @remark OBJECT_SELF in the script is the object the effect is applied to.
|
||||
/// @note Only works for TEMPORARY and PERMANENT effects applied to an object.
|
||||
effect NWNX_Effect_SetEffectExpiredScript(effect e, string script, string data = "");
|
||||
|
||||
/// @brief Get the data set with NWNX_Effect_SetEffectExpiredScript()
|
||||
/// @note Should only be called from a script set with NWNX_Effect_SetEffectExpiredScript().
|
||||
/// @return The data attached to the effect.
|
||||
string NWNX_Effect_GetEffectExpiredData();
|
||||
|
||||
/// @brief Get the effect creator.
|
||||
/// @note Should only be called from a script set with NWNX_Effect_SetEffectExpiredScript().
|
||||
/// @return The object from which the effect originated.
|
||||
object NWNX_Effect_GetEffectExpiredCreator();
|
||||
|
||||
/// @brief Accessorize an EffectVisualEffect(), making it undispellable and unable to be removed by resting or death.
|
||||
/// @note If linked with a non-visualeffect or a non-accessorized visualeffect it *will* get removed.
|
||||
/// @param eEffect An EffectVisualEffect(), does not work for other effect types.
|
||||
/// @return The accessorized effect or an unchanged effect if not an EffectVisualEffect().
|
||||
effect NWNX_Effect_AccessorizeVisualEffect(effect eEffect);
|
||||
|
||||
effect NWNX_Effect_SetEffectExpiredScript(effect e, string script, string data = "")
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Effect_SetEffectExpiredScript");
|
||||
return EffectLinkEffects(EffectRunScript("", script, "", 0.0f, data), e);
|
||||
}
|
||||
|
||||
string NWNX_Effect_GetEffectExpiredData()
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Effect_GetEffectExpiredData");
|
||||
return GetEffectString(GetLastRunScriptEffect(), 0);
|
||||
}
|
||||
|
||||
object NWNX_Effect_GetEffectExpiredCreator()
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Effect_GetEffectExpiredCreator");
|
||||
return GetEffectCreator(GetLastRunScriptEffect());
|
||||
}
|
||||
|
||||
effect NWNX_Effect_AccessorizeVisualEffect(effect eEffect)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Effect_AccessorizeVisualEffect");
|
||||
if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT)
|
||||
return UnyieldingEffect(eEffect);
|
||||
else
|
||||
return eEffect;
|
||||
}
|
||||
|
||||
// *** NWNX_Object
|
||||
|
||||
/// @brief Convert an object id to the actual object.
|
||||
/// @param id The object id.
|
||||
/// @return An object from the provided object ID.
|
||||
/// @remark This is the counterpart to ObjectToString.
|
||||
/// @deprecated Use the basegame StringToObject() function. This will be removed in a future NWNX release.
|
||||
object NWNX_Object_StringToObject(string id);
|
||||
|
||||
/// @brief Check if an item can fit in an object's inventory.
|
||||
/// @param obj The object with an inventory.
|
||||
/// @param baseitem The base item id to check for a fit.
|
||||
/// @return TRUE if an item of base item type can fit in object's inventory
|
||||
int NWNX_Object_CheckFit(object obj, int baseitem);
|
||||
|
||||
/// @brief Add an effect to an object that displays an icon and has no other effect.
|
||||
/// @remark See effecticons.2da for a list of possible effect icons.
|
||||
/// @param obj The object to apply the effect.
|
||||
/// @param nIcon The icon id.
|
||||
/// @param fDuration If specified the effect will be temporary and last this length in seconds, otherwise the effect
|
||||
/// will be permanent.
|
||||
void NWNX_Object_AddIconEffect(object obj, int nIcon, float fDuration=0.0);
|
||||
|
||||
/// @brief Remove an icon effect from an object that was added by the NWNX_Object_AddIconEffect() function.
|
||||
/// @param obj The object.
|
||||
/// @param nIcon The icon id.
|
||||
void NWNX_Object_RemoveIconEffect(object obj, int nIcon);
|
||||
|
||||
/// @brief Cause oObject to face fDirection.
|
||||
/// @note This function is almost identical to SetFacing(), the only difference being that it allows you to specify
|
||||
/// the target object without the use of AssignCommand(). This is useful when you want to change the facing of an object
|
||||
/// in an ExecuteScriptChunk() call where AssignCommand() does not work.
|
||||
/// @param oObject The object to change its facing of
|
||||
/// @param fDirection The direction the object should face
|
||||
void NWNX_Object_SetFacing(object oObject, float fDirection);
|
||||
|
||||
object NWNX_Object_StringToObject(string id)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Object_StringToObject");
|
||||
return StringToObject(id);
|
||||
}
|
||||
|
||||
int NWNX_Object_CheckFit(object obj, int baseitem)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Object_CheckFit");
|
||||
return GetBaseItemFitsInInventory(baseitem, obj);
|
||||
}
|
||||
|
||||
void NWNX_Object_AddIconEffect(object obj, int nIcon, float fDuration=0.0)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Object_AddIconEffect");
|
||||
effect eEffect = GetFirstEffect(obj);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
if (GetEffectTag(eEffect) == "NWNX_Object_IconEffect" && GetEffectInteger(eEffect, 0) == nIcon)
|
||||
RemoveEffect(obj, eEffect);
|
||||
eEffect = GetNextEffect(obj);
|
||||
}
|
||||
|
||||
effect eIcon = TagEffect(SupernaturalEffect(EffectIcon(nIcon)), "NWNX_Object_IconEffect");
|
||||
ApplyEffectToObject(fDuration == 0.0 ? DURATION_TYPE_PERMANENT : DURATION_TYPE_TEMPORARY, eIcon, obj, fDuration);
|
||||
}
|
||||
|
||||
void NWNX_Object_RemoveIconEffect(object obj, int nIcon)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Object_RemoveIconEffect");
|
||||
effect eEffect = GetFirstEffect(obj);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
if (GetEffectTag(eEffect) == "NWNX_Object_IconEffect" && GetEffectInteger(eEffect, 0) == nIcon)
|
||||
RemoveEffect(obj, eEffect);
|
||||
eEffect = GetNextEffect(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void NWNX_Object_SetFacing(object oObject, float fDirection)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Object_SetFacing");
|
||||
AssignCommand(oObject, SetFacing(fDirection));
|
||||
}
|
||||
|
||||
// *** NWNX_Regex
|
||||
|
||||
/// @param str The string to search.
|
||||
/// @param regex The regular expression to use when searching.
|
||||
/// @return TRUE if string matches the regular expression.
|
||||
int NWNX_Regex_Search(string str, string regex);
|
||||
|
||||
/// @brief Replaces any matches of the regular expression with a string.
|
||||
/// @param str The string to search.
|
||||
/// @param regex The regular expression to use when searching.
|
||||
/// @param replace The string to replace the matches with.
|
||||
/// @param firstOnly Set to TRUE to only replace the first match.
|
||||
/// @return A new string with any replacements made.
|
||||
string NWNX_Regex_Replace(string str, string regex, string replace = "", int firstOnly = FALSE);
|
||||
|
||||
/// @brief Returns all matches in a string that match the regular expression.
|
||||
/// @param str The string to search.
|
||||
/// @param regex The regular expression to use.
|
||||
/// @return A json array with json arrays of all (sub)matches. Returns JsonNull() on error.
|
||||
json NWNX_Regex_Match(string str, string regex);
|
||||
|
||||
int NWNX_Regex_Search(string str, string regex)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Regex_Search");
|
||||
return JsonGetLength(RegExpMatch(regex, str));
|
||||
}
|
||||
|
||||
string NWNX_Regex_Replace(string str, string regex, string replace="", int firstOnly=0)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Regex_Replace");
|
||||
return RegExpReplace(regex, str, replace, firstOnly ? REGEXP_FORMAT_FIRST_ONLY : REGEXP_FORMAT_DEFAULT);
|
||||
}
|
||||
|
||||
json NWNX_Regex_Match(string str, string regex)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Regex_Match");
|
||||
return RegExpIterate(regex, str);
|
||||
}
|
||||
|
||||
// *** NWNX_Util
|
||||
|
||||
/// @brief Determines if the supplied resref exists.
|
||||
/// @param resref The resref to check.
|
||||
/// @param type The @ref resref_types "Resref Type".
|
||||
/// @return TRUE/FALSE
|
||||
int NWNX_Util_IsValidResRef(string resref, int type = RESTYPE_UTC);
|
||||
|
||||
/// @anchor twoda_row_count
|
||||
/// @brief Gets the row count for a 2da.
|
||||
/// @param str The 2da to check (do not include the .2da).
|
||||
/// @return The amount of rows in the 2da.
|
||||
int NWNX_Util_Get2DARowCount(string str);
|
||||
|
||||
/// @brief Gets the contents of a .nss script file as a string.
|
||||
/// @param sScriptName The name of the script to get the contents of.
|
||||
/// @param nMaxLength The max length of the return string, -1 to get everything
|
||||
/// @return The script file contents or "" on error.
|
||||
string NWNX_Util_GetNSSContents(string sScriptName, int nMaxLength = -1);
|
||||
|
||||
/// @brief Get the ticks per second of the server.
|
||||
/// @remark Useful to dynamically detect lag and adjust behavior accordingly.
|
||||
/// @return The ticks per second.
|
||||
int NWNX_Util_GetServerTicksPerSecond();
|
||||
|
||||
int NWNX_Util_IsValidResRef(string resref, int type = RESTYPE_UTC)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Util_IsValidResRef");
|
||||
return ResManGetAliasFor(resref, type) != "";
|
||||
}
|
||||
|
||||
int NWNX_Util_Get2DARowCount(string str)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Util_Get2DARowCount");
|
||||
return Get2DARowCount(str);
|
||||
}
|
||||
|
||||
string NWNX_Util_GetNSSContents(string sScriptName, int nMaxLength = -1)
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Util_GetNSSContents");
|
||||
string s = ResManGetFileContents(sScriptName, RESTYPE_NSS);
|
||||
return nMaxLength == -1 ? s : GetStringLeft(s, nMaxLength);
|
||||
}
|
||||
|
||||
int NWNX_Util_GetServerTicksPerSecond()
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: Calling deprecated NWNX Function: NWNX_Util_GetServerTicksPerSecond");
|
||||
return GetTickRate();
|
||||
}
|
@@ -83,7 +83,7 @@ int NWNX_Dialog_GetCurrentNodeType()
|
||||
string sFunc = "GetCurrentNodeType";
|
||||
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Dialog_GetCurrentScriptType()
|
||||
@@ -91,7 +91,7 @@ int NWNX_Dialog_GetCurrentScriptType()
|
||||
string sFunc = "GetCurrentScriptType";
|
||||
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Dialog_GetCurrentNodeID()
|
||||
@@ -99,7 +99,7 @@ int NWNX_Dialog_GetCurrentNodeID()
|
||||
string sFunc = "GetCurrentNodeID";
|
||||
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Dialog_GetCurrentNodeIndex()
|
||||
@@ -107,26 +107,26 @@ int NWNX_Dialog_GetCurrentNodeIndex()
|
||||
string sFunc = "GetCurrentNodeIndex";
|
||||
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Dialog_GetCurrentNodeText(int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE)
|
||||
{
|
||||
string sFunc = "GetCurrentNodeText";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Dialog, sFunc, gender);
|
||||
NWNX_PushArgumentInt(NWNX_Dialog, sFunc, language);
|
||||
NWNX_PushArgumentInt(gender);
|
||||
NWNX_PushArgumentInt(language);
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Dialog, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Dialog_SetCurrentNodeText(string text, int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE)
|
||||
{
|
||||
string sFunc = "SetCurrentNodeText";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Dialog, sFunc, gender);
|
||||
NWNX_PushArgumentInt(NWNX_Dialog, sFunc, language);
|
||||
NWNX_PushArgumentString(NWNX_Dialog, sFunc, text);
|
||||
NWNX_PushArgumentInt(gender);
|
||||
NWNX_PushArgumentInt(language);
|
||||
NWNX_PushArgumentString(text);
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
}
|
||||
|
||||
@@ -134,6 +134,6 @@ void NWNX_Dialog_End(object oObject)
|
||||
{
|
||||
string sFunc = "End";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Dialog, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Dialog, sFunc);
|
||||
}
|
||||
|
@@ -6,9 +6,24 @@
|
||||
|
||||
const string NWNX_Effect = "NWNX_Effect"; ///< @private
|
||||
|
||||
/// EQUIPPED effects are always associated with a slotted item:
|
||||
/// Setting this duration type requires the effect creator
|
||||
/// to be set to the (already equipped) item that should remove
|
||||
/// this effect when unequipped.
|
||||
/// Removal behaviour for effects where the creator is NOT a equipped
|
||||
/// item is undefined.
|
||||
/// They are not removed by resting, cannot be dispelled, etc.
|
||||
const int DURATION_TYPE_EQUIPPED = 3;
|
||||
|
||||
/// These are feat/racial effects used internally by the game to
|
||||
/// implement things like movement speed changes and darkvision.
|
||||
/// They cannot be removed by resting, dispelling, etc.
|
||||
const int DURATION_TYPE_INNATE = 4;
|
||||
|
||||
/// An unpacked effect
|
||||
struct NWNX_EffectUnpacked
|
||||
{
|
||||
string sID; ///< @todo Describe
|
||||
int nType; ///< @todo Describe
|
||||
int nSubType; ///< @todo Describe
|
||||
|
||||
@@ -54,6 +69,8 @@ struct NWNX_EffectUnpacked
|
||||
vector vParam1; ///< @todo Describe
|
||||
|
||||
string sTag; ///< @todo Describe
|
||||
|
||||
string sItemProp; ///< @todo Describe
|
||||
};
|
||||
|
||||
/// @brief Convert native effect type to unpacked structure.
|
||||
@@ -66,194 +83,320 @@ struct NWNX_EffectUnpacked NWNX_Effect_UnpackEffect(effect e);
|
||||
/// @return The effect.
|
||||
effect NWNX_Effect_PackEffect(struct NWNX_EffectUnpacked e);
|
||||
|
||||
/// @brief Set a script with optional data that runs when an effect expires
|
||||
/// @param e The effect.
|
||||
/// @param script The script to run when the effect expires.
|
||||
/// @param data Any other data you wish to send back to the script.
|
||||
/// @remark OBJECT_SELF in the script is the object the effect is applied to.
|
||||
/// @note Only works for TEMPORARY and PERMANENT effects applied to an object.
|
||||
effect NWNX_Effect_SetEffectExpiredScript(effect e, string script, string data = "");
|
||||
|
||||
/// @brief Get the data set with NWNX_Effect_SetEffectExpiredScript()
|
||||
/// @note Should only be called from a script set with NWNX_Effect_SetEffectExpiredScript().
|
||||
/// @return The data attached to the effect.
|
||||
string NWNX_Effect_GetEffectExpiredData();
|
||||
|
||||
/// @brief Get the effect creator.
|
||||
/// @note Should only be called from a script set with NWNX_Effect_SetEffectExpiredScript().
|
||||
/// @return The object from which the effect originated.
|
||||
object NWNX_Effect_GetEffectExpiredCreator();
|
||||
|
||||
/// @brief replace an already applied effect on an object
|
||||
/// Only duration, subtype, tag and spell related fields can be overwritten.
|
||||
/// @note eNew and eOld need to have the same type.
|
||||
/// @return Number of internal effects updated.
|
||||
int NWNX_Effect_ReplaceEffect(object obj, effect eOld, effect eNew);
|
||||
|
||||
/// @brief Gets the true effect count
|
||||
/// @param oObject The object to get the count of.
|
||||
/// @return the number of effects (item properties and other non-exposed effects included)
|
||||
int NWNX_Effect_GetTrueEffectCount(object oObject);
|
||||
|
||||
/// @brief Gets a specific effect on an object. This can grab effects normally hidden from developers, such as item properties.
|
||||
/// @param oObject The object with the effect
|
||||
/// @param nIndex The point in the array to retrieve (0 to GetTrueEffectCount())
|
||||
/// @return A constructed NWNX_EffectUnpacked.
|
||||
struct NWNX_EffectUnpacked NWNX_Effect_GetTrueEffect(object oObject, int nIndex);
|
||||
|
||||
/// @brief Replaces an already applied effect with another.
|
||||
/// @param oObject The object with the effect to replace
|
||||
/// @param nIndex The array element to be replaced
|
||||
/// @param e The unpacked effect to replace it with.
|
||||
/// @note Cannot replace an effect with a different type or ID.
|
||||
void NWNX_Effect_ReplaceEffectByIndex(object oObject, int nIndex, struct NWNX_EffectUnpacked e);
|
||||
|
||||
/// @brief Removes effect by ID
|
||||
/// @param oObject The object to remove the effect from
|
||||
/// @param sID The id of the effect, can be retrieved by unpacking effects.
|
||||
/// @return FALSE/0 on failure TRUE/1 on success.
|
||||
int NWNX_Effect_RemoveEffectById(object oObject, string sID);
|
||||
|
||||
/// @brief Applys an effect, bypassing any processing done by ApplyEffectToObject
|
||||
/// @param eEffect The effect to be applied.
|
||||
/// @param oObject The object to apply it to.
|
||||
void NWNX_Effect_Apply(effect eEffect, object oObject);
|
||||
|
||||
/// @brief Sets an effect creator.
|
||||
/// @param eEffect The effect to be modified.
|
||||
/// @param oObject The effect creator.
|
||||
/// @return The effect with creator field set.
|
||||
effect NWNX_Effect_SetEffectCreator(effect eEffect, object oObject);
|
||||
|
||||
/// @brief Checks if the given effect is valid. Unlike the game builtin, this call considers internal types too.
|
||||
/// @param eEffect The effect to check
|
||||
/// @return TRUE if the effect is valid (including internal types).
|
||||
int NWNX_Effect_GetIsEffectValid(effect eEffect);
|
||||
|
||||
/// @brief Returns the number of applied effects on the given object.
|
||||
/// @param oObject The object to get the applied effect count for.
|
||||
/// @return The number of applied effects, including internal.
|
||||
int NWNX_Effect_GetAppliedEffectCount(object oObject);
|
||||
|
||||
/// @brief Returns the nNth applied effect on a object.
|
||||
/// @param oObject The object to get the applied effect copy for.
|
||||
/// @param nNth The effect index to get.
|
||||
/// @note Make sure to check with NWNX_Effect_GetIsEffectValid, as this iterator also includes internal effects.
|
||||
/// @return A copy of the applied game effect, or a invalid effect.
|
||||
effect NWNX_Effect_GetAppliedEffect(object oObject, int nNth);
|
||||
|
||||
/// @}
|
||||
|
||||
struct NWNX_EffectUnpacked __NWNX_Effect_ResolveUnpack(string sFunc, int bLink=TRUE)
|
||||
{
|
||||
struct NWNX_EffectUnpacked n;
|
||||
|
||||
n.sItemProp = NWNX_GetReturnValueString();
|
||||
|
||||
n.sTag = NWNX_GetReturnValueString();
|
||||
|
||||
float fZ = NWNX_GetReturnValueFloat();
|
||||
float fY = NWNX_GetReturnValueFloat();
|
||||
float fX = NWNX_GetReturnValueFloat();
|
||||
n.vParam1 = Vector(fX, fY, fZ);
|
||||
fZ = NWNX_GetReturnValueFloat();
|
||||
fY = NWNX_GetReturnValueFloat();
|
||||
fX = NWNX_GetReturnValueFloat();
|
||||
n.vParam0 = Vector(fX, fY, fZ);
|
||||
n.oParam3 = NWNX_GetReturnValueObject();
|
||||
n.oParam2 = NWNX_GetReturnValueObject();
|
||||
n.oParam1 = NWNX_GetReturnValueObject();
|
||||
n.oParam0 = NWNX_GetReturnValueObject();
|
||||
n.sParam5 = NWNX_GetReturnValueString();
|
||||
n.sParam4 = NWNX_GetReturnValueString();
|
||||
n.sParam3 = NWNX_GetReturnValueString();
|
||||
n.sParam2 = NWNX_GetReturnValueString();
|
||||
n.sParam1 = NWNX_GetReturnValueString();
|
||||
n.sParam0 = NWNX_GetReturnValueString();
|
||||
n.fParam3 = NWNX_GetReturnValueFloat();
|
||||
n.fParam2 = NWNX_GetReturnValueFloat();
|
||||
n.fParam1 = NWNX_GetReturnValueFloat();
|
||||
n.fParam0 = NWNX_GetReturnValueFloat();
|
||||
n.nParam7 = NWNX_GetReturnValueInt();
|
||||
n.nParam6 = NWNX_GetReturnValueInt();
|
||||
n.nParam5 = NWNX_GetReturnValueInt();
|
||||
n.nParam4 = NWNX_GetReturnValueInt();
|
||||
n.nParam3 = NWNX_GetReturnValueInt();
|
||||
n.nParam2 = NWNX_GetReturnValueInt();
|
||||
n.nParam1 = NWNX_GetReturnValueInt();
|
||||
n.nParam0 = NWNX_GetReturnValueInt();
|
||||
n.nNumIntegers = NWNX_GetReturnValueInt();
|
||||
|
||||
if(bLink)
|
||||
{
|
||||
n.bLinkRightValid = NWNX_GetReturnValueInt();
|
||||
n.eLinkRight = NWNX_GetReturnValueEffect();
|
||||
n.bLinkLeftValid = NWNX_GetReturnValueInt();
|
||||
n.eLinkLeft = NWNX_GetReturnValueEffect();
|
||||
}
|
||||
else
|
||||
{
|
||||
n.bLinkRightValid = FALSE;
|
||||
n.bLinkLeftValid = FALSE;
|
||||
}
|
||||
|
||||
n.nCasterLevel = NWNX_GetReturnValueInt();
|
||||
n.bShowIcon = NWNX_GetReturnValueInt();
|
||||
n.bExpose = NWNX_GetReturnValueInt();
|
||||
n.nSpellId = NWNX_GetReturnValueInt();
|
||||
n.oCreator = NWNX_GetReturnValueObject();
|
||||
|
||||
n.nExpiryTimeOfDay = NWNX_GetReturnValueInt();
|
||||
n.nExpiryCalendarDay = NWNX_GetReturnValueInt();
|
||||
n.fDuration = NWNX_GetReturnValueFloat();
|
||||
|
||||
n.nSubType = NWNX_GetReturnValueInt();
|
||||
n.nType = NWNX_GetReturnValueInt();
|
||||
n.sID = NWNX_GetReturnValueString();
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
void __NWNX_Effect_ResolvePack(string sFunc, struct NWNX_EffectUnpacked e, int bReplace=FALSE)
|
||||
{
|
||||
if(!bReplace)
|
||||
NWNX_PushArgumentInt(e.nType);
|
||||
|
||||
NWNX_PushArgumentInt(e.nSubType);
|
||||
|
||||
NWNX_PushArgumentFloat(e.fDuration);
|
||||
NWNX_PushArgumentInt(e.nExpiryCalendarDay);
|
||||
NWNX_PushArgumentInt(e.nExpiryTimeOfDay);
|
||||
|
||||
NWNX_PushArgumentObject(e.oCreator);
|
||||
NWNX_PushArgumentInt(e.nSpellId);
|
||||
NWNX_PushArgumentInt(e.bExpose);
|
||||
NWNX_PushArgumentInt(e.bShowIcon);
|
||||
NWNX_PushArgumentInt(e.nCasterLevel);
|
||||
|
||||
if(!bReplace)
|
||||
{
|
||||
NWNX_PushArgumentEffect(e.eLinkLeft);
|
||||
NWNX_PushArgumentInt(e.bLinkLeftValid);
|
||||
NWNX_PushArgumentEffect(e.eLinkRight);
|
||||
NWNX_PushArgumentInt(e.bLinkRightValid);
|
||||
}
|
||||
|
||||
NWNX_PushArgumentInt(e.nNumIntegers);
|
||||
NWNX_PushArgumentInt(e.nParam0);
|
||||
NWNX_PushArgumentInt(e.nParam1);
|
||||
NWNX_PushArgumentInt(e.nParam2);
|
||||
NWNX_PushArgumentInt(e.nParam3);
|
||||
NWNX_PushArgumentInt(e.nParam4);
|
||||
NWNX_PushArgumentInt(e.nParam5);
|
||||
NWNX_PushArgumentInt(e.nParam6);
|
||||
NWNX_PushArgumentInt(e.nParam7);
|
||||
NWNX_PushArgumentFloat(e.fParam0);
|
||||
NWNX_PushArgumentFloat(e.fParam1);
|
||||
NWNX_PushArgumentFloat(e.fParam2);
|
||||
NWNX_PushArgumentFloat(e.fParam3);
|
||||
NWNX_PushArgumentString(e.sParam0);
|
||||
NWNX_PushArgumentString(e.sParam1);
|
||||
NWNX_PushArgumentString(e.sParam2);
|
||||
NWNX_PushArgumentString(e.sParam3);
|
||||
NWNX_PushArgumentString(e.sParam4);
|
||||
NWNX_PushArgumentString(e.sParam5);
|
||||
NWNX_PushArgumentObject(e.oParam0);
|
||||
NWNX_PushArgumentObject(e.oParam1);
|
||||
NWNX_PushArgumentObject(e.oParam2);
|
||||
NWNX_PushArgumentObject(e.oParam3);
|
||||
|
||||
NWNX_PushArgumentFloat(e.vParam0.x);
|
||||
NWNX_PushArgumentFloat(e.vParam0.y);
|
||||
NWNX_PushArgumentFloat(e.vParam0.z);
|
||||
|
||||
NWNX_PushArgumentFloat(e.vParam1.x);
|
||||
NWNX_PushArgumentFloat(e.vParam1.y);
|
||||
NWNX_PushArgumentFloat(e.vParam1.z);
|
||||
|
||||
NWNX_PushArgumentString(e.sTag);
|
||||
|
||||
NWNX_PushArgumentString(e.sItemProp);
|
||||
}
|
||||
|
||||
struct NWNX_EffectUnpacked NWNX_Effect_UnpackEffect(effect e)
|
||||
{
|
||||
string sFunc = "UnpackEffect";
|
||||
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, e);
|
||||
NWNX_PushArgumentEffect(e);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
struct NWNX_EffectUnpacked n;
|
||||
n.sTag = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
|
||||
float fZ = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
float fY = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
float fX = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.vParam1 = Vector(fX, fY, fZ);
|
||||
fZ = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
fY = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
fX = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.vParam0 = Vector(fX, fY, fZ);
|
||||
n.oParam3 = NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
n.oParam2 = NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
n.oParam1 = NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
n.oParam0 = NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
n.sParam5 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.sParam4 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.sParam3 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.sParam2 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.sParam1 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.sParam0 = NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
n.fParam3 = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.fParam2 = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.fParam1 = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.fParam0 = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
n.nParam7 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam6 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam5 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam4 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam3 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam2 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam1 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nParam0 = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nNumIntegers = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
|
||||
n.bLinkRightValid = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.eLinkRight = NWNX_GetReturnValueEffect(NWNX_Effect, sFunc);
|
||||
n.bLinkLeftValid = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.eLinkLeft = NWNX_GetReturnValueEffect(NWNX_Effect, sFunc);
|
||||
|
||||
n.nCasterLevel = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.bShowIcon = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.bExpose = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nSpellId = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.oCreator = NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
|
||||
n.nExpiryTimeOfDay = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nExpiryCalendarDay = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.fDuration = NWNX_GetReturnValueFloat(NWNX_Effect, sFunc);
|
||||
|
||||
n.nSubType = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
n.nType = NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
|
||||
return n;
|
||||
return __NWNX_Effect_ResolveUnpack(sFunc);
|
||||
}
|
||||
effect NWNX_Effect_PackEffect(struct NWNX_EffectUnpacked e)
|
||||
{
|
||||
string sFunc = "PackEffect";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nType);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nSubType);
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.fDuration);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nExpiryCalendarDay);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nExpiryTimeOfDay);
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, e.oCreator);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nSpellId);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.bExpose);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.bShowIcon);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nCasterLevel);
|
||||
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, e.eLinkLeft);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.bLinkLeftValid);
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, e.eLinkRight);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.bLinkRightValid);
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nNumIntegers);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam0);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam1);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam2);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam3);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam4);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam5);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam6);
|
||||
NWNX_PushArgumentInt(NWNX_Effect, sFunc, e.nParam7);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.fParam0);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.fParam1);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.fParam2);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.fParam3);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam0);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam1);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam2);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam3);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam4);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sParam5);
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, e.oParam0);
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, e.oParam1);
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, e.oParam2);
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, e.oParam3);
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam0.x);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam0.y);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam0.z);
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam1.x);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam1.y);
|
||||
NWNX_PushArgumentFloat(NWNX_Effect, sFunc, e.vParam1.z);
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, e.sTag);
|
||||
__NWNX_Effect_ResolvePack(sFunc, e);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
return NWNX_GetReturnValueEffect(NWNX_Effect, sFunc);
|
||||
}
|
||||
|
||||
effect NWNX_Effect_SetEffectExpiredScript(effect e, string script, string data = "")
|
||||
{
|
||||
string sFunc = "SetEffectExpiredScript";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, data);
|
||||
NWNX_PushArgumentString(NWNX_Effect, sFunc, script);
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, e);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueEffect(NWNX_Effect, sFunc);
|
||||
}
|
||||
|
||||
string NWNX_Effect_GetEffectExpiredData()
|
||||
{
|
||||
string sFunc = "GetEffectExpiredData";
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Effect, sFunc);
|
||||
}
|
||||
|
||||
object NWNX_Effect_GetEffectExpiredCreator()
|
||||
{
|
||||
string sFunc = "GetEffectExpiredCreator";
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Effect, sFunc);
|
||||
return NWNX_GetReturnValueEffect();
|
||||
}
|
||||
|
||||
int NWNX_Effect_ReplaceEffect(object obj, effect eOld, effect eNew)
|
||||
{
|
||||
string sFunc = "ReplaceEffect";
|
||||
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, eNew);
|
||||
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, eOld);
|
||||
NWNX_PushArgumentObject(NWNX_Effect, sFunc, obj);
|
||||
NWNX_PushArgumentEffect(eNew);
|
||||
NWNX_PushArgumentEffect(eOld);
|
||||
NWNX_PushArgumentObject(obj);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Effect_GetTrueEffectCount(object oObject)
|
||||
{
|
||||
string sFunc = "GetTrueEffectCount";
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_EffectUnpacked NWNX_Effect_GetTrueEffect(object oObject, int nIndex)
|
||||
{
|
||||
string sFunc = "GetTrueEffect";
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return __NWNX_Effect_ResolveUnpack(sFunc, FALSE);
|
||||
}
|
||||
|
||||
void NWNX_Effect_ReplaceEffectByIndex(object oObject, int nIndex, struct NWNX_EffectUnpacked e)
|
||||
{
|
||||
string sFunc = "ReplaceEffectByIndex";
|
||||
|
||||
__NWNX_Effect_ResolvePack(sFunc, e, TRUE);
|
||||
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Effect_RemoveEffectById(object oObject, string sID)
|
||||
{
|
||||
string sFunc = "RemoveEffectById";
|
||||
NWNX_PushArgumentString(sID);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Effect_Apply(effect eEffect, object oObject)
|
||||
{
|
||||
string sFunc = "Apply";
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentEffect(eEffect);
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
}
|
||||
|
||||
effect NWNX_Effect_SetEffectCreator(effect eEffect, object oObject)
|
||||
{
|
||||
string sFunc = "SetEffectCreator";
|
||||
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentEffect(eEffect);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueEffect();
|
||||
}
|
||||
|
||||
int NWNX_Effect_GetIsEffectValid(effect eEffect)
|
||||
{
|
||||
string sFunc = "GetIsEffectValid";
|
||||
|
||||
NWNX_PushArgumentEffect(eEffect);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Effect_GetAppliedEffectCount(object oObject)
|
||||
{
|
||||
string sFunc = "GetAppliedEffectCount";
|
||||
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
effect NWNX_Effect_GetAppliedEffect(object oObject, int nNth)
|
||||
{
|
||||
string sFunc = "GetAppliedEffect";
|
||||
|
||||
NWNX_PushArgumentInt(nNth);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
|
||||
NWNX_CallFunction(NWNX_Effect, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueEffect();
|
||||
}
|
||||
|
@@ -21,11 +21,8 @@ const int NWNX_ELC_VALIDATION_FAILURE_TYPE_CUSTOM = 6;
|
||||
|
||||
/// @anchor elc_fail_subtype
|
||||
/// @name ELC Failure Subtypes
|
||||
/// @note By default these constants are commented out to avoid a
|
||||
/// limitation on constants. Uncomment them as needed.
|
||||
/// @{
|
||||
const int NWNX_ELC_SUBTYPE_NONE = 0;
|
||||
/*
|
||||
const int NWNX_ELC_SUBTYPE_SERVER_LEVEL_RESTRICTION = 1;
|
||||
const int NWNX_ELC_SUBTYPE_LEVEL_HACK = 2;
|
||||
const int NWNX_ELC_SUBTYPE_COLORED_NAME = 3;
|
||||
@@ -75,7 +72,7 @@ const int NWNX_ELC_SUBTYPE_SKILL_LIST_COMPARISON = 48;
|
||||
const int NWNX_ELC_SUBTYPE_FEAT_LIST_COMPARISON = 49;
|
||||
const int NWNX_ELC_SUBTYPE_MISC_SAVING_THROW = 50;
|
||||
const int NWNX_ELC_SUBTYPE_NUM_FEAT_COMPARISON = 51;
|
||||
*/
|
||||
const int NWNX_ELC_SUBTYPE_NUM_MULTICLASS = 52;
|
||||
/// @}
|
||||
|
||||
/// @brief Sets the script that runs whenever an ELC validation failure happens
|
||||
@@ -152,7 +149,7 @@ void NWNX_ELC_SetELCScript(string sScript)
|
||||
{
|
||||
string sFunc = "SetELCScript";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_ELC, sFunc, sScript);
|
||||
NWNX_PushArgumentString(sScript);
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
}
|
||||
|
||||
@@ -160,7 +157,7 @@ void NWNX_ELC_EnableCustomELCCheck(int bEnabled)
|
||||
{
|
||||
string sFunc = "EnableCustomELCCheck";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_ELC, sFunc, bEnabled);
|
||||
NWNX_PushArgumentInt(bEnabled);
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
}
|
||||
|
||||
@@ -176,7 +173,7 @@ int NWNX_ELC_GetValidationFailureType()
|
||||
string sFunc = "GetValidationFailureType";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureSubType()
|
||||
@@ -184,7 +181,7 @@ int NWNX_ELC_GetValidationFailureSubType()
|
||||
string sFunc = "GetValidationFailureSubType";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureMessageStrRef()
|
||||
@@ -192,14 +189,14 @@ int NWNX_ELC_GetValidationFailureMessageStrRef()
|
||||
string sFunc = "GetValidationFailureMessageStrRef";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_ELC_SetValidationFailureMessageStrRef(int nStrRef)
|
||||
{
|
||||
string sFunc = "SetValidationFailureMessageStrRef";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_ELC, sFunc, nStrRef);
|
||||
NWNX_PushArgumentInt(nStrRef);
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
}
|
||||
|
||||
@@ -208,7 +205,7 @@ object NWNX_ELC_GetValidationFailureItem()
|
||||
string sFunc = "GetValidationFailureItem";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueObject(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureLevel()
|
||||
@@ -216,7 +213,7 @@ int NWNX_ELC_GetValidationFailureLevel()
|
||||
string sFunc = "GetValidationFailureLevel";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureSkillID()
|
||||
@@ -224,7 +221,7 @@ int NWNX_ELC_GetValidationFailureSkillID()
|
||||
string sFunc = "GetValidationFailureSkillID";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureFeatID()
|
||||
@@ -232,7 +229,7 @@ int NWNX_ELC_GetValidationFailureFeatID()
|
||||
string sFunc = "GetValidationFailureFeatID";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_ELC_GetValidationFailureSpellID()
|
||||
@@ -240,5 +237,5 @@ int NWNX_ELC_GetValidationFailureSpellID()
|
||||
string sFunc = "GetValidationFailureSpellID";
|
||||
|
||||
NWNX_CallFunction(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
@@ -15,6 +15,9 @@ struct NWNX_Encounter_CreatureListEntry
|
||||
int alreadyUsed; //< Creature has already been used.
|
||||
};
|
||||
|
||||
/// @brief Immediately destroys the specified encounter object.
|
||||
/// @param encounter The encounter object.
|
||||
void NWNX_Encounter_Destroy(object encounter);
|
||||
|
||||
/// @brief Get the number of creatures in the encounter list
|
||||
/// @param encounter The encounter object.
|
||||
@@ -53,6 +56,16 @@ int NWNX_Encounter_GetPlayerTriggeredOnly(object encounter);
|
||||
/// @param playerTriggeredOnly TRUE/FALSE
|
||||
void NWNX_Encounter_SetPlayerTriggeredOnly(object encounter, int playerTriggeredOnly);
|
||||
|
||||
/// @brief Get if the encounter respawns or not.
|
||||
/// @param encounter The encounter object.
|
||||
/// @return TRUE if the encounter does respawn, FALSE otherwise.
|
||||
int NWNX_Encounter_GetCanReset(object encounter);
|
||||
|
||||
/// @brief Set if the encounter respawns or not.
|
||||
/// @param encounter The encounter object.
|
||||
/// @param reset Does the encounter respawn TRUE or FALSE.
|
||||
void NWNX_Encounter_SetCanReset(object encounter, int reset);
|
||||
|
||||
/// @brief Get the reset time of encounter.
|
||||
/// @param encounter The encounter object.
|
||||
/// @return The seconds the encounter is defined to reset.
|
||||
@@ -107,14 +120,22 @@ void NWNX_Encounter_SetGeometry(object oTrigger, string sGeometry);
|
||||
|
||||
/// @}
|
||||
|
||||
void NWNX_Encounter_Destroy(object encounter)
|
||||
{
|
||||
string sFunc = "Destroy";
|
||||
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Encounter_GetNumberOfCreaturesInEncounterList(object encounter)
|
||||
{
|
||||
string sFunc = "GetNumberOfCreaturesInEncounterList";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_Encounter_CreatureListEntry NWNX_Encounter_GetEncounterCreatureByIndex(object encounter, int index)
|
||||
@@ -122,15 +143,15 @@ struct NWNX_Encounter_CreatureListEntry NWNX_Encounter_GetEncounterCreatureByInd
|
||||
string sFunc = "GetEncounterCreatureByIndex";
|
||||
struct NWNX_Encounter_CreatureListEntry creatureEntry;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, index);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(index);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
creatureEntry.alreadyUsed = NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
creatureEntry.unique = NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
creatureEntry.challengeRating = NWNX_GetReturnValueFloat(NWNX_Encounter, sFunc);
|
||||
creatureEntry.resref = NWNX_GetReturnValueString(NWNX_Encounter, sFunc);
|
||||
creatureEntry.alreadyUsed = NWNX_GetReturnValueInt();
|
||||
creatureEntry.unique = NWNX_GetReturnValueInt();
|
||||
creatureEntry.challengeRating = NWNX_GetReturnValueFloat();
|
||||
creatureEntry.resref = NWNX_GetReturnValueString();
|
||||
|
||||
return creatureEntry;
|
||||
}
|
||||
@@ -139,12 +160,12 @@ void NWNX_Encounter_SetEncounterCreatureByIndex(object encounter, int index, str
|
||||
{
|
||||
string sFunc = "SetEncounterCreatureByIndex";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, creatureEntry.alreadyUsed);
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, creatureEntry.unique);
|
||||
NWNX_PushArgumentFloat(NWNX_Encounter, sFunc, creatureEntry.challengeRating);
|
||||
NWNX_PushArgumentString(NWNX_Encounter, sFunc, creatureEntry.resref);
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, index);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(creatureEntry.alreadyUsed);
|
||||
NWNX_PushArgumentInt(creatureEntry.unique);
|
||||
NWNX_PushArgumentFloat(creatureEntry.challengeRating);
|
||||
NWNX_PushArgumentString(creatureEntry.resref);
|
||||
NWNX_PushArgumentInt(index);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
@@ -153,18 +174,18 @@ int NWNX_Encounter_GetFactionId(object encounter)
|
||||
{
|
||||
string sFunc = "GetFactionId";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Encounter_SetFactionId(object encounter, int factionId)
|
||||
{
|
||||
string sFunc = "SetFactionId";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, factionId);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(factionId);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
@@ -173,18 +194,38 @@ int NWNX_Encounter_GetPlayerTriggeredOnly(object encounter)
|
||||
{
|
||||
string sFunc = "GetPlayerTriggeredOnly";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Encounter_SetPlayerTriggeredOnly(object encounter, int playerTriggeredOnly)
|
||||
{
|
||||
string sFunc = "SetPlayerTriggeredOnly";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, playerTriggeredOnly);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(playerTriggeredOnly);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Encounter_GetCanReset(object encounter)
|
||||
{
|
||||
string sFunc = "GetCanReset";
|
||||
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Encounter_SetCanReset(object encounter, int reset)
|
||||
{
|
||||
string sFunc = "SetCanReset";
|
||||
|
||||
NWNX_PushArgumentInt(reset);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
@@ -193,18 +234,18 @@ int NWNX_Encounter_GetResetTime(object encounter)
|
||||
{
|
||||
string sFunc = "GetResetTime";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Encounter_SetResetTime(object encounter, int resetTime)
|
||||
{
|
||||
string sFunc = "SetResetTime";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, resetTime);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(resetTime);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
@@ -213,24 +254,24 @@ int NWNX_Encounter_GetNumberOfSpawnPoints(object encounter)
|
||||
{
|
||||
string sFunc = "GetNumberOfSpawnPoints";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
location NWNX_Encounter_GetSpawnPointByIndex(object encounter, int index)
|
||||
{
|
||||
string sFunc = "GetSpawnPointByIndex";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, index);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentInt(index);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
float o = NWNX_GetReturnValueFloat(NWNX_Encounter, sFunc);
|
||||
float z = NWNX_GetReturnValueFloat(NWNX_Encounter, sFunc);
|
||||
float y = NWNX_GetReturnValueFloat(NWNX_Encounter, sFunc);
|
||||
float x = NWNX_GetReturnValueFloat(NWNX_Encounter, sFunc);
|
||||
float o = NWNX_GetReturnValueFloat();
|
||||
float z = NWNX_GetReturnValueFloat();
|
||||
float y = NWNX_GetReturnValueFloat();
|
||||
float x = NWNX_GetReturnValueFloat();
|
||||
|
||||
return Location(GetArea(encounter), Vector(x, y, z), o);
|
||||
}
|
||||
@@ -239,47 +280,47 @@ int NWNX_Encounter_GetMinNumSpawned(object encounter)
|
||||
{
|
||||
string sFunc = "GetMinNumSpawned";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Encounter_GetMaxNumSpawned(object encounter)
|
||||
{
|
||||
string sFunc = "GetMaxNumSpawned";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Encounter_GetCurrentNumSpawned(object encounter)
|
||||
{
|
||||
string sFunc = "GetCurrentNumSpawned";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
|
||||
NWNX_PushArgumentObject(encounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Encounter_GetGeometry(object oEncounter)
|
||||
{
|
||||
string sFunc = "GetGeometry";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, oEncounter);
|
||||
NWNX_PushArgumentObject(oEncounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Encounter, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Encounter_SetGeometry(object oEncounter, string sGeometry)
|
||||
{
|
||||
string sFunc = "SetGeometry";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Encounter, sFunc, sGeometry);
|
||||
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, oEncounter);
|
||||
NWNX_PushArgumentString(sGeometry);
|
||||
NWNX_PushArgumentObject(oEncounter);
|
||||
NWNX_CallFunction(NWNX_Encounter, sFunc);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,34 +10,37 @@ const string NWNX_Feat = "NWNX_Feat"; ///< @private
|
||||
/// @anchor feat_modifiers
|
||||
///
|
||||
/// @{
|
||||
const int NWNX_FEAT_MODIFIER_INVALID = 0;
|
||||
const int NWNX_FEAT_MODIFIER_AB = 1;
|
||||
const int NWNX_FEAT_MODIFIER_ABILITY = 2;
|
||||
const int NWNX_FEAT_MODIFIER_ABVSRACE = 3;
|
||||
const int NWNX_FEAT_MODIFIER_AC = 4;
|
||||
const int NWNX_FEAT_MODIFIER_ACVSRACE = 5;
|
||||
const int NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE = 6;
|
||||
const int NWNX_FEAT_MODIFIER_CONCEALMENT = 7;
|
||||
const int NWNX_FEAT_MODIFIER_DMGIMMUNITY = 8;
|
||||
const int NWNX_FEAT_MODIFIER_DMGREDUCTION = 9;
|
||||
const int NWNX_FEAT_MODIFIER_DMGRESIST = 10;
|
||||
const int NWNX_FEAT_MODIFIER_IMMUNITY = 11;
|
||||
const int NWNX_FEAT_MODIFIER_MOVEMENTSPEED = 12;
|
||||
const int NWNX_FEAT_MODIFIER_REGENERATION = 13;
|
||||
const int NWNX_FEAT_MODIFIER_SAVE = 14;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSRACE = 15;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSTYPE = 16;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSTYPERACE = 17;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLIMMUNITY = 18;
|
||||
const int NWNX_FEAT_MODIFIER_SRCHARGEN = 19;
|
||||
const int NWNX_FEAT_MODIFIER_SRINCLEVEL = 20;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLSAVEDC = 21;
|
||||
const int NWNX_FEAT_MODIFIER_BONUSSPELL = 22;
|
||||
const int NWNX_FEAT_MODIFIER_TRUESEEING = 23;
|
||||
const int NWNX_FEAT_MODIFIER_SEEINVISIBLE = 24;
|
||||
const int NWNX_FEAT_MODIFIER_ULTRAVISION = 25;
|
||||
const int NWNX_FEAT_MODIFIER_HASTE = 26;
|
||||
const int NWNX_FEAT_MODIFIER_VISUALEFFECT = 27;
|
||||
const int NWNX_FEAT_MODIFIER_INVALID = 0;
|
||||
const int NWNX_FEAT_MODIFIER_AB = 1;
|
||||
const int NWNX_FEAT_MODIFIER_ABILITY = 2;
|
||||
const int NWNX_FEAT_MODIFIER_ABVSRACE = 3;
|
||||
const int NWNX_FEAT_MODIFIER_AC = 4;
|
||||
const int NWNX_FEAT_MODIFIER_ACVSRACE = 5;
|
||||
const int NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE = 6;
|
||||
const int NWNX_FEAT_MODIFIER_CONCEALMENT = 7;
|
||||
const int NWNX_FEAT_MODIFIER_DMGIMMUNITY = 8;
|
||||
const int NWNX_FEAT_MODIFIER_DMGREDUCTION = 9;
|
||||
const int NWNX_FEAT_MODIFIER_DMGRESIST = 10;
|
||||
const int NWNX_FEAT_MODIFIER_IMMUNITY = 11;
|
||||
const int NWNX_FEAT_MODIFIER_MOVEMENTSPEED = 12;
|
||||
const int NWNX_FEAT_MODIFIER_REGENERATION = 13;
|
||||
const int NWNX_FEAT_MODIFIER_SAVE = 14;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSRACE = 15;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSTYPE = 16;
|
||||
const int NWNX_FEAT_MODIFIER_SAVEVSTYPERACE = 17;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLIMMUNITY = 18;
|
||||
const int NWNX_FEAT_MODIFIER_SRCHARGEN = 19;
|
||||
const int NWNX_FEAT_MODIFIER_SRINCLEVEL = 20;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLSAVEDC = 21;
|
||||
const int NWNX_FEAT_MODIFIER_BONUSSPELL = 22;
|
||||
const int NWNX_FEAT_MODIFIER_TRUESEEING = 23;
|
||||
const int NWNX_FEAT_MODIFIER_SEEINVISIBLE = 24;
|
||||
const int NWNX_FEAT_MODIFIER_ULTRAVISION = 25;
|
||||
const int NWNX_FEAT_MODIFIER_HASTE = 26;
|
||||
const int NWNX_FEAT_MODIFIER_VISUALEFFECT = 27;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL = 28;
|
||||
const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL = 29;
|
||||
const int NWNX_FEAT_MODIFIER_DAMAGE = 30;
|
||||
///@}
|
||||
|
||||
/// @brief Sets a feat modifier.
|
||||
@@ -52,12 +55,12 @@ void NWNX_Feat_SetFeatModifier(int iFeat, int iMod, int iParam1 = 0xDEADBEEF, in
|
||||
{
|
||||
string sFunc = "SetFeatModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iParam4);
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iParam3);
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iParam2);
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iParam1);
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iMod);
|
||||
NWNX_PushArgumentInt(NWNX_Feat, sFunc, iFeat);
|
||||
NWNX_PushArgumentInt(iParam4);
|
||||
NWNX_PushArgumentInt(iParam3);
|
||||
NWNX_PushArgumentInt(iParam2);
|
||||
NWNX_PushArgumentInt(iParam1);
|
||||
NWNX_PushArgumentInt(iMod);
|
||||
NWNX_PushArgumentInt(iFeat);
|
||||
|
||||
NWNX_CallFunction(NWNX_Feat, sFunc);
|
||||
}
|
||||
|
78
_module/nss/nwnx_feat_2da.nss
Normal file
78
_module/nss/nwnx_feat_2da.nss
Normal file
@@ -0,0 +1,78 @@
|
||||
/// @ingroup feat
|
||||
/// @file nwnx_feat_2da.nss
|
||||
/// @brief Parse a column in the feat.2da to load the modifiers.
|
||||
#include "nwnx_feat"
|
||||
|
||||
/// @ingroup feat
|
||||
/// @brief Translate a modifier type from a string to its constant.
|
||||
/// @param featMod The string representation of the constant.
|
||||
/// @return The constant for the feat modifier.
|
||||
int NWNX_Feat_GetModifierConstant(string featMod);
|
||||
|
||||
/// @ingroup feat
|
||||
/// @brief Loops through feat.2da and checks for the column for feat modifications and sets them.
|
||||
/// @param sColumnName The column name in the feat.2da that defines the 2da for the feat mods.
|
||||
void NWNX_Feat_LoadFeatModifiers(string sColumnName = "FeatModsTable");
|
||||
|
||||
int NWNX_Feat_GetModifierConstant(string featMod)
|
||||
{
|
||||
if (featMod == "AB") return NWNX_FEAT_MODIFIER_AB;
|
||||
else if (featMod == "ABILITY") return NWNX_FEAT_MODIFIER_ABILITY;
|
||||
else if (featMod == "ABVSRACE") return NWNX_FEAT_MODIFIER_ABVSRACE;
|
||||
else if (featMod == "AC") return NWNX_FEAT_MODIFIER_AC;
|
||||
else if (featMod == "ACVSRACE") return NWNX_FEAT_MODIFIER_ACVSRACE;
|
||||
else if (featMod == "ARCANESPELLFAILURE") return NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE;
|
||||
else if (featMod == "BONUSSPELL") return NWNX_FEAT_MODIFIER_BONUSSPELL;
|
||||
else if (featMod == "CONCEALMENT") return NWNX_FEAT_MODIFIER_CONCEALMENT;
|
||||
else if (featMod == "DMGREDUCTION") return NWNX_FEAT_MODIFIER_DMGREDUCTION;
|
||||
else if (featMod == "DMGRESIST") return NWNX_FEAT_MODIFIER_DMGRESIST;
|
||||
else if (featMod == "DMGIMMUNITY") return NWNX_FEAT_MODIFIER_DMGIMMUNITY;
|
||||
else if (featMod == "IMMUNITY") return NWNX_FEAT_MODIFIER_IMMUNITY;
|
||||
else if (featMod == "HASTE") return NWNX_FEAT_MODIFIER_HASTE;
|
||||
else if (featMod == "MOVEMENTSPEED") return NWNX_FEAT_MODIFIER_MOVEMENTSPEED;
|
||||
else if (featMod == "REGENERATION") return NWNX_FEAT_MODIFIER_REGENERATION;
|
||||
else if (featMod == "SAVE") return NWNX_FEAT_MODIFIER_SAVE;
|
||||
else if (featMod == "SAVEVSRACE") return NWNX_FEAT_MODIFIER_SAVEVSRACE;
|
||||
else if (featMod == "SAVEVSTYPE") return NWNX_FEAT_MODIFIER_SAVEVSTYPE;
|
||||
else if (featMod == "SAVEVSTYPERACE") return NWNX_FEAT_MODIFIER_SAVEVSTYPERACE;
|
||||
else if (featMod == "SEEINVISIBLE") return NWNX_FEAT_MODIFIER_SEEINVISIBLE;
|
||||
else if (featMod == "SPELLIMMUNITY") return NWNX_FEAT_MODIFIER_SPELLIMMUNITY;
|
||||
else if (featMod == "SRCHARGEN") return NWNX_FEAT_MODIFIER_SRCHARGEN;
|
||||
else if (featMod == "SRINCLEVEL") return NWNX_FEAT_MODIFIER_SRINCLEVEL;
|
||||
else if (featMod == "SPELLSAVEDC") return NWNX_FEAT_MODIFIER_SPELLSAVEDC;
|
||||
else if (featMod == "TRUESEEING") return NWNX_FEAT_MODIFIER_TRUESEEING;
|
||||
else if (featMod == "ULTRAVISION") return NWNX_FEAT_MODIFIER_ULTRAVISION;
|
||||
else if (featMod == "VISUALEFFECT") return NWNX_FEAT_MODIFIER_VISUALEFFECT;
|
||||
else if (featMod == "SPELLSAVEDCFORSCHOOL") return NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL;
|
||||
else if (featMod == "SPELLSAVEDCFORSPELL") return NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL;
|
||||
|
||||
return NWNX_FEAT_MODIFIER_INVALID;
|
||||
}
|
||||
|
||||
void NWNX_Feat_LoadFeatModifiers(string sColumnName = "FeatModsTable")
|
||||
{
|
||||
int iFeatRows = Get2DARowCount("feat");
|
||||
int iFeat;
|
||||
for (iFeat = 0; iFeat < iFeatRows; iFeat++)
|
||||
{
|
||||
string sFeatModTable = Get2DAString("feat", sColumnName, iFeat);
|
||||
if(sFeatModTable != "")
|
||||
{
|
||||
int iFeatModRows = Get2DARowCount(sFeatModTable);
|
||||
int iFeatMod;
|
||||
for (iFeatMod = 0; iFeatMod < iFeatModRows; iFeatMod++)
|
||||
{
|
||||
string sType = Get2DAString(sFeatModTable, "Type", iFeatMod);
|
||||
string sParam1 = Get2DAString(sFeatModTable, "Param1", iFeatMod);
|
||||
string sParam2 = Get2DAString(sFeatModTable, "Param2", iFeatMod);
|
||||
string sParam3 = Get2DAString(sFeatModTable, "Param3", iFeatMod);
|
||||
string sParam4 = Get2DAString(sFeatModTable, "Param4", iFeatMod);
|
||||
int iParam1 = sParam1 == "" ? 0xDEADBEEF : StringToInt(sParam1);
|
||||
int iParam2 = sParam2 == "" ? 0xDEADBEEF : StringToInt(sParam2);
|
||||
int iParam3 = sParam3 == "" ? 0xDEADBEEF : StringToInt(sParam3);
|
||||
int iParam4 = sParam4 == "" ? 0xDEADBEEF : StringToInt(sParam4);
|
||||
NWNX_Feat_SetFeatModifier(iFeat, NWNX_Feat_GetModifierConstant(sType), iParam1, iParam2, iParam3, iParam4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -17,48 +17,27 @@ const string NWNX_Feedback = "NWNX_Feedback"; ///< @private
|
||||
/// @name Combat Log Message Types
|
||||
/// @anchor combat_log_msgs
|
||||
/// @{
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SIMPLE_ADJECTIVE = 1;
|
||||
/*
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SIMPLE_DAMAGE = 2;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE = 3;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_DEATH = 4;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_ATTACK = 5;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SPECIAL_ATTACK = 6;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SAVING_THROW = 7;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_CAST_SPELL = 8;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_USE_SKILL = 9;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SPELL_RESISTANCE = 10;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_FEEDBACK = 11; // NOTE: This hides ALL feedback messages, to hide individual messages use NWNX_Feedback_SetFeedbackMessageHidden()
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COUNTERSPELL = 12;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_TOUCHATTACK = 13;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_INITIATIVE = 14;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_DISPEL_MAGIC = 15;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_POLYMORPH = 17;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_FEEDBACKSTRING = 18;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_VIBRATE = 19;
|
||||
const int NWNX_FEEDBACK_COMBATLOG_UNLOCKACHIEVEMENT = 20;
|
||||
|
||||
// 1 -> Simple_Adjective: <charname> : <adjective described by strref>
|
||||
// 2 -> Simple_Damage: <charname> damaged : <amount>
|
||||
// 3 -> Complex_Damage: <charname> damages <charname> : <amount>
|
||||
// 4 -> Complex_Death: <charname> killed <charname>
|
||||
// 5 -> Complex_Attack: <charname> attacks <charname> : *hit* / *miss* / *parried* : (<attack roll> + <attack mod> = <modified total>)
|
||||
// 6 -> Special_Attack: <charname> attempts <special attack> on <charname> : *success* / *failure* : (<attack roll> + <attack mod> = <modified roll>)
|
||||
// 7 -> Saving_Throw: <charname> : <saving throw type> : *success* / *failure* : (<saving throw roll> + <saving throw modifier> = <modified total>)
|
||||
// 8 -> Cast_Spell: <charname> casts <spell name> : Spellcraft check *failure* / *success*
|
||||
// 9 -> Use_Skill: <charname> : <skill name> : *success* / *failure* : (<skill roll> + <skill modifier> = <modified total> vs <DC> )
|
||||
// 10 -> Spell_Resistance: <charname> : Spell Resistance <SR value> : *success* / *failure*
|
||||
// 11 -> Feedback: Reason skill/feat/ability failed.
|
||||
// 12 -> Counterspel: <charname> casts <spell name> : *spell countered by* : <charname> casting <spell name>
|
||||
// 13 -> TouchAttack: <charname> attempts <melee/ranged touch attack> on <charname> : *hit/miss/critical* : (<attack roll> + <attack mod> = <modified roll>)
|
||||
// 14 -> Initiative: <charname> : Initiative Roll : <total> : (<roll> + <modifier> = <total>)
|
||||
// 15 -> Dispel_Magic: Dispel Magic : <charname> : <spell name>, <spell name>, <spell name>...
|
||||
// 17 -> Unused, probably
|
||||
// 18 -> Same as 11, maybe. Might be unused too
|
||||
// 19 -> Unused
|
||||
// 20 -> Unused
|
||||
*/
|
||||
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SIMPLE_ADJECTIVE = 1; // Simple_Adjective: <charname> : <adjective described by strref>
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SIMPLE_DAMAGE = 2; // Simple_Damage: <charname> damaged : <amount>
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE = 3; // Complex_Damage: <charname> damages <charname> : <amount>
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_DEATH = 4; // Complex_Death: <charname> killed <charname>
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_ATTACK = 5; // Complex_Attack: <charname> attacks <charname> : *hit* / *miss* / *parried* : (<attack roll> + <attack mod> = <modified total>)
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SPECIAL_ATTACK = 6; // Special_Attack: <charname> attempts <special attack> on <charname> : *success* / *failure* : (<attack roll> + <attack mod> = <modified roll>)
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SAVING_THROW = 7; // Saving_Throw: <charname> : <saving throw type> : *success* / *failure* : (<saving throw roll> + <saving throw modifier> = <modified total>)
|
||||
const int NWNX_FEEDBACK_COMBATLOG_CAST_SPELL = 8; // Cast_Spell: <charname> casts <spell name> : Spellcraft check *failure* / *success*
|
||||
const int NWNX_FEEDBACK_COMBATLOG_USE_SKILL = 9; // Use_Skill: <charname> : <skill name> : *success* / *failure* : (<skill roll> + <skill modifier> = <modified total> vs <DC> )
|
||||
const int NWNX_FEEDBACK_COMBATLOG_SPELL_RESISTANCE = 10; // Spell_Resistance: <charname> : Spell Resistance <SR value> : *success* / *failure*
|
||||
const int NWNX_FEEDBACK_COMBATLOG_FEEDBACK = 11; // Reason skill/feat/ability failed, SendMessageToPC() NOTE: This hides ALL feedback messages, to hide individual messages use NWNX_Feedback_SetFeedbackMessageHidden()
|
||||
const int NWNX_FEEDBACK_COMBATLOG_COUNTERSPELL = 12; // Counterspel: <charname> casts <spell name> : *spell countered by* : <charname> casting <spell name>
|
||||
const int NWNX_FEEDBACK_COMBATLOG_TOUCHATTACK = 13; // TouchAttack: <charname> attempts <melee/ranged touch attack> on <charname> : *hit/miss/critical* : (<attack roll> + <attack mod> = <modified roll>)
|
||||
const int NWNX_FEEDBACK_COMBATLOG_INITIATIVE = 14; // Initiative: <charname> : Initiative Roll : <total> : (<roll> + <modifier> = <total>)
|
||||
const int NWNX_FEEDBACK_COMBATLOG_DISPEL_MAGIC = 15; // Dispel_Magic: Dispel Magic : <charname> : <spell name>, <spell name>, <spell name>...
|
||||
const int NWNX_FEEDBACK_COMBATLOG_POLYMORPH = 17; // Doesn't go through the function that the plugin hooks, so does nothing.
|
||||
const int NWNX_FEEDBACK_COMBATLOG_FEEDBACKSTRING = 18; // Custom feedback for objects requiring a key
|
||||
const int NWNX_FEEDBACK_COMBATLOG_VIBRATE = 19; // Controller vibration
|
||||
const int NWNX_FEEDBACK_COMBATLOG_UNLOCKACHIEVEMENT = 20; // Unlock Campaign Achievement
|
||||
const int NWNX_FEEDBACK_COMBATLOG_POSTAURSTRING = 22; // PostString messages
|
||||
const int NWNX_FEEDBACK_COMBATLOG_ENTERTARGETINGMODE = 23; // Enter Targeting Mode
|
||||
/// @}
|
||||
|
||||
/// @name Feedback Message Types
|
||||
@@ -66,7 +45,6 @@ const int NWNX_FEEDBACK_COMBATLOG_UNLOCKACHIEVEMENT = 20;
|
||||
/// @{
|
||||
|
||||
const int NWNX_FEEDBACK_SKILL_CANT_USE = 0;
|
||||
/*
|
||||
/// Skill Feedback Messages
|
||||
const int NWNX_FEEDBACK_SKILL_CANT_USE_TIMER = 1;
|
||||
const int NWNX_FEEDBACK_SKILL_ANIMALEMPATHY_VALID_TARGETS = 2;
|
||||
@@ -368,7 +346,6 @@ const int NWNX_FEEDBACK_CAMERA_CHASECAM = 258;
|
||||
|
||||
const int NWNX_FEEDBACK_SAVING = 225;
|
||||
const int NWNX_FEEDBACK_SAVE_COMPLETE = 226;
|
||||
*/
|
||||
/// @}
|
||||
|
||||
/// @brief Gets if feedback message is hidden.
|
||||
@@ -428,12 +405,12 @@ int NWNX_Feedback_GetFeedbackMessageHidden(int nMessage, object oPC = OBJECT_INV
|
||||
string sFunc = "GetMessageHidden";
|
||||
int nMessageType = 0;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessage);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(nMessage);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Feedback, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Feedback_SetFeedbackMessageHidden(int nMessage, int isHidden, object oPC = OBJECT_INVALID)
|
||||
@@ -441,10 +418,10 @@ void NWNX_Feedback_SetFeedbackMessageHidden(int nMessage, int isHidden, object o
|
||||
string sFunc = "SetMessageHidden";
|
||||
int nMessageType = 0;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, isHidden);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessage);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(isHidden);
|
||||
NWNX_PushArgumentInt(nMessage);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
}
|
||||
|
||||
@@ -453,12 +430,12 @@ int NWNX_Feedback_GetCombatLogMessageHidden(int nMessage, object oPC = OBJECT_IN
|
||||
string sFunc = "GetMessageHidden";
|
||||
int nMessageType = 1;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessage);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(nMessage);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Feedback, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Feedback_SetCombatLogMessageHidden(int nMessage, int isHidden, object oPC = OBJECT_INVALID)
|
||||
@@ -466,10 +443,10 @@ void NWNX_Feedback_SetCombatLogMessageHidden(int nMessage, int isHidden, object
|
||||
string sFunc = "SetMessageHidden";
|
||||
int nMessageType = 1;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, isHidden);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessage);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(isHidden);
|
||||
NWNX_PushArgumentInt(nMessage);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
}
|
||||
|
||||
@@ -478,12 +455,12 @@ int NWNX_Feedback_GetJournalUpdatedMessageHidden(object oPC = OBJECT_INVALID)
|
||||
string sFunc = "GetMessageHidden";
|
||||
int nMessageType = 2;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, 0);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(0);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Feedback, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Feedback_SetJournalUpdatedMessageHidden(int isHidden, object oPC = OBJECT_INVALID)
|
||||
@@ -491,10 +468,10 @@ void NWNX_Feedback_SetJournalUpdatedMessageHidden(int isHidden, object oPC = OBJ
|
||||
string sFunc = "SetMessageHidden";
|
||||
int nMessageType = 2;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, isHidden);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, 0);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
|
||||
NWNX_PushArgumentInt(isHidden);
|
||||
NWNX_PushArgumentInt(0);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_PushArgumentObject(oPC);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
}
|
||||
|
||||
@@ -503,8 +480,8 @@ void NWNX_Feedback_SetFeedbackMessageMode(int bWhitelist)
|
||||
string sFunc = "SetFeedbackMode";
|
||||
int nMessageType = 0;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, bWhitelist);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentInt(bWhitelist);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
}
|
||||
|
||||
@@ -513,7 +490,7 @@ void NWNX_Feedback_SetCombatLogMessageMode(int bWhitelist)
|
||||
string sFunc = "SetFeedbackMode";
|
||||
int nMessageType = 1;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, bWhitelist);
|
||||
NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
|
||||
NWNX_PushArgumentInt(bWhitelist);
|
||||
NWNX_PushArgumentInt(nMessageType);
|
||||
NWNX_CallFunction(NWNX_Feedback, sFunc);
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ void NWNX_Item_SetWeight(object oItem, int weight);
|
||||
/// @remark Total cost = base_value + additional_value.
|
||||
/// @remark Equivalent to SetGoldPieceValue NWNX2 function.
|
||||
/// @note Will not persist through saving.
|
||||
/// @note This value will also revert if item is identified or player relogs into server.
|
||||
/// @param oItem The item object.
|
||||
/// @param gold The base gold value.
|
||||
void NWNX_Item_SetBaseGoldPieceValue(object oItem, int gold);
|
||||
@@ -68,7 +69,12 @@ void NWNX_Item_SetBaseItemType(object oItem, int nBaseItem);
|
||||
///
|
||||
/// [1] When specifying per-part coloring, the value 255 corresponds with the logical
|
||||
/// function 'clear colour override', which clears the per-part override for that part.
|
||||
void NWNX_Item_SetItemAppearance(object oItem, int nType, int nIndex, int nValue);
|
||||
/// @param oItem The item
|
||||
/// @param nType The type
|
||||
/// @param nIndex The index
|
||||
/// @param nValue The value
|
||||
/// @param bUpdateCreatureAppearance If TRUE, also update the appearance of oItem's possessor. Only works for armor/helmets/cloaks. Will remove the item from the quickbar as side effect.
|
||||
void NWNX_Item_SetItemAppearance(object oItem, int nType, int nIndex, int nValue, int bUpdateCreatureAppearance = FALSE);
|
||||
|
||||
/// @brief Return a string containing the entire appearance for an item.
|
||||
/// @sa NWNX_Item_RestoreItemAppearance
|
||||
@@ -91,14 +97,47 @@ int NWNX_Item_GetBaseArmorClass(object oItem);
|
||||
/// @return The minimum level required to equip the item.
|
||||
int NWNX_Item_GetMinEquipLevel(object oItem);
|
||||
|
||||
/// @brief Move oItem to oTarget
|
||||
/// @remark Moving items from a container to the inventory of the container's owner (or the other way around) is always "silent" and won't trigger feedback messages
|
||||
/// @param oItem The item object.
|
||||
/// @param oTarget The target bag/creature/placeable or store object to move oItem to.
|
||||
/// @param bHideAllFeedback Hides all feedback messages generated by losing/acquiring items
|
||||
/// @return TRUE if the item was successfully moved to the target, otherwise FALSE
|
||||
int NWNX_Item_MoveTo(object oItem, object oTarget, int bHideAllFeedback = FALSE);
|
||||
|
||||
/// @brief Set a modifier to the Minimum Level to Equip (Item Level Restriction).
|
||||
/// @param oItem The item object.
|
||||
/// @param nModifier the modifier to apply (After any Override)
|
||||
/// @param bPersist Whether the modifier should persist to gff field. Strongly Recommended to be TRUE (See warning)
|
||||
/// @note This function (or override partner) must be used each server reset to reenable persistence. Recommended use on OBJECT_INVALID OnModuleLoad.
|
||||
/// @warning if Persistence is FALSE, or not renabled, beware characters may trigger ELC logging in with now-invalid ItemLevelRestrictions equipped.
|
||||
void NWNX_Item_SetMinEquipLevelModifier(object oItem, int nModifier, int bPersist = TRUE);
|
||||
|
||||
/// @brief Gets the applied modifier to the Minimum Level to Equip (Item Level Restriction).
|
||||
/// @param oItem The item object.
|
||||
int NWNX_Item_GetMinEquipLevelModifier(object oItem);
|
||||
|
||||
/// @brief Set an override to the Minimum Level to Equip (Item Level Restriction).
|
||||
/// @param oItem The item object.
|
||||
/// @param nOverride the nOverride to apply (Before any Modifier)
|
||||
/// @param bPersist Whether the modifier should persist to gff field. Strongly Recommended to be TRUE (See warning)
|
||||
/// @note This function (or modifier partner) must be used each server reset to reenable persistence. Recommended use on OBJECT_INVALID OnModuleLoad.
|
||||
/// @warning if Persistence is FALSE, or not renabled, beware characters may trigger ELC logging in with now-invalid ItemLevelRestrictions equipped.
|
||||
void NWNX_Item_SetMinEquipLevelOverride(object oItem, int nOverride, int bPersist = TRUE);
|
||||
|
||||
/// @brief Gets the applied override to the Minimum Level to Equip (Item Level Restriction).
|
||||
/// @param oItem The item object.
|
||||
int NWNX_Item_GetMinEquipLevelOverride(object oItem);
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
void NWNX_Item_SetWeight(object oItem, int w)
|
||||
{
|
||||
string sFunc = "SetWeight";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, w);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(w);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
@@ -107,8 +146,8 @@ void NWNX_Item_SetBaseGoldPieceValue(object oItem, int g)
|
||||
{
|
||||
string sFunc = "SetBaseGoldPieceValue";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, g);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(g);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
@@ -117,8 +156,8 @@ void NWNX_Item_SetAddGoldPieceValue(object oItem, int g)
|
||||
{
|
||||
string sFunc = "SetAddGoldPieceValue";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, g);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(g);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
@@ -127,40 +166,41 @@ int NWNX_Item_GetBaseGoldPieceValue(object oItem)
|
||||
{
|
||||
string sFunc = "GetBaseGoldPieceValue";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Item_GetAddGoldPieceValue(object oItem)
|
||||
{
|
||||
string sFunc = "GetAddGoldPieceValue";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Item_SetBaseItemType(object oItem, int nBaseItem)
|
||||
{
|
||||
string sFunc = "SetBaseItemType";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Item_SetItemAppearance(object oItem, int nType, int nIndex, int nValue)
|
||||
void NWNX_Item_SetItemAppearance(object oItem, int nType, int nIndex, int nValue, int bUpdateCreatureAppearance = FALSE)
|
||||
{
|
||||
string sFunc = "SetItemAppearance";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, nValue);
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, nIndex);
|
||||
NWNX_PushArgumentInt(NWNX_Item, sFunc, nType);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(bUpdateCreatureAppearance);
|
||||
NWNX_PushArgumentInt(nValue);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentInt(nType);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
|
||||
@@ -170,18 +210,18 @@ string NWNX_Item_GetEntireItemAppearance(object oItem)
|
||||
{
|
||||
string sFunc = "GetEntireItemAppearance";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Item_RestoreItemAppearance(object oItem, string sApp)
|
||||
{
|
||||
string sFunc = "RestoreItemAppearance";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Item, sFunc, sApp);
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentString(sApp);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
@@ -190,18 +230,73 @@ int NWNX_Item_GetBaseArmorClass(object oItem)
|
||||
{
|
||||
string sFunc = "GetBaseArmorClass";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Item_GetMinEquipLevel(object oItem)
|
||||
{
|
||||
string sFunc = "GetMinEquipLevel";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Item_MoveTo(object oItem, object oTarget, int bHideAllFeedback = FALSE)
|
||||
{
|
||||
string sFunc = "MoveTo";
|
||||
|
||||
NWNX_PushArgumentInt(bHideAllFeedback);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Item_SetMinEquipLevelModifier(object oItem, int nModifier, int bPersist = TRUE)
|
||||
{
|
||||
string sFunc = "SetMinEquipLevelModifier";
|
||||
|
||||
NWNX_PushArgumentInt(bPersist);
|
||||
NWNX_PushArgumentInt(nModifier);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Item_GetMinEquipLevelModifier(object oItem)
|
||||
{
|
||||
string sFunc = "GetMinEquipLevelModifier";
|
||||
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Item_SetMinEquipLevelOverride(object oItem, int nOverride, int bPersist = TRUE)
|
||||
{
|
||||
string sFunc = "SetMinEquipLevelOverride";
|
||||
|
||||
NWNX_PushArgumentInt(bPersist);
|
||||
NWNX_PushArgumentInt(nOverride);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Item_GetMinEquipLevelOverride(object oItem)
|
||||
{
|
||||
string sFunc = "GetMinEquipLevelOverride";
|
||||
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Item, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ const string NWNX_ItemProperty = "NWNX_ItemProperty"; ///< @private
|
||||
/// @brief An unpacked itemproperty.
|
||||
struct NWNX_IPUnpacked
|
||||
{
|
||||
string sID; ///< @todo Describe
|
||||
int nProperty; ///< @todo Describe
|
||||
int nSubType; ///< @todo Describe
|
||||
int nCostTable; ///< @todo Describe
|
||||
@@ -45,66 +46,68 @@ struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip)
|
||||
{
|
||||
string sFunc = "UnpackIP";
|
||||
|
||||
NWNX_PushArgumentItemProperty(NWNX_ItemProperty, sFunc, ip);
|
||||
NWNX_PushArgumentItemProperty(ip);
|
||||
NWNX_CallFunction(NWNX_ItemProperty, sFunc);
|
||||
|
||||
struct NWNX_IPUnpacked n;
|
||||
|
||||
n.nProperty = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nSubType = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nCostTable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nCostTableValue = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nParam1 = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nParam1Value = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nUsesPerDay = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nChanceToAppear = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.bUsable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nSpellId = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.oCreator = NWNX_GetReturnValueObject(NWNX_ItemProperty, sFunc);
|
||||
n.sTag = NWNX_GetReturnValueString(NWNX_ItemProperty, sFunc);
|
||||
n.sID = NWNX_GetReturnValueString();
|
||||
n.nProperty = NWNX_GetReturnValueInt();
|
||||
n.nSubType = NWNX_GetReturnValueInt();
|
||||
n.nCostTable = NWNX_GetReturnValueInt();
|
||||
n.nCostTableValue = NWNX_GetReturnValueInt();
|
||||
n.nParam1 = NWNX_GetReturnValueInt();
|
||||
n.nParam1Value = NWNX_GetReturnValueInt();
|
||||
n.nUsesPerDay = NWNX_GetReturnValueInt();
|
||||
n.nChanceToAppear = NWNX_GetReturnValueInt();
|
||||
n.bUsable = NWNX_GetReturnValueInt();
|
||||
n.nSpellId = NWNX_GetReturnValueInt();
|
||||
n.oCreator = NWNX_GetReturnValueObject();
|
||||
n.sTag = NWNX_GetReturnValueString();
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked n)
|
||||
{
|
||||
string sFunc = "PackIP";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_ItemProperty, sFunc, n.sTag);
|
||||
NWNX_PushArgumentObject(NWNX_ItemProperty, sFunc, n.oCreator);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nSpellId);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.bUsable);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nChanceToAppear);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nUsesPerDay);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nParam1Value);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nParam1);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nCostTableValue);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nCostTable);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nSubType);
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nProperty);
|
||||
NWNX_PushArgumentString(n.sTag);
|
||||
NWNX_PushArgumentObject(n.oCreator);
|
||||
NWNX_PushArgumentInt(n.nSpellId);
|
||||
NWNX_PushArgumentInt(n.bUsable);
|
||||
NWNX_PushArgumentInt(n.nChanceToAppear);
|
||||
NWNX_PushArgumentInt(n.nUsesPerDay);
|
||||
NWNX_PushArgumentInt(n.nParam1Value);
|
||||
NWNX_PushArgumentInt(n.nParam1);
|
||||
NWNX_PushArgumentInt(n.nCostTableValue);
|
||||
NWNX_PushArgumentInt(n.nCostTable);
|
||||
NWNX_PushArgumentInt(n.nSubType);
|
||||
NWNX_PushArgumentInt(n.nProperty);
|
||||
|
||||
NWNX_CallFunction(NWNX_ItemProperty, sFunc);
|
||||
return NWNX_GetReturnValueItemProperty(NWNX_ItemProperty, sFunc);
|
||||
return NWNX_GetReturnValueItemProperty();
|
||||
}
|
||||
|
||||
struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex)
|
||||
{
|
||||
string sFunc = "GetActiveProperty";
|
||||
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, nIndex);
|
||||
NWNX_PushArgumentObject(NWNX_ItemProperty, sFunc, oItem);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
NWNX_CallFunction(NWNX_ItemProperty, sFunc);
|
||||
|
||||
struct NWNX_IPUnpacked n;
|
||||
|
||||
n.nProperty = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nSubType = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nCostTable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nCostTableValue = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nParam1 = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nParam1Value = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nUsesPerDay = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.nChanceToAppear = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.bUsable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
|
||||
n.sTag = NWNX_GetReturnValueString(NWNX_ItemProperty, sFunc);
|
||||
n.nProperty = NWNX_GetReturnValueInt();
|
||||
n.nSubType = NWNX_GetReturnValueInt();
|
||||
n.nCostTable = NWNX_GetReturnValueInt();
|
||||
n.nCostTableValue = NWNX_GetReturnValueInt();
|
||||
n.nParam1 = NWNX_GetReturnValueInt();
|
||||
n.nParam1Value = NWNX_GetReturnValueInt();
|
||||
n.nUsesPerDay = NWNX_GetReturnValueInt();
|
||||
n.nChanceToAppear = NWNX_GetReturnValueInt();
|
||||
n.bUsable = NWNX_GetReturnValueInt();
|
||||
n.sTag = NWNX_GetReturnValueString();
|
||||
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ void NWNX_Lua_EvalVoid(string sCode)
|
||||
{
|
||||
string sFunc = "EvalVoid";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Lua, sFunc, sCode);
|
||||
NWNX_PushArgumentString(sCode);
|
||||
NWNX_CallFunction(NWNX_Lua, sFunc);
|
||||
}
|
||||
|
||||
@@ -35,17 +35,17 @@ string NWNX_Lua_Eval(string sCode)
|
||||
{
|
||||
string sFunc = "Eval";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Lua, sFunc, sCode);
|
||||
NWNX_PushArgumentString(sCode);
|
||||
NWNX_CallFunction(NWNX_Lua, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Lua, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Lua_RunEvent(string sEvent, object oObject, string sExtra="")
|
||||
{
|
||||
string sFunc = "RunEvent";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Lua, sFunc, sExtra);
|
||||
NWNX_PushArgumentObject(NWNX_Lua, sFunc, oObject);
|
||||
NWNX_PushArgumentString(NWNX_Lua, sFunc, sEvent);
|
||||
NWNX_PushArgumentString(sExtra);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentString(sEvent);
|
||||
NWNX_CallFunction(NWNX_Lua, sFunc);
|
||||
}
|
||||
|
40
_module/nss/nwnx_nostack.nss
Normal file
40
_module/nss/nwnx_nostack.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
/// @addtogroup nostack NoStack
|
||||
/// @brief Functions to allow more control over ability/skill/bonuses stacking.
|
||||
/// @{
|
||||
/// @file nwnx_nostack.nss
|
||||
#include "nwnx"
|
||||
|
||||
const string NWNX_NoStack = "NWNX_NoStack"; ///< @private
|
||||
|
||||
/// @name Spell Effect Bonus Types
|
||||
/// @anchor spell_bonus_types
|
||||
///
|
||||
/// Used with NWNX_NoStack_SetSpellBonusType() these are the effect bonus types.
|
||||
/// @{
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_ENHANCEMENT = 0;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_CIRCUMSTANCE = 1;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_COMPETENCE = 2;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_INSIGHT = 3;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_LUCK = 4;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_MORALE = 5;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_PROFANE = 6;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_RESISTANCE = 7;
|
||||
const int NWNX_NOSTACK_EFFECT_TYPE_SACRED = 8;
|
||||
/// @}
|
||||
|
||||
/// @brief Sets a spell bonus type to be used by the NoStack feature.
|
||||
/// @param spell The spell ID from spells.2da.
|
||||
/// @param type The new type.
|
||||
void NWNX_NoStack_SetSpellBonusType(int spell, int type);
|
||||
|
||||
/// @}
|
||||
|
||||
void NWNX_NoStack_SetSpellBonusType(int spell, int type)
|
||||
{
|
||||
string sFunc = "SetSpellBonusType";
|
||||
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentInt(spell);
|
||||
|
||||
NWNX_CallFunction(NWNX_NoStack, sFunc);
|
||||
}
|
25
_module/nss/nwnx_nwsqliteext.nss
Normal file
25
_module/nss/nwnx_nwsqliteext.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
/// @addtogroup nwsqliteextensions NWSQLiteExtensions
|
||||
/// @brief Various extensions for the game's built-in sqlite database.
|
||||
/// @{
|
||||
/// @file nwnx_nwsqliteext.nss
|
||||
#include "nwnx"
|
||||
|
||||
const string NWNX_NWSQLiteExtensions = "NWNX_NWSQLiteExtensions"; ///< @private
|
||||
|
||||
/// @brief Create a virtual table for s2DA in the module sqlite database.
|
||||
/// @param s2DA The 2DA name, cannot be empty.
|
||||
/// @param sColumnTypeHints A string containing type hints for the 2DA columns. See this plugin's readme file for more info.
|
||||
/// @param sTableName The table name, will use the 2da name if empty.
|
||||
/// @return TRUE if the virtual table was created.
|
||||
int NWNX_NWSQLiteExtensions_CreateVirtual2DATable(string s2DA, string sColumnTypeHints = "", string sTableName = "");
|
||||
|
||||
/// @}
|
||||
|
||||
int NWNX_NWSQLiteExtensions_CreateVirtual2DATable(string s2DA, string sColumnTypeHints = "", string sTableName = "")
|
||||
{
|
||||
NWNX_PushArgumentString(sTableName);
|
||||
NWNX_PushArgumentString(sColumnTypeHints);
|
||||
NWNX_PushArgumentString(s2DA);
|
||||
NWNX_CallFunction(NWNX_NWSQLiteExtensions, "CreateVirtual2DATable");
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,10 @@ string NWNX_Player_GetBicFileName(object player);
|
||||
/// @param player The player object.
|
||||
/// @param effectId The effect id.
|
||||
/// @param position The position to play the visual effect.
|
||||
void NWNX_Player_ShowVisualEffect(object player, int effectId, vector position);
|
||||
/// @param scale The scale of the effect
|
||||
/// @param translate A translation vector to offset the position of the effect
|
||||
/// @param rotate A rotation vector to rotate the effect
|
||||
void NWNX_Player_ShowVisualEffect(object player, int effectId, vector position, float scale=1.0f, vector translate=[], vector rotate=[]);
|
||||
|
||||
/// @brief Changes the daytime music track for the given player only
|
||||
/// @param player The player object.
|
||||
@@ -190,8 +193,11 @@ void NWNX_Player_SetRestDuration(object player, int duration);
|
||||
/// @param player The player object.
|
||||
/// @param target The target object to play the effect upon.
|
||||
/// @param visualeffect The visual effect id.
|
||||
/// @param scale The scale of the effect
|
||||
/// @param translate A translation vector to offset the position of the effect
|
||||
/// @param rotate A rotation vector to rotate the effect
|
||||
/// @note Only works with instant effects: VFX_COM_*, VFX_FNF_*, VFX_IMP_*
|
||||
void NWNX_Player_ApplyInstantVisualEffectToObject(object player, object target, int visualeffect);
|
||||
void NWNX_Player_ApplyInstantVisualEffectToObject(object player, object target, int visualeffect, float scale=1.0f, vector translate=[], vector rotate=[]);
|
||||
|
||||
/// @brief Refreshes the players character sheet
|
||||
/// @param player The player object.
|
||||
@@ -323,7 +329,8 @@ void NWNX_Player_SetCreatureNameOverride(object oPlayer, object oCreature, strin
|
||||
/// @param oPlayer The player to display the text to.
|
||||
/// @param oCreature The creature to display the text above.
|
||||
/// @param sText The text to display.
|
||||
void NWNX_Player_FloatingTextStringOnCreature(object oPlayer, object oCreature, string sText);
|
||||
/// @param bChatWindow If TRUE, sText will be displayed in oPlayer's chat window.
|
||||
void NWNX_Player_FloatingTextStringOnCreature(object oPlayer, object oCreature, string sText, int bChatWindow = TRUE);
|
||||
|
||||
/// @brief Toggle oPlayer's PlayerDM status.
|
||||
/// @note This function does nothing for actual DMClient DMs or players with a client version < 8193.14
|
||||
@@ -382,14 +389,79 @@ struct NWNX_Player_JournalEntry NWNX_Player_GetJournalEntry(object oPlayer, stri
|
||||
/// @param oPlayer The player object.
|
||||
void NWNX_Player_CloseStore(object oPlayer);
|
||||
|
||||
/// @brief Override nStrRef from the TlkTable with sOverride for oPlayer only.
|
||||
/// @param oPlayer The player.
|
||||
/// @param nStrRef The StrRef.
|
||||
/// @param sOverride The new value for nStrRef or "" to remove the override.
|
||||
/// @param bRestoreGlobal If TRUE, when removing a personal override it will attempt to restore the global override if it exists.
|
||||
/// @note Overrides will not persist through relogging.
|
||||
void NWNX_Player_SetTlkOverride(object oPlayer, int nStrRef, string sOverride, int bRestoreGlobal = TRUE);
|
||||
|
||||
/// @brief Make the player reload it's TlkTable.
|
||||
/// @param oPlayer The player.
|
||||
void NWNX_Player_ReloadTlk(object oPlayer);
|
||||
|
||||
/// @brief Update wind for oPlayer only.
|
||||
/// @param oPlayer The player.
|
||||
/// @param vDirection The Wind's direction.
|
||||
/// @param fMagnitude The Wind's magnitude.
|
||||
/// @param fYaw The Wind's yaw.
|
||||
/// @param fPitch The Wind's pitch.
|
||||
void NWNX_Player_UpdateWind(object oPlayer, vector vDirection, float fMagnitude, float fYaw, float fPitch);
|
||||
|
||||
/// @brief Update the SkyBox for oPlayer only.
|
||||
/// @param oPlayer The player.
|
||||
/// @param nSkyBox The Skybox ID.
|
||||
void NWNX_Player_UpdateSkyBox(object oPlayer, int nSkyBox);
|
||||
|
||||
/// @brief Update Sun and Moon Fog Color for oPlayer only.
|
||||
/// @param oPlayer The player.
|
||||
/// @param nSunFogColor The int value of Sun Fog color.
|
||||
/// @param nMoonFogColor The int value of Moon Fog color.
|
||||
void NWNX_Player_UpdateFogColor(object oPlayer, int nSunFogColor, int nMoonFogColor);
|
||||
|
||||
|
||||
/// @brief Update Sun and Moon Fog Amount for oPlayer only.
|
||||
/// @param oPlayer The player.
|
||||
/// @param nSunFogAmount The int value of Sun Fog amount (range 0-255).
|
||||
/// @param nMoonFogAmount The int value of Moon Fog amount (range 0-255).
|
||||
void NWNX_Player_UpdateFogAmount(object oPlayer, int nSunFogAmount, int nMoonFogAmount);
|
||||
|
||||
/// @brief Return's the currently-possessed game object of a player.
|
||||
/// @param oPlayer The player object (e.g. from GetFirst/NextPC()).
|
||||
/// @return the actual game object of oPlayer, or OBJECT_INVALID on error.
|
||||
object NWNX_Player_GetGameObject(object oPlayer);
|
||||
|
||||
/// @brief Override the ui discovery mask of oObject for oPlayer only
|
||||
/// @param oPlayer The player object.
|
||||
/// @param oObject The target object.
|
||||
/// @param nMask A mask of OBJECT_UI_DISCOVERY_*, or -1 to clear the override
|
||||
void NWNX_Player_SetObjectUiDiscoveryMaskOverride(object oPlayer, object oObject, int nMask);
|
||||
|
||||
/// @brief Send a party invite from oInviter to oPlayer
|
||||
/// @param oPlayer The player to invite
|
||||
/// @param oInviter The one inviting the player
|
||||
/// @param bForceInvite TRUE: Sends the invite even if the target ignores invites
|
||||
/// @param bHideDialog TRUE: Does not show the party invitation dialog
|
||||
void NWNX_Player_SendPartyInvite(object oPlayer, object oInviter, int bForceInvite = FALSE, int bHideDialog = FALSE);
|
||||
|
||||
/// @brief Get the TURD for oPlayer
|
||||
/// @param oPlayer The offline player to get the TURD from
|
||||
/// @return the TURD object of oPlayer, or OBJECT_INVALID if no TURD exists
|
||||
object NWNX_Player_GetTURD(object oPlayer);
|
||||
|
||||
/// @brief Reloads the color palettes for oPlayer
|
||||
/// @param oPlayer The player to reload the color palette for
|
||||
void NWNX_Player_ReloadColorPalettes(object oPlayer);
|
||||
|
||||
/// @}
|
||||
|
||||
void NWNX_Player_ForcePlaceableExamineWindow(object player, object placeable)
|
||||
{
|
||||
string sFunc = "ForcePlaceableExamineWindow";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, placeable);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(placeable);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -398,8 +470,8 @@ void NWNX_Player_ForcePlaceableInventoryWindow(object player, object placeable)
|
||||
{
|
||||
string sFunc = "ForcePlaceableInventoryWindow";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, placeable);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(placeable);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -418,7 +490,7 @@ void NWNX_Player_INTERNAL_StopGuiTimingBar(object player, string script = "", in
|
||||
DeleteLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ACTIVE");
|
||||
|
||||
string sFunc = "StopGuiTimingBar";
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(player);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
|
||||
if(script != "")
|
||||
@@ -433,9 +505,9 @@ void NWNX_Player_StartGuiTimingBar(object player, float seconds, string script =
|
||||
return;
|
||||
|
||||
string sFunc = "StartGuiTimingBar";
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, type);
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, seconds);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(type);
|
||||
NWNX_PushArgumentFloat(seconds);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
|
||||
@@ -455,8 +527,8 @@ void NWNX_Player_SetAlwaysWalk(object player, int bWalk=TRUE)
|
||||
{
|
||||
string sFunc = "SetAlwaysWalk";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, bWalk);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(bWalk);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -466,23 +538,23 @@ struct NWNX_Player_QuickBarSlot NWNX_Player_GetQuickBarSlot(object player, int s
|
||||
string sFunc = "GetQuickBarSlot";
|
||||
struct NWNX_Player_QuickBarSlot qbs;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, slot);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(slot);
|
||||
NWNX_PushArgumentObject(player);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
|
||||
qbs.oAssociate = NWNX_GetReturnValueObject(NWNX_Player, sFunc);
|
||||
qbs.nAssociateType = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.nDomainLevel = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.nMetaType = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.nINTParam1 = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.sToolTip = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
qbs.sCommandLine = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
qbs.sCommandLabel = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
qbs.sResRef = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
qbs.nMultiClass = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.nObjectType = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
qbs.oSecondaryItem = NWNX_GetReturnValueObject(NWNX_Player, sFunc);
|
||||
qbs.oItem = NWNX_GetReturnValueObject(NWNX_Player, sFunc);
|
||||
qbs.oAssociate = NWNX_GetReturnValueObject();
|
||||
qbs.nAssociateType = NWNX_GetReturnValueInt();
|
||||
qbs.nDomainLevel = NWNX_GetReturnValueInt();
|
||||
qbs.nMetaType = NWNX_GetReturnValueInt();
|
||||
qbs.nINTParam1 = NWNX_GetReturnValueInt();
|
||||
qbs.sToolTip = NWNX_GetReturnValueString();
|
||||
qbs.sCommandLine = NWNX_GetReturnValueString();
|
||||
qbs.sCommandLabel = NWNX_GetReturnValueString();
|
||||
qbs.sResRef = NWNX_GetReturnValueString();
|
||||
qbs.nMultiClass = NWNX_GetReturnValueInt();
|
||||
qbs.nObjectType = NWNX_GetReturnValueInt();
|
||||
qbs.oSecondaryItem = NWNX_GetReturnValueObject();
|
||||
qbs.oItem = NWNX_GetReturnValueObject();
|
||||
|
||||
return qbs;
|
||||
}
|
||||
@@ -491,22 +563,22 @@ void NWNX_Player_SetQuickBarSlot(object player, int slot, struct NWNX_Player_Qui
|
||||
{
|
||||
string sFunc = "SetQuickBarSlot";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.oItem);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.oSecondaryItem);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nObjectType);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nMultiClass);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.sResRef);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.sCommandLabel);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.sCommandLine);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.sToolTip);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nINTParam1);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nMetaType);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nDomainLevel);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.nAssociateType);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.oAssociate);
|
||||
NWNX_PushArgumentObject(qbs.oItem);
|
||||
NWNX_PushArgumentObject(qbs.oSecondaryItem);
|
||||
NWNX_PushArgumentInt(qbs.nObjectType);
|
||||
NWNX_PushArgumentInt(qbs.nMultiClass);
|
||||
NWNX_PushArgumentString(qbs.sResRef);
|
||||
NWNX_PushArgumentString(qbs.sCommandLabel);
|
||||
NWNX_PushArgumentString(qbs.sCommandLine);
|
||||
NWNX_PushArgumentString(qbs.sToolTip);
|
||||
NWNX_PushArgumentInt(qbs.nINTParam1);
|
||||
NWNX_PushArgumentInt(qbs.nMetaType);
|
||||
NWNX_PushArgumentInt(qbs.nDomainLevel);
|
||||
NWNX_PushArgumentInt(qbs.nAssociateType);
|
||||
NWNX_PushArgumentObject(qbs.oAssociate);
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, slot);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(slot);
|
||||
NWNX_PushArgumentObject(player);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
@@ -514,20 +586,27 @@ string NWNX_Player_GetBicFileName(object player)
|
||||
{
|
||||
string sFunc = "GetBicFileName";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(player);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Player_ShowVisualEffect(object player, int effectId, vector position)
|
||||
void NWNX_Player_ShowVisualEffect(object player, int effectId, vector position, float scale=1.0f, vector translate=[], vector rotate=[])
|
||||
{
|
||||
string sFunc = "ShowVisualEffect";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, position.x);
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, position.y);
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, position.z);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, effectId);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentFloat(rotate.x);
|
||||
NWNX_PushArgumentFloat(rotate.y);
|
||||
NWNX_PushArgumentFloat(rotate.z);
|
||||
NWNX_PushArgumentFloat(translate.x);
|
||||
NWNX_PushArgumentFloat(translate.y);
|
||||
NWNX_PushArgumentFloat(translate.z);
|
||||
NWNX_PushArgumentFloat(scale);
|
||||
NWNX_PushArgumentFloat(position.x);
|
||||
NWNX_PushArgumentFloat(position.y);
|
||||
NWNX_PushArgumentFloat(position.z);
|
||||
NWNX_PushArgumentInt(effectId);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -536,9 +615,9 @@ void NWNX_Player_MusicBackgroundChangeDay(object player, int track)
|
||||
{
|
||||
string sFunc = "ChangeBackgroundMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, track);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, TRUE); // bool day = TRUE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(track);
|
||||
NWNX_PushArgumentInt(TRUE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -547,9 +626,9 @@ void NWNX_Player_MusicBackgroundChangeNight(object player, int track)
|
||||
{
|
||||
string sFunc = "ChangeBackgroundMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, track);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, FALSE); // bool day = FALSE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(track);
|
||||
NWNX_PushArgumentInt(FALSE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -558,8 +637,8 @@ void NWNX_Player_MusicBackgroundStart(object player)
|
||||
{
|
||||
string sFunc = "PlayBackgroundMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, TRUE); // bool play = TRUE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(TRUE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -568,8 +647,8 @@ void NWNX_Player_MusicBackgroundStop(object player)
|
||||
{
|
||||
string sFunc = "PlayBackgroundMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, FALSE); // bool play = FALSE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(FALSE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -578,8 +657,8 @@ void NWNX_Player_MusicBattleChange(object player, int track)
|
||||
{
|
||||
string sFunc = "ChangeBattleMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, track);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(track);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -588,8 +667,8 @@ void NWNX_Player_MusicBattleStart(object player)
|
||||
{
|
||||
string sFunc = "PlayBattleMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, TRUE); // bool play = TRUE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(TRUE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -598,8 +677,8 @@ void NWNX_Player_MusicBattleStop(object player)
|
||||
{
|
||||
string sFunc = "PlayBattleMusic";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, FALSE); // bool play = FALSE
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(FALSE);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -608,9 +687,9 @@ void NWNX_Player_PlaySound(object player, string sound, object target = OBJECT_I
|
||||
{
|
||||
string sFunc = "PlaySound";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, target);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sound);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentString(sound);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -619,9 +698,9 @@ void NWNX_Player_SetPlaceableUsable(object player, object placeable, int usable)
|
||||
{
|
||||
string sFunc = "SetPlaceableUsable";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, usable);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, placeable);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(usable);
|
||||
NWNX_PushArgumentObject(placeable);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -630,19 +709,26 @@ void NWNX_Player_SetRestDuration(object player, int duration)
|
||||
{
|
||||
string sFunc = "SetRestDuration";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, duration);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(duration);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_ApplyInstantVisualEffectToObject(object player, object target, int visualeffect)
|
||||
void NWNX_Player_ApplyInstantVisualEffectToObject(object player, object target, int visualeffect, float scale=1.0f, vector translate=[], vector rotate=[])
|
||||
{
|
||||
string sFunc = "ApplyInstantVisualEffectToObject";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, visualeffect);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, target);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentFloat(rotate.z);
|
||||
NWNX_PushArgumentFloat(rotate.y);
|
||||
NWNX_PushArgumentFloat(rotate.x);
|
||||
NWNX_PushArgumentFloat(translate.z);
|
||||
NWNX_PushArgumentFloat(translate.y);
|
||||
NWNX_PushArgumentFloat(translate.x);
|
||||
NWNX_PushArgumentFloat(scale);
|
||||
NWNX_PushArgumentInt(visualeffect);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -651,7 +737,7 @@ void NWNX_Player_UpdateCharacterSheet(object player)
|
||||
{
|
||||
string sFunc = "UpdateCharacterSheet";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -660,9 +746,9 @@ void NWNX_Player_OpenInventory(object player, object target, int open = TRUE)
|
||||
{
|
||||
string sFunc = "OpenInventory";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, open);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, target);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(open);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -671,20 +757,20 @@ string NWNX_Player_GetAreaExplorationState(object player, object area)
|
||||
{
|
||||
string sFunc = "GetAreaExplorationState";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, area);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Player_SetAreaExplorationState(object player, object area, string str)
|
||||
{
|
||||
string sFunc = "SetAreaExplorationState";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, str);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, area);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentString(str);
|
||||
NWNX_PushArgumentObject(area);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -693,8 +779,8 @@ void NWNX_Player_SetRestAnimation(object oPlayer, int nAnimation)
|
||||
{
|
||||
string sFunc = "SetRestAnimation";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nAnimation);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nAnimation);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -703,10 +789,10 @@ void NWNX_Player_SetObjectVisualTransformOverride(object oPlayer, object oObject
|
||||
{
|
||||
string sFunc = "SetObjectVisualTransformOverride";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, fValue);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nTransform);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentFloat(fValue);
|
||||
NWNX_PushArgumentInt(nTransform);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -715,9 +801,9 @@ void NWNX_Player_ApplyLoopingVisualEffectToObject(object player, object target,
|
||||
{
|
||||
string sFunc = "ApplyLoopingVisualEffectToObject";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, visualeffect);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, target);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentInt(visualeffect);
|
||||
NWNX_PushArgumentObject(target);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -726,9 +812,9 @@ void NWNX_Player_SetPlaceableNameOverride(object player, object placeable, strin
|
||||
{
|
||||
string sFunc = "SetPlaceableNameOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, name);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, placeable);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentString(name);
|
||||
NWNX_PushArgumentObject(placeable);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -737,21 +823,21 @@ int NWNX_Player_GetQuestCompleted(object player, string sQuestName)
|
||||
{
|
||||
string sFunc = "GetQuestCompleted";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sQuestName);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
|
||||
NWNX_PushArgumentString(sQuestName);
|
||||
NWNX_PushArgumentObject(player);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Player_SetPersistentLocation(string sCDKeyOrCommunityName, string sBicFileName, object oWP, int bFirstConnectOnly = TRUE)
|
||||
{
|
||||
string sFunc = "SetPersistentLocation";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, bFirstConnectOnly);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oWP);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sBicFileName);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sCDKeyOrCommunityName);
|
||||
NWNX_PushArgumentInt(bFirstConnectOnly);
|
||||
NWNX_PushArgumentObject(oWP);
|
||||
NWNX_PushArgumentString(sBicFileName);
|
||||
NWNX_PushArgumentString(sCDKeyOrCommunityName);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -760,8 +846,8 @@ void NWNX_Player_UpdateItemName(object oPlayer, object oItem)
|
||||
{
|
||||
string sFunc = "UpdateItemName";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oItem);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oItem);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -770,43 +856,43 @@ int NWNX_Player_PossessCreature(object oPossessor, object oPossessed, int bMindI
|
||||
{
|
||||
string sFunc = "PossessCreature";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, bCreateDefaultQB);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, bMindImmune);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPossessed);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPossessor);
|
||||
NWNX_PushArgumentInt(bCreateDefaultQB);
|
||||
NWNX_PushArgumentInt(bMindImmune);
|
||||
NWNX_PushArgumentObject(oPossessed);
|
||||
NWNX_PushArgumentObject(oPossessor);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Player_GetPlatformId(object oPlayer)
|
||||
{
|
||||
string sFunc = "GetPlatformId";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Player_GetLanguage(object oPlayer)
|
||||
{
|
||||
string sFunc = "GetLanguage";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Player_SetResManOverride(object oPlayer, int nResType, string sOldResName, string sNewResName)
|
||||
{
|
||||
string sFunc = "SetResManOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sNewResName);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sOldResName);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nResType);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentString(sNewResName);
|
||||
NWNX_PushArgumentString(sOldResName);
|
||||
NWNX_PushArgumentInt(nResType);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -815,9 +901,9 @@ void NWNX_Player_SetCustomToken(object oPlayer, int nCustomTokenNumber, string s
|
||||
{
|
||||
string sFunc = "SetCustomToken";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sTokenValue);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nCustomTokenNumber);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentString(sTokenValue);
|
||||
NWNX_PushArgumentInt(nCustomTokenNumber);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -826,20 +912,21 @@ void NWNX_Player_SetCreatureNameOverride(object oPlayer, object oCreature, strin
|
||||
{
|
||||
string sFunc = "SetCreatureNameOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sName);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oCreature);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentString(sName);
|
||||
NWNX_PushArgumentObject(oCreature);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_FloatingTextStringOnCreature(object oPlayer, object oCreature, string sText)
|
||||
void NWNX_Player_FloatingTextStringOnCreature(object oPlayer, object oCreature, string sText, int bChatWindow = TRUE)
|
||||
{
|
||||
string sFunc = "FloatingTextStringOnCreature";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sText);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oCreature);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(bChatWindow);
|
||||
NWNX_PushArgumentString(sText);
|
||||
NWNX_PushArgumentObject(oCreature);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -848,8 +935,8 @@ void NWNX_Player_ToggleDM(object oPlayer, int bIsDM)
|
||||
{
|
||||
string sFunc = "ToggleDM";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, bIsDM);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(bIsDM);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -858,9 +945,9 @@ void NWNX_Player_SetObjectMouseCursorOverride(object oPlayer, object oObject, in
|
||||
{
|
||||
string sFunc = "SetObjectMouseCursorOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nCursor);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nCursor);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -869,9 +956,9 @@ void NWNX_Player_SetObjectHiliteColorOverride(object oPlayer, object oObject, in
|
||||
{
|
||||
string sFunc = "SetObjectHiliteColorOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nColor);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nColor);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -880,8 +967,8 @@ void NWNX_Player_RemoveEffectFromTURD(object oPlayer, string sEffectTag)
|
||||
{
|
||||
string sFunc = "RemoveEffectFromTURD";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, sEffectTag);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentString(sEffectTag);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -892,12 +979,12 @@ void NWNX_Player_SetSpawnLocation(object oPlayer, location locSpawn)
|
||||
|
||||
vector vPosition = GetPositionFromLocation(locSpawn);
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, GetFacingFromLocation(locSpawn));
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, vPosition.z);
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, vPosition.y);
|
||||
NWNX_PushArgumentFloat(NWNX_Player, sFunc, vPosition.x);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, GetAreaFromLocation(locSpawn));
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentFloat(GetFacingFromLocation(locSpawn));
|
||||
NWNX_PushArgumentFloat(vPosition.z);
|
||||
NWNX_PushArgumentFloat(vPosition.y);
|
||||
NWNX_PushArgumentFloat(vPosition.x);
|
||||
NWNX_PushArgumentObject(GetAreaFromLocation(locSpawn));
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
@@ -905,27 +992,27 @@ void NWNX_Player_SetSpawnLocation(object oPlayer, location locSpawn)
|
||||
void NWNX_Player_SendDMAllCreatorLists(object oPlayer)
|
||||
{
|
||||
string sFunc = "SendDMAllCreatorLists";
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Player_AddCustomJournalEntry(object oPlayer, struct NWNX_Player_JournalEntry journalEntry, int nSilentUpdate = 0)
|
||||
{
|
||||
string sFunc = "AddCustomJournalEntry";
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, nSilentUpdate);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nTimeOfDay);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nCalendarDay);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nUpdated);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nQuestDisplayed);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nQuestCompleted);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nPriority);
|
||||
NWNX_PushArgumentInt(NWNX_Player, sFunc, journalEntry.nState);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, journalEntry.sTag);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, journalEntry.sText);
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, journalEntry.sName);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nSilentUpdate);
|
||||
NWNX_PushArgumentInt(journalEntry.nTimeOfDay);
|
||||
NWNX_PushArgumentInt(journalEntry.nCalendarDay);
|
||||
NWNX_PushArgumentInt(journalEntry.nUpdated);
|
||||
NWNX_PushArgumentInt(journalEntry.nQuestDisplayed);
|
||||
NWNX_PushArgumentInt(journalEntry.nQuestCompleted);
|
||||
NWNX_PushArgumentInt(journalEntry.nPriority);
|
||||
NWNX_PushArgumentInt(journalEntry.nState);
|
||||
NWNX_PushArgumentString(journalEntry.sTag);
|
||||
NWNX_PushArgumentString(journalEntry.sText);
|
||||
NWNX_PushArgumentString(journalEntry.sName);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_Player_JournalEntry NWNX_Player_GetJournalEntry(object oPlayer, string questTag)
|
||||
@@ -933,23 +1020,23 @@ struct NWNX_Player_JournalEntry NWNX_Player_GetJournalEntry(object oPlayer, stri
|
||||
string sFunc = "GetJournalEntry";
|
||||
struct NWNX_Player_JournalEntry entry;
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Player, sFunc, questTag);
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentString(questTag);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
|
||||
entry.nUpdated = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nUpdated = NWNX_GetReturnValueInt();
|
||||
if(entry.nUpdated == -1) // -1 set as an indicator to say that the entry was not found
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
entry.nQuestDisplayed = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nQuestCompleted = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nPriority = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nState = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nTimeOfDay = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.nCalendarDay = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
|
||||
entry.sName = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
entry.sText = NWNX_GetReturnValueString(NWNX_Player, sFunc);
|
||||
entry.nQuestDisplayed = NWNX_GetReturnValueInt();
|
||||
entry.nQuestCompleted = NWNX_GetReturnValueInt();
|
||||
entry.nPriority = NWNX_GetReturnValueInt();
|
||||
entry.nState = NWNX_GetReturnValueInt();
|
||||
entry.nTimeOfDay = NWNX_GetReturnValueInt();
|
||||
entry.nCalendarDay = NWNX_GetReturnValueInt();
|
||||
entry.sName = NWNX_GetReturnValueString();
|
||||
entry.sText = NWNX_GetReturnValueString();
|
||||
entry.sTag = questTag;
|
||||
return entry;
|
||||
}
|
||||
@@ -958,6 +1045,118 @@ void NWNX_Player_CloseStore(object oPlayer)
|
||||
{
|
||||
string sFunc = "CloseStore";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_SetTlkOverride(object oPlayer, int nStrRef, string sOverride, int bRestoreGlobal = TRUE)
|
||||
{
|
||||
string sFunc = "SetTlkOverride";
|
||||
|
||||
NWNX_PushArgumentInt(bRestoreGlobal);
|
||||
NWNX_PushArgumentString(sOverride);
|
||||
NWNX_PushArgumentInt(nStrRef);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_ReloadTlk(object oPlayer)
|
||||
{
|
||||
string sFunc = "ReloadTlk";
|
||||
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_UpdateWind(object oPlayer, vector vDirection, float fMagnitude, float fYaw, float fPitch)
|
||||
{
|
||||
string sFunc = "UpdateWind";
|
||||
|
||||
NWNX_PushArgumentFloat(fPitch);
|
||||
NWNX_PushArgumentFloat(fYaw);
|
||||
NWNX_PushArgumentFloat(fMagnitude);
|
||||
NWNX_PushArgumentFloat(vDirection.x);
|
||||
NWNX_PushArgumentFloat(vDirection.y);
|
||||
NWNX_PushArgumentFloat(vDirection.z);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_UpdateSkyBox(object oPlayer, int nSkyBox)
|
||||
{
|
||||
string sFunc = "UpdateSkyBox";
|
||||
|
||||
NWNX_PushArgumentInt(nSkyBox);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_UpdateFogColor(object oPlayer, int nSunFogColor, int nMoonFogColor)
|
||||
{
|
||||
string sFunc = "UpdateFogColor";
|
||||
|
||||
NWNX_PushArgumentInt(nMoonFogColor);
|
||||
NWNX_PushArgumentInt(nSunFogColor);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_UpdateFogAmount(object oPlayer, int nSunFogAmount, int nMoonFogAmount)
|
||||
{
|
||||
string sFunc = "UpdateFogAmount";
|
||||
|
||||
NWNX_PushArgumentInt(nMoonFogAmount);
|
||||
NWNX_PushArgumentInt(nSunFogAmount);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
object NWNX_Player_GetGameObject(object oPlayer)
|
||||
{
|
||||
string sFunc = "GetGameObject";
|
||||
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Player_SetObjectUiDiscoveryMaskOverride(object oPlayer, object oObject, int nMask)
|
||||
{
|
||||
string sFunc = "SetObjectUiDiscoveryMaskOverride";
|
||||
|
||||
NWNX_PushArgumentInt(nMask);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Player_SendPartyInvite(object oPlayer, object oInviter, int bForceInvite = FALSE, int bHideDialog = FALSE)
|
||||
{
|
||||
string sFunc = "SendPartyInvite";
|
||||
|
||||
NWNX_PushArgumentInt(bHideDialog);
|
||||
NWNX_PushArgumentInt(bForceInvite);
|
||||
NWNX_PushArgumentObject(oInviter);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
||||
object NWNX_Player_GetTURD(object oPlayer)
|
||||
{
|
||||
string sFunc = "GetTURD";
|
||||
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Player_ReloadColorPalettes(object oPlayer)
|
||||
{
|
||||
string sFunc = "ReloadColorPalettes";
|
||||
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Player, sFunc);
|
||||
}
|
||||
|
@@ -41,12 +41,12 @@ void NWNX_Profiler_PushPerfScope(string name, string tag0_tag = "", string tag0_
|
||||
{
|
||||
string sFunc = "PushPerfScope";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Profiler, sFunc, name);
|
||||
NWNX_PushArgumentString(name);
|
||||
|
||||
if (tag0_value != "" && tag0_tag != "")
|
||||
{
|
||||
NWNX_PushArgumentString(NWNX_Profiler, sFunc, tag0_value);
|
||||
NWNX_PushArgumentString(NWNX_Profiler, sFunc, tag0_tag);
|
||||
NWNX_PushArgumentString(tag0_value);
|
||||
NWNX_PushArgumentString(tag0_tag);
|
||||
}
|
||||
|
||||
NWNX_CallFunction(NWNX_Profiler, sFunc);
|
||||
|
@@ -60,11 +60,11 @@ void NWNX_Race_SetRacialModifier(int iRace, int iMod, int iParam1, int iParam2 =
|
||||
{
|
||||
string sFunc = "SetRacialModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iParam3);
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iParam2);
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iParam1);
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iMod);
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iRace);
|
||||
NWNX_PushArgumentInt(iParam3);
|
||||
NWNX_PushArgumentInt(iParam2);
|
||||
NWNX_PushArgumentInt(iParam1);
|
||||
NWNX_PushArgumentInt(iMod);
|
||||
NWNX_PushArgumentInt(iRace);
|
||||
|
||||
NWNX_CallFunction(NWNX_Race, sFunc);
|
||||
}
|
||||
@@ -73,18 +73,18 @@ int NWNX_Race_GetParentRace(int iRace)
|
||||
{
|
||||
string sFunc = "GetParentRace";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iRace);
|
||||
NWNX_PushArgumentInt(iRace);
|
||||
|
||||
NWNX_CallFunction(NWNX_Race, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Race, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Race_SetFavoredEnemyFeat(int iRace, int iFeat)
|
||||
{
|
||||
string sFunc = "SetFavoredEnemyFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Race, sFunc, iRace);
|
||||
NWNX_PushArgumentInt(iFeat);
|
||||
NWNX_PushArgumentInt(iRace);
|
||||
|
||||
NWNX_CallFunction(NWNX_Race, sFunc);
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@
|
||||
/// @file nwnx_race_2da.nss
|
||||
/// @brief Parse a column in the racialtypes.2da to load the modifiers.
|
||||
#include "nwnx_race"
|
||||
#include "nwnx_util"
|
||||
|
||||
/// @ingroup race
|
||||
/// @brief Translate a modifier type from a string to its constant.
|
||||
@@ -45,14 +44,14 @@ int NWNX_Race_GetModifierConstant(string raceMod)
|
||||
|
||||
void NWNX_Race_LoadRacialModifiers(string sColumnName = "RacialModsTable")
|
||||
{
|
||||
int iRaceRows = NWNX_Util_Get2DARowCount("racialtypes");
|
||||
int iRaceRows = Get2DARowCount("racialtypes");
|
||||
int iRace;
|
||||
for (iRace = 0; iRace < iRaceRows; iRace++)
|
||||
{
|
||||
string sRaceModTable = Get2DAString("racialtypes", sColumnName, iRace);
|
||||
if(sRaceModTable != "")
|
||||
{
|
||||
int iRaceModRows = NWNX_Util_Get2DARowCount(sRaceModTable);
|
||||
int iRaceModRows = Get2DARowCount(sRaceModTable);
|
||||
int iRaceMod;
|
||||
for (iRaceMod = 0; iRaceMod < iRaceModRows; iRaceMod++)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -65,44 +65,44 @@ string NWNX_Redis_GetResultAsString(int resultId);
|
||||
|
||||
int NWNX_Redis_GetResultType(int resultId)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultType", resultId);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultType");
|
||||
return NWNX_GetReturnValueInt("NWNX_Redis", "GetResultType");
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Redis_GetArrayLength(int resultId)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultArrayLength", resultId);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultArrayLength");
|
||||
return NWNX_GetReturnValueInt("NWNX_Redis", "GetResultArrayLength");
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
// Returns the last
|
||||
int NWNX_Redis_GetArrayElement(int resultId, int idx)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultArrayElement", resultId);
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultArrayElement", idx);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_PushArgumentInt(idx);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultArrayElement");
|
||||
return NWNX_GetReturnValueInt("NWNX_Redis", "GetResultArrayElement");
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
float NWNX_Redis_GetResultAsFloat(int resultId)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultAsString", resultId);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultAsString");
|
||||
return StringToFloat(NWNX_GetReturnValueString("NWNX_Redis", "GetResultAsString"));
|
||||
return StringToFloat(NWNX_GetReturnValueString());
|
||||
}
|
||||
|
||||
int NWNX_Redis_GetResultAsInt(int resultId)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultAsString", resultId);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultAsString");
|
||||
return StringToInt(NWNX_GetReturnValueString("NWNX_Redis", "GetResultAsString"));
|
||||
return StringToInt(NWNX_GetReturnValueString());
|
||||
}
|
||||
|
||||
string NWNX_Redis_GetResultAsString(int resultId)
|
||||
{
|
||||
NWNX_PushArgumentInt("NWNX_Redis", "GetResultAsString", resultId);
|
||||
NWNX_PushArgumentInt(resultId);
|
||||
NWNX_CallFunction("NWNX_Redis", "GetResultAsString");
|
||||
return NWNX_GetReturnValueString("NWNX_Redis", "GetResultAsString");
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
@@ -16,8 +16,8 @@ struct NWNX_Redis_PubSubMessageData NWNX_Redis_GetPubSubMessageData()
|
||||
{
|
||||
struct NWNX_Redis_PubSubMessageData ret;
|
||||
NWNX_CallFunction("NWNX_Redis", "GetPubSubData");
|
||||
ret.message = NWNX_GetReturnValueString("NWNX_Redis", "GetPubSubData");
|
||||
ret.channel = NWNX_GetReturnValueString("NWNX_Redis", "GetPubSubData");
|
||||
ret.message = NWNX_GetReturnValueString();
|
||||
ret.channel = NWNX_GetReturnValueString();
|
||||
return ret;
|
||||
}
|
||||
/// @}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -48,12 +48,12 @@ void NWNX_Rename_SetPCNameOverride(object oTarget, string sNewName, string sPref
|
||||
{
|
||||
string sFunc = "SetPCNameOverride";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oObserver);
|
||||
NWNX_PushArgumentInt(NWNX_Rename, sFunc, iPlayerNameState);
|
||||
NWNX_PushArgumentString(NWNX_Rename, sFunc, sSuffix);
|
||||
NWNX_PushArgumentString(NWNX_Rename, sFunc, sPrefix);
|
||||
NWNX_PushArgumentString(NWNX_Rename, sFunc, sNewName);
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oTarget);
|
||||
NWNX_PushArgumentObject(oObserver);
|
||||
NWNX_PushArgumentInt(iPlayerNameState);
|
||||
NWNX_PushArgumentString(sSuffix);
|
||||
NWNX_PushArgumentString(sPrefix);
|
||||
NWNX_PushArgumentString(sNewName);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
|
||||
NWNX_CallFunction(NWNX_Rename, sFunc);
|
||||
}
|
||||
@@ -61,20 +61,20 @@ string NWNX_Rename_GetPCNameOverride(object oTarget, object oObserver = OBJECT_I
|
||||
{
|
||||
string sFunc = "GetPCNameOverride";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oObserver);
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oTarget);
|
||||
NWNX_PushArgumentObject(oObserver);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
|
||||
NWNX_CallFunction(NWNX_Rename, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Rename, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Rename_ClearPCNameOverride(object oTarget, object oObserver = OBJECT_INVALID, int clearAll = FALSE)
|
||||
{
|
||||
string sFunc = "ClearPCNameOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Rename, sFunc, clearAll);
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oObserver);
|
||||
NWNX_PushArgumentObject(NWNX_Rename, sFunc, oTarget);
|
||||
NWNX_PushArgumentInt(clearAll);
|
||||
NWNX_PushArgumentObject(oObserver);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
|
||||
NWNX_CallFunction(NWNX_Rename, sFunc);
|
||||
}
|
||||
|
@@ -30,9 +30,9 @@ void NWNX_Reveal_RevealTo(object oHiding, object oObserver, int iDetectionMethod
|
||||
{
|
||||
string sFunc = "RevealTo";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Reveal, sFunc, iDetectionMethod);
|
||||
NWNX_PushArgumentObject(NWNX_Reveal, sFunc, oObserver);
|
||||
NWNX_PushArgumentObject(NWNX_Reveal, sFunc, oHiding);
|
||||
NWNX_PushArgumentInt(iDetectionMethod);
|
||||
NWNX_PushArgumentObject(oObserver);
|
||||
NWNX_PushArgumentObject(oHiding);
|
||||
|
||||
NWNX_CallFunction(NWNX_Reveal, sFunc);
|
||||
}
|
||||
@@ -41,9 +41,9 @@ void NWNX_Reveal_SetRevealToParty(object oHiding, int bReveal, int iDetectionMet
|
||||
{
|
||||
string sFunc = "SetRevealToParty";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Reveal, sFunc, iDetectionMethod);
|
||||
NWNX_PushArgumentInt(NWNX_Reveal, sFunc, bReveal);
|
||||
NWNX_PushArgumentObject(NWNX_Reveal, sFunc, oHiding);
|
||||
NWNX_PushArgumentInt(iDetectionMethod);
|
||||
NWNX_PushArgumentInt(bReveal);
|
||||
NWNX_PushArgumentObject(oHiding);
|
||||
|
||||
NWNX_CallFunction(NWNX_Reveal, sFunc);
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
const string NWNX_Ruby = "NWNX_Ruby"; ///< @private
|
||||
|
||||
string NWNX_Ruby_Evaluate (string sCode);
|
||||
string NWNX_Ruby_Evaluate(string sCode);
|
||||
|
||||
/// @brief Evaluates some ruby code.
|
||||
/// @param sCode The code to evaluate.
|
||||
@@ -15,9 +15,9 @@ string NWNX_Ruby_Evaluate(string sCode)
|
||||
{
|
||||
string sFunc = "Evaluate";
|
||||
|
||||
NWNX_PushArgumentString (NWNX_Ruby, sFunc, sCode);
|
||||
NWNX_CallFunction (NWNX_Ruby, sFunc);
|
||||
return NWNX_GetReturnValueString (NWNX_Ruby, sFunc);
|
||||
NWNX_PushArgumentString(sCode);
|
||||
NWNX_CallFunction(NWNX_Ruby, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
@@ -146,33 +146,33 @@ int NWNX_SkillRanks_GetSkillFeatCountForSkill(int iSkill)
|
||||
{
|
||||
string sFunc = "GetSkillFeatCountForSkill";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iSkill);
|
||||
NWNX_PushArgumentInt(iSkill);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeatForSkillByIndex(int iSkill, int iIndex)
|
||||
{
|
||||
string sFunc = "GetSkillFeatForSkillByIndex";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iIndex);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iSkill);
|
||||
NWNX_PushArgumentInt(iIndex);
|
||||
NWNX_PushArgumentInt(iSkill);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
|
||||
struct NWNX_SkillRanks_SkillFeat skillFeat;
|
||||
|
||||
skillFeat.iSkill = iSkill;
|
||||
skillFeat.iFeat = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iModifier = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iFocusFeat = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.sClasses = NWNX_GetReturnValueString(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iDayOrNight = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iFeat = NWNX_GetReturnValueInt();
|
||||
skillFeat.iModifier = NWNX_GetReturnValueInt();
|
||||
skillFeat.iFocusFeat = NWNX_GetReturnValueInt();
|
||||
skillFeat.sClasses = NWNX_GetReturnValueString();
|
||||
skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat();
|
||||
skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt();
|
||||
skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt();
|
||||
skillFeat.iDayOrNight = NWNX_GetReturnValueInt();
|
||||
skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt();
|
||||
skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt();
|
||||
|
||||
return skillFeat;
|
||||
}
|
||||
@@ -181,23 +181,23 @@ struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat(int iSkill, int iF
|
||||
{
|
||||
string sFunc = "GetSkillFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iFeat);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iSkill);
|
||||
NWNX_PushArgumentInt(iFeat);
|
||||
NWNX_PushArgumentInt(iSkill);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
|
||||
struct NWNX_SkillRanks_SkillFeat skillFeat;
|
||||
|
||||
skillFeat.iSkill = iSkill;
|
||||
skillFeat.iFeat = iFeat;
|
||||
skillFeat.iModifier = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iFocusFeat = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.sClasses = NWNX_GetReturnValueString(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iDayOrNight = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
skillFeat.iModifier = NWNX_GetReturnValueInt();
|
||||
skillFeat.iFocusFeat = NWNX_GetReturnValueInt();
|
||||
skillFeat.sClasses = NWNX_GetReturnValueString();
|
||||
skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat();
|
||||
skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt();
|
||||
skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt();
|
||||
skillFeat.iDayOrNight = NWNX_GetReturnValueInt();
|
||||
skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt();
|
||||
skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt();
|
||||
|
||||
return skillFeat;
|
||||
}
|
||||
@@ -206,19 +206,19 @@ void NWNX_SkillRanks_SetSkillFeat(struct NWNX_SkillRanks_SkillFeat skillFeat, in
|
||||
{
|
||||
string sFunc = "SetSkillFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, createIfNonExistent);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iKeyAbilityMask);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.bBypassArmorCheckPenalty);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iDayOrNight);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iAreaFlagsForbidden);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iAreaFlagsRequired);
|
||||
NWNX_PushArgumentFloat(NWNX_SkillRanks, sFunc, skillFeat.fClassLevelMod);
|
||||
NWNX_PushArgumentInt(createIfNonExistent);
|
||||
NWNX_PushArgumentInt(skillFeat.iKeyAbilityMask);
|
||||
NWNX_PushArgumentInt(skillFeat.bBypassArmorCheckPenalty);
|
||||
NWNX_PushArgumentInt(skillFeat.iDayOrNight);
|
||||
NWNX_PushArgumentInt(skillFeat.iAreaFlagsForbidden);
|
||||
NWNX_PushArgumentInt(skillFeat.iAreaFlagsRequired);
|
||||
NWNX_PushArgumentFloat(skillFeat.fClassLevelMod);
|
||||
// We only need to send the string from the point of the first set bit
|
||||
NWNX_PushArgumentString(NWNX_SkillRanks, sFunc, GetStringRight(skillFeat.sClasses, GetStringLength(skillFeat.sClasses)-FindSubString(skillFeat.sClasses, "1")));
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iFocusFeat);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iModifier);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iFeat);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, skillFeat.iSkill);
|
||||
NWNX_PushArgumentString(GetStringRight(skillFeat.sClasses,GetStringLength(skillFeat.sClasses)-FindSubString(skillFeat.sClasses,"1")));
|
||||
NWNX_PushArgumentInt(skillFeat.iFocusFeat);
|
||||
NWNX_PushArgumentInt(skillFeat.iModifier);
|
||||
NWNX_PushArgumentInt(skillFeat.iFeat);
|
||||
NWNX_PushArgumentInt(skillFeat.iSkill);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ void NWNX_SkillRanks_SetSkillFeatFocusModifier(int iModifier, int epicFocus = FA
|
||||
{
|
||||
string sFunc = "SetSkillFeatFocusModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, epicFocus);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iModifier);
|
||||
NWNX_PushArgumentInt(epicFocus);
|
||||
NWNX_PushArgumentInt(iModifier);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
}
|
||||
|
||||
@@ -250,14 +250,14 @@ int NWNX_SkillRanks_GetBlindnessPenalty()
|
||||
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_SkillRanks_SetBlindnessPenalty(int iModifier)
|
||||
{
|
||||
string sFunc = "SetBlindnessPenalty";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iModifier);
|
||||
NWNX_PushArgumentInt(iModifier);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
}
|
||||
|
||||
@@ -265,19 +265,19 @@ int NWNX_SkillRanks_GetAreaModifier(object oArea, int iSkill)
|
||||
{
|
||||
string sFunc = "GetAreaModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iSkill);
|
||||
NWNX_PushArgumentObject(NWNX_SkillRanks, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(iSkill);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_SkillRanks, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier)
|
||||
{
|
||||
string sFunc = "SetAreaModifier";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iModifier);
|
||||
NWNX_PushArgumentInt(NWNX_SkillRanks, sFunc, iSkill);
|
||||
NWNX_PushArgumentObject(NWNX_SkillRanks, sFunc, oArea);
|
||||
NWNX_PushArgumentInt(iModifier);
|
||||
NWNX_PushArgumentInt(iSkill);
|
||||
NWNX_PushArgumentObject(oArea);
|
||||
NWNX_CallFunction(NWNX_SkillRanks, sFunc);
|
||||
}
|
||||
|
@@ -29,15 +29,15 @@ string NWNX_SpellChecker_FindMisspell(string sentence)
|
||||
{
|
||||
string sFunc = "FindMisspell";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_SpellChecker, sFunc, sentence);
|
||||
NWNX_PushArgumentString(sentence);
|
||||
NWNX_CallFunction(NWNX_SpellChecker, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_SpellChecker, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_SpellChecker_GetSuggestSpell(string word)
|
||||
{
|
||||
string sFunc = "GetSuggestSpell";
|
||||
NWNX_PushArgumentString(NWNX_SpellChecker, sFunc, word);
|
||||
NWNX_PushArgumentString(word);
|
||||
NWNX_CallFunction(NWNX_SpellChecker, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_SpellChecker, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
@@ -61,6 +61,16 @@ void NWNX_SQL_PreparedObjectId(int position, object value);
|
||||
/// @param base64 Use base64-encoded string format if TRUE (default), otherwise use binary format.
|
||||
void NWNX_SQL_PreparedObjectFull(int position, object value, int base64 = TRUE);
|
||||
|
||||
/// @brief Set the NULL value of a prepared statement at given position.
|
||||
/// @param position The nth ? in a prepared statement.
|
||||
void NWNX_SQL_PreparedNULL(int position);
|
||||
|
||||
/// @brief Set the Json value of a prepared statement at given position.
|
||||
/// Convienence function to match other Prepared(type) functions.
|
||||
/// @param position The nth ? in a prepared statement.
|
||||
/// @param value The value to set.
|
||||
void NWNX_SQL_PreparedJson(int position, json value);
|
||||
|
||||
/// @brief Like NWNX_SQL_ReadDataInActiveRow, but for full serialized objects.
|
||||
///
|
||||
/// The object will be deserialized and created in the game. New object ID is returned.
|
||||
@@ -98,15 +108,19 @@ string NWNX_SQL_GetLastError();
|
||||
/// @return Returns the number of parameters expected by the prepared query or -1 if no query is prepared.
|
||||
int NWNX_SQL_GetPreparedQueryParamCount();
|
||||
|
||||
/// @brief Set the next query to return full binary results **ON THE FIRST COLUMN ONLY**.
|
||||
/// @note This is ONLY needed on PostgreSQL, and ONLY if you want to deserialize raw bytea in NWNX_SQL_ReadFullObjectInActiveRow with base64=FALSE.
|
||||
void NWNX_SQL_PostgreSQL_SetNextQueryResultsBinaryMode();
|
||||
|
||||
/// @}
|
||||
|
||||
int NWNX_SQL_PrepareQuery(string query)
|
||||
{
|
||||
string sFunc = "PrepareQuery";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_SQL, sFunc, query);
|
||||
NWNX_PushArgumentString(query);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_SQL_ExecutePreparedQuery()
|
||||
@@ -114,7 +128,7 @@ int NWNX_SQL_ExecutePreparedQuery()
|
||||
string sFunc = "ExecutePreparedQuery";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_SQL_ExecuteQuery(string query)
|
||||
@@ -135,7 +149,7 @@ int NWNX_SQL_ReadyToReadNextRow()
|
||||
string sFunc = "ReadyToReadNextRow";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_SQL_ReadNextRow()
|
||||
@@ -149,9 +163,9 @@ string NWNX_SQL_ReadDataInActiveRow(int column = 0)
|
||||
{
|
||||
string sFunc = "ReadDataInActiveRow";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, column);
|
||||
NWNX_PushArgumentInt(column);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
|
||||
@@ -159,59 +173,70 @@ void NWNX_SQL_PreparedInt(int position, int value)
|
||||
{
|
||||
string sFunc = "PreparedInt";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, position);
|
||||
NWNX_PushArgumentInt(value);
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
}
|
||||
void NWNX_SQL_PreparedString(int position, string value)
|
||||
{
|
||||
string sFunc = "PreparedString";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_SQL, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, position);
|
||||
NWNX_PushArgumentString(value);
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
|
||||
}
|
||||
void NWNX_SQL_PreparedFloat(int position, float value)
|
||||
{
|
||||
string sFunc = "PreparedFloat";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_SQL, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, position);
|
||||
NWNX_PushArgumentFloat(value);
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
|
||||
}
|
||||
void NWNX_SQL_PreparedObjectId(int position, object value)
|
||||
{
|
||||
string sFunc = "PreparedObjectId";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_SQL, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, position);
|
||||
NWNX_PushArgumentObject(value);
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
|
||||
}
|
||||
void NWNX_SQL_PreparedObjectFull(int position, object value, int base64 = TRUE)
|
||||
{
|
||||
string sFunc = "PreparedObjectFull";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, base64);
|
||||
NWNX_PushArgumentObject(NWNX_SQL, sFunc, value);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, position);
|
||||
NWNX_PushArgumentInt(base64);
|
||||
NWNX_PushArgumentObject(value);
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
}
|
||||
void NWNX_SQL_PreparedNULL(int position)
|
||||
{
|
||||
string sFunc = "PreparedNULL";
|
||||
|
||||
NWNX_PushArgumentInt(position);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
}
|
||||
void NWNX_SQL_PreparedJson(int position, json value)
|
||||
{
|
||||
// Dump to string and continue as a string from here.
|
||||
// Famously assuming we're sent valid Json here.
|
||||
NWNX_SQL_PreparedString(position, JsonDump(value));
|
||||
}
|
||||
|
||||
|
||||
object NWNX_SQL_ReadFullObjectInActiveRow(int column = 0, object owner = OBJECT_INVALID, float x = 0.0, float y = 0.0, float z = 0.0, int base64 = TRUE)
|
||||
{
|
||||
string sFunc = "ReadFullObjectInActiveRow";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, base64);
|
||||
NWNX_PushArgumentFloat(NWNX_SQL, sFunc, z);
|
||||
NWNX_PushArgumentFloat(NWNX_SQL, sFunc, y);
|
||||
NWNX_PushArgumentFloat(NWNX_SQL, sFunc, x);
|
||||
NWNX_PushArgumentObject(NWNX_SQL, sFunc, owner);
|
||||
NWNX_PushArgumentInt(NWNX_SQL, sFunc, column);
|
||||
NWNX_PushArgumentInt(base64);
|
||||
NWNX_PushArgumentFloat(z);
|
||||
NWNX_PushArgumentFloat(y);
|
||||
NWNX_PushArgumentFloat(x);
|
||||
NWNX_PushArgumentObject(owner);
|
||||
NWNX_PushArgumentInt(column);
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueObject(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
int NWNX_SQL_GetAffectedRows()
|
||||
@@ -219,7 +244,7 @@ int NWNX_SQL_GetAffectedRows()
|
||||
string sFunc = "GetAffectedRows";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_SQL_GetDatabaseType()
|
||||
@@ -227,7 +252,7 @@ string NWNX_SQL_GetDatabaseType()
|
||||
string sFunc = "GetDatabaseType";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_SQL_DestroyPreparedQuery()
|
||||
@@ -242,7 +267,7 @@ string NWNX_SQL_GetLastError()
|
||||
string sFunc = "GetLastError";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_SQL_GetPreparedQueryParamCount()
|
||||
@@ -250,5 +275,12 @@ int NWNX_SQL_GetPreparedQueryParamCount()
|
||||
string sFunc = "GetPreparedQueryParamCount";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_SQL, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_SQL_PostgreSQL_SetNextQueryResultsBinaryMode()
|
||||
{
|
||||
string sFunc = "PostgreSQL_SetNextQueryResultsBinaryMode";
|
||||
|
||||
NWNX_CallFunction(NWNX_SQL, sFunc);
|
||||
}
|
||||
|
131
_module/nss/nwnx_store.nss
Normal file
131
_module/nss/nwnx_store.nss
Normal file
@@ -0,0 +1,131 @@
|
||||
/// @addtogroup store
|
||||
/// @brief Functions exposing additional store properties.
|
||||
/// @{
|
||||
/// @file nwnx_store.nss
|
||||
#include "nwnx"
|
||||
|
||||
const string NWNX_Store = "NWNX_Store"; ///< @private
|
||||
|
||||
/// @brief Return status of a base item purchase status.
|
||||
/// @param oStore The store object.
|
||||
/// @param nBaseItem A BASE_ITEM_* value
|
||||
/// @return TRUE if the quest has been completed. -1 if the player does not have the journal entry.
|
||||
int NWNX_Store_GetIsRestrictedBuyItem(object oStore, int nBaseItem);
|
||||
|
||||
/// @brief Return the blackmarket mark down of a store
|
||||
/// @param oStore The store object.
|
||||
/// @return mark down of a store, -1 on error
|
||||
int NWNX_Store_GetBlackMarketMarkDown(object oStore);
|
||||
|
||||
/// @brief Set the blackmarket mark down of a store
|
||||
/// @param oStore The store object.
|
||||
/// @param nValue The amount.
|
||||
void NWNX_Store_SetBlackMarketMarkDown(object oStore, int nValue);
|
||||
|
||||
/// @brief Return the mark down of a store
|
||||
/// @param oStore The store object.
|
||||
/// @return mark down of a store, -1 on error
|
||||
int NWNX_Store_GetMarkDown(object oStore);
|
||||
|
||||
/// @brief Set the mark down of a store
|
||||
/// @param oStore The store object.
|
||||
/// @param nValue The amount.
|
||||
void NWNX_Store_SetMarkDown(object oStore, int nValue);
|
||||
|
||||
/// @brief Return the mark up of a store
|
||||
/// @param oStore The store object.
|
||||
/// @return mark up of a store, -1 on error
|
||||
int NWNX_Store_GetMarkUp(object oStore);
|
||||
|
||||
/// @brief Set the mark up of a store
|
||||
/// @param oStore The store object.
|
||||
/// @param nValue The amount.
|
||||
void NWNX_Store_SetMarkUp(object oStore, int nValue);
|
||||
|
||||
/// @brief Return current customer count
|
||||
/// @param oStore The store object.
|
||||
/// @return count, or -1 on error
|
||||
int NWNX_Store_GetCurrentCustomersCount(object oStore);
|
||||
|
||||
/// @}
|
||||
|
||||
int NWNX_Store_GetIsRestrictedBuyItem(object oStore, int nBaseItem)
|
||||
{
|
||||
string sFunc = "GetIsRestrictedBuyItem";
|
||||
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Store_GetBlackMarketMarkDown(object oStore)
|
||||
{
|
||||
string sFunc = "GetBlackMarketMarkDown";
|
||||
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Store_SetBlackMarketMarkDown(object oStore, int nValue)
|
||||
{
|
||||
string sFunc = "SetBlackMarketMarkDown";
|
||||
|
||||
NWNX_PushArgumentInt(nValue);
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Store_GetMarkDown(object oStore)
|
||||
{
|
||||
string sFunc = "GetMarkDown";
|
||||
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Store_SetMarkDown(object oStore, int nValue)
|
||||
{
|
||||
string sFunc = "SetMarkDown";
|
||||
|
||||
NWNX_PushArgumentInt(nValue);
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Store_GetMarkUp(object oStore)
|
||||
{
|
||||
string sFunc = "GetMarkUp";
|
||||
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Store_SetMarkUp(object oStore, int nValue)
|
||||
{
|
||||
string sFunc = "SetMarkUp";
|
||||
|
||||
NWNX_PushArgumentInt(nValue);
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Store_GetCurrentCustomersCount(object oStore)
|
||||
{
|
||||
string sFunc = "GetCurrentCustomersCount";
|
||||
|
||||
NWNX_PushArgumentObject(oStore);
|
||||
|
||||
NWNX_CallFunction(NWNX_Store, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
@@ -95,11 +95,12 @@ string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex);
|
||||
/// @return A NWNX_Tileset_TilesetGroupData struct.
|
||||
struct NWNX_Tileset_TilesetGroupData NWNX_Tileset_GetTilesetGroupData(string sTileset, int nIndex);
|
||||
|
||||
/// @brief Get tile ID of the tile at nIndex.
|
||||
/// @note NWNX_Tileset_GetTilesetGroupData() needs to be called first.
|
||||
/// @param nIndex The index of the tile. Range: (NWNX_Tileset_TilesetGroupData.nRows * NWNX_Tileset_TilesetGroupData.nColumns) > nIndex >= 0
|
||||
/// @brief Get the tile ID at nTileIndex in nGroupIndex of sTileset.
|
||||
/// @param sTileset The tileset.
|
||||
/// @param nGroupIndex The index of the group. Range: NWNX_Tileset_TilesetData.nNumGroups > nGroupIndex >= 0
|
||||
/// @param nTileIndex The index of the tile. Range: (NWNX_Tileset_TilesetGroupData.nRows * NWNX_Tileset_TilesetGroupData.nColumns) > nTileIndex >= 0
|
||||
/// @return The tile ID or 0 on error.
|
||||
int NWNX_Tileset_GetTilesetGroupTile(int nIndex);
|
||||
int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex);
|
||||
|
||||
/// @brief Get the model name of a tile in sTileset.
|
||||
/// @param sTileset The tileset.
|
||||
@@ -165,207 +166,174 @@ void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex);
|
||||
|
||||
struct NWNX_Tileset_TilesetData NWNX_Tileset_GetTilesetData(string sTileset)
|
||||
{
|
||||
string sFunc = "GetTilesetData";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTilesetData");
|
||||
|
||||
struct NWNX_Tileset_TilesetData str;
|
||||
str.bHasHeightTransition = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.bInterior = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.sUnlocalizedName = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.nDisplayNameStrRef = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.sFloorTerrain = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sDefaultTerrain = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sBorderTerrain = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.nNumGroups = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.nNumCrossers = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.nNumTerrain = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.fHeightTransition = NWNX_GetReturnValueFloat(NWNX_Tileset, sFunc);
|
||||
str.nNumTileData = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.bHasHeightTransition = NWNX_GetReturnValueInt();
|
||||
str.bInterior = NWNX_GetReturnValueInt();
|
||||
str.sUnlocalizedName = NWNX_GetReturnValueString();
|
||||
str.nDisplayNameStrRef = NWNX_GetReturnValueInt();
|
||||
str.sFloorTerrain = NWNX_GetReturnValueString();
|
||||
str.sDefaultTerrain = NWNX_GetReturnValueString();
|
||||
str.sBorderTerrain = NWNX_GetReturnValueString();
|
||||
str.nNumGroups = NWNX_GetReturnValueInt();
|
||||
str.nNumCrossers = NWNX_GetReturnValueInt();
|
||||
str.nNumTerrain = NWNX_GetReturnValueInt();
|
||||
str.fHeightTransition = NWNX_GetReturnValueFloat();
|
||||
str.nNumTileData = NWNX_GetReturnValueInt();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
string NWNX_Tileset_GetTilesetTerrain(string sTileset, int nIndex)
|
||||
{
|
||||
string sFunc = "GetTilesetTerrain";
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTilesetTerrain");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex)
|
||||
{
|
||||
string sFunc = "GetTilesetCrosser";
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTilesetCrosser");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
struct NWNX_Tileset_TilesetGroupData NWNX_Tileset_GetTilesetGroupData(string sTileset, int nIndex)
|
||||
{
|
||||
string sFunc = "GetTilesetGroupData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupData");
|
||||
|
||||
struct NWNX_Tileset_TilesetGroupData str;
|
||||
str.nColumns = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.nRows = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.nStrRef = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.sName = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.nColumns = NWNX_GetReturnValueInt();
|
||||
str.nRows = NWNX_GetReturnValueInt();
|
||||
str.nStrRef = NWNX_GetReturnValueInt();
|
||||
str.sName = NWNX_GetReturnValueString();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int NWNX_Tileset_GetTilesetGroupTile(int nIndex)
|
||||
int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex)
|
||||
{
|
||||
string sFunc = "GetTilesetGroupTile";
|
||||
NWNX_PushArgumentInt(nTileIndex);
|
||||
NWNX_PushArgumentInt(nGroupIndex);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupTile");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Tileset_GetTileModel(string sTileset, int nTileID)
|
||||
{
|
||||
string sFunc = "GetTileModel";
|
||||
NWNX_PushArgumentInt(nTileID);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTileModel");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nTileID);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Tileset_GetTileMinimapTexture(string sTileset, int nTileID)
|
||||
{
|
||||
string sFunc = "GetTileMinimapTexture";
|
||||
NWNX_PushArgumentInt(nTileID);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTileMinimapTexture");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nTileID);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
struct NWNX_Tileset_TileEdgesAndCorners NWNX_Tileset_GetTileEdgesAndCorners(string sTileset, int nTileID)
|
||||
{
|
||||
string sFunc = "GetTileEdgesAndCorners";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nTileID);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(nTileID);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTileEdgesAndCorners");
|
||||
|
||||
struct NWNX_Tileset_TileEdgesAndCorners str;
|
||||
str.sLeft = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sBottomLeft = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sBottom = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sBottomRight = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sRight = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sTopRight = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sTop = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sTopLeft = NWNX_GetReturnValueString(NWNX_Tileset, sFunc);
|
||||
str.sLeft = NWNX_GetReturnValueString();
|
||||
str.sBottomLeft = NWNX_GetReturnValueString();
|
||||
str.sBottom = NWNX_GetReturnValueString();
|
||||
str.sBottomRight = NWNX_GetReturnValueString();
|
||||
str.sRight = NWNX_GetReturnValueString();
|
||||
str.sTopRight = NWNX_GetReturnValueString();
|
||||
str.sTop = NWNX_GetReturnValueString();
|
||||
str.sTopLeft = NWNX_GetReturnValueString();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int NWNX_Tileset_GetTileNumDoors(string sTileset, int nTileID)
|
||||
{
|
||||
string sFunc = "GetTileNumDoors";
|
||||
NWNX_PushArgumentInt(nTileID);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTileNumDoors");
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nTileID);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
struct NWNX_Tileset_TileDoorData NWNX_Tileset_GetTileDoorData(string sTileset, int nTileID, int nIndex = 0)
|
||||
{
|
||||
string sFunc = "GetTileDoorData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nTileID);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentInt(nTileID);
|
||||
NWNX_PushArgumentString(sTileset);
|
||||
NWNX_CallFunction(NWNX_Tileset, "GetTileDoorData");
|
||||
|
||||
struct NWNX_Tileset_TileDoorData str;
|
||||
str.fOrientation = NWNX_GetReturnValueFloat(NWNX_Tileset, sFunc);
|
||||
str.fZ = NWNX_GetReturnValueFloat(NWNX_Tileset, sFunc);
|
||||
str.fY = NWNX_GetReturnValueFloat(NWNX_Tileset, sFunc);
|
||||
str.fX = NWNX_GetReturnValueFloat(NWNX_Tileset, sFunc);
|
||||
str.nType = NWNX_GetReturnValueInt(NWNX_Tileset, sFunc);
|
||||
str.fOrientation = NWNX_GetReturnValueFloat();
|
||||
str.fZ = NWNX_GetReturnValueFloat();
|
||||
str.fY = NWNX_GetReturnValueFloat();
|
||||
str.fX = NWNX_GetReturnValueFloat();
|
||||
str.nType = NWNX_GetReturnValueInt();
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
void NWNX_Tileset_SetAreaTileOverride(string sAreaResRef, string sOverrideName)
|
||||
{
|
||||
string sFunc = "SetAreaTileOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sOverrideName);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sAreaResRef);
|
||||
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentString(sOverrideName);
|
||||
NWNX_PushArgumentString(sAreaResRef);
|
||||
NWNX_CallFunction(NWNX_Tileset, "SetAreaTileOverride");
|
||||
}
|
||||
|
||||
void NWNX_Tileset_CreateTileOverride(string sOverrideName, string sTileSet, int nWidth, int nHeight)
|
||||
{
|
||||
string sFunc = "CreateTileOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nHeight);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nWidth);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sTileSet);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sOverrideName);
|
||||
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(nHeight);
|
||||
NWNX_PushArgumentInt(nWidth);
|
||||
NWNX_PushArgumentString(sTileSet);
|
||||
NWNX_PushArgumentString(sOverrideName);
|
||||
NWNX_CallFunction(NWNX_Tileset, "CreateTileOverride");
|
||||
}
|
||||
|
||||
void NWNX_Tileset_DeleteTileOverride(string sOverrideName)
|
||||
{
|
||||
string sFunc = "DeleteTileOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sOverrideName);
|
||||
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentString(sOverrideName);
|
||||
NWNX_CallFunction(NWNX_Tileset, "DeleteTileOverride");
|
||||
}
|
||||
|
||||
void NWNX_Tileset_SetOverrideTileData(string sOverrideName, int nIndex, struct NWNX_Tileset_CustomTileData strCustomTileData)
|
||||
{
|
||||
string sFunc = "SetOverrideTileData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.bAnimLoop3);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.bAnimLoop2);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.bAnimLoop1);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nSourceLightColor2);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nSourceLightColor1);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nMainLightColor2);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nMainLightColor1);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nHeight);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nOrientation);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, strCustomTileData.nTileID);
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sOverrideName);
|
||||
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(strCustomTileData.bAnimLoop3);
|
||||
NWNX_PushArgumentInt(strCustomTileData.bAnimLoop2);
|
||||
NWNX_PushArgumentInt(strCustomTileData.bAnimLoop1);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor2);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor1);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nMainLightColor2);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nMainLightColor1);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nHeight);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nOrientation);
|
||||
NWNX_PushArgumentInt(strCustomTileData.nTileID);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentString(sOverrideName);
|
||||
NWNX_CallFunction(NWNX_Tileset, "SetOverrideTileData");
|
||||
}
|
||||
|
||||
void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex)
|
||||
{
|
||||
string sFunc = "DeleteOverrideTileData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Tileset, sFunc, nIndex);
|
||||
NWNX_PushArgumentString(NWNX_Tileset, sFunc, sOverrideName);
|
||||
|
||||
NWNX_CallFunction(NWNX_Tileset, sFunc);
|
||||
NWNX_PushArgumentInt(nIndex);
|
||||
NWNX_PushArgumentString(sOverrideName);
|
||||
NWNX_CallFunction(NWNX_Tileset, "DeleteOverrideTileData");
|
||||
}
|
||||
|
@@ -3,17 +3,22 @@
|
||||
/// @{
|
||||
/// @file nwnx_time.nss
|
||||
#include "nwnx"
|
||||
#include "nwnx_util"
|
||||
#include "inc_sqlite_time"
|
||||
|
||||
const string NWNX_Time = "NWNX_Time"; ///< @private
|
||||
|
||||
/// @brief Returns the current date.
|
||||
/// @deprecated Use SQLite functions (see inc_sqlite_time). This will be removed in future NWNX releases.
|
||||
/// @return The date in the format (mm/dd/yyyy).
|
||||
string NWNX_Time_GetSystemDate();
|
||||
|
||||
/// @brief Returns current time.
|
||||
/// @deprecated Use SQLite functions (see inc_sqlite_time). This will be removed in future NWNX releases.
|
||||
/// @return The current time in the format (24:mm:ss).
|
||||
string NWNX_Time_GetSystemTime();
|
||||
|
||||
/// @deprecated Use SQLite functions (see inc_sqlite_time). This will be removed in future NWNX releases.
|
||||
/// @return Returns the number of seconds since midnight on January 1, 1970.
|
||||
int NWNX_Time_GetTimeStamp();
|
||||
|
||||
@@ -24,6 +29,7 @@ struct NWNX_Time_HighResTimestamp
|
||||
int microseconds; ///< Microseconds
|
||||
};
|
||||
|
||||
/// @deprecated Use NWNX_Util_GetHighResTimeStamp(). This will be removed in future NWNX releases.
|
||||
/// @return Returns the number of microseconds since midnight on January 1, 1970.
|
||||
struct NWNX_Time_HighResTimestamp NWNX_Time_GetHighResTimeStamp();
|
||||
|
||||
@@ -31,33 +37,28 @@ struct NWNX_Time_HighResTimestamp NWNX_Time_GetHighResTimeStamp();
|
||||
|
||||
string NWNX_Time_GetSystemDate()
|
||||
{
|
||||
string sFunc = "GetSystemDate";
|
||||
NWNX_CallFunction(NWNX_Time, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Time, sFunc);
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Time is deprecated. You should migrate to SQLite based functions (see inc_sqlite_time).");
|
||||
return SQLite_GetSystemDate();
|
||||
}
|
||||
|
||||
string NWNX_Time_GetSystemTime()
|
||||
{
|
||||
string sFunc = "GetSystemTime";
|
||||
NWNX_CallFunction(NWNX_Time, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Time, sFunc);
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Time is deprecated. You should migrate to SQLite based functions (see inc_sqlite_time).");
|
||||
return SQLite_GetSystemTime();
|
||||
}
|
||||
|
||||
int NWNX_Time_GetTimeStamp()
|
||||
{
|
||||
string sFunc = "GetTimeStamp";
|
||||
|
||||
NWNX_CallFunction(NWNX_Time, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Time, sFunc);
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Time is deprecated. You should migrate to SQLite based functions (see inc_sqlite_time).");
|
||||
return SQLite_GetTimeStamp();
|
||||
}
|
||||
|
||||
struct NWNX_Time_HighResTimestamp NWNX_Time_GetHighResTimeStamp()
|
||||
{
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Time is deprecated. NWNX_Time_GetHighResTimeStamp is moving to NWNX_Util.");
|
||||
struct NWNX_Util_HighResTimestamp u = NWNX_Util_GetHighResTimeStamp();
|
||||
struct NWNX_Time_HighResTimestamp t;
|
||||
string sFunc = "GetHighResTimeStamp";
|
||||
|
||||
NWNX_CallFunction(NWNX_Time, sFunc);
|
||||
t.microseconds = NWNX_GetReturnValueInt(NWNX_Time, sFunc);
|
||||
t.seconds = NWNX_GetReturnValueInt(NWNX_Time, sFunc);
|
||||
t.seconds = u.seconds;
|
||||
t.microseconds = u.microseconds;
|
||||
return t;
|
||||
}
|
||||
|
@@ -35,6 +35,13 @@ struct NWNX_Util_WorldTime
|
||||
int nTimeOfDay; ///< The time of day
|
||||
};
|
||||
|
||||
/// @brief A high resolution timestamp
|
||||
struct NWNX_Util_HighResTimestamp
|
||||
{
|
||||
int seconds; ///< Seconds since epoch
|
||||
int microseconds; ///< Microseconds
|
||||
};
|
||||
|
||||
/// @brief Gets the name of the currently executing script.
|
||||
/// @note If depth is > 0, it will return the name of the script that called this one via ExecuteScript().
|
||||
/// @param depth to seek the executing script.
|
||||
@@ -51,6 +58,14 @@ string NWNX_Util_GetAsciiTableString();
|
||||
/// @return The hashed string as an integer.
|
||||
int NWNX_Util_Hash(string str);
|
||||
|
||||
/// @brief Gets the last modified timestamp (mtime) of the module file in seconds.
|
||||
/// @return The mtime of the module file.
|
||||
int NWNX_Util_GetModuleMtime();
|
||||
|
||||
/// @brief Gets the module short file name.
|
||||
/// @return The module file as a string.
|
||||
string NWNX_Util_GetModuleFile();
|
||||
|
||||
/// @brief Gets the value of customTokenNumber.
|
||||
/// @param customTokenNumber The token number to query.
|
||||
/// @return The string representation of the token value.
|
||||
@@ -61,7 +76,6 @@ string NWNX_Util_GetCustomToken(int customTokenNumber);
|
||||
/// @return The converted itemproperty.
|
||||
itemproperty NWNX_Util_EffectToItemProperty(effect e);
|
||||
|
||||
///
|
||||
/// @brief Convert an itemproperty type to an effect type.
|
||||
/// @param ip The itemproperty to convert to an effect.
|
||||
/// @return The converted effect.
|
||||
@@ -72,12 +86,6 @@ effect NWNX_Util_ItemPropertyToEffect(itemproperty ip);
|
||||
/// @return The new string without any color codes.
|
||||
string NWNX_Util_StripColors(string str);
|
||||
|
||||
/// @brief Determines if the supplied resref exists.
|
||||
/// @param resref The resref to check.
|
||||
/// @param type The @ref resref_types "Resref Type".
|
||||
/// @return TRUE/FALSE
|
||||
int NWNX_Util_IsValidResRef(string resref, int type = NWNX_UTIL_RESREF_TYPE_CREATURE);
|
||||
|
||||
/// @brief Retrieves an environment variable.
|
||||
/// @param sVarname The environment variable to query.
|
||||
/// @return The value of the environment variable.
|
||||
@@ -97,12 +105,6 @@ void NWNX_Util_SetMinutesPerHour(int minutes);
|
||||
/// @return The url encoded string.
|
||||
string NWNX_Util_EncodeStringForURL(string str);
|
||||
|
||||
/// @anchor twoda_row_count
|
||||
/// @brief Gets the row count for a 2da.
|
||||
/// @param str The 2da to check (do not include the .2da).
|
||||
/// @return The amount of rows in the 2da.
|
||||
int NWNX_Util_Get2DARowCount(string str);
|
||||
|
||||
/// @brief Get the first resref of nType.
|
||||
/// @param nType A @ref resref_types "Resref Type".
|
||||
/// @param sRegexFilter Lets you filter out resrefs using a regexfilter.
|
||||
@@ -116,11 +118,6 @@ string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter = "", int bModule
|
||||
/// @return The next resref found or "" if none is found.
|
||||
string NWNX_Util_GetNextResRef();
|
||||
|
||||
/// @brief Get the ticks per second of the server.
|
||||
/// @remark Useful to dynamically detect lag and adjust behavior accordingly.
|
||||
/// @return The ticks per second.
|
||||
int NWNX_Util_GetServerTicksPerSecond();
|
||||
|
||||
/// @brief Get the last created object.
|
||||
/// @param nObjectType Does not take the NWScript OBJECT_TYPE_* constants.
|
||||
/// Use NWNX_Consts_TranslateNWScriptObjectType() to get their NWNX equivalent.
|
||||
@@ -137,12 +134,6 @@ object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast = 1);
|
||||
/// @return "" on success, or the compilation error.
|
||||
string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain = FALSE, string sAlias = "NWNX");
|
||||
|
||||
/// @brief Gets the contents of a .nss script file as a string.
|
||||
/// @param sScriptName The name of the script to get the contents of.
|
||||
/// @param nMaxLength The max length of the return string, -1 to get everything
|
||||
/// @return The script file contents or "" on error.
|
||||
string NWNX_Util_GetNSSContents(string sScriptName, int nMaxLength = -1);
|
||||
|
||||
/// @brief Adds a nss file to the UserDirectory/nwnx folder, or to the location of sAlias.
|
||||
/// @note Will override existing nss files that are in the module
|
||||
/// @param sFileName The script filename without extension, 16 or less characters.
|
||||
@@ -241,91 +232,125 @@ void NWNX_Util_SetDawnHour(int nDawnHour);
|
||||
/// @param nDuskHour The new dusk hour
|
||||
void NWNX_Util_SetDuskHour(int nDuskHour);
|
||||
|
||||
/// @return Returns the number of microseconds since midnight on January 1, 1970.
|
||||
struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp();
|
||||
|
||||
/// @return Return name of a terminal, "" if not a TTY
|
||||
string NWNX_Util_GetTTY();
|
||||
|
||||
/// @brief Set the currently running script event.
|
||||
/// @param nEventID The ID of the event.
|
||||
void NWNX_Util_SetCurrentlyRunningEvent(int nEventID);
|
||||
|
||||
/// @brief Calculate the levenshtein distance of two strings
|
||||
/// @param sString The string to compare with.
|
||||
/// @param sCompareTo The string to compare sString to.
|
||||
/// @return The number of characters different between the compared strings.
|
||||
int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo);
|
||||
|
||||
/// @brief Sends a full object update of oObjectToUpdate to all clients
|
||||
/// @param oObjectToUpdate The object to update
|
||||
/// @param oPlayer The player for which the objects needs to update, OBJECT_INVALID for all players
|
||||
void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer = OBJECT_INVALID);
|
||||
|
||||
/// @brief Clean a resource directory, deleting all files of nResType.
|
||||
/// @param sAlias A resource directory alias, NWNX or one defined in the custom resource directory file.
|
||||
/// @param nResType The type of file to delete or 0xFFFF for all types.
|
||||
/// @return TRUE if successful, FALSE on error.
|
||||
int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF);
|
||||
|
||||
/// @brief Return the filename of the tlk file.
|
||||
/// @return The name
|
||||
string NWNX_Util_GetModuleTlkFile();
|
||||
|
||||
/// @}
|
||||
|
||||
string NWNX_Util_GetCurrentScriptName(int depth = 0)
|
||||
{
|
||||
string sFunc = "GetCurrentScriptName";
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, depth);
|
||||
NWNX_PushArgumentInt(depth);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetAsciiTableString()
|
||||
{
|
||||
string sFunc = "GetAsciiTableString";
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Util_Hash(string str)
|
||||
{
|
||||
string sFunc = "Hash";
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, str);
|
||||
NWNX_PushArgumentString(str);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Util_GetModuleMtime()
|
||||
{
|
||||
NWNX_CallFunction(NWNX_Util, "GetModuleMtime");
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetModuleFile()
|
||||
{
|
||||
NWNX_CallFunction(NWNX_Util, "GetModuleFile");
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetCustomToken(int customTokenNumber)
|
||||
{
|
||||
string sFunc = "GetCustomToken";
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, customTokenNumber);
|
||||
NWNX_PushArgumentInt(customTokenNumber);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
itemproperty NWNX_Util_EffectToItemProperty(effect e)
|
||||
{
|
||||
string sFunc = "EffectTypeCast";
|
||||
NWNX_PushArgumentEffect(NWNX_Util, sFunc, e);
|
||||
NWNX_PushArgumentEffect(e);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueItemProperty(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueItemProperty();
|
||||
}
|
||||
|
||||
effect NWNX_Util_ItemPropertyToEffect(itemproperty ip)
|
||||
{
|
||||
string sFunc = "EffectTypeCast";
|
||||
NWNX_PushArgumentItemProperty(NWNX_Util, sFunc, ip);
|
||||
NWNX_PushArgumentItemProperty(ip);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueEffect(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueEffect();
|
||||
}
|
||||
|
||||
string NWNX_Util_StripColors(string str)
|
||||
{
|
||||
string sFunc = "StripColors";
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, str);
|
||||
NWNX_PushArgumentString(str);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_IsValidResRef(string resref, int type = NWNX_UTIL_RESREF_TYPE_CREATURE)
|
||||
{
|
||||
string sFunc = "IsValidResRef";
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, type);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, resref);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetEnvironmentVariable(string sVarname)
|
||||
{
|
||||
string sFunc = "GetEnvironmentVariable";
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sVarname);
|
||||
NWNX_PushArgumentString(sVarname);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Util_GetMinutesPerHour()
|
||||
{
|
||||
string sFunc = "GetMinutesPerHour";
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetMinutesPerHour(int minutes)
|
||||
{
|
||||
string sFunc = "SetMinutesPerHour";
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, minutes);
|
||||
NWNX_PushArgumentInt(minutes);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -333,30 +358,22 @@ string NWNX_Util_EncodeStringForURL(string sURL)
|
||||
{
|
||||
string sFunc = "EncodeStringForURL";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sURL);
|
||||
NWNX_PushArgumentString(sURL);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_Get2DARowCount(string str)
|
||||
{
|
||||
string sFunc = "Get2DARowCount";
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, str);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter = "", int bModuleResourcesOnly = TRUE)
|
||||
{
|
||||
string sFunc = "GetFirstResRef";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, bModuleResourcesOnly);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sRegexFilter);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nType);
|
||||
NWNX_PushArgumentInt(bModuleResourcesOnly);
|
||||
NWNX_PushArgumentString(sRegexFilter);
|
||||
NWNX_PushArgumentInt(nType);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetNextResRef()
|
||||
@@ -365,82 +382,62 @@ string NWNX_Util_GetNextResRef()
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_GetServerTicksPerSecond()
|
||||
{
|
||||
string sFunc = "GetServerTicksPerSecond";
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast = 1)
|
||||
{
|
||||
string sFunc = "GetLastCreatedObject";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nNthLast);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nObjectType);
|
||||
NWNX_PushArgumentInt(nNthLast);
|
||||
NWNX_PushArgumentInt(nObjectType);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain = FALSE, string sAlias = "NWNX")
|
||||
{
|
||||
string sFunc = "AddScript";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sAlias);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, bWrapIntoMain);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sScriptData);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sFileName);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_PushArgumentInt(bWrapIntoMain);
|
||||
NWNX_PushArgumentString(sScriptData);
|
||||
NWNX_PushArgumentString(sFileName);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
string NWNX_Util_GetNSSContents(string sScriptName, int nMaxLength = -1)
|
||||
{
|
||||
string sFunc = "GetNSSContents";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nMaxLength);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sScriptName);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Util_AddNSSFile(string sFileName, string sContents, string sAlias = "NWNX")
|
||||
{
|
||||
string sFunc = "AddNSSFile";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sAlias);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sContents);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sFileName);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_PushArgumentString(sContents);
|
||||
NWNX_PushArgumentString(sFileName);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Util_RemoveNWNXResourceFile(string sFileName, int nType, string sAlias = "NWNX")
|
||||
{
|
||||
string sFunc = "RemoveNWNXResourceFile";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sAlias);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nType);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sFileName);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_PushArgumentInt(nType);
|
||||
NWNX_PushArgumentString(sFileName);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetInstructionLimit(int nInstructionLimit)
|
||||
{
|
||||
string sFunc = "SetInstructionLimit";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nInstructionLimit);
|
||||
NWNX_PushArgumentInt(nInstructionLimit);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -450,14 +447,14 @@ int NWNX_Util_GetInstructionLimit()
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetInstructionsExecuted(int nInstructions)
|
||||
{
|
||||
string sFunc = "SetInstructionsExecuted";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nInstructions);
|
||||
NWNX_PushArgumentInt(nInstructions);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -467,41 +464,39 @@ int NWNX_Util_GetInstructionsExecuted()
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk)
|
||||
{
|
||||
string sFunc = "RegisterServerConsoleCommand";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sScriptChunk);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sCommand);
|
||||
NWNX_PushArgumentString(sScriptChunk);
|
||||
NWNX_PushArgumentString(sCommand);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_UnregisterServerConsoleCommand(string sCommand)
|
||||
{
|
||||
string sFunc = "UnregisterServerConsoleCommand";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sCommand);
|
||||
NWNX_PushArgumentString(sCommand);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_PluginExists(string sPlugin)
|
||||
{
|
||||
string sFunc = "PluginExists";
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sPlugin);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
WriteTimestampedLogEntry("WARNING: NWNX_Util_PluginExists is deprecated. You should migrate to NWNX_PluginExists.");
|
||||
return NWNX_PluginExists(sPlugin);
|
||||
}
|
||||
|
||||
string NWNX_Util_GetUserDirectory()
|
||||
{
|
||||
string sFunc = "GetUserDirectory";
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Util_GetScriptReturnValue()
|
||||
@@ -510,7 +505,7 @@ int NWNX_Util_GetScriptReturnValue()
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag = "", int nAppearanceType = -1)
|
||||
@@ -519,24 +514,24 @@ object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag
|
||||
|
||||
vector vPosition = GetPositionFromLocation(locLocation);
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nAppearanceType);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sNewTag);
|
||||
NWNX_PushArgumentFloat(NWNX_Util, sFunc, GetFacingFromLocation(locLocation));
|
||||
NWNX_PushArgumentFloat(NWNX_Util, sFunc, vPosition.z);
|
||||
NWNX_PushArgumentFloat(NWNX_Util, sFunc, vPosition.y);
|
||||
NWNX_PushArgumentFloat(NWNX_Util, sFunc, vPosition.x);
|
||||
NWNX_PushArgumentObject(NWNX_Util, sFunc, GetAreaFromLocation(locLocation));
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sResRef);
|
||||
NWNX_PushArgumentInt(nAppearanceType);
|
||||
NWNX_PushArgumentString(sNewTag);
|
||||
NWNX_PushArgumentFloat(GetFacingFromLocation(locLocation));
|
||||
NWNX_PushArgumentFloat(vPosition.z);
|
||||
NWNX_PushArgumentFloat(vPosition.y);
|
||||
NWNX_PushArgumentFloat(vPosition.x);
|
||||
NWNX_PushArgumentObject(GetAreaFromLocation(locLocation));
|
||||
NWNX_PushArgumentString(sResRef);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueObject(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueObject();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetItemActivator(object oObject)
|
||||
{
|
||||
string sFunc = "SetItemActivator";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Util, sFunc, oObject);
|
||||
NWNX_PushArgumentObject(oObject);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -544,12 +539,12 @@ struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment = 0.0f)
|
||||
{
|
||||
string sFunc = "GetWorldTime";
|
||||
|
||||
NWNX_PushArgumentFloat(NWNX_Util, sFunc, fAdjustment);
|
||||
NWNX_PushArgumentFloat(fAdjustment);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
struct NWNX_Util_WorldTime strWorldTime;
|
||||
strWorldTime.nTimeOfDay = NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
strWorldTime.nCalendarDay = NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
strWorldTime.nTimeOfDay = NWNX_GetReturnValueInt();
|
||||
strWorldTime.nCalendarDay = NWNX_GetReturnValueInt();
|
||||
|
||||
return strWorldTime;
|
||||
}
|
||||
@@ -558,9 +553,9 @@ void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewNam
|
||||
{
|
||||
string sFunc = "SetResourceOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sNewName);
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sOldName);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nResType);
|
||||
NWNX_PushArgumentString(sNewName);
|
||||
NWNX_PushArgumentString(sOldName);
|
||||
NWNX_PushArgumentInt(nResType);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -568,28 +563,28 @@ string NWNX_Util_GetResourceOverride(int nResType, string sName)
|
||||
{
|
||||
string sFunc = "GetResourceOverride";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sName);
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nResType);
|
||||
NWNX_PushArgumentString(sName);
|
||||
NWNX_PushArgumentInt(nResType);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueString(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
int NWNX_Util_GetScriptParamIsSet(string sParamName)
|
||||
{
|
||||
string sFunc = "GetScriptParamIsSet";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Util, sFunc, sParamName);
|
||||
NWNX_PushArgumentString(sParamName);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetDawnHour(int nDawnHour)
|
||||
{
|
||||
string sFunc = "SetDawnHour";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nDawnHour);
|
||||
NWNX_PushArgumentInt(nDawnHour);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
@@ -597,6 +592,68 @@ void NWNX_Util_SetDuskHour(int nDuskHour)
|
||||
{
|
||||
string sFunc = "SetDuskHour";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Util, sFunc, nDuskHour);
|
||||
NWNX_PushArgumentInt(nDuskHour);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp()
|
||||
{
|
||||
struct NWNX_Util_HighResTimestamp t;
|
||||
string sFunc = "GetHighResTimeStamp";
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
t.microseconds = NWNX_GetReturnValueInt();
|
||||
t.seconds = NWNX_GetReturnValueInt();
|
||||
return t;
|
||||
}
|
||||
|
||||
string NWNX_Util_GetTTY()
|
||||
{
|
||||
string sFunc = "GetTTY";
|
||||
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
||||
void NWNX_Util_SetCurrentlyRunningEvent(int nEventID)
|
||||
{
|
||||
string sFunc = "SetCurrentlyRunningEvent";
|
||||
|
||||
NWNX_PushArgumentInt(nEventID);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo)
|
||||
{
|
||||
string sFunc = "LevenshteinDistance";
|
||||
|
||||
NWNX_PushArgumentString(sCompareTo);
|
||||
NWNX_PushArgumentString(sString);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer = OBJECT_INVALID)
|
||||
{
|
||||
string sFunc = "UpdateClientObject";
|
||||
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_PushArgumentObject(oObjectToUpdate);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF)
|
||||
{
|
||||
string sFunc = "CleanResourceDirectory";
|
||||
NWNX_PushArgumentInt(nResType);
|
||||
NWNX_PushArgumentString(sAlias);
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
string NWNX_Util_GetModuleTlkFile()
|
||||
{
|
||||
string sFunc = "GetModuleTlkFile";
|
||||
NWNX_CallFunction(NWNX_Util, sFunc);
|
||||
return NWNX_GetReturnValueString();
|
||||
}
|
||||
|
@@ -59,19 +59,19 @@ int NWNX_Visibility_GetVisibilityOverride(object oPlayer, object oTarget)
|
||||
{
|
||||
string sFunc = "GetVisibilityOverride";
|
||||
|
||||
NWNX_PushArgumentObject(NWNX_Visibility, sFunc, oTarget);
|
||||
NWNX_PushArgumentObject(NWNX_Visibility, sFunc, oPlayer);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Visibility, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Visibility, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Visibility_SetVisibilityOverride(object oPlayer, object oTarget, int nOverride)
|
||||
{
|
||||
string sFunc = "SetVisibilityOverride";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Visibility, sFunc, nOverride);
|
||||
NWNX_PushArgumentObject(NWNX_Visibility, sFunc, oTarget);
|
||||
NWNX_PushArgumentObject(NWNX_Visibility, sFunc, oPlayer);
|
||||
NWNX_PushArgumentInt(nOverride);
|
||||
NWNX_PushArgumentObject(oTarget);
|
||||
NWNX_PushArgumentObject(oPlayer);
|
||||
NWNX_CallFunction(NWNX_Visibility, sFunc);
|
||||
}
|
||||
|
@@ -93,8 +93,8 @@ void NWNX_Weapon_SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat);
|
||||
void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat);
|
||||
|
||||
/// @brief Set base item as monk weapon.
|
||||
/// @note Requires activation of CombatModes plugin for Flurry of Blows.
|
||||
/// @param nBaseItem The base item id.
|
||||
/// @deprecated Use baseitems.2da. This will be removed in future NWNX releases.
|
||||
void NWNX_Weapon_SetWeaponIsMonkWeapon(int nBaseItem);
|
||||
|
||||
/// @brief Set plugin options.
|
||||
@@ -126,14 +126,22 @@ void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist =
|
||||
/// @return FALSE/0 if weapon is not receiving the bonus. TRUE/1 if it does.
|
||||
int NWNX_Weapon_GetOneHalfStrength(object oWeapon);
|
||||
|
||||
/// @brief Override the max attack distance of ranged weapons.
|
||||
/// @param nBaseItem The baseitem id.
|
||||
/// @param fMax The maximum attack distance. Default is 40.0f.
|
||||
/// @param fMaxPassive The maximum passive attack distance. Default is 20.0f. Seems to be used by the engine to determine a new nearby target when needed.
|
||||
/// @param fPreferred The preferred attack distance. See the PrefAttackDist column in baseitems.2da, default seems to be 30.0f for ranged weapons.
|
||||
/// @note fMaxPassive should probably be lower than fMax, half of fMax seems to be a good start. fPreferred should be at least ~0.5f lower than fMax.
|
||||
void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred);
|
||||
|
||||
/// @}
|
||||
|
||||
void NWNX_Weapon_SetWeaponFocusFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetWeaponFocusFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -142,8 +150,8 @@ void NWNX_Weapon_SetEpicWeaponFocusFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetEpicWeaponFocusFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -152,8 +160,8 @@ void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetGreaterWeaponFocusFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -162,8 +170,8 @@ void NWNX_Weapon_SetWeaponFinesseSize(int nBaseItem, int nSize)
|
||||
{
|
||||
string sFunc = "SetWeaponFinesseSize";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nSize);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nSize);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -172,27 +180,29 @@ int NWNX_Weapon_GetWeaponFinesseSize(int nBaseItem)
|
||||
{
|
||||
string sFunc = "GetWeaponFinesseSize";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Weapon, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Weapon_SetWeaponUnarmed(int nBaseItem)
|
||||
{
|
||||
string sFunc = "SetWeaponUnarmed";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
|
||||
void NWNX_Weapon_SetWeaponIsMonkWeapon(int nBaseItem)
|
||||
{
|
||||
WriteTimestampedLogEntry("NWNX_Weapon_SetWeaponIsMonkWeapon() is deprecated. Please use baseitems.2da instead.");
|
||||
|
||||
string sFunc = "SetWeaponIsMonkWeapon";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -201,8 +211,8 @@ void NWNX_Weapon_SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetWeaponImprovedCriticalFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -211,8 +221,8 @@ void NWNX_Weapon_SetWeaponSpecializationFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetWeaponSpecializationFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -221,8 +231,8 @@ void NWNX_Weapon_SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetGreaterWeaponSpecializationFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -231,8 +241,8 @@ void NWNX_Weapon_SetEpicWeaponSpecializationFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetEpicWeaponSpecializationFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -241,8 +251,8 @@ void NWNX_Weapon_SetEpicWeaponOverwhelmingCriticalFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetEpicWeaponOverwhelmingCriticalFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -251,8 +261,8 @@ void NWNX_Weapon_SetEpicWeaponDevastatingCriticalFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetEpicWeaponDevastatingCriticalFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -261,8 +271,8 @@ void NWNX_Weapon_SetWeaponOfChoiceFeat(int nBaseItem, int nFeat)
|
||||
{
|
||||
string sFunc = "SetWeaponOfChoiceFeat";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);
|
||||
NWNX_PushArgumentInt(nFeat);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -271,8 +281,8 @@ void NWNX_Weapon_SetOption(int nOption, int nVal)
|
||||
{
|
||||
string sFunc = "SetOption";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nVal);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nOption);
|
||||
NWNX_PushArgumentInt(nVal);
|
||||
NWNX_PushArgumentInt(nOption);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -281,7 +291,7 @@ void NWNX_Weapon_SetDevastatingCriticalEventScript(string sScript)
|
||||
{
|
||||
string sFunc = "SetDevastatingCriticalEventScript";
|
||||
|
||||
NWNX_PushArgumentString(NWNX_Weapon, sFunc, sScript);
|
||||
NWNX_PushArgumentString(sScript);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -290,8 +300,8 @@ void NWNX_Weapon_BypassDevastatingCritical()
|
||||
{
|
||||
string sFunc = "SetEventData";
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, 1);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, NWNX_WEAPON_SETDATA_DC_BYPASS);
|
||||
NWNX_PushArgumentInt(1);
|
||||
NWNX_PushArgumentInt(NWNX_WEAPON_SETDATA_DC_BYPASS);
|
||||
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
@@ -301,12 +311,12 @@ struct NWNX_Weapon_DevastatingCriticalEvent_Data NWNX_Weapon_GetDevastatingCriti
|
||||
string sFunc = "GetEventData";
|
||||
struct NWNX_Weapon_DevastatingCriticalEvent_Data data;
|
||||
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, NWNX_WEAPON_GETDATA_DC);
|
||||
NWNX_PushArgumentInt(NWNX_WEAPON_GETDATA_DC);
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
|
||||
data.oWeapon = NWNX_GetReturnValueObject(NWNX_Weapon, sFunc);
|
||||
data.oTarget = NWNX_GetReturnValueObject(NWNX_Weapon, sFunc);
|
||||
data.nDamage = NWNX_GetReturnValueInt(NWNX_Weapon, sFunc);
|
||||
data.oWeapon = NWNX_GetReturnValueObject();
|
||||
data.oTarget = NWNX_GetReturnValueObject();
|
||||
data.nDamage = NWNX_GetReturnValueInt();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -314,17 +324,28 @@ struct NWNX_Weapon_DevastatingCriticalEvent_Data NWNX_Weapon_GetDevastatingCriti
|
||||
void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist = FALSE)
|
||||
{
|
||||
string sFunc = "SetOneHalfStrength";
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, bPersist);
|
||||
NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nEnable);
|
||||
NWNX_PushArgumentObject(NWNX_Weapon, sFunc, oWeapon);
|
||||
NWNX_PushArgumentInt(bPersist);
|
||||
NWNX_PushArgumentInt(nEnable);
|
||||
NWNX_PushArgumentObject(oWeapon);
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
|
||||
int NWNX_Weapon_GetOneHalfStrength(object oWeapon)
|
||||
{
|
||||
string sFunc = "GetOneHalfStrength";
|
||||
NWNX_PushArgumentObject(NWNX_Weapon, sFunc, oWeapon);
|
||||
NWNX_PushArgumentObject(oWeapon);
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
|
||||
return NWNX_GetReturnValueInt(NWNX_Weapon, sFunc);
|
||||
return NWNX_GetReturnValueInt();
|
||||
}
|
||||
|
||||
void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred)
|
||||
{
|
||||
string sFunc = "SetMaxRangedAttackDistanceOverride";
|
||||
|
||||
NWNX_PushArgumentFloat(fPreferred);
|
||||
NWNX_PushArgumentFloat(fMaxPassive);
|
||||
NWNX_PushArgumentFloat(fMax);
|
||||
NWNX_PushArgumentInt(nBaseItem);
|
||||
NWNX_CallFunction(NWNX_Weapon, sFunc);
|
||||
}
|
||||
|
@@ -29,11 +29,11 @@ void NWNX_WebHook_ResendWebHookHTTPS(string host, string path, string sMessage,
|
||||
void NWNX_WebHook_SendWebHookHTTPS(string host, string path, string message, string username = "", int mrkdwn = 1)
|
||||
{
|
||||
string sFunc = "SendWebHookHTTPS";
|
||||
NWNX_PushArgumentInt(NWNX_WebHook, sFunc, mrkdwn);
|
||||
NWNX_PushArgumentString(NWNX_WebHook, sFunc, username);
|
||||
NWNX_PushArgumentString(NWNX_WebHook, sFunc, message);
|
||||
NWNX_PushArgumentString(NWNX_WebHook, sFunc, path);
|
||||
NWNX_PushArgumentString(NWNX_WebHook, sFunc, host);
|
||||
NWNX_PushArgumentInt(mrkdwn);
|
||||
NWNX_PushArgumentString(username);
|
||||
NWNX_PushArgumentString(message);
|
||||
NWNX_PushArgumentString(path);
|
||||
NWNX_PushArgumentString(host);
|
||||
NWNX_CallFunction(NWNX_WebHook, sFunc);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oKiller = GetLastKiller();
|
||||
object oArea=GetArea(oKiller);
|
||||
object oWorm=GetLocalObject(oArea, "Worm");
|
||||
|
@@ -54,6 +54,7 @@ void SetCampSpawn(object oCamp, string sCamp, location lCamp)
|
||||
// Place Custom Camps Here
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
/* Horsefly Swamp Wandering Monsters
|
||||
Check for encounters at 4 a.m. (just before
|
||||
dawn), 9 a.m., noon, dusk, 9 p.m., and midnight.
|
||||
@@ -8887,7 +8888,7 @@ at night. */
|
||||
// Set Placeable 0 and Spawn Flags
|
||||
// First Placeable always Spawns at Center of Camp
|
||||
// If CampCenter Is Not Set
|
||||
SetLocalString(oCamp, "CampP0", "plc_campfrwspit");
|
||||
SetLocalString(oCamp, "CampP0", "poa_corpse001");
|
||||
SetLocalString(oCamp, "CampP0_Flags", "SP_SF");
|
||||
|
||||
// Set Placeable 1 and Spawn Flags
|
||||
|
Reference in New Issue
Block a user