Added Erdlu Animal Companion

Added Erdlu Animal Companion & NWNxEE.
This commit is contained in:
Jaysyn904 2021-07-17 11:20:01 -04:00
parent f01fa4bd76
commit 552f1686c8
143 changed files with 24397 additions and 34 deletions
nwnds_2da
nwnds_animalcomp
nwnds_compiled_mod
nwnds_module

@ -1,22 +1,22 @@
2DA V2.0
NAME BASERESREF STRREF DESCRIPTION
0 Jankx DS_AC_JANKX 16778467 16778468
1 Wolf NW_AC_WOLF 1578 5929
2 Bear NW_AC_BEAR 1580 5986
3 Boar NW_AC_BOAR 1577 5988
4 Hawk NW_AC_HAWK 5989 5990
5 Panther NW_AC_PANT 5991 5992
6 Boneclaw DS_AC_BONECLAW 16778475 16778476
7 Direwolf NW_AC_DWLF 10526 5994
8 Direrat X0_AC_DRAT0 3105 9158
9 Jhakar DS_AC_JHAKAR 16778469 16778470
10 Cobra NW_AC_COBRA 111372 16789834
11 Worg NW_AC_WORG 12820 16789835
12 SandHowler DS_AC_SANDHOWL 16778473 16778474
13 StinkBeetle NW_AC_STINKB 12409 16789837
14 Bat NW_AC_BAT 12376 16789838
15 Carru DS_AC_CARRU 16778477 16778478
16 Krenshar NW_AC_KRENSHAR 12625 16789840
17 Z'tal DS_AC_ZTAL 16778471 16778472
18 CragCat NW_AC_CRAGCAT 57919 16789842
NAME BASERESREF STRREF DESCRIPTION
0 Jankx DS_AC_JANKX 16778467 16778468
1 Wolf NW_AC_WOLF 1578 5929
2 Bear NW_AC_BEAR 1580 5986
3 Boar NW_AC_BOAR 1577 5988
4 Hawk NW_AC_HAWK 5989 5990
5 Panther NW_AC_PANT 5991 5992
6 Boneclaw DS_AC_BONECLAW 16778475 16778476
7 Direwolf NW_AC_DWLF 10526 5994
8 Direrat X0_AC_DRAT0 3105 9158
9 Jhakar DS_AC_JHAKAR 16778469 16778470
10 Cobra NW_AC_COBRA 111372 16789834
11 Worg NW_AC_WORG 12820 16789835
12 SandHowler DS_AC_SANDHOWL 16778473 16778474
13 Erdlu DS_AC_ERDLU 16778479 16778480
14 Bat NW_AC_BAT 12376 16789838
15 Carru DS_AC_CARRU 16778477 16778478
16 Krenshar NW_AC_KRENSHAR 12625 16789840
17 Z'tal DS_AC_ZTAL 16778471 16778472
18 CragCat NW_AC_CRAGCAT 57919 16789842

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,11 +1,10 @@
// This is the script dante_letodel_at
//#include "delchar_include"
//#include "aps_include"
//#include "sha_subr_consts"
#include "delchar_include"
#include "aps_include"
//void DeletePCSubRace(string sPlayer,string sCharName);
/*void main()
void main()
{
object oPlayer = GetPCSpeaker();
string sName = GetName(oPlayer);
@ -22,11 +21,10 @@
SendMessageToAllDMs("PC Player Name: "+sPlayer+" just tried to delete a character without a name.");
WriteTimestampedLogEntry("PC Player Name: "+sPlayer+" just tried to delete a character without a name.");
}
}*/
}
/* void DeletePCSubRace(string sPlayer,string sCharName)
/*void DeletePCSubRace(string sPlayer,string sCharName)
{
sPlayer = SQLEncodeSpecialChars(sPlayer);
@ -70,13 +68,10 @@
}
return;
} */
}
/* // player not found in db.. may need manual delete
SendMessageToAllDMs("Error Deleting PC from Subrace DB: Player/PC not found: " +
sPlayer + "/" + sCharName + "May need manual delete ");
return;*/
//}

Binary file not shown.

@ -18,8 +18,10 @@
/* Implementation */
/************************************/
/*void deletechar(string sPlayerName, string sCharName)
//void main (){}
void deletechar(string sPlayerName, string sCharName)
{
object oModule = GetModule();
SetLocalString(oModule, "NWNX!DELETECHAR!DELETE", sPlayerName + "?" + sCharName);
} */
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

113
nwnds_module/nwnx.nss Normal file

@ -0,0 +1,113 @@
/// @addtogroup nwnx NWNX
/// @brief Functions for plugin developers.
/// @{
/// @file nwnx.nss
/// @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);
/// @copydoc NWNX_PushArgumentInt()
void NWNX_PushArgumentFloat(string pluginName, string functionName, float value);
/// @copydoc NWNX_PushArgumentInt()
void NWNX_PushArgumentObject(string pluginName, string functionName, object value);
/// @copydoc NWNX_PushArgumentInt()
void NWNX_PushArgumentString(string pluginName, string functionName, string value);
/// @copydoc NWNX_PushArgumentInt()
void NWNX_PushArgumentEffect(string pluginName, string functionName, effect value);
/// @copydoc NWNX_PushArgumentInt()
void NWNX_PushArgumentItemProperty(string pluginName, string functionName, itemproperty 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);
/// @copydoc NWNX_GetReturnValueInt()
float NWNX_GetReturnValueFloat(string pluginName, string functionName);
/// @copydoc NWNX_GetReturnValueInt()
object NWNX_GetReturnValueObject(string pluginName, string functionName);
/// @copydoc NWNX_GetReturnValueInt()
string NWNX_GetReturnValueString(string pluginName, string functionName);
/// @copydoc NWNX_GetReturnValueInt()
effect NWNX_GetReturnValueEffect(string pluginName, string functionName);
/// @copydoc NWNX_GetReturnValueInt()
itemproperty NWNX_GetReturnValueItemProperty(string pluginName, string functionName);
/// @private
string NWNX_INTERNAL_BuildString(string pluginName, string functionName, string operation)
{
return "NWNXEE!ABIv2!" + pluginName + "!" + functionName + "!" + operation;
}
/// @}
void NWNX_CallFunction(string pluginName, string functionName)
{
PlaySound(NWNX_INTERNAL_BuildString(pluginName, functionName, "CALL"));
}
void NWNX_PushArgumentInt(string pluginName, string functionName, int value)
{
SetLocalInt(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
}
void NWNX_PushArgumentFloat(string pluginName, string functionName, float value)
{
SetLocalFloat(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
}
void NWNX_PushArgumentObject(string pluginName, string functionName, object value)
{
SetLocalObject(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
}
void NWNX_PushArgumentString(string pluginName, string functionName, string value)
{
SetLocalString(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"), value);
}
void NWNX_PushArgumentEffect(string pluginName, string functionName, effect value)
{
TagEffect(value, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"));
}
void NWNX_PushArgumentItemProperty(string pluginName, string functionName, itemproperty value)
{
TagItemProperty(value, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH"));
}
int NWNX_GetReturnValueInt(string pluginName, string functionName)
{
return GetLocalInt(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}
float NWNX_GetReturnValueFloat(string pluginName, string functionName)
{
return GetLocalFloat(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}
object NWNX_GetReturnValueObject(string pluginName, string functionName)
{
return GetLocalObject(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}
string NWNX_GetReturnValueString(string pluginName, string functionName)
{
return GetLocalString(OBJECT_INVALID, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}
effect NWNX_GetReturnValueEffect(string pluginName, string functionName)
{
effect e;
return TagEffect(e, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}
itemproperty NWNX_GetReturnValueItemProperty(string pluginName, string functionName)
{
itemproperty ip;
return TagItemProperty(ip, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"));
}

344
nwnds_module/nwnx_admin.nss Normal file

@ -0,0 +1,344 @@
/// @addtogroup admin Administration
/// @brief Various admin related functions
/// @{
/// @file nwnx_admin.nss
#include "nwnx"
const string NWNX_Administration = "NWNX_Administration"; ///< @private
/// @name Administration Options
/// @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_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
const int NWNX_ADMINISTRATION_OPTION_ENFORCE_LEGAL_CHARACTERS = 13; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_ITEM_LEVEL_RESTRICTIONS = 14; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_CDKEY_BANLIST_ALLOWLIST = 15; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_DISALLOW_SHOUTING = 16; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_SHOW_DM_JOIN_MESSAGE = 17; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_BACKUP_SAVED_CHARACTERS = 18; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_AUTO_FAIL_SAVE_ON_1 = 19; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_VALIDATE_SPELLS = 20; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_EXAMINE_EFFECTS = 21; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_EXAMINE_CHALLENGE_RATING = 22; // TRUE/FALSE
const int NWNX_ADMINISTRATION_OPTION_USE_MAX_HITPOINTS = 23; // TRUE/FALSE
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
/// @}
/// @name Administration Debug Types
/// @anchor admin_debug
///
/// @{
const int NWNX_ADMINISTRATION_DEBUG_COMBAT = 0; // TRUE/FALSE
const int NWNX_ADMINISTRATION_DEBUG_SAVING_THROW = 1; // TRUE/FALSE
const int NWNX_ADMINISTRATION_DEBUG_MOVEMENT_SPEED = 2; // TRUE/FALSE
const int NWNX_ADMINISTRATION_DEBUG_HIT_DIE = 3; // TRUE/FALSE
/// @}
/// @brief Gets the current player password.
/// @return The current player password.
string NWNX_Administration_GetPlayerPassword();
/// @brief Sets the password for players to login.
/// @param password The password to use.
void NWNX_Administration_SetPlayerPassword(string password);
/// @brief Clears the player password required to login.
void NWNX_Administration_ClearPlayerPassword();
/// @brief Gets the current DM password.
/// @return The current DM password.
string NWNX_Administration_GetDMPassword();
/// @brief Sets the password for DMs to login.
/// @param password The password to use.
void NWNX_Administration_SetDMPassword(string password);
/// @brief Signals the server to immediately shut down.
void NWNX_Administration_ShutdownServer();
/// @brief Deletes the player character from the servervault
///
/// The PC will be immediately booted from the game with a "Delete Character" message
///
/// @param oPC The player to delete.
/// @param bPreserveBackup If true, it will leave the file on server, only appending ".deleted0" to the bic filename.
/// @param sKickMessage An optional kick message, if left blank it will default to "Delete Character" as reason.
void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup = TRUE, string sKickMessage = "");
/// @brief Bans the provided IP.
/// @param ip The IP Address to ban.
void NWNX_Administration_AddBannedIP(string ip);
/// @brief Removes the ban on the provided IP.
/// @param ip The IP Address to unban.
void NWNX_Administration_RemoveBannedIP(string ip);
/// @brief Bans the provided Public CD Key.
/// @param key The Public CD Key to ban.
void NWNX_Administration_AddBannedCDKey(string key);
/// @brief Removes the ban on the provided Public CD Key.
/// @param key The Public CD Key to unban.
void NWNX_Administration_RemoveBannedCDKey(string key);
/// @brief Bans the provided playername.
/// @param playerName The player name (community name) to ban.
/// @warning A user can change their playername at will.
void NWNX_Administration_AddBannedPlayerName(string playerName);
/// @brief Removes the ban on the provided playername.
/// @param playerName The player name (community name) to unban.
void NWNX_Administration_RemoveBannedPlayerName(string playerName);
/// @brief Get a list of all banned IPs/Keys/names as a string.
/// @return A string with a listing of the banned IPs/Keys/names.
string NWNX_Administration_GetBannedList();
/// @brief Set the module's name as shown to the serverlist.
/// @param name The name to give the module.
void NWNX_Administration_SetModuleName(string name);
/// @brief Set the server's name as shown to the serverlist.
/// @param name The name to give the server.
void NWNX_Administration_SetServerName(string name);
/// @brief Returns the server's name as shown to the serverlist.
string NWNX_Administration_GetServerName();
/// @brief Get an @ref admin_opts "Administration Option" value.
/// @param option An @ref admin_opts "Administration Option".
/// @return The current setting for the supplied option from @ref admin_opts "Administration Options".
int NWNX_Administration_GetPlayOption(int option);
/// @brief Set an @ref admin_opts "Administration Options" to a value.
/// @param option The option to adjust from @ref admin_opts "Administration Options".
/// @param value The new value for the option.
void NWNX_Administration_SetPlayOption(int option, int value);
/// @brief Delete the TURD of playerName + characterName.
///
/// At times a PC may get stuck in a permanent crash loop when attempting to log
/// in. This function allows administrators to delete their Temporary User
/// Resource Data where the PC's current location is stored allowing them to log
/// into the starting area.
///
/// @param playerName The community (login name).
/// @param characterName The character name.
/// @return Returns TRUE if successful
int NWNX_Administration_DeleteTURD(string playerName, string characterName);
/// @brief Get an @ref admin_debug "Administration Debug Type" value.
/// @param type An @ref admin_debug "Administration Debug Type".
/// @return The current value for the supplied debug type from @ref admin_debug "Administration Debug Types".
int NWNX_Administration_GetDebugValue(int type);
/// @brief Set an @ref admin_debug "Administration Debug Type" to a value.
/// @param type The debug type to adjust from @ref admin_debug "Administration Debug Types".
/// @param state The new state for the debug type, TRUE or FALSE
void NWNX_Administration_SetDebugValue(int type, int state);
/// @brief Reload all rules (2da stuff etc).
/// @warning DANGER, DRAGONS. Bad things may or may not happen.
void NWNX_Administration_ReloadRules();
/// @}
string NWNX_Administration_GetPlayerPassword()
{
string sFunc = "GetPlayerPassword";
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetPlayerPassword(string password)
{
string sFunc = "SetPlayerPassword";
NWNX_PushArgumentString(NWNX_Administration, sFunc, password);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_ClearPlayerPassword()
{
string sFunc = "ClearPlayerPassword";
NWNX_CallFunction(NWNX_Administration, sFunc);
}
string NWNX_Administration_GetDMPassword()
{
string sFunc = "GetDMPassword";
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetDMPassword(string password)
{
string sFunc = "SetDMPassword";
NWNX_PushArgumentString(NWNX_Administration, sFunc, password);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_ShutdownServer()
{
string sFunc = "ShutdownServer";
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup = TRUE, string sKickMessage = "")
{
string sFunc = "DeletePlayerCharacter";
NWNX_PushArgumentString(NWNX_Administration, sFunc, sKickMessage);
NWNX_PushArgumentInt(NWNX_Administration, sFunc, bPreserveBackup);
NWNX_PushArgumentObject(NWNX_Administration, sFunc, oPC);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_AddBannedIP(string ip)
{
string sFunc = "AddBannedIP";
NWNX_PushArgumentString(NWNX_Administration, sFunc, ip);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_RemoveBannedIP(string ip)
{
string sFunc = "RemoveBannedIP";
NWNX_PushArgumentString(NWNX_Administration, sFunc, ip);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_AddBannedCDKey(string key)
{
string sFunc = "AddBannedCDKey";
NWNX_PushArgumentString(NWNX_Administration, sFunc, key);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_RemoveBannedCDKey(string key)
{
string sFunc = "RemoveBannedCDKey";
NWNX_PushArgumentString(NWNX_Administration, sFunc, key);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_AddBannedPlayerName(string playerName)
{
string sFunc = "AddBannedPlayerName";
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_RemoveBannedPlayerName(string playerName)
{
string sFunc = "RemoveBannedPlayerName";
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
string NWNX_Administration_GetBannedList()
{
string sFunc = "GetBannedList";
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetModuleName(string name)
{
string sFunc = "SetModuleName";
NWNX_PushArgumentString(NWNX_Administration, sFunc, name);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetServerName(string name)
{
string sFunc = "SetServerName";
NWNX_PushArgumentString(NWNX_Administration, sFunc, name);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
string NWNX_Administration_GetServerName()
{
string sFunc = "GetServerName";
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueString(NWNX_Administration, sFunc);
}
int NWNX_Administration_GetPlayOption(int option)
{
string sFunc = "GetPlayOption";
NWNX_PushArgumentInt(NWNX_Administration, sFunc, option);
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetPlayOption(int option, int value)
{
string sFunc = "SetPlayOption";
NWNX_PushArgumentInt(NWNX_Administration, sFunc, value);
NWNX_PushArgumentInt(NWNX_Administration, sFunc, option);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
int NWNX_Administration_DeleteTURD(string playerName, string characterName)
{
string sFunc = "DeleteTURD";
NWNX_PushArgumentString(NWNX_Administration, sFunc, characterName);
NWNX_PushArgumentString(NWNX_Administration, sFunc, playerName);
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
}
int NWNX_Administration_GetDebugValue(int type)
{
string sFunc = "GetDebugValue";
NWNX_PushArgumentInt(NWNX_Administration, sFunc, type);
NWNX_CallFunction(NWNX_Administration, sFunc);
return NWNX_GetReturnValueInt(NWNX_Administration, sFunc);
}
void NWNX_Administration_SetDebugValue(int type, int state)
{
string sFunc = "SetDebugValue";
NWNX_PushArgumentInt(NWNX_Administration, sFunc, state);
NWNX_PushArgumentInt(NWNX_Administration, sFunc, type);
NWNX_CallFunction(NWNX_Administration, sFunc);
}
void NWNX_Administration_ReloadRules()
{
string sFunc = "ReloadRules";
NWNX_CallFunction(NWNX_Administration, sFunc);
}

@ -0,0 +1,73 @@
/// @addtogroup appearance Appearance
/// @brief Allows the appearance and some other things of creatures to be overridden per player.
/// @{
/// @file nwnx_appearance.nss
#include "nwnx"
const string NWNX_Appearance = "NWNX_Appearance"; ///< @private
/// @name Appearance Types
/// @anchor appearance_types
///
/// The various types of changes that can be made to how a PC is perceived.
/// @{
const int NWNX_APPEARANCE_TYPE_APPEARANCE = 0; ///< APPEARANCE_TYPE_* or -1 to remove
const int NWNX_APPEARANCE_TYPE_GENDER = 1; ///< GENDER_* or -1 to remove
/// @brief 0-GetMaxHitPoints(oCreature) or -1 to remove
/// @note This is visual only. Does not change the Examine Window health status.
const int NWNX_APPEARANCE_TYPE_HITPOINTS = 2;
const int NWNX_APPEARANCE_TYPE_HAIR_COLOR = 3; ///< 0-175 or -1 to remove
const int NWNX_APPEARANCE_TYPE_SKIN_COLOR = 4; ///< 0-175 or -1 to remove
const int NWNX_APPEARANCE_TYPE_PHENOTYPE = 5; ///< PHENOTYPE_* or -1 to remove
const int NWNX_APPEARANCE_TYPE_HEAD_TYPE = 6; ///< 0-? or -1 to remove
const int NWNX_APPEARANCE_TYPE_SOUNDSET = 7; ///< See soundset.2da or -1 to remove
const int NWNX_APPEARANCE_TYPE_TAIL_TYPE = 8; ///< CREATURE_TAIL_TYPE_* or see tailmodel.2da, -1 to remove
const int NWNX_APPEARANCE_TYPE_WING_TYPE = 9; ///< CREATURE_WING_TYPE_* or see wingmodel.2da, -1 to remove
const int NWNX_APPEARANCE_TYPE_FOOTSTEP_SOUND = 10; ///< 0-17 or see footstepsounds.2da, -1 to remove
/// @brief See portraits.2da, -1 to remove
/// @note Does not change the Examine Window portrait.
const int NWNX_APPEARANCE_TYPE_PORTRAIT = 11;
///@}
/// @brief Override a creature's appearance type for a player.
/// @param oPlayer The player who will see/hear things differently.
/// @param oCreature The target creature whose appearance type to alter for oPlayer. Can be a PC.
/// @param nType The @ref appearance_types "Appearance Type" to set or -1 to fully remove override.
/// @param nValue The new value for the appearance type.
void NWNX_Appearance_SetOverride(object oPlayer, object oCreature, int nType, int nValue);
/// @brief Get a creature's appearance type for a player.
/// @param oPlayer The player who see/hear things differently.
/// @param oCreature The target creature whose appearance type is altered for oPlayer. Can be a PC.
/// @param nType The @ref appearance_types "Appearance Type" to get.
/// @return The value for the appearance type or -1 when not set.
int NWNX_Appearance_GetOverride(object oPlayer, object oCreature, int nType);
/// @}
void NWNX_Appearance_SetOverride(object oPlayer, object oCreature, int nType, int nValue)
{
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_CallFunction(NWNX_Appearance, sFunc);
}
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_CallFunction(NWNX_Appearance, sFunc);
return NWNX_GetReturnValueInt(NWNX_Appearance, sFunc);
}

660
nwnds_module/nwnx_area.nss Normal file

@ -0,0 +1,660 @@
/// @addtogroup area Area
/// @brief Functions exposing additional area properties as well as creating transitions.
/// @{
/// @file nwnx_area.nss
#include "nwnx"
const string NWNX_Area = "NWNX_Area"; ///< @private
/// @name Area PVP Settings
/// @anchor area_pvp
/// @{
const int NWNX_AREA_PVP_SETTING_NO_PVP = 0;
const int NWNX_AREA_PVP_SETTING_PARTY_PVP = 1;
const int NWNX_AREA_PVP_SETTING_FULL_PVP = 2;
const int NWNX_AREA_PVP_SETTING_SERVER_DEFAULT = 3;
/// @}
/// @name Area Weather Settings
/// @anchor area_weather
/// @{
const int NWNX_AREA_WEATHER_CHANCE_RAIN = 0;
const int NWNX_AREA_WEATHER_CHANCE_SNOW = 1;
const int NWNX_AREA_WEATHER_CHANCE_LIGHTNING = 2;
/// @}
/// @name Area Day Night Cycle Settings
/// @anchor area_daynight
/// @{
const int NWNX_AREA_DAYNIGHTCYCLE_CYCLE_DAY_NIGHT = 0;
const int NWNX_AREA_DAYNIGHTCYCLE_ALWAYS_BRIGHT = 1;
const int NWNX_AREA_DAYNIGHTCYCLE_ALWAYS_DARK = 2;
/// @}
/// @name Area Sun/Moon Color Settings
/// @anchor area_color
/// @{
const int NWNX_AREA_COLOR_TYPE_MOON_AMBIENT = 0;
const int NWNX_AREA_COLOR_TYPE_MOON_DIFFUSE = 1;
const int NWNX_AREA_COLOR_TYPE_SUN_AMBIENT = 2;
const int NWNX_AREA_COLOR_TYPE_SUN_DIFFUSE = 3;
/// @}
/// @brief A tile info struct
struct NWNX_Area_TileInfo
{
int nID; ///< The tile's ID
int nHeight; ///< The tile's height
int nOrientation; ///< The tile's orientation
int nGridX; ///< The tile's grid x position
int nGridY; ///< The tile's grid y position
};
/// @brief Gets the number of players in area.
/// @param area The area object.
/// @return The player count for the area.
int NWNX_Area_GetNumberOfPlayersInArea(object area);
/// @brief Gets the creature that last entered area.
/// @param area The area object.
/// @return The most recent creature to enter the area.
object NWNX_Area_GetLastEntered(object area);
/// @brief Gets the creature that last left area
/// @param area The area object.
object NWNX_Area_GetLastLeft(object area);
/// @brief Get the PVP setting of area
/// @param area The area object.
/// @return Returns the @ref area_pvp "PVP Setting" for the area.
int NWNX_Area_GetPVPSetting(object area);
/// @brief Set the PVP setting of area
/// @param area The area object.
/// @param pvpSetting One of @ref area_pvp the "PVP Settings".
void NWNX_Area_SetPVPSetting(object area, int pvpSetting);
/// @brief Get the spot modifier of area
/// @param area The area object.
/// @return The value of the Spot skill modifier for this area.
int NWNX_Area_GetAreaSpotModifier(object area);
/// @brief Set the spot modifier of area
/// @param area The area object.
/// @param spotModifier The modifier to the Spot skill for this area.
/// @sa NWNX_SkillRanks_SetAreaModifier() to change any skill modifier.
void NWNX_Area_SetAreaSpotModifier(object area, int spotModifier);
/// @brief Get the listen modifer of area
/// @param area The area object.
/// @return The value of the Listen skill modifier for this area.
int NWNX_Area_GetAreaListenModifier(object area);
/// @brief Set the listen modifier of area
/// @param area The area object.
/// @param listenModifier The modifier to the Listen skill for this area.
/// @sa NWNX_SkillRanks_SetAreaModifier() to change any skill modifier.
void NWNX_Area_SetAreaListenModifier(object area, int listenModifier);
/// @brief Checks the No Resting area flag
/// @param area The area object.
/// @return TRUE if resting is not allowed in area.
int NWNX_Area_GetNoRestingAllowed(object area);
/// @brief Set whether to disable resting in the area.
/// @param area The area object.
/// @param bNoRestingAllowed TRUE to disable resting in the area.
void NWNX_Area_SetNoRestingAllowed(object area, int bNoRestingAllowed);
/// @brief Get the wind power in area
/// @param area The area object.
/// @return The wind power for the area. (0-2)
int NWNX_Area_GetWindPower(object area);
/// @brief Set the wind power in area
/// @param area The area object.
/// @param windPower Set to 0, 1 or 2.
void NWNX_Area_SetWindPower(object area, int windPower);
/// @brief Get the weather chance of type in area
/// @param type A @ref area_weather "Weather Setting".
/// @param area The area object.
/// @return The percentage chance for the weather type. (0-100)
int NWNX_Area_GetWeatherChance(object area, int type);
/// @brief Set the weather chance of type in area
/// @param area The area object.
/// @param type A @ref area_weather "Weather Setting".
/// @param chance The chance this weather event occurs.
void NWNX_Area_SetWeatherChance(object area, int type, int chance);
/// @brief Get the fog clip distance in area
/// @param area The area object.
/// @return The fog clip distance.
float NWNX_Area_GetFogClipDistance(object area);
/// @brief Set the fog clip distance in area
/// @param area The area object.
/// @param distance The new fog clip distance.
void NWNX_Area_SetFogClipDistance(object area, float distance);
/// @brief Get the shadow opacity of area
/// @param area The area object.
/// @return The shadow opacity for the area. (0-100)
int NWNX_Area_GetShadowOpacity(object area);
/// @brief Set the shadow opacity of area
/// @param area The area object.
/// @param shadowOpacity The shadow opacity to set for the area (0-100).
void NWNX_Area_SetShadowOpacity(object area, int shadowOpacity);
/// @brief Get the day/night cycle of area
/// @param area The area object.
/// @return The @ref area_daynight "Day Night Cycle Setting".
int NWNX_Area_GetDayNightCycle(object area);
/// @brief Set the day/night cycle of area
/// @param area The area object.
/// @param type = A @ref area_daynight "Day Night Cycle Setting".
void NWNX_Area_SetDayNightCycle(object area, int type);
/// @brief Get the Sun/Moon Ambient/Diffuse colors of area
/// @param area The area object.
/// @param type = A @ref area_color "Sun/Moon Color Setting".
/// @return A FOG_COLOR_* or a custom value, -1 on error.
int NWNX_Area_GetSunMoonColors(object area, int type);
/// @brief Set the Sun/Moon Ambient/Diffuse colors of area
// type = NWNX_AREA_COLOR_TYPE_*
/// @param area The area object.
/// @param type = A @ref area_color "Sun/Moon Color Setting".
/// @param color = A FOG_COLOR_*.
/// @note The color can also be represented as a hex RGB number if specific color shades are desired.
/// The format of a hex specified color would be 0xFFEEDD where
/// * FF would represent the amount of red in the color
/// * EE would represent the amount of green in the color
/// * DD would represent the amount of blue in the color.
void NWNX_Area_SetSunMoonColors(object area, int type, int color);
/// @brief Create and returns a transition (square shaped of specified size) at a location.
/// @param area The area object.
/// @param target A door or waypoint object.
/// @param x,y,z The position to create the transition.
/// @param size The size of the square.
/// @param tag If specified, the returning object will have this tag.
/// @sa NWNX_Object_SetTriggerGeometry() if you wish to draw the transition as something other than a square.
object NWNX_Area_CreateTransition(object area, object target, float x, float y, float z, float size = 2.0f, string tag="");
/// @brief Get the state of a tile animation loop.
/// @param oArea The area object.
/// @param fTileX, fTileY The coordinates of the tile.
/// @param nAnimLoop The loop to check. (1-3)
/// @return TRUE if the loop is enabled.
int NWNX_Area_GetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop);
/// @brief Set the state of a tile animation loop.
/// @param oArea The area object.
/// @param fTileX, fTileY The coordinates of the tile.
/// @param nAnimLoop The loop to set (1-3).
/// @param bEnabled TRUE or FALSE.
/// @note Requires clients to re-enter the area for it to take effect
void NWNX_Area_SetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop, int bEnabled);
/// @brief Get the name of the tile model from any location.
/// @param oArea The area name.
/// @param fTileX, fTileY The coordinates of the tile.
string NWNX_Area_GetTileModelResRef(object oArea, float fTileX, float fTileY);
/// @brief Test to see if there's a direct, walkable line between two points in the area.
/// @param oArea The area object.
/// @param fStartX, fStartY The starting points.
/// @param fEndX, fEndY The ending points.
/// @param fPerSpace The personal space of a creature. Found in appearance.2da.
/// @param fHeight The height of a creature. Found in appearance.2da.
/// @param bIgnoreDoors Whether to ignore doors in the check.
/// @return
/// * 1 if there is a direct walkable line.
/// * -1 if the line is blocked by terrain.
/// * -2 if the line is blocked by a placeable.
/// * -3 if the line is blocked by a creature.
int NWNX_Area_TestDirectLine(object oArea, float fStartX, float fStartY, float fEndX, float fEndY, float fPerSpace, float fHeight, int bIgnoreDoors=FALSE);
/// @brief Get if the area music is playing.
/// @param oArea The area object.
/// @param bBattleMusic Set to TRUE to get if the battle music is playing.
/// @return TRUE if music is playing
int NWNX_Area_GetMusicIsPlaying(object oArea, int bBattleMusic = FALSE);
/// @brief Create and return a generic trigger (square shaped of specified size) at a location.
/// @param oArea The area object.
/// @param fX, fY, fZ The position to create the trigger.
/// @param sTag If specified, the returned trigger will have this tag.
/// @param fSize The size of the square.
/// @sa NWNX_Object_SetTriggerGeometry() if you wish to draw the trigger as something other than a square.
object NWNX_Area_CreateGenericTrigger(object oArea, float fX, float fY, float fZ, string sTag = "", float fSize = 1.0f);
/// @brief Add oObject to the ExportGIT exclusion list, objects on this list won't be exported when NWNX_Area_ExportGIT() is called.
/// @param oObject The object to add
void NWNX_Area_AddObjectToExclusionList(object oObject);
/// @brief Remove oObject from the ExportGIT exclusion list.
/// @param oObject The object to add
void NWNX_Area_RemoveObjectFromExclusionList(object oObject);
/// @brief Export the .git file of oArea to the UserDirectory/nwnx folder, or to the location of sAlias.
/// @note Take care with local objects set on objects, they will likely not reference the same object after a server restart.
/// @param oArea The area to export the .git file of.
/// @param sFileName The filename, 16 characters or less and should be lowercase. If left blank the resref of oArea will be used.
/// @param bExportVarTable If TRUE, local variables set on oArea will be exported too.
/// @param bExportUUID If TRUE, the UUID of oArea will be exported, if it has one.
/// @param nObjectFilter One or more OBJECT_TYPE_* constants. These object will not be exported. For example OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR
/// will not export creatures and doors. Use OBJECT_TYPE_ALL to filter all objects or 0 to export all objects.
/// @param sAlias The alias of the resource directory to add the .git file to. Default: UserDirectory/nwnx
/// @return TRUE if exported successfully, FALSE if not.
int NWNX_Area_ExportGIT(object oArea, string sFileName = "", int bExportVarTable = TRUE, int bExportUUID = TRUE, int nObjectFilter = 0, string sAlias = "NWNX");
/// @brief Get the tile info of the tile at [fTileX, fTileY] in oArea.
/// @param oArea The area name.
/// @param fTileX, fTileY The coordinates of the tile.
/// @return A NWNX_Area_TileInfo struct with tile info.
struct NWNX_Area_TileInfo NWNX_Area_GetTileInfo(object oArea, float fTileX, float fTileY);
/// @brief Export the .are file of oArea to the UserDirectory/nwnx folder, or to the location of sAlias.
/// @param oArea The area to export the .are file of.
/// @param sFileName The filename, 16 characters or less and should be lowercase. This will also be the resref of the area.
/// @param sNewName Optional new name of the area. Leave blank to use the current name.
/// @param sNewTag Optional new tag of the area. Leave blank to use the current tag.
/// @param sAlias The alias of the resource directory to add the .are file to. Default: UserDirectory/nwnx
/// @return TRUE if exported successfully, FALSE if not.
int NWNX_Area_ExportARE(object oArea, string sFileName, string sNewName = "", string sNewTag = "", string sAlias = "NWNX");
/// @}
int NWNX_Area_GetNumberOfPlayersInArea(object area)
{
string sFunc = "GetNumberOfPlayersInArea";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
object NWNX_Area_GetLastEntered(object area)
{
string sFunc = "GetLastEntered";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
}
object NWNX_Area_GetLastLeft(object area)
{
string sFunc = "GetLastLeft";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
}
int NWNX_Area_GetPVPSetting(object area)
{
string sFunc = "GetPVPSetting";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetPVPSetting(object area, int pvpSetting)
{
string sFunc = "SetPVPSetting";
NWNX_PushArgumentInt(NWNX_Area, sFunc, pvpSetting);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetAreaSpotModifier(object area)
{
string sFunc = "GetAreaSpotModifier";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetAreaSpotModifier(object area, int spotModifier)
{
string sFunc = "SetAreaSpotModifier";
NWNX_PushArgumentInt(NWNX_Area, sFunc, spotModifier);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetAreaListenModifier(object area)
{
string sFunc = "GetAreaListenModifier";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetAreaListenModifier(object area, int listenModifier)
{
string sFunc = "SetAreaListenModifier";
NWNX_PushArgumentInt(NWNX_Area, sFunc, listenModifier);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetNoRestingAllowed(object area)
{
string sFunc = "GetNoRestingAllowed";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetNoRestingAllowed(object area, int bNoRestingAllowed)
{
string sFunc = "SetNoRestingAllowed";
NWNX_PushArgumentInt(NWNX_Area, sFunc, bNoRestingAllowed);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetWindPower(object area)
{
string sFunc = "GetWindPower";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetWindPower(object area, int windPower)
{
string sFunc = "SetWindPower";
NWNX_PushArgumentInt(NWNX_Area, sFunc, windPower);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetWeatherChance(object area, int type)
{
string sFunc = "GetWeatherChance";
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
}
float NWNX_Area_GetFogClipDistance(object area)
{
string sFunc = "GetFogClipDistance";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueFloat(NWNX_Area, sFunc);
}
void NWNX_Area_SetFogClipDistance(object area, float distance)
{
string sFunc = "SetFogClipDistance";
NWNX_PushArgumentFloat(NWNX_Area, sFunc, distance);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetShadowOpacity(object area)
{
string sFunc = "GetShadowOpacity";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetShadowOpacity(object area, int shadowOpacity)
{
string sFunc = "SetShadowOpacity";
NWNX_PushArgumentInt(NWNX_Area, sFunc, shadowOpacity);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetDayNightCycle(object area)
{
string sFunc = "GetDayNightCycle";
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
void NWNX_Area_SetDayNightCycle(object area, int type)
{
string sFunc = "SetDayNightCycle";
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_GetSunMoonColors(object area, int type)
{
string sFunc = "GetSunMoonColors";
NWNX_PushArgumentInt(NWNX_Area, sFunc, type);
NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
NWNX_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
}
object NWNX_Area_CreateTransition(object area, object target, float x, float y, float z, float size = 2.0f, string tag="")
{
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueString(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueObject(NWNX_Area, sFunc);
}
void NWNX_Area_AddObjectToExclusionList(object oObject)
{
string sFunc = "AddObjectToExclusionList";
NWNX_PushArgumentObject(NWNX_Area, sFunc, oObject);
NWNX_CallFunction(NWNX_Area, sFunc);
}
void NWNX_Area_RemoveObjectFromExclusionList(object oObject)
{
string sFunc = "RemoveObjectFromExclusionList";
NWNX_PushArgumentObject(NWNX_Area, sFunc, oObject);
NWNX_CallFunction(NWNX_Area, sFunc);
}
int NWNX_Area_ExportGIT(object oArea, string sFileName = "", int bExportVarTable = TRUE, int bExportUUID = TRUE, int nObjectFilter = 0, string sAlias = "NWNX")
{
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}
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_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);
return str;
}
int NWNX_Area_ExportARE(object oArea, string sFileName, string sNewName = "", string sNewTag = "", string sAlias = "NWNX")
{
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_CallFunction(NWNX_Area, sFunc);
return NWNX_GetReturnValueInt(NWNX_Area, sFunc);
}

158
nwnds_module/nwnx_chat.nss Normal file

@ -0,0 +1,158 @@
/// @addtogroup chat Chat
/// @brief Functions related to chat.
/// @{
/// @file nwnx_chat.nss
#include "nwnx"
const string NWNX_Chat = "NWNX_Chat"; ///< @private
/// @name Chat Channels
/// @anchor chat_channels
///
/// Constants defining the various chat channels.
/// @{
const int NWNX_CHAT_CHANNEL_PLAYER_TALK = 1;
const int NWNX_CHAT_CHANNEL_PLAYER_SHOUT = 2;
const int NWNX_CHAT_CHANNEL_PLAYER_WHISPER = 3;
const int NWNX_CHAT_CHANNEL_PLAYER_TELL = 4;
const int NWNX_CHAT_CHANNEL_SERVER_MSG = 5;
const int NWNX_CHAT_CHANNEL_PLAYER_PARTY = 6;
const int NWNX_CHAT_CHANNEL_PLAYER_DM = 14;
const int NWNX_CHAT_CHANNEL_DM_TALK = 17;
const int NWNX_CHAT_CHANNEL_DM_SHOUT = 18;
const int NWNX_CHAT_CHANNEL_DM_WHISPER = 19;
const int NWNX_CHAT_CHANNEL_DM_TELL = 20;
const int NWNX_CHAT_CHANNEL_DM_PARTY = 22;
const int NWNX_CHAT_CHANNEL_DM_DM = 30;
/// @}
/// @brief Sends a chat message.
/// @remark If no target is provided, then it broadcasts to all eligible targets.
/// @param channel The @ref chat_channels "channel" to send the message.
/// @param message The message to send.
/// @param sender The sender of the message.
/// @param target The receiver of the message.
/// @return TRUE if successful, FALSE otherwise.
int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SELF, object target = OBJECT_INVALID);
/// @brief Registers the script which receives all chat messages.
/// @note If a script was previously registered, this one will take over.
/// @param script The script name to handle the chat events.
void NWNX_Chat_RegisterChatScript(string script);
/// @brief Skips a chat message
/// @note Must be called from a chat or system script handler.
void NWNX_Chat_SkipMessage();
/// @brief Gets the chat @ref chat_channels "channel".
/// @note Must be called from a chat or system script handler.
/// @return The @ref chat_channels "channel" the message is sent.
int NWNX_Chat_GetChannel();
/// @brief Gets the message.
/// @note Must be called from a chat or system script handler.
/// @return The message sent.
string NWNX_Chat_GetMessage();
/// @brief Gets the sender of the message.
/// @note Must be called from a chat or system script handler.
/// @return The object sending the message.
object NWNX_Chat_GetSender();
/// @brief Gets the target of the message.
/// @note Must be called from an chat or system script handler.
/// @return The target of the message or OBJECT_INVALID if no target.
object NWNX_Chat_GetTarget();
/// @brief Sets the distance with which the player hears talks or whispers.
/// @remark Per player settings override server wide.
/// @param distance The distance in meters.
/// @param listener The listener, if OBJECT_INVALID then it will be set server wide.
/// @param channel The @ref chat_channels "channel" to modify the distance heard. Only applicable for talk and whisper.
void NWNX_Chat_SetChatHearingDistance(float distance, object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK);
/// @brief Gets the distance with which the player hears talks or whisper
/// @param listener The listener, if OBJECT_INVALID then will return server wide setting.
/// @param channel The @ref chat_channels "channel". Only applicable for talk and whisper.
float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK);
/// @}
int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SELF, object target = OBJECT_INVALID)
{
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_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueInt(NWNX_Chat, sFunc);
}
void NWNX_Chat_RegisterChatScript(string script)
{
string sFunc = "RegisterChatScript";
NWNX_PushArgumentString(NWNX_Chat, sFunc, script);
NWNX_CallFunction(NWNX_Chat, sFunc);
}
void NWNX_Chat_SkipMessage()
{
string sFunc = "SkipMessage";
NWNX_CallFunction(NWNX_Chat, sFunc);
}
int NWNX_Chat_GetChannel()
{
string sFunc = "GetChannel";
NWNX_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueInt(NWNX_Chat, sFunc);
}
string NWNX_Chat_GetMessage()
{
string sFunc = "GetMessage";
NWNX_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueString(NWNX_Chat, sFunc);
}
object NWNX_Chat_GetSender()
{
string sFunc = "GetSender";
NWNX_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueObject(NWNX_Chat, sFunc);
}
object NWNX_Chat_GetTarget()
{
string sFunc = "GetTarget";
NWNX_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueObject(NWNX_Chat, sFunc);
}
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_CallFunction(NWNX_Chat, sFunc);
}
float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK)
{
string sFunc = "GetChatHearingDistance";
NWNX_PushArgumentInt(NWNX_Chat, sFunc, channel);
NWNX_PushArgumentObject(NWNX_Chat, sFunc, listener);
NWNX_CallFunction(NWNX_Chat, sFunc);
return NWNX_GetReturnValueFloat(NWNX_Chat, sFunc);
}

@ -0,0 +1,182 @@
/// @ingroup nwnx
/// @addtogroup consts NWNX Constants
/// @brief Provides various NWScript <-> Engine Constants Translation Table functions
/// @{
/// @file nwnx_consts.nss
/// @brief Translates ANIMATION_LOOPING_* and ANIMATION_FIREFORGET_* constants to their engine equivalent.
/// @param nAnimation The nwn animation constant
/// @return The engine equivalent of the constant
int NWNX_Consts_TranslateNWScriptAnimation(int nAnimation);
/// @brief Translates engine animation constants to their ANIMATION_LOOPING_* and ANIMATION_FIREFORGET_* equivalent.
/// @param nAnimation The engine animation constant
/// @return The NWScript equivalent of the constant or -1 if a nwscript equivalent doesn't exist
int NWNX_Consts_TranslateEngineAnimation(int nAnimation);
/// @brief Translates OBJECT_TYPE_* constants to their engine equivalent.
/// @param nObjectType The nwn object type
/// @return The engine equivalent of the constant
int NWNX_Consts_TranslateNWScriptObjectType(int nObjectType);
int NWNX_Consts_TranslateNWScriptAnimation(int nAnimation)
{
switch (nAnimation)
{
case ANIMATION_LOOPING_PAUSE: nAnimation = 0; break;
case ANIMATION_LOOPING_PAUSE2: nAnimation = 52; break;
case ANIMATION_LOOPING_LISTEN: nAnimation = 30; break;
case ANIMATION_LOOPING_MEDITATE: nAnimation = 32; break;
case ANIMATION_LOOPING_WORSHIP: nAnimation = 33; break;
case ANIMATION_LOOPING_LOOK_FAR: nAnimation = 48; break;
case ANIMATION_LOOPING_SIT_CHAIR: nAnimation = 36; break;
case ANIMATION_LOOPING_SIT_CROSS: nAnimation = 47; break;
case ANIMATION_LOOPING_TALK_NORMAL: nAnimation = 38; break;
case ANIMATION_LOOPING_TALK_PLEADING: nAnimation = 39; break;
case ANIMATION_LOOPING_TALK_FORCEFUL: nAnimation = 40; break;
case ANIMATION_LOOPING_TALK_LAUGHING: nAnimation = 41; break;
case ANIMATION_LOOPING_GET_LOW: nAnimation = 59; break;
case ANIMATION_LOOPING_GET_MID: nAnimation = 60; break;
case ANIMATION_LOOPING_PAUSE_TIRED: nAnimation = 57; break;
case ANIMATION_LOOPING_PAUSE_DRUNK: nAnimation = 58; break;
case ANIMATION_LOOPING_DEAD_FRONT: nAnimation = 6; break;
case ANIMATION_LOOPING_DEAD_BACK: nAnimation = 8; break;
case ANIMATION_LOOPING_CONJURE1: nAnimation = 15; break;
case ANIMATION_LOOPING_CONJURE2: nAnimation = 16; break;
case ANIMATION_LOOPING_SPASM: nAnimation = 93; break;
case ANIMATION_LOOPING_CUSTOM1: nAnimation = 97; break;
case ANIMATION_LOOPING_CUSTOM2: nAnimation = 98; break;
case ANIMATION_LOOPING_CUSTOM3: nAnimation = 101; break;
case ANIMATION_LOOPING_CUSTOM4: nAnimation = 102; break;
case ANIMATION_LOOPING_CUSTOM5: nAnimation = 103; break;
case ANIMATION_LOOPING_CUSTOM6: nAnimation = 104; break;
case ANIMATION_LOOPING_CUSTOM7: nAnimation = 105; break;
case ANIMATION_LOOPING_CUSTOM8: nAnimation = 106; break;
case ANIMATION_LOOPING_CUSTOM9: nAnimation = 107; break;
case ANIMATION_LOOPING_CUSTOM10: nAnimation = 108; break;
case ANIMATION_LOOPING_CUSTOM11: nAnimation = 109; break;
case ANIMATION_LOOPING_CUSTOM12: nAnimation = 110; break;
case ANIMATION_LOOPING_CUSTOM13: nAnimation = 111; break;
case ANIMATION_LOOPING_CUSTOM14: nAnimation = 112; break;
case ANIMATION_LOOPING_CUSTOM15: nAnimation = 113; break;
case ANIMATION_LOOPING_CUSTOM16: nAnimation = 114; break;
case ANIMATION_LOOPING_CUSTOM17: nAnimation = 115; break;
case ANIMATION_LOOPING_CUSTOM18: nAnimation = 116; break;
case ANIMATION_LOOPING_CUSTOM19: nAnimation = 117; break;
case ANIMATION_LOOPING_CUSTOM20: nAnimation = 118; break;
case ANIMATION_MOUNT1: nAnimation = 119; break;
case ANIMATION_DISMOUNT1: nAnimation = 120; break;
case ANIMATION_FIREFORGET_HEAD_TURN_LEFT: nAnimation = 53; break;
case ANIMATION_FIREFORGET_HEAD_TURN_RIGHT: nAnimation = 54; break;
case ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD: nAnimation = 55; break;
case ANIMATION_FIREFORGET_PAUSE_BORED: nAnimation = 56; break;
case ANIMATION_FIREFORGET_SALUTE: nAnimation = 34; break;
case ANIMATION_FIREFORGET_BOW: nAnimation = 35; break;
case ANIMATION_FIREFORGET_STEAL: nAnimation = 37; break;
case ANIMATION_FIREFORGET_GREETING: nAnimation = 29; break;
case ANIMATION_FIREFORGET_TAUNT: nAnimation = 28; break;
case ANIMATION_FIREFORGET_VICTORY1: nAnimation = 44; break;
case ANIMATION_FIREFORGET_VICTORY2: nAnimation = 45; break;
case ANIMATION_FIREFORGET_VICTORY3: nAnimation = 46; break;
case ANIMATION_FIREFORGET_READ: nAnimation = 71; break;
case ANIMATION_FIREFORGET_DRINK: nAnimation = 70; break;
case ANIMATION_FIREFORGET_DODGE_SIDE: nAnimation = 90; break;
case ANIMATION_FIREFORGET_DODGE_DUCK: nAnimation = 91; break;
case ANIMATION_FIREFORGET_SPASM: nAnimation = 23; break;
default: nAnimation = 0; break;
}
return nAnimation;
}
int NWNX_Consts_TranslateEngineAnimation(int nAnimation)
{
switch (nAnimation)
{
case 0: nAnimation = ANIMATION_LOOPING_PAUSE; break;
case 52: nAnimation = ANIMATION_LOOPING_PAUSE2; break;
case 30: nAnimation = ANIMATION_LOOPING_LISTEN; break;
case 32: nAnimation = ANIMATION_LOOPING_MEDITATE; break;
case 33: nAnimation = ANIMATION_LOOPING_WORSHIP; break;
case 48: nAnimation = ANIMATION_LOOPING_LOOK_FAR; break;
case 36: nAnimation = ANIMATION_LOOPING_SIT_CHAIR; break;
case 47: nAnimation = ANIMATION_LOOPING_SIT_CROSS; break;
case 38: nAnimation = ANIMATION_LOOPING_TALK_NORMAL; break;
case 39: nAnimation = ANIMATION_LOOPING_TALK_PLEADING; break;
case 40: nAnimation = ANIMATION_LOOPING_TALK_FORCEFUL; break;
case 41: nAnimation = ANIMATION_LOOPING_TALK_LAUGHING; break;
case 59: nAnimation = ANIMATION_LOOPING_GET_LOW; break;
case 60: nAnimation = ANIMATION_LOOPING_GET_MID; break;
case 57: nAnimation = ANIMATION_LOOPING_PAUSE_TIRED; break;
case 58: nAnimation = ANIMATION_LOOPING_PAUSE_DRUNK; break;
case 6: nAnimation = ANIMATION_LOOPING_DEAD_FRONT; break;
case 8: nAnimation = ANIMATION_LOOPING_DEAD_BACK; break;
case 15: nAnimation = ANIMATION_LOOPING_CONJURE1; break;
case 16: nAnimation = ANIMATION_LOOPING_CONJURE2; break;
case 93: nAnimation = ANIMATION_LOOPING_SPASM; break;
case 97: nAnimation = ANIMATION_LOOPING_CUSTOM1; break;
case 98: nAnimation = ANIMATION_LOOPING_CUSTOM2; break;
case 101: nAnimation = ANIMATION_LOOPING_CUSTOM3; break;
case 102: nAnimation = ANIMATION_LOOPING_CUSTOM4; break;
case 103: nAnimation = ANIMATION_LOOPING_CUSTOM5; break;
case 104: nAnimation = ANIMATION_LOOPING_CUSTOM6; break;
case 105: nAnimation = ANIMATION_LOOPING_CUSTOM7; break;
case 106: nAnimation = ANIMATION_LOOPING_CUSTOM8; break;
case 107: nAnimation = ANIMATION_LOOPING_CUSTOM9; break;
case 108: nAnimation = ANIMATION_LOOPING_CUSTOM10; break;
case 109: nAnimation = ANIMATION_LOOPING_CUSTOM11; break;
case 110: nAnimation = ANIMATION_LOOPING_CUSTOM12; break;
case 111: nAnimation = ANIMATION_LOOPING_CUSTOM13; break;
case 112: nAnimation = ANIMATION_LOOPING_CUSTOM14; break;
case 113: nAnimation = ANIMATION_LOOPING_CUSTOM15; break;
case 114: nAnimation = ANIMATION_LOOPING_CUSTOM16; break;
case 115: nAnimation = ANIMATION_LOOPING_CUSTOM17; break;
case 116: nAnimation = ANIMATION_LOOPING_CUSTOM18; break;
case 117: nAnimation = ANIMATION_LOOPING_CUSTOM19; break;
case 118: nAnimation = ANIMATION_LOOPING_CUSTOM20; break;
case 119: nAnimation = ANIMATION_MOUNT1; break;
case 120: nAnimation = ANIMATION_DISMOUNT1; break;
case 53: nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_LEFT; break;
case 54: nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_RIGHT; break;
case 55: nAnimation = ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD; break;
case 56: nAnimation = ANIMATION_FIREFORGET_PAUSE_BORED; break;
case 34: nAnimation = ANIMATION_FIREFORGET_SALUTE; break;
case 35: nAnimation = ANIMATION_FIREFORGET_BOW; break;
case 37: nAnimation = ANIMATION_FIREFORGET_STEAL; break;
case 29: nAnimation = ANIMATION_FIREFORGET_GREETING; break;
case 28: nAnimation = ANIMATION_FIREFORGET_TAUNT; break;
case 44: nAnimation = ANIMATION_FIREFORGET_VICTORY1; break;
case 45: nAnimation = ANIMATION_FIREFORGET_VICTORY2; break;
case 46: nAnimation = ANIMATION_FIREFORGET_VICTORY3; break;
case 71: nAnimation = ANIMATION_FIREFORGET_READ; break;
case 70: nAnimation = ANIMATION_FIREFORGET_DRINK; break;
case 90: nAnimation = ANIMATION_FIREFORGET_DODGE_SIDE; break;
case 91: nAnimation = ANIMATION_FIREFORGET_DODGE_DUCK; break;
case 23: nAnimation = ANIMATION_FIREFORGET_SPASM; break;
default: nAnimation = -1; break;
}
return nAnimation;
}
int NWNX_Consts_TranslateNWScriptObjectType(int nObjectType)
{
switch(nObjectType)
{
case OBJECT_TYPE_ALL: nObjectType = 0; break;
case OBJECT_TYPE_AREA_OF_EFFECT: nObjectType = 11; break;
case OBJECT_TYPE_CREATURE: nObjectType = 5; break;
case OBJECT_TYPE_DOOR: nObjectType = 10; break;
case OBJECT_TYPE_ENCOUNTER: nObjectType = 13; break;
case OBJECT_TYPE_ITEM: nObjectType = 6; break;
case OBJECT_TYPE_PLACEABLE: nObjectType = 9; break;
case OBJECT_TYPE_STORE: nObjectType = 14; break;
case OBJECT_TYPE_TRIGGER: nObjectType = 7; break;
case OBJECT_TYPE_WAYPOINT: nObjectType = 12; break;
default: nObjectType = 0; break;
}
return nObjectType;
}
/// @} // End of consts

File diff suppressed because it is too large Load Diff

@ -0,0 +1,253 @@
/// @addtogroup damage Damage
/// @brief Run a script before damage and attack events allowing for modification. Includes function to arbitrarily apply damage.
/// @{
/// @file nwnx_damage.nss
#include "nwnx"
const string NWNX_Damage = "NWNX_Damage"; ///< @private
/// @struct NWNX_Damage_DamageEventData
/// @brief Damage Event Data
struct NWNX_Damage_DamageEventData
{
object oDamager; ///< The object that inflicted the damage.
int iBludgeoning; ///< Bludgeoning damage
int iPierce; ///< Piercing damage
int iSlash; ///< Slashing damage
int iMagical; ///< Magical damage
int iAcid; ///< Acid damage
int iCold; ///< Cold damage
int iDivine; ///< Divine damage
int iElectrical; ///< Electrical damage
int iFire; ///< Fire damage
int iNegative; ///< Negative damage
int iPositive; ///< Positive damage
int iSonic; ///< Sonic damage
int iBase; ///< Base damage
};
/// @struct NWNX_Damage_AttackEventData
/// @brief Attack Event Data
struct NWNX_Damage_AttackEventData
{
object oTarget; ///< The target who took the damage
int iBludgeoning; ///< Bludgeoning damage
int iPierce; ///< Piercing damage
int iSlash; ///< Slashing damage
int iMagical; ///< Magical damage
int iAcid; ///< Acid damage
int iCold; ///< Cold damage
int iDivine; ///< Divine damage
int iElectrical; ///< Electrical damage
int iFire; ///< Fire damage
int iNegative; ///< Negative damage
int iPositive; ///< Positive damage
int iSonic; ///< Sonic damage
int iBase; ///< Base 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
};
/// @struct NWNX_Damage_DamageData
/// @brief Used for DealDamage
struct NWNX_Damage_DamageData
{
int iBludgeoning; ///< Bludgeoning damage
int iPierce; ///< Piercing damage
int iSlash; ///< Slashing damage
int iMagical; ///< Magical damage
int iAcid; ///< Acid damage
int iCold; ///< Cold damage
int iDivine; ///< Divine damage
int iElectrical; ///< Electrical damage
int iFire; ///< Fire damage
int iNegative; ///< Negative damage
int iPositive; ///< Positive damage
int iSonic; ///< Sonic 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);
/// @brief Get Damage Event Data
/// @return A NWNX_Damage_DamageEventData struct.
/// @note To use only in the Damage Event Script.
struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData();
/// @brief Set Damage Event Data
/// @param data A NWNX_Damage_DamageEventData struct.
/// @note To use only in the Damage Event Script.
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);
/// @brief Get Attack Event Data
/// @return A NWNX_Damage_AttackEventData struct.
/// @note To use only in the Attack Event Script.
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.
void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data);
/// @brief Deal damage to a target.
/// @remark Permits multiple damage types and checks enhancement bonus for overcoming DR.
/// @param data A NWNX_Damage_DamageData struct.
/// @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_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID)
{
string sFunc = "SetEventScript";
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oOwner);
NWNX_PushArgumentString(NWNX_Damage, sFunc, sScript);
NWNX_PushArgumentString(NWNX_Damage, sFunc, "DAMAGE");
NWNX_CallFunction(NWNX_Damage, sFunc);
}
struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData()
{
string sFunc = "GetDamageEventData";
struct NWNX_Damage_DamageEventData data;
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);
return data;
}
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_CallFunction(NWNX_Damage, sFunc);
}
void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID)
{
string sFunc = "SetEventScript";
NWNX_PushArgumentObject(NWNX_Damage, sFunc, oOwner);
NWNX_PushArgumentString(NWNX_Damage, sFunc, sScript);
NWNX_PushArgumentString(NWNX_Damage, sFunc, "ATTACK");
NWNX_CallFunction(NWNX_Damage, sFunc);
}
struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData()
{
string sFunc = "GetAttackEventData";
struct NWNX_Damage_AttackEventData data;
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);
return data;
}
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_CallFunction(NWNX_Damage, sFunc);
}
void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource, int iRanged = FALSE)
{
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_CallFunction(NWNX_Damage, sFunc);
}

351
nwnds_module/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);
}

@ -0,0 +1,139 @@
/// @addtogroup dialog Dialog
/// @brief Functions exposing additional dialog properties
/// @{
/// @file nwnx_dialog.nss
#include "nwnx"
const string NWNX_Dialog = "NWNX_Dialog"; ///< @private
/// @name Dialog Node Types
/// @anchor dialog_node_types
/// @{
const int NWNX_DIALOG_NODE_TYPE_INVALID = -1;
const int NWNX_DIALOG_NODE_TYPE_STARTING_NODE = 0;
const int NWNX_DIALOG_NODE_TYPE_ENTRY_NODE = 1;
const int NWNX_DIALOG_NODE_TYPE_REPLY_NODE = 2;
/// @}
/// @name Dialog Script Types
/// @anchor dialog_script_types
/// @{
const int NWNX_DIALOG_SCRIPT_TYPE_OTHER = 0;
const int NWNX_DIALOG_SCRIPT_TYPE_STARTING_CONDITIONAL = 1;
const int NWNX_DIALOG_SCRIPT_TYPE_ACTION_TAKEN = 2;
/// @}
/// @name Dialog Languages
/// @anchor dialog_languages
/// @{
const int NWNX_DIALOG_LANGUAGE_ENGLISH = 0;
const int NWNX_DIALOG_LANGUAGE_FRENCH = 1;
const int NWNX_DIALOG_LANGUAGE_GERMAN = 2;
const int NWNX_DIALOG_LANGUAGE_ITALIAN = 3;
const int NWNX_DIALOG_LANGUAGE_SPANISH = 4;
const int NWNX_DIALOG_LANGUAGE_POLISH = 5;
const int NWNX_DIALOG_LANGUAGE_KOREAN = 128;
const int NWNX_DIALOG_LANGUAGE_CHINESE_TRADITIONAL = 129;
const int NWNX_DIALOG_LANGUAGE_CHINESE_SIMPLIFIED = 130;
const int NWNX_DIALOG_LANGUAGE_JAPANESE = 131;
/// @}
/// @brief Get the @ref dialog_node_types "Node Type" of the current text node
/// @return A @ref dialog_node_types "Node Type". If called out of dialog, returns NWNX_DIALOG_NODE_TYPE_INVALID
int NWNX_Dialog_GetCurrentNodeType();
/// @brief Get the @ref dialog_script_types "Script Type" of the current text node
/// @return A @ref dialog_script_types "Node Type". If called out of dialog, returns NWNX_DIALOG_SCRIPT_TYPE_OTHER
int NWNX_Dialog_GetCurrentScriptType();
/// @brief Get the absolute ID of the current node in the conversation
/// @note NWNX_DIALOG_NODE_TYPE_ENTRY_NODE and NWNX_DIALOG_NODE_TYPE_REPLY_NODE nodes
/// have different namespaces, so they can share the same ID
/// @return The absolute ID in the dialog. If called out of dialog, returns -1
int NWNX_Dialog_GetCurrentNodeID();
/// @brief Get the index of the current node in the list of replies/entries.
/// @note The index is zero based, and counts items not displayed due to a StartingConditional.
/// @return The index of the current node.
int NWNX_Dialog_GetCurrentNodeIndex();
/// @brief Get the text of the current node
/// @param language The @ref dialog_languages "language" of the text.
/// @param gender The gender for the text.
string NWNX_Dialog_GetCurrentNodeText(int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE);
/// @brief Set the text of the current node for given language/gender
/// @note This will only work in a starting conditional script (action take comes after the text is displayed)
/// @param text The text for the node.
/// @param language The @ref dialog_languages "language" of the text.
/// @param gender The gender for the text.
void NWNX_Dialog_SetCurrentNodeText(string text, int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE);
/// @brief End a conversation oObject is involved in, it will fire the OnAbort script of the conversation
/// @warning Calling this from a conversation script will crash your server.
/// @param oObject The object in a conversation
void NWNX_Dialog_End(object oObject);
/// @}
int NWNX_Dialog_GetCurrentNodeType()
{
string sFunc = "GetCurrentNodeType";
NWNX_CallFunction(NWNX_Dialog, sFunc);
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
}
int NWNX_Dialog_GetCurrentScriptType()
{
string sFunc = "GetCurrentScriptType";
NWNX_CallFunction(NWNX_Dialog, sFunc);
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
}
int NWNX_Dialog_GetCurrentNodeID()
{
string sFunc = "GetCurrentNodeID";
NWNX_CallFunction(NWNX_Dialog, sFunc);
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
}
int NWNX_Dialog_GetCurrentNodeIndex()
{
string sFunc = "GetCurrentNodeIndex";
NWNX_CallFunction(NWNX_Dialog, sFunc);
return NWNX_GetReturnValueInt(NWNX_Dialog, sFunc);
}
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_CallFunction(NWNX_Dialog, sFunc);
return NWNX_GetReturnValueString(NWNX_Dialog, sFunc);
}
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_CallFunction(NWNX_Dialog, sFunc);
}
void NWNX_Dialog_End(object oObject)
{
string sFunc = "End";
NWNX_PushArgumentObject(NWNX_Dialog, sFunc, oObject);
NWNX_CallFunction(NWNX_Dialog, sFunc);
}

@ -0,0 +1,259 @@
/// @addtogroup effect Effect
/// @brief Utility functions to manipulate the builtin effect type.
/// @{
/// @file nwnx_effect.nss
#include "nwnx"
const string NWNX_Effect = "NWNX_Effect"; ///< @private
/// An unpacked effect
struct NWNX_EffectUnpacked
{
int nType; ///< @todo Describe
int nSubType; ///< @todo Describe
float fDuration; ///< @todo Describe
int nExpiryCalendarDay; ///< @todo Describe
int nExpiryTimeOfDay; ///< @todo Describe
object oCreator; ///< @todo Describe
int nSpellId; ///< @todo Describe
int bExpose; ///< @todo Describe
int bShowIcon; ///< @todo Describe
int nCasterLevel; ///< @todo Describe
effect eLinkLeft; ///< @todo Describe
int bLinkLeftValid; ///< @todo Describe
effect eLinkRight; ///< @todo Describe
int bLinkRightValid; ///< @todo Describe
int nNumIntegers; ///< @todo Describe
int nParam0; ///< @todo Describe
int nParam1; ///< @todo Describe
int nParam2; ///< @todo Describe
int nParam3; ///< @todo Describe
int nParam4; ///< @todo Describe
int nParam5; ///< @todo Describe
int nParam6; ///< @todo Describe
int nParam7; ///< @todo Describe
float fParam0; ///< @todo Describe
float fParam1; ///< @todo Describe
float fParam2; ///< @todo Describe
float fParam3; ///< @todo Describe
string sParam0; ///< @todo Describe
string sParam1; ///< @todo Describe
string sParam2; ///< @todo Describe
string sParam3; ///< @todo Describe
string sParam4; ///< @todo Describe
string sParam5; ///< @todo Describe
object oParam0; ///< @todo Describe
object oParam1; ///< @todo Describe
object oParam2; ///< @todo Describe
object oParam3; ///< @todo Describe
vector vParam0; ///< @todo Describe
vector vParam1; ///< @todo Describe
string sTag; ///< @todo Describe
};
/// @brief Convert native effect type to unpacked structure.
/// @param e The effect to convert.
/// @return A constructed NWNX_EffectUnpacked.
struct NWNX_EffectUnpacked NWNX_Effect_UnpackEffect(effect e);
/// @brief Convert unpacked effect structure to native type.
/// @param e The NWNX_EffectUnpacked structure to convert.
/// @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);
/// @}
struct NWNX_EffectUnpacked NWNX_Effect_UnpackEffect(effect e)
{
string sFunc = "UnpackEffect";
NWNX_PushArgumentEffect(NWNX_Effect, sFunc, 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;
}
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_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);
}
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_CallFunction(NWNX_Effect, sFunc);
return NWNX_GetReturnValueInt(NWNX_Effect, sFunc);
}

244
nwnds_module/nwnx_elc.nss Normal file

@ -0,0 +1,244 @@
/// @addtogroup elc ELC
/// @brief Replacement for ValidateCharacter: ELC & ILR
/// @{
/// @file nwnx_elc.nss
#include "nwnx"
const string NWNX_ELC = "NWNX_ELC"; ///< @private
/// @anchor elc_fail_type
/// @name ELC Failure Types
/// @{
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_NONE = 0;
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_CHARACTER = 1;
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_ITEM = 2;
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_SKILL = 3;
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_FEAT = 4;
const int NWNX_ELC_VALIDATION_FAILURE_TYPE_SPELL = 5;
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;
const int NWNX_ELC_SUBTYPE_UNIDENTIFIED_EQUIPPED_ITEM = 4;
const int NWNX_ELC_SUBTYPE_MIN_EQUIP_LEVEL = 5;
const int NWNX_ELC_SUBTYPE_NON_PC_CHARACTER = 6;
const int NWNX_ELC_SUBTYPE_DM_CHARACTER = 7;
const int NWNX_ELC_SUBTYPE_NON_PLAYER_RACE = 8;
const int NWNX_ELC_SUBTYPE_NON_PLAYER_CLASS = 9;
const int NWNX_ELC_SUBTYPE_CLASS_LEVEL_RESTRICTION = 10;
const int NWNX_ELC_SUBTYPE_PRESTIGE_CLASS_REQUIREMENTS = 11;
const int NWNX_ELC_SUBTYPE_CLASS_ALIGNMENT_RESTRICTION = 12;
const int NWNX_ELC_SUBTYPE_STARTING_ABILITY_VALUE_MAX = 13;
const int NWNX_ELC_SUBTYPE_ABILITY_POINT_BUY_SYSTEM_CALCULATION = 14;
const int NWNX_ELC_SUBTYPE_CLASS_SPELLCASTER_INVALID_PRIMARY_STAT = 15;
const int NWNX_ELC_SUBTYPE_EPIC_LEVEL_FLAG = 16;
const int NWNX_ELC_SUBTYPE_TOO_MANY_HITPOINTS = 17;
const int NWNX_ELC_SUBTYPE_UNUSABLE_SKILL = 18;
const int NWNX_ELC_SUBTYPE_NOT_ENOUGH_SKILLPOINTS = 19;
const int NWNX_ELC_SUBTYPE_INVALID_NUM_RANKS_IN_CLASS_SKILL = 20;
const int NWNX_ELC_SUBTYPE_INVALID_NUM_RANKS_IN_NON_CLASS_SKILL = 21;
const int NWNX_ELC_SUBTYPE_INVALID_NUM_REMAINING_SKILL_POINTS = 22;
const int NWNX_ELC_SUBTYPE_INVALID_FEAT = 23;
const int NWNX_ELC_SUBTYPE_FEAT_REQUIRED_SPELL_LEVEL_NOT_MET = 24;
const int NWNX_ELC_SUBTYPE_FEAT_REQUIRED_BASE_ATTACK_BONUS_NOT_MET = 25;
const int NWNX_ELC_SUBTYPE_FEAT_REQUIRED_ABILITY_VALUE_NOT_MET = 26;
const int NWNX_ELC_SUBTYPE_FEAT_REQUIRED_SKILL_NOT_MET = 27;
const int NWNX_ELC_SUBTYPE_FEAT_REQUIRED_FEAT_NOT_MET = 28;
const int NWNX_ELC_SUBTYPE_TOO_MANY_FEATS_THIS_LEVEL = 29;
const int NWNX_ELC_SUBTYPE_FEAT_NOT_AVAILABLE_TO_CLASS = 30;
const int NWNX_ELC_SUBTYPE_FEAT_IS_NORMAL_FEAT_ONLY = 31;
const int NWNX_ELC_SUBTYPE_FEAT_IS_BONUS_FEAT_ONLY = 32;
const int NWNX_ELC_SUBTYPE_SPELL_INVALID_SPELL_GAIN_WIZARD = 33;
const int NWNX_ELC_SUBTYPE_SPELL_INVALID_SPELL_GAIN_BARD_SORCERER = 34;
const int NWNX_ELC_SUBTYPE_SPELL_INVALID_SPELL_GAIN_OTHER_CLASSES = 35;
const int NWNX_ELC_SUBTYPE_INVALID_SPELL = 36;
const int NWNX_ELC_SUBTYPE_SPELL_INVALID_SPELL_LEVEL = 37;
const int NWNX_ELC_SUBTYPE_SPELL_MINIMUM_ABILITY = 40;
const int NWNX_ELC_SUBTYPE_SPELL_RESTRICTED_SPELL_SCHOOL = 41;
const int NWNX_ELC_SUBTYPE_SPELL_ALREADY_KNOWN = 42;
const int NWNX_ELC_SUBTYPE_SPELL_WIZARD_EXCEEDS_NUMSPELLS_TO_ADD = 43;
const int NWNX_ELC_SUBTYPE_ILLEGAL_REMOVED_SPELL = 44;
const int NWNX_ELC_SUBTYPE_REMOVED_NOT_KNOWN_SPELL = 45;
const int NWNX_ELC_SUBTYPE_INVALID_NUM_SPELLS = 46;
const int NWNX_ELC_SUBTYPE_SPELL_LIST_COMPARISON = 47;
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;
*/
/// @}
/// @brief Sets the script that runs whenever an ELC validation failure happens
/// @param sScript The script name.
void NWNX_ELC_SetELCScript(string sScript);
/// @brief Enables a custom ELC Check that will call the ELC Script with the
/// NWNX_ELC_VALIDATION_FAILURE_TYPE_CUSTOM type.
/// @param bEnabled TRUE to use this check.
/// @note Only runs if you have an ELC script set, be sure to skip this check
/// if a player doesn't fail your custom check otherwise they won't be able to log in
void NWNX_ELC_EnableCustomELCCheck(int bEnabled);
/// @brief Skip an ELC Validation Failure Event
/// @note Only to be called in the ELC Script
void NWNX_ELC_SkipValidationFailure();
/// @brief Get the validation failure type
/// @return A @ref elc_fail_type "Validation Failure Type"
/// @note Only to be called in the ELC Script
int NWNX_ELC_GetValidationFailureType();
/// @brief Get the validation failure subtype
/// @return A @ref elc_fail_subtype "Validation Failure Subtype"
/// @note Only to be called in the ELC Script
int NWNX_ELC_GetValidationFailureSubType();
/// @brief Get the failure message
/// @return The talk table strref the player receives.
/// @note Only to be called in the ELC Script
int NWNX_ELC_GetValidationFailureMessageStrRef();
/// @brief Set the failure message
/// @param nStrRef The talk table strref the player receives, must be > 0.
/// @note Only to be called in the ELC Script
void NWNX_ELC_SetValidationFailureMessageStrRef(int nStrRef);
/// @brief Get the item that failed ILR validation
/// @return The object that caused the ILR validation failure. Returns OBJECT_INVALID on error.
/// @note Only to be called in the ELC Script during a
/// NWNX_ELC_VALIDATION_FAILURE_TYPE_ITEM validation failure.
object NWNX_ELC_GetValidationFailureItem();
/// @brief Get the character level at which the validation failure occurred
/// @return The character level or -1 on error.
/// @remark May not always return a level, depending on where the failure occurred.
/// @note Only to be called in the ELC Script
int NWNX_ELC_GetValidationFailureLevel();
/// @brief Get the ID of the skill that failed ELC validation
/// @return The skill ID or -1 on error.
/// @remark May not always return a skill id, depending on the validation failure subtype.
/// @note Only to be called in the ELC Script during a
/// NWNX_ELC_VALIDATION_FAILURE_TYPE_SKILL validation failure.
int NWNX_ELC_GetValidationFailureSkillID();
/// @brief Get the ID of the feat that failed ELC validation
/// @return The feat ID or -1 on error
/// @remark May not always return a feat id, depending on the validation failure subtype.
/// @note Only to be called in the ELC Script during a
/// NWNX_ELC_VALIDATION_FAILURE_TYPE_FEAT validation failure.
int NWNX_ELC_GetValidationFailureFeatID();
/// @brief Get the ID of the spell that failed ELC validation
/// @return The spell ID or -1 on error
/// @remark May not always return a spell id, depending on the validation failure subtype.
/// @note Only to be called in the ELC Script during a
/// NWNX_ELC_VALIDATION_FAILURE_TYPE_SPELL validation failure.
int NWNX_ELC_GetValidationFailureSpellID();
/// @}
void NWNX_ELC_SetELCScript(string sScript)
{
string sFunc = "SetELCScript";
NWNX_PushArgumentString(NWNX_ELC, sFunc, sScript);
NWNX_CallFunction(NWNX_ELC, sFunc);
}
void NWNX_ELC_EnableCustomELCCheck(int bEnabled)
{
string sFunc = "EnableCustomELCCheck";
NWNX_PushArgumentInt(NWNX_ELC, sFunc, bEnabled);
NWNX_CallFunction(NWNX_ELC, sFunc);
}
void NWNX_ELC_SkipValidationFailure()
{
string sFunc = "SkipValidationFailure";
NWNX_CallFunction(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureType()
{
string sFunc = "GetValidationFailureType";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureSubType()
{
string sFunc = "GetValidationFailureSubType";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureMessageStrRef()
{
string sFunc = "GetValidationFailureMessageStrRef";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
void NWNX_ELC_SetValidationFailureMessageStrRef(int nStrRef)
{
string sFunc = "SetValidationFailureMessageStrRef";
NWNX_PushArgumentInt(NWNX_ELC, sFunc, nStrRef);
NWNX_CallFunction(NWNX_ELC, sFunc);
}
object NWNX_ELC_GetValidationFailureItem()
{
string sFunc = "GetValidationFailureItem";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueObject(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureLevel()
{
string sFunc = "GetValidationFailureLevel";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureSkillID()
{
string sFunc = "GetValidationFailureSkillID";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureFeatID()
{
string sFunc = "GetValidationFailureFeatID";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}
int NWNX_ELC_GetValidationFailureSpellID()
{
string sFunc = "GetValidationFailureSpellID";
NWNX_CallFunction(NWNX_ELC, sFunc);
return NWNX_GetReturnValueInt(NWNX_ELC, sFunc);
}

@ -0,0 +1,285 @@
/// @addtogroup encounter Encounter
/// @brief Functions exposing additional encounter properties.
/// @{
/// @file nwnx_encounter.nss
#include "nwnx"
const string NWNX_Encounter = "NWNX_Encounter"; ///< @private
/// @brief A creature list entry for an encounter.
struct NWNX_Encounter_CreatureListEntry
{
string resref; ///< The resref.
float challengeRating; ///< The challenge rating.
int unique; ///< Creature will be unique to the encounter.
int alreadyUsed; //< Creature has already been used.
};
/// @brief Get the number of creatures in the encounter list
/// @param encounter The encounter object.
/// @return The number of creatures in the encounter list.
int NWNX_Encounter_GetNumberOfCreaturesInEncounterList(object encounter);
/// @brief Gets the encounter creature list entry at the specified index
/// @param encounter The encounter object.
/// @param index The index of the creature in the encounter list.
/// @return An NWNX_Encounter_CreatureListEntry.
struct NWNX_Encounter_CreatureListEntry NWNX_Encounter_GetEncounterCreatureByIndex(object encounter, int index);
/// @brief Set the encounter creature list entry at the specified index
/// @param encounter The encounter object.
/// @param index The index of the creature in the encounter list.
/// @param creatureEntry The NWNX_Encounter_CreatureListEntry.
void NWNX_Encounter_SetEncounterCreatureByIndex(object encounter, int index, struct NWNX_Encounter_CreatureListEntry creatureEntry);
/// @brief Get the faction id of encounter
/// @param encounter The encounter object.
/// @return The faction id.
int NWNX_Encounter_GetFactionId(object encounter);
/// @brief Set the faction id of encounter.
/// @param encounter The encounter object.
/// @param factionId The faction id.
void NWNX_Encounter_SetFactionId(object encounter, int factionId);
/// @brief Get if encounter is player triggered only.
/// @param encounter The encounter object.
/// @return TRUE if encounter is player triggered only.
int NWNX_Encounter_GetPlayerTriggeredOnly(object encounter);
/// @brief Set if encounter is player triggered only.
/// @param encounter The encounter object.
/// @param playerTriggeredOnly TRUE/FALSE
void NWNX_Encounter_SetPlayerTriggeredOnly(object encounter, int playerTriggeredOnly);
/// @brief Get the reset time of encounter.
/// @param encounter The encounter object.
/// @return The seconds the encounter is defined to reset.
int NWNX_Encounter_GetResetTime(object encounter);
/// @brief Set the reset time of encounter.
/// @param encounter The encounter object.
/// @param resetTime The seconds the encounter will reset.
void NWNX_Encounter_SetResetTime(object encounter, int resetTime);
/// @brief Get the number of spawn points of encounter.
/// @param encounter The encounter object.
/// @return The count of the spawn points for the encounter.
int NWNX_Encounter_GetNumberOfSpawnPoints(object encounter);
/// @brief Gets the spawn point list entry at the specified index
/// @param encounter The encounter object.
/// @param index The index of the spawn point in the encounter list.
/// @return Location of spawn point.
location NWNX_Encounter_GetSpawnPointByIndex(object encounter, int index);
/// @brief Get the minimum amount of creatures that encounter will spawn.
/// @param encounter The encounter object.
/// @return the minimal amount.
int NWNX_Encounter_GetMinNumSpawned(object encounter);
/// @brief Get the maximum amount of creatures that encounter will spawn.
/// @param encounter The encounter object.
/// @return the maximal amount.
int NWNX_Encounter_GetMaxNumSpawned(object encounter);
/// @brief Get the current number of creatures that are spawned and alive
/// @param encounter The encounter object.
/// @return amount of creatures
int NWNX_Encounter_GetCurrentNumSpawned(object encounter);
/// @brief Get the geometry of an encounter
/// @param oEncounter: The encounter object.
/// @return A string of vertex positions.
string NWNX_Encounter_GetGeometry(object oEncounter);
/// @brief Set the geometry of an encounter with a list of vertex positions
/// @param oTrigger The encounter object.
/// @param sGeometry Needs to be in the following format -> {x.x, y.y, z.z} or {x.x, y.y}
/// Example Geometry: "{1.0, 1.0, 0.0}{4.0, 1.0, 0.0}{4.0, 4.0, 0.0}{1.0, 4.0, 0.0}"
///
/// @remark The Z position is optional and will be calculated dynamically based
/// on terrain height if it's not provided.
///
/// @remark The minimum number of vertices is 3.
void NWNX_Encounter_SetGeometry(object oTrigger, string sGeometry);
/// @}
int NWNX_Encounter_GetNumberOfCreaturesInEncounterList(object encounter)
{
string sFunc = "GetNumberOfCreaturesInEncounterList";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
struct NWNX_Encounter_CreatureListEntry NWNX_Encounter_GetEncounterCreatureByIndex(object encounter, int index)
{
string sFunc = "GetEncounterCreatureByIndex";
struct NWNX_Encounter_CreatureListEntry creatureEntry;
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, index);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, 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);
return creatureEntry;
}
void NWNX_Encounter_SetEncounterCreatureByIndex(object encounter, int index, struct NWNX_Encounter_CreatureListEntry creatureEntry)
{
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_CallFunction(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetFactionId(object encounter)
{
string sFunc = "GetFactionId";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
void NWNX_Encounter_SetFactionId(object encounter, int factionId)
{
string sFunc = "SetFactionId";
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, factionId);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetPlayerTriggeredOnly(object encounter)
{
string sFunc = "GetPlayerTriggeredOnly";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
void NWNX_Encounter_SetPlayerTriggeredOnly(object encounter, int playerTriggeredOnly)
{
string sFunc = "SetPlayerTriggeredOnly";
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, playerTriggeredOnly);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetResetTime(object encounter)
{
string sFunc = "GetResetTime";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
void NWNX_Encounter_SetResetTime(object encounter, int resetTime)
{
string sFunc = "SetResetTime";
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, resetTime);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetNumberOfSpawnPoints(object encounter)
{
string sFunc = "GetNumberOfSpawnPoints";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
location NWNX_Encounter_GetSpawnPointByIndex(object encounter, int index)
{
string sFunc = "GetSpawnPointByIndex";
NWNX_PushArgumentInt(NWNX_Encounter, sFunc, index);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, 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);
return Location(GetArea(encounter), Vector(x, y, z), o);
}
int NWNX_Encounter_GetMinNumSpawned(object encounter)
{
string sFunc = "GetMinNumSpawned";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetMaxNumSpawned(object encounter)
{
string sFunc = "GetMaxNumSpawned";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
int NWNX_Encounter_GetCurrentNumSpawned(object encounter)
{
string sFunc = "GetCurrentNumSpawned";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, encounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueInt(NWNX_Encounter, sFunc);
}
string NWNX_Encounter_GetGeometry(object oEncounter)
{
string sFunc = "GetGeometry";
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, oEncounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
return NWNX_GetReturnValueString(NWNX_Encounter, sFunc);
}
void NWNX_Encounter_SetGeometry(object oEncounter, string sGeometry)
{
string sFunc = "SetGeometry";
NWNX_PushArgumentString(NWNX_Encounter, sFunc, sGeometry);
NWNX_PushArgumentObject(NWNX_Encounter, sFunc, oEncounter);
NWNX_CallFunction(NWNX_Encounter, sFunc);
}

Some files were not shown because too many files have changed in this diff Show More