diff --git a/CHANGELOG.md b/CHANGELOG.md index acaf1c1e7bf..2160d0afc66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ https://github.com/nwnxee/unified/compare/build8193.37.13...HEAD - N/A ### Removed -- N/A +- Removed NWNX_Lua and NWNX_SpellChecker due to presumably being unused and bitrotten. ### Fixed - Fixed `NWNX_TWEAKS_SETAREA_CALLS_SETPOSITION` not working with `NWNX_ON_MATERIALCHANGE_*`. diff --git a/Plugins/Lua/CMakeLists.txt b/Plugins/Lua/CMakeLists.txt deleted file mode 100644 index 7b553f15005..00000000000 --- a/Plugins/Lua/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -#CmakeLists.txt -# search for luajit before -find_package(LuaJIT) -if (LuaJIT_FOUND) - add_plugin(Lua Lua.cpp Lua_Functions.cpp ) - target_include_directories(Lua PRIVATE "${LUAJIT_INCLUDE_DIR}" ) - target_link_libraries( Lua ${LUAJIT_LIBRARY} ) - add_definitions( -DNWNX_LUA_LUAJIT ) - add_definitions( -DNWNX_LUA_LIBRARY="${LUAJIT_LIBRARY}" ) -else (LuaJIT_FOUND) - find_package(Lua) - if (Lua_FOUND) - add_plugin(Lua Lua.cpp Lua_Functions.cpp ) - target_include_directories(Lua PRIVATE "${LUA_INCLUDE_DIR}" ) - target_link_libraries( Lua ${LUA_LIBRARY} ) - add_definitions( -DNWNX_LUA_LIBRARY="${LUA_LIBRARY}" ) - endif (Lua_FOUND) -endif (LuaJIT_FOUND) \ No newline at end of file diff --git a/Plugins/Lua/Lua.cpp b/Plugins/Lua/Lua.cpp deleted file mode 100644 index daa83334e15..00000000000 --- a/Plugins/Lua/Lua.cpp +++ /dev/null @@ -1,381 +0,0 @@ -#include "Lua.hpp" - -#include "API/Globals.hpp" -#include "API/CExoBase.hpp" -#include "API/Functions.hpp" -#include "API/CNWSVirtualMachineCommands.hpp" -//for objectself -#include "API/CVirtualMachine.hpp" -// for dlopen -#ifdef NWNX_LUA_LIBRARY -#include -#endif - - -using namespace NWNXLib; -static Lua::Lua* g_plugin; - -NWNX_PLUGIN_ENTRY Plugin* PluginLoad(Services::ProxyServiceList* services) -{ - g_plugin = new Lua::Lua(services); - return g_plugin; -} - -namespace Lua { - - using namespace NWNXLib::Services; - using namespace NWNXLib::API; - using namespace NWNXLib; - - static Hooks::Hook s_RunScriptHook; - static Hooks::Hook s_RunScriptSituationHook; - - Lua::Lua(Services::ProxyServiceList* services) : Plugin(services) - { - std::string userDir = std::string(Globals::ExoBase()->m_sUserDirectory.CStr()); - - // This dcall assure that external object libraries required by lua can have the lualib loaded and exported, - // It seems that by default cmake link library with RTLD_LOCAL so the symbols in the lualib are not visible by - // external object required/loaded in lua code. - // With this trick the library visibility will become global without load it a second time (RTLD_NOLOAD) - // Without this trick if you load/require an object extension you will have the error: *undefined symbol* - // on some lua_api functions. - // Dont know if that is necessary for Mac - #ifdef NWNX_LUA_LIBRARY - dlopen(NWNX_LUA_LIBRARY, RTLD_NOW | RTLD_NOLOAD | RTLD_GLOBAL); - #endif - - // create new Lua instance and open libs - m_luaInstance = luaL_newstate(); - luaL_openlibs(m_luaInstance); - - // open nwnx specific functions - LUA_InitNWScript(m_luaInstance); - - //set global USER_DIR in Lua - lua_pushstring(m_luaInstance, userDir.c_str()); - lua_setglobal(m_luaInstance, "USER_DIR"); - - // get configuration - // mandatory preload script and Token Function - std::string preloadScript = Config::Get("PRELOAD_SCRIPT", userDir+"/lua/preload.lua"); - std::string tokenFunction = Config::Get("TOKEN_FUNCTION", "CallToken"); - - // if you want to use an event framework instead of use only Eval and EvalVoid, less intensive - std::string eventFunction = Config::Get("EVENT_FUNCTION", "RunEvent"); - - // custom Set OBJECT_SELF function accepting an integer as argument (the current value of OBJECT_SELF) - // if this configuration is not defined a global OBJECT_SELF integer wil be keeped aligned to the current value - // This is useful if you want to write OOP code and treat nwn objects as lua classes and not as numbers - // The other function in wich you recive a numeric object is the RunEvent Function, - // but RunEvent is in lua code so you can modifiy as you want - std::string setObjSelfFunction = Config::Get("OBJSELF_FUNCTION", ""); - - // Name of the table containg the functions called in the run script hook - // Optional; a function with the same name of the script executed will be run before - // the script, if returning something diffferent from nil the script execution will be skipped, - // if returns a Lua boolean is treated like a return value from a StartingConditional() in NWScript - std::string runScriptTable = Config::Get("RUNSCRIPT_TABLE", ""); - - // loading preload code - // Dont call any NWN function in this script like SetLocalString(), GetModule() etc - // the module is not loaded and you can have strange errors with premature crash - // the trick is to load/require the remainig scripts on the module_load event - LOG_DEBUG("Loding preload script: %s", preloadScript); - if(luaL_dofile(m_luaInstance, preloadScript.c_str())) - { - LOG_ERROR("Error loading preload script: %s", lua_tostring(m_luaInstance, -1)); - } - lua_settop(m_luaInstance, 0); - - // save the Token function in the lua registry for fast access - lua_getglobal(m_luaInstance, tokenFunction.c_str()); - m_tokenFunction = luaL_ref(m_luaInstance, LUA_REGISTRYINDEX); - - // save the Event function in the lua registry for fast access - lua_getglobal(m_luaInstance, eventFunction.c_str()); - m_eventFunction = luaL_ref(m_luaInstance, LUA_REGISTRYINDEX); - - // default assignement - m_object_self = Constants::OBJECT_INVALID; - - if(setObjSelfFunction.empty()) - { - m_setObjSelfFunction = [&](ObjectID objSelf) - { - lua_pushinteger(m_luaInstance, objSelf); - lua_setglobal(m_luaInstance, "OBJECT_SELF"); - }; - } - else - { - // Save the SetObjectSelf function in the lua registry - lua_getglobal(m_luaInstance, setObjSelfFunction.c_str()); - int iRef = luaL_ref(m_luaInstance, LUA_REGISTRYINDEX); - - m_setObjSelfFunction = [&, iRef](ObjectID objSelf) - { - lua_rawgeti(m_luaInstance, LUA_REGISTRYINDEX, iRef); - lua_pushinteger(m_luaInstance, objSelf); - if (lua_pcall(m_luaInstance, 1, 0, 0) != 0) - { - LOG_ERROR("Error on OBJSELF_FUNCTION function, object 0x%x: %s", objSelf, lua_tostring(m_luaInstance, -1)); - lua_remove(m_luaInstance, -1); - } - }; - } - - // bind events - ScriptAPI::RegisterEvent(PLUGIN_NAME, "Eval", std::bind(&Lua::Eval, this, std::placeholders::_1)); - ScriptAPI::RegisterEvent(PLUGIN_NAME, "EvalVoid", std::bind(&Lua::EvalVoid, this, std::placeholders::_1)); - ScriptAPI::RegisterEvent(PLUGIN_NAME, "RunEvent", std::bind(&Lua::RunEvent, this, std::placeholders::_1)); - - // RunScript hook - if(!runScriptTable.empty()) - { - // save the Scripts table in the registry - lua_getglobal(m_luaInstance, runScriptTable.c_str()); - m_runScriptTable = luaL_ref(m_luaInstance, LUA_REGISTRYINDEX); - - s_RunScriptHook = Hooks::HookFunction(&CVirtualMachine::RunScript, - +[](CVirtualMachine* thisPtr, CExoString* script, ObjectID objId, int32_t valid, int32_t eventId) - { - bool skip = script->m_sString && g_plugin->OnScript(script->m_sString, objId, !!valid); - return skip ? 1 : s_RunScriptHook->CallOriginal(thisPtr, script, objId, valid, eventId); - }, - Hooks::Order::Latest); - } - - // RunScriptSituation hook - s_RunScriptSituationHook = Hooks::HookFunction(&CVirtualMachine::RunScriptSituation, - +[](CVirtualMachine* thisPtr, CVirtualMachineScript* script, ObjectID oid, int32_t oidValid) - { - if (strstr(script->m_sScriptName.m_sString, "NWNX_LUA_INTERNAL")) - { - char* token = strstr(script->m_sScriptName.m_sString, " "); - if (token) - { - g_plugin->OnToken(oid, token + 1); - delete script; - } - return 1; - } - - return s_RunScriptSituationHook->CallOriginal(thisPtr, script, oid, oidValid); - }, - Hooks::Order::Latest); - } - - Lua::~Lua() - { - // run last event so resources on Lua side could be released, i.e: closing DB connections - LOG_INFO("Running server_shutdown event"); - lua_rawgeti(m_luaInstance, LUA_REGISTRYINDEX, m_eventFunction); /* function to be called */ - lua_pushstring(m_luaInstance, "server_shutdown"); /* push 1st argument */ - lua_pushinteger(m_luaInstance, 0); /* push 2nd argument */ - - if (lua_pcall(m_luaInstance, 2, 0, 0) != 0) - { - LOG_ERROR("Error on Event server_shutdown, object 0x0: %s", lua_tostring(m_luaInstance, -1)); - } - - lua_settop (m_luaInstance, 0); - LOG_INFO("Lua Shutdown, Memory: %d Kb", lua_gc(m_luaInstance, LUA_GCCOUNT, 0)); - } - - // Eval Lua code and returns the result - ArgumentStack Lua::Eval(ArgumentStack&& args) - { - const auto code = ScriptAPI::ExtractArgument(args); - ArgumentStack stack; - - SetObjectSelf(); - - LOG_DEBUG("Eval request code: %s", code); - - if(luaL_dostring(m_luaInstance, code.c_str())) - { - LOG_ERROR("Error on Eval: %s", lua_tostring(m_luaInstance, -1)); - ScriptAPI::InsertArgument(stack, std::string("")); - } - else if(lua_gettop(m_luaInstance)) - { - size_t iLength = 0; - const char *returnStr = lua_tolstring(m_luaInstance, -1, &iLength); - ScriptAPI::InsertArgument(stack, std::string(returnStr, iLength)); - } - else - { - ScriptAPI::InsertArgument(stack, std::string("")); - } - lua_settop(m_luaInstance, 0); - return stack; - } - - // Eval Lua code without result - ArgumentStack Lua::EvalVoid(ArgumentStack&& args) - { - const auto code = ScriptAPI::ExtractArgument(args); - ArgumentStack stack; - - SetObjectSelf(); - - LOG_DEBUG("Evalvoid request code: %s", code); - - if(luaL_dostring(m_luaInstance, code.c_str())) - { - LOG_ERROR("Error on EvalVoid: %s", lua_tostring(m_luaInstance, -1)); - } - - lua_settop(m_luaInstance, 0); - return stack; - } - - // Used to emulate DelayCommand, AssignCommand and ActioDoCommand - void Lua::OnToken(ObjectID oid, char* token) - { - GetVm()->m_nRecursionLevel += 1; - - GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel] = oid; - GetVm()->m_bValidObjectRunScript[GetVm()->m_nRecursionLevel] = 1; - GetVmCommands()->m_oidObjectRunScript = GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel]; - GetVmCommands()->m_bValidObjectRunScript = GetVm()->m_bValidObjectRunScript[GetVm()->m_nRecursionLevel]; - - SetObjectSelf(oid); - - LOG_DEBUG("Token %s on OBJECT: 0x%x", token, oid); - - lua_rawgeti(m_luaInstance, LUA_REGISTRYINDEX, m_tokenFunction); - lua_pushstring(m_luaInstance, token); /* push 1st argument */ - if (lua_pcall(m_luaInstance, 1, 0, 0) != 0) - { - LOG_ERROR("Error on Token %s: %s", token, lua_tostring(m_luaInstance, -1)); - } - - lua_settop(m_luaInstance, 0); - - GetVm()->m_nRecursionLevel -= 1; - } - - // Call the event function - ArgumentStack Lua::RunEvent(ArgumentStack&& args) - { - const auto eventStr = ScriptAPI::ExtractArgument(args); - const auto objectId = ScriptAPI::ExtractArgument(args); - const auto extraStr = ScriptAPI::ExtractArgument(args); - ArgumentStack stack; - - SetObjectSelf(); - - LOG_DEBUG("Event %s on OBJECT: 0x%x", eventStr, objectId); - - lua_rawgeti(m_luaInstance, LUA_REGISTRYINDEX, m_eventFunction); /* function to be called */ - lua_pushstring(m_luaInstance, eventStr.c_str()); /* push 1st argument */ - lua_pushinteger(m_luaInstance, objectId); /* push 2nd argument */ - lua_pushstring(m_luaInstance, extraStr.c_str()); /* push 3st argument */ - - if (lua_pcall(m_luaInstance, 3, 0, 0) != 0) - { - LOG_ERROR("Error on Event %s, object 0x%x: %s", eventStr, objectId, lua_tostring(m_luaInstance, -1)); - } - - lua_settop(m_luaInstance, 0); - return stack; - } - - bool Lua::OnScript(const char* scriptName, ObjectID objId, bool valid) - { - bool bSkip = false; - - //LOG_DEBUG("Called Script %s, OBJECT: 0x%x", scriptName, objId); - lua_rawgeti(m_luaInstance, LUA_REGISTRYINDEX, m_runScriptTable); - lua_getfield(m_luaInstance, -1, scriptName); - - // check if the functions exists in the m_runScriptTable Table - if(lua_isfunction(m_luaInstance, -1)) - { - LOG_DEBUG("RunScript Hook: %s function found, object 0x%x", scriptName, objId); - - // PREPARE VM - if (GetVm()->m_nRecursionLevel == -1) - { - GetVm()->m_cRunTimeStack.InitializeStack(); - GetVm()->m_cRunTimeStack.m_pVMachine = GetVm(); - } - GetVm()->m_nReturnValueParameterType = 0; - GetVm()->m_pReturnValue = nullptr; - GetVm()->m_nRecursionLevel += 1; - GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel] = objId; - GetVm()->m_bValidObjectRunScript[GetVm()->m_nRecursionLevel] = valid; - GetVmCommands()->m_oidObjectRunScript = GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel]; - GetVmCommands()->m_bValidObjectRunScript = GetVm()->m_bValidObjectRunScript[GetVm()->m_nRecursionLevel]; - - int spBefore = GetVm()->m_cRunTimeStack.GetStackPointer(); - - SetObjectSelf(objId); - - if (lua_pcall(m_luaInstance, 0, 1, 0) != 0) // call with 0 args and a return value - { - LOG_ERROR("Error on function %s: %s", scriptName, lua_tostring(m_luaInstance, -1)); - } - else - { - if(!lua_isnil(m_luaInstance, -1)) - { - // we got something so skip the original script call - bSkip = true; - LOG_DEBUG("Skipping %s execution", scriptName); - - - if(lua_isboolean(m_luaInstance, -1)) - { - // we got a boolean: it's a result from a starting conditional!! - int retval = lua_toboolean(m_luaInstance, -1); - LOG_DEBUG("Got a returning boolean from function %s, value: %d", scriptName, retval); - GetVm()->m_nReturnValueParameterType = 0x03; - GetVm()->m_pReturnValue = reinterpret_cast(retval); - } - } - } - - // check the VM stack - int spAfter = GetVm()->m_cRunTimeStack.GetStackPointer(); - if (spBefore != spAfter) - { - LOG_WARNING("The stack pointer before (%d) and after (%d) were different - stack over/underflow in script %s?", spBefore, spAfter, scriptName); - } - - // CLEANUP VM - GetVm()->m_nRecursionLevel -= 1; - if (GetVm()->m_nRecursionLevel != -1) - { - GetVmCommands()->m_oidObjectRunScript = GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel]; - GetVmCommands()->m_bValidObjectRunScript = GetVm()->m_bValidObjectRunScript[GetVm()->m_nRecursionLevel]; - } - - } - // clean the stack - lua_settop(m_luaInstance, 0); - return bSkip; - } - - // Set a global number OBJECT_SELF at each request of running Lua code, - // if a function is present in the configuration - // call that function instead, leave the stack clean even on error - void Lua::SetObjectSelf(ObjectID objSelf) - { - if(objSelf == Constants::OBJECT_INVALID) - { - objSelf = GetVm()->m_oidObjectRunScript[GetVm()->m_nRecursionLevel]; - } - // change only if there is a change of context - if(m_object_self == objSelf) - { - return; - } - LOG_DEBUG("Setting OBJECT_SELF to 0x%x", objSelf); - m_setObjSelfFunction(objSelf); - m_object_self = objSelf; - } - -} diff --git a/Plugins/Lua/Lua.hpp b/Plugins/Lua/Lua.hpp deleted file mode 100644 index 2486d67420f..00000000000 --- a/Plugins/Lua/Lua.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "nwnx.hpp" -#include "API/Constants.hpp" -extern "C" { -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#ifdef NWNX_LUA_LUAJIT -#include "luajit.h" -#endif -} -#include "Lua_Functions.hpp" - -namespace Lua { - using namespace NWNXLib::Services; - using namespace NWNXLib::API; - using namespace NWNXLib; - class Lua : public NWNXLib::Plugin - { - public: - Lua(NWNXLib::Services::ProxyServiceList* services); - virtual ~Lua(); - lua_State *m_luaInstance; - ArgumentStack Eval(ArgumentStack&& args); - ArgumentStack EvalVoid(ArgumentStack&& args); - ArgumentStack RunEvent(ArgumentStack&& args); - void OnToken(ObjectID oid, char* token); - bool OnScript(const char* scriptName, ObjectID objId, bool valid); - private: - void SetObjectSelf(ObjectID objSelf = Constants::OBJECT_INVALID); - int m_tokenFunction; - int m_eventFunction; - int m_runScriptTable; - std::function m_setObjSelfFunction; - ObjectID m_object_self; - }; - -} diff --git a/Plugins/Lua/Lua_Functions.cpp b/Plugins/Lua/Lua_Functions.cpp deleted file mode 100644 index a1cc4b4a905..00000000000 --- a/Plugins/Lua/Lua_Functions.cpp +++ /dev/null @@ -1,549 +0,0 @@ -#include "nwnx.hpp" -#include "Lua_Functions.hpp" -#include "API/CAppManager.hpp" -#include "API/CNWSVirtualMachineCommands.hpp" -#include "API/Constants.hpp" -#include "API/CVirtualMachine.hpp" -#include "API/Globals.hpp" -#include "API/CServerExoApp.hpp" -#include "API/Vector.hpp" -#include "API/CExoString.hpp" -#include "API/CScriptLocation.hpp" -#include "API/CServerAIMaster.hpp" -#include "API/CWorldTimer.hpp" -#include "API/CNWSObject.hpp" -#include -#include - - -// metatables -#define LUA_NWN_VECTOR "nwn_vector" -#define LUA_NWN_EFFECT "nwn_effect" -#define LUA_NWN_EVENT "nwn_event" -#define LUA_NWN_LOCATION "nwn_location" -#define LUA_NWN_TALENT "nwn_talent" -#define LUA_NWN_ITEMPROPERTY "nwn_itemproperty" - - -using namespace NWNXLib; -using namespace NWNXLib::API; - - -CVirtualMachine* GetVm() -{ - return Globals::VirtualMachine(); -} - - -CNWSVirtualMachineCommands* GetVmCommands() -{ - return static_cast(GetVm()->m_pCmdImplementer); -} - -CVirtualMachineScript* CreateScriptForClosure(const char* token) -{ - CVirtualMachineScript* script = new CVirtualMachineScript(); - script->m_pCode = NULL; - script->m_nSecondaryInstructPtr = 0; - script->m_nInstructPtr = 0; - script->m_nStackSize = 0; - script->m_pStack = new CVirtualMachineStack(); - - char buff[128]; - sprintf(buff, "%s %s", "NWNX_LUA_INTERNAL", token); - script->m_sScriptName = CExoString(buff); - - return script; -} - -extern "C" { - - static int NWScript_DelayCommand(lua_State *L) - { - uint32_t oid = (uint32_t)luaL_checkinteger(L, 1); - const char* token = luaL_checkstring(L, 2); - float duration = lua_tonumber(L, 3); - - CGameObject* obj = Globals::AppManager()->m_pServerExoApp->GetGameObject(oid); - if (obj) - { - int32_t days = 0; - int32_t time = 0; - if(duration > 0.0f) - { - days = Globals::AppManager()->m_pServerExoApp->GetWorldTimer()->GetCalendarDayFromSeconds(duration); - time = Globals::AppManager()->m_pServerExoApp->GetWorldTimer()->GetTimeOfDayFromSeconds(duration); - } - - CServerAIMaster* ai = Globals::AppManager()->m_pServerExoApp->GetServerAIMaster(); - ai->AddEventDeltaTime(days, time, oid, oid, 1, CreateScriptForClosure(token)); - } - return 0; - } - - static int NWScript_ActionDoCommand(lua_State *L) - { - uint32_t oid = (uint32_t)luaL_checkinteger(L, 1); - const char* token = luaL_checkstring(L, 2); - - CGameObject* obj = Globals::AppManager()->m_pServerExoApp->GetGameObject(oid); - if (obj && obj->m_nObjectType > Constants::ObjectType::Area) - { - ((CNWSObject*)obj)->AddDoCommandAction(CreateScriptForClosure(token)); - return 0; - } - - return 0; - } - - static int NWScript_VM_ExecuteCommand(lua_State *L) - { - int32_t nCommand = (int32_t)luaL_checkinteger(L, 1); - int32_t nArgs = (int32_t)luaL_checkinteger(L, 2); - if(GetVmCommands()->ExecuteCommand(nCommand, nArgs)) - { - LOG_WARNING("VM command %d failure called with %d args.", nCommand, nArgs); - } - return 0; - } - - static int NWScript_StackPushInteger(lua_State *L) - { - int32_t nArg = (int32_t)luaL_checkinteger(L, 1); - if(!GetVm()->StackPushInteger(nArg)) - { - LOG_DEBUG("VM failed to push Integer"); - } - return 0; - } - - static int NWScript_StackPopInteger(lua_State *L) - { - int32_t nRetVal; - if (!GetVm()->StackPopInteger(&nRetVal)) - { - LOG_DEBUG("VM failed to pop Integer"); - nRetVal = 0; - } - lua_pushinteger(L, nRetVal); - return 1; - } - - static int NWScript_StackPushFloat(lua_State *L) - { - float fFloat = luaL_checknumber(L, 1); - if(!GetVm()->StackPushFloat(fFloat)) - { - LOG_DEBUG("VM failed to push Float"); - } - return 0; - } - - static int NWScript_StackPopFloat(lua_State *L) - { - float fRetVal; - if (!GetVm()->StackPopFloat(&fRetVal)) - { - LOG_DEBUG("VM failed to pop Float"); - fRetVal = 0.0f; - } - lua_pushnumber(L, fRetVal); - return 1; - } - - static int NWScript_StackPushString(lua_State *L) - { - const char *sString = luaL_checkstring(L, 1); - CExoString str(sString); - if(!GetVm()->StackPushString(str)) - { - LOG_DEBUG("VM failed to push String"); - } - return 0; - } - - static int NWScript_StackPopString(lua_State *L) - { - CExoString value; - if(!GetVm()->StackPopString(&value)) - { - LOG_DEBUG("VM failed to pop String"); - } - lua_pushstring(L, value.CStr()); - return 1; - } - - static int NWScript_StackPushObject(lua_State *L) - { - uint32_t oObject = (uint32_t)luaL_checkinteger(L, 1); - if(!GetVm()->StackPushObject(oObject)) - { - LOG_DEBUG("VM failed to push Object"); - } - return 0; - } - - static int NWScript_StackPopObject(lua_State *L) - { - uint32_t nRetVal; - if (!GetVm()->StackPopObject(&nRetVal)) - { - LOG_DEBUG("VM failed to pop Object"); - nRetVal = Constants::OBJECT_INVALID; - } - lua_pushinteger(L, nRetVal); - return 1; - } - - static int NWScript_StackPushVector(lua_State *L) - { - Vector *vVector = (Vector *)luaL_checkudata(L, 1, LUA_NWN_VECTOR); - if(!GetVm()->StackPushVector(*vVector)) - { - LOG_DEBUG("VM failed to push Vector"); - } - return 0; - } - - static int NWScript_StackPopVector(lua_State *L) - { - Vector *vRetVal = (Vector *)lua_newuserdata(L, sizeof(Vector)); - if(!GetVm()->StackPopVector(vRetVal)) - { - LOG_DEBUG("VM failed to pop Vector"); - } - luaL_getmetatable(L, LUA_NWN_VECTOR); - lua_setmetatable(L, -2); - return 1; - } - - static int NWScript_StackPushEffect(lua_State *L) - { - void *pEffect = *(void **)luaL_checkudata(L, 1, LUA_NWN_EFFECT); - if(!GetVm()->StackPushEngineStructure(0, pEffect)) - { - LOG_DEBUG("VM failed to push Effect"); - } - return 0; - } - - static int NWScript_StackPopEffect(lua_State *L) - { - void **pEffect = (void **)lua_newuserdata(L, sizeof(void*)); //CGameEffect - if(!GetVm()->StackPopEngineStructure(0, pEffect)) - { - LOG_DEBUG("VM failed to pop Effect"); - } - luaL_getmetatable(L, LUA_NWN_EFFECT); - lua_setmetatable(L, -2); - return 1; - } - - static int NWScript_StackPushEvent(lua_State *L) - { - void *pEvent = *(void **)luaL_checkudata(L, 1, LUA_NWN_EVENT); - if(!GetVm()->StackPushEngineStructure(1, pEvent)) - { - LOG_DEBUG("VM failed to push Event"); - } - return 0; - } - - static int NWScript_StackPopEvent(lua_State *L) - { - void **pEvent = (void **)lua_newuserdata(L, sizeof(void*));//CScriptEvent - if(!GetVm()->StackPopEngineStructure(1, pEvent)) - { - LOG_DEBUG("VM failed to pop Event"); - } - luaL_getmetatable(L, LUA_NWN_EVENT); - lua_setmetatable(L, -2); - return 1; - } - - static int NWScript_StackPushLocation(lua_State *L) - { - void *pLocation = *(void **)luaL_checkudata(L, 1, LUA_NWN_LOCATION); - if(!GetVm()->StackPushEngineStructure(2, pLocation)) - { - LOG_DEBUG("VM failed to push Location"); - } - return 0; - } - - static int NWScript_StackPopLocation(lua_State *L) - { - void **pLocation = (void **)lua_newuserdata(L, sizeof(void*));//CScriptLocation - if(!GetVm()->StackPopEngineStructure(2, pLocation)) - { - LOG_DEBUG("VM failed to pop Location"); - } - luaL_getmetatable(L, LUA_NWN_LOCATION); - lua_setmetatable(L, -2); - return 1; - } - - static int NWScript_StackPushTalent(lua_State *L) - { - void *pTalent = *(void **)luaL_checkudata(L, 1, LUA_NWN_TALENT); - if(!GetVm()->StackPushEngineStructure(3, pTalent)) - { - LOG_DEBUG("VM failed to push Talent"); - } - return 0; - } - - static int NWScript_StackPopTalent(lua_State *L) - { - void **pTalent = (void **)lua_newuserdata(L, sizeof(void*));//CScriptTalent - if(!GetVm()->StackPopEngineStructure(3, pTalent)) - { - LOG_DEBUG("VM failed to pop Talent"); - } - luaL_getmetatable(L, LUA_NWN_TALENT); - lua_setmetatable(L, -2); - return 1; - } - - static int NWScript_StackPushItemProperty(lua_State *L) - { - void *pProperty = *(void **)luaL_checkudata(L, 1, LUA_NWN_ITEMPROPERTY); - if(!GetVm()->StackPushEngineStructure(4, pProperty)) - { - LOG_DEBUG("VM failed to push ItemProperty"); - } - return 0; - } - - static int NWScript_StackPopItemProperty(lua_State *L) - { - void **pProperty = (void **)lua_newuserdata(L, sizeof(void*));//CGameEffect - if(!GetVm()->StackPopEngineStructure(4, pProperty)) - { - LOG_DEBUG("VM failed to pop ItemProperty"); - } - luaL_getmetatable(L, LUA_NWN_ITEMPROPERTY); - lua_setmetatable(L, -2); - return 1; - } - // metatables functions - // __gc - static int NWScript_FreeEffect(lua_State *L) - { - void *pEffect = *(void **)lua_touserdata(L, 1); - if (pEffect) - { - GetVmCommands()->DestroyGameDefinedStructure(0, pEffect); - } - return 0; - } - - static int NWScript_FreeEvent(lua_State *L) - { - void *pEvent = *(void **)lua_touserdata(L, 1); - if (pEvent) - { - GetVmCommands()->DestroyGameDefinedStructure(1, pEvent); - } - return 0; - } - - static int NWScript_FreeLocation(lua_State *L) - { - void *pLocation = *(void **)lua_touserdata(L, 1); - if (pLocation) - { - GetVmCommands()->DestroyGameDefinedStructure(2, pLocation); - } - return 0; - } - - static int NWScript_FreeTalent(lua_State *L) - { - void *pTalent = *(void **)lua_touserdata(L, 1); - if (pTalent) - { - GetVmCommands()->DestroyGameDefinedStructure(3, pTalent); - } - return 0; - } - - static int NWScript_FreeItemProperty(lua_State *L) - { - void *pProperty = *(void **)lua_touserdata(L, 1); - if (pProperty) - { - GetVmCommands()->DestroyGameDefinedStructure(4, pProperty); - } - return 0; - } - - // nwn_vector.components() - static int NWScript_VectorGetComponents(lua_State *L) - { - Vector *ptr = (Vector *)luaL_checkudata(L, 1, LUA_NWN_VECTOR); - lua_pushnumber(L, ptr->x); - lua_pushnumber(L, ptr->y); - lua_pushnumber(L, ptr->z); - return 3; - } - - // nwn_location.components() - static int NWScript_LocationGetComponents(lua_State *L) - { - CScriptLocation *ptr = *(CScriptLocation **)luaL_checkudata(L, 1, LUA_NWN_LOCATION); - - float facing = (float)(std::atan2(ptr->m_vOrientation.y, ptr->m_vOrientation.x) * (180 / 3.1415927)); - while (facing > 360.0) - { - facing -= 360.0; - } - while (facing < 0.0) - { - facing += 360.0; - } - lua_pushinteger(L, ptr->m_oArea); - lua_pushnumber(L, ptr->m_vPosition.x); - lua_pushnumber(L, ptr->m_vPosition.y); - lua_pushnumber(L, ptr->m_vPosition.z); - lua_pushnumber(L, facing); - return 5; - } - - // Additional functions - static int NWScript_gettimeofday(lua_State *L) - { - struct timeval t; - gettimeofday(&t, NULL); - lua_pushnumber(L, t.tv_sec); - lua_pushnumber(L, t.tv_usec); - return 2; - } - - static int NWScript_SerializeObject(lua_State *L) - { - uint32_t value = (uint32_t)luaL_checkinteger(L, 1); - CGameObject *pObject = API::Globals::AppManager()->m_pServerExoApp->GetGameObject(value); - std::string serialized = Utils::SerializeGameObjectB64(pObject); - lua_pushstring(L, serialized.c_str()); - return 1; - } - - static int NWScript_DeserializeObject(lua_State *L) - { - const char *s = luaL_checkstring(L, 1); - uint32_t owner = (uint32_t)luaL_checkinteger(L, 2); - Vector *v = (Vector *)luaL_checkudata(L, 3, LUA_NWN_VECTOR); - - std::string serialized(s); - uint32_t retval = API::Constants::OBJECT_INVALID; - if (CGameObject *pObject = Utils::DeserializeGameObjectB64(serialized)) - { - retval = static_cast(pObject->m_idSelf); - ASSERT(API::Globals::AppManager()->m_pServerExoApp->GetGameObject(retval)); - - CGameObject *pOwner = API::Globals::AppManager()->m_pServerExoApp->GetGameObject(owner); - if (auto *pArea = Utils::AsNWSArea(pOwner)) - { - if (!Utils::AddToArea(pObject, pArea, v->x, v->y, v->z)) - LOG_WARNING("Failed to add object %x to area %x (%f,%f,%f)", retval, owner, v->x, v->y, v->z); - } - else if (auto *pItem = Utils::AsNWSItem(pObject)) - { - if (!Utils::AcquireItem(pItem, pOwner)) - LOG_WARNING("Failed to 'acquire' deserialized item %x by owner %x", retval, owner); - } - else - { - LOG_INFO("No valid owner given, object %x deserialized outside world bounds", retval); - } - } - - lua_pushinteger(L, retval); - return 1; - } - -} - -static const struct luaL_Reg vector_m [] = { - {"components", NWScript_VectorGetComponents}, - {NULL, NULL} -}; - -static const struct luaL_Reg effect_m [] = { - {"__gc", NWScript_FreeEffect}, - {NULL, NULL} -}; - -static const struct luaL_Reg event_m [] = { - {"__gc", NWScript_FreeEvent}, - {NULL, NULL} -}; - -static const struct luaL_Reg location_m [] = { - {"components", NWScript_LocationGetComponents}, - {"__gc", NWScript_FreeLocation}, - {NULL, NULL} -}; - -static const struct luaL_Reg talent_m [] = { - {"__gc", NWScript_FreeTalent}, - {NULL, NULL} -}; - -static const struct luaL_Reg property_m [] = { - {"__gc", NWScript_FreeItemProperty}, - {NULL, NULL} -}; - -void luaopen_structure(lua_State *L, const char *tname, const luaL_Reg *lreg, bool global) { - luaL_newmetatable(L, tname); - lua_pushvalue(L, -1); - lua_setfield(L, -2, "__index"); -#if LUA_VERSION_NUM > 501 - luaL_setfuncs(L, lreg, 0); -#else - luaL_register(L, NULL, lreg); -#endif - if (global) - { - lua_setglobal(L, tname); - } -} - -void LUA_InitNWScript(lua_State *L) -{ - luaopen_structure(L, LUA_NWN_VECTOR, vector_m, true); - luaopen_structure(L, LUA_NWN_LOCATION, location_m, true); - luaopen_structure(L, LUA_NWN_EFFECT, effect_m, false); - luaopen_structure(L, LUA_NWN_EVENT, event_m, false); - luaopen_structure(L, LUA_NWN_TALENT, talent_m, false); - luaopen_structure(L, LUA_NWN_ITEMPROPERTY, property_m, false); - lua_register(L, "actiondocommand", NWScript_ActionDoCommand); - lua_register(L, "delaycommand", NWScript_DelayCommand); - lua_register(L, "serializeobject", NWScript_SerializeObject); - lua_register(L, "deserializeobject", NWScript_DeserializeObject); - lua_register(L, "gettimeofday", NWScript_gettimeofday); - lua_register(L, "VM_ExecuteCommand", NWScript_VM_ExecuteCommand); - lua_register(L, "StackPushObject", NWScript_StackPushObject); - lua_register(L, "StackPopObject", NWScript_StackPopObject); - lua_register(L, "StackPushVector", NWScript_StackPushVector); - lua_register(L, "StackPopVector", NWScript_StackPopVector); - lua_register(L, "StackPushString", NWScript_StackPushString); - lua_register(L, "StackPopString", NWScript_StackPopString); - lua_register(L, "StackPushFloat", NWScript_StackPushFloat); - lua_register(L, "StackPopFloat", NWScript_StackPopFloat); - lua_register(L, "StackPushInteger", NWScript_StackPushInteger); - lua_register(L, "StackPopInteger", NWScript_StackPopInteger); - lua_register(L, "StackPushEffect", NWScript_StackPushEffect); - lua_register(L, "StackPopEffect", NWScript_StackPopEffect); - lua_register(L, "StackPushEvent", NWScript_StackPushEvent); - lua_register(L, "StackPopEvent", NWScript_StackPopEvent); - lua_register(L, "StackPushLocation", NWScript_StackPushLocation); - lua_register(L, "StackPopLocation", NWScript_StackPopLocation); - lua_register(L, "StackPushTalent", NWScript_StackPushTalent); - lua_register(L, "StackPopTalent", NWScript_StackPopTalent); - lua_register(L, "StackPushItemProperty", NWScript_StackPushItemProperty); - lua_register(L, "StackPopItemProperty", NWScript_StackPopItemProperty); -} - diff --git a/Plugins/Lua/Lua_Functions.hpp b/Plugins/Lua/Lua_Functions.hpp deleted file mode 100644 index 12fcdbefcf9..00000000000 --- a/Plugins/Lua/Lua_Functions.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "API/ALL_CLASSES.hpp" - -extern "C" { -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#ifdef NWNX_LUA_LUAJIT -#include "luajit.h" -#endif -} - -CVirtualMachine* GetVm(); -CNWSVirtualMachineCommands* GetVmCommands(); - -void LUA_InitNWScript(lua_State *L); - diff --git a/Plugins/Lua/NWScript/nwnx_lua.nss b/Plugins/Lua/NWScript/nwnx_lua.nss deleted file mode 100644 index 42bf158e99d..00000000000 --- a/Plugins/Lua/NWScript/nwnx_lua.nss +++ /dev/null @@ -1,44 +0,0 @@ -/// @addtogroup lua LUA -/// @brief Execute Lua code and generate events in NWScript -/// @{ -/// @file nwnx_lua.nss - -const string NWNX_Lua = "NWNX_Lua"; ///< @private - -/// @brief Evaluate LUA code. -/// @param sCode The code to evaluate. -void NWNX_Lua_EvalVoid(string sCode); - -/// @brief Evaluate LUA code and return the output. -/// @param sCode The code to evaluate. -/// @return The result of the Lua code execution. -string NWNX_Lua_Eval(string sCode); - -/// @brief Generate events in NWScript to receive on the Lua side. -/// -/// Executes all the Lua functions registered to listen to that event in order of priority. -/// For details on events just look at the three *Event() functions in preload.lua. -void NWNX_Lua_RunEvent(string sEvent, object oObject, string sExtra=""); - -/// @} - -void NWNX_Lua_EvalVoid(string sCode) -{ - NWNXPushString(sCode); - NWNXCall(NWNX_Lua, "EvalVoid"); -} - -string NWNX_Lua_Eval(string sCode) -{ - NWNXPushString(sCode); - NWNXCall(NWNX_Lua, "Eval"); - return NWNXPopString(); -} - -void NWNX_Lua_RunEvent(string sEvent, object oObject, string sExtra="") -{ - NWNXPushString(sExtra); - NWNXPushObject(oObject); - NWNXPushString(sEvent); - NWNXCall(NWNX_Lua, "RunEvent"); -} diff --git a/Plugins/Lua/README.md b/Plugins/Lua/README.md deleted file mode 100644 index 16f384cdfdb..00000000000 --- a/Plugins/Lua/README.md +++ /dev/null @@ -1,120 +0,0 @@ -@page lua Readme -@ingroup lua - -Allows users to call Lua code with NWScript binding. - -## Environment Variables - -| Variable Name | Type | Default Value | -| ------------- | :----: | ------------- | -| PRELOAD_SCRIPT | string | USERDIR/lua/preload.lua | -| TOKEN_FUNCTION | string | CallToken | -| EVENT_FUNCTION | string | RunEvent | -| OBJSELF_FUNCTION | string | _none_ | -| RUNSCRIPT_TABLE | string | _none_ | - -## Quick start - -### Docker - -1. Include `nwnx_lua.nss` in your module -2. Enable the plugin and mount a complete copy of `unified/Plugins/Lua/lua` to your container. This is where all your scripts will go. Compose example: -```yaml - volumes: - - ./server/:/nwn/home - - ./lua:/nwn/run/lua/ - environment: - - NWNX_LUA_SKIP=n -``` -3. Continue from step 6 in the list below. - -### Native - -1. Install **LuaJIT**, i.e `sudo apt-get install luajit libluajit-5.1-dev` -2. Compile your plugin and install as any other nwnxee plugin -3. Don't set any configuration env variable -4. Import the `nwnx_lua.nss` script in the **NWScript** directory in your module -5. Copy the Lua directory inside your **USERDIR** (usually `.local/Neverwinter Nights/`), so you will have a **USERDIR/lua/preload.lua** file. -6. In your *"on module load script"* include *"nwnx_lua"* and add this line `NWNX_Lua_RunEvent("mod_load", OBJECT_SELF);` -7. In your *"on module chat script"* include *"nwnx_lua"* and add this line `NWNX_Lua_RunEvent("mod_chat", GetPCChatSpeaker());` -8. Enter your module and put this line in your talk chat: `/c =GetName(oPC)` dont forget the '=' -9. Press enter and you will get your name as server message -10. try the same with `/c ApplyEffectToObject(2, EffectHeal(10), oPC)` or `/c return GetName(GetArea(oPC))` or `/c =3+5` or `/c DelayCommand(oPC, 1.5, SpeakString, 'Foo')` -11. Have some fun with your chat command interpreter, every command you want evaled by Lua must start with `/c `, if you want a return value start with `/c =` or `/c return ` -12. Look at the Lua scripts provided for some examples. The different ways to use this plugin are a lot, now you have NWScript binding in a interpred language, Lua, so you can do things like change a Lua script and hot reload it without even restart the module; for an example look at the `loadscript()` function in the preload script. - - -## Documentation -This plugin let you execute Lua code inside *NWscript* via two functions NWNX_Lua_EvalVoid() and NWNX_Lua_Eval(), the second one returning (as string) the result of the Lua code execution. With the NWNX_Lua_RunEvent() function you can generate events in NWScript, receive them on the Lua side and executing all the Lua functions registered to listen to that event in order of priority. For details on events just look at the three `*Event()` functions in `preload.lua`. -Lastly the *run script hook* permit to run a Lua function before a script is executed in the module, with returning values from the function having special effects: from skipping the script execution to being treated as a StartingConditional() result (for details see the configuration section). - -In the Lua space all the basics NWScript functions are already defined, that by simply requiring the file `nwn.lua`. - -All functions returning a NWScript boolean (1 or 0) in Lua now returns a **boolean** (`true` or `false`), the same for functions accepting booleans, so in Lua you can write: `ClearAllActions(true)` or `if GetIsObjectValid(oObject) then .... end` - -`OBJECT_SELF` and `OBJECT_INVALID` are defined too, the first changing and following the script context. - -Only these functions are different from NWScript: `DelayCommand`, `AssignCommand` and `ActionDoCommand` - -The signatures of the functions are: -```ruby -DelayCommand(oObject, fDelay, Function, 1stFunctionArg, 2ndFunctionArg .....) - -AssignCommand(oObject, Function, 1stFunctionArg, 2ndFunctionArg .....) - -ActionDoCommand(Function, 1stFunctionArg, 2ndFunctionArg .....) -``` -For Example: -```ruby -DelayCommand(oPC, 2.5, SetLocalInt, oPC, "LOCAL_INT", 42) - -AssignCommand(OBJECT_SELF, SpeakString, "Bar") - -ActionDoCommand(SpeakString, "Here's my seat!"); - -``` -Beware that for `DelayCommand` there is an additional argument (oObject) respect to the NWScript counterpart, so you can avoid to write `AssignCommand(oObject, DelayCommand, ...`. Just write `DelayCommand(oObject, 2.0 ....`. If you dont know how to set oObject just use `OBJECT_SELF`. - -In the Lua namespace are defined, by the plugin, some additional utility functions. You can find them in the file `lua/additions.lua`, among these there are `SerializeObject()` and `DeserializeObject()`, useful if you want to use Lua to connect to database and saving/retrieving objects in it. - -They are also implemented `tostring(vVector)` or `vVector:tostring()`, `tostring(lLocation)` or `lLocation:tostring()` and the inverse `string.tovector()` or `sVector:vector()` and `string.tolocation()` or `sLocation:tolocation()`, the same as above useful if you want to save/retrieve vectors and locations in a database via lua. - -Last but not least the function `GetTimeOfDay()` returns the time since Epoch in microseconds, useful for tracing execution speed. - -**Important**: dont call *directly* **any** NWScript function in the preload script or any other directly required script, so avoid writing lines like SetLocalString(...), GetModule() etc, you can write them inside function definitions but, again, dont call these functions directly during preload. The preload script is loaded during the start of nwserver and before the module is even loaded. So any direct call to NWScript functions during preload time will crash the server. - -The trick is to load/require the others scripts in the module_load event, you can see how in the preload script. - -The entire system is configurable ad hoc, if you have time you can even change the name of any NWScript function, use OOP programming, i.e using Lua classes instead of numbers for objects; with LuaJIT and FFi you can even directly access C structures. - -## Installation and configuration - -1) Just import in your module the two scripts in the NWScript directory. -2) Copy the *lua* directory inside your NWN user directory (usually `.local/share/Neverwinter Nights/`) - -Here is the complete list of the configuration environment variables: - -**NWNX_LUA_PRELOAD_SCRIPT** mandatory, the default value is `your_default_NWN_user_directory/lua/preload.lua`. - -**NWNX_LUA_TOKEN_FUNCTION** mandatory, it's the name of the function used internally to emulate `DelayCommand`, `AssignCommand` and `ActionDoCommand`. The function is already defined in the preload script provided, default: `CallToken()`. - -**NWNX_LUA_EVENT_FUNCTION** mandatory: you can use the event system for generate events inside NWScript, via the function `NWNX_Lua_RunEvent` provided in nwnx_lua.nss. These events can be consumend by a Lua function registered to observe the events, the default is `RunEvent()`, and it's already defined in the preload script. If you dont want to use the event system just dont call `NWNX_Lua_RunEvent()` on the NWScript side. - -**NWNX_LUA_OBJSELF_FUNCTION** optional and advanced: in the Lua global namespace there is already a OBJECT_SELF global variable synced by the plugin at the right integer value following the context change. If you need to be more OOP and don't want to use integers for objects you have to change first the `RunEvent` function, because is accepting integers as objects. So you have to transform them in real objects inside the `RunEvent` function, just before the function call the observers callbacks. Second you have to set this configuration variable to the name of the function responsible for setting OBJECT_SELF to an object. The function will be called by the plugin with an integer value (the value of OBJECT_SELF) as argument when needed, i.e. when the context change. There is an example of `SetObjectSelf()` commented out in the preload script, note: it does not work by itself, you have to write oop code (i.e. a class for objects) before setting the configuration and uncommenting/modifying it. If this configuration is defined the function **must** be present in the preload script. Default: none. - -**NWNX_LUA_RUNSCRIPT_TABLE** optional: this is the name of the *global* Lua **table** containing the functions called in the *run script hook*. A function with the same name of the script executed in the module will be run before the script itself. If the function returns something different from `nil` (i.e.: string, numbers or booleans) the script execution will be skipped, if the function returns a Lua boolean (`true` or `false`) it's treated like a return value from a StartingConditional(). -For example if you have the script 'mod_on_chat.nss' in your module *onchat* event, if this configuration parameter is set to `Scripts`, when the `mod_on_chat` script is called the plugin search for a Lua function `Scripts.mod_on_chat()`. If the function is found it will be called before the 'mod_on_chat' script and the returned value determine if the original script is to be skipped. No argument is passed to the function, the context object is already represented by OBJECT_SELF. -If this parameter is not defined no *run script hook* is set up. If this parameter is defined the basic table definition **must** be present in the preload script, a line like this one is enough: `Scripts = {}` all the other functions of the run script table could be defined after the preloading phase, obviously apart from the mod_load function if you want one. Default: none. -**WARNING** dont set this config with any other *RunScript* hook in place, i.e. if you have the ENABLE_SCRIPTS of the Profiler plugin enabled dont set this config or you will have a server crash at startup. For the same reason enabling this setting makes this plugin not compatible with the Mono Plugin. - -## Notes on Compilation -NWNX_Lua is configured to compile first against *LuaJIT*, and only if LuaJIT (and its library) cannot be find search for a regular Lua library. -So if you want to compile against LuaJIT just install it, otherwise install a regular Lua with liblua-dev provided by your distro; something like `sudo apt-get install luajit libluajit-5.1-dev` for luajit or `sudo apt-get install lua5.3 liblua5.3-dev` for regular Lua. - -I highly reccomend to use or try LuaJIT, it is really fast and has the FFI library for C bindings. There is a script provided ('compat.lua') that try to mantain compatibility with differents Lua versions, it's tested with LuaJIT and Lua 5.3 but should work with Lua 5.2 and Lua 5.1. - -## Note on LuaJIT and extensions -If you want to use extensions in *LuaJIT* I highly reccomend to use *luarocks* to install them. To install and compile *luarocks* for *LuaJIT* downlowd it and compile/install with this two commands: -1) `./configure --lua-suffix=jit --with-lua-include=/usr/include/luajit-2.0` -2) `make build && sudo make install` - diff --git a/Plugins/Lua/lua/additions.lua b/Plugins/Lua/lua/additions.lua deleted file mode 100644 index 5a4a2ec6ce0..00000000000 --- a/Plugins/Lua/lua/additions.lua +++ /dev/null @@ -1,123 +0,0 @@ --- Additional functions -local int_serializeObject = serializeobject -local int_deserializeObject = deserializeobject -local int_gettimeofday = gettimeofday -serializeobject = nil -deserializeobject = nil -gettimeofday = nil - - --- serialize an object into a base64 encoded string --- return the serialized string -function SerializeObject(oObject) - return int_serializeObject(oObject) -end - --- deserialize an object from a base64 encoded string --- oOwner can be a creature, container or area --- if oOwner is an Area, vPosition is a vector representign the position in wich deserialize the object --- return the Object deserialized, OBJECT_INVALID on any error -function DeserializeObject(sString, oOwner, vPosition) - vPosition = vPosition or Vector() - return int_deserializeObject(sString, oOwner, vPosition) -end - --- return the number of seconds with microseconds precision since the Epoch --- useful for tracking running events -function GetTimeOfDay() - local sec, usec = int_gettimeofday() - return sec + (usec / 1000000) -end - --- implements tostring(vVector) or vVector:tostring() -nwn_vector.__tostring = function(vVector) - return string.format("%.4f;%.4f;%.4f", vVector:components()) -end - --- vVector:x() -nwn_vector.x = function(vVector) - local x, y, z = vVector:components() - return x -end - ---vVector:y() -nwn_vector.y = function(vVector) - local x, y, z = vVector:components() - return y -end - ---vVector:z() -nwn_vector.z = function(vVector) - local x, y, z = vVector:components() - return z -end - --- implements tostring(lLocation) or lLocation:tostring() -nwn_location.__tostring = function(lLoc) - local a, x, y, z, f = lLoc:components() - if a == 0 or not GetIsObjectValid(a) then return "" end - return string.format("%s;%.4f;%.4f;%.4f;%.4f", GetTag(a), x, y, z, f) -end - --- boolean functions -function GetLocalBool(oObject, sName) - return GetLocalInt(oObject, sName) > 0 -end - -function SetLocalBool(oObject, sName, bCond) - bCond = bCond and 1 or 0 - SetLocalInt(oObject, sName, bCond) -end - -function DeleteLocalBool(oObject, sName) - DeleteLocalInt(oObject, sName) -end - --- string functions -function string.eval(sString, ...) - sString = string.format(sString, ...) - local status, msg = pcall(loadstring(sString)) - return status, msg -end - -function string:split(sep) - local sep, fields = sep or " ", {} - local pattern = string.format("([^%s]+)", sep) - self:gsub(pattern, function(c) fields[#fields+1] = c end) - return fields -end - -function string:color(nRed, nGreen, nBlue) - return string.format("%s", nRed, nGreen, nBlue, self) -end - -function string:blue() return self:color(102, 204, 254) end -- used by saving throws. -function string:dblue() return self:color( 32, 102, 254) end -- used for electric damage. -function string:gray() return self:color(153, 153, 153) end -- used for negative damage. -function string:green() return self:color( 32, 254, 32) end -- used for acid damage. -function string:lblue() return self:color(153, 254, 254) end -- used for the player's name, and cold damage. -function string:lgray() return self:color(176, 176, 176) end -- used for system messages. -function string:lorange() return self:color(254, 153, 32) end -- used for sonic damage. -function string:lpurple() return self:color(204, 153, 204) end -- used for a target's name. -function string:orange() return self:color(254, 102, 32) end -- used for attack rolls and physical damage. -function string:purple() return self:color(204, 119, 254) end -- used for spell casts, as well as magic damage. -function string:red() return self:color(254, 32, 32) end -- used for fire damage. -function string:white() return self:color(254, 254, 254) end -- used for positive damage. -function string:yellow() return self:color(254, 254, 32) end -- used for healing, and sent messages. - --- implements sString:tovector -function string:tovector() - local t = self:split(";") - if #t < 3 then return Vector() end - return Vector(tonumber(t[1]),tonumber(t[2]),tonumber(t[3])) -end - --- implements sString:tolocation -function string:tolocation() - local t = self:split(";") - if #t < 5 then return false end - local a, x, y, z, f = GetObjectByTag(t[1], 0), tonumber(t[2]),tonumber(t[3]),tonumber(t[4]),tonumber(t[5]) - if not GetIsObjectValid(a) then return false end - return Location(a, Vector(x,y,z), f) -end - diff --git a/Plugins/Lua/lua/compat.lua b/Plugins/Lua/lua/compat.lua deleted file mode 100644 index c2c3f83fc60..00000000000 --- a/Plugins/Lua/lua/compat.lua +++ /dev/null @@ -1,15 +0,0 @@ -_LUA_VERSION = tonumber(string.sub(_VERSION, 5)) - -if _LUA_VERSION > 5.1 then - loadstring = load - unpack = table.unpack - function math.log10(x) - return math.log(x, 10) - end -end - -if _LUA_VERSION > 5.2 then - function math.pow(x,y) - return x^y - end -end \ No newline at end of file diff --git a/Plugins/Lua/lua/constants.lua b/Plugins/Lua/lua/constants.lua deleted file mode 100644 index 4b6c7763588..00000000000 --- a/Plugins/Lua/lua/constants.lua +++ /dev/null @@ -1,5669 +0,0 @@ --- Constants -NUM_INVENTORY_SLOTS = 18; -TRUE = 1; -FALSE = 0; -DIRECTION_EAST = 0.0f; -DIRECTION_NORTH = 90.0f; -DIRECTION_WEST = 180.0f; -DIRECTION_SOUTH = 270.0f; -PI = 3.141592f; -ATTITUDE_NEUTRAL = 0; -ATTITUDE_AGGRESSIVE = 1; -ATTITUDE_DEFENSIVE = 2; -ATTITUDE_SPECIAL = 3; -TALKVOLUME_TALK = 0; -TALKVOLUME_WHISPER = 1; -TALKVOLUME_SHOUT = 2; -TALKVOLUME_SILENT_TALK = 3; -TALKVOLUME_SILENT_SHOUT = 4; -TALKVOLUME_PARTY = 5; -TALKVOLUME_TELL = 6; -INVENTORY_SLOT_HEAD = 0; -INVENTORY_SLOT_CHEST = 1; -INVENTORY_SLOT_BOOTS = 2; -INVENTORY_SLOT_ARMS = 3; -INVENTORY_SLOT_RIGHTHAND = 4; -INVENTORY_SLOT_LEFTHAND = 5; -INVENTORY_SLOT_CLOAK = 6; -INVENTORY_SLOT_LEFTRING = 7; -INVENTORY_SLOT_RIGHTRING = 8; -INVENTORY_SLOT_NECK = 9; -INVENTORY_SLOT_BELT = 10; -INVENTORY_SLOT_ARROWS = 11; -INVENTORY_SLOT_BULLETS = 12; -INVENTORY_SLOT_BOLTS = 13; -INVENTORY_SLOT_CWEAPON_L = 14; -INVENTORY_SLOT_CWEAPON_R = 15; -INVENTORY_SLOT_CWEAPON_B = 16; -INVENTORY_SLOT_CARMOUR = 17; --- Effect type constants -DURATION_TYPE_INSTANT = 0; -DURATION_TYPE_TEMPORARY = 1; -DURATION_TYPE_PERMANENT = 2; -SUBTYPE_MAGICAL = 8; -SUBTYPE_SUPERNATURAL = 16; -SUBTYPE_EXTRAORDINARY = 24; -ABILITY_STRENGTH = 0; --- should be the same as in nwseffectlist.cpp -ABILITY_DEXTERITY = 1; -ABILITY_CONSTITUTION = 2; -ABILITY_INTELLIGENCE = 3; -ABILITY_WISDOM = 4; -ABILITY_CHARISMA = 5; -SHAPE_SPELLCYLINDER = 0; -SHAPE_CONE = 1; -SHAPE_CUBE = 2; -SHAPE_SPELLCONE = 3; -SHAPE_SPHERE = 4; -METAMAGIC_NONE = 0; -METAMAGIC_EMPOWER = 1; -METAMAGIC_EXTEND = 2; -METAMAGIC_MAXIMIZE = 4; -METAMAGIC_QUICKEN = 8; -METAMAGIC_SILENT = 16; -METAMAGIC_STILL = 32; -METAMAGIC_ANY = 255; -OBJECT_TYPE_CREATURE = 1; -OBJECT_TYPE_ITEM = 2; -OBJECT_TYPE_TRIGGER = 4; -OBJECT_TYPE_DOOR = 8; -OBJECT_TYPE_AREA_OF_EFFECT = 16; -OBJECT_TYPE_WAYPOINT = 32; -OBJECT_TYPE_PLACEABLE = 64; -OBJECT_TYPE_STORE = 128; -OBJECT_TYPE_ENCOUNTER = 256; -OBJECT_TYPE_ALL = 32767; -OBJECT_TYPE_INVALID = 32767; -GENDER_MALE = 0; -GENDER_FEMALE = 1; -GENDER_BOTH = 2; -GENDER_OTHER = 3; -GENDER_NONE = 4; -DAMAGE_TYPE_BLUDGEONING = 1; -DAMAGE_TYPE_PIERCING = 2; -DAMAGE_TYPE_SLASHING = 4; -DAMAGE_TYPE_MAGICAL = 8; -DAMAGE_TYPE_ACID = 16; -DAMAGE_TYPE_COLD = 32; -DAMAGE_TYPE_DIVINE = 64; -DAMAGE_TYPE_ELECTRICAL = 128; -DAMAGE_TYPE_FIRE = 256; -DAMAGE_TYPE_NEGATIVE = 512; -DAMAGE_TYPE_POSITIVE = 1024; -DAMAGE_TYPE_SONIC = 2048; --- The base weapon damage is the base damage delivered by the weapon before --- any additional types of damage (e.g. fire) have been added. -DAMAGE_TYPE_BASE_WEAPON = 4096; --- Special versus flag just for AC effects -AC_VS_DAMAGE_TYPE_ALL = 4103; -DAMAGE_BONUS_1 = 1; -DAMAGE_BONUS_2 = 2; -DAMAGE_BONUS_3 = 3; -DAMAGE_BONUS_4 = 4; -DAMAGE_BONUS_5 = 5; -DAMAGE_BONUS_1d4 = 6; -DAMAGE_BONUS_1d6 = 7; -DAMAGE_BONUS_1d8 = 8; -DAMAGE_BONUS_1d10 = 9; -DAMAGE_BONUS_2d6 = 10; -DAMAGE_BONUS_2d8 = 11; -DAMAGE_BONUS_2d4 = 12; -DAMAGE_BONUS_2d10 = 13; -DAMAGE_BONUS_1d12 = 14; -DAMAGE_BONUS_2d12 = 15; -DAMAGE_BONUS_6 = 16; -DAMAGE_BONUS_7 = 17; -DAMAGE_BONUS_8 = 18; -DAMAGE_BONUS_9 = 19; -DAMAGE_BONUS_10 = 20; -DAMAGE_BONUS_11 = 21; -DAMAGE_BONUS_12 = 22; -DAMAGE_BONUS_13 = 23; -DAMAGE_BONUS_14 = 24; -DAMAGE_BONUS_15 = 25; -DAMAGE_BONUS_16 = 26; -DAMAGE_BONUS_17 = 27; -DAMAGE_BONUS_18 = 28; -DAMAGE_BONUS_19 = 29; -DAMAGE_BONUS_20 = 30; -DAMAGE_POWER_NORMAL = 0; -DAMAGE_POWER_PLUS_ONE = 1; -DAMAGE_POWER_PLUS_TWO = 2; -DAMAGE_POWER_PLUS_THREE = 3; -DAMAGE_POWER_PLUS_FOUR = 4; -DAMAGE_POWER_PLUS_FIVE = 5; -DAMAGE_POWER_ENERGY = 6; -DAMAGE_POWER_PLUS_SIX = 7; -DAMAGE_POWER_PLUS_SEVEN = 8; -DAMAGE_POWER_PLUS_EIGHT = 9; -DAMAGE_POWER_PLUS_NINE = 10; -DAMAGE_POWER_PLUS_TEN = 11; -DAMAGE_POWER_PLUS_ELEVEN = 12; -DAMAGE_POWER_PLUS_TWELVE = 13; -DAMAGE_POWER_PLUS_THIRTEEN = 14; -DAMAGE_POWER_PLUS_FOURTEEN = 15; -DAMAGE_POWER_PLUS_FIFTEEN = 16; -DAMAGE_POWER_PLUS_SIXTEEN = 17; -DAMAGE_POWER_PLUS_SEVENTEEN = 18; -DAMAGE_POWER_PLUS_EIGHTEEN = 19; -DAMAGE_POWER_PLUS_NINTEEN = 20; -DAMAGE_POWER_PLUS_TWENTY = 21; -ATTACK_BONUS_MISC = 0; -ATTACK_BONUS_ONHAND = 1; -ATTACK_BONUS_OFFHAND = 2; -AC_DODGE_BONUS = 0; -AC_NATURAL_BONUS = 1; -AC_ARMOUR_ENCHANTMENT_BONUS = 2; -AC_SHIELD_ENCHANTMENT_BONUS = 3; -AC_DEFLECTION_BONUS = 4; -MISS_CHANCE_TYPE_NORMAL = 0; -MISS_CHANCE_TYPE_VS_RANGED = 1; -MISS_CHANCE_TYPE_VS_MELEE = 2; -DOOR_ACTION_OPEN = 0; -DOOR_ACTION_UNLOCK = 1; -DOOR_ACTION_BASH = 2; -DOOR_ACTION_IGNORE = 3; -DOOR_ACTION_KNOCK = 4; -PLACEABLE_ACTION_USE = 0; -PLACEABLE_ACTION_UNLOCK = 1; -PLACEABLE_ACTION_BASH = 2; -PLACEABLE_ACTION_KNOCK = 4; -RACIAL_TYPE_DWARF = 0; -RACIAL_TYPE_ELF = 1; -RACIAL_TYPE_GNOME = 2; -RACIAL_TYPE_HALFLING = 3; -RACIAL_TYPE_HALFELF = 4; -RACIAL_TYPE_HALFORC = 5; -RACIAL_TYPE_HUMAN = 6; -RACIAL_TYPE_ABERRATION = 7; -RACIAL_TYPE_ANIMAL = 8; -RACIAL_TYPE_BEAST = 9; -RACIAL_TYPE_CONSTRUCT = 10; -RACIAL_TYPE_DRAGON = 11; -RACIAL_TYPE_HUMANOID_GOBLINOID = 12; -RACIAL_TYPE_HUMANOID_MONSTROUS = 13; -RACIAL_TYPE_HUMANOID_ORC = 14; -RACIAL_TYPE_HUMANOID_REPTILIAN = 15; -RACIAL_TYPE_ELEMENTAL = 16; -RACIAL_TYPE_FEY = 17; -RACIAL_TYPE_GIANT = 18; -RACIAL_TYPE_MAGICAL_BEAST = 19; -RACIAL_TYPE_OUTSIDER = 20; -RACIAL_TYPE_SHAPECHANGER = 23; -RACIAL_TYPE_UNDEAD = 24; -RACIAL_TYPE_VERMIN = 25; -RACIAL_TYPE_ALL = 28; -RACIAL_TYPE_INVALID = 28; -RACIAL_TYPE_OOZE = 29; -ALIGNMENT_ALL = 0; -ALIGNMENT_NEUTRAL = 1; -ALIGNMENT_LAWFUL = 2; -ALIGNMENT_CHAOTIC = 3; -ALIGNMENT_GOOD = 4; -ALIGNMENT_EVIL = 5; -SAVING_THROW_ALL = 0; -SAVING_THROW_FORT = 1; -SAVING_THROW_REFLEX = 2; -SAVING_THROW_WILL = 3; -SAVING_THROW_TYPE_ALL = 0; -SAVING_THROW_TYPE_NONE = 0; -SAVING_THROW_TYPE_MIND_SPELLS = 1; -SAVING_THROW_TYPE_POISON = 2; -SAVING_THROW_TYPE_DISEASE = 3; -SAVING_THROW_TYPE_FEAR = 4; -SAVING_THROW_TYPE_SONIC = 5; -SAVING_THROW_TYPE_ACID = 6; -SAVING_THROW_TYPE_FIRE = 7; -SAVING_THROW_TYPE_ELECTRICITY = 8; -SAVING_THROW_TYPE_POSITIVE = 9; -SAVING_THROW_TYPE_NEGATIVE = 10; -SAVING_THROW_TYPE_DEATH = 11; -SAVING_THROW_TYPE_COLD = 12; -SAVING_THROW_TYPE_DIVINE = 13; -SAVING_THROW_TYPE_TRAP = 14; -SAVING_THROW_TYPE_SPELL = 15; -SAVING_THROW_TYPE_GOOD = 16; -SAVING_THROW_TYPE_EVIL = 17; -SAVING_THROW_TYPE_LAW = 18; -SAVING_THROW_TYPE_CHAOS = 19; -IMMUNITY_TYPE_NONE = 0; -IMMUNITY_TYPE_MIND_SPELLS = 1; -IMMUNITY_TYPE_POISON = 2; -IMMUNITY_TYPE_DISEASE = 3; -IMMUNITY_TYPE_FEAR = 4; -IMMUNITY_TYPE_TRAP = 5; -IMMUNITY_TYPE_PARALYSIS = 6; -IMMUNITY_TYPE_BLINDNESS = 7; -IMMUNITY_TYPE_DEAFNESS = 8; -IMMUNITY_TYPE_SLOW = 9; -IMMUNITY_TYPE_ENTANGLE = 10; -IMMUNITY_TYPE_SILENCE = 11; -IMMUNITY_TYPE_STUN = 12; -IMMUNITY_TYPE_SLEEP = 13; -IMMUNITY_TYPE_CHARM = 14; -IMMUNITY_TYPE_DOMINATE = 15; -IMMUNITY_TYPE_CONFUSED = 16; -IMMUNITY_TYPE_CURSED = 17; -IMMUNITY_TYPE_DAZED = 18; -IMMUNITY_TYPE_ABILITY_DECREASE = 19; -IMMUNITY_TYPE_ATTACK_DECREASE = 20; -IMMUNITY_TYPE_DAMAGE_DECREASE = 21; -IMMUNITY_TYPE_DAMAGE_IMMUNITY_DECREASE = 22; -IMMUNITY_TYPE_AC_DECREASE = 23; -IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE = 24; -IMMUNITY_TYPE_SAVING_THROW_DECREASE = 25; -IMMUNITY_TYPE_SPELL_RESISTANCE_DECREASE = 26; -IMMUNITY_TYPE_SKILL_DECREASE = 27; -IMMUNITY_TYPE_KNOCKDOWN = 28; -IMMUNITY_TYPE_NEGATIVE_LEVEL = 29; -IMMUNITY_TYPE_SNEAK_ATTACK = 30; -IMMUNITY_TYPE_CRITICAL_HIT = 31; -IMMUNITY_TYPE_DEATH = 32; -AREA_TRANSITION_RANDOM = 0; -AREA_TRANSITION_USER_DEFINED = 1; -AREA_TRANSITION_CITY_01 = 2; -AREA_TRANSITION_CITY_02 = 3; -AREA_TRANSITION_CITY_03 = 4; -AREA_TRANSITION_CITY_04 = 5; -AREA_TRANSITION_CITY_05 = 6; -AREA_TRANSITION_CRYPT_01 = 7; -AREA_TRANSITION_CRYPT_02 = 8; -AREA_TRANSITION_CRYPT_03 = 9; -AREA_TRANSITION_CRYPT_04 = 10; -AREA_TRANSITION_CRYPT_05 = 11; -AREA_TRANSITION_DUNGEON_01 = 12; -AREA_TRANSITION_DUNGEON_02 = 13; -AREA_TRANSITION_DUNGEON_03 = 14; -AREA_TRANSITION_DUNGEON_04 = 15; -AREA_TRANSITION_DUNGEON_05 = 16; -AREA_TRANSITION_DUNGEON_06 = 17; -AREA_TRANSITION_DUNGEON_07 = 18; -AREA_TRANSITION_DUNGEON_08 = 19; -AREA_TRANSITION_MINES_01 = 20; -AREA_TRANSITION_MINES_02 = 21; -AREA_TRANSITION_MINES_03 = 22; -AREA_TRANSITION_MINES_04 = 23; -AREA_TRANSITION_MINES_05 = 24; -AREA_TRANSITION_MINES_06 = 25; -AREA_TRANSITION_MINES_07 = 26; -AREA_TRANSITION_MINES_08 = 27; -AREA_TRANSITION_MINES_09 = 28; -AREA_TRANSITION_SEWER_01 = 29; -AREA_TRANSITION_SEWER_02 = 30; -AREA_TRANSITION_SEWER_03 = 31; -AREA_TRANSITION_SEWER_04 = 32; -AREA_TRANSITION_SEWER_05 = 33; -AREA_TRANSITION_CASTLE_01 = 34; -AREA_TRANSITION_CASTLE_02 = 35; -AREA_TRANSITION_CASTLE_03 = 36; -AREA_TRANSITION_CASTLE_04 = 37; -AREA_TRANSITION_CASTLE_05 = 38; -AREA_TRANSITION_CASTLE_06 = 39; -AREA_TRANSITION_CASTLE_07 = 40; -AREA_TRANSITION_CASTLE_08 = 41; -AREA_TRANSITION_INTERIOR_01 = 42; -AREA_TRANSITION_INTERIOR_02 = 43; -AREA_TRANSITION_INTERIOR_03 = 44; -AREA_TRANSITION_INTERIOR_04 = 45; -AREA_TRANSITION_INTERIOR_05 = 46; -AREA_TRANSITION_INTERIOR_06 = 47; -AREA_TRANSITION_INTERIOR_07 = 48; -AREA_TRANSITION_INTERIOR_08 = 49; -AREA_TRANSITION_INTERIOR_09 = 50; -AREA_TRANSITION_INTERIOR_10 = 51; -AREA_TRANSITION_INTERIOR_11 = 52; -AREA_TRANSITION_INTERIOR_12 = 53; -AREA_TRANSITION_INTERIOR_13 = 54; -AREA_TRANSITION_INTERIOR_14 = 55; -AREA_TRANSITION_INTERIOR_15 = 56; -AREA_TRANSITION_INTERIOR_16 = 57; -AREA_TRANSITION_FOREST_01 = 58; -AREA_TRANSITION_FOREST_02 = 59; -AREA_TRANSITION_FOREST_03 = 60; -AREA_TRANSITION_FOREST_04 = 61; -AREA_TRANSITION_FOREST_05 = 62; -AREA_TRANSITION_RURAL_01 = 63; -AREA_TRANSITION_RURAL_02 = 64; -AREA_TRANSITION_RURAL_03 = 65; -AREA_TRANSITION_RURAL_04 = 66; -AREA_TRANSITION_RURAL_05 = 67; -AREA_TRANSITION_WRURAL_01 = 68; -AREA_TRANSITION_WRURAL_02 = 69; -AREA_TRANSITION_WRURAL_03 = 70; -AREA_TRANSITION_WRURAL_04 = 71; -AREA_TRANSITION_WRURAL_05 = 72; -AREA_TRANSITION_DESERT_01 = 73; -AREA_TRANSITION_DESERT_02 = 74; -AREA_TRANSITION_DESERT_03 = 75; -AREA_TRANSITION_DESERT_04 = 76; -AREA_TRANSITION_DESERT_05 = 77; -AREA_TRANSITION_RUINS_01 = 78; -AREA_TRANSITION_RUINS_02 = 79; -AREA_TRANSITION_RUINS_03 = 80; -AREA_TRANSITION_RUINS_04 = 81; -AREA_TRANSITION_RUINS_05 = 82; -AREA_TRANSITION_CARAVAN_WINTER = 83; -AREA_TRANSITION_CARAVAN_DESERT = 84; -AREA_TRANSITION_CARAVAN_RURAL = 85; -AREA_TRANSITION_MAGICAL_01 = 86; -AREA_TRANSITION_MAGICAL_02 = 87; -AREA_TRANSITION_UNDERDARK_01 = 88; -AREA_TRANSITION_UNDERDARK_02 = 89; -AREA_TRANSITION_UNDERDARK_03 = 90; -AREA_TRANSITION_UNDERDARK_04 = 91; -AREA_TRANSITION_UNDERDARK_05 = 92; -AREA_TRANSITION_UNDERDARK_06 = 93; -AREA_TRANSITION_UNDERDARK_07 = 94; -AREA_TRANSITION_BEHOLDER_01 = 95; -AREA_TRANSITION_BEHOLDER_02 = 96; -AREA_TRANSITION_DROW_01 = 97; -AREA_TRANSITION_DROW_02 = 98; -AREA_TRANSITION_ILLITHID_01 = 99; -AREA_TRANSITION_ILLITHID_02 = 100; -AREA_TRANSITION_WASTELAND_01 = 101; -AREA_TRANSITION_WASTELAND_02 = 102; -AREA_TRANSITION_WASTELAND_03 = 103; -AREA_TRANSITION_DROW_03 = 104; -AREA_TRANSITION_DROW_04 = 105; --- Legacy area-transition constants. Do not delete these. -AREA_TRANSITION_CITY = 2; -AREA_TRANSITION_CRYPT = 7; -AREA_TRANSITION_FOREST = 58; -AREA_TRANSITION_RURAL = 63; -BODY_NODE_HAND = 0; -BODY_NODE_CHEST = 1; -BODY_NODE_MONSTER_0 = 2; -BODY_NODE_MONSTER_1 = 3; -BODY_NODE_MONSTER_2 = 4; -BODY_NODE_MONSTER_3 = 5; -BODY_NODE_MONSTER_4 = 6; -BODY_NODE_MONSTER_5 = 7; -BODY_NODE_MONSTER_6 = 8; -BODY_NODE_MONSTER_7 = 9; -BODY_NODE_MONSTER_8 = 10; -BODY_NODE_MONSTER_9 = 11; -RADIUS_SIZE_SMALL = 1.67f; -RADIUS_SIZE_MEDIUM = 3.33f; -RADIUS_SIZE_LARGE = 5.0f; -RADIUS_SIZE_HUGE = 6.67f; -RADIUS_SIZE_GARGANTUAN = 8.33f; -RADIUS_SIZE_COLOSSAL = 10.0f; --- these are magic numbers. they should correspond to the values layed out in ExecuteCommandGetEffectType -EFFECT_TYPE_INVALIDEFFECT = 0; -EFFECT_TYPE_DAMAGE_RESISTANCE = 1; --- int EFFECT_TYPE_ABILITY_BONUS = 2; -EFFECT_TYPE_REGENERATE = 3; --- int EFFECT_TYPE_SAVING_THROW_BONUS = 4; --- int EFFECT_TYPE_MODIFY_AC = 5; --- int EFFECT_TYPE_ATTACK_BONUS = 6; -EFFECT_TYPE_DAMAGE_REDUCTION = 7; --- int EFFECT_TYPE_DAMAGE_BONUS = 8; -EFFECT_TYPE_TEMPORARY_HITPOINTS = 9; --- int EFFECT_TYPE_DAMAGE_IMMUNITY = 10; -EFFECT_TYPE_ENTANGLE = 11; -EFFECT_TYPE_INVULNERABLE = 12; -EFFECT_TYPE_DEAF = 13; -EFFECT_TYPE_RESURRECTION = 14; -EFFECT_TYPE_IMMUNITY = 15; --- int EFFECT_TYPE_BLIND = 16; -EFFECT_TYPE_ENEMY_ATTACK_BONUS = 17; -EFFECT_TYPE_ARCANE_SPELL_FAILURE = 18; --- int EFFECT_TYPE_MOVEMENT_SPEED = 19; -EFFECT_TYPE_AREA_OF_EFFECT = 20; -EFFECT_TYPE_BEAM = 21; --- int EFFECT_TYPE_SPELL_RESISTANCE = 22; -EFFECT_TYPE_CHARMED = 23; -EFFECT_TYPE_CONFUSED = 24; -EFFECT_TYPE_FRIGHTENED = 25; -EFFECT_TYPE_DOMINATED = 26; -EFFECT_TYPE_PARALYZE = 27; -EFFECT_TYPE_DAZED = 28; -EFFECT_TYPE_STUNNED = 29; -EFFECT_TYPE_SLEEP = 30; -EFFECT_TYPE_POISON = 31; -EFFECT_TYPE_DISEASE = 32; -EFFECT_TYPE_CURSE = 33; -EFFECT_TYPE_SILENCE = 34; -EFFECT_TYPE_TURNED = 35; -EFFECT_TYPE_HASTE = 36; -EFFECT_TYPE_SLOW = 37; -EFFECT_TYPE_ABILITY_INCREASE = 38; -EFFECT_TYPE_ABILITY_DECREASE = 39; -EFFECT_TYPE_ATTACK_INCREASE = 40; -EFFECT_TYPE_ATTACK_DECREASE = 41; -EFFECT_TYPE_DAMAGE_INCREASE = 42; -EFFECT_TYPE_DAMAGE_DECREASE = 43; -EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE = 44; -EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE = 45; -EFFECT_TYPE_AC_INCREASE = 46; -EFFECT_TYPE_AC_DECREASE = 47; -EFFECT_TYPE_MOVEMENT_SPEED_INCREASE = 48; -EFFECT_TYPE_MOVEMENT_SPEED_DECREASE = 49; -EFFECT_TYPE_SAVING_THROW_INCREASE = 50; -EFFECT_TYPE_SAVING_THROW_DECREASE = 51; -EFFECT_TYPE_SPELL_RESISTANCE_INCREASE = 52; -EFFECT_TYPE_SPELL_RESISTANCE_DECREASE = 53; -EFFECT_TYPE_SKILL_INCREASE = 54; -EFFECT_TYPE_SKILL_DECREASE = 55; -EFFECT_TYPE_INVISIBILITY = 56; -EFFECT_TYPE_IMPROVEDINVISIBILITY = 57; -EFFECT_TYPE_DARKNESS = 58; -EFFECT_TYPE_DISPELMAGICALL = 59; -EFFECT_TYPE_ELEMENTALSHIELD = 60; -EFFECT_TYPE_NEGATIVELEVEL = 61; -EFFECT_TYPE_POLYMORPH = 62; -EFFECT_TYPE_SANCTUARY = 63; -EFFECT_TYPE_TRUESEEING = 64; -EFFECT_TYPE_SEEINVISIBLE = 65; -EFFECT_TYPE_TIMESTOP = 66; -EFFECT_TYPE_BLINDNESS = 67; -EFFECT_TYPE_SPELLLEVELABSORPTION = 68; -EFFECT_TYPE_DISPELMAGICBEST = 69; -EFFECT_TYPE_ULTRAVISION = 70; -EFFECT_TYPE_MISS_CHANCE = 71; -EFFECT_TYPE_CONCEALMENT = 72; -EFFECT_TYPE_SPELL_IMMUNITY = 73; -EFFECT_TYPE_VISUALEFFECT = 74; -EFFECT_TYPE_DISAPPEARAPPEAR = 75; -EFFECT_TYPE_SWARM = 76; -EFFECT_TYPE_TURN_RESISTANCE_DECREASE = 77; -EFFECT_TYPE_TURN_RESISTANCE_INCREASE = 78; -EFFECT_TYPE_PETRIFY = 79; -EFFECT_TYPE_CUTSCENE_PARALYZE = 80; -EFFECT_TYPE_ETHEREAL = 81; -EFFECT_TYPE_SPELL_FAILURE = 82; -EFFECT_TYPE_CUTSCENEGHOST = 83; -EFFECT_TYPE_CUTSCENEIMMOBILIZE = 84; -ITEM_APPR_TYPE_SIMPLE_MODEL = 0; -ITEM_APPR_TYPE_WEAPON_COLOR = 1; -ITEM_APPR_TYPE_WEAPON_MODEL = 2; -ITEM_APPR_TYPE_ARMOR_MODEL = 3; -ITEM_APPR_TYPE_ARMOR_COLOR = 4; -ITEM_APPR_NUM_TYPES = 5; -ITEM_APPR_ARMOR_COLOR_LEATHER1 = 0; -ITEM_APPR_ARMOR_COLOR_LEATHER2 = 1; -ITEM_APPR_ARMOR_COLOR_CLOTH1 = 2; -ITEM_APPR_ARMOR_COLOR_CLOTH2 = 3; -ITEM_APPR_ARMOR_COLOR_METAL1 = 4; -ITEM_APPR_ARMOR_COLOR_METAL2 = 5; -ITEM_APPR_ARMOR_NUM_COLORS = 6; -ITEM_APPR_ARMOR_MODEL_RFOOT = 0; -ITEM_APPR_ARMOR_MODEL_LFOOT = 1; -ITEM_APPR_ARMOR_MODEL_RSHIN = 2; -ITEM_APPR_ARMOR_MODEL_LSHIN = 3; -ITEM_APPR_ARMOR_MODEL_LTHIGH = 4; -ITEM_APPR_ARMOR_MODEL_RTHIGH = 5; -ITEM_APPR_ARMOR_MODEL_PELVIS = 6; -ITEM_APPR_ARMOR_MODEL_TORSO = 7; -ITEM_APPR_ARMOR_MODEL_BELT = 8; -ITEM_APPR_ARMOR_MODEL_NECK = 9; -ITEM_APPR_ARMOR_MODEL_RFOREARM = 10; -ITEM_APPR_ARMOR_MODEL_LFOREARM = 11; -ITEM_APPR_ARMOR_MODEL_RBICEP = 12; -ITEM_APPR_ARMOR_MODEL_LBICEP = 13; -ITEM_APPR_ARMOR_MODEL_RSHOULDER = 14; -ITEM_APPR_ARMOR_MODEL_LSHOULDER = 15; -ITEM_APPR_ARMOR_MODEL_RHAND = 16; -ITEM_APPR_ARMOR_MODEL_LHAND = 17; -ITEM_APPR_ARMOR_MODEL_ROBE = 18; -ITEM_APPR_ARMOR_NUM_MODELS = 19; -ITEM_APPR_WEAPON_MODEL_BOTTOM = 0; -ITEM_APPR_WEAPON_MODEL_MIDDLE = 1; -ITEM_APPR_WEAPON_MODEL_TOP = 2; -ITEM_APPR_WEAPON_COLOR_BOTTOM = 0; -ITEM_APPR_WEAPON_COLOR_MIDDLE = 1; -ITEM_APPR_WEAPON_COLOR_TOP = 2; -ITEM_PROPERTY_ABILITY_BONUS = 0; -ITEM_PROPERTY_AC_BONUS = 1; -ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP = 2; -ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE = 3; -ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP = 4; -ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT = 5; -ITEM_PROPERTY_ENHANCEMENT_BONUS = 6; -ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP = 7; -ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP = 8; -ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT = 9; -ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER = 10; -ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION = 11; -ITEM_PROPERTY_BONUS_FEAT = 12; -ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N = 13; -ITEM_PROPERTY_CAST_SPELL = 15; -ITEM_PROPERTY_DAMAGE_BONUS = 16; -ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP = 17; -ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP = 18; -ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT = 19; -ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE = 20; -ITEM_PROPERTY_DECREASED_DAMAGE = 21; -ITEM_PROPERTY_DAMAGE_REDUCTION = 22; -ITEM_PROPERTY_DAMAGE_RESISTANCE = 23; -ITEM_PROPERTY_DAMAGE_VULNERABILITY = 24; -ITEM_PROPERTY_DARKVISION = 26; -ITEM_PROPERTY_DECREASED_ABILITY_SCORE = 27; -ITEM_PROPERTY_DECREASED_AC = 28; -ITEM_PROPERTY_DECREASED_SKILL_MODIFIER = 29; -ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT = 32; -ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE = 33; -ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE = 34; -ITEM_PROPERTY_HASTE = 35; -ITEM_PROPERTY_HOLY_AVENGER = 36; -ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS = 37; -ITEM_PROPERTY_IMPROVED_EVASION = 38; -ITEM_PROPERTY_SPELL_RESISTANCE = 39; -ITEM_PROPERTY_SAVING_THROW_BONUS = 40; -ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC = 41; -ITEM_PROPERTY_KEEN = 43; -ITEM_PROPERTY_LIGHT = 44; -ITEM_PROPERTY_MIGHTY = 45; -ITEM_PROPERTY_MIND_BLANK = 46; -ITEM_PROPERTY_NO_DAMAGE = 47; -ITEM_PROPERTY_ON_HIT_PROPERTIES = 48; -ITEM_PROPERTY_DECREASED_SAVING_THROWS = 49; -ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC = 50; -ITEM_PROPERTY_REGENERATION = 51; -ITEM_PROPERTY_SKILL_BONUS = 52; -ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL = 53; -ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL = 54; -ITEM_PROPERTY_THIEVES_TOOLS = 55; -ITEM_PROPERTY_ATTACK_BONUS = 56; -ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP = 57; -ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP = 58; -ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT = 59; -ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER = 60; -ITEM_PROPERTY_UNLIMITED_AMMUNITION = 61; -ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP = 62; -ITEM_PROPERTY_USE_LIMITATION_CLASS = 63; -ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE = 64; -ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT = 65; -ITEM_PROPERTY_USE_LIMITATION_TILESET = 66; -ITEM_PROPERTY_REGENERATION_VAMPIRIC = 67; -ITEM_PROPERTY_TRAP = 70; -ITEM_PROPERTY_TRUE_SEEING = 71; -ITEM_PROPERTY_ON_MONSTER_HIT = 72; -ITEM_PROPERTY_TURN_RESISTANCE = 73; -ITEM_PROPERTY_MASSIVE_CRITICALS = 74; -ITEM_PROPERTY_FREEDOM_OF_MOVEMENT = 75; --- no longer working, poison is now a on_hit subtype -ITEM_PROPERTY_POISON = 76; -ITEM_PROPERTY_MONSTER_DAMAGE = 77; -ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL = 78; -ITEM_PROPERTY_SPECIAL_WALK = 79; -ITEM_PROPERTY_HEALERS_KIT = 80; -ITEM_PROPERTY_WEIGHT_INCREASE = 81; -ITEM_PROPERTY_ONHITCASTSPELL = 82; -ITEM_PROPERTY_VISUALEFFECT = 83; -ITEM_PROPERTY_ARCANE_SPELL_FAILURE = 84; -ITEM_PROPERTY_MATERIAL = 85; -ITEM_PROPERTY_QUALITY = 86; -ITEM_PROPERTY_ADDITIONAL = 87; -BASE_ITEM_SHORTSWORD = 0; -BASE_ITEM_LONGSWORD = 1; -BASE_ITEM_BATTLEAXE = 2; -BASE_ITEM_BASTARDSWORD = 3; -BASE_ITEM_LIGHTFLAIL = 4; -BASE_ITEM_WARHAMMER = 5; -BASE_ITEM_HEAVYCROSSBOW = 6; -BASE_ITEM_LIGHTCROSSBOW = 7; -BASE_ITEM_LONGBOW = 8; -BASE_ITEM_LIGHTMACE = 9; -BASE_ITEM_HALBERD = 10; -BASE_ITEM_SHORTBOW = 11; -BASE_ITEM_TWOBLADEDSWORD = 12; -BASE_ITEM_GREATSWORD = 13; -BASE_ITEM_SMALLSHIELD = 14; -BASE_ITEM_TORCH = 15; -BASE_ITEM_ARMOR = 16; -BASE_ITEM_HELMET = 17; -BASE_ITEM_GREATAXE = 18; -BASE_ITEM_AMULET = 19; -BASE_ITEM_ARROW = 20; -BASE_ITEM_BELT = 21; -BASE_ITEM_DAGGER = 22; -BASE_ITEM_MISCSMALL = 24; -BASE_ITEM_BOLT = 25; -BASE_ITEM_BOOTS = 26; -BASE_ITEM_BULLET = 27; -BASE_ITEM_CLUB = 28; -BASE_ITEM_MISCMEDIUM = 29; -BASE_ITEM_DART = 31; -BASE_ITEM_DIREMACE = 32; -BASE_ITEM_DOUBLEAXE = 33; -BASE_ITEM_MISCLARGE = 34; -BASE_ITEM_HEAVYFLAIL = 35; -BASE_ITEM_GLOVES = 36; -BASE_ITEM_LIGHTHAMMER = 37; -BASE_ITEM_HANDAXE = 38; -BASE_ITEM_HEALERSKIT = 39; -BASE_ITEM_KAMA = 40; -BASE_ITEM_KATANA = 41; -BASE_ITEM_KUKRI = 42; -BASE_ITEM_MISCTALL = 43; -BASE_ITEM_MAGICROD = 44; -BASE_ITEM_MAGICSTAFF = 45; -BASE_ITEM_MAGICWAND = 46; -BASE_ITEM_MORNINGSTAR = 47; -BASE_ITEM_POTIONS = 49; -BASE_ITEM_QUARTERSTAFF = 50; -BASE_ITEM_RAPIER = 51; -BASE_ITEM_RING = 52; -BASE_ITEM_SCIMITAR = 53; -BASE_ITEM_SCROLL = 54; -BASE_ITEM_SCYTHE = 55; -BASE_ITEM_LARGESHIELD = 56; -BASE_ITEM_TOWERSHIELD = 57; -BASE_ITEM_SHORTSPEAR = 58; -BASE_ITEM_SHURIKEN = 59; -BASE_ITEM_SICKLE = 60; -BASE_ITEM_SLING = 61; -BASE_ITEM_THIEVESTOOLS = 62; -BASE_ITEM_THROWINGAXE = 63; -BASE_ITEM_TRAPKIT = 64; -BASE_ITEM_KEY = 65; -BASE_ITEM_LARGEBOX = 66; -BASE_ITEM_MISCWIDE = 68; -BASE_ITEM_CSLASHWEAPON = 69; -BASE_ITEM_CPIERCWEAPON = 70; -BASE_ITEM_CBLUDGWEAPON = 71; -BASE_ITEM_CSLSHPRCWEAP = 72; -BASE_ITEM_CREATUREITEM = 73; -BASE_ITEM_BOOK = 74; -BASE_ITEM_SPELLSCROLL = 75; -BASE_ITEM_GOLD = 76; -BASE_ITEM_GEM = 77; -BASE_ITEM_BRACER = 78; -BASE_ITEM_MISCTHIN = 79; -BASE_ITEM_CLOAK = 80; -BASE_ITEM_GRENADE = 81; -BASE_ITEM_TRIDENT = 95; -BASE_ITEM_BLANK_POTION = 101; -BASE_ITEM_BLANK_SCROLL = 102; -BASE_ITEM_BLANK_WAND = 103; -BASE_ITEM_ENCHANTED_POTION = 104; -BASE_ITEM_ENCHANTED_SCROLL = 105; -BASE_ITEM_ENCHANTED_WAND = 106; -BASE_ITEM_DWARVENWARAXE = 108; -BASE_ITEM_CRAFTMATERIALMED = 109; -BASE_ITEM_CRAFTMATERIALSML = 110; -BASE_ITEM_WHIP = 111; -BASE_ITEM_INVALID = 256; -VFX_NONE = -1; -VFX_DUR_BLUR = 0; -VFX_DUR_DARKNESS = 1; -VFX_DUR_ENTANGLE = 2; -VFX_DUR_FREEDOM_OF_MOVEMENT = 3; -VFX_DUR_GLOBE_INVULNERABILITY = 4; -VFX_DUR_BLACKOUT = 5; -VFX_DUR_INVISIBILITY = 6; -VFX_DUR_MIND_AFFECTING_NEGATIVE = 7; -VFX_DUR_MIND_AFFECTING_POSITIVE = 8; -VFX_DUR_GHOSTLY_VISAGE = 9; -VFX_DUR_ETHEREAL_VISAGE = 10; -VFX_DUR_PROT_BARKSKIN = 11; -VFX_DUR_PROT_GREATER_STONESKIN = 12; -VFX_DUR_PROT_PREMONITION = 13; -VFX_DUR_PROT_SHADOW_ARMOR = 14; -VFX_DUR_PROT_STONESKIN = 15; -VFX_DUR_SANCTUARY = 16; -VFX_DUR_WEB = 17; -VFX_FNF_BLINDDEAF = 18; -VFX_FNF_DISPEL = 19; -VFX_FNF_DISPEL_DISJUNCTION = 20; -VFX_FNF_DISPEL_GREATER = 21; -VFX_FNF_FIREBALL = 22; -VFX_FNF_FIRESTORM = 23; -VFX_FNF_IMPLOSION = 24; --- int VFX_FNF_MASS_HASTE = 25 ; -VFX_FNF_MASS_HEAL = 26; -VFX_FNF_MASS_MIND_AFFECTING = 27; -VFX_FNF_METEOR_SWARM = 28; -VFX_FNF_NATURES_BALANCE = 29; -VFX_FNF_PWKILL = 30; -VFX_FNF_PWSTUN = 31; -VFX_FNF_SUMMON_GATE = 32; -VFX_FNF_SUMMON_MONSTER_1 = 33; -VFX_FNF_SUMMON_MONSTER_2 = 34; -VFX_FNF_SUMMON_MONSTER_3 = 35; -VFX_FNF_SUMMON_UNDEAD = 36; -VFX_FNF_SUNBEAM = 37; -VFX_FNF_TIME_STOP = 38; -VFX_FNF_WAIL_O_BANSHEES = 39; -VFX_FNF_WEIRD = 40; -VFX_FNF_WORD = 41; -VFX_IMP_AC_BONUS = 42; -VFX_IMP_ACID_L = 43; -VFX_IMP_ACID_S = 44; --- int VFX_IMP_ALTER_WEAPON = 45 ; -VFX_IMP_BLIND_DEAF_M = 46; -VFX_IMP_BREACH = 47; -VFX_IMP_CONFUSION_S = 48; -VFX_IMP_DAZED_S = 49; -VFX_IMP_DEATH = 50; -VFX_IMP_DISEASE_S = 51; -VFX_IMP_DISPEL = 52; -VFX_IMP_DISPEL_DISJUNCTION = 53; -VFX_IMP_DIVINE_STRIKE_FIRE = 54; -VFX_IMP_DIVINE_STRIKE_HOLY = 55; -VFX_IMP_DOMINATE_S = 56; -VFX_IMP_DOOM = 57; -VFX_IMP_FEAR_S = 58; --- int VFX_IMP_FLAME_L = 59 ; -VFX_IMP_FLAME_M = 60; -VFX_IMP_FLAME_S = 61; -VFX_IMP_FROST_L = 62; -VFX_IMP_FROST_S = 63; -VFX_IMP_GREASE = 64; -VFX_IMP_HASTE = 65; -VFX_IMP_HEALING_G = 66; -VFX_IMP_HEALING_L = 67; -VFX_IMP_HEALING_M = 68; -VFX_IMP_HEALING_S = 69; -VFX_IMP_HEALING_X = 70; -VFX_IMP_HOLY_AID = 71; -VFX_IMP_KNOCK = 72; -VFX_BEAM_LIGHTNING = 73; -VFX_IMP_LIGHTNING_M = 74; -VFX_IMP_LIGHTNING_S = 75; -VFX_IMP_MAGBLUE = 76; --- int VFX_IMP_MAGBLUE2 = 77 ; --- int VFX_IMP_MAGBLUE3 = 78 ; --- int VFX_IMP_MAGBLUE4 = 79 ; --- int VFX_IMP_MAGBLUE5 = 80 ; -VFX_IMP_NEGATIVE_ENERGY = 81; -VFX_DUR_PARALYZE_HOLD = 82; -VFX_IMP_POISON_L = 83; -VFX_IMP_POISON_S = 84; -VFX_IMP_POLYMORPH = 85; -VFX_IMP_PULSE_COLD = 86; -VFX_IMP_PULSE_FIRE = 87; -VFX_IMP_PULSE_HOLY = 88; -VFX_IMP_PULSE_NEGATIVE = 89; -VFX_IMP_RAISE_DEAD = 90; -VFX_IMP_REDUCE_ABILITY_SCORE = 91; -VFX_IMP_REMOVE_CONDITION = 92; -VFX_IMP_SILENCE = 93; -VFX_IMP_SLEEP = 94; -VFX_IMP_SLOW = 95; -VFX_IMP_SONIC = 96; -VFX_IMP_STUN = 97; -VFX_IMP_SUNSTRIKE = 98; -VFX_IMP_UNSUMMON = 99; -VFX_COM_SPECIAL_BLUE_RED = 100; -VFX_COM_SPECIAL_PINK_ORANGE = 101; -VFX_COM_SPECIAL_RED_WHITE = 102; -VFX_COM_SPECIAL_RED_ORANGE = 103; -VFX_COM_SPECIAL_WHITE_BLUE = 104; -VFX_COM_SPECIAL_WHITE_ORANGE = 105; -VFX_COM_BLOOD_REG_WIMP = 106; -VFX_COM_BLOOD_LRG_WIMP = 107; -VFX_COM_BLOOD_CRT_WIMP = 108; -VFX_COM_BLOOD_REG_RED = 109; -VFX_COM_BLOOD_REG_GREEN = 110; -VFX_COM_BLOOD_REG_YELLOW = 111; -VFX_COM_BLOOD_LRG_RED = 112; -VFX_COM_BLOOD_LRG_GREEN = 113; -VFX_COM_BLOOD_LRG_YELLOW = 114; -VFX_COM_BLOOD_CRT_RED = 115; -VFX_COM_BLOOD_CRT_GREEN = 116; -VFX_COM_BLOOD_CRT_YELLOW = 117; -VFX_COM_SPARKS_PARRY = 118; --- int VFX_COM_GIB = 119 ; -VFX_COM_UNLOAD_MODEL = 120; -VFX_COM_CHUNK_RED_SMALL = 121; -VFX_COM_CHUNK_RED_MEDIUM = 122; -VFX_COM_CHUNK_GREEN_SMALL = 123; -VFX_COM_CHUNK_GREEN_MEDIUM = 124; -VFX_COM_CHUNK_YELLOW_SMALL = 125; -VFX_COM_CHUNK_YELLOW_MEDIUM = 126; --- int VFX_ITM_ACID = 127 ; --- int VFX_ITM_FIRE = 128 ; --- int VFX_ITM_FROST = 129 ; --- int VFX_ITM_ILLUMINATED_BLUE = 130 ; --- int VFX_ITM_ILLUMINATED_PURPLE = 131 ; --- int VFX_ITM_ILLUMINATED_RED = 132 ; --- int VFX_ITM_LIGHTNING = 133 ; --- int VFX_ITM_PULSING_BLUE = 134 ; --- int VFX_ITM_PULSING_PURPLE = 135 ; --- int VFX_ITM_PULSING_RED = 136 ; --- int VFX_ITM_SMOKING = 137 ; -VFX_DUR_SPELLTURNING = 138; -VFX_IMP_IMPROVE_ABILITY_SCORE = 139; -VFX_IMP_CHARM = 140; -VFX_IMP_MAGICAL_VISION = 141; --- int VFX_IMP_LAW_HELP = 142; --- int VFX_IMP_CHAOS_HELP = 143; -VFX_IMP_EVIL_HELP = 144; -VFX_IMP_GOOD_HELP = 145; -VFX_IMP_DEATH_WARD = 146; -VFX_DUR_ELEMENTAL_SHIELD = 147; -VFX_DUR_LIGHT = 148; -VFX_IMP_MAGIC_PROTECTION = 149; -VFX_IMP_SUPER_HEROISM = 150; -VFX_FNF_STORM = 151; -VFX_IMP_ELEMENTAL_PROTECTION = 152; -VFX_DUR_LIGHT_BLUE_5 = 153; -VFX_DUR_LIGHT_BLUE_10 = 154; -VFX_DUR_LIGHT_BLUE_15 = 155; -VFX_DUR_LIGHT_BLUE_20 = 156; -VFX_DUR_LIGHT_YELLOW_5 = 157; -VFX_DUR_LIGHT_YELLOW_10 = 158; -VFX_DUR_LIGHT_YELLOW_15 = 159; -VFX_DUR_LIGHT_YELLOW_20 = 160; -VFX_DUR_LIGHT_PURPLE_5 = 161; -VFX_DUR_LIGHT_PURPLE_10 = 162; -VFX_DUR_LIGHT_PURPLE_15 = 163; -VFX_DUR_LIGHT_PURPLE_20 = 164; -VFX_DUR_LIGHT_RED_5 = 165; -VFX_DUR_LIGHT_RED_10 = 166; -VFX_DUR_LIGHT_RED_15 = 167; -VFX_DUR_LIGHT_RED_20 = 168; -VFX_DUR_LIGHT_ORANGE_5 = 169; -VFX_DUR_LIGHT_ORANGE_10 = 170; -VFX_DUR_LIGHT_ORANGE_15 = 171; -VFX_DUR_LIGHT_ORANGE_20 = 172; -VFX_DUR_LIGHT_WHITE_5 = 173; -VFX_DUR_LIGHT_WHITE_10 = 174; -VFX_DUR_LIGHT_WHITE_15 = 175; -VFX_DUR_LIGHT_WHITE_20 = 176; -VFX_DUR_LIGHT_GREY_5 = 177; -VFX_DUR_LIGHT_GREY_10 = 178; -VFX_DUR_LIGHT_GREY_15 = 179; -VFX_DUR_LIGHT_GREY_20 = 180; -VFX_IMP_MIRV = 181; -VFX_DUR_DARKVISION = 182; -VFX_FNF_SOUND_BURST = 183; -VFX_FNF_STRIKE_HOLY = 184; -VFX_FNF_LOS_EVIL_10 = 185; -VFX_FNF_LOS_EVIL_20 = 186; -VFX_FNF_LOS_EVIL_30 = 187; -VFX_FNF_LOS_HOLY_10 = 188; -VFX_FNF_LOS_HOLY_20 = 189; -VFX_FNF_LOS_HOLY_30 = 190; -VFX_FNF_LOS_NORMAL_10 = 191; -VFX_FNF_LOS_NORMAL_20 = 192; -VFX_FNF_LOS_NORMAL_30 = 193; -VFX_IMP_HEAD_ACID = 194; -VFX_IMP_HEAD_FIRE = 195; -VFX_IMP_HEAD_SONIC = 196; -VFX_IMP_HEAD_ELECTRICITY = 197; -VFX_IMP_HEAD_COLD = 198; -VFX_IMP_HEAD_HOLY = 199; -VFX_IMP_HEAD_NATURE = 200; -VFX_IMP_HEAD_HEAL = 201; -VFX_IMP_HEAD_MIND = 202; -VFX_IMP_HEAD_EVIL = 203; -VFX_IMP_HEAD_ODD = 204; -VFX_DUR_CESSATE_NEUTRAL = 205; -VFX_DUR_CESSATE_POSITIVE = 206; -VFX_DUR_CESSATE_NEGATIVE = 207; -VFX_DUR_MIND_AFFECTING_DISABLED = 208; -VFX_DUR_MIND_AFFECTING_DOMINATED = 209; -VFX_BEAM_FIRE = 210; -VFX_BEAM_COLD = 211; -VFX_BEAM_HOLY = 212; -VFX_BEAM_MIND = 213; -VFX_BEAM_EVIL = 214; -VFX_BEAM_ODD = 215; -VFX_BEAM_FIRE_LASH = 216; -VFX_IMP_DEATH_L = 217; -VFX_DUR_MIND_AFFECTING_FEAR = 218; -VFX_FNF_SUMMON_CELESTIAL = 219; -VFX_DUR_GLOBE_MINOR = 220; -VFX_IMP_RESTORATION_LESSER = 221; -VFX_IMP_RESTORATION = 222; -VFX_IMP_RESTORATION_GREATER = 223; -VFX_DUR_PROTECTION_ELEMENTS = 224; -VFX_DUR_PROTECTION_GOOD_MINOR = 225; -VFX_DUR_PROTECTION_GOOD_MAJOR = 226; -VFX_DUR_PROTECTION_EVIL_MINOR = 227; -VFX_DUR_PROTECTION_EVIL_MAJOR = 228; -VFX_DUR_MAGICAL_SIGHT = 229; -VFX_DUR_WEB_MASS = 230; -VFX_FNF_ICESTORM = 231; -VFX_DUR_PARALYZED = 232; -VFX_IMP_MIRV_FLAME = 233; -VFX_IMP_DESTRUCTION = 234; -VFX_COM_CHUNK_RED_LARGE = 235; -VFX_COM_CHUNK_BONE_MEDIUM = 236; -VFX_COM_BLOOD_SPARK_SMALL = 237; -VFX_COM_BLOOD_SPARK_MEDIUM = 238; -VFX_COM_BLOOD_SPARK_LARGE = 239; -VFX_DUR_GHOSTLY_PULSE = 240; -VFX_FNF_HORRID_WILTING = 241; -VFX_DUR_BLINDVISION = 242; -VFX_DUR_LOWLIGHTVISION = 243; -VFX_DUR_ULTRAVISION = 244; -VFX_DUR_MIRV_ACID = 245; -VFX_IMP_HARM = 246; -VFX_DUR_BLIND = 247; -VFX_DUR_ANTI_LIGHT_10 = 248; -VFX_DUR_MAGIC_RESISTANCE = 249; -VFX_IMP_MAGIC_RESISTANCE_USE = 250; -VFX_IMP_GLOBE_USE = 251; -VFX_IMP_WILL_SAVING_THROW_USE = 252; -VFX_IMP_SPIKE_TRAP = 253; -VFX_IMP_SPELL_MANTLE_USE = 254; -VFX_IMP_FORTITUDE_SAVING_THROW_USE = 255; -VFX_IMP_REFLEX_SAVE_THROW_USE = 256; -VFX_FNF_GAS_EXPLOSION_ACID = 257; -VFX_FNF_GAS_EXPLOSION_EVIL = 258; -VFX_FNF_GAS_EXPLOSION_NATURE = 259; -VFX_FNF_GAS_EXPLOSION_FIRE = 260; -VFX_FNF_GAS_EXPLOSION_GREASE = 261; -VFX_FNF_GAS_EXPLOSION_MIND = 262; -VFX_FNF_SMOKE_PUFF = 263; -VFX_IMP_PULSE_WATER = 264; -VFX_IMP_PULSE_WIND = 265; -VFX_IMP_PULSE_NATURE = 266; -VFX_DUR_AURA_COLD = 267; -VFX_DUR_AURA_FIRE = 268; -VFX_DUR_AURA_POISON = 269; -VFX_DUR_AURA_DISEASE = 270; -VFX_DUR_AURA_ODD = 271; -VFX_DUR_AURA_SILENCE = 272; -VFX_IMP_AURA_HOLY = 273; -VFX_IMP_AURA_UNEARTHLY = 274; -VFX_IMP_AURA_FEAR = 275; -VFX_IMP_AURA_NEGATIVE_ENERGY = 276; -VFX_DUR_BARD_SONG = 277; -VFX_FNF_HOWL_MIND = 278; -VFX_FNF_HOWL_ODD = 279; -VFX_COM_HIT_FIRE = 280; -VFX_COM_HIT_FROST = 281; -VFX_COM_HIT_ELECTRICAL = 282; -VFX_COM_HIT_ACID = 283; -VFX_COM_HIT_SONIC = 284; -VFX_FNF_HOWL_WAR_CRY = 285; -VFX_FNF_SCREEN_SHAKE = 286; -VFX_FNF_SCREEN_BUMP = 287; -VFX_COM_HIT_NEGATIVE = 288; -VFX_COM_HIT_DIVINE = 289; -VFX_FNF_HOWL_WAR_CRY_FEMALE = 290; -VFX_DUR_AURA_DRAGON_FEAR = 291; -VFX_DUR_FLAG_RED = 303; -VFX_DUR_FLAG_BLUE = 304; -VFX_DUR_FLAG_GOLD = 305; -VFX_DUR_FLAG_PURPLE = 306; -VFX_DUR_FLAG_GOLD_FIXED = 306; -VFX_DUR_FLAG_PURPLE_FIXED = 305; -VFX_DUR_TENTACLE = 346; -VFX_DUR_PETRIFY = 351; -VFX_DUR_FREEZE_ANIMATION = 352; -VFX_COM_CHUNK_STONE_SMALL = 353; -VFX_COM_CHUNK_STONE_MEDIUM = 354; -VFX_BEAM_SILENT_LIGHTNING = 307; -VFX_BEAM_SILENT_FIRE = 308; -VFX_BEAM_SILENT_COLD = 309; -VFX_BEAM_SILENT_HOLY = 310; -VFX_BEAM_SILENT_MIND = 311; -VFX_BEAM_SILENT_EVIL = 312; -VFX_BEAM_SILENT_ODD = 313; -VFX_DUR_BIGBYS_INTERPOSING_HAND = 314; -VFX_IMP_BIGBYS_FORCEFUL_HAND = 315; -VFX_DUR_BIGBYS_CLENCHED_FIST = 316; -VFX_DUR_BIGBYS_CRUSHING_HAND = 317; -VFX_DUR_BIGBYS_GRASPING_HAND = 318; -VFX_DUR_CALTROPS = 319; -VFX_DUR_SMOKE = 320; -VFX_DUR_PIXIEDUST = 321; -VFX_FNF_DECK = 322; -VFX_DUR_CUTSCENE_INVISIBILITY = 355; -VFX_EYES_RED_FLAME_HUMAN_MALE = 360; -VFX_EYES_RED_FLAME_HUMAN_FEMALE = 361; -VFX_EYES_RED_FLAME_HALFELF_MALE = 360; -VFX_EYES_RED_FLAME_HALFELF_FEMALE = 361; -VFX_EYES_RED_FLAME_DWARF_MALE = 362; -VFX_EYES_RED_FLAME_DWARF_FEMALE = 363; -VFX_EYES_RED_FLAME_ELF_MALE = 364; -VFX_EYES_RED_FLAME_ELF_FEMALE = 365; -VFX_EYES_RED_FLAME_GNOME_MALE = 366; -VFX_EYES_RED_FLAME_GNOME_FEMALE = 367; -VFX_EYES_RED_FLAME_HALFLING_MALE = 368; -VFX_EYES_RED_FLAME_HALFLING_FEMALE = 369; -VFX_EYES_RED_FLAME_HALFORC_MALE = 370; -VFX_EYES_RED_FLAME_HALFORC_FEMALE = 371; -VFX_EYES_RED_FLAME_TROGLODYTE = 372; -VFX_EYES_YEL_HUMAN_MALE = 373; -VFX_EYES_YEL_HUMAN_FEMALE = 374; -VFX_EYES_YEL_DWARF_MALE = 375; -VFX_EYES_YEL_DWARF_FEMALE = 376; -VFX_EYES_YEL_ELF_MALE = 377; -VFX_EYES_YEL_ELF_FEMALE = 378; -VFX_EYES_YEL_GNOME_MALE = 379; -VFX_EYES_YEL_GNOME_FEMALE = 380; -VFX_EYES_YEL_HALFLING_MALE = 381; -VFX_EYES_YEL_HALFLING_FEMALE = 382; -VFX_EYES_YEL_HALFORC_MALE = 383; -VFX_EYES_YEL_HALFORC_FEMALE = 384; -VFX_EYES_YEL_TROGLODYTE = 385; -VFX_EYES_ORG_HUMAN_MALE = 386; -VFX_EYES_ORG_HUMAN_FEMALE = 387; -VFX_EYES_ORG_DWARF_MALE = 388; -VFX_EYES_ORG_DWARF_FEMALE = 389; -VFX_EYES_ORG_ELF_MALE = 390; -VFX_EYES_ORG_ELF_FEMALE = 391; -VFX_EYES_ORG_GNOME_MALE = 392; -VFX_EYES_ORG_GNOME_FEMALE = 393; -VFX_EYES_ORG_HALFLING_MALE = 394; -VFX_EYES_ORG_HALFLING_FEMALE = 395; -VFX_EYES_ORG_HALFORC_MALE = 396; -VFX_EYES_ORG_HALFORC_FEMALE = 397; -VFX_EYES_ORG_TROGLODYTE = 398; -VFX_DUR_IOUNSTONE = 403; -VFX_IMP_TORNADO = 407; -VFX_DUR_GLOW_LIGHT_BLUE = 408; -VFX_DUR_GLOW_PURPLE = 409; -VFX_DUR_GLOW_BLUE = 410; -VFX_DUR_GLOW_RED = 411; -VFX_DUR_GLOW_LIGHT_RED = 412; -VFX_DUR_GLOW_YELLOW = 413; -VFX_DUR_GLOW_LIGHT_YELLOW = 414; -VFX_DUR_GLOW_GREEN = 415; -VFX_DUR_GLOW_LIGHT_GREEN = 416; -VFX_DUR_GLOW_ORANGE = 417; -VFX_DUR_GLOW_LIGHT_ORANGE = 418; -VFX_DUR_GLOW_BROWN = 419; -VFX_DUR_GLOW_LIGHT_BROWN = 420; -VFX_DUR_GLOW_GREY = 421; -VFX_DUR_GLOW_WHITE = 422; -VFX_DUR_GLOW_LIGHT_PURPLE = 423; -VFX_DUR_GHOST_TRANSPARENT = 424; -VFX_DUR_GHOST_SMOKE = 425; -VFX_DUR_GLYPH_OF_WARDING = 445; -VFX_FNF_SOUND_BURST_SILENT = 446; -VFX_BEAM_DISINTEGRATE = 447; -VFX_FNF_ELECTRIC_EXPLOSION = 459; -VFX_IMP_DUST_EXPLOSION = 460; -VFX_IMP_PULSE_HOLY_SILENT = 461; -VFX_DUR_DEATH_ARMOR = 463; -VFX_DUR_ICESKIN = 465; -VFX_FNF_SWINGING_BLADE = 473; -VFX_DUR_INFERNO = 474; -VFX_FNF_DEMON_HAND = 475; -VFX_DUR_STONEHOLD = 476; -VFX_FNF_MYSTICAL_EXPLOSION = 477; -VFX_DUR_GHOSTLY_VISAGE_NO_SOUND = 478; -VFX_DUR_GHOST_SMOKE_2 = 479; -VFX_DUR_FLIES = 480; -VFX_FNF_SUMMONDRAGON = 481; -VFX_BEAM_FIRE_W = 482; -VFX_BEAM_FIRE_W_SILENT = 483; -VFX_BEAM_CHAIN = 484; -VFX_BEAM_BLACK = 485; -VFX_IMP_WALLSPIKE = 486; -VFX_FNF_GREATER_RUIN = 487; -VFX_FNF_UNDEAD_DRAGON = 488; -VFX_DUR_PROT_EPIC_ARMOR = 495; -VFX_FNF_SUMMON_EPIC_UNDEAD = 496; -VFX_DUR_PROT_EPIC_ARMOR_2 = 497; -VFX_DUR_INFERNO_CHEST = 498; -VFX_DUR_IOUNSTONE_RED = 499; -VFX_DUR_IOUNSTONE_BLUE = 500; -VFX_DUR_IOUNSTONE_YELLOW = 501; -VFX_DUR_IOUNSTONE_GREEN = 502; -VFX_IMP_MIRV_ELECTRIC = 503; -VFX_COM_CHUNK_RED_BALLISTA = 504; -VFX_DUR_INFERNO_NO_SOUND = 505; -VFX_DUR_AURA_PULSE_RED_WHITE = 512; -VFX_DUR_AURA_PULSE_BLUE_WHITE = 513; -VFX_DUR_AURA_PULSE_GREEN_WHITE = 514; -VFX_DUR_AURA_PULSE_YELLOW_WHITE = 515; -VFX_DUR_AURA_PULSE_MAGENTA_WHITE = 516; -VFX_DUR_AURA_PULSE_CYAN_WHITE = 517; -VFX_DUR_AURA_PULSE_ORANGE_WHITE = 518; -VFX_DUR_AURA_PULSE_BROWN_WHITE = 519; -VFX_DUR_AURA_PULSE_PURPLE_WHITE = 520; -VFX_DUR_AURA_PULSE_GREY_WHITE = 521; -VFX_DUR_AURA_PULSE_GREY_BLACK = 522; -VFX_DUR_AURA_PULSE_BLUE_GREEN = 523; -VFX_DUR_AURA_PULSE_RED_BLUE = 524; -VFX_DUR_AURA_PULSE_RED_YELLOW = 525; -VFX_DUR_AURA_PULSE_GREEN_YELLOW = 526; -VFX_DUR_AURA_PULSE_RED_GREEN = 527; -VFX_DUR_AURA_PULSE_BLUE_YELLOW = 528; -VFX_DUR_AURA_PULSE_BLUE_BLACK = 529; -VFX_DUR_AURA_PULSE_RED_BLACK = 530; -VFX_DUR_AURA_PULSE_GREEN_BLACK = 531; -VFX_DUR_AURA_PULSE_YELLOW_BLACK = 532; -VFX_DUR_AURA_PULSE_MAGENTA_BLACK = 533; -VFX_DUR_AURA_PULSE_CYAN_BLACK = 534; -VFX_DUR_AURA_PULSE_ORANGE_BLACK = 535; -VFX_DUR_AURA_PULSE_BROWN_BLACK = 536; -VFX_DUR_AURA_PULSE_PURPLE_BLACK = 537; -VFX_DUR_AURA_PULSE_CYAN_GREEN = 538; -VFX_DUR_AURA_PULSE_CYAN_BLUE = 539; -VFX_DUR_AURA_PULSE_CYAN_RED = 540; -VFX_DUR_AURA_PULSE_CYAN_YELLOW = 541; -VFX_DUR_AURA_PULSE_MAGENTA_BLUE = 542; -VFX_DUR_AURA_PULSE_MAGENTA_RED = 543; -VFX_DUR_AURA_PULSE_MAGENTA_GREEN = 544; -VFX_DUR_AURA_PULSE_MAGENTA_YELLOW = 545; -VFX_DUR_AURA_PULSE_RED_ORANGE = 546; -VFX_DUR_AURA_PULSE_YELLOW_ORANGE = 547; -VFX_DUR_AURA_RED = 548; -VFX_DUR_AURA_GREEN = 549; -VFX_DUR_AURA_BLUE = 550; -VFX_DUR_AURA_MAGENTA = 551; -VFX_DUR_AURA_YELLOW = 552; -VFX_DUR_AURA_WHITE = 553; -VFX_DUR_AURA_ORANGE = 554; -VFX_DUR_AURA_BROWN = 555; -VFX_DUR_AURA_PURPLE = 556; -VFX_DUR_AURA_CYAN = 557; -VFX_DUR_AURA_GREEN_DARK = 558; -VFX_DUR_AURA_GREEN_LIGHT = 559; -VFX_DUR_AURA_RED_DARK = 560; -VFX_DUR_AURA_RED_LIGHT = 561; -VFX_DUR_AURA_BLUE_DARK = 562; -VFX_DUR_AURA_BLUE_LIGHT = 563; -VFX_DUR_AURA_YELLOW_DARK = 564; -VFX_DUR_AURA_YELLOW_LIGHT = 565; -VFX_DUR_BUBBLES = 566; -VFX_EYES_GREEN_HUMAN_MALE = 567; -VFX_EYES_GREEN_HUMAN_FEMALE = 568; -VFX_EYES_GREEN_HALFELF_MALE = 567; -VFX_EYES_GREEN_HALFELF_FEMALE = 568; -VFX_EYES_GREEN_DWARF_MALE = 569; -VFX_EYES_GREEN_DWARF_FEMALE = 570; -VFX_EYES_GREEN_ELF_MALE = 571; -VFX_EYES_GREEN_ELF_FEMALE = 572; -VFX_EYES_GREEN_GNOME_MALE = 573; -VFX_EYES_GREEN_GNOME_FEMALE = 574; -VFX_EYES_GREEN_HALFLING_MALE = 575; -VFX_EYES_GREEN_HALFLING_FEMALE = 576; -VFX_EYES_GREEN_HALFORC_MALE = 577; -VFX_EYES_GREEN_HALFORC_FEMALE = 578; -VFX_EYES_GREEN_TROGLODYTE = 579; -VFX_EYES_PUR_HUMAN_MALE = 580; -VFX_EYES_PUR_HUMAN_FEMALE = 581; -VFX_EYES_PUR_DWARF_MALE = 582; -VFX_EYES_PUR_DWARF_FEMALE = 583; -VFX_EYES_PUR_ELF_MALE = 584; -VFX_EYES_PUR_ELF_FEMALE = 585; -VFX_EYES_PUR_GNOME_MALE = 586; -VFX_EYES_PUR_GNOME_FEMALE = 587; -VFX_EYES_PUR_HALFLING_MALE = 588; -VFX_EYES_PUR_HALFLING_FEMALE = 589; -VFX_EYES_PUR_HALFORC_MALE = 590; -VFX_EYES_PUR_HALFORC_FEMALE = 591; -VFX_EYES_PUR_TROGLODYTE = 592; -VFX_EYES_CYN_HUMAN_MALE = 593; -VFX_EYES_CYN_HUMAN_FEMALE = 594; -VFX_EYES_CYN_DWARF_MALE = 595; -VFX_EYES_CYN_DWARF_FEMALE = 596; -VFX_EYES_CYN_ELF_MALE = 597; -VFX_EYES_CYN_ELF_FEMALE = 598; -VFX_EYES_CYN_GNOME_MALE = 599; -VFX_EYES_CYN_GNOME_FEMALE = 600; -VFX_EYES_CYN_HALFLING_MALE = 601; -VFX_EYES_CYN_HALFLING_FEMALE = 602; -VFX_EYES_CYN_HALFORC_MALE = 603; -VFX_EYES_CYN_HALFORC_FEMALE = 604; -VFX_EYES_CYN_TROGLODYTE = 605; -VFX_EYES_WHT_HUMAN_MALE = 606; -VFX_EYES_WHT_HUMAN_FEMALE = 607; -VFX_EYES_WHT_DWARF_MALE = 608; -VFX_EYES_WHT_DWARF_FEMALE = 609; -VFX_EYES_WHT_ELF_MALE = 610; -VFX_EYES_WHT_ELF_FEMALE = 611; -VFX_EYES_WHT_GNOME_MALE = 612; -VFX_EYES_WHT_GNOME_FEMALE = 613; -VFX_EYES_WHT_HALFLING_MALE = 614; -VFX_EYES_WHT_HALFLING_FEMALE = 615; -VFX_EYES_WHT_HALFORC_MALE = 616; -VFX_EYES_WHT_HALFORC_FEMALE = 617; -VFX_EYES_WHT_TROGLODYTE = 618; -VFX_IMP_PDK_GENERIC_PULSE = 623; -VFX_IMP_PDK_GENERIC_HEAD_HIT = 624; -VFX_IMP_PDK_RALLYING_CRY = 625; -VFX_IMP_PDK_HEROIC_SHIELD = 626; -VFX_IMP_PDK_INSPIRE_COURAGE = 627; -VFX_DUR_PDK_FEAR = 628; -VFX_IMP_PDK_WRATH = 629; -VFX_IMP_PDK_OATH = 630; -VFX_IMP_PDK_FINAL_STAND = 631; -VFX_DUR_ARROW_IN_STERNUM = 632; -VFX_DUR_ARROW_IN_CHEST_LEFT = 633; -VFX_DUR_ARROW_IN_CHEST_RIGHT = 634; -VFX_DUR_ARROW_IN_BACK = 635; -VFX_DUR_ARROW_IN_TEMPLES = 636; -VFX_DUR_ARROW_IN_FACE = 637; -VFX_DUR_ARROW_IN_HEAD = 638; -VFX_DUR_QUILL_IN_CHEST = 639; -VFX_IMP_STARBURST_GREEN = 644; -VFX_IMP_STARBURST_RED = 645; -VFX_IMP_NIGHTMARE_HEAD_HIT = 670; --- VFX_Persistent.2da -AOE_PER_FOGACID = 0; -AOE_PER_FOGFIRE = 1; -AOE_PER_FOGSTINK = 2; -AOE_PER_FOGKILL = 3; -AOE_PER_FOGMIND = 4; -AOE_PER_WALLFIRE = 5; -AOE_PER_WALLWIND = 6; -AOE_PER_WALLBLADE = 7; -AOE_PER_WEB = 8; -AOE_PER_ENTANGLE = 9; --- int AOE_PER_CHAOS = 10; -AOE_PER_DARKNESS = 11; -AOE_MOB_CIRCEVIL = 12; -AOE_MOB_CIRCGOOD = 13; -AOE_MOB_CIRCLAW = 14; -AOE_MOB_CIRCCHAOS = 15; -AOE_MOB_FEAR = 16; -AOE_MOB_BLINDING = 17; -AOE_MOB_UNEARTHLY = 18; -AOE_MOB_MENACE = 19; -AOE_MOB_UNNATURAL = 20; -AOE_MOB_STUN = 21; -AOE_MOB_PROTECTION = 22; -AOE_MOB_FIRE = 23; -AOE_MOB_FROST = 24; -AOE_MOB_ELECTRICAL = 25; -AOE_PER_FOGGHOUL = 26; -AOE_MOB_TYRANT_FOG = 27; -AOE_PER_STORM = 28; -AOE_PER_INVIS_SPHERE = 29; -AOE_MOB_SILENCE = 30; -AOE_PER_DELAY_BLAST_FIREBALL = 31; -AOE_PER_GREASE = 32; -AOE_PER_CREEPING_DOOM = 33; -AOE_PER_EVARDS_BLACK_TENTACLES = 34; -AOE_MOB_INVISIBILITY_PURGE = 35; -AOE_MOB_DRAGON_FEAR = 36; -AOE_PER_CUSTOM_AOE = 37; -AOE_PER_GLYPH_OF_WARDING = 38; -AOE_PER_FOG_OF_BEWILDERMENT = 39; -AOE_PER_VINE_MINE_CAMOUFLAGE = 40; -AOE_MOB_TIDE_OF_BATTLE = 41; -AOE_PER_STONEHOLD = 42; -AOE_PER_OVERMIND = 43; -AOE_MOB_HORRIFICAPPEARANCE = 44; -AOE_MOB_TROGLODYTE_STENCH = 45; -SPELL_ALL_SPELLS = -1; --- used for spell immunity. -SPELL_ACID_FOG = 0; -SPELL_AID = 1; -SPELL_ANIMATE_DEAD = 2; -SPELL_BARKSKIN = 3; -SPELL_BESTOW_CURSE = 4; -SPELL_BLADE_BARRIER = 5; -SPELL_BLESS = 6; -SPELL_BLESS_WEAPON = 537; -SPELL_BLINDNESS_AND_DEAFNESS = 8; -SPELL_BULLS_STRENGTH = 9; -SPELL_BURNING_HANDS = 10; -SPELL_CALL_LIGHTNING = 11; --- int SPELL_CALM_EMOTIONS = 12; -SPELL_CATS_GRACE = 13; -SPELL_CHAIN_LIGHTNING = 14; -SPELL_CHARM_MONSTER = 15; -SPELL_CHARM_PERSON = 16; -SPELL_CHARM_PERSON_OR_ANIMAL = 17; -SPELL_CIRCLE_OF_DEATH = 18; -SPELL_CIRCLE_OF_DOOM = 19; -SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE = 20; -SPELL_CLARITY = 21; -SPELL_CLOAK_OF_CHAOS = 22; -SPELL_CLOUDKILL = 23; -SPELL_COLOR_SPRAY = 24; -SPELL_CONE_OF_COLD = 25; -SPELL_CONFUSION = 26; -SPELL_CONTAGION = 27; -SPELL_CONTROL_UNDEAD = 28; -SPELL_CREATE_GREATER_UNDEAD = 29; -SPELL_CREATE_UNDEAD = 30; -SPELL_CURE_CRITICAL_WOUNDS = 31; -SPELL_CURE_LIGHT_WOUNDS = 32; -SPELL_CURE_MINOR_WOUNDS = 33; -SPELL_CURE_MODERATE_WOUNDS = 34; -SPELL_CURE_SERIOUS_WOUNDS = 35; -SPELL_DARKNESS = 36; -SPELL_DAZE = 37; -SPELL_DEATH_WARD = 38; -SPELL_DELAYED_BLAST_FIREBALL = 39; -SPELL_DISMISSAL = 40; -SPELL_DISPEL_MAGIC = 41; -SPELL_DIVINE_POWER = 42; -SPELL_DOMINATE_ANIMAL = 43; -SPELL_DOMINATE_MONSTER = 44; -SPELL_DOMINATE_PERSON = 45; -SPELL_DOOM = 46; -SPELL_ELEMENTAL_SHIELD = 47; -SPELL_ELEMENTAL_SWARM = 48; -SPELL_ENDURANCE = 49; -SPELL_ENDURE_ELEMENTS = 50; -SPELL_ENERGY_DRAIN = 51; -SPELL_ENERVATION = 52; -SPELL_ENTANGLE = 53; -SPELL_FEAR = 54; -SPELL_FEEBLEMIND = 55; -SPELL_FINGER_OF_DEATH = 56; -SPELL_FIRE_STORM = 57; -SPELL_FIREBALL = 58; -SPELL_FLAME_ARROW = 59; -SPELL_FLAME_LASH = 60; -SPELL_FLAME_STRIKE = 61; -SPELL_FREEDOM_OF_MOVEMENT = 62; -SPELL_GATE = 63; -SPELL_GHOUL_TOUCH = 64; -SPELL_GLOBE_OF_INVULNERABILITY = 65; -SPELL_GREASE = 66; -SPELL_GREATER_DISPELLING = 67; --- int SPELL_GREATER_MAGIC_WEAPON = 68; -SPELL_GREATER_PLANAR_BINDING = 69; -SPELL_GREATER_RESTORATION = 70; --- int SPELL_GREATER_SHADOW_CONJURATION = 71; -SPELL_GREATER_SPELL_BREACH = 72; -SPELL_GREATER_SPELL_MANTLE = 73; -SPELL_GREATER_STONESKIN = 74; -SPELL_GUST_OF_WIND = 75; -SPELL_HAMMER_OF_THE_GODS = 76; -SPELL_HARM = 77; -SPELL_HASTE = 78; -SPELL_HEAL = 79; -SPELL_HEALING_CIRCLE = 80; -SPELL_HOLD_ANIMAL = 81; -SPELL_HOLD_MONSTER = 82; -SPELL_HOLD_PERSON = 83; -SPELL_HOLY_AURA = 84; -SPELL_HOLY_SWORD = 538; -SPELL_IDENTIFY = 86; -SPELL_IMPLOSION = 87; -SPELL_IMPROVED_INVISIBILITY = 88; -SPELL_INCENDIARY_CLOUD = 89; -SPELL_INVISIBILITY = 90; -SPELL_INVISIBILITY_PURGE = 91; -SPELL_INVISIBILITY_SPHERE = 92; -SPELL_KNOCK = 93; -SPELL_LESSER_DISPEL = 94; -SPELL_LESSER_MIND_BLANK = 95; -SPELL_LESSER_PLANAR_BINDING = 96; -SPELL_LESSER_RESTORATION = 97; -SPELL_LESSER_SPELL_BREACH = 98; -SPELL_LESSER_SPELL_MANTLE = 99; -SPELL_LIGHT = 100; -SPELL_LIGHTNING_BOLT = 101; -SPELL_MAGE_ARMOR = 102; -SPELL_MAGIC_CIRCLE_AGAINST_CHAOS = 103; -SPELL_MAGIC_CIRCLE_AGAINST_EVIL = 104; -SPELL_MAGIC_CIRCLE_AGAINST_GOOD = 105; -SPELL_MAGIC_CIRCLE_AGAINST_LAW = 106; -SPELL_MAGIC_MISSILE = 107; -SPELL_MAGIC_VESTMENT = 546; --- int SPELL_MAGIC_WEAPON = 109; -SPELL_MASS_BLINDNESS_AND_DEAFNESS = 110; -SPELL_MASS_CHARM = 111; --- int SPELL_MASS_DOMINATION = 112; -SPELL_MASS_HASTE = 113; -SPELL_MASS_HEAL = 114; -SPELL_MELFS_ACID_ARROW = 115; -SPELL_METEOR_SWARM = 116; -SPELL_MIND_BLANK = 117; -SPELL_MIND_FOG = 118; -SPELL_MINOR_GLOBE_OF_INVULNERABILITY = 119; -SPELL_GHOSTLY_VISAGE = 120; -SPELL_ETHEREAL_VISAGE = 121; -SPELL_MORDENKAINENS_DISJUNCTION = 122; -SPELL_MORDENKAINENS_SWORD = 123; -SPELL_NATURES_BALANCE = 124; -SPELL_NEGATIVE_ENERGY_PROTECTION = 125; -SPELL_NEUTRALIZE_POISON = 126; -SPELL_PHANTASMAL_KILLER = 127; -SPELL_PLANAR_BINDING = 128; -SPELL_POISON = 129; -SPELL_POLYMORPH_SELF = 130; -SPELL_POWER_WORD_KILL = 131; -SPELL_POWER_WORD_STUN = 132; -SPELL_PRAYER = 133; -SPELL_PREMONITION = 134; -SPELL_PRISMATIC_SPRAY = 135; -SPELL_PROTECTION__FROM_CHAOS = 136; -SPELL_PROTECTION_FROM_ELEMENTS = 137; -SPELL_PROTECTION_FROM_EVIL = 138; -SPELL_PROTECTION_FROM_GOOD = 139; -SPELL_PROTECTION_FROM_LAW = 140; -SPELL_PROTECTION_FROM_SPELLS = 141; -SPELL_RAISE_DEAD = 142; -SPELL_RAY_OF_ENFEEBLEMENT = 143; -SPELL_RAY_OF_FROST = 144; -SPELL_REMOVE_BLINDNESS_AND_DEAFNESS = 145; -SPELL_REMOVE_CURSE = 146; -SPELL_REMOVE_DISEASE = 147; -SPELL_REMOVE_FEAR = 148; -SPELL_REMOVE_PARALYSIS = 149; -SPELL_RESIST_ELEMENTS = 150; -SPELL_RESISTANCE = 151; -SPELL_RESTORATION = 152; -SPELL_RESURRECTION = 153; -SPELL_SANCTUARY = 154; -SPELL_SCARE = 155; -SPELL_SEARING_LIGHT = 156; -SPELL_SEE_INVISIBILITY = 157; --- int SPELL_SHADES = 158; --- int SPELL_SHADOW_CONJURATION = 159; -SPELL_SHADOW_SHIELD = 160; -SPELL_SHAPECHANGE = 161; -SPELL_SHIELD_OF_LAW = 162; -SPELL_SILENCE = 163; -SPELL_SLAY_LIVING = 164; -SPELL_SLEEP = 165; -SPELL_SLOW = 166; -SPELL_SOUND_BURST = 167; -SPELL_SPELL_RESISTANCE = 168; -SPELL_SPELL_MANTLE = 169; -SPELL_SPHERE_OF_CHAOS = 170; -SPELL_STINKING_CLOUD = 171; -SPELL_STONESKIN = 172; -SPELL_STORM_OF_VENGEANCE = 173; -SPELL_SUMMON_CREATURE_I = 174; -SPELL_SUMMON_CREATURE_II = 175; -SPELL_SUMMON_CREATURE_III = 176; -SPELL_SUMMON_CREATURE_IV = 177; -SPELL_SUMMON_CREATURE_IX = 178; -SPELL_SUMMON_CREATURE_V = 179; -SPELL_SUMMON_CREATURE_VI = 180; -SPELL_SUMMON_CREATURE_VII = 181; -SPELL_SUMMON_CREATURE_VIII = 182; -SPELL_SUNBEAM = 183; -SPELL_TENSERS_TRANSFORMATION = 184; -SPELL_TIME_STOP = 185; -SPELL_TRUE_SEEING = 186; -SPELL_UNHOLY_AURA = 187; -SPELL_VAMPIRIC_TOUCH = 188; -SPELL_VIRTUE = 189; -SPELL_WAIL_OF_THE_BANSHEE = 190; -SPELL_WALL_OF_FIRE = 191; -SPELL_WEB = 192; -SPELL_WEIRD = 193; -SPELL_WORD_OF_FAITH = 194; -SPELLABILITY_AURA_BLINDING = 195; -SPELLABILITY_AURA_COLD = 196; -SPELLABILITY_AURA_ELECTRICITY = 197; -SPELLABILITY_AURA_FEAR = 198; -SPELLABILITY_AURA_FIRE = 199; -SPELLABILITY_AURA_MENACE = 200; -SPELLABILITY_AURA_PROTECTION = 201; -SPELLABILITY_AURA_STUN = 202; -SPELLABILITY_AURA_UNEARTHLY_VISAGE = 203; -SPELLABILITY_AURA_UNNATURAL = 204; -SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA = 205; -SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION = 206; -SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY = 207; -SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE = 208; -SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH = 209; -SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM = 210; -SPELLABILITY_BOLT_ACID = 211; -SPELLABILITY_BOLT_CHARM = 212; -SPELLABILITY_BOLT_COLD = 213; -SPELLABILITY_BOLT_CONFUSE = 214; -SPELLABILITY_BOLT_DAZE = 215; -SPELLABILITY_BOLT_DEATH = 216; -SPELLABILITY_BOLT_DISEASE = 217; -SPELLABILITY_BOLT_DOMINATE = 218; -SPELLABILITY_BOLT_FIRE = 219; -SPELLABILITY_BOLT_KNOCKDOWN = 220; -SPELLABILITY_BOLT_LEVEL_DRAIN = 221; -SPELLABILITY_BOLT_LIGHTNING = 222; -SPELLABILITY_BOLT_PARALYZE = 223; -SPELLABILITY_BOLT_POISON = 224; -SPELLABILITY_BOLT_SHARDS = 225; -SPELLABILITY_BOLT_SLOW = 226; -SPELLABILITY_BOLT_STUN = 227; -SPELLABILITY_BOLT_WEB = 228; -SPELLABILITY_CONE_ACID = 229; -SPELLABILITY_CONE_COLD = 230; -SPELLABILITY_CONE_DISEASE = 231; -SPELLABILITY_CONE_FIRE = 232; -SPELLABILITY_CONE_LIGHTNING = 233; -SPELLABILITY_CONE_POISON = 234; -SPELLABILITY_CONE_SONIC = 235; -SPELLABILITY_DRAGON_BREATH_ACID = 236; -SPELLABILITY_DRAGON_BREATH_COLD = 237; -SPELLABILITY_DRAGON_BREATH_FEAR = 238; -SPELLABILITY_DRAGON_BREATH_FIRE = 239; -SPELLABILITY_DRAGON_BREATH_GAS = 240; -SPELLABILITY_DRAGON_BREATH_LIGHTNING = 241; -SPELLABILITY_DRAGON_BREATH_PARALYZE = 242; -SPELLABILITY_DRAGON_BREATH_SLEEP = 243; -SPELLABILITY_DRAGON_BREATH_SLOW = 244; -SPELLABILITY_DRAGON_BREATH_WEAKEN = 245; -SPELLABILITY_DRAGON_WING_BUFFET = 246; -SPELLABILITY_FEROCITY_1 = 247; -SPELLABILITY_FEROCITY_2 = 248; -SPELLABILITY_FEROCITY_3 = 249; -SPELLABILITY_GAZE_CHARM = 250; -SPELLABILITY_GAZE_CONFUSION = 251; -SPELLABILITY_GAZE_DAZE = 252; -SPELLABILITY_GAZE_DEATH = 253; -SPELLABILITY_GAZE_DESTROY_CHAOS = 254; -SPELLABILITY_GAZE_DESTROY_EVIL = 255; -SPELLABILITY_GAZE_DESTROY_GOOD = 256; -SPELLABILITY_GAZE_DESTROY_LAW = 257; -SPELLABILITY_GAZE_DOMINATE = 258; -SPELLABILITY_GAZE_DOOM = 259; -SPELLABILITY_GAZE_FEAR = 260; -SPELLABILITY_GAZE_PARALYSIS = 261; -SPELLABILITY_GAZE_STUNNED = 262; -SPELLABILITY_GOLEM_BREATH_GAS = 263; -SPELLABILITY_HELL_HOUND_FIREBREATH = 264; -SPELLABILITY_HOWL_CONFUSE = 265; -SPELLABILITY_HOWL_DAZE = 266; -SPELLABILITY_HOWL_DEATH = 267; -SPELLABILITY_HOWL_DOOM = 268; -SPELLABILITY_HOWL_FEAR = 269; -SPELLABILITY_HOWL_PARALYSIS = 270; -SPELLABILITY_HOWL_SONIC = 271; -SPELLABILITY_HOWL_STUN = 272; -SPELLABILITY_INTENSITY_1 = 273; -SPELLABILITY_INTENSITY_2 = 274; -SPELLABILITY_INTENSITY_3 = 275; -SPELLABILITY_KRENSHAR_SCARE = 276; -SPELLABILITY_LESSER_BODY_ADJUSTMENT = 277; -SPELLABILITY_MEPHIT_SALT_BREATH = 278; -SPELLABILITY_MEPHIT_STEAM_BREATH = 279; -SPELLABILITY_MUMMY_BOLSTER_UNDEAD = 280; -SPELLABILITY_PULSE_DROWN = 281; -SPELLABILITY_PULSE_SPORES = 282; -SPELLABILITY_PULSE_WHIRLWIND = 283; -SPELLABILITY_PULSE_FIRE = 284; -SPELLABILITY_PULSE_LIGHTNING = 285; -SPELLABILITY_PULSE_COLD = 286; -SPELLABILITY_PULSE_NEGATIVE = 287; -SPELLABILITY_PULSE_HOLY = 288; -SPELLABILITY_PULSE_DEATH = 289; -SPELLABILITY_PULSE_LEVEL_DRAIN = 290; -SPELLABILITY_PULSE_ABILITY_DRAIN_INTELLIGENCE = 291; -SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA = 292; -SPELLABILITY_PULSE_ABILITY_DRAIN_CONSTITUTION = 293; -SPELLABILITY_PULSE_ABILITY_DRAIN_DEXTERITY = 294; -SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH = 295; -SPELLABILITY_PULSE_ABILITY_DRAIN_WISDOM = 296; -SPELLABILITY_PULSE_POISON = 297; -SPELLABILITY_PULSE_DISEASE = 298; -SPELLABILITY_RAGE_3 = 299; -SPELLABILITY_RAGE_4 = 300; -SPELLABILITY_RAGE_5 = 301; -SPELLABILITY_SMOKE_CLAW = 302; -SPELLABILITY_SUMMON_SLAAD = 303; -SPELLABILITY_SUMMON_TANARRI = 304; -SPELLABILITY_TRUMPET_BLAST = 305; -SPELLABILITY_TYRANT_FOG_MIST = 306; -SPELLABILITY_BARBARIAN_RAGE = 307; -SPELLABILITY_TURN_UNDEAD = 308; -SPELLABILITY_WHOLENESS_OF_BODY = 309; -SPELLABILITY_QUIVERING_PALM = 310; -SPELLABILITY_EMPTY_BODY = 311; -SPELLABILITY_DETECT_EVIL = 312; -SPELLABILITY_LAY_ON_HANDS = 313; -SPELLABILITY_AURA_OF_COURAGE = 314; -SPELLABILITY_SMITE_EVIL = 315; -SPELLABILITY_REMOVE_DISEASE = 316; -SPELLABILITY_SUMMON_ANIMAL_COMPANION = 317; -SPELLABILITY_SUMMON_FAMILIAR = 318; -SPELLABILITY_ELEMENTAL_SHAPE = 319; -SPELLABILITY_WILD_SHAPE = 320; --- int SPELL_PROTECTION_FROM_ALIGNMENT = 321; --- int SPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT = 322; --- int SPELL_AURA_VERSUS_ALIGNMENT = 323; -SPELL_SHADES_SUMMON_SHADOW = 324; --- int SPELL_PROTECTION_FROM_ELEMENTS_COLD = 325; --- int SPELL_PROTECTION_FROM_ELEMENTS_FIRE = 326; --- int SPELL_PROTECTION_FROM_ELEMENTS_ACID = 327; --- int SPELL_PROTECTION_FROM_ELEMENTS_SONIC = 328; --- int SPELL_PROTECTION_FROM_ELEMENTS_ELECTRICITY = 329; --- int SPELL_ENDURE_ELEMENTS_COLD = 330; --- int SPELL_ENDURE_ELEMENTS_FIRE = 331; --- int SPELL_ENDURE_ELEMENTS_ACID = 332; --- int SPELL_ENDURE_ELEMENTS_SONIC = 333; --- int SPELL_ENDURE_ELEMENTS_ELECTRICITY = 334; --- int SPELL_RESIST_ELEMENTS_COLD = 335; --- int SPELL_RESIST_ELEMENTS_FIRE = 336; --- int SPELL_RESIST_ELEMENTS_ACID = 337; --- int SPELL_RESIST_ELEMENTS_SONIC = 338; --- int SPELL_RESIST_ELEMENTS_ELECTRICITY = 339; -SPELL_SHADES_CONE_OF_COLD = 340; -SPELL_SHADES_FIREBALL = 341; -SPELL_SHADES_STONESKIN = 342; -SPELL_SHADES_WALL_OF_FIRE = 343; -SPELL_SHADOW_CONJURATION_SUMMON_SHADOW = 344; -SPELL_SHADOW_CONJURATION_DARKNESS = 345; -SPELL_SHADOW_CONJURATION_INIVSIBILITY = 346; -SPELL_SHADOW_CONJURATION_MAGE_ARMOR = 347; -SPELL_SHADOW_CONJURATION_MAGIC_MISSILE = 348; -SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW = 349; -SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW = 350; -SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE = 351; -SPELL_GREATER_SHADOW_CONJURATION_WEB = 352; -SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE = 353; -SPELL_EAGLE_SPLEDOR = 354; -SPELL_OWLS_WISDOM = 355; -SPELL_FOXS_CUNNING = 356; -SPELL_GREATER_EAGLE_SPLENDOR = 357; -SPELL_GREATER_OWLS_WISDOM = 358; -SPELL_GREATER_FOXS_CUNNING = 359; -SPELL_GREATER_BULLS_STRENGTH = 360; -SPELL_GREATER_CATS_GRACE = 361; -SPELL_GREATER_ENDURANCE = 362; -SPELL_AWAKEN = 363; -SPELL_CREEPING_DOOM = 364; -SPELL_DARKVISION = 365; -SPELL_DESTRUCTION = 366; -SPELL_HORRID_WILTING = 367; -SPELL_ICE_STORM = 368; -SPELL_ENERGY_BUFFER = 369; -SPELL_NEGATIVE_ENERGY_BURST = 370; -SPELL_NEGATIVE_ENERGY_RAY = 371; -SPELL_AURA_OF_VITALITY = 372; -SPELL_WAR_CRY = 373; -SPELL_REGENERATE = 374; -SPELL_EVARDS_BLACK_TENTACLES = 375; -SPELL_LEGEND_LORE = 376; -SPELL_FIND_TRAPS = 377; -SPELLABILITY_SUMMON_MEPHIT = 378; -SPELLABILITY_SUMMON_CELESTIAL = 379; -SPELLABILITY_BATTLE_MASTERY = 380; -SPELLABILITY_DIVINE_STRENGTH = 381; -SPELLABILITY_DIVINE_PROTECTION = 382; -SPELLABILITY_NEGATIVE_PLANE_AVATAR = 383; -SPELLABILITY_DIVINE_TRICKERY = 384; -SPELLABILITY_ROGUES_CUNNING = 385; -SPELLABILITY_ACTIVATE_ITEM = 386; -SPELLABILITY_DRAGON_FEAR = 412; -SPELL_DIVINE_FAVOR = 414; -SPELL_TRUE_STRIKE = 415; -SPELL_FLARE = 416; -SPELL_SHIELD = 417; -SPELL_ENTROPIC_SHIELD = 418; -SPELL_CONTINUAL_FLAME = 419; -SPELL_ONE_WITH_THE_LAND = 420; -SPELL_CAMOFLAGE = 421; -SPELL_BLOOD_FRENZY = 422; -SPELL_BOMBARDMENT = 423; -SPELL_ACID_SPLASH = 424; -SPELL_QUILLFIRE = 425; -SPELL_EARTHQUAKE = 426; -SPELL_SUNBURST = 427; -SPELL_ACTIVATE_ITEM_SELF2 = 428; -SPELL_AURAOFGLORY = 429; -SPELL_BANISHMENT = 430; -SPELL_INFLICT_MINOR_WOUNDS = 431; -SPELL_INFLICT_LIGHT_WOUNDS = 432; -SPELL_INFLICT_MODERATE_WOUNDS = 433; -SPELL_INFLICT_SERIOUS_WOUNDS = 434; -SPELL_INFLICT_CRITICAL_WOUNDS = 435; -SPELL_BALAGARNSIRONHORN = 436; -SPELL_DROWN = 437; -SPELL_OWLS_INSIGHT = 438; -SPELL_ELECTRIC_JOLT = 439; -SPELL_FIREBRAND = 440; -SPELL_WOUNDING_WHISPERS = 441; -SPELL_AMPLIFY = 442; -SPELL_ETHEREALNESS = 443; -SPELL_UNDEATHS_ETERNAL_FOE = 444; -SPELL_DIRGE = 445; -SPELL_INFERNO = 446; -SPELL_ISAACS_LESSER_MISSILE_STORM = 447; -SPELL_ISAACS_GREATER_MISSILE_STORM = 448; -SPELL_BANE = 449; -SPELL_SHIELD_OF_FAITH = 450; -SPELL_PLANAR_ALLY = 451; -SPELL_MAGIC_FANG = 452; -SPELL_GREATER_MAGIC_FANG = 453; -SPELL_SPIKE_GROWTH = 454; -SPELL_MASS_CAMOFLAGE = 455; -SPELL_EXPEDITIOUS_RETREAT = 456; -SPELL_TASHAS_HIDEOUS_LAUGHTER = 457; -SPELL_DISPLACEMENT = 458; -SPELL_BIGBYS_INTERPOSING_HAND = 459; -SPELL_BIGBYS_FORCEFUL_HAND = 460; -SPELL_BIGBYS_GRASPING_HAND = 461; -SPELL_BIGBYS_CLENCHED_FIST = 462; -SPELL_BIGBYS_CRUSHING_HAND = 463; -SPELL_GRENADE_FIRE = 464; -SPELL_GRENADE_TANGLE = 465; -SPELL_GRENADE_HOLY = 466; -SPELL_GRENADE_CHOKING = 467; -SPELL_GRENADE_THUNDERSTONE = 468; -SPELL_GRENADE_ACID = 469; -SPELL_GRENADE_CHICKEN = 470; -SPELL_GRENADE_CALTROPS = 471; -SPELL_ACTIVATE_ITEM_PORTAL = 472; -SPELL_DIVINE_MIGHT = 473; -SPELL_DIVINE_SHIELD = 474; -SPELL_SHADOW_DAZE = 475; -SPELL_SUMMON_SHADOW = 476; -SPELL_SHADOW_EVADE = 477; -SPELL_TYMORAS_SMILE = 478; -SPELL_CRAFT_HARPER_ITEM = 479; -SPELL_FLESH_TO_STONE = 485; -SPELL_STONE_TO_FLESH = 486; -SPELL_TRAP_ARROW = 487; -SPELL_TRAP_BOLT = 488; -SPELL_TRAP_DART = 493; -SPELL_TRAP_SHURIKEN = 494; -SPELLABILITY_BREATH_PETRIFY = 495; -SPELLABILITY_TOUCH_PETRIFY = 496; -SPELLABILITY_GAZE_PETRIFY = 497; -SPELLABILITY_MANTICORE_SPIKES = 498; -SPELL_ROD_OF_WONDER = 499; -SPELL_DECK_OF_MANY_THINGS = 500; -SPELL_ELEMENTAL_SUMMONING_ITEM = 502; -SPELL_DECK_AVATAR = 503; -SPELL_DECK_GEMSPRAY = 504; -SPELL_DECK_BUTTERFLYSPRAY = 505; -SPELL_HEALINGKIT = 506; -SPELL_POWERSTONE = 507; -SPELL_SPELLSTAFF = 508; -SPELL_CHARGER = 500; -SPELL_DECHARGER = 510; -SPELL_KOBOLD_JUMP = 511; -SPELL_CRUMBLE = 512; -SPELL_INFESTATION_OF_MAGGOTS = 513; -SPELL_HEALING_STING = 514; -SPELL_GREAT_THUNDERCLAP = 515; -SPELL_BALL_LIGHTNING = 516; -SPELL_BATTLETIDE = 517; -SPELL_COMBUST = 518; -SPELL_DEATH_ARMOR = 519; -SPELL_GEDLEES_ELECTRIC_LOOP = 520; -SPELL_HORIZIKAULS_BOOM = 521; -SPELL_IRONGUTS = 522; -SPELL_MESTILS_ACID_BREATH = 523; -SPELL_MESTILS_ACID_SHEATH = 524; -SPELL_MONSTROUS_REGENERATION = 525; -SPELL_SCINTILLATING_SPHERE = 526; -SPELL_STONE_BONES = 527; -SPELL_UNDEATH_TO_DEATH = 528; -SPELL_VINE_MINE = 529; -SPELL_VINE_MINE_ENTANGLE = 530; -SPELL_VINE_MINE_HAMPER_MOVEMENT = 531; -SPELL_VINE_MINE_CAMOUFLAGE = 532; -SPELL_BLACK_BLADE_OF_DISASTER = 533; -SPELL_SHELGARNS_PERSISTENT_BLADE = 534; -SPELL_BLADE_THIRST = 535; -SPELL_DEAFENING_CLANG = 536; -SPELL_CLOUD_OF_BEWILDERMENT = 569; -SPELL_KEEN_EDGE = 539; -SPELL_BLACKSTAFF = 541; -SPELL_FLAME_WEAPON = 542; -SPELL_ICE_DAGGER = 543; -SPELL_MAGIC_WEAPON = 544; -SPELL_GREATER_MAGIC_WEAPON = 545; -SPELL_STONEHOLD = 547; -SPELL_DARKFIRE = 548; -SPELL_GLYPH_OF_WARDING = 549; -SPELLABILITY_MINDBLAST = 551; -SPELLABILITY_CHARMMONSTER = 552; -SPELL_IOUN_STONE_DUSTY_ROSE = 554; -SPELL_IOUN_STONE_PALE_BLUE = 555; -SPELL_IOUN_STONE_SCARLET_BLUE = 556; -SPELL_IOUN_STONE_BLUE = 557; -SPELL_IOUN_STONE_DEEP_RED = 558; -SPELL_IOUN_STONE_PINK = 559; -SPELL_IOUN_STONE_PINK_GREEN = 560; -SPELLABILITY_WHIRLWIND = 561; -SPELLABILITY_COMMAND_THE_HORDE = 571; -SPELLABILITY_AA_IMBUE_ARROW = 600; -SPELLABILITY_AA_SEEKER_ARROW_1 = 601; -SPELLABILITY_AA_SEEKER_ARROW_2 = 602; -SPELLABILITY_AA_HAIL_OF_ARROWS = 603; -SPELLABILITY_AA_ARROW_OF_DEATH = 604; -SPELLABILITY_AS_GHOSTLY_VISAGE = 605; -SPELLABILITY_AS_DARKNESS = 606; -SPELLABILITY_AS_INVISIBILITY = 607; -SPELLABILITY_AS_IMPROVED_INVISIBLITY = 608; -SPELLABILITY_BG_CREATEDEAD = 609; -SPELLABILITY_BG_FIENDISH_SERVANT = 610; -SPELLABILITY_BG_INFLICT_SERIOUS_WOUNDS = 611; -SPELLABILITY_BG_INFLICT_CRITICAL_WOUNDS = 612; -SPELLABILITY_BG_CONTAGION = 613; -SPELLABILITY_BG_BULLS_STRENGTH = 614; -SPELL_FLYING_DEBRIS = 620; -SPELLABILITY_DC_DIVINE_WRATH = 622; -SPELLABILITY_PM_ANIMATE_DEAD = 623; -SPELLABILITY_PM_SUMMON_UNDEAD = 624; -SPELLABILITY_PM_UNDEAD_GRAFT_1 = 625; -SPELLABILITY_PM_UNDEAD_GRAFT_2 = 626; -SPELLABILITY_PM_SUMMON_GREATER_UNDEAD = 627; -SPELLABILITY_PM_DEATHLESS_MASTER_TOUCH = 628; -SPELL_EPIC_HELLBALL = 636; -SPELL_EPIC_MUMMY_DUST = 637; -SPELL_EPIC_DRAGON_KNIGHT = 638; -SPELL_EPIC_MAGE_ARMOR = 639; -SPELL_EPIC_RUIN = 640; -SPELLABILITY_DW_DEFENSIVE_STANCE = 641; -SPELLABILITY_EPIC_MIGHTY_RAGE = 642; -SPELLABILITY_EPIC_CURSE_SONG = 644; -SPELLABILITY_EPIC_IMPROVED_WHIRLWIND = 645; -SPELLABILITY_EPIC_SHAPE_DRAGONKIN = 646; -SPELLABILITY_EPIC_SHAPE_DRAGON = 647; -SPELL_CRAFT_DYE_CLOTHCOLOR_1 = 648; -SPELL_CRAFT_DYE_CLOTHCOLOR_2 = 649; -SPELL_CRAFT_DYE_LEATHERCOLOR_1 = 650; -SPELL_CRAFT_DYE_LEATHERCOLOR_2 = 651; -SPELL_CRAFT_DYE_METALCOLOR_1 = 652; -SPELL_CRAFT_DYE_METALCOLOR_2 = 653; -SPELL_CRAFT_ADD_ITEM_PROPERTY = 654; -SPELL_CRAFT_POISON_WEAPON_OR_AMMO = 655; -SPELL_CRAFT_CRAFT_WEAPON_SKILL = 656; -SPELL_CRAFT_CRAFT_ARMOR_SKILL = 657; -SPELLABILITY_DRAGON_BREATH_NEGATIVE = 698; -SPELLABILITY_SEAHAG_EVILEYE = 803; -SPELLABILITY_AURA_HORRIFICAPPEARANCE = 804; -SPELLABILITY_TROGLODYTE_STENCH = 805; -SPELL_HORSE_MENU = 812; -SPELL_HORSE_MOUNT = 813; -SPELL_HORSE_DISMOUNT = 814; -SPELL_HORSE_PARTY_MOUNT = 815; -SPELL_HORSE_PARTY_DISMOUNT = 816; -SPELL_HORSE_ASSIGN_MOUNT = 817; -SPELL_PALADIN_SUMMON_MOUNT = 818; --- these constants must match those in poison.2da -POISON_NIGHTSHADE = 0; -POISON_SMALL_CENTIPEDE_POISON = 1; -POISON_BLADE_BANE = 2; -POISON_GREENBLOOD_OIL = 3; -POISON_BLOODROOT = 4; -POISON_PURPLE_WORM_POISON = 5; -POISON_LARGE_SCORPION_VENOM = 6; -POISON_WYVERN_POISON = 7; -POISON_BLUE_WHINNIS = 8; -POISON_GIANT_WASP_POISON = 9; -POISON_SHADOW_ESSENCE = 10; -POISON_BLACK_ADDER_VENOM = 11; -POISON_DEATHBLADE = 12; -POISON_MALYSS_ROOT_PASTE = 13; -POISON_NITHARIT = 14; -POISON_DRAGON_BILE = 15; -POISON_SASSONE_LEAF_RESIDUE = 16; -POISON_TERINAV_ROOT = 17; -POISON_CARRION_CRAWLER_BRAIN_JUICE = 18; -POISON_BLACK_LOTUS_EXTRACT = 19; -POISON_OIL_OF_TAGGIT = 20; -POISON_ID_MOSS = 21; -POISON_STRIPED_TOADSTOOL = 22; -POISON_ARSENIC = 23; -POISON_LICH_DUST = 24; -POISON_DARK_REAVER_POWDER = 25; -POISON_UNGOL_DUST = 26; -POISON_BURNT_OTHUR_FUMES = 27; -POISON_CHAOS_MIST = 28; -POISON_BEBILITH_VENOM = 29; -POISON_QUASIT_VENOM = 30; -POISON_PIT_FIEND_ICHOR = 31; -POISON_ETTERCAP_VENOM = 32; -POISON_ARANEA_VENOM = 33; -POISON_TINY_SPIDER_VENOM = 34; -POISON_SMALL_SPIDER_VENOM = 35; -POISON_MEDIUM_SPIDER_VENOM = 36; -POISON_LARGE_SPIDER_VENOM = 37; -POISON_HUGE_SPIDER_VENOM = 38; -POISON_GARGANTUAN_SPIDER_VENOM = 39; -POISON_COLOSSAL_SPIDER_VENOM = 40; -POISON_PHASE_SPIDER_VENOM = 41; -POISON_WRAITH_SPIDER_VENOM = 42; -POISON_IRON_GOLEM = 43; --- these constants match those in disease.2da -DISEASE_BLINDING_SICKNESS = 0; -DISEASE_CACKLE_FEVER = 1; -DISEASE_DEVIL_CHILLS = 2; -DISEASE_DEMON_FEVER = 3; -DISEASE_FILTH_FEVER = 4; -DISEASE_MINDFIRE = 5; -DISEASE_MUMMY_ROT = 6; -DISEASE_RED_ACHE = 7; -DISEASE_SHAKES = 8; -DISEASE_SLIMY_DOOM = 9; -DISEASE_RED_SLAAD_EGGS = 10; -DISEASE_GHOUL_ROT = 11; -DISEASE_ZOMBIE_CREEP = 12; -DISEASE_DREAD_BLISTERS = 13; -DISEASE_BURROW_MAGGOTS = 14; -DISEASE_SOLDIER_SHAKES = 15; -DISEASE_VERMIN_MADNESS = 16; --- the thing after CREATURE_TYPE_ should refer to the --- actual "subtype" in the lists given above. -CREATURE_TYPE_RACIAL_TYPE = 0; -CREATURE_TYPE_PLAYER_CHAR = 1; -CREATURE_TYPE_CLASS = 2; -CREATURE_TYPE_REPUTATION = 3; -CREATURE_TYPE_IS_ALIVE = 4; -CREATURE_TYPE_HAS_SPELL_EFFECT = 5; -CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT = 6; -CREATURE_TYPE_PERCEPTION = 7; --- int CREATURE_TYPE_ALIGNMENT = 2; -REPUTATION_TYPE_FRIEND = 0; -REPUTATION_TYPE_ENEMY = 1; -REPUTATION_TYPE_NEUTRAL = 2; -PERCEPTION_SEEN_AND_HEARD = 0; -PERCEPTION_NOT_SEEN_AND_NOT_HEARD = 1; -PERCEPTION_HEARD_AND_NOT_SEEN = 2; -PERCEPTION_SEEN_AND_NOT_HEARD = 3; -PERCEPTION_NOT_HEARD = 4; -PERCEPTION_HEARD = 5; -PERCEPTION_NOT_SEEN = 6; -PERCEPTION_SEEN = 7; -PLAYER_CHAR_NOT_PC = FALSE; -PLAYER_CHAR_IS_PC = TRUE; -CLASS_TYPE_BARBARIAN = 0; -CLASS_TYPE_BARD = 1; -CLASS_TYPE_CLERIC = 2; -CLASS_TYPE_DRUID = 3; -CLASS_TYPE_FIGHTER = 4; -CLASS_TYPE_MONK = 5; -CLASS_TYPE_PALADIN = 6; -CLASS_TYPE_RANGER = 7; -CLASS_TYPE_ROGUE = 8; -CLASS_TYPE_SORCERER = 9; -CLASS_TYPE_WIZARD = 10; -CLASS_TYPE_ABERRATION = 11; -CLASS_TYPE_ANIMAL = 12; -CLASS_TYPE_CONSTRUCT = 13; -CLASS_TYPE_HUMANOID = 14; -CLASS_TYPE_MONSTROUS = 15; -CLASS_TYPE_ELEMENTAL = 16; -CLASS_TYPE_FEY = 17; -CLASS_TYPE_DRAGON = 18; -CLASS_TYPE_UNDEAD = 19; -CLASS_TYPE_COMMONER = 20; -CLASS_TYPE_BEAST = 21; -CLASS_TYPE_GIANT = 22; -CLASS_TYPE_MAGICAL_BEAST = 23; -CLASS_TYPE_OUTSIDER = 24; -CLASS_TYPE_SHAPECHANGER = 25; -CLASS_TYPE_VERMIN = 26; -CLASS_TYPE_SHADOWDANCER = 27; -CLASS_TYPE_HARPER = 28; -CLASS_TYPE_ARCANE_ARCHER = 29; -CLASS_TYPE_ASSASSIN = 30; -CLASS_TYPE_BLACKGUARD = 31; -CLASS_TYPE_DIVINECHAMPION = 32; -CLASS_TYPE_DIVINE_CHAMPION = 32; -CLASS_TYPE_WEAPON_MASTER = 33; -CLASS_TYPE_PALEMASTER = 34; -CLASS_TYPE_PALE_MASTER = 34; -CLASS_TYPE_SHIFTER = 35; -CLASS_TYPE_DWARVENDEFENDER = 36; -CLASS_TYPE_DWARVEN_DEFENDER = 36; -CLASS_TYPE_DRAGONDISCIPLE = 37; -CLASS_TYPE_DRAGON_DISCIPLE = 37; -CLASS_TYPE_OOZE = 38; -CLASS_TYPE_EYE_OF_GRUUMSH = 39; -CLASS_TYPE_SHOU_DISCIPLE = 40; -CLASS_TYPE_PURPLE_DRAGON_KNIGHT = 41; -CLASS_TYPE_INVALID = 255; --- These are for the LevelUpHenchman command. -PACKAGE_BARBARIAN = 0; -PACKAGE_BARD = 1; -PACKAGE_CLERIC = 2; -PACKAGE_DRUID = 3; -PACKAGE_FIGHTER = 4; -PACKAGE_MONK = 5; -PACKAGE_PALADIN = 6; -PACKAGE_RANGER = 7; -PACKAGE_ROGUE = 8; -PACKAGE_SORCERER = 9; -PACKAGE_WIZARDGENERALIST = 10; -PACKAGE_DRUID_INTERLOPER = 11; -PACKAGE_DRUID_GRAY = 12; -PACKAGE_DRUID_DEATH = 13; -PACKAGE_DRUID_HAWKMASTER = 14; -PACKAGE_BARBARIAN_BRUTE = 15; -PACKAGE_BARBARIAN_SLAYER = 16; -PACKAGE_BARBARIAN_SAVAGE = 17; -PACKAGE_BARBARIAN_ORCBLOOD = 18; -PACKAGE_CLERIC_SHAMAN = 19; -PACKAGE_CLERIC_DEADWALKER = 20; -PACKAGE_CLERIC_ELEMENTALIST = 21; -PACKAGE_CLERIC_BATTLE_PRIEST = 22; -PACKAGE_FIGHTER_FINESSE = 23; -PACKAGE_FIGHTER_PIRATE = 24; -PACKAGE_FIGHTER_GLADIATOR = 25; -PACKAGE_FIGHTER_COMMANDER = 26; -PACKAGE_WIZARD_ABJURATION = 27; -PACKAGE_WIZARD_CONJURATION = 28; -PACKAGE_WIZARD_DIVINATION = 29; -PACKAGE_WIZARD_ENCHANTMENT = 30; -PACKAGE_WIZARD_EVOCATION = 31; -PACKAGE_WIZARD_ILLUSION = 32; -PACKAGE_WIZARD_NECROMANCY = 33; -PACKAGE_WIZARD_TRANSMUTATION = 34; -PACKAGE_SORCERER_ABJURATION = 35; -PACKAGE_SORCERER_CONJURATION = 36; -PACKAGE_SORCERER_DIVINATION = 37; -PACKAGE_SORCERER_ENCHANTMENT = 38; -PACKAGE_SORCERER_EVOCATION = 39; -PACKAGE_SORCERER_ILLUSION = 40; -PACKAGE_SORCERER_NECROMANCY = 41; -PACKAGE_SORCERER_TRANSMUTATION = 42; -PACKAGE_BARD_BLADE = 43; -PACKAGE_BARD_GALLANT = 44; -PACKAGE_BARD_JESTER = 45; -PACKAGE_BARD_LOREMASTER = 46; -PACKAGE_MONK_SPIRIT = 47; -PACKAGE_MONK_GIFTED = 48; -PACKAGE_MONK_DEVOUT = 49; -PACKAGE_MONK_PEASANT = 50; -PACKAGE_PALADIN_ERRANT = 51; -PACKAGE_PALADIN_UNDEAD = 52; -PACKAGE_PALADIN_INQUISITOR = 53; -PACKAGE_PALADIN_CHAMPION = 54; -PACKAGE_RANGER_MARKSMAN = 55; -PACKAGE_RANGER_WARDEN = 56; -PACKAGE_RANGER_STALKER = 57; -PACKAGE_RANGER_GIANTKILLER = 58; -PACKAGE_ROGUE_GYPSY = 59; -PACKAGE_ROGUE_BANDIT = 60; -PACKAGE_ROGUE_SCOUT = 61; -PACKAGE_ROGUE_SWASHBUCKLER = 62; -PACKAGE_SHADOWDANCER = 63; -PACKAGE_HARPER = 64; -PACKAGE_ARCANE_ARCHER = 65; -PACKAGE_ASSASSIN = 66; -PACKAGE_BLACKGUARD = 67; -PACKAGE_NPC_SORCERER = 70; -PACKAGE_NPC_ROGUE = 71; -PACKAGE_NPC_BARD = 72; -PACKAGE_ABERRATION = 73; -PACKAGE_ANIMAL = 74; -PACKAGE_CONSTRUCT = 75; -PACKAGE_HUMANOID = 76; -PACKAGE_MONSTROUS = 77; -PACKAGE_ELEMENTAL = 78; -PACKAGE_FEY = 79; -PACKAGE_DRAGON = 80; -PACKAGE_UNDEAD = 81; -PACKAGE_COMMONER = 82; -PACKAGE_BEAST = 83; -PACKAGE_GIANT = 84; -PACKAGE_MAGICBEAST = 85; -PACKAGE_OUTSIDER = 86; -PACKAGE_SHAPECHANGER = 87; -PACKAGE_VERMIN = 88; -PACKAGE_DWARVEN_DEFENDER = 89; -PACKAGE_BARBARIAN_BLACKGUARD = 90; -PACKAGE_BARD_HARPER = 91; -PACKAGE_CLERIC_DIVINE = 92; -PACKAGE_DRUID_SHIFTER = 93; -PACKAGE_FIGHTER_WEAPONMASTER = 94; -PACKAGE_MONK_ASSASSIN = 95; -PACKAGE_PALADIN_DIVINE = 96; -PACKAGE_RANGER_ARCANEARCHER = 97; -PACKAGE_ROGUE_SHADOWDANCER = 98; -PACKAGE_SORCERER_DRAGONDISCIPLE = 99; -PACKAGE_WIZARD_PALEMASTER = 100; -PACKAGE_NPC_WIZASSASSIN = 101; -PACKAGE_NPC_FT_WEAPONMASTER = 102; -PACKAGE_NPC_RG_SHADOWDANCER = 103; -PACKAGE_NPC_CLERIC_LINU = 104; -PACKAGE_NPC_BARBARIAN_DAELAN = 105; -PACKAGE_NPC_BARD_FIGHTER = 106; -PACKAGE_NPC_PALADIN_FALLING = 107; -PACKAGE_SHIFTER = 108; -PACKAGE_DIVINE_CHAMPION = 109; -PACKAGE_PALE_MASTER = 110; -PACKAGE_DRAGON_DISCIPLE = 111; -PACKAGE_WEAPONMASTER = 112; -PACKAGE_NPC_FT_WEAPONMASTER_VALEN_2 = 113; -PACKAGE_NPC_BARD_FIGHTER_SHARWYN2 = 114; -PACKAGE_NPC_WIZASSASSIN_NATHYRRA = 115; -PACKAGE_NPC_RG_TOMI_2 = 116; -PACKAGE_NPC_BARD_DEEKIN_2 = 117; -PACKAGE_BARBARIAN_BLACKGUARD_2NDCLASS = 118; -PACKAGE_BARD_HARPER_2NDCLASS = 119; -PACKAGE_CLERIC_DIVINE_2NDCLASS = 120; -PACKAGE_DRUID_SHIFTER_2NDCLASS = 121; -PACKAGE_FIGHTER_WEAPONMASTER_2NDCLASS = 122; -PACKAGE_MONK_ASSASSIN_2NDCLASS = 123; -PACKAGE_PALADIN_DIVINE_2NDCLASS = 124; -PACKAGE_RANGER_ARCANEARCHER_2NDCLASS = 125; -PACKAGE_ROGUE_SHADOWDANCER_2NDCLASS = 126; -PACKAGE_SORCERER_DRAGONDISCIPLE_2NDCLASS = 127; -PACKAGE_WIZARD_PALEMASTER_2NDCLASS = 128; -PACKAGE_NPC_ARIBETH_PALADIN = 129; -PACKAGE_NPC_ARIBETH_BLACKGUARD = 130; -PACKAGE_INVALID = 255; --- These are for GetFirstInPersistentObject() and GetNextInPersistentObject() -PERSISTENT_ZONE_ACTIVE = 0; -PERSISTENT_ZONE_FOLLOW = 1; -STANDARD_FACTION_HOSTILE = 0; -STANDARD_FACTION_COMMONER = 1; -STANDARD_FACTION_MERCHANT = 2; -STANDARD_FACTION_DEFENDER = 3; --- Skill defines -SKILL_ANIMAL_EMPATHY = 0; -SKILL_CONCENTRATION = 1; -SKILL_DISABLE_TRAP = 2; -SKILL_DISCIPLINE = 3; -SKILL_HEAL = 4; -SKILL_HIDE = 5; -SKILL_LISTEN = 6; -SKILL_LORE = 7; -SKILL_MOVE_SILENTLY = 8; -SKILL_OPEN_LOCK = 9; -SKILL_PARRY = 10; -SKILL_PERFORM = 11; -SKILL_PERSUADE = 12; -SKILL_PICK_POCKET = 13; -SKILL_SEARCH = 14; -SKILL_SET_TRAP = 15; -SKILL_SPELLCRAFT = 16; -SKILL_SPOT = 17; -SKILL_TAUNT = 18; -SKILL_USE_MAGIC_DEVICE = 19; -SKILL_APPRAISE = 20; -SKILL_TUMBLE = 21; -SKILL_CRAFT_TRAP = 22; -SKILL_BLUFF = 23; -SKILL_INTIMIDATE = 24; -SKILL_CRAFT_ARMOR = 25; -SKILL_CRAFT_WEAPON = 26; -SKILL_RIDE = 27; -SKILL_ALL_SKILLS = 255; -SUBSKILL_FLAGTRAP = 100; -SUBSKILL_RECOVERTRAP = 101; -SUBSKILL_EXAMINETRAP = 102; -FEAT_ALERTNESS = 0; -FEAT_AMBIDEXTERITY = 1; -FEAT_ARMOR_PROFICIENCY_HEAVY = 2; -FEAT_ARMOR_PROFICIENCY_LIGHT = 3; -FEAT_ARMOR_PROFICIENCY_MEDIUM = 4; -FEAT_CALLED_SHOT = 5; -FEAT_CLEAVE = 6; -FEAT_COMBAT_CASTING = 7; -FEAT_DEFLECT_ARROWS = 8; -FEAT_DISARM = 9; -FEAT_DODGE = 10; -FEAT_EMPOWER_SPELL = 11; -FEAT_EXTEND_SPELL = 12; -FEAT_EXTRA_TURNING = 13; -FEAT_GREAT_FORTITUDE = 14; -FEAT_IMPROVED_CRITICAL_CLUB = 15; -FEAT_IMPROVED_DISARM = 16; -FEAT_IMPROVED_KNOCKDOWN = 17; -FEAT_IMPROVED_PARRY = 18; -FEAT_IMPROVED_POWER_ATTACK = 19; -FEAT_IMPROVED_TWO_WEAPON_FIGHTING = 20; -FEAT_IMPROVED_UNARMED_STRIKE = 21; -FEAT_IRON_WILL = 22; -FEAT_KNOCKDOWN = 23; -FEAT_LIGHTNING_REFLEXES = 24; -FEAT_MAXIMIZE_SPELL = 25; -FEAT_MOBILITY = 26; -FEAT_POINT_BLANK_SHOT = 27; -FEAT_POWER_ATTACK = 28; -FEAT_QUICKEN_SPELL = 29; -FEAT_RAPID_SHOT = 30; -FEAT_SAP = 31; -FEAT_SHIELD_PROFICIENCY = 32; -FEAT_SILENCE_SPELL = 33; -FEAT_SKILL_FOCUS_ANIMAL_EMPATHY = 34; -FEAT_SPELL_FOCUS_ABJURATION = 35; -FEAT_SPELL_PENETRATION = 36; -FEAT_STILL_SPELL = 37; -FEAT_STUNNING_FIST = 39; -FEAT_TOUGHNESS = 40; -FEAT_TWO_WEAPON_FIGHTING = 41; -FEAT_WEAPON_FINESSE = 42; -FEAT_WEAPON_FOCUS_CLUB = 43; -FEAT_WEAPON_PROFICIENCY_EXOTIC = 44; -FEAT_WEAPON_PROFICIENCY_MARTIAL = 45; -FEAT_WEAPON_PROFICIENCY_SIMPLE = 46; -FEAT_WEAPON_SPECIALIZATION_CLUB = 47; -FEAT_WEAPON_PROFICIENCY_DRUID = 48; -FEAT_WEAPON_PROFICIENCY_MONK = 49; -FEAT_WEAPON_PROFICIENCY_ROGUE = 50; -FEAT_WEAPON_PROFICIENCY_WIZARD = 51; -FEAT_IMPROVED_CRITICAL_DAGGER = 52; -FEAT_IMPROVED_CRITICAL_DART = 53; -FEAT_IMPROVED_CRITICAL_HEAVY_CROSSBOW = 54; -FEAT_IMPROVED_CRITICAL_LIGHT_CROSSBOW = 55; -FEAT_IMPROVED_CRITICAL_LIGHT_MACE = 56; -FEAT_IMPROVED_CRITICAL_MORNING_STAR = 57; -FEAT_IMPROVED_CRITICAL_STAFF = 58; -FEAT_IMPROVED_CRITICAL_SPEAR = 59; -FEAT_IMPROVED_CRITICAL_SICKLE = 60; -FEAT_IMPROVED_CRITICAL_SLING = 61; -FEAT_IMPROVED_CRITICAL_UNARMED_STRIKE = 62; -FEAT_IMPROVED_CRITICAL_LONGBOW = 63; -FEAT_IMPROVED_CRITICAL_SHORTBOW = 64; -FEAT_IMPROVED_CRITICAL_SHORT_SWORD = 65; -FEAT_IMPROVED_CRITICAL_RAPIER = 66; -FEAT_IMPROVED_CRITICAL_SCIMITAR = 67; -FEAT_IMPROVED_CRITICAL_LONG_SWORD = 68; -FEAT_IMPROVED_CRITICAL_GREAT_SWORD = 69; -FEAT_IMPROVED_CRITICAL_HAND_AXE = 70; -FEAT_IMPROVED_CRITICAL_THROWING_AXE = 71; -FEAT_IMPROVED_CRITICAL_BATTLE_AXE = 72; -FEAT_IMPROVED_CRITICAL_GREAT_AXE = 73; -FEAT_IMPROVED_CRITICAL_HALBERD = 74; -FEAT_IMPROVED_CRITICAL_LIGHT_HAMMER = 75; -FEAT_IMPROVED_CRITICAL_LIGHT_FLAIL = 76; -FEAT_IMPROVED_CRITICAL_WAR_HAMMER = 77; -FEAT_IMPROVED_CRITICAL_HEAVY_FLAIL = 78; -FEAT_IMPROVED_CRITICAL_KAMA = 79; -FEAT_IMPROVED_CRITICAL_KUKRI = 80; --- int FEAT_IMPROVED_CRITICAL_NUNCHAKU = 81; -FEAT_IMPROVED_CRITICAL_SHURIKEN = 82; -FEAT_IMPROVED_CRITICAL_SCYTHE = 83; -FEAT_IMPROVED_CRITICAL_KATANA = 84; -FEAT_IMPROVED_CRITICAL_BASTARD_SWORD = 85; -FEAT_IMPROVED_CRITICAL_DIRE_MACE = 87; -FEAT_IMPROVED_CRITICAL_DOUBLE_AXE = 88; -FEAT_IMPROVED_CRITICAL_TWO_BLADED_SWORD = 89; -FEAT_WEAPON_FOCUS_DAGGER = 90; -FEAT_WEAPON_FOCUS_DART = 91; -FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW = 92; -FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW = 93; -FEAT_WEAPON_FOCUS_LIGHT_MACE = 94; -FEAT_WEAPON_FOCUS_MORNING_STAR = 95; -FEAT_WEAPON_FOCUS_STAFF = 96; -FEAT_WEAPON_FOCUS_SPEAR = 97; -FEAT_WEAPON_FOCUS_SICKLE = 98; -FEAT_WEAPON_FOCUS_SLING = 99; -FEAT_WEAPON_FOCUS_UNARMED_STRIKE = 100; -FEAT_WEAPON_FOCUS_LONGBOW = 101; -FEAT_WEAPON_FOCUS_SHORTBOW = 102; -FEAT_WEAPON_FOCUS_SHORT_SWORD = 103; -FEAT_WEAPON_FOCUS_RAPIER = 104; -FEAT_WEAPON_FOCUS_SCIMITAR = 105; -FEAT_WEAPON_FOCUS_LONG_SWORD = 106; -FEAT_WEAPON_FOCUS_GREAT_SWORD = 107; -FEAT_WEAPON_FOCUS_HAND_AXE = 108; -FEAT_WEAPON_FOCUS_THROWING_AXE = 109; -FEAT_WEAPON_FOCUS_BATTLE_AXE = 110; -FEAT_WEAPON_FOCUS_GREAT_AXE = 111; -FEAT_WEAPON_FOCUS_HALBERD = 112; -FEAT_WEAPON_FOCUS_LIGHT_HAMMER = 113; -FEAT_WEAPON_FOCUS_LIGHT_FLAIL = 114; -FEAT_WEAPON_FOCUS_WAR_HAMMER = 115; -FEAT_WEAPON_FOCUS_HEAVY_FLAIL = 116; -FEAT_WEAPON_FOCUS_KAMA = 117; -FEAT_WEAPON_FOCUS_KUKRI = 118; --- int FEAT_WEAPON_FOCUS_NUNCHAKU = 119; -FEAT_WEAPON_FOCUS_SHURIKEN = 120; -FEAT_WEAPON_FOCUS_SCYTHE = 121; -FEAT_WEAPON_FOCUS_KATANA = 122; -FEAT_WEAPON_FOCUS_BASTARD_SWORD = 123; -FEAT_WEAPON_FOCUS_DIRE_MACE = 125; -FEAT_WEAPON_FOCUS_DOUBLE_AXE = 126; -FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD = 127; -FEAT_WEAPON_SPECIALIZATION_DAGGER = 128; -FEAT_WEAPON_SPECIALIZATION_DART = 129; -FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW = 130; -FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW = 131; -FEAT_WEAPON_SPECIALIZATION_LIGHT_MACE = 132; -FEAT_WEAPON_SPECIALIZATION_MORNING_STAR = 133; -FEAT_WEAPON_SPECIALIZATION_STAFF = 134; -FEAT_WEAPON_SPECIALIZATION_SPEAR = 135; -FEAT_WEAPON_SPECIALIZATION_SICKLE = 136; -FEAT_WEAPON_SPECIALIZATION_SLING = 137; -FEAT_WEAPON_SPECIALIZATION_UNARMED_STRIKE = 138; -FEAT_WEAPON_SPECIALIZATION_LONGBOW = 139; -FEAT_WEAPON_SPECIALIZATION_SHORTBOW = 140; -FEAT_WEAPON_SPECIALIZATION_SHORT_SWORD = 141; -FEAT_WEAPON_SPECIALIZATION_RAPIER = 142; -FEAT_WEAPON_SPECIALIZATION_SCIMITAR = 143; -FEAT_WEAPON_SPECIALIZATION_LONG_SWORD = 144; -FEAT_WEAPON_SPECIALIZATION_GREAT_SWORD = 145; -FEAT_WEAPON_SPECIALIZATION_HAND_AXE = 146; -FEAT_WEAPON_SPECIALIZATION_THROWING_AXE = 147; -FEAT_WEAPON_SPECIALIZATION_BATTLE_AXE = 148; -FEAT_WEAPON_SPECIALIZATION_GREAT_AXE = 149; -FEAT_WEAPON_SPECIALIZATION_HALBERD = 150; -FEAT_WEAPON_SPECIALIZATION_LIGHT_HAMMER = 151; -FEAT_WEAPON_SPECIALIZATION_LIGHT_FLAIL = 152; -FEAT_WEAPON_SPECIALIZATION_WAR_HAMMER = 153; -FEAT_WEAPON_SPECIALIZATION_HEAVY_FLAIL = 154; -FEAT_WEAPON_SPECIALIZATION_KAMA = 155; -FEAT_WEAPON_SPECIALIZATION_KUKRI = 156; --- int FEAT_WEAPON_SPECIALIZATION_NUNCHAKU = 157; -FEAT_WEAPON_SPECIALIZATION_SHURIKEN = 158; -FEAT_WEAPON_SPECIALIZATION_SCYTHE = 159; -FEAT_WEAPON_SPECIALIZATION_KATANA = 160; -FEAT_WEAPON_SPECIALIZATION_BASTARD_SWORD = 161; -FEAT_WEAPON_SPECIALIZATION_DIRE_MACE = 163; -FEAT_WEAPON_SPECIALIZATION_DOUBLE_AXE = 164; -FEAT_WEAPON_SPECIALIZATION_TWO_BLADED_SWORD = 165; -FEAT_SPELL_FOCUS_CONJURATION = 166; -FEAT_SPELL_FOCUS_DIVINATION = 167; -FEAT_SPELL_FOCUS_ENCHANTMENT = 168; -FEAT_SPELL_FOCUS_EVOCATION = 169; -FEAT_SPELL_FOCUS_ILLUSION = 170; -FEAT_SPELL_FOCUS_NECROMANCY = 171; -FEAT_SPELL_FOCUS_TRANSMUTATION = 172; -FEAT_SKILL_FOCUS_CONCENTRATION = 173; -FEAT_SKILL_FOCUS_DISABLE_TRAP = 174; -FEAT_SKILL_FOCUS_DISCIPLINE = 175; -FEAT_SKILL_FOCUS_HEAL = 177; -FEAT_SKILL_FOCUS_HIDE = 178; -FEAT_SKILL_FOCUS_LISTEN = 179; -FEAT_SKILL_FOCUS_LORE = 180; -FEAT_SKILL_FOCUS_MOVE_SILENTLY = 181; -FEAT_SKILL_FOCUS_OPEN_LOCK = 182; -FEAT_SKILL_FOCUS_PARRY = 183; -FEAT_SKILL_FOCUS_PERFORM = 184; -FEAT_SKILL_FOCUS_PERSUADE = 185; -FEAT_SKILL_FOCUS_PICK_POCKET = 186; -FEAT_SKILL_FOCUS_SEARCH = 187; -FEAT_SKILL_FOCUS_SET_TRAP = 188; -FEAT_SKILL_FOCUS_SPELLCRAFT = 189; -FEAT_SKILL_FOCUS_SPOT = 190; -FEAT_SKILL_FOCUS_TAUNT = 192; -FEAT_SKILL_FOCUS_USE_MAGIC_DEVICE = 193; -FEAT_BARBARIAN_ENDURANCE = 194; -FEAT_UNCANNY_DODGE_1 = 195; -FEAT_DAMAGE_REDUCTION = 196; -FEAT_BARDIC_KNOWLEDGE = 197; -FEAT_NATURE_SENSE = 198; -FEAT_ANIMAL_COMPANION = 199; -FEAT_WOODLAND_STRIDE = 200; -FEAT_TRACKLESS_STEP = 201; -FEAT_RESIST_NATURES_LURE = 202; -FEAT_VENOM_IMMUNITY = 203; -FEAT_FLURRY_OF_BLOWS = 204; -FEAT_EVASION = 206; -FEAT_MONK_ENDURANCE = 207; -FEAT_STILL_MIND = 208; -FEAT_PURITY_OF_BODY = 209; -FEAT_WHOLENESS_OF_BODY = 211; -FEAT_IMPROVED_EVASION = 212; -FEAT_KI_STRIKE = 213; -FEAT_DIAMOND_BODY = 214; -FEAT_DIAMOND_SOUL = 215; -FEAT_PERFECT_SELF = 216; -FEAT_DIVINE_GRACE = 217; -FEAT_DIVINE_HEALTH = 219; -FEAT_SNEAK_ATTACK = 221; -FEAT_CRIPPLING_STRIKE = 222; -FEAT_DEFENSIVE_ROLL = 223; -FEAT_OPPORTUNIST = 224; -FEAT_SKILL_MASTERY = 225; -FEAT_UNCANNY_REFLEX = 226; -FEAT_STONECUNNING = 227; -FEAT_DARKVISION = 228; -FEAT_HARDINESS_VERSUS_POISONS = 229; -FEAT_HARDINESS_VERSUS_SPELLS = 230; -FEAT_BATTLE_TRAINING_VERSUS_ORCS = 231; -FEAT_BATTLE_TRAINING_VERSUS_GOBLINS = 232; -FEAT_BATTLE_TRAINING_VERSUS_GIANTS = 233; -FEAT_SKILL_AFFINITY_LORE = 234; -FEAT_IMMUNITY_TO_SLEEP = 235; -FEAT_HARDINESS_VERSUS_ENCHANTMENTS = 236; -FEAT_SKILL_AFFINITY_LISTEN = 237; -FEAT_SKILL_AFFINITY_SEARCH = 238; -FEAT_SKILL_AFFINITY_SPOT = 239; -FEAT_KEEN_SENSE = 240; -FEAT_HARDINESS_VERSUS_ILLUSIONS = 241; -FEAT_BATTLE_TRAINING_VERSUS_REPTILIANS = 242; -FEAT_SKILL_AFFINITY_CONCENTRATION = 243; -FEAT_PARTIAL_SKILL_AFFINITY_LISTEN = 244; -FEAT_PARTIAL_SKILL_AFFINITY_SEARCH = 245; -FEAT_PARTIAL_SKILL_AFFINITY_SPOT = 246; -FEAT_SKILL_AFFINITY_MOVE_SILENTLY = 247; -FEAT_LUCKY = 248; -FEAT_FEARLESS = 249; -FEAT_GOOD_AIM = 250; -FEAT_UNCANNY_DODGE_2 = 251; -FEAT_UNCANNY_DODGE_3 = 252; -FEAT_UNCANNY_DODGE_4 = 253; -FEAT_UNCANNY_DODGE_5 = 254; -FEAT_UNCANNY_DODGE_6 = 255; -FEAT_WEAPON_PROFICIENCY_ELF = 256; -FEAT_BARD_SONGS = 257; -FEAT_QUICK_TO_MASTER = 258; -FEAT_SLIPPERY_MIND = 259; -FEAT_MONK_AC_BONUS = 260; -FEAT_FAVORED_ENEMY_DWARF = 261; -FEAT_FAVORED_ENEMY_ELF = 262; -FEAT_FAVORED_ENEMY_GNOME = 263; -FEAT_FAVORED_ENEMY_HALFLING = 264; -FEAT_FAVORED_ENEMY_HALFELF = 265; -FEAT_FAVORED_ENEMY_HALFORC = 266; -FEAT_FAVORED_ENEMY_HUMAN = 267; -FEAT_FAVORED_ENEMY_ABERRATION = 268; -FEAT_FAVORED_ENEMY_ANIMAL = 269; -FEAT_FAVORED_ENEMY_BEAST = 270; -FEAT_FAVORED_ENEMY_CONSTRUCT = 271; -FEAT_FAVORED_ENEMY_DRAGON = 272; -FEAT_FAVORED_ENEMY_GOBLINOID = 273; -FEAT_FAVORED_ENEMY_MONSTROUS = 274; -FEAT_FAVORED_ENEMY_ORC = 275; -FEAT_FAVORED_ENEMY_REPTILIAN = 276; -FEAT_FAVORED_ENEMY_ELEMENTAL = 277; -FEAT_FAVORED_ENEMY_FEY = 278; -FEAT_FAVORED_ENEMY_GIANT = 279; -FEAT_FAVORED_ENEMY_MAGICAL_BEAST = 280; -FEAT_FAVORED_ENEMY_OUTSIDER = 281; -FEAT_FAVORED_ENEMY_SHAPECHANGER = 284; -FEAT_FAVORED_ENEMY_UNDEAD = 285; -FEAT_FAVORED_ENEMY_VERMIN = 286; -FEAT_WEAPON_PROFICIENCY_CREATURE = 289; -FEAT_WEAPON_SPECIALIZATION_CREATURE = 290; -FEAT_WEAPON_FOCUS_CREATURE = 291; -FEAT_IMPROVED_CRITICAL_CREATURE = 292; -FEAT_BARBARIAN_RAGE = 293; -FEAT_TURN_UNDEAD = 294; -FEAT_QUIVERING_PALM = 296; -FEAT_EMPTY_BODY = 297; --- int FEAT_DETECT_EVIL = 298; -FEAT_LAY_ON_HANDS = 299; -FEAT_AURA_OF_COURAGE = 300; -FEAT_SMITE_EVIL = 301; -FEAT_REMOVE_DISEASE = 302; -FEAT_SUMMON_FAMILIAR = 303; -FEAT_ELEMENTAL_SHAPE = 304; -FEAT_WILD_SHAPE = 305; -FEAT_WAR_DOMAIN_POWER = 306; -FEAT_STRENGTH_DOMAIN_POWER = 307; -FEAT_PROTECTION_DOMAIN_POWER = 308; -FEAT_LUCK_DOMAIN_POWER = 309; -FEAT_DEATH_DOMAIN_POWER = 310; -FEAT_AIR_DOMAIN_POWER = 311; -FEAT_ANIMAL_DOMAIN_POWER = 312; -FEAT_DESTRUCTION_DOMAIN_POWER = 313; -FEAT_EARTH_DOMAIN_POWER = 314; -FEAT_EVIL_DOMAIN_POWER = 315; -FEAT_FIRE_DOMAIN_POWER = 316; -FEAT_GOOD_DOMAIN_POWER = 317; -FEAT_HEALING_DOMAIN_POWER = 318; -FEAT_KNOWLEDGE_DOMAIN_POWER = 319; -FEAT_MAGIC_DOMAIN_POWER = 320; -FEAT_PLANT_DOMAIN_POWER = 321; -FEAT_SUN_DOMAIN_POWER = 322; -FEAT_TRAVEL_DOMAIN_POWER = 323; -FEAT_TRICKERY_DOMAIN_POWER = 324; -FEAT_WATER_DOMAIN_POWER = 325; -FEAT_LOWLIGHTVISION = 354; -FEAT_IMPROVED_INITIATIVE = 377; -FEAT_ARTIST = 378; -FEAT_BLOODED = 379; -FEAT_BULLHEADED = 380; -FEAT_COURTLY_MAGOCRACY = 381; -FEAT_LUCK_OF_HEROES = 382; -FEAT_RESIST_POISON = 383; -FEAT_SILVER_PALM = 384; -FEAT_SNAKEBLOOD = 386; -FEAT_STEALTHY = 387; -FEAT_STRONGSOUL = 388; -FEAT_EXPERTISE = 389; -FEAT_IMPROVED_EXPERTISE = 390; -FEAT_GREAT_CLEAVE = 391; -FEAT_SPRING_ATTACK = 392; -FEAT_GREATER_SPELL_FOCUS_ABJURATION = 393; -FEAT_GREATER_SPELL_FOCUS_CONJURATION = 394; -FEAT_GREATER_SPELL_FOCUS_DIVINIATION = 395; -FEAT_GREATER_SPELL_FOCUS_DIVINATION = 395; -FEAT_GREATER_SPELL_FOCUS_ENCHANTMENT = 396; -FEAT_GREATER_SPELL_FOCUS_EVOCATION = 397; -FEAT_GREATER_SPELL_FOCUS_ILLUSION = 398; -FEAT_GREATER_SPELL_FOCUS_NECROMANCY = 399; -FEAT_GREATER_SPELL_FOCUS_TRANSMUTATION = 400; -FEAT_GREATER_SPELL_PENETRATION = 401; -FEAT_THUG = 402; -FEAT_SKILLFOCUS_APPRAISE = 404; -FEAT_SKILL_FOCUS_TUMBLE = 406; -FEAT_SKILL_FOCUS_CRAFT_TRAP = 407; -FEAT_BLIND_FIGHT = 408; -FEAT_CIRCLE_KICK = 409; -FEAT_EXTRA_STUNNING_ATTACK = 410; -FEAT_RAPID_RELOAD = 411; -FEAT_ZEN_ARCHERY = 412; -FEAT_DIVINE_MIGHT = 413; -FEAT_DIVINE_SHIELD = 414; -FEAT_ARCANE_DEFENSE_ABJURATION = 415; -FEAT_ARCANE_DEFENSE_CONJURATION = 416; -FEAT_ARCANE_DEFENSE_DIVINATION = 417; -FEAT_ARCANE_DEFENSE_ENCHANTMENT = 418; -FEAT_ARCANE_DEFENSE_EVOCATION = 419; -FEAT_ARCANE_DEFENSE_ILLUSION = 420; -FEAT_ARCANE_DEFENSE_NECROMANCY = 421; -FEAT_ARCANE_DEFENSE_TRANSMUTATION = 422; -FEAT_EXTRA_MUSIC = 423; -FEAT_LINGERING_SONG = 424; -FEAT_DIRTY_FIGHTING = 425; -FEAT_RESIST_DISEASE = 426; -FEAT_RESIST_ENERGY_COLD = 427; -FEAT_RESIST_ENERGY_ACID = 428; -FEAT_RESIST_ENERGY_FIRE = 429; -FEAT_RESIST_ENERGY_ELECTRICAL = 430; -FEAT_RESIST_ENERGY_SONIC = 431; -FEAT_HIDE_IN_PLAIN_SIGHT = 433; -FEAT_SHADOW_DAZE = 434; -FEAT_SUMMON_SHADOW = 435; -FEAT_SHADOW_EVADE = 436; -FEAT_DENEIRS_EYE = 437; -FEAT_TYMORAS_SMILE = 438; -FEAT_LLIIRAS_HEART = 439; -FEAT_CRAFT_HARPER_ITEM = 440; -FEAT_HARPER_SLEEP = 441; -FEAT_HARPER_CATS_GRACE = 442; -FEAT_HARPER_EAGLES_SPLENDOR = 443; -FEAT_HARPER_INVISIBILITY = 444; -FEAT_PRESTIGE_ENCHANT_ARROW_1 = 445; -FEAT_PRESTIGE_ENCHANT_ARROW_2 = 446; -FEAT_PRESTIGE_ENCHANT_ARROW_3 = 447; -FEAT_PRESTIGE_ENCHANT_ARROW_4 = 448; -FEAT_PRESTIGE_ENCHANT_ARROW_5 = 449; -FEAT_PRESTIGE_IMBUE_ARROW = 450; -FEAT_PRESTIGE_SEEKER_ARROW_1 = 451; -FEAT_PRESTIGE_SEEKER_ARROW_2 = 452; -FEAT_PRESTIGE_HAIL_OF_ARROWS = 453; -FEAT_PRESTIGE_ARROW_OF_DEATH = 454; -FEAT_PRESTIGE_DEATH_ATTACK_1 = 455; -FEAT_PRESTIGE_DEATH_ATTACK_2 = 456; -FEAT_PRESTIGE_DEATH_ATTACK_3 = 457; -FEAT_PRESTIGE_DEATH_ATTACK_4 = 458; -FEAT_PRESTIGE_DEATH_ATTACK_5 = 459; -FEAT_BLACKGUARD_SNEAK_ATTACK_1D6 = 460; -FEAT_BLACKGUARD_SNEAK_ATTACK_2D6 = 461; -FEAT_BLACKGUARD_SNEAK_ATTACK_3D6 = 462; -FEAT_PRESTIGE_POISON_SAVE_1 = 463; -FEAT_PRESTIGE_POISON_SAVE_2 = 464; -FEAT_PRESTIGE_POISON_SAVE_3 = 465; -FEAT_PRESTIGE_POISON_SAVE_4 = 466; -FEAT_PRESTIGE_POISON_SAVE_5 = 467; -FEAT_PRESTIGE_SPELL_GHOSTLY_VISAGE = 468; -FEAT_PRESTIGE_DARKNESS = 469; -FEAT_PRESTIGE_INVISIBILITY_1 = 470; -FEAT_PRESTIGE_INVISIBILITY_2 = 471; -FEAT_SMITE_GOOD = 472; -FEAT_PRESTIGE_DARK_BLESSING = 473; -FEAT_INFLICT_LIGHT_WOUNDS = 474; -FEAT_INFLICT_MODERATE_WOUNDS = 475; -FEAT_INFLICT_SERIOUS_WOUNDS = 476; -FEAT_INFLICT_CRITICAL_WOUNDS = 477; -FEAT_BULLS_STRENGTH = 478; -FEAT_CONTAGION = 479; -FEAT_EYE_OF_GRUUMSH_BLINDING_SPITTLE = 480; -FEAT_EYE_OF_GRUUMSH_BLINDING_SPITTLE_2 = 481; -FEAT_EYE_OF_GRUUMSH_COMMAND_THE_HORDE = 482; -FEAT_EYE_OF_GRUUMSH_SWING_BLINDLY = 483; -FEAT_EYE_OF_GRUUMSH_RITUAL_SCARRING = 484; -FEAT_BLINDSIGHT_5_FEET = 485; -FEAT_BLINDSIGHT_10_FEET = 486; -FEAT_EYE_OF_GRUUMSH_SIGHT_OF_GRUUMSH = 487; -FEAT_BLINDSIGHT_60_FEET = 488; -FEAT_SHOU_DISCIPLE_DODGE_2 = 489; -FEAT_EPIC_ARMOR_SKIN = 490; -FEAT_EPIC_BLINDING_SPEED = 491; -FEAT_EPIC_DAMAGE_REDUCTION_3 = 492; -FEAT_EPIC_DAMAGE_REDUCTION_6 = 493; -FEAT_EPIC_DAMAGE_REDUCTION_9 = 494; -FEAT_EPIC_DEVASTATING_CRITICAL_CLUB = 495; -FEAT_EPIC_DEVASTATING_CRITICAL_DAGGER = 496; -FEAT_EPIC_DEVASTATING_CRITICAL_DART = 497; -FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYCROSSBOW = 498; -FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTCROSSBOW = 499; -FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTMACE = 500; -FEAT_EPIC_DEVASTATING_CRITICAL_MORNINGSTAR = 501; -FEAT_EPIC_DEVASTATING_CRITICAL_QUARTERSTAFF = 502; -FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSPEAR = 503; -FEAT_EPIC_DEVASTATING_CRITICAL_SICKLE = 504; -FEAT_EPIC_DEVASTATING_CRITICAL_SLING = 505; -FEAT_EPIC_DEVASTATING_CRITICAL_UNARMED = 506; -FEAT_EPIC_DEVASTATING_CRITICAL_LONGBOW = 507; -FEAT_EPIC_DEVASTATING_CRITICAL_SHORTBOW = 508; -FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSWORD = 509; -FEAT_EPIC_DEVASTATING_CRITICAL_RAPIER = 510; -FEAT_EPIC_DEVASTATING_CRITICAL_SCIMITAR = 511; -FEAT_EPIC_DEVASTATING_CRITICAL_LONGSWORD = 512; -FEAT_EPIC_DEVASTATING_CRITICAL_GREATSWORD = 513; -FEAT_EPIC_DEVASTATING_CRITICAL_HANDAXE = 514; -FEAT_EPIC_DEVASTATING_CRITICAL_THROWINGAXE = 515; -FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE = 516; -FEAT_EPIC_DEVASTATING_CRITICAL_GREATAXE = 517; -FEAT_EPIC_DEVASTATING_CRITICAL_HALBERD = 518; -FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTHAMMER = 519; -FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTFLAIL = 520; -FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER = 521; -FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYFLAIL = 522; -FEAT_EPIC_DEVASTATING_CRITICAL_KAMA = 523; -FEAT_EPIC_DEVASTATING_CRITICAL_KUKRI = 524; -FEAT_EPIC_DEVASTATING_CRITICAL_SHURIKEN = 525; -FEAT_EPIC_DEVASTATING_CRITICAL_SCYTHE = 526; -FEAT_EPIC_DEVASTATING_CRITICAL_KATANA = 527; -FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD = 528; -FEAT_EPIC_DEVASTATING_CRITICAL_DIREMACE = 529; -FEAT_EPIC_DEVASTATING_CRITICAL_DOUBLEAXE = 530; -FEAT_EPIC_DEVASTATING_CRITICAL_TWOBLADEDSWORD = 531; -FEAT_EPIC_DEVASTATING_CRITICAL_CREATURE = 532; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_1 = 533; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_2 = 534; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_3 = 535; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_4 = 536; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_5 = 537; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_6 = 538; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_7 = 539; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_8 = 540; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_9 = 541; -FEAT_EPIC_ENERGY_RESISTANCE_COLD_10 = 542; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_1 = 543; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_2 = 544; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_3 = 545; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_4 = 546; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_5 = 547; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_6 = 548; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_7 = 549; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_8 = 550; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_9 = 551; -FEAT_EPIC_ENERGY_RESISTANCE_ACID_10 = 552; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_1 = 553; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_2 = 554; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_3 = 555; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_4 = 556; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_5 = 557; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_6 = 558; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_7 = 559; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_8 = 560; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_9 = 561; -FEAT_EPIC_ENERGY_RESISTANCE_FIRE_10 = 562; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_1 = 563; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_2 = 564; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_3 = 565; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_4 = 566; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_5 = 567; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_6 = 568; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_7 = 569; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_8 = 570; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_9 = 571; -FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_10 = 572; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_1 = 573; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_2 = 574; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_3 = 575; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_4 = 576; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_5 = 577; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_6 = 578; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_7 = 579; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_8 = 580; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_9 = 581; -FEAT_EPIC_ENERGY_RESISTANCE_SONIC_10 = 582; -FEAT_EPIC_FORTITUDE = 583; -FEAT_EPIC_PROWESS = 584; -FEAT_EPIC_REFLEXES = 585; -FEAT_EPIC_REPUTATION = 586; -FEAT_EPIC_SKILL_FOCUS_ANIMAL_EMPATHY = 587; -FEAT_EPIC_SKILL_FOCUS_APPRAISE = 588; -FEAT_EPIC_SKILL_FOCUS_CONCENTRATION = 589; -FEAT_EPIC_SKILL_FOCUS_CRAFT_TRAP = 590; -FEAT_EPIC_SKILL_FOCUS_DISABLETRAP = 591; -FEAT_EPIC_SKILL_FOCUS_DISCIPLINE = 592; -FEAT_EPIC_SKILL_FOCUS_HEAL = 593; -FEAT_EPIC_SKILL_FOCUS_HIDE = 594; -FEAT_EPIC_SKILL_FOCUS_LISTEN = 595; -FEAT_EPIC_SKILL_FOCUS_LORE = 596; -FEAT_EPIC_SKILL_FOCUS_MOVESILENTLY = 597; -FEAT_EPIC_SKILL_FOCUS_OPENLOCK = 598; -FEAT_EPIC_SKILL_FOCUS_PARRY = 599; -FEAT_EPIC_SKILL_FOCUS_PERFORM = 600; -FEAT_EPIC_SKILL_FOCUS_PERSUADE = 601; -FEAT_EPIC_SKILL_FOCUS_PICKPOCKET = 602; -FEAT_EPIC_SKILL_FOCUS_SEARCH = 603; -FEAT_EPIC_SKILL_FOCUS_SETTRAP = 604; -FEAT_EPIC_SKILL_FOCUS_SPELLCRAFT = 605; -FEAT_EPIC_SKILL_FOCUS_SPOT = 606; -FEAT_EPIC_SKILL_FOCUS_TAUNT = 607; -FEAT_EPIC_SKILL_FOCUS_TUMBLE = 608; -FEAT_EPIC_SKILL_FOCUS_USEMAGICDEVICE = 609; -FEAT_EPIC_SPELL_FOCUS_ABJURATION = 610; -FEAT_EPIC_SPELL_FOCUS_CONJURATION = 611; -FEAT_EPIC_SPELL_FOCUS_DIVINATION = 612; -FEAT_EPIC_SPELL_FOCUS_ENCHANTMENT = 613; -FEAT_EPIC_SPELL_FOCUS_EVOCATION = 614; -FEAT_EPIC_SPELL_FOCUS_ILLUSION = 615; -FEAT_EPIC_SPELL_FOCUS_NECROMANCY = 616; -FEAT_EPIC_SPELL_FOCUS_TRANSMUTATION = 617; -FEAT_EPIC_SPELL_PENETRATION = 618; -FEAT_EPIC_WEAPON_FOCUS_CLUB = 619; -FEAT_EPIC_WEAPON_FOCUS_DAGGER = 620; -FEAT_EPIC_WEAPON_FOCUS_DART = 621; -FEAT_EPIC_WEAPON_FOCUS_HEAVYCROSSBOW = 622; -FEAT_EPIC_WEAPON_FOCUS_LIGHTCROSSBOW = 623; -FEAT_EPIC_WEAPON_FOCUS_LIGHTMACE = 624; -FEAT_EPIC_WEAPON_FOCUS_MORNINGSTAR = 625; -FEAT_EPIC_WEAPON_FOCUS_QUARTERSTAFF = 626; -FEAT_EPIC_WEAPON_FOCUS_SHORTSPEAR = 627; -FEAT_EPIC_WEAPON_FOCUS_SICKLE = 628; -FEAT_EPIC_WEAPON_FOCUS_SLING = 629; -FEAT_EPIC_WEAPON_FOCUS_UNARMED = 630; -FEAT_EPIC_WEAPON_FOCUS_LONGBOW = 631; -FEAT_EPIC_WEAPON_FOCUS_SHORTBOW = 632; -FEAT_EPIC_WEAPON_FOCUS_SHORTSWORD = 633; -FEAT_EPIC_WEAPON_FOCUS_RAPIER = 634; -FEAT_EPIC_WEAPON_FOCUS_SCIMITAR = 635; -FEAT_EPIC_WEAPON_FOCUS_LONGSWORD = 636; -FEAT_EPIC_WEAPON_FOCUS_GREATSWORD = 637; -FEAT_EPIC_WEAPON_FOCUS_HANDAXE = 638; -FEAT_EPIC_WEAPON_FOCUS_THROWINGAXE = 639; -FEAT_EPIC_WEAPON_FOCUS_BATTLEAXE = 640; -FEAT_EPIC_WEAPON_FOCUS_GREATAXE = 641; -FEAT_EPIC_WEAPON_FOCUS_HALBERD = 642; -FEAT_EPIC_WEAPON_FOCUS_LIGHTHAMMER = 643; -FEAT_EPIC_WEAPON_FOCUS_LIGHTFLAIL = 644; -FEAT_EPIC_WEAPON_FOCUS_WARHAMMER = 645; -FEAT_EPIC_WEAPON_FOCUS_HEAVYFLAIL = 646; -FEAT_EPIC_WEAPON_FOCUS_KAMA = 647; -FEAT_EPIC_WEAPON_FOCUS_KUKRI = 648; -FEAT_EPIC_WEAPON_FOCUS_SHURIKEN = 649; -FEAT_EPIC_WEAPON_FOCUS_SCYTHE = 650; -FEAT_EPIC_WEAPON_FOCUS_KATANA = 651; -FEAT_EPIC_WEAPON_FOCUS_BASTARDSWORD = 652; -FEAT_EPIC_WEAPON_FOCUS_DIREMACE = 653; -FEAT_EPIC_WEAPON_FOCUS_DOUBLEAXE = 654; -FEAT_EPIC_WEAPON_FOCUS_TWOBLADEDSWORD = 655; -FEAT_EPIC_WEAPON_FOCUS_CREATURE = 656; -FEAT_EPIC_WEAPON_SPECIALIZATION_CLUB = 657; -FEAT_EPIC_WEAPON_SPECIALIZATION_DAGGER = 658; -FEAT_EPIC_WEAPON_SPECIALIZATION_DART = 659; -FEAT_EPIC_WEAPON_SPECIALIZATION_HEAVYCROSSBOW = 660; -FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTCROSSBOW = 661; -FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTMACE = 662; -FEAT_EPIC_WEAPON_SPECIALIZATION_MORNINGSTAR = 663; -FEAT_EPIC_WEAPON_SPECIALIZATION_QUARTERSTAFF = 664; -FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTSPEAR = 665; -FEAT_EPIC_WEAPON_SPECIALIZATION_SICKLE = 666; -FEAT_EPIC_WEAPON_SPECIALIZATION_SLING = 667; -FEAT_EPIC_WEAPON_SPECIALIZATION_UNARMED = 668; -FEAT_EPIC_WEAPON_SPECIALIZATION_LONGBOW = 669; -FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTBOW = 670; -FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTSWORD = 671; -FEAT_EPIC_WEAPON_SPECIALIZATION_RAPIER = 672; -FEAT_EPIC_WEAPON_SPECIALIZATION_SCIMITAR = 673; -FEAT_EPIC_WEAPON_SPECIALIZATION_LONGSWORD = 674; -FEAT_EPIC_WEAPON_SPECIALIZATION_GREATSWORD = 675; -FEAT_EPIC_WEAPON_SPECIALIZATION_HANDAXE = 676; -FEAT_EPIC_WEAPON_SPECIALIZATION_THROWINGAXE = 677; -FEAT_EPIC_WEAPON_SPECIALIZATION_BATTLEAXE = 678; -FEAT_EPIC_WEAPON_SPECIALIZATION_GREATAXE = 679; -FEAT_EPIC_WEAPON_SPECIALIZATION_HALBERD = 680; -FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTHAMMER = 681; -FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTFLAIL = 682; -FEAT_EPIC_WEAPON_SPECIALIZATION_WARHAMMER = 683; -FEAT_EPIC_WEAPON_SPECIALIZATION_HEAVYFLAIL = 684; -FEAT_EPIC_WEAPON_SPECIALIZATION_KAMA = 685; -FEAT_EPIC_WEAPON_SPECIALIZATION_KUKRI = 686; -FEAT_EPIC_WEAPON_SPECIALIZATION_SHURIKEN = 687; -FEAT_EPIC_WEAPON_SPECIALIZATION_SCYTHE = 688; -FEAT_EPIC_WEAPON_SPECIALIZATION_KATANA = 689; -FEAT_EPIC_WEAPON_SPECIALIZATION_BASTARDSWORD = 690; -FEAT_EPIC_WEAPON_SPECIALIZATION_DIREMACE = 691; -FEAT_EPIC_WEAPON_SPECIALIZATION_DOUBLEAXE = 692; -FEAT_EPIC_WEAPON_SPECIALIZATION_TWOBLADEDSWORD = 693; -FEAT_EPIC_WEAPON_SPECIALIZATION_CREATURE = 694; -FEAT_EPIC_WILL = 695; -FEAT_EPIC_IMPROVED_COMBAT_CASTING = 696; -FEAT_EPIC_IMPROVED_KI_STRIKE_4 = 697; -FEAT_EPIC_IMPROVED_KI_STRIKE_5 = 698; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_1 = 699; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_2 = 700; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_3 = 701; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_4 = 702; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_5 = 703; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_6 = 704; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_7 = 705; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_8 = 706; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_9 = 707; -FEAT_EPIC_IMPROVED_SPELL_RESISTANCE_10 = 708; -FEAT_EPIC_OVERWHELMING_CRITICAL_CLUB = 709; -FEAT_EPIC_OVERWHELMING_CRITICAL_DAGGER = 710; -FEAT_EPIC_OVERWHELMING_CRITICAL_DART = 711; -FEAT_EPIC_OVERWHELMING_CRITICAL_HEAVYCROSSBOW = 712; -FEAT_EPIC_OVERWHELMING_CRITICAL_LIGHTCROSSBOW = 713; -FEAT_EPIC_OVERWHELMING_CRITICAL_LIGHTMACE = 714; -FEAT_EPIC_OVERWHELMING_CRITICAL_MORNINGSTAR = 715; -FEAT_EPIC_OVERWHELMING_CRITICAL_QUARTERSTAFF = 716; -FEAT_EPIC_OVERWHELMING_CRITICAL_SHORTSPEAR = 717; -FEAT_EPIC_OVERWHELMING_CRITICAL_SICKLE = 718; -FEAT_EPIC_OVERWHELMING_CRITICAL_SLING = 719; -FEAT_EPIC_OVERWHELMING_CRITICAL_UNARMED = 720; -FEAT_EPIC_OVERWHELMING_CRITICAL_LONGBOW = 721; -FEAT_EPIC_OVERWHELMING_CRITICAL_SHORTBOW = 722; -FEAT_EPIC_OVERWHELMING_CRITICAL_SHORTSWORD = 723; -FEAT_EPIC_OVERWHELMING_CRITICAL_RAPIER = 724; -FEAT_EPIC_OVERWHELMING_CRITICAL_SCIMITAR = 725; -FEAT_EPIC_OVERWHELMING_CRITICAL_LONGSWORD = 726; -FEAT_EPIC_OVERWHELMING_CRITICAL_GREATSWORD = 727; -FEAT_EPIC_OVERWHELMING_CRITICAL_HANDAXE = 728; -FEAT_EPIC_OVERWHELMING_CRITICAL_THROWINGAXE = 729; -FEAT_EPIC_OVERWHELMING_CRITICAL_BATTLEAXE = 730; -FEAT_EPIC_OVERWHELMING_CRITICAL_GREATAXE = 731; -FEAT_EPIC_OVERWHELMING_CRITICAL_HALBERD = 732; -FEAT_EPIC_OVERWHELMING_CRITICAL_LIGHTHAMMER = 733; -FEAT_EPIC_OVERWHELMING_CRITICAL_LIGHTFLAIL = 734; -FEAT_EPIC_OVERWHELMING_CRITICAL_WARHAMMER = 735; -FEAT_EPIC_OVERWHELMING_CRITICAL_HEAVYFLAIL = 736; -FEAT_EPIC_OVERWHELMING_CRITICAL_KAMA = 737; -FEAT_EPIC_OVERWHELMING_CRITICAL_KUKRI = 738; -FEAT_EPIC_OVERWHELMING_CRITICAL_SHURIKEN = 739; -FEAT_EPIC_OVERWHELMING_CRITICAL_SCYTHE = 740; -FEAT_EPIC_OVERWHELMING_CRITICAL_KATANA = 741; -FEAT_EPIC_OVERWHELMING_CRITICAL_BASTARDSWORD = 742; -FEAT_EPIC_OVERWHELMING_CRITICAL_DIREMACE = 743; -FEAT_EPIC_OVERWHELMING_CRITICAL_DOUBLEAXE = 744; -FEAT_EPIC_OVERWHELMING_CRITICAL_TWOBLADEDSWORD = 745; -FEAT_EPIC_OVERWHELMING_CRITICAL_CREATURE = 746; -FEAT_EPIC_PERFECT_HEALTH = 747; -FEAT_EPIC_SELF_CONCEALMENT_10 = 748; -FEAT_EPIC_SELF_CONCEALMENT_20 = 749; -FEAT_EPIC_SELF_CONCEALMENT_30 = 750; -FEAT_EPIC_SELF_CONCEALMENT_40 = 751; -FEAT_EPIC_SELF_CONCEALMENT_50 = 752; -FEAT_EPIC_SUPERIOR_INITIATIVE = 753; -FEAT_EPIC_TOUGHNESS_1 = 754; -FEAT_EPIC_TOUGHNESS_2 = 755; -FEAT_EPIC_TOUGHNESS_3 = 756; -FEAT_EPIC_TOUGHNESS_4 = 757; -FEAT_EPIC_TOUGHNESS_5 = 758; -FEAT_EPIC_TOUGHNESS_6 = 759; -FEAT_EPIC_TOUGHNESS_7 = 760; -FEAT_EPIC_TOUGHNESS_8 = 761; -FEAT_EPIC_TOUGHNESS_9 = 762; -FEAT_EPIC_TOUGHNESS_10 = 763; -FEAT_EPIC_GREAT_CHARISMA_1 = 764; -FEAT_EPIC_GREAT_CHARISMA_2 = 765; -FEAT_EPIC_GREAT_CHARISMA_3 = 766; -FEAT_EPIC_GREAT_CHARISMA_4 = 767; -FEAT_EPIC_GREAT_CHARISMA_5 = 768; -FEAT_EPIC_GREAT_CHARISMA_6 = 769; -FEAT_EPIC_GREAT_CHARISMA_7 = 770; -FEAT_EPIC_GREAT_CHARISMA_8 = 771; -FEAT_EPIC_GREAT_CHARISMA_9 = 772; -FEAT_EPIC_GREAT_CHARISMA_10 = 773; -FEAT_EPIC_GREAT_CONSTITUTION_1 = 774; -FEAT_EPIC_GREAT_CONSTITUTION_2 = 775; -FEAT_EPIC_GREAT_CONSTITUTION_3 = 776; -FEAT_EPIC_GREAT_CONSTITUTION_4 = 777; -FEAT_EPIC_GREAT_CONSTITUTION_5 = 778; -FEAT_EPIC_GREAT_CONSTITUTION_6 = 779; -FEAT_EPIC_GREAT_CONSTITUTION_7 = 780; -FEAT_EPIC_GREAT_CONSTITUTION_8 = 781; -FEAT_EPIC_GREAT_CONSTITUTION_9 = 782; -FEAT_EPIC_GREAT_CONSTITUTION_10 = 783; -FEAT_EPIC_GREAT_DEXTERITY_1 = 784; -FEAT_EPIC_GREAT_DEXTERITY_2 = 785; -FEAT_EPIC_GREAT_DEXTERITY_3 = 786; -FEAT_EPIC_GREAT_DEXTERITY_4 = 787; -FEAT_EPIC_GREAT_DEXTERITY_5 = 788; -FEAT_EPIC_GREAT_DEXTERITY_6 = 789; -FEAT_EPIC_GREAT_DEXTERITY_7 = 790; -FEAT_EPIC_GREAT_DEXTERITY_8 = 791; -FEAT_EPIC_GREAT_DEXTERITY_9 = 792; -FEAT_EPIC_GREAT_DEXTERITY_10 = 793; -FEAT_EPIC_GREAT_INTELLIGENCE_1 = 794; -FEAT_EPIC_GREAT_INTELLIGENCE_2 = 795; -FEAT_EPIC_GREAT_INTELLIGENCE_3 = 796; -FEAT_EPIC_GREAT_INTELLIGENCE_4 = 797; -FEAT_EPIC_GREAT_INTELLIGENCE_5 = 798; -FEAT_EPIC_GREAT_INTELLIGENCE_6 = 799; -FEAT_EPIC_GREAT_INTELLIGENCE_7 = 800; -FEAT_EPIC_GREAT_INTELLIGENCE_8 = 801; -FEAT_EPIC_GREAT_INTELLIGENCE_9 = 802; -FEAT_EPIC_GREAT_INTELLIGENCE_10 = 803; -FEAT_EPIC_GREAT_WISDOM_1 = 804; -FEAT_EPIC_GREAT_WISDOM_2 = 805; -FEAT_EPIC_GREAT_WISDOM_3 = 806; -FEAT_EPIC_GREAT_WISDOM_4 = 807; -FEAT_EPIC_GREAT_WISDOM_5 = 808; -FEAT_EPIC_GREAT_WISDOM_6 = 809; -FEAT_EPIC_GREAT_WISDOM_7 = 810; -FEAT_EPIC_GREAT_WISDOM_8 = 811; -FEAT_EPIC_GREAT_WISDOM_9 = 812; -FEAT_EPIC_GREAT_WISDOM_10 = 813; -FEAT_EPIC_GREAT_STRENGTH_1 = 814; -FEAT_EPIC_GREAT_STRENGTH_2 = 815; -FEAT_EPIC_GREAT_STRENGTH_3 = 816; -FEAT_EPIC_GREAT_STRENGTH_4 = 817; -FEAT_EPIC_GREAT_STRENGTH_5 = 818; -FEAT_EPIC_GREAT_STRENGTH_6 = 819; -FEAT_EPIC_GREAT_STRENGTH_7 = 820; -FEAT_EPIC_GREAT_STRENGTH_8 = 821; -FEAT_EPIC_GREAT_STRENGTH_9 = 822; -FEAT_EPIC_GREAT_STRENGTH_10 = 823; -FEAT_EPIC_GREAT_SMITING_1 = 824; -FEAT_EPIC_GREAT_SMITING_2 = 825; -FEAT_EPIC_GREAT_SMITING_3 = 826; -FEAT_EPIC_GREAT_SMITING_4 = 827; -FEAT_EPIC_GREAT_SMITING_5 = 828; -FEAT_EPIC_GREAT_SMITING_6 = 829; -FEAT_EPIC_GREAT_SMITING_7 = 830; -FEAT_EPIC_GREAT_SMITING_8 = 831; -FEAT_EPIC_GREAT_SMITING_9 = 832; -FEAT_EPIC_GREAT_SMITING_10 = 833; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_1 = 834; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_2 = 835; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_3 = 836; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_4 = 837; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_5 = 838; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_6 = 839; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_7 = 840; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_8 = 841; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_9 = 842; -FEAT_EPIC_IMPROVED_SNEAK_ATTACK_10 = 843; -FEAT_EPIC_IMPROVED_STUNNING_FIST_1 = 844; -FEAT_EPIC_IMPROVED_STUNNING_FIST_2 = 845; -FEAT_EPIC_IMPROVED_STUNNING_FIST_3 = 846; -FEAT_EPIC_IMPROVED_STUNNING_FIST_4 = 847; -FEAT_EPIC_IMPROVED_STUNNING_FIST_5 = 848; -FEAT_EPIC_IMPROVED_STUNNING_FIST_6 = 849; -FEAT_EPIC_IMPROVED_STUNNING_FIST_7 = 850; -FEAT_EPIC_IMPROVED_STUNNING_FIST_8 = 851; -FEAT_EPIC_IMPROVED_STUNNING_FIST_9 = 852; -FEAT_EPIC_IMPROVED_STUNNING_FIST_10 = 853; --- int FEAT_EPIC_PLANAR_TURNING = 854; -FEAT_EPIC_BANE_OF_ENEMIES = 855; -FEAT_EPIC_DODGE = 856; -FEAT_EPIC_AUTOMATIC_QUICKEN_1 = 857; -FEAT_EPIC_AUTOMATIC_QUICKEN_2 = 858; -FEAT_EPIC_AUTOMATIC_QUICKEN_3 = 859; -FEAT_EPIC_AUTOMATIC_SILENT_SPELL_1 = 860; -FEAT_EPIC_AUTOMATIC_SILENT_SPELL_2 = 861; -FEAT_EPIC_AUTOMATIC_SILENT_SPELL_3 = 862; -FEAT_EPIC_AUTOMATIC_STILL_SPELL_1 = 863; -FEAT_EPIC_AUTOMATIC_STILL_SPELL_2 = 864; -FEAT_EPIC_AUTOMATIC_STILL_SPELL_3 = 865; -FEAT_SHOU_DISCIPLE_MARTIAL_FLURRY_LIGHT = 866; -FEAT_WHIRLWIND_ATTACK = 867; -FEAT_IMPROVED_WHIRLWIND = 868; -FEAT_MIGHTY_RAGE = 869; -FEAT_EPIC_LASTING_INSPIRATION = 870; -FEAT_CURSE_SONG = 871; -FEAT_EPIC_WILD_SHAPE_UNDEAD = 872; -FEAT_EPIC_WILD_SHAPE_DRAGON = 873; -FEAT_EPIC_SPELL_MUMMY_DUST = 874; -FEAT_EPIC_SPELL_DRAGON_KNIGHT = 875; -FEAT_EPIC_SPELL_HELLBALL = 876; -FEAT_EPIC_SPELL_MAGE_ARMOUR = 877; -FEAT_EPIC_SPELL_RUIN = 878; -FEAT_WEAPON_OF_CHOICE_SICKLE = 879; -FEAT_WEAPON_OF_CHOICE_KAMA = 880; -FEAT_WEAPON_OF_CHOICE_KUKRI = 881; -FEAT_KI_DAMAGE = 882; -FEAT_INCREASE_MULTIPLIER = 883; -FEAT_SUPERIOR_WEAPON_FOCUS = 884; -FEAT_KI_CRITICAL = 885; -FEAT_BONE_SKIN_2 = 886; -FEAT_BONE_SKIN_4 = 887; -FEAT_BONE_SKIN_6 = 888; -FEAT_ANIMATE_DEAD = 889; -FEAT_SUMMON_UNDEAD = 890; -FEAT_DEATHLESS_VIGOR = 891; -FEAT_UNDEAD_GRAFT_1 = 892; -FEAT_UNDEAD_GRAFT_2 = 893; -FEAT_TOUGH_AS_BONE = 894; -FEAT_SUMMON_GREATER_UNDEAD = 895; -FEAT_DEATHLESS_MASTERY = 896; -FEAT_DEATHLESS_MASTER_TOUCH = 897; -FEAT_GREATER_WILDSHAPE_1 = 898; -FEAT_SHOU_DISCIPLE_MARTIAL_FLURRY_ANY = 899; -FEAT_GREATER_WILDSHAPE_2 = 900; -FEAT_GREATER_WILDSHAPE_3 = 901; -FEAT_HUMANOID_SHAPE = 902; -FEAT_GREATER_WILDSHAPE_4 = 903; -FEAT_SACRED_DEFENSE_1 = 904; -FEAT_SACRED_DEFENSE_2 = 905; -FEAT_SACRED_DEFENSE_3 = 906; -FEAT_SACRED_DEFENSE_4 = 907; -FEAT_SACRED_DEFENSE_5 = 908; -FEAT_DIVINE_WRATH = 909; -FEAT_EXTRA_SMITING = 910; -FEAT_SKILL_FOCUS_CRAFT_ARMOR = 911; -FEAT_SKILL_FOCUS_CRAFT_WEAPON = 912; -FEAT_EPIC_SKILL_FOCUS_CRAFT_ARMOR = 913; -FEAT_EPIC_SKILL_FOCUS_CRAFT_WEAPON = 914; -FEAT_SKILL_FOCUS_BLUFF = 915; -FEAT_SKILL_FOCUS_INTIMIDATE = 916; -FEAT_EPIC_SKILL_FOCUS_BLUFF = 917; -FEAT_EPIC_SKILL_FOCUS_INTIMIDATE = 918; -FEAT_WEAPON_OF_CHOICE_CLUB = 919; -FEAT_WEAPON_OF_CHOICE_DAGGER = 920; -FEAT_WEAPON_OF_CHOICE_LIGHTMACE = 921; -FEAT_WEAPON_OF_CHOICE_MORNINGSTAR = 922; -FEAT_WEAPON_OF_CHOICE_QUARTERSTAFF = 923; -FEAT_WEAPON_OF_CHOICE_SHORTSPEAR = 924; -FEAT_WEAPON_OF_CHOICE_SHORTSWORD = 925; -FEAT_WEAPON_OF_CHOICE_RAPIER = 926; -FEAT_WEAPON_OF_CHOICE_SCIMITAR = 927; -FEAT_WEAPON_OF_CHOICE_LONGSWORD = 928; -FEAT_WEAPON_OF_CHOICE_GREATSWORD = 929; -FEAT_WEAPON_OF_CHOICE_HANDAXE = 930; -FEAT_WEAPON_OF_CHOICE_BATTLEAXE = 931; -FEAT_WEAPON_OF_CHOICE_GREATAXE = 932; -FEAT_WEAPON_OF_CHOICE_HALBERD = 933; -FEAT_WEAPON_OF_CHOICE_LIGHTHAMMER = 934; -FEAT_WEAPON_OF_CHOICE_LIGHTFLAIL = 935; -FEAT_WEAPON_OF_CHOICE_WARHAMMER = 936; -FEAT_WEAPON_OF_CHOICE_HEAVYFLAIL = 937; -FEAT_WEAPON_OF_CHOICE_SCYTHE = 938; -FEAT_WEAPON_OF_CHOICE_KATANA = 939; -FEAT_WEAPON_OF_CHOICE_BASTARDSWORD = 940; -FEAT_WEAPON_OF_CHOICE_DIREMACE = 941; -FEAT_WEAPON_OF_CHOICE_DOUBLEAXE = 942; -FEAT_WEAPON_OF_CHOICE_TWOBLADEDSWORD = 943; -FEAT_BREW_POTION = 944; -FEAT_SCRIBE_SCROLL = 945; -FEAT_CRAFT_WAND = 946; -FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE = 947; -FEAT_DAMAGE_REDUCTION_6 = 948; -FEAT_PRESTIGE_DEFENSIVE_AWARENESS_1 = 949; -FEAT_PRESTIGE_DEFENSIVE_AWARENESS_2 = 950; -FEAT_PRESTIGE_DEFENSIVE_AWARENESS_3 = 951; -FEAT_WEAPON_FOCUS_DWAXE = 952; -FEAT_WEAPON_SPECIALIZATION_DWAXE = 953; -FEAT_IMPROVED_CRITICAL_DWAXE = 954; -FEAT_EPIC_DEVASTATING_CRITICAL_DWAXE = 955; -FEAT_EPIC_WEAPON_FOCUS_DWAXE = 956; -FEAT_EPIC_WEAPON_SPECIALIZATION_DWAXE = 957; -FEAT_EPIC_OVERWHELMING_CRITICAL_DWAXE = 958; -FEAT_WEAPON_OF_CHOICE_DWAXE = 959; -FEAT_USE_POISON = 960; -FEAT_DRAGON_ARMOR = 961; -FEAT_DRAGON_ABILITIES = 962; -FEAT_DRAGON_IMMUNE_PARALYSIS = 963; -FEAT_DRAGON_IMMUNE_FIRE = 964; -FEAT_DRAGON_DIS_BREATH = 965; -FEAT_EPIC_FIGHTER = 966; -FEAT_EPIC_BARBARIAN = 967; -FEAT_EPIC_BARD = 968; -FEAT_EPIC_CLERIC = 969; -FEAT_EPIC_DRUID = 970; -FEAT_EPIC_MONK = 971; -FEAT_EPIC_PALADIN = 972; -FEAT_EPIC_RANGER = 973; -FEAT_EPIC_ROGUE = 974; -FEAT_EPIC_SORCERER = 975; -FEAT_EPIC_WIZARD = 976; -FEAT_EPIC_ARCANE_ARCHER = 977; -FEAT_EPIC_ASSASSIN = 978; -FEAT_EPIC_BLACKGUARD = 979; -FEAT_EPIC_SHADOWDANCER = 980; -FEAT_EPIC_HARPER_SCOUT = 981; -FEAT_EPIC_DIVINE_CHAMPION = 982; -FEAT_EPIC_WEAPON_MASTER = 983; -FEAT_EPIC_PALE_MASTER = 984; -FEAT_EPIC_DWARVEN_DEFENDER = 985; -FEAT_EPIC_SHIFTER = 986; -FEAT_EPIC_RED_DRAGON_DISC = 987; -FEAT_EPIC_THUNDERING_RAGE = 988; -FEAT_EPIC_TERRIFYING_RAGE = 989; -FEAT_EPIC_SPELL_EPIC_WARDING = 990; -FEAT_WEAPON_FOCUS_WHIP = 993; -FEAT_WEAPON_SPECIALIZATION_WHIP = 994; -FEAT_IMPROVED_CRITICAL_WHIP = 995; -FEAT_EPIC_DEVASTATING_CRITICAL_WHIP = 996; -FEAT_EPIC_WEAPON_FOCUS_WHIP = 997; -FEAT_EPIC_WEAPON_SPECIALIZATION_WHIP = 998; -FEAT_EPIC_OVERWHELMING_CRITICAL_WHIP = 999; -FEAT_WEAPON_OF_CHOICE_WHIP = 1000; -FEAT_EPIC_CHARACTER = 1001; -FEAT_EPIC_EPIC_SHADOWLORD = 1002; -FEAT_EPIC_EPIC_FIEND = 1003; -FEAT_PRESTIGE_DEATH_ATTACK_6 = 1004; -FEAT_PRESTIGE_DEATH_ATTACK_7 = 1005; -FEAT_PRESTIGE_DEATH_ATTACK_8 = 1006; -FEAT_BLACKGUARD_SNEAK_ATTACK_4D6 = 1007; -FEAT_BLACKGUARD_SNEAK_ATTACK_5D6 = 1008; -FEAT_BLACKGUARD_SNEAK_ATTACK_6D6 = 1009; -FEAT_BLACKGUARD_SNEAK_ATTACK_7D6 = 1010; -FEAT_BLACKGUARD_SNEAK_ATTACK_8D6 = 1011; -FEAT_BLACKGUARD_SNEAK_ATTACK_9D6 = 1012; -FEAT_BLACKGUARD_SNEAK_ATTACK_10D6 = 1013; -FEAT_BLACKGUARD_SNEAK_ATTACK_11D6 = 1014; -FEAT_BLACKGUARD_SNEAK_ATTACK_12D6 = 1015; -FEAT_BLACKGUARD_SNEAK_ATTACK_13D6 = 1016; -FEAT_BLACKGUARD_SNEAK_ATTACK_14D6 = 1017; -FEAT_BLACKGUARD_SNEAK_ATTACK_15D6 = 1018; -FEAT_PRESTIGE_DEATH_ATTACK_9 = 1019; -FEAT_PRESTIGE_DEATH_ATTACK_10 = 1020; -FEAT_PRESTIGE_DEATH_ATTACK_11 = 1021; -FEAT_PRESTIGE_DEATH_ATTACK_12 = 1022; -FEAT_PRESTIGE_DEATH_ATTACK_13 = 1023; -FEAT_PRESTIGE_DEATH_ATTACK_14 = 1024; -FEAT_PRESTIGE_DEATH_ATTACK_15 = 1025; -FEAT_PRESTIGE_DEATH_ATTACK_16 = 1026; -FEAT_PRESTIGE_DEATH_ATTACK_17 = 1027; -FEAT_PRESTIGE_DEATH_ATTACK_18 = 1028; -FEAT_PRESTIGE_DEATH_ATTACK_19 = 1029; -FEAT_PRESTIGE_DEATH_ATTACK_20 = 1030; -FEAT_SHOU_DISCIPLE_DODGE_3 = 1031; -FEAT_DRAGON_HDINCREASE_D6 = 1042; -FEAT_DRAGON_HDINCREASE_D8 = 1043; -FEAT_DRAGON_HDINCREASE_D10 = 1044; -FEAT_PRESTIGE_ENCHANT_ARROW_6 = 1045; -FEAT_PRESTIGE_ENCHANT_ARROW_7 = 1046; -FEAT_PRESTIGE_ENCHANT_ARROW_8 = 1047; -FEAT_PRESTIGE_ENCHANT_ARROW_9 = 1048; -FEAT_PRESTIGE_ENCHANT_ARROW_10 = 1049; -FEAT_PRESTIGE_ENCHANT_ARROW_11 = 1050; -FEAT_PRESTIGE_ENCHANT_ARROW_12 = 1051; -FEAT_PRESTIGE_ENCHANT_ARROW_13 = 1052; -FEAT_PRESTIGE_ENCHANT_ARROW_14 = 1053; -FEAT_PRESTIGE_ENCHANT_ARROW_15 = 1054; -FEAT_PRESTIGE_ENCHANT_ARROW_16 = 1055; -FEAT_PRESTIGE_ENCHANT_ARROW_17 = 1056; -FEAT_PRESTIGE_ENCHANT_ARROW_18 = 1057; -FEAT_PRESTIGE_ENCHANT_ARROW_19 = 1058; -FEAT_PRESTIGE_ENCHANT_ARROW_20 = 1059; -FEAT_EPIC_OUTSIDER_SHAPE = 1060; -FEAT_EPIC_CONSTRUCT_SHAPE = 1061; -FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_1 = 1062; -FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_2 = 1063; -FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_3 = 1064; -FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_4 = 1065; -FEAT_EPIC_SHIFTER_INFINITE_HUMANOID_SHAPE = 1066; -FEAT_EPIC_BARBARIAN_DAMAGE_REDUCTION = 1067; -FEAT_EPIC_DRUID_INFINITE_WILDSHAPE = 1068; -FEAT_EPIC_DRUID_INFINITE_ELEMENTAL_SHAPE = 1069; -FEAT_PRESTIGE_POISON_SAVE_EPIC = 1070; -FEAT_EPIC_SUPERIOR_WEAPON_FOCUS = 1071; -FEAT_WEAPON_FOCUS_TRIDENT = 1072; -FEAT_WEAPON_SPECIALIZATION_TRIDENT = 1073; -FEAT_IMPROVED_CRITICAL_TRIDENT = 1074; -FEAT_EPIC_DEVASTATING_CRITICAL_TRIDENT = 1075; -FEAT_EPIC_WEAPON_FOCUS_TRIDENT = 1076; -FEAT_EPIC_WEAPON_SPECIALIZATION_TRIDENT = 1077; -FEAT_EPIC_OVERWHELMING_CRITICAL_TRIDENT = 1078; -FEAT_WEAPON_OF_CHOICE_TRIDENT = 1079; -FEAT_PDK_RALLY = 1080; -FEAT_PDK_SHIELD = 1081; -FEAT_PDK_FEAR = 1082; -FEAT_PDK_WRATH = 1083; -FEAT_PDK_STAND = 1084; -FEAT_PDK_INSPIRE_1 = 1085; -FEAT_PDK_INSPIRE_2 = 1086; -FEAT_MOUNTED_COMBAT = 1087; -FEAT_MOUNTED_ARCHERY = 1088; -FEAT_HORSE_MENU = 1089; -FEAT_HORSE_MOUNT = 1090; -FEAT_HORSE_DISMOUNT = 1091; -FEAT_HORSE_PARTY_MOUNT = 1092; -FEAT_HORSE_PARTY_DISMOUNT = 1093; -FEAT_HORSE_ASSIGN_MOUNT = 1094; -FEAT_PALADIN_SUMMON_MOUNT = 1095; -FEAT_PLAYER_TOOL_01 = 1106; -FEAT_PLAYER_TOOL_02 = 1107; -FEAT_PLAYER_TOOL_03 = 1108; -FEAT_PLAYER_TOOL_04 = 1109; -FEAT_PLAYER_TOOL_05 = 1110; -FEAT_PLAYER_TOOL_06 = 1111; -FEAT_PLAYER_TOOL_07 = 1112; -FEAT_PLAYER_TOOL_08 = 1113; -FEAT_PLAYER_TOOL_09 = 1114; -FEAT_PLAYER_TOOL_10 = 1115; --- Special Attack Defines -SPECIAL_ATTACK_INVALID = 0; -SPECIAL_ATTACK_CALLED_SHOT_LEG = 1; -SPECIAL_ATTACK_CALLED_SHOT_ARM = 2; -SPECIAL_ATTACK_SAP = 3; -SPECIAL_ATTACK_DISARM = 4; -SPECIAL_ATTACK_IMPROVED_DISARM = 5; -SPECIAL_ATTACK_KNOCKDOWN = 6; -SPECIAL_ATTACK_IMPROVED_KNOCKDOWN = 7; -SPECIAL_ATTACK_STUNNING_FIST = 8; -SPECIAL_ATTACK_FLURRY_OF_BLOWS = 9; -SPECIAL_ATTACK_RAPID_SHOT = 10; --- Combat Mode Defines -COMBAT_MODE_INVALID = 0; -COMBAT_MODE_PARRY = 1; -COMBAT_MODE_POWER_ATTACK = 2; -COMBAT_MODE_IMPROVED_POWER_ATTACK = 3; -COMBAT_MODE_FLURRY_OF_BLOWS = 4; -COMBAT_MODE_RAPID_SHOT = 5; -COMBAT_MODE_EXPERTISE = 6; -COMBAT_MODE_IMPROVED_EXPERTISE = 7; -COMBAT_MODE_DEFENSIVE_CASTING = 8; -COMBAT_MODE_DIRTY_FIGHTING = 9; -COMBAT_MODE_DEFENSIVE_STANCE = 10; --- These represent the row in the difficulty 2da, rather than --- a difficulty value. -ENCOUNTER_DIFFICULTY_VERY_EASY = 0; -ENCOUNTER_DIFFICULTY_EASY = 1; -ENCOUNTER_DIFFICULTY_NORMAL = 2; -ENCOUNTER_DIFFICULTY_HARD = 3; -ENCOUNTER_DIFFICULTY_IMPOSSIBLE = 4; --- Looping animation constants. -ANIMATION_LOOPING_PAUSE = 0; -ANIMATION_LOOPING_PAUSE2 = 1; -ANIMATION_LOOPING_LISTEN = 2; -ANIMATION_LOOPING_MEDITATE = 3; -ANIMATION_LOOPING_WORSHIP = 4; -ANIMATION_LOOPING_LOOK_FAR = 5; -ANIMATION_LOOPING_SIT_CHAIR = 6; -ANIMATION_LOOPING_SIT_CROSS = 7; -ANIMATION_LOOPING_TALK_NORMAL = 8; -ANIMATION_LOOPING_TALK_PLEADING = 9; -ANIMATION_LOOPING_TALK_FORCEFUL = 10; -ANIMATION_LOOPING_TALK_LAUGHING = 11; -ANIMATION_LOOPING_GET_LOW = 12; -ANIMATION_LOOPING_GET_MID = 13; -ANIMATION_LOOPING_PAUSE_TIRED = 14; -ANIMATION_LOOPING_PAUSE_DRUNK = 15; -ANIMATION_LOOPING_DEAD_FRONT = 16; -ANIMATION_LOOPING_DEAD_BACK = 17; -ANIMATION_LOOPING_CONJURE1 = 18; -ANIMATION_LOOPING_CONJURE2 = 19; -ANIMATION_LOOPING_SPASM = 20; -ANIMATION_LOOPING_CUSTOM1 = 21; -ANIMATION_LOOPING_CUSTOM2 = 22; -ANIMATION_LOOPING_CUSTOM3 = 23; -ANIMATION_LOOPING_CUSTOM4 = 24; -ANIMATION_LOOPING_CUSTOM5 = 25; -ANIMATION_LOOPING_CUSTOM6 = 26; -ANIMATION_LOOPING_CUSTOM7 = 27; -ANIMATION_LOOPING_CUSTOM8 = 28; -ANIMATION_LOOPING_CUSTOM9 = 29; -ANIMATION_LOOPING_CUSTOM10 = 30; -ANIMATION_LOOPING_CUSTOM11 = 31; -ANIMATION_LOOPING_CUSTOM12 = 32; -ANIMATION_LOOPING_CUSTOM13 = 33; -ANIMATION_LOOPING_CUSTOM14 = 34; -ANIMATION_LOOPING_CUSTOM15 = 35; -ANIMATION_LOOPING_CUSTOM16 = 36; -ANIMATION_LOOPING_CUSTOM17 = 37; -ANIMATION_LOOPING_CUSTOM18 = 38; -ANIMATION_LOOPING_CUSTOM19 = 39; -ANIMATION_LOOPING_CUSTOM20 = 40; -ANIMATION_MOUNT1 = 41; -ANIMATION_DISMOUNT1 = 42; --- Fire and forget animation constants. -ANIMATION_FIREFORGET_HEAD_TURN_LEFT = 100; -ANIMATION_FIREFORGET_HEAD_TURN_RIGHT = 101; -ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD = 102; -ANIMATION_FIREFORGET_PAUSE_BORED = 103; -ANIMATION_FIREFORGET_SALUTE = 104; -ANIMATION_FIREFORGET_BOW = 105; -ANIMATION_FIREFORGET_STEAL = 106; -ANIMATION_FIREFORGET_GREETING = 107; -ANIMATION_FIREFORGET_TAUNT = 108; -ANIMATION_FIREFORGET_VICTORY1 = 109; -ANIMATION_FIREFORGET_VICTORY2 = 110; -ANIMATION_FIREFORGET_VICTORY3 = 111; -ANIMATION_FIREFORGET_READ = 112; -ANIMATION_FIREFORGET_DRINK = 113; -ANIMATION_FIREFORGET_DODGE_SIDE = 114; -ANIMATION_FIREFORGET_DODGE_DUCK = 115; -ANIMATION_FIREFORGET_SPASM = 116; --- Placeable animation constants -ANIMATION_PLACEABLE_ACTIVATE = 200; -ANIMATION_PLACEABLE_DEACTIVATE = 201; -ANIMATION_PLACEABLE_OPEN = 202; -ANIMATION_PLACEABLE_CLOSE = 203; --- Door animation constants -ANIMATION_DOOR_CLOSE = 204; -ANIMATION_DOOR_OPEN1 = 205; -ANIMATION_DOOR_OPEN2 = 206; -ANIMATION_DOOR_DESTROY = 207; -TALENT_TYPE_SPELL = 0; -TALENT_TYPE_FEAT = 1; -TALENT_TYPE_SKILL = 2; --- These must match the values in nwscreature.h and nwccreaturemenu.cpp --- Cannot use the value -1 because that is used to start a conversation -ASSOCIATE_COMMAND_STANDGROUND = -2; -ASSOCIATE_COMMAND_ATTACKNEAREST = -3; -ASSOCIATE_COMMAND_HEALMASTER = -4; -ASSOCIATE_COMMAND_FOLLOWMASTER = -5; -ASSOCIATE_COMMAND_MASTERFAILEDLOCKPICK = -6; -ASSOCIATE_COMMAND_GUARDMASTER = -7; -ASSOCIATE_COMMAND_UNSUMMONFAMILIAR = -8; -ASSOCIATE_COMMAND_UNSUMMONANIMALCOMPANION = -9; -ASSOCIATE_COMMAND_UNSUMMONSUMMONED = -10; -ASSOCIATE_COMMAND_MASTERUNDERATTACK = -11; -ASSOCIATE_COMMAND_RELEASEDOMINATION = -12; -ASSOCIATE_COMMAND_UNPOSSESSFAMILIAR = -13; -ASSOCIATE_COMMAND_MASTERSAWTRAP = -14; -ASSOCIATE_COMMAND_MASTERATTACKEDOTHER = -15; -ASSOCIATE_COMMAND_MASTERGOINGTOBEATTACKED = -16; -ASSOCIATE_COMMAND_LEAVEPARTY = -17; -ASSOCIATE_COMMAND_PICKLOCK = -18; -ASSOCIATE_COMMAND_INVENTORY = -19; -ASSOCIATE_COMMAND_DISARMTRAP = -20; -ASSOCIATE_COMMAND_TOGGLECASTING = -21; -ASSOCIATE_COMMAND_TOGGLESTEALTH = -22; -ASSOCIATE_COMMAND_TOGGLESEARCH = -23; --- These match the values in nwscreature.h -ASSOCIATE_TYPE_NONE = 0; -ASSOCIATE_TYPE_HENCHMAN = 1; -ASSOCIATE_TYPE_ANIMALCOMPANION = 2; -ASSOCIATE_TYPE_FAMILIAR = 3; -ASSOCIATE_TYPE_SUMMONED = 4; -ASSOCIATE_TYPE_DOMINATED = 5; --- These must match the list in nwscreaturestats.cpp -TALENT_CATEGORY_HARMFUL_AREAEFFECT_DISCRIMINANT = 1; -TALENT_CATEGORY_HARMFUL_RANGED = 2; -TALENT_CATEGORY_HARMFUL_TOUCH = 3; -TALENT_CATEGORY_BENEFICIAL_HEALING_AREAEFFECT = 4; -TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH = 5; -TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_AREAEFFECT = 6; -TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_SINGLE = 7; -TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT = 8; -TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SINGLE = 9; -TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SELF = 10; -TALENT_CATEGORY_HARMFUL_AREAEFFECT_INDISCRIMINANT = 11; -TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF = 12; -TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE = 13; -TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT = 14; -TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES = 15; -TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT = 16; -TALENT_CATEGORY_BENEFICIAL_HEALING_POTION = 17; -TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_POTION = 18; -TALENT_CATEGORY_DRAGONS_BREATH = 19; -TALENT_CATEGORY_BENEFICIAL_PROTECTION_POTION = 20; -TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_POTION = 21; -TALENT_CATEGORY_HARMFUL_MELEE = 22; -INVENTORY_DISTURB_TYPE_ADDED = 0; -INVENTORY_DISTURB_TYPE_REMOVED = 1; -INVENTORY_DISTURB_TYPE_STOLEN = 2; -GUI_PANEL_PLAYER_DEATH = 0; -VOICE_CHAT_ATTACK = 0; -VOICE_CHAT_BATTLECRY1 = 1; -VOICE_CHAT_BATTLECRY2 = 2; -VOICE_CHAT_BATTLECRY3 = 3; -VOICE_CHAT_HEALME = 4; -VOICE_CHAT_HELP = 5; -VOICE_CHAT_ENEMIES = 6; -VOICE_CHAT_FLEE = 7; -VOICE_CHAT_TAUNT = 8; -VOICE_CHAT_GUARDME = 9; -VOICE_CHAT_HOLD = 10; -VOICE_CHAT_GATTACK1 = 11; -VOICE_CHAT_GATTACK2 = 12; -VOICE_CHAT_GATTACK3 = 13; -VOICE_CHAT_PAIN1 = 14; -VOICE_CHAT_PAIN2 = 15; -VOICE_CHAT_PAIN3 = 16; -VOICE_CHAT_NEARDEATH = 17; -VOICE_CHAT_DEATH = 18; -VOICE_CHAT_POISONED = 19; -VOICE_CHAT_SPELLFAILED = 20; -VOICE_CHAT_WEAPONSUCKS = 21; -VOICE_CHAT_FOLLOWME = 22; -VOICE_CHAT_LOOKHERE = 23; -VOICE_CHAT_GROUP = 24; -VOICE_CHAT_MOVEOVER = 25; -VOICE_CHAT_PICKLOCK = 26; -VOICE_CHAT_SEARCH = 27; -VOICE_CHAT_HIDE = 28; -VOICE_CHAT_CANDO = 29; -VOICE_CHAT_CANTDO = 30; -VOICE_CHAT_TASKCOMPLETE = 31; -VOICE_CHAT_ENCUMBERED = 32; -VOICE_CHAT_SELECTED = 33; -VOICE_CHAT_HELLO = 34; -VOICE_CHAT_YES = 35; -VOICE_CHAT_NO = 36; -VOICE_CHAT_STOP = 37; -VOICE_CHAT_REST = 38; -VOICE_CHAT_BORED = 39; -VOICE_CHAT_GOODBYE = 40; -VOICE_CHAT_THANKS = 41; -VOICE_CHAT_LAUGH = 42; -VOICE_CHAT_CUSS = 43; -VOICE_CHAT_CHEER = 44; -VOICE_CHAT_TALKTOME = 45; -VOICE_CHAT_GOODIDEA = 46; -VOICE_CHAT_BADIDEA = 47; -VOICE_CHAT_THREATEN = 48; -POLYMORPH_TYPE_WEREWOLF = 0; -POLYMORPH_TYPE_WERERAT = 1; -POLYMORPH_TYPE_WERECAT = 2; -POLYMORPH_TYPE_GIANT_SPIDER = 3; -POLYMORPH_TYPE_TROLL = 4; -POLYMORPH_TYPE_UMBER_HULK = 5; -POLYMORPH_TYPE_PIXIE = 6; -POLYMORPH_TYPE_ZOMBIE = 7; -POLYMORPH_TYPE_RED_DRAGON = 8; -POLYMORPH_TYPE_FIRE_GIANT = 9; -POLYMORPH_TYPE_BALOR = 10; -POLYMORPH_TYPE_DEATH_SLAAD = 11; -POLYMORPH_TYPE_IRON_GOLEM = 12; -POLYMORPH_TYPE_HUGE_FIRE_ELEMENTAL = 13; -POLYMORPH_TYPE_HUGE_WATER_ELEMENTAL = 14; -POLYMORPH_TYPE_HUGE_EARTH_ELEMENTAL = 15; -POLYMORPH_TYPE_HUGE_AIR_ELEMENTAL = 16; -POLYMORPH_TYPE_ELDER_FIRE_ELEMENTAL = 17; -POLYMORPH_TYPE_ELDER_WATER_ELEMENTAL = 18; -POLYMORPH_TYPE_ELDER_EARTH_ELEMENTAL = 19; -POLYMORPH_TYPE_ELDER_AIR_ELEMENTAL = 20; -POLYMORPH_TYPE_BROWN_BEAR = 21; -POLYMORPH_TYPE_PANTHER = 22; -POLYMORPH_TYPE_WOLF = 23; -POLYMORPH_TYPE_BOAR = 24; -POLYMORPH_TYPE_BADGER = 25; -POLYMORPH_TYPE_PENGUIN = 26; -POLYMORPH_TYPE_COW = 27; -POLYMORPH_TYPE_DOOM_KNIGHT = 28; -POLYMORPH_TYPE_YUANTI = 29; -POLYMORPH_TYPE_IMP = 30; -POLYMORPH_TYPE_QUASIT = 31; -POLYMORPH_TYPE_SUCCUBUS = 32; -POLYMORPH_TYPE_DIRE_BROWN_BEAR = 33; -POLYMORPH_TYPE_DIRE_PANTHER = 34; -POLYMORPH_TYPE_DIRE_WOLF = 35; -POLYMORPH_TYPE_DIRE_BOAR = 36; -POLYMORPH_TYPE_DIRE_BADGER = 37; -POLYMORPH_TYPE_CELESTIAL_AVENGER = 38; -POLYMORPH_TYPE_VROCK = 39; -POLYMORPH_TYPE_CHICKEN = 40; -POLYMORPH_TYPE_FROST_GIANT_MALE = 41; -POLYMORPH_TYPE_FROST_GIANT_FEMALE = 42; -POLYMORPH_TYPE_HEURODIS = 43; -POLYMORPH_TYPE_JNAH_GIANT_MALE = 44; -POLYMORPH_TYPE_JNAH_GIANT_FEMAL = 45; -POLYMORPH_TYPE_WYRMLING_WHITE = 52; -POLYMORPH_TYPE_WYRMLING_BLUE = 53; -POLYMORPH_TYPE_WYRMLING_RED = 54; -POLYMORPH_TYPE_WYRMLING_GREEN = 55; -POLYMORPH_TYPE_WYRMLING_BLACK = 56; -POLYMORPH_TYPE_GOLEM_AUTOMATON = 57; -POLYMORPH_TYPE_MANTICORE = 58; -POLYMORPH_TYPE_MALE_DROW = 59; -POLYMORPH_TYPE_HARPY = 60; -POLYMORPH_TYPE_BASILISK = 61; -POLYMORPH_TYPE_DRIDER = 62; -POLYMORPH_TYPE_BEHOLDER = 63; -POLYMORPH_TYPE_MEDUSA = 64; -POLYMORPH_TYPE_GARGOYLE = 65; -POLYMORPH_TYPE_MINOTAUR = 66; -POLYMORPH_TYPE_SUPER_CHICKEN = 67; -POLYMORPH_TYPE_MINDFLAYER = 68; -POLYMORPH_TYPE_DIRETIGER = 69; -POLYMORPH_TYPE_FEMALE_DROW = 70; -POLYMORPH_TYPE_ANCIENT_BLUE_DRAGON = 71; -POLYMORPH_TYPE_ANCIENT_RED_DRAGON = 72; -POLYMORPH_TYPE_ANCIENT_GREEN_DRAGON = 73; -POLYMORPH_TYPE_VAMPIRE_MALE = 74; -POLYMORPH_TYPE_RISEN_LORD = 75; -POLYMORPH_TYPE_SPECTRE = 76; -POLYMORPH_TYPE_VAMPIRE_FEMALE = 77; -POLYMORPH_TYPE_NULL_HUMAN = 78; -INVISIBILITY_TYPE_NORMAL = 1; -INVISIBILITY_TYPE_DARKNESS = 2; -INVISIBILITY_TYPE_IMPROVED = 4; -CREATURE_SIZE_INVALID = 0; -CREATURE_SIZE_TINY = 1; -CREATURE_SIZE_SMALL = 2; -CREATURE_SIZE_MEDIUM = 3; -CREATURE_SIZE_LARGE = 4; -CREATURE_SIZE_HUGE = 5; -SPELL_SCHOOL_GENERAL = 0; -SPELL_SCHOOL_ABJURATION = 1; -SPELL_SCHOOL_CONJURATION = 2; -SPELL_SCHOOL_DIVINATION = 3; -SPELL_SCHOOL_ENCHANTMENT = 4; -SPELL_SCHOOL_EVOCATION = 5; -SPELL_SCHOOL_ILLUSION = 6; -SPELL_SCHOOL_NECROMANCY = 7; -SPELL_SCHOOL_TRANSMUTATION = 8; -ANIMAL_COMPANION_CREATURE_TYPE_BADGER = 0; -ANIMAL_COMPANION_CREATURE_TYPE_WOLF = 1; -ANIMAL_COMPANION_CREATURE_TYPE_BEAR = 2; -ANIMAL_COMPANION_CREATURE_TYPE_BOAR = 3; -ANIMAL_COMPANION_CREATURE_TYPE_HAWK = 4; -ANIMAL_COMPANION_CREATURE_TYPE_PANTHER = 5; -ANIMAL_COMPANION_CREATURE_TYPE_SPIDER = 6; -ANIMAL_COMPANION_CREATURE_TYPE_DIREWOLF = 7; -ANIMAL_COMPANION_CREATURE_TYPE_DIRERAT = 8; -ANIMAL_COMPANION_CREATURE_TYPE_NONE = 255; -FAMILIAR_CREATURE_TYPE_BAT = 0; -FAMILIAR_CREATURE_TYPE_CRAGCAT = 1; -FAMILIAR_CREATURE_TYPE_HELLHOUND = 2; -FAMILIAR_CREATURE_TYPE_IMP = 3; -FAMILIAR_CREATURE_TYPE_FIREMEPHIT = 4; -FAMILIAR_CREATURE_TYPE_ICEMEPHIT = 5; -FAMILIAR_CREATURE_TYPE_PIXIE = 6; -FAMILIAR_CREATURE_TYPE_RAVEN = 7; -FAMILIAR_CREATURE_TYPE_FAIRY_DRAGON = 8; -FAMILIAR_CREATURE_TYPE_PSEUDO_DRAGON = 9; -FAMILIAR_CREATURE_TYPE_EYEBALL = 10; -FAMILIAR_CREATURE_TYPE_NONE = 255; -CAMERA_MODE_CHASE_CAMERA = 0; -CAMERA_MODE_TOP_DOWN = 1; -CAMERA_MODE_STIFF_CHASE_CAMERA = 2; -WEATHER_INVALID = -1; -WEATHER_CLEAR = 0; -WEATHER_RAIN = 1; -WEATHER_SNOW = 2; -WEATHER_USE_AREA_SETTINGS = -1; -REST_EVENTTYPE_REST_INVALID = 0; -REST_EVENTTYPE_REST_STARTED = 1; -REST_EVENTTYPE_REST_FINISHED = 2; -REST_EVENTTYPE_REST_CANCELLED = 3; -PROJECTILE_PATH_TYPE_DEFAULT = 0; -PROJECTILE_PATH_TYPE_HOMING = 1; -PROJECTILE_PATH_TYPE_BALLISTIC = 2; -PROJECTILE_PATH_TYPE_HIGH_BALLISTIC = 3; -PROJECTILE_PATH_TYPE_ACCELERATING = 4; -GAME_DIFFICULTY_VERY_EASY = 0; -GAME_DIFFICULTY_EASY = 1; -GAME_DIFFICULTY_NORMAL = 2; -GAME_DIFFICULTY_CORE_RULES = 3; -GAME_DIFFICULTY_DIFFICULT = 4; -TILE_MAIN_LIGHT_COLOR_BLACK = 0; -TILE_MAIN_LIGHT_COLOR_DIM_WHITE = 1; -TILE_MAIN_LIGHT_COLOR_WHITE = 2; -TILE_MAIN_LIGHT_COLOR_BRIGHT_WHITE = 3; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_YELLOW = 4; -TILE_MAIN_LIGHT_COLOR_DARK_YELLOW = 5; -TILE_MAIN_LIGHT_COLOR_PALE_YELLOW = 6; -TILE_MAIN_LIGHT_COLOR_YELLOW = 7; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_GREEN = 8; -TILE_MAIN_LIGHT_COLOR_DARK_GREEN = 9; -TILE_MAIN_LIGHT_COLOR_PALE_GREEN = 10; -TILE_MAIN_LIGHT_COLOR_GREEN = 11; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_AQUA = 12; -TILE_MAIN_LIGHT_COLOR_DARK_AQUA = 13; -TILE_MAIN_LIGHT_COLOR_PALE_AQUA = 14; -TILE_MAIN_LIGHT_COLOR_AQUA = 15; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_BLUE = 16; -TILE_MAIN_LIGHT_COLOR_DARK_BLUE = 17; -TILE_MAIN_LIGHT_COLOR_PALE_BLUE = 18; -TILE_MAIN_LIGHT_COLOR_BLUE = 19; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_PURPLE = 20; -TILE_MAIN_LIGHT_COLOR_DARK_PURPLE = 21; -TILE_MAIN_LIGHT_COLOR_PALE_PURPLE = 22; -TILE_MAIN_LIGHT_COLOR_PURPLE = 23; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_RED = 24; -TILE_MAIN_LIGHT_COLOR_DARK_RED = 25; -TILE_MAIN_LIGHT_COLOR_PALE_RED = 26; -TILE_MAIN_LIGHT_COLOR_RED = 27; -TILE_MAIN_LIGHT_COLOR_PALE_DARK_ORANGE = 28; -TILE_MAIN_LIGHT_COLOR_DARK_ORANGE = 29; -TILE_MAIN_LIGHT_COLOR_PALE_ORANGE = 30; -TILE_MAIN_LIGHT_COLOR_ORANGE = 31; -TILE_SOURCE_LIGHT_COLOR_BLACK = 0; -TILE_SOURCE_LIGHT_COLOR_WHITE = 1; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_YELLOW = 2; -TILE_SOURCE_LIGHT_COLOR_PALE_YELLOW = 3; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_GREEN = 4; -TILE_SOURCE_LIGHT_COLOR_PALE_GREEN = 5; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_AQUA = 6; -TILE_SOURCE_LIGHT_COLOR_PALE_AQUA = 7; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_BLUE = 8; -TILE_SOURCE_LIGHT_COLOR_PALE_BLUE = 9; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_PURPLE = 10; -TILE_SOURCE_LIGHT_COLOR_PALE_PURPLE = 11; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_RED = 12; -TILE_SOURCE_LIGHT_COLOR_PALE_RED = 13; -TILE_SOURCE_LIGHT_COLOR_PALE_DARK_ORANGE = 14; -TILE_SOURCE_LIGHT_COLOR_PALE_ORANGE = 15; -PANEL_BUTTON_MAP = 0; -PANEL_BUTTON_INVENTORY = 1; -PANEL_BUTTON_JOURNAL = 2; -PANEL_BUTTON_CHARACTER = 3; -PANEL_BUTTON_OPTIONS = 4; -PANEL_BUTTON_SPELLS = 5; -PANEL_BUTTON_REST = 6; -PANEL_BUTTON_PLAYER_VERSUS_PLAYER = 7; -ACTION_MOVETOPOINT = 0; -ACTION_PICKUPITEM = 1; -ACTION_DROPITEM = 2; -ACTION_ATTACKOBJECT = 3; -ACTION_CASTSPELL = 4; -ACTION_OPENDOOR = 5; -ACTION_CLOSEDOOR = 6; -ACTION_DIALOGOBJECT = 7; -ACTION_DISABLETRAP = 8; -ACTION_RECOVERTRAP = 9; -ACTION_FLAGTRAP = 10; -ACTION_EXAMINETRAP = 11; -ACTION_SETTRAP = 12; -ACTION_OPENLOCK = 13; -ACTION_LOCK = 14; -ACTION_USEOBJECT = 15; -ACTION_ANIMALEMPATHY = 16; -ACTION_REST = 17; -ACTION_TAUNT = 18; -ACTION_ITEMCASTSPELL = 19; -ACTION_COUNTERSPELL = 31; -ACTION_HEAL = 33; -ACTION_PICKPOCKET = 34; -ACTION_FOLLOW = 35; -ACTION_WAIT = 36; -ACTION_SIT = 37; -ACTION_SMITEGOOD = 40; -ACTION_KIDAMAGE = 41; -ACTION_RANDOMWALK = 43; -ACTION_INVALID = 65535; -TRAP_BASE_TYPE_MINOR_SPIKE = 0; -TRAP_BASE_TYPE_AVERAGE_SPIKE = 1; -TRAP_BASE_TYPE_STRONG_SPIKE = 2; -TRAP_BASE_TYPE_DEADLY_SPIKE = 3; -TRAP_BASE_TYPE_MINOR_HOLY = 4; -TRAP_BASE_TYPE_AVERAGE_HOLY = 5; -TRAP_BASE_TYPE_STRONG_HOLY = 6; -TRAP_BASE_TYPE_DEADLY_HOLY = 7; -TRAP_BASE_TYPE_MINOR_TANGLE = 8; -TRAP_BASE_TYPE_AVERAGE_TANGLE = 9; -TRAP_BASE_TYPE_STRONG_TANGLE = 10; -TRAP_BASE_TYPE_DEADLY_TANGLE = 11; -TRAP_BASE_TYPE_MINOR_ACID = 12; -TRAP_BASE_TYPE_AVERAGE_ACID = 13; -TRAP_BASE_TYPE_STRONG_ACID = 14; -TRAP_BASE_TYPE_DEADLY_ACID = 15; -TRAP_BASE_TYPE_MINOR_FIRE = 16; -TRAP_BASE_TYPE_AVERAGE_FIRE = 17; -TRAP_BASE_TYPE_STRONG_FIRE = 18; -TRAP_BASE_TYPE_DEADLY_FIRE = 19; -TRAP_BASE_TYPE_MINOR_ELECTRICAL = 20; -TRAP_BASE_TYPE_AVERAGE_ELECTRICAL = 21; -TRAP_BASE_TYPE_STRONG_ELECTRICAL = 22; -TRAP_BASE_TYPE_DEADLY_ELECTRICAL = 23; -TRAP_BASE_TYPE_MINOR_GAS = 24; -TRAP_BASE_TYPE_AVERAGE_GAS = 25; -TRAP_BASE_TYPE_STRONG_GAS = 26; -TRAP_BASE_TYPE_DEADLY_GAS = 27; -TRAP_BASE_TYPE_MINOR_FROST = 28; -TRAP_BASE_TYPE_AVERAGE_FROST = 29; -TRAP_BASE_TYPE_STRONG_FROST = 30; -TRAP_BASE_TYPE_DEADLY_FROST = 31; -TRAP_BASE_TYPE_MINOR_NEGATIVE = 32; -TRAP_BASE_TYPE_AVERAGE_NEGATIVE = 33; -TRAP_BASE_TYPE_STRONG_NEGATIVE = 34; -TRAP_BASE_TYPE_DEADLY_NEGATIVE = 35; -TRAP_BASE_TYPE_MINOR_SONIC = 36; -TRAP_BASE_TYPE_AVERAGE_SONIC = 37; -TRAP_BASE_TYPE_STRONG_SONIC = 38; -TRAP_BASE_TYPE_DEADLY_SONIC = 39; -TRAP_BASE_TYPE_MINOR_ACID_SPLASH = 40; -TRAP_BASE_TYPE_AVERAGE_ACID_SPLASH = 41; -TRAP_BASE_TYPE_STRONG_ACID_SPLASH = 42; -TRAP_BASE_TYPE_DEADLY_ACID_SPLASH = 43; -TRAP_BASE_TYPE_EPIC_ELECTRICAL = 44; -TRAP_BASE_TYPE_EPIC_FIRE = 45; -TRAP_BASE_TYPE_EPIC_FROST = 46; -TRAP_BASE_TYPE_EPIC_SONIC = 47; -TRACK_RURALDAY1 = 1; -TRACK_RURALDAY2 = 2; -TRACK_RURALNIGHT = 3; -TRACK_FORESTDAY1 = 4; -TRACK_FORESTDAY2 = 5; -TRACK_FORESTNIGHT = 6; -TRACK_DUNGEON1 = 7; -TRACK_SEWER = 8; -TRACK_MINES1 = 9; -TRACK_MINES2 = 10; -TRACK_CRYPT1 = 11; -TRACK_CRYPT2 = 12; -TRACK_DESERT_DAY = 58; -TRACK_DESERT_NIGHT = 61; -TRACK_WINTER_DAY = 59; -TRACK_EVILDUNGEON1 = 13; -TRACK_EVILDUNGEON2 = 14; -TRACK_CITYSLUMDAY = 15; -TRACK_CITYSLUMNIGHT = 16; -TRACK_CITYDOCKDAY = 17; -TRACK_CITYDOCKNIGHT = 18; -TRACK_CITYWEALTHY = 19; -TRACK_CITYMARKET = 20; -TRACK_CITYNIGHT = 21; -TRACK_TAVERN1 = 22; -TRACK_TAVERN2 = 23; -TRACK_TAVERN3 = 24; -TRACK_TAVERN4 = 56; -TRACK_RICHHOUSE = 25; -TRACK_STORE = 26; -TRACK_TEMPLEGOOD = 27; -TRACK_TEMPLEGOOD2 = 49; -TRACK_TEMPLEEVIL = 28; -TRACK_THEME_NWN = 29; -TRACK_THEME_CHAPTER1 = 30; -TRACK_THEME_CHAPTER2 = 31; -TRACK_THEME_CHAPTER3 = 32; -TRACK_THEME_CHAPTER4 = 33; -TRACK_BATTLE_RURAL1 = 34; -TRACK_BATTLE_FOREST1 = 35; -TRACK_BATTLE_FOREST2 = 36; -TRACK_BATTLE_DUNGEON1 = 37; -TRACK_BATTLE_DUNGEON2 = 38; -TRACK_BATTLE_DUNGEON3 = 39; -TRACK_BATTLE_CITY1 = 40; -TRACK_BATTLE_CITY2 = 41; -TRACK_BATTLE_CITY3 = 42; -TRACK_BATTLE_CITYBOSS = 43; -TRACK_BATTLE_FORESTBOSS = 44; -TRACK_BATTLE_LIZARDBOSS = 45; -TRACK_BATTLE_DRAGON = 46; -TRACK_BATTLE_ARIBETH = 47; -TRACK_BATTLE_ENDBOSS = 48; -TRACK_BATTLE_DESERT = 57; -TRACK_BATTLE_WINTER = 60; -TRACK_CASTLE = 50; -TRACK_THEME_ARIBETH1 = 51; -TRACK_THEME_ARIBETH2 = 52; -TRACK_THEME_GEND = 53; -TRACK_THEME_MAUGRIM = 54; -TRACK_THEME_MORAG = 55; -TRACK_HOTU_THEME = 62; -TRACK_HOTU_WATERDEEP = 63; -TRACK_HOTU_UNDERMOUNTAIN = 64; -TRACK_HOTU_REBELCAMP = 65; -TRACK_HOTU_FIREPLANE = 66; -TRACK_HOTU_QUEEN = 67; -TRACK_HOTU_HELLFROZEOVER = 68; -TRACK_HOTU_DRACOLICH = 69; -TRACK_HOTU_BATTLE_SMALL = 70; -TRACK_HOTU_BATTLE_MED = 71; -TRACK_HOTU_BATTLE_LARGE = 72; -TRACK_HOTU_BATTLE_HELL = 73; -TRACK_HOTU_BATTLE_BOSS1 = 74; -TRACK_HOTU_BATTLE_BOSS2 = 75; -STEALTH_MODE_DISABLED = 0; -STEALTH_MODE_ACTIVATED = 1; -DETECT_MODE_PASSIVE = 0; -DETECT_MODE_ACTIVE = 1; -DEFENSIVE_CASTING_MODE_DISABLED = 0; -DEFENSIVE_CASTING_MODE_ACTIVATED = 1; -APPEARANCE_TYPE_INVALID = -1; -APPEARANCE_TYPE_ALLIP = 186; -APPEARANCE_TYPE_ARANEA = 157; -APPEARANCE_TYPE_ARCH_TARGET = 200; -APPEARANCE_TYPE_ARIBETH = 190; -APPEARANCE_TYPE_ASABI_CHIEFTAIN = 353; -APPEARANCE_TYPE_ASABI_SHAMAN = 354; -APPEARANCE_TYPE_ASABI_WARRIOR = 355; -APPEARANCE_TYPE_BADGER = 8; -APPEARANCE_TYPE_BADGER_DIRE = 9; -APPEARANCE_TYPE_BALOR = 38; -APPEARANCE_TYPE_BARTENDER = 234; -APPEARANCE_TYPE_BASILISK = 369; -APPEARANCE_TYPE_BAT = 10; -APPEARANCE_TYPE_BAT_HORROR = 11; -APPEARANCE_TYPE_BEAR_BLACK = 12; -APPEARANCE_TYPE_BEAR_BROWN = 13; -APPEARANCE_TYPE_BEAR_DIRE = 15; -APPEARANCE_TYPE_BEAR_KODIAK = 204; -APPEARANCE_TYPE_BEAR_POLAR = 14; -APPEARANCE_TYPE_BEETLE_FIRE = 18; -APPEARANCE_TYPE_BEETLE_SLICER = 17; -APPEARANCE_TYPE_BEETLE_STAG = 19; -APPEARANCE_TYPE_BEETLE_STINK = 20; -APPEARANCE_TYPE_BEGGER = 220; -APPEARANCE_TYPE_BLOOD_SAILER = 221; -APPEARANCE_TYPE_BOAR = 21; -APPEARANCE_TYPE_BOAR_DIRE = 22; -APPEARANCE_TYPE_BODAK = 23; -APPEARANCE_TYPE_BUGBEAR_A = 29; -APPEARANCE_TYPE_BUGBEAR_B = 30; -APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_A = 25; -APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_B = 26; -APPEARANCE_TYPE_BUGBEAR_SHAMAN_A = 27; -APPEARANCE_TYPE_BUGBEAR_SHAMAN_B = 28; -APPEARANCE_TYPE_BULETTE = 481; -APPEARANCE_TYPE_CAT_CAT_DIRE = 95; -APPEARANCE_TYPE_CAT_COUGAR = 203; -APPEARANCE_TYPE_CAT_CRAG_CAT = 94; -APPEARANCE_TYPE_CAT_JAGUAR = 98; -APPEARANCE_TYPE_CAT_KRENSHAR = 96; -APPEARANCE_TYPE_CAT_LEOPARD = 93; -APPEARANCE_TYPE_CAT_LION = 97; -APPEARANCE_TYPE_CAT_MPANTHER = 306; -APPEARANCE_TYPE_CAT_PANTHER = 202; -APPEARANCE_TYPE_CHICKEN = 31; -APPEARANCE_TYPE_COCKATRICE = 368; -APPEARANCE_TYPE_COMBAT_DUMMY = 201; -APPEARANCE_TYPE_CONVICT = 238; -APPEARANCE_TYPE_COW = 34; -APPEARANCE_TYPE_CULT_MEMBER = 212; -APPEARANCE_TYPE_DEER = 35; -APPEARANCE_TYPE_DEER_STAG = 37; -APPEARANCE_TYPE_DEVIL = 392; -APPEARANCE_TYPE_DOG = 176; -APPEARANCE_TYPE_DOG_BLINKDOG = 174; -APPEARANCE_TYPE_DOG_DIRE_WOLF = 175; -APPEARANCE_TYPE_DOG_FENHOUND = 177; -APPEARANCE_TYPE_DOG_HELL_HOUND = 179; -APPEARANCE_TYPE_DOG_SHADOW_MASTIF = 180; -APPEARANCE_TYPE_DOG_WINTER_WOLF = 184; -APPEARANCE_TYPE_DOG_WOLF = 181; -APPEARANCE_TYPE_DOG_WORG = 185; -APPEARANCE_TYPE_DOOM_KNIGHT = 40; -APPEARANCE_TYPE_DRAGON_BLACK = 41; -APPEARANCE_TYPE_DRAGON_BLUE = 47; -APPEARANCE_TYPE_DRAGON_BRASS = 42; -APPEARANCE_TYPE_DRAGON_BRONZE = 45; -APPEARANCE_TYPE_DRAGON_COPPER = 43; -APPEARANCE_TYPE_DRAGON_GOLD = 46; -APPEARANCE_TYPE_DRAGON_GREEN = 48; -APPEARANCE_TYPE_DRAGON_RED = 49; -APPEARANCE_TYPE_DRAGON_SILVER = 44; -APPEARANCE_TYPE_DRAGON_WHITE = 50; -APPEARANCE_TYPE_DROW_CLERIC = 215; -APPEARANCE_TYPE_DROW_FIGHTER = 216; -APPEARANCE_TYPE_DRUEGAR_CLERIC = 218; -APPEARANCE_TYPE_DRUEGAR_FIGHTER = 217; -APPEARANCE_TYPE_DRYAD = 51; -APPEARANCE_TYPE_DWARF = 0; -APPEARANCE_TYPE_DWARF_NPC_FEMALE = 248; -APPEARANCE_TYPE_DWARF_NPC_MALE = 249; -APPEARANCE_TYPE_ELEMENTAL_AIR = 52; -APPEARANCE_TYPE_ELEMENTAL_AIR_ELDER = 53; -APPEARANCE_TYPE_ELEMENTAL_EARTH = 56; -APPEARANCE_TYPE_ELEMENTAL_EARTH_ELDER = 57; -APPEARANCE_TYPE_ELEMENTAL_FIRE = 60; -APPEARANCE_TYPE_ELEMENTAL_FIRE_ELDER = 61; -APPEARANCE_TYPE_ELEMENTAL_WATER = 69; -APPEARANCE_TYPE_ELEMENTAL_WATER_ELDER = 68; -APPEARANCE_TYPE_ELF = 1; -APPEARANCE_TYPE_ELF_NPC_FEMALE = 245; -APPEARANCE_TYPE_ELF_NPC_MALE_01 = 246; -APPEARANCE_TYPE_ELF_NPC_MALE_02 = 247; -APPEARANCE_TYPE_ETTERCAP = 166; -APPEARANCE_TYPE_ETTIN = 72; -APPEARANCE_TYPE_FAERIE_DRAGON = 374; -APPEARANCE_TYPE_FAIRY = 55; -APPEARANCE_TYPE_FALCON = 144; -APPEARANCE_TYPE_FEMALE_01 = 222; -APPEARANCE_TYPE_FEMALE_02 = 223; -APPEARANCE_TYPE_FEMALE_03 = 224; -APPEARANCE_TYPE_FEMALE_04 = 225; -APPEARANCE_TYPE_FORMIAN_MYRMARCH = 362; -APPEARANCE_TYPE_FORMIAN_QUEEN = 363; -APPEARANCE_TYPE_FORMIAN_WARRIOR = 361; -APPEARANCE_TYPE_FORMIAN_WORKER = 360; -APPEARANCE_TYPE_GARGOYLE = 73; -APPEARANCE_TYPE_GHAST = 74; -APPEARANCE_TYPE_GHOUL = 76; -APPEARANCE_TYPE_GHOUL_LORD = 77; -APPEARANCE_TYPE_GIANT_FIRE = 80; -APPEARANCE_TYPE_GIANT_FIRE_FEMALE = 351; -APPEARANCE_TYPE_GIANT_FROST = 81; -APPEARANCE_TYPE_GIANT_FROST_FEMALE = 350; -APPEARANCE_TYPE_GIANT_HILL = 78; -APPEARANCE_TYPE_GIANT_MOUNTAIN = 79; -APPEARANCE_TYPE_GNOLL_WARRIOR = 388; -APPEARANCE_TYPE_GNOLL_WIZ = 389; -APPEARANCE_TYPE_GNOME = 2; -APPEARANCE_TYPE_GNOME_NPC_FEMALE = 243; -APPEARANCE_TYPE_GNOME_NPC_MALE = 244; -APPEARANCE_TYPE_GOBLIN_A = 86; -APPEARANCE_TYPE_GOBLIN_B = 87; -APPEARANCE_TYPE_GOBLIN_CHIEF_A = 82; -APPEARANCE_TYPE_GOBLIN_CHIEF_B = 83; -APPEARANCE_TYPE_GOBLIN_SHAMAN_A = 84; -APPEARANCE_TYPE_GOBLIN_SHAMAN_B = 85; -APPEARANCE_TYPE_GOLEM_BONE = 24; -APPEARANCE_TYPE_GOLEM_CLAY = 91; -APPEARANCE_TYPE_GOLEM_FLESH = 88; -APPEARANCE_TYPE_GOLEM_IRON = 89; -APPEARANCE_TYPE_GOLEM_STONE = 92; -APPEARANCE_TYPE_GORGON = 367; -APPEARANCE_TYPE_GRAY_OOZE = 393; -APPEARANCE_TYPE_GREY_RENDER = 205; -APPEARANCE_TYPE_GYNOSPHINX = 365; -APPEARANCE_TYPE_HALFLING = 3; -APPEARANCE_TYPE_HALFLING_NPC_FEMALE = 250; -APPEARANCE_TYPE_HALFLING_NPC_MALE = 251; -APPEARANCE_TYPE_HALF_ELF = 4; -APPEARANCE_TYPE_HALF_ORC = 5; -APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE = 252; -APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01 = 253; -APPEARANCE_TYPE_HALF_ORC_NPC_MALE_02 = 254; -APPEARANCE_TYPE_HELMED_HORROR = 100; -APPEARANCE_TYPE_HEURODIS_LICH = 370; -APPEARANCE_TYPE_HOBGOBLIN_WARRIOR = 390; -APPEARANCE_TYPE_HOBGOBLIN_WIZARD = 391; -APPEARANCE_TYPE_HOOK_HORROR = 102; -APPEARANCE_TYPE_HOUSE_GUARD = 219; -APPEARANCE_TYPE_HUMAN = 6; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01 = 255; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02 = 256; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_03 = 257; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_04 = 258; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_05 = 259; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_06 = 260; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_07 = 261; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_08 = 262; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_09 = 263; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_10 = 264; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_11 = 265; -APPEARANCE_TYPE_HUMAN_NPC_FEMALE_12 = 266; -APPEARANCE_TYPE_HUMAN_NPC_MALE_01 = 267; -APPEARANCE_TYPE_HUMAN_NPC_MALE_02 = 268; -APPEARANCE_TYPE_HUMAN_NPC_MALE_03 = 269; -APPEARANCE_TYPE_HUMAN_NPC_MALE_04 = 270; -APPEARANCE_TYPE_HUMAN_NPC_MALE_05 = 271; -APPEARANCE_TYPE_HUMAN_NPC_MALE_06 = 272; -APPEARANCE_TYPE_HUMAN_NPC_MALE_07 = 273; -APPEARANCE_TYPE_HUMAN_NPC_MALE_08 = 274; -APPEARANCE_TYPE_HUMAN_NPC_MALE_09 = 275; -APPEARANCE_TYPE_HUMAN_NPC_MALE_10 = 276; -APPEARANCE_TYPE_HUMAN_NPC_MALE_11 = 277; -APPEARANCE_TYPE_HUMAN_NPC_MALE_12 = 278; -APPEARANCE_TYPE_HUMAN_NPC_MALE_13 = 279; -APPEARANCE_TYPE_HUMAN_NPC_MALE_14 = 280; -APPEARANCE_TYPE_HUMAN_NPC_MALE_15 = 281; -APPEARANCE_TYPE_HUMAN_NPC_MALE_16 = 282; -APPEARANCE_TYPE_HUMAN_NPC_MALE_17 = 283; -APPEARANCE_TYPE_HUMAN_NPC_MALE_18 = 284; -APPEARANCE_TYPE_IMP = 105; -APPEARANCE_TYPE_INN_KEEPER = 233; -APPEARANCE_TYPE_INTELLECT_DEVOURER = 117; -APPEARANCE_TYPE_INVISIBLE_HUMAN_MALE = 298; -APPEARANCE_TYPE_INVISIBLE_STALKER = 64; -APPEARANCE_TYPE_KID_FEMALE = 242; -APPEARANCE_TYPE_KID_MALE = 241; -APPEARANCE_TYPE_KOBOLD_A = 302; -APPEARANCE_TYPE_KOBOLD_B = 305; -APPEARANCE_TYPE_KOBOLD_CHIEF_A = 300; -APPEARANCE_TYPE_KOBOLD_CHIEF_B = 303; -APPEARANCE_TYPE_KOBOLD_SHAMAN_A = 301; -APPEARANCE_TYPE_KOBOLD_SHAMAN_B = 304; -APPEARANCE_TYPE_LANTERN_ARCHON = 103; -APPEARANCE_TYPE_LICH = 39; -APPEARANCE_TYPE_LIZARDFOLK_A = 134; -APPEARANCE_TYPE_LIZARDFOLK_B = 135; -APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_A = 132; -APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_B = 133; -APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_A = 130; -APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_B = 131; -APPEARANCE_TYPE_LUSKAN_GUARD = 211; -APPEARANCE_TYPE_MALE_01 = 226; -APPEARANCE_TYPE_MALE_02 = 227; -APPEARANCE_TYPE_MALE_03 = 228; -APPEARANCE_TYPE_MALE_04 = 229; -APPEARANCE_TYPE_MALE_05 = 230; -APPEARANCE_TYPE_MANTICORE = 366; -APPEARANCE_TYPE_MEDUSA = 352; -APPEARANCE_TYPE_MEPHIT_AIR = 106; -APPEARANCE_TYPE_MEPHIT_DUST = 107; -APPEARANCE_TYPE_MEPHIT_EARTH = 108; -APPEARANCE_TYPE_MEPHIT_FIRE = 109; -APPEARANCE_TYPE_MEPHIT_ICE = 110; -APPEARANCE_TYPE_MEPHIT_MAGMA = 114; -APPEARANCE_TYPE_MEPHIT_OOZE = 112; -APPEARANCE_TYPE_MEPHIT_SALT = 111; -APPEARANCE_TYPE_MEPHIT_STEAM = 113; -APPEARANCE_TYPE_MEPHIT_WATER = 115; -APPEARANCE_TYPE_MINOGON = 119; -APPEARANCE_TYPE_MINOTAUR = 120; -APPEARANCE_TYPE_MINOTAUR_CHIEFTAIN = 121; -APPEARANCE_TYPE_MINOTAUR_SHAMAN = 122; -APPEARANCE_TYPE_MOHRG = 123; -APPEARANCE_TYPE_MUMMY_COMMON = 58; -APPEARANCE_TYPE_MUMMY_FIGHTER_2 = 59; -APPEARANCE_TYPE_MUMMY_GREATER = 124; -APPEARANCE_TYPE_MUMMY_WARRIOR = 125; -APPEARANCE_TYPE_NWN_AARIN = 188; -APPEARANCE_TYPE_NWN_ARIBETH_EVIL = 189; -APPEARANCE_TYPE_NWN_HAEDRALINE = 191; -APPEARANCE_TYPE_NWN_MAUGRIM = 193; -APPEARANCE_TYPE_NWN_MORAG = 192; -APPEARANCE_TYPE_NWN_NASHER = 296; -APPEARANCE_TYPE_NWN_SEDOS = 297; -APPEARANCE_TYPE_NW_MILITIA_MEMBER = 210; -APPEARANCE_TYPE_NYMPH = 126; -APPEARANCE_TYPE_OCHRE_JELLY_LARGE = 394; -APPEARANCE_TYPE_OCHRE_JELLY_MEDIUM = 396; -APPEARANCE_TYPE_OCHRE_JELLY_SMALL = 398; -APPEARANCE_TYPE_OGRE = 127; -APPEARANCE_TYPE_OGREB = 207; -APPEARANCE_TYPE_OGRE_CHIEFTAIN = 128; -APPEARANCE_TYPE_OGRE_CHIEFTAINB = 208; -APPEARANCE_TYPE_OGRE_MAGE = 129; -APPEARANCE_TYPE_OGRE_MAGEB = 209; -APPEARANCE_TYPE_OLD_MAN = 239; -APPEARANCE_TYPE_OLD_WOMAN = 240; -APPEARANCE_TYPE_ORC_A = 140; -APPEARANCE_TYPE_ORC_B = 141; -APPEARANCE_TYPE_ORC_CHIEFTAIN_A = 136; -APPEARANCE_TYPE_ORC_CHIEFTAIN_B = 137; -APPEARANCE_TYPE_ORC_SHAMAN_A = 138; -APPEARANCE_TYPE_ORC_SHAMAN_B = 139; -APPEARANCE_TYPE_OX = 142; -APPEARANCE_TYPE_PARROT = 7; -APPEARANCE_TYPE_PENGUIN = 206; -APPEARANCE_TYPE_PLAGUE_VICTIM = 231; -APPEARANCE_TYPE_PROSTITUTE_01 = 236; -APPEARANCE_TYPE_PROSTITUTE_02 = 237; -APPEARANCE_TYPE_PSEUDODRAGON = 375; -APPEARANCE_TYPE_QUASIT = 104; -APPEARANCE_TYPE_RAKSHASA_BEAR_MALE = 294; -APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE = 290; -APPEARANCE_TYPE_RAKSHASA_TIGER_MALE = 293; -APPEARANCE_TYPE_RAKSHASA_WOLF_MALE = 295; -APPEARANCE_TYPE_RAT = 386; -APPEARANCE_TYPE_RAT_DIRE = 387; -APPEARANCE_TYPE_RAVEN = 145; -APPEARANCE_TYPE_SAHUAGIN = 65; -APPEARANCE_TYPE_SAHUAGIN_LEADER = 66; -APPEARANCE_TYPE_SAHUAGIN_CLERIC = 67; -APPEARANCE_TYPE_SEAGULL_FLYING = 291; -APPEARANCE_TYPE_SEAGULL_WALKING = 292; -APPEARANCE_TYPE_SHADOW = 146; -APPEARANCE_TYPE_SHADOW_FIEND = 147; -APPEARANCE_TYPE_SHARK_MAKO = 447; -APPEARANCE_TYPE_SHARK_HAMMERHEAD = 448; -APPEARANCE_TYPE_SHARK_GOBLIN = 449; -APPEARANCE_TYPE_SHIELD_GUARDIAN = 90; -APPEARANCE_TYPE_SHOP_KEEPER = 232; -APPEARANCE_TYPE_SKELETAL_DEVOURER = 36; -APPEARANCE_TYPE_SKELETON_CHIEFTAIN = 182; -APPEARANCE_TYPE_SKELETON_COMMON = 63; -APPEARANCE_TYPE_SKELETON_MAGE = 148; -APPEARANCE_TYPE_SKELETON_PRIEST = 62; -APPEARANCE_TYPE_SKELETON_WARRIOR = 150; -APPEARANCE_TYPE_SKELETON_WARRIOR_1 = 70; -APPEARANCE_TYPE_SKELETON_WARRIOR_2 = 71; -APPEARANCE_TYPE_SLAAD_BLUE = 151; -APPEARANCE_TYPE_SLAAD_DEATH = 152; -APPEARANCE_TYPE_SLAAD_GRAY = 153; -APPEARANCE_TYPE_SLAAD_GREEN = 154; -APPEARANCE_TYPE_SLAAD_RED = 155; -APPEARANCE_TYPE_SPECTRE = 156; -APPEARANCE_TYPE_SPHINX = 364; -APPEARANCE_TYPE_SPIDER_DIRE = 158; -APPEARANCE_TYPE_SPIDER_GIANT = 159; -APPEARANCE_TYPE_SPIDER_PHASE = 160; -APPEARANCE_TYPE_SPIDER_SWORD = 161; -APPEARANCE_TYPE_SPIDER_WRAITH = 162; -APPEARANCE_TYPE_STINGER = 356; -APPEARANCE_TYPE_STINGER_CHIEFTAIN = 358; -APPEARANCE_TYPE_STINGER_MAGE = 359; -APPEARANCE_TYPE_STINGER_WARRIOR = 357; -APPEARANCE_TYPE_SUCCUBUS = 163; -APPEARANCE_TYPE_TROGLODYTE = 451; -APPEARANCE_TYPE_TROGLODYTE_WARRIOR = 452; -APPEARANCE_TYPE_TROGLODYTE_CLERIC = 453; -APPEARANCE_TYPE_TROLL = 167; -APPEARANCE_TYPE_TROLL_CHIEFTAIN = 164; -APPEARANCE_TYPE_TROLL_SHAMAN = 165; -APPEARANCE_TYPE_UMBERHULK = 168; -APPEARANCE_TYPE_UTHGARD_ELK_TRIBE = 213; -APPEARANCE_TYPE_UTHGARD_TIGER_TRIBE = 214; -APPEARANCE_TYPE_VAMPIRE_FEMALE = 288; -APPEARANCE_TYPE_VAMPIRE_MALE = 289; -APPEARANCE_TYPE_VROCK = 101; -APPEARANCE_TYPE_WAITRESS = 235; -APPEARANCE_TYPE_WAR_DEVOURER = 54; -APPEARANCE_TYPE_WERECAT = 99; -APPEARANCE_TYPE_WERERAT = 170; -APPEARANCE_TYPE_WEREWOLF = 171; -APPEARANCE_TYPE_WIGHT = 172; -APPEARANCE_TYPE_WILL_O_WISP = 116; -APPEARANCE_TYPE_WRAITH = 187; -APPEARANCE_TYPE_WYRMLING_BLACK = 378; -APPEARANCE_TYPE_WYRMLING_BLUE = 377; -APPEARANCE_TYPE_WYRMLING_BRASS = 381; -APPEARANCE_TYPE_WYRMLING_BRONZE = 383; -APPEARANCE_TYPE_WYRMLING_COPPER = 382; -APPEARANCE_TYPE_WYRMLING_GOLD = 385; -APPEARANCE_TYPE_WYRMLING_GREEN = 379; -APPEARANCE_TYPE_WYRMLING_RED = 376; -APPEARANCE_TYPE_WYRMLING_SILVER = 384; -APPEARANCE_TYPE_WYRMLING_WHITE = 380; -APPEARANCE_TYPE_YUAN_TI = 285; -APPEARANCE_TYPE_YUAN_TI_CHIEFTEN = 286; -APPEARANCE_TYPE_YUAN_TI_WIZARD = 287; -APPEARANCE_TYPE_ZOMBIE = 198; -APPEARANCE_TYPE_ZOMBIE_ROTTING = 195; -APPEARANCE_TYPE_ZOMBIE_TYRANT_FOG = 199; -APPEARANCE_TYPE_ZOMBIE_WARRIOR_1 = 196; -APPEARANCE_TYPE_ZOMBIE_WARRIOR_2 = 197; -APPEARANCE_TYPE_BEHOLDER = 401; -APPEARANCE_TYPE_BEHOLDER_MAGE = 402; -APPEARANCE_TYPE_BEHOLDER_EYEBALL = 403; -APPEARANCE_TYPE_MEPHISTO_BIG = 404; -APPEARANCE_TYPE_DRACOLICH = 405; -APPEARANCE_TYPE_DRIDER = 406; -APPEARANCE_TYPE_DRIDER_CHIEF = 407; -APPEARANCE_TYPE_DROW_SLAVE = 408; -APPEARANCE_TYPE_DROW_WIZARD = 409; -APPEARANCE_TYPE_DROW_MATRON = 410; -APPEARANCE_TYPE_DUERGAR_SLAVE = 411; -APPEARANCE_TYPE_DUERGAR_CHIEF = 412; -APPEARANCE_TYPE_MINDFLAYER = 413; -APPEARANCE_TYPE_MINDFLAYER_2 = 414; -APPEARANCE_TYPE_MINDFLAYER_ALHOON = 415; -APPEARANCE_TYPE_DEEP_ROTHE = 416; -APPEARANCE_TYPE_DRAGON_SHADOW = 418; -APPEARANCE_TYPE_HARPY = 419; -APPEARANCE_TYPE_GOLEM_MITHRAL = 420; -APPEARANCE_TYPE_GOLEM_ADAMANTIUM = 421; -APPEARANCE_TYPE_SPIDER_DEMON = 422; -APPEARANCE_TYPE_SVIRF_MALE = 423; -APPEARANCE_TYPE_SVIRF_FEMALE = 424; -APPEARANCE_TYPE_DRAGON_PRIS = 425; -APPEARANCE_TYPE_SLAAD_BLACK = 426; -APPEARANCE_TYPE_SLAAD_WHITE = 427; -APPEARANCE_TYPE_AZER_MALE = 428; -APPEARANCE_TYPE_AZER_FEMALE = 429; -APPEARANCE_TYPE_DEMI_LICH = 430; -APPEARANCE_TYPE_OBJECT_CHAIR = 431; -APPEARANCE_TYPE_OBJECT_TABLE = 432; -APPEARANCE_TYPE_OBJECT_CANDLE = 433; -APPEARANCE_TYPE_OBJECT_CHEST = 434; -APPEARANCE_TYPE_OBJECT_WHITE = 435; -APPEARANCE_TYPE_OBJECT_BLUE = 436; -APPEARANCE_TYPE_OBJECT_CYAN = 437; -APPEARANCE_TYPE_OBJECT_GREEN = 438; -APPEARANCE_TYPE_OBJECT_YELLOW = 439; -APPEARANCE_TYPE_OBJECT_ORANGE = 440; -APPEARANCE_TYPE_OBJECT_RED = 441; -APPEARANCE_TYPE_OBJECT_PURPLE = 442; -APPEARANCE_TYPE_OBJECT_FLAME_SMALL = 443; -APPEARANCE_TYPE_OBJECT_FLAME_MEDIUM = 444; -APPEARANCE_TYPE_OBJECT_FLAME_LARGE = 445; -APPEARANCE_TYPE_DRIDER_FEMALE = 446; -APPEARANCE_TYPE_SEA_HAG = 454; -APPEARANCE_TYPE_GOLEM_DEMONFLESH = 468; -APPEARANCE_TYPE_ANIMATED_CHEST = 469; -APPEARANCE_TYPE_GELATINOUS_CUBE = 470; -APPEARANCE_TYPE_MEPHISTO_NORM = 471; -APPEARANCE_TYPE_BEHOLDER_MOTHER = 472; -APPEARANCE_TYPE_OBJECT_BOAT = 473; -APPEARANCE_TYPE_DWARF_GOLEM = 474; -APPEARANCE_TYPE_DWARF_HALFORC = 475; -APPEARANCE_TYPE_DROW_WARRIOR_1 = 476; -APPEARANCE_TYPE_DROW_WARRIOR_2 = 477; -APPEARANCE_TYPE_DROW_FEMALE_1 = 478; -APPEARANCE_TYPE_DROW_FEMALE_2 = 479; -APPEARANCE_TYPE_DROW_WARRIOR_3 = 480; -PHENOTYPE_NORMAL = 0; -PHENOTYPE_BIG = 2; -PHENOTYPE_CUSTOM1 = 3; -PHENOTYPE_CUSTOM2 = 4; -PHENOTYPE_CUSTOM3 = 5; -PHENOTYPE_CUSTOM4 = 6; -PHENOTYPE_CUSTOM5 = 7; -PHENOTYPE_CUSTOM6 = 8; -PHENOTYPE_CUSTOM7 = 9; -PHENOTYPE_CUSTOM8 = 10; -PHENOTYPE_CUSTOM9 = 11; -PHENOTYPE_CUSTOM10 = 12; -PHENOTYPE_CUSTOM11 = 13; -PHENOTYPE_CUSTOM12 = 14; -PHENOTYPE_CUSTOM13 = 15; -PHENOTYPE_CUSTOM14 = 16; -PHENOTYPE_CUSTOM15 = 17; -PHENOTYPE_CUSTOM16 = 18; -PHENOTYPE_CUSTOM17 = 19; -PHENOTYPE_CUSTOM18 = 20; -CAMERA_TRANSITION_TYPE_SNAP = 0; -CAMERA_TRANSITION_TYPE_CRAWL = 2; -CAMERA_TRANSITION_TYPE_VERY_SLOW = 5; -CAMERA_TRANSITION_TYPE_SLOW = 20; -CAMERA_TRANSITION_TYPE_MEDIUM = 40; -CAMERA_TRANSITION_TYPE_FAST = 70; -CAMERA_TRANSITION_TYPE_VERY_FAST = 100; -FADE_SPEED_SLOWEST = 0.003f; -FADE_SPEED_SLOW = 0.005f; -FADE_SPEED_MEDIUM = 0.01f; -FADE_SPEED_FAST = 0.017f; -FADE_SPEED_FASTEST = 0.25f; -EVENT_HEARTBEAT = 1001; -EVENT_PERCEIVE = 1002; -EVENT_END_COMBAT_ROUND = 1003; -EVENT_DIALOGUE = 1004; -EVENT_ATTACKED = 1005; -EVENT_DAMAGED = 1006; -EVENT_DISTURBED = 1008; -EVENT_SPELL_CAST_AT = 1011; -AI_LEVEL_INVALID = -1; -AI_LEVEL_DEFAULT = -1; -AI_LEVEL_VERY_LOW = 0; -AI_LEVEL_LOW = 1; -AI_LEVEL_NORMAL = 2; -AI_LEVEL_HIGH = 3; -AI_LEVEL_VERY_HIGH = 4; -AREA_INVALID = -1; -AREA_NATURAL = 1; -AREA_ARTIFICIAL = 0; -AREA_ABOVEGROUND = 1; -AREA_UNDERGROUND = 0; -AREA_HEIGHT = 0; -AREA_WIDTH = 1; -PORTRAIT_INVALID = 65535; -USE_CREATURE_LEVEL = 0; --- The following is all the item property constants... -IP_CONST_ABILITY_STR = 0; -IP_CONST_ABILITY_DEX = 1; -IP_CONST_ABILITY_CON = 2; -IP_CONST_ABILITY_INT = 3; -IP_CONST_ABILITY_WIS = 4; -IP_CONST_ABILITY_CHA = 5; -IP_CONST_ACMODIFIERTYPE_DODGE = 0; -IP_CONST_ACMODIFIERTYPE_NATURAL = 1; -IP_CONST_ACMODIFIERTYPE_ARMOR = 2; -IP_CONST_ACMODIFIERTYPE_SHIELD = 3; -IP_CONST_ACMODIFIERTYPE_DEFLECTION = 4; -IP_CONST_ADDITIONAL_UNKNOWN = 0; -IP_CONST_ADDITIONAL_CURSED = 1; -IP_CONST_ALIGNMENTGROUP_ALL = 0; -IP_CONST_ALIGNMENTGROUP_NEUTRAL = 1; -IP_CONST_ALIGNMENTGROUP_LAWFUL = 2; -IP_CONST_ALIGNMENTGROUP_CHAOTIC = 3; -IP_CONST_ALIGNMENTGROUP_GOOD = 4; -IP_CONST_ALIGNMENTGROUP_EVIL = 5; -IP_CONST_ALIGNMENT_LG = 0; -IP_CONST_ALIGNMENT_LN = 1; -IP_CONST_ALIGNMENT_LE = 2; -IP_CONST_ALIGNMENT_NG = 3; -IP_CONST_ALIGNMENT_TN = 4; -IP_CONST_ALIGNMENT_NE = 5; -IP_CONST_ALIGNMENT_CG = 6; -IP_CONST_ALIGNMENT_CN = 7; -IP_CONST_ALIGNMENT_CE = 8; -IP_CONST_RACIALTYPE_DWARF = 0; -IP_CONST_RACIALTYPE_ELF = 1; -IP_CONST_RACIALTYPE_GNOME = 2; -IP_CONST_RACIALTYPE_HALFLING = 3; -IP_CONST_RACIALTYPE_HALFELF = 4; -IP_CONST_RACIALTYPE_HALFORC = 5; -IP_CONST_RACIALTYPE_HUMAN = 6; -IP_CONST_RACIALTYPE_ABERRATION = 7; -IP_CONST_RACIALTYPE_ANIMAL = 8; -IP_CONST_RACIALTYPE_BEAST = 9; -IP_CONST_RACIALTYPE_CONSTRUCT = 10; -IP_CONST_RACIALTYPE_DRAGON = 11; -IP_CONST_RACIALTYPE_HUMANOID_GOBLINOID = 12; -IP_CONST_RACIALTYPE_HUMANOID_MONSTROUS = 13; -IP_CONST_RACIALTYPE_HUMANOID_ORC = 14; -IP_CONST_RACIALTYPE_HUMANOID_REPTILIAN = 15; -IP_CONST_RACIALTYPE_ELEMENTAL = 16; -IP_CONST_RACIALTYPE_FEY = 17; -IP_CONST_RACIALTYPE_GIANT = 18; -IP_CONST_RACIALTYPE_MAGICAL_BEAST = 19; -IP_CONST_RACIALTYPE_OUTSIDER = 20; -IP_CONST_RACIALTYPE_SHAPECHANGER = 23; -IP_CONST_RACIALTYPE_UNDEAD = 24; -IP_CONST_RACIALTYPE_VERMIN = 25; -IP_CONST_UNLIMITEDAMMO_BASIC = 1; -IP_CONST_UNLIMITEDAMMO_1D6FIRE = 2; -IP_CONST_UNLIMITEDAMMO_1D6COLD = 3; -IP_CONST_UNLIMITEDAMMO_1D6LIGHT = 4; -IP_CONST_UNLIMITEDAMMO_PLUS1 = 11; -IP_CONST_UNLIMITEDAMMO_PLUS2 = 12; -IP_CONST_UNLIMITEDAMMO_PLUS3 = 13; -IP_CONST_UNLIMITEDAMMO_PLUS4 = 14; -IP_CONST_UNLIMITEDAMMO_PLUS5 = 15; -IP_CONST_AMMOTYPE_ARROW = 0; -IP_CONST_AMMOTYPE_BOLT = 1; -IP_CONST_AMMOTYPE_BULLET = 2; -IP_CONST_CASTSPELL_NUMUSES_SINGLE_USE = 1; -IP_CONST_CASTSPELL_NUMUSES_5_CHARGES_PER_USE = 2; -IP_CONST_CASTSPELL_NUMUSES_4_CHARGES_PER_USE = 3; -IP_CONST_CASTSPELL_NUMUSES_3_CHARGES_PER_USE = 4; -IP_CONST_CASTSPELL_NUMUSES_2_CHARGES_PER_USE = 5; -IP_CONST_CASTSPELL_NUMUSES_1_CHARGE_PER_USE = 6; -IP_CONST_CASTSPELL_NUMUSES_0_CHARGES_PER_USE = 7; -IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY = 8; -IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY = 9; -IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY = 10; -IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY = 11; -IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY = 12; -IP_CONST_CASTSPELL_NUMUSES_UNLIMITED_USE = 13; -IP_CONST_DAMAGEBONUS_1 = 1; -IP_CONST_DAMAGEBONUS_2 = 2; -IP_CONST_DAMAGEBONUS_3 = 3; -IP_CONST_DAMAGEBONUS_4 = 4; -IP_CONST_DAMAGEBONUS_5 = 5; -IP_CONST_DAMAGEBONUS_1d4 = 6; -IP_CONST_DAMAGEBONUS_1d6 = 7; -IP_CONST_DAMAGEBONUS_1d8 = 8; -IP_CONST_DAMAGEBONUS_1d10 = 9; -IP_CONST_DAMAGEBONUS_2d6 = 10; -IP_CONST_DAMAGEBONUS_2d8 = 11; -IP_CONST_DAMAGEBONUS_2d4 = 12; -IP_CONST_DAMAGEBONUS_2d10 = 13; -IP_CONST_DAMAGEBONUS_1d12 = 14; -IP_CONST_DAMAGEBONUS_2d12 = 15; -IP_CONST_DAMAGEBONUS_6 = 16; -IP_CONST_DAMAGEBONUS_7 = 17; -IP_CONST_DAMAGEBONUS_8 = 18; -IP_CONST_DAMAGEBONUS_9 = 19; -IP_CONST_DAMAGEBONUS_10 = 20; -IP_CONST_DAMAGETYPE_BLUDGEONING = 0; -IP_CONST_DAMAGETYPE_PIERCING = 1; -IP_CONST_DAMAGETYPE_SLASHING = 2; -IP_CONST_DAMAGETYPE_SUBDUAL = 3; -IP_CONST_DAMAGETYPE_PHYSICAL = 4; -IP_CONST_DAMAGETYPE_MAGICAL = 5; -IP_CONST_DAMAGETYPE_ACID = 6; -IP_CONST_DAMAGETYPE_COLD = 7; -IP_CONST_DAMAGETYPE_DIVINE = 8; -IP_CONST_DAMAGETYPE_ELECTRICAL = 9; -IP_CONST_DAMAGETYPE_FIRE = 10; -IP_CONST_DAMAGETYPE_NEGATIVE = 11; -IP_CONST_DAMAGETYPE_POSITIVE = 12; -IP_CONST_DAMAGETYPE_SONIC = 13; -IP_CONST_DAMAGEIMMUNITY_5_PERCENT = 1; -IP_CONST_DAMAGEIMMUNITY_10_PERCENT = 2; -IP_CONST_DAMAGEIMMUNITY_25_PERCENT = 3; -IP_CONST_DAMAGEIMMUNITY_50_PERCENT = 4; -IP_CONST_DAMAGEIMMUNITY_75_PERCENT = 5; -IP_CONST_DAMAGEIMMUNITY_90_PERCENT = 6; -IP_CONST_DAMAGEIMMUNITY_100_PERCENT = 7; -IP_CONST_DAMAGEVULNERABILITY_5_PERCENT = 1; -IP_CONST_DAMAGEVULNERABILITY_10_PERCENT = 2; -IP_CONST_DAMAGEVULNERABILITY_25_PERCENT = 3; -IP_CONST_DAMAGEVULNERABILITY_50_PERCENT = 4; -IP_CONST_DAMAGEVULNERABILITY_75_PERCENT = 5; -IP_CONST_DAMAGEVULNERABILITY_90_PERCENT = 6; -IP_CONST_DAMAGEVULNERABILITY_100_PERCENT = 7; -IP_CONST_FEAT_ALERTNESS = 0; -IP_CONST_FEAT_AMBIDEXTROUS = 1; -IP_CONST_FEAT_CLEAVE = 2; -IP_CONST_FEAT_COMBAT_CASTING = 3; -IP_CONST_FEAT_DODGE = 4; -IP_CONST_FEAT_EXTRA_TURNING = 5; -IP_CONST_FEAT_KNOCKDOWN = 6; -IP_CONST_FEAT_POINTBLANK = 7; -IP_CONST_FEAT_SPELLFOCUSABJ = 8; -IP_CONST_FEAT_SPELLFOCUSCON = 9; -IP_CONST_FEAT_SPELLFOCUSDIV = 10; -IP_CONST_FEAT_SPELLFOCUSENC = 11; -IP_CONST_FEAT_SPELLFOCUSEVO = 12; -IP_CONST_FEAT_SPELLFOCUSILL = 13; -IP_CONST_FEAT_SPELLFOCUSNEC = 14; -IP_CONST_FEAT_SPELLPENETRATION = 15; -IP_CONST_FEAT_POWERATTACK = 16; -IP_CONST_FEAT_TWO_WEAPON_FIGHTING = 17; -IP_CONST_FEAT_WEAPSPEUNARM = 18; -IP_CONST_FEAT_WEAPFINESSE = 19; -IP_CONST_FEAT_IMPCRITUNARM = 20; -IP_CONST_FEAT_WEAPON_PROF_EXOTIC = 21; -IP_CONST_FEAT_WEAPON_PROF_MARTIAL = 22; -IP_CONST_FEAT_WEAPON_PROF_SIMPLE = 23; -IP_CONST_FEAT_ARMOR_PROF_HEAVY = 24; -IP_CONST_FEAT_ARMOR_PROF_LIGHT = 25; -IP_CONST_FEAT_ARMOR_PROF_MEDIUM = 26; -IP_CONST_FEAT_MOBILITY = 27; -IP_CONST_FEAT_DISARM = 28; -IP_CONST_FEAT_WHIRLWIND = 29; -IP_CONST_FEAT_RAPID_SHOT = 30; -IP_CONST_FEAT_HIDE_IN_PLAIN_SIGHT = 31; -IP_CONST_FEAT_SNEAK_ATTACK_1D6 = 32; -IP_CONST_FEAT_SNEAK_ATTACK_2D6 = 33; -IP_CONST_FEAT_SNEAK_ATTACK_3D6 = 34; -IP_CONST_FEAT_SHIELD_PROFICIENCY = 35; -IP_CONST_FEAT_USE_POISON = 36; -IP_CONST_FEAT_DISARM_WHIP = 37; -IP_CONST_FEAT_WEAPON_PROF_CREATURE = 38; -IP_CONST_FEAT_SNEAK_ATTACK_5D6 = 39; -IP_CONST_FEAT_PLAYER_TOOL_01 = 53; -IP_CONST_FEAT_PLAYER_TOOL_02 = 54; -IP_CONST_FEAT_PLAYER_TOOL_03 = 55; -IP_CONST_FEAT_PLAYER_TOOL_04 = 56; -IP_CONST_FEAT_PLAYER_TOOL_05 = 57; -IP_CONST_FEAT_PLAYER_TOOL_06 = 58; -IP_CONST_FEAT_PLAYER_TOOL_07 = 59; -IP_CONST_FEAT_PLAYER_TOOL_08 = 60; -IP_CONST_FEAT_PLAYER_TOOL_09 = 61; -IP_CONST_FEAT_PLAYER_TOOL_10 = 62; -IP_CONST_IMMUNITYMISC_BACKSTAB = 0; -IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN = 1; -IP_CONST_IMMUNITYMISC_MINDSPELLS = 2; -IP_CONST_IMMUNITYMISC_POISON = 3; -IP_CONST_IMMUNITYMISC_DISEASE = 4; -IP_CONST_IMMUNITYMISC_FEAR = 5; -IP_CONST_IMMUNITYMISC_KNOCKDOWN = 6; -IP_CONST_IMMUNITYMISC_PARALYSIS = 7; -IP_CONST_IMMUNITYMISC_CRITICAL_HITS = 8; -IP_CONST_IMMUNITYMISC_DEATH_MAGIC = 9; -IP_CONST_LIGHTBRIGHTNESS_DIM = 1; -IP_CONST_LIGHTBRIGHTNESS_LOW = 2; -IP_CONST_LIGHTBRIGHTNESS_NORMAL = 3; -IP_CONST_LIGHTBRIGHTNESS_BRIGHT = 4; -IP_CONST_LIGHTCOLOR_BLUE = 0; -IP_CONST_LIGHTCOLOR_YELLOW = 1; -IP_CONST_LIGHTCOLOR_PURPLE = 2; -IP_CONST_LIGHTCOLOR_RED = 3; -IP_CONST_LIGHTCOLOR_GREEN = 4; -IP_CONST_LIGHTCOLOR_ORANGE = 5; -IP_CONST_LIGHTCOLOR_WHITE = 6; -IP_CONST_MONSTERDAMAGE_1d2 = 1; -IP_CONST_MONSTERDAMAGE_1d3 = 2; -IP_CONST_MONSTERDAMAGE_1d4 = 3; -IP_CONST_MONSTERDAMAGE_2d4 = 4; -IP_CONST_MONSTERDAMAGE_3d4 = 5; -IP_CONST_MONSTERDAMAGE_4d4 = 6; -IP_CONST_MONSTERDAMAGE_5d4 = 7; -IP_CONST_MONSTERDAMAGE_1d6 = 8; -IP_CONST_MONSTERDAMAGE_2d6 = 9; -IP_CONST_MONSTERDAMAGE_3d6 = 10; -IP_CONST_MONSTERDAMAGE_4d6 = 11; -IP_CONST_MONSTERDAMAGE_5d6 = 12; -IP_CONST_MONSTERDAMAGE_6d6 = 13; -IP_CONST_MONSTERDAMAGE_7d6 = 14; -IP_CONST_MONSTERDAMAGE_8d6 = 15; -IP_CONST_MONSTERDAMAGE_9d6 = 16; -IP_CONST_MONSTERDAMAGE_10d6 = 17; -IP_CONST_MONSTERDAMAGE_1d8 = 18; -IP_CONST_MONSTERDAMAGE_2d8 = 19; -IP_CONST_MONSTERDAMAGE_3d8 = 20; -IP_CONST_MONSTERDAMAGE_4d8 = 21; -IP_CONST_MONSTERDAMAGE_5d8 = 22; -IP_CONST_MONSTERDAMAGE_6d8 = 23; -IP_CONST_MONSTERDAMAGE_7d8 = 24; -IP_CONST_MONSTERDAMAGE_8d8 = 25; -IP_CONST_MONSTERDAMAGE_9d8 = 26; -IP_CONST_MONSTERDAMAGE_10d8 = 27; -IP_CONST_MONSTERDAMAGE_1d10 = 28; -IP_CONST_MONSTERDAMAGE_2d10 = 29; -IP_CONST_MONSTERDAMAGE_3d10 = 30; -IP_CONST_MONSTERDAMAGE_4d10 = 31; -IP_CONST_MONSTERDAMAGE_5d10 = 32; -IP_CONST_MONSTERDAMAGE_6d10 = 33; -IP_CONST_MONSTERDAMAGE_7d10 = 34; -IP_CONST_MONSTERDAMAGE_8d10 = 35; -IP_CONST_MONSTERDAMAGE_9d10 = 36; -IP_CONST_MONSTERDAMAGE_10d10 = 37; -IP_CONST_MONSTERDAMAGE_1d12 = 38; -IP_CONST_MONSTERDAMAGE_2d12 = 39; -IP_CONST_MONSTERDAMAGE_3d12 = 40; -IP_CONST_MONSTERDAMAGE_4d12 = 41; -IP_CONST_MONSTERDAMAGE_5d12 = 42; -IP_CONST_MONSTERDAMAGE_6d12 = 43; -IP_CONST_MONSTERDAMAGE_7d12 = 44; -IP_CONST_MONSTERDAMAGE_8d12 = 45; -IP_CONST_MONSTERDAMAGE_9d12 = 46; -IP_CONST_MONSTERDAMAGE_10d12 = 47; -IP_CONST_MONSTERDAMAGE_1d20 = 48; -IP_CONST_MONSTERDAMAGE_2d20 = 49; -IP_CONST_MONSTERDAMAGE_3d20 = 50; -IP_CONST_MONSTERDAMAGE_4d20 = 51; -IP_CONST_MONSTERDAMAGE_5d20 = 52; -IP_CONST_MONSTERDAMAGE_6d20 = 53; -IP_CONST_MONSTERDAMAGE_7d20 = 54; -IP_CONST_MONSTERDAMAGE_8d20 = 55; -IP_CONST_MONSTERDAMAGE_9d20 = 56; -IP_CONST_MONSTERDAMAGE_10d20 = 57; -IP_CONST_ONMONSTERHIT_ABILITYDRAIN = 0; -IP_CONST_ONMONSTERHIT_CONFUSION = 1; -IP_CONST_ONMONSTERHIT_DISEASE = 2; -IP_CONST_ONMONSTERHIT_DOOM = 3; -IP_CONST_ONMONSTERHIT_FEAR = 4; -IP_CONST_ONMONSTERHIT_LEVELDRAIN = 5; -IP_CONST_ONMONSTERHIT_POISON = 6; -IP_CONST_ONMONSTERHIT_SLOW = 7; -IP_CONST_ONMONSTERHIT_STUN = 8; -IP_CONST_ONMONSTERHIT_WOUNDING = 9; -IP_CONST_ONHIT_SLEEP = 0; -IP_CONST_ONHIT_STUN = 1; -IP_CONST_ONHIT_HOLD = 2; -IP_CONST_ONHIT_CONFUSION = 3; -IP_CONST_ONHIT_DAZE = 5; -IP_CONST_ONHIT_DOOM = 6; -IP_CONST_ONHIT_FEAR = 7; -IP_CONST_ONHIT_KNOCK = 8; -IP_CONST_ONHIT_SLOW = 9; -IP_CONST_ONHIT_LESSERDISPEL = 10; -IP_CONST_ONHIT_DISPELMAGIC = 11; -IP_CONST_ONHIT_GREATERDISPEL = 12; -IP_CONST_ONHIT_MORDSDISJUNCTION = 13; -IP_CONST_ONHIT_SILENCE = 14; -IP_CONST_ONHIT_DEAFNESS = 15; -IP_CONST_ONHIT_BLINDNESS = 16; -IP_CONST_ONHIT_LEVELDRAIN = 17; -IP_CONST_ONHIT_ABILITYDRAIN = 18; -IP_CONST_ONHIT_ITEMPOISON = 19; -IP_CONST_ONHIT_DISEASE = 20; -IP_CONST_ONHIT_SLAYRACE = 21; -IP_CONST_ONHIT_SLAYALIGNMENTGROUP = 22; -IP_CONST_ONHIT_SLAYALIGNMENT = 23; -IP_CONST_ONHIT_VORPAL = 24; -IP_CONST_ONHIT_WOUNDING = 25; -IP_CONST_ONHIT_SAVEDC_14 = 0; -IP_CONST_ONHIT_SAVEDC_16 = 1; -IP_CONST_ONHIT_SAVEDC_18 = 2; -IP_CONST_ONHIT_SAVEDC_20 = 3; -IP_CONST_ONHIT_SAVEDC_22 = 4; -IP_CONST_ONHIT_SAVEDC_24 = 5; -IP_CONST_ONHIT_SAVEDC_26 = 6; -IP_CONST_ONHIT_DURATION_5_PERCENT_5_ROUNDS = 0; -IP_CONST_ONHIT_DURATION_10_PERCENT_4_ROUNDS = 1; -IP_CONST_ONHIT_DURATION_25_PERCENT_3_ROUNDS = 2; -IP_CONST_ONHIT_DURATION_50_PERCENT_2_ROUNDS = 3; -IP_CONST_ONHIT_DURATION_75_PERCENT_1_ROUND = 4; -IP_CONST_ONHIT_CASTSPELL_ACID_FOG = 0; -IP_CONST_ONHIT_CASTSPELL_BESTOW_CURSE = 1; -IP_CONST_ONHIT_CASTSPELL_BLADE_BARRIER = 2; -IP_CONST_ONHIT_CASTSPELL_BLINDNESS_AND_DEAFNESS = 3; -IP_CONST_ONHIT_CASTSPELL_CALL_LIGHTNING = 4; -IP_CONST_ONHIT_CASTSPELL_CHAIN_LIGHTNING = 5; -IP_CONST_ONHIT_CASTSPELL_CLOUDKILL = 6; -IP_CONST_ONHIT_CASTSPELL_CONFUSION = 7; -IP_CONST_ONHIT_CASTSPELL_CONTAGION = 8; -IP_CONST_ONHIT_CASTSPELL_DARKNESS = 9; -IP_CONST_ONHIT_CASTSPELL_DAZE = 10; -IP_CONST_ONHIT_CASTSPELL_DELAYED_BLAST_FIREBALL = 11; -IP_CONST_ONHIT_CASTSPELL_DISMISSAL = 12; -IP_CONST_ONHIT_CASTSPELL_DISPEL_MAGIC = 13; -IP_CONST_ONHIT_CASTSPELL_DOOM = 14; -IP_CONST_ONHIT_CASTSPELL_ENERGY_DRAIN = 15; -IP_CONST_ONHIT_CASTSPELL_ENERVATION = 16; -IP_CONST_ONHIT_CASTSPELL_ENTANGLE = 17; -IP_CONST_ONHIT_CASTSPELL_FEAR = 18; -IP_CONST_ONHIT_CASTSPELL_FEEBLEMIND = 19; -IP_CONST_ONHIT_CASTSPELL_FIRE_STORM = 20; -IP_CONST_ONHIT_CASTSPELL_FIREBALL = 21; -IP_CONST_ONHIT_CASTSPELL_FLAME_LASH = 22; -IP_CONST_ONHIT_CASTSPELL_FLAME_STRIKE = 23; -IP_CONST_ONHIT_CASTSPELL_GHOUL_TOUCH = 24; -IP_CONST_ONHIT_CASTSPELL_GREASE = 25; -IP_CONST_ONHIT_CASTSPELL_GREATER_DISPELLING = 26; -IP_CONST_ONHIT_CASTSPELL_GREATER_SPELL_BREACH = 27; -IP_CONST_ONHIT_CASTSPELL_GUST_OF_WIND = 28; -IP_CONST_ONHIT_CASTSPELL_HAMMER_OF_THE_GODS = 29; -IP_CONST_ONHIT_CASTSPELL_HARM = 30; -IP_CONST_ONHIT_CASTSPELL_HOLD_ANIMAL = 31; -IP_CONST_ONHIT_CASTSPELL_HOLD_MONSTER = 32; -IP_CONST_ONHIT_CASTSPELL_HOLD_PERSON = 33; -IP_CONST_ONHIT_CASTSPELL_IMPLOSION = 34; -IP_CONST_ONHIT_CASTSPELL_INCENDIARY_CLOUD = 35; -IP_CONST_ONHIT_CASTSPELL_LESSER_DISPEL = 36; -IP_CONST_ONHIT_CASTSPELL_LESSER_SPELL_BREACH = 38; -IP_CONST_ONHIT_CASTSPELL_LIGHT = 40; -IP_CONST_ONHIT_CASTSPELL_LIGHTNING_BOLT = 41; -IP_CONST_ONHIT_CASTSPELL_MAGIC_MISSILE = 42; -IP_CONST_ONHIT_CASTSPELL_MASS_BLINDNESS_AND_DEAFNESS = 43; -IP_CONST_ONHIT_CASTSPELL_MASS_CHARM = 44; -IP_CONST_ONHIT_CASTSPELL_MELFS_ACID_ARROW = 45; -IP_CONST_ONHIT_CASTSPELL_METEOR_SWARM = 46; -IP_CONST_ONHIT_CASTSPELL_MIND_FOG = 47; -IP_CONST_ONHIT_CASTSPELL_PHANTASMAL_KILLER = 49; -IP_CONST_ONHIT_CASTSPELL_POISON = 50; -IP_CONST_ONHIT_CASTSPELL_POWER_WORD_KILL = 51; -IP_CONST_ONHIT_CASTSPELL_POWER_WORD_STUN = 52; -IP_CONST_ONHIT_CASTSPELL_SCARE = 54; -IP_CONST_ONHIT_CASTSPELL_SEARING_LIGHT = 55; -IP_CONST_ONHIT_CASTSPELL_SILENCE = 56; -IP_CONST_ONHIT_CASTSPELL_SLAY_LIVING = 57; -IP_CONST_ONHIT_CASTSPELL_SLEEP = 58; -IP_CONST_ONHIT_CASTSPELL_SLOW = 59; -IP_CONST_ONHIT_CASTSPELL_SOUND_BURST = 60; -IP_CONST_ONHIT_CASTSPELL_STINKING_CLOUD = 61; -IP_CONST_ONHIT_CASTSPELL_STORM_OF_VENGEANCE = 63; -IP_CONST_ONHIT_CASTSPELL_SUNBEAM = 64; -IP_CONST_ONHIT_CASTSPELL_VAMPIRIC_TOUCH = 65; -IP_CONST_ONHIT_CASTSPELL_WAIL_OF_THE_BANSHEE = 66; -IP_CONST_ONHIT_CASTSPELL_WALL_OF_FIRE = 67; -IP_CONST_ONHIT_CASTSPELL_WEB = 68; -IP_CONST_ONHIT_CASTSPELL_WEIRD = 69; -IP_CONST_ONHIT_CASTSPELL_WORD_OF_FAITH = 70; -IP_CONST_ONHIT_CASTSPELL_CREEPING_DOOM = 72; -IP_CONST_ONHIT_CASTSPELL_DESTRUCTION = 73; -IP_CONST_ONHIT_CASTSPELL_HORRID_WILTING = 74; -IP_CONST_ONHIT_CASTSPELL_ICE_STORM = 75; -IP_CONST_ONHIT_CASTSPELL_NEGATIVE_ENERGY_BURST = 76; -IP_CONST_ONHIT_CASTSPELL_EVARDS_BLACK_TENTACLES = 77; -IP_CONST_ONHIT_CASTSPELL_ACTIVATE_ITEM = 78; -IP_CONST_ONHIT_CASTSPELL_FLARE = 79; -IP_CONST_ONHIT_CASTSPELL_BOMBARDMENT = 80; -IP_CONST_ONHIT_CASTSPELL_ACID_SPLASH = 81; -IP_CONST_ONHIT_CASTSPELL_QUILLFIRE = 82; -IP_CONST_ONHIT_CASTSPELL_EARTHQUAKE = 83; -IP_CONST_ONHIT_CASTSPELL_SUNBURST = 84; -IP_CONST_ONHIT_CASTSPELL_BANISHMENT = 85; -IP_CONST_ONHIT_CASTSPELL_INFLICT_MINOR_WOUNDS = 86; -IP_CONST_ONHIT_CASTSPELL_INFLICT_LIGHT_WOUNDS = 87; -IP_CONST_ONHIT_CASTSPELL_INFLICT_MODERATE_WOUNDS = 88; -IP_CONST_ONHIT_CASTSPELL_INFLICT_SERIOUS_WOUNDS = 89; -IP_CONST_ONHIT_CASTSPELL_INFLICT_CRITICAL_WOUNDS = 90; -IP_CONST_ONHIT_CASTSPELL_BALAGARNSIRONHORN = 91; -IP_CONST_ONHIT_CASTSPELL_DROWN = 92; -IP_CONST_ONHIT_CASTSPELL_ELECTRIC_JOLT = 93; -IP_CONST_ONHIT_CASTSPELL_FIREBRAND = 94; -IP_CONST_ONHIT_CASTSPELL_WOUNDING_WHISPERS = 95; -IP_CONST_ONHIT_CASTSPELL_UNDEATHS_ETERNAL_FOE = 96; -IP_CONST_ONHIT_CASTSPELL_INFERNO = 97; -IP_CONST_ONHIT_CASTSPELL_ISAACS_LESSER_MISSILE_STORM = 98; -IP_CONST_ONHIT_CASTSPELL_ISAACS_GREATER_MISSILE_STORM = 99; -IP_CONST_ONHIT_CASTSPELL_BANE = 100; -IP_CONST_ONHIT_CASTSPELL_SPIKE_GROWTH = 101; -IP_CONST_ONHIT_CASTSPELL_TASHAS_HIDEOUS_LAUGHTER = 102; -IP_CONST_ONHIT_CASTSPELL_BIGBYS_INTERPOSING_HAND = 103; -IP_CONST_ONHIT_CASTSPELL_BIGBYS_FORCEFUL_HAND = 104; -IP_CONST_ONHIT_CASTSPELL_BIGBYS_GRASPING_HAND = 105; -IP_CONST_ONHIT_CASTSPELL_BIGBYS_CLENCHED_FIST = 106; -IP_CONST_ONHIT_CASTSPELL_BIGBYS_CRUSHING_HAND = 107; -IP_CONST_ONHIT_CASTSPELL_FLESH_TO_STONE = 108; -IP_CONST_ONHIT_CASTSPELL_STONE_TO_FLESH = 109; -IP_CONST_ONHIT_CASTSPELL_CRUMBLE = 110; -IP_CONST_ONHIT_CASTSPELL_INFESTATION_OF_MAGGOTS = 111; -IP_CONST_ONHIT_CASTSPELL_GREAT_THUNDERCLAP = 112; -IP_CONST_ONHIT_CASTSPELL_BALL_LIGHTNING = 113; -IP_CONST_ONHIT_CASTSPELL_GEDLEES_ELECTRIC_LOOP = 114; -IP_CONST_ONHIT_CASTSPELL_HORIZIKAULS_BOOM = 115; -IP_CONST_ONHIT_CASTSPELL_MESTILS_ACID_BREATH = 116; -IP_CONST_ONHIT_CASTSPELL_SCINTILLATING_SPHERE = 117; -IP_CONST_ONHIT_CASTSPELL_UNDEATH_TO_DEATH = 118; -IP_CONST_ONHIT_CASTSPELL_STONEHOLD = 119; -IP_CONST_ONHIT_CASTSPELL_EVIL_BLIGHT = 121; -IP_CONST_ONHIT_CASTSPELL_ONHIT_TELEPORT = 122; -IP_CONST_ONHIT_CASTSPELL_ONHIT_SLAYRAKSHASA = 123; -IP_CONST_ONHIT_CASTSPELL_ONHIT_FIREDAMAGE = 124; -IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER = 125; -IP_CONST_ONHIT_CASTSPELL_ONHIT_PLANARRIFT = 126; -IP_CONST_ONHIT_CASTSPELL_ONHIT_DARKFIRE = 127; -IP_CONST_ONHIT_CASTSPELL_ONHIT_EXTRACTBRAIN = 128; -IP_CONST_ONHIT_CASTSPELL_ONHITFLAMINGSKIN = 129; -IP_CONST_ONHIT_CASTSPELL_ONHIT_CHAOSSHIELD = 130; -IP_CONST_ONHIT_CASTSPELL_ONHIT_CONSTRICTWEAPON = 131; -IP_CONST_ONHIT_CASTSPELL_ONHITRUINARMORBEBILITH = 132; -IP_CONST_ONHIT_CASTSPELL_ONHITDEMILICHTOUCH = 133; -IP_CONST_ONHIT_CASTSPELL_ONHITDRACOLICHTOUCH = 134; -IP_CONST_ONHIT_CASTSPELL_INTELLIGENT_WEAPON_ONHIT = 135; -IP_CONST_ONHIT_CASTSPELL_PARALYZE_2 = 136; -IP_CONST_ONHIT_CASTSPELL_DEAFENING_CLNG = 137; -IP_CONST_ONHIT_CASTSPELL_KNOCKDOWN = 138; -IP_CONST_ONHIT_CASTSPELL_FREEZE = 139; -IP_CONST_ONHIT_CASTSPELL_COMBUST = 140; -IP_CONST_POISON_1D2_STRDAMAGE = 0; -IP_CONST_POISON_1D2_DEXDAMAGE = 1; -IP_CONST_POISON_1D2_CONDAMAGE = 2; -IP_CONST_POISON_1D2_INTDAMAGE = 3; -IP_CONST_POISON_1D2_WISDAMAGE = 4; -IP_CONST_POISON_1D2_CHADAMAGE = 5; -IP_CONST_QUALITY_UNKOWN = 0; -IP_CONST_QUALITY_DESTROYED = 1; -IP_CONST_QUALITY_RUINED = 2; -IP_CONST_QUALITY_VERY_POOR = 3; -IP_CONST_QUALITY_POOR = 4; -IP_CONST_QUALITY_BELOW_AVERAGE = 5; -IP_CONST_QUALITY_AVERAGE = 6; -IP_CONST_QUALITY_ABOVE_AVERAGE = 7; -IP_CONST_QUALITY_GOOD = 8; -IP_CONST_QUALITY_VERY_GOOD = 9; -IP_CONST_QUALITY_EXCELLENT = 10; -IP_CONST_QUALITY_MASTERWORK = 11; -IP_CONST_QUALITY_GOD_LIKE = 12; -IP_CONST_QUALITY_RAW = 13; -IP_CONST_QUALITY_CUT = 14; -IP_CONST_QUALITY_POLISHED = 15; -IP_CONST_CONTAINERWEIGHTRED_20_PERCENT = 1; -IP_CONST_CONTAINERWEIGHTRED_40_PERCENT = 2; -IP_CONST_CONTAINERWEIGHTRED_60_PERCENT = 3; -IP_CONST_CONTAINERWEIGHTRED_80_PERCENT = 4; -IP_CONST_CONTAINERWEIGHTRED_100_PERCENT = 5; -IP_CONST_DAMAGERESIST_5 = 1; -IP_CONST_DAMAGERESIST_10 = 2; -IP_CONST_DAMAGERESIST_15 = 3; -IP_CONST_DAMAGERESIST_20 = 4; -IP_CONST_DAMAGERESIST_25 = 5; -IP_CONST_DAMAGERESIST_30 = 6; -IP_CONST_DAMAGERESIST_35 = 7; -IP_CONST_DAMAGERESIST_40 = 8; -IP_CONST_DAMAGERESIST_45 = 9; -IP_CONST_DAMAGERESIST_50 = 10; -IP_CONST_SAVEVS_ACID = 1; -IP_CONST_SAVEVS_COLD = 3; -IP_CONST_SAVEVS_DEATH = 4; -IP_CONST_SAVEVS_DISEASE = 5; -IP_CONST_SAVEVS_DIVINE = 6; -IP_CONST_SAVEVS_ELECTRICAL = 7; -IP_CONST_SAVEVS_FEAR = 8; -IP_CONST_SAVEVS_FIRE = 9; -IP_CONST_SAVEVS_MINDAFFECTING = 11; -IP_CONST_SAVEVS_NEGATIVE = 12; -IP_CONST_SAVEVS_POISON = 13; -IP_CONST_SAVEVS_POSITIVE = 14; -IP_CONST_SAVEVS_SONIC = 15; -IP_CONST_SAVEVS_UNIVERSAL = 0; -IP_CONST_SAVEBASETYPE_FORTITUDE = 1; -IP_CONST_SAVEBASETYPE_WILL = 2; -IP_CONST_SAVEBASETYPE_REFLEX = 3; -IP_CONST_DAMAGESOAK_5_HP = 1; -IP_CONST_DAMAGESOAK_10_HP = 2; -IP_CONST_DAMAGESOAK_15_HP = 3; -IP_CONST_DAMAGESOAK_20_HP = 4; -IP_CONST_DAMAGESOAK_25_HP = 5; -IP_CONST_DAMAGESOAK_30_HP = 6; -IP_CONST_DAMAGESOAK_35_HP = 7; -IP_CONST_DAMAGESOAK_40_HP = 8; -IP_CONST_DAMAGESOAK_45_HP = 9; -IP_CONST_DAMAGESOAK_50_HP = 10; -IP_CONST_DAMAGEREDUCTION_1 = 0; -IP_CONST_DAMAGEREDUCTION_2 = 1; -IP_CONST_DAMAGEREDUCTION_3 = 2; -IP_CONST_DAMAGEREDUCTION_4 = 3; -IP_CONST_DAMAGEREDUCTION_5 = 4; -IP_CONST_DAMAGEREDUCTION_6 = 5; -IP_CONST_DAMAGEREDUCTION_7 = 6; -IP_CONST_DAMAGEREDUCTION_8 = 7; -IP_CONST_DAMAGEREDUCTION_9 = 8; -IP_CONST_DAMAGEREDUCTION_10 = 9; -IP_CONST_DAMAGEREDUCTION_11 = 10; -IP_CONST_DAMAGEREDUCTION_12 = 11; -IP_CONST_DAMAGEREDUCTION_13 = 12; -IP_CONST_DAMAGEREDUCTION_14 = 13; -IP_CONST_DAMAGEREDUCTION_15 = 14; -IP_CONST_DAMAGEREDUCTION_16 = 15; -IP_CONST_DAMAGEREDUCTION_17 = 16; -IP_CONST_DAMAGEREDUCTION_18 = 17; -IP_CONST_DAMAGEREDUCTION_19 = 18; -IP_CONST_DAMAGEREDUCTION_20 = 19; -IP_CONST_IMMUNITYSPELL_ACID_FOG = 0; -IP_CONST_IMMUNITYSPELL_AID = 1; -IP_CONST_IMMUNITYSPELL_BARKSKIN = 2; -IP_CONST_IMMUNITYSPELL_BESTOW_CURSE = 3; -IP_CONST_IMMUNITYSPELL_BLINDNESS_AND_DEAFNESS = 6; -IP_CONST_IMMUNITYSPELL_BURNING_HANDS = 8; -IP_CONST_IMMUNITYSPELL_CALL_LIGHTNING = 9; -IP_CONST_IMMUNITYSPELL_CHAIN_LIGHTNING = 12; -IP_CONST_IMMUNITYSPELL_CHARM_MONSTER = 13; -IP_CONST_IMMUNITYSPELL_CHARM_PERSON = 14; -IP_CONST_IMMUNITYSPELL_CHARM_PERSON_OR_ANIMAL = 15; -IP_CONST_IMMUNITYSPELL_CIRCLE_OF_DEATH = 16; -IP_CONST_IMMUNITYSPELL_CIRCLE_OF_DOOM = 17; -IP_CONST_IMMUNITYSPELL_CLOUDKILL = 21; -IP_CONST_IMMUNITYSPELL_COLOR_SPRAY = 22; -IP_CONST_IMMUNITYSPELL_CONE_OF_COLD = 23; -IP_CONST_IMMUNITYSPELL_CONFUSION = 24; -IP_CONST_IMMUNITYSPELL_CONTAGION = 25; -IP_CONST_IMMUNITYSPELL_CONTROL_UNDEAD = 26; -IP_CONST_IMMUNITYSPELL_CURE_CRITICAL_WOUNDS = 27; -IP_CONST_IMMUNITYSPELL_CURE_LIGHT_WOUNDS = 28; -IP_CONST_IMMUNITYSPELL_CURE_MINOR_WOUNDS = 29; -IP_CONST_IMMUNITYSPELL_CURE_MODERATE_WOUNDS = 30; -IP_CONST_IMMUNITYSPELL_CURE_SERIOUS_WOUNDS = 31; -IP_CONST_IMMUNITYSPELL_DARKNESS = 32; -IP_CONST_IMMUNITYSPELL_DAZE = 33; -IP_CONST_IMMUNITYSPELL_DEATH_WARD = 34; -IP_CONST_IMMUNITYSPELL_DELAYED_BLAST_FIREBALL = 35; -IP_CONST_IMMUNITYSPELL_DISMISSAL = 36; -IP_CONST_IMMUNITYSPELL_DISPEL_MAGIC = 37; -IP_CONST_IMMUNITYSPELL_DOMINATE_ANIMAL = 39; -IP_CONST_IMMUNITYSPELL_DOMINATE_MONSTER = 40; -IP_CONST_IMMUNITYSPELL_DOMINATE_PERSON = 41; -IP_CONST_IMMUNITYSPELL_DOOM = 42; -IP_CONST_IMMUNITYSPELL_ENERGY_DRAIN = 46; -IP_CONST_IMMUNITYSPELL_ENERVATION = 47; -IP_CONST_IMMUNITYSPELL_ENTANGLE = 48; -IP_CONST_IMMUNITYSPELL_FEAR = 49; -IP_CONST_IMMUNITYSPELL_FEEBLEMIND = 50; -IP_CONST_IMMUNITYSPELL_FINGER_OF_DEATH = 51; -IP_CONST_IMMUNITYSPELL_FIRE_STORM = 52; -IP_CONST_IMMUNITYSPELL_FIREBALL = 53; -IP_CONST_IMMUNITYSPELL_FLAME_ARROW = 54; -IP_CONST_IMMUNITYSPELL_FLAME_LASH = 55; -IP_CONST_IMMUNITYSPELL_FLAME_STRIKE = 56; -IP_CONST_IMMUNITYSPELL_FREEDOM_OF_MOVEMENT = 57; -IP_CONST_IMMUNITYSPELL_GREASE = 59; -IP_CONST_IMMUNITYSPELL_GREATER_DISPELLING = 60; -IP_CONST_IMMUNITYSPELL_GREATER_PLANAR_BINDING = 62; -IP_CONST_IMMUNITYSPELL_GREATER_SHADOW_CONJURATION = 64; -IP_CONST_IMMUNITYSPELL_GREATER_SPELL_BREACH = 65; -IP_CONST_IMMUNITYSPELL_HAMMER_OF_THE_GODS = 68; -IP_CONST_IMMUNITYSPELL_HARM = 69; -IP_CONST_IMMUNITYSPELL_HEAL = 71; -IP_CONST_IMMUNITYSPELL_HEALING_CIRCLE = 72; -IP_CONST_IMMUNITYSPELL_HOLD_ANIMAL = 73; -IP_CONST_IMMUNITYSPELL_HOLD_MONSTER = 74; -IP_CONST_IMMUNITYSPELL_HOLD_PERSON = 75; -IP_CONST_IMMUNITYSPELL_IMPLOSION = 78; -IP_CONST_IMMUNITYSPELL_IMPROVED_INVISIBILITY = 79; -IP_CONST_IMMUNITYSPELL_INCENDIARY_CLOUD = 80; -IP_CONST_IMMUNITYSPELL_INVISIBILITY_PURGE = 82; -IP_CONST_IMMUNITYSPELL_LESSER_DISPEL = 84; -IP_CONST_IMMUNITYSPELL_LESSER_PLANAR_BINDING = 86; -IP_CONST_IMMUNITYSPELL_LESSER_SPELL_BREACH = 88; -IP_CONST_IMMUNITYSPELL_LIGHTNING_BOLT = 91; -IP_CONST_IMMUNITYSPELL_MAGIC_MISSILE = 97; -IP_CONST_IMMUNITYSPELL_MASS_BLINDNESS_AND_DEAFNESS = 100; -IP_CONST_IMMUNITYSPELL_MASS_CHARM = 101; -IP_CONST_IMMUNITYSPELL_MASS_HEAL = 104; -IP_CONST_IMMUNITYSPELL_MELFS_ACID_ARROW = 105; -IP_CONST_IMMUNITYSPELL_METEOR_SWARM = 106; -IP_CONST_IMMUNITYSPELL_MIND_FOG = 108; -IP_CONST_IMMUNITYSPELL_MORDENKAINENS_DISJUNCTION = 112; -IP_CONST_IMMUNITYSPELL_PHANTASMAL_KILLER = 116; -IP_CONST_IMMUNITYSPELL_PLANAR_BINDING = 117; -IP_CONST_IMMUNITYSPELL_POISON = 118; -IP_CONST_IMMUNITYSPELL_POWER_WORD_KILL = 120; -IP_CONST_IMMUNITYSPELL_POWER_WORD_STUN = 121; -IP_CONST_IMMUNITYSPELL_PRISMATIC_SPRAY = 124; -IP_CONST_IMMUNITYSPELL_RAY_OF_ENFEEBLEMENT = 131; -IP_CONST_IMMUNITYSPELL_RAY_OF_FROST = 132; -IP_CONST_IMMUNITYSPELL_SCARE = 142; -IP_CONST_IMMUNITYSPELL_SEARING_LIGHT = 143; -IP_CONST_IMMUNITYSPELL_SHADES = 145; -IP_CONST_IMMUNITYSPELL_SHADOW_CONJURATION = 146; -IP_CONST_IMMUNITYSPELL_SILENCE = 150; -IP_CONST_IMMUNITYSPELL_SLAY_LIVING = 151; -IP_CONST_IMMUNITYSPELL_SLEEP = 152; -IP_CONST_IMMUNITYSPELL_SLOW = 153; -IP_CONST_IMMUNITYSPELL_SOUND_BURST = 154; -IP_CONST_IMMUNITYSPELL_STINKING_CLOUD = 158; -IP_CONST_IMMUNITYSPELL_STONESKIN = 159; -IP_CONST_IMMUNITYSPELL_STORM_OF_VENGEANCE = 160; -IP_CONST_IMMUNITYSPELL_SUNBEAM = 161; -IP_CONST_IMMUNITYSPELL_VIRTUE = 165; -IP_CONST_IMMUNITYSPELL_WAIL_OF_THE_BANSHEE = 166; -IP_CONST_IMMUNITYSPELL_WEB = 167; -IP_CONST_IMMUNITYSPELL_WEIRD = 168; -IP_CONST_IMMUNITYSPELL_WORD_OF_FAITH = 169; -IP_CONST_IMMUNITYSPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT = 171; -IP_CONST_IMMUNITYSPELL_EAGLE_SPLEDOR = 173; -IP_CONST_IMMUNITYSPELL_OWLS_WISDOM = 174; -IP_CONST_IMMUNITYSPELL_FOXS_CUNNING = 175; -IP_CONST_IMMUNITYSPELL_GREATER_EAGLES_SPLENDOR = 176; -IP_CONST_IMMUNITYSPELL_GREATER_OWLS_WISDOM = 177; -IP_CONST_IMMUNITYSPELL_GREATER_FOXS_CUNNING = 178; -IP_CONST_IMMUNITYSPELL_GREATER_BULLS_STRENGTH = 179; -IP_CONST_IMMUNITYSPELL_GREATER_CATS_GRACE = 180; -IP_CONST_IMMUNITYSPELL_GREATER_ENDURANCE = 181; -IP_CONST_IMMUNITYSPELL_AURA_OF_VITALITY = 182; -IP_CONST_IMMUNITYSPELL_WAR_CRY = 183; -IP_CONST_IMMUNITYSPELL_REGENERATE = 184; -IP_CONST_IMMUNITYSPELL_EVARDS_BLACK_TENTACLES = 185; -IP_CONST_IMMUNITYSPELL_LEGEND_LORE = 186; -IP_CONST_IMMUNITYSPELL_FIND_TRAPS = 187; -IP_CONST_SPELLLEVEL_0 = 0; --- hmm are these necessary? -IP_CONST_SPELLLEVEL_1 = 1; -IP_CONST_SPELLLEVEL_2 = 2; -IP_CONST_SPELLLEVEL_3 = 3; -IP_CONST_SPELLLEVEL_4 = 4; -IP_CONST_SPELLLEVEL_5 = 5; -IP_CONST_SPELLLEVEL_6 = 6; -IP_CONST_SPELLLEVEL_7 = 7; -IP_CONST_SPELLLEVEL_8 = 8; -IP_CONST_SPELLLEVEL_9 = 9; -IP_CONST_CASTSPELL_ACID_FOG_11 = 0; -IP_CONST_CASTSPELL_ACID_SPLASH_1 = 355; -IP_CONST_CASTSPELL_ACTIVATE_ITEM = 359; -IP_CONST_CASTSPELL_AID_3 = 1; -IP_CONST_CASTSPELL_AMPLIFY_5 = 373; -IP_CONST_CASTSPELL_ANIMATE_DEAD_10 = 3; -IP_CONST_CASTSPELL_ANIMATE_DEAD_15 = 4; -IP_CONST_CASTSPELL_ANIMATE_DEAD_5 = 2; -IP_CONST_CASTSPELL_AURA_OF_VITALITY_13 = 321; -IP_CONST_CASTSPELL_AURA_VERSUS_ALIGNMENT_15 = 287; -IP_CONST_CASTSPELL_AURAOFGLORY_7 = 360; -IP_CONST_CASTSPELL_AWAKEN_9 = 303; -IP_CONST_CASTSPELL_BALAGARNSIRONHORN_7 = 367; -IP_CONST_CASTSPELL_BANE_5 = 380; -IP_CONST_CASTSPELL_BANISHMENT_15 = 361; -IP_CONST_CASTSPELL_BARKSKIN_12 = 7; -IP_CONST_CASTSPELL_BARKSKIN_3 = 5; -IP_CONST_CASTSPELL_BARKSKIN_6 = 6; -IP_CONST_CASTSPELL_BESTOW_CURSE_5 = 8; -IP_CONST_CASTSPELL_BIGBYS_CLENCHED_FIST_20 = 393; -IP_CONST_CASTSPELL_BIGBYS_CRUSHING_HAND_20 = 394; -IP_CONST_CASTSPELL_BIGBYS_FORCEFUL_HAND_15 = 391; -IP_CONST_CASTSPELL_BIGBYS_GRASPING_HAND_17 = 392; -IP_CONST_CASTSPELL_BIGBYS_INTERPOSING_HAND_15 = 390; -IP_CONST_CASTSPELL_BLADE_BARRIER_11 = 9; -IP_CONST_CASTSPELL_BLADE_BARRIER_15 = 10; -IP_CONST_CASTSPELL_BLESS_2 = 11; -IP_CONST_CASTSPELL_BLINDNESS_DEAFNESS_3 = 14; -IP_CONST_CASTSPELL_BLOOD_FRENZY_7 = 353; -IP_CONST_CASTSPELL_BOMBARDMENT_20 = 354; -IP_CONST_CASTSPELL_BULLS_STRENGTH_10 = 16; -IP_CONST_CASTSPELL_BULLS_STRENGTH_15 = 17; -IP_CONST_CASTSPELL_BULLS_STRENGTH_3 = 15; -IP_CONST_CASTSPELL_BURNING_HANDS_2 = 18; -IP_CONST_CASTSPELL_BURNING_HANDS_5 = 19; -IP_CONST_CASTSPELL_CALL_LIGHTNING_10 = 21; -IP_CONST_CASTSPELL_CALL_LIGHTNING_5 = 20; -IP_CONST_CASTSPELL_CAMOFLAGE_5 = 352; -IP_CONST_CASTSPELL_CATS_GRACE_10 = 26; -IP_CONST_CASTSPELL_CATS_GRACE_15 = 27; -IP_CONST_CASTSPELL_CATS_GRACE_3 = 25; -IP_CONST_CASTSPELL_CHAIN_LIGHTNING_11 = 28; -IP_CONST_CASTSPELL_CHAIN_LIGHTNING_15 = 29; -IP_CONST_CASTSPELL_CHAIN_LIGHTNING_20 = 30; -IP_CONST_CASTSPELL_CHARM_MONSTER_10 = 32; -IP_CONST_CASTSPELL_CHARM_MONSTER_5 = 31; -IP_CONST_CASTSPELL_CHARM_PERSON_10 = 34; -IP_CONST_CASTSPELL_CHARM_PERSON_2 = 33; -IP_CONST_CASTSPELL_CHARM_PERSON_OR_ANIMAL_10 = 36; -IP_CONST_CASTSPELL_CHARM_PERSON_OR_ANIMAL_3 = 35; -IP_CONST_CASTSPELL_CIRCLE_OF_DEATH_11 = 37; -IP_CONST_CASTSPELL_CIRCLE_OF_DEATH_15 = 38; -IP_CONST_CASTSPELL_CIRCLE_OF_DEATH_20 = 39; -IP_CONST_CASTSPELL_CIRCLE_OF_DOOM_15 = 41; -IP_CONST_CASTSPELL_CIRCLE_OF_DOOM_20 = 42; -IP_CONST_CASTSPELL_CIRCLE_OF_DOOM_9 = 40; -IP_CONST_CASTSPELL_CLAIRAUDIENCE_CLAIRVOYANCE_10 = 44; -IP_CONST_CASTSPELL_CLAIRAUDIENCE_CLAIRVOYANCE_15 = 45; -IP_CONST_CASTSPELL_CLAIRAUDIENCE_CLAIRVOYANCE_5 = 43; -IP_CONST_CASTSPELL_CLARITY_3 = 46; -IP_CONST_CASTSPELL_CLOUDKILL_9 = 48; -IP_CONST_CASTSPELL_COLOR_SPRAY_2 = 49; -IP_CONST_CASTSPELL_CONE_OF_COLD_15 = 51; -IP_CONST_CASTSPELL_CONE_OF_COLD_9 = 50; -IP_CONST_CASTSPELL_CONFUSION_10 = 53; -IP_CONST_CASTSPELL_CONFUSION_5 = 52; -IP_CONST_CASTSPELL_CONTAGION_5 = 54; -IP_CONST_CASTSPELL_CONTINUAL_FLAME_7 = 350; -IP_CONST_CASTSPELL_CONTROL_UNDEAD_13 = 55; -IP_CONST_CASTSPELL_CONTROL_UNDEAD_20 = 56; -IP_CONST_CASTSPELL_CREATE_GREATER_UNDEAD_15 = 57; -IP_CONST_CASTSPELL_CREATE_GREATER_UNDEAD_16 = 58; -IP_CONST_CASTSPELL_CREATE_GREATER_UNDEAD_18 = 59; -IP_CONST_CASTSPELL_CREATE_UNDEAD_11 = 60; -IP_CONST_CASTSPELL_CREATE_UNDEAD_14 = 61; -IP_CONST_CASTSPELL_CREATE_UNDEAD_16 = 62; -IP_CONST_CASTSPELL_CREEPING_DOOM_13 = 304; -IP_CONST_CASTSPELL_CURE_CRITICAL_WOUNDS_12 = 64; -IP_CONST_CASTSPELL_CURE_CRITICAL_WOUNDS_15 = 65; -IP_CONST_CASTSPELL_CURE_CRITICAL_WOUNDS_7 = 63; -IP_CONST_CASTSPELL_CURE_LIGHT_WOUNDS_2 = 66; -IP_CONST_CASTSPELL_CURE_LIGHT_WOUNDS_5 = 67; -IP_CONST_CASTSPELL_CURE_MINOR_WOUNDS_1 = 68; -IP_CONST_CASTSPELL_CURE_MODERATE_WOUNDS_10 = 71; -IP_CONST_CASTSPELL_CURE_MODERATE_WOUNDS_3 = 69; -IP_CONST_CASTSPELL_CURE_MODERATE_WOUNDS_6 = 70; -IP_CONST_CASTSPELL_CURE_SERIOUS_WOUNDS_10 = 73; -IP_CONST_CASTSPELL_CURE_SERIOUS_WOUNDS_5 = 72; -IP_CONST_CASTSPELL_DARKNESS_3 = 75; -IP_CONST_CASTSPELL_DARKVISION_3 = 305; -IP_CONST_CASTSPELL_DARKVISION_6 = 306; -IP_CONST_CASTSPELL_DAZE_1 = 76; -IP_CONST_CASTSPELL_DEATH_WARD_7 = 77; -IP_CONST_CASTSPELL_DELAYED_BLAST_FIREBALL_13 = 78; -IP_CONST_CASTSPELL_DELAYED_BLAST_FIREBALL_15 = 79; -IP_CONST_CASTSPELL_DELAYED_BLAST_FIREBALL_20 = 80; -IP_CONST_CASTSPELL_DESTRUCTION_13 = 307; -IP_CONST_CASTSPELL_DIRGE_15 = 376; -IP_CONST_CASTSPELL_DISMISSAL_12 = 82; -IP_CONST_CASTSPELL_DISMISSAL_18 = 83; -IP_CONST_CASTSPELL_DISMISSAL_7 = 81; -IP_CONST_CASTSPELL_DISPEL_MAGIC_10 = 85; -IP_CONST_CASTSPELL_DISPEL_MAGIC_5 = 84; -IP_CONST_CASTSPELL_DISPLACEMENT_9 = 389; -IP_CONST_CASTSPELL_DIVINE_FAVOR_5 = 345; -IP_CONST_CASTSPELL_DIVINE_MIGHT_5 = 395; -IP_CONST_CASTSPELL_DIVINE_POWER_7 = 86; -IP_CONST_CASTSPELL_DIVINE_SHIELD_5 = 396; -IP_CONST_CASTSPELL_DOMINATE_ANIMAL_5 = 87; -IP_CONST_CASTSPELL_DOMINATE_MONSTER_17 = 88; -IP_CONST_CASTSPELL_DOMINATE_PERSON_7 = 89; -IP_CONST_CASTSPELL_DOOM_2 = 90; -IP_CONST_CASTSPELL_DOOM_5 = 91; -IP_CONST_CASTSPELL_DRAGON_BREATH_ACID_10 = 400; -IP_CONST_CASTSPELL_DRAGON_BREATH_COLD_10 = 401; -IP_CONST_CASTSPELL_DRAGON_BREATH_FEAR_10 = 402; -IP_CONST_CASTSPELL_DRAGON_BREATH_FIRE_10 = 403; -IP_CONST_CASTSPELL_DRAGON_BREATH_GAS_10 = 404; -IP_CONST_CASTSPELL_DRAGON_BREATH_LIGHTNING_10 = 405; -IP_CONST_CASTSPELL_DRAGON_BREATH_PARALYZE_10 = 406; -IP_CONST_CASTSPELL_DRAGON_BREATH_SLEEP_10 = 407; -IP_CONST_CASTSPELL_DRAGON_BREATH_SLOW_10 = 408; -IP_CONST_CASTSPELL_DRAGON_BREATH_WEAKEN_10 = 409; -IP_CONST_CASTSPELL_DROWN_15 = 368; -IP_CONST_CASTSPELL_EAGLE_SPLEDOR_10 = 289; -IP_CONST_CASTSPELL_EAGLE_SPLEDOR_15 = 290; -IP_CONST_CASTSPELL_EAGLE_SPLEDOR_3 = 288; -IP_CONST_CASTSPELL_EARTHQUAKE_20 = 357; -IP_CONST_CASTSPELL_ELECTRIC_JOLT_1 = 370; -IP_CONST_CASTSPELL_ELEMENTAL_SHIELD_12 = 93; -IP_CONST_CASTSPELL_ELEMENTAL_SHIELD_7 = 92; -IP_CONST_CASTSPELL_ELEMENTAL_SWARM_17 = 94; -IP_CONST_CASTSPELL_ENDURANCE_10 = 96; -IP_CONST_CASTSPELL_ENDURANCE_15 = 97; -IP_CONST_CASTSPELL_ENDURANCE_3 = 95; -IP_CONST_CASTSPELL_ENDURE_ELEMENTS_2 = 98; -IP_CONST_CASTSPELL_ENERGY_BUFFER_11 = 311; -IP_CONST_CASTSPELL_ENERGY_BUFFER_15 = 312; -IP_CONST_CASTSPELL_ENERGY_BUFFER_20 = 313; -IP_CONST_CASTSPELL_ENERGY_DRAIN_17 = 99; -IP_CONST_CASTSPELL_ENERVATION_7 = 100; -IP_CONST_CASTSPELL_ENTANGLE_2 = 101; -IP_CONST_CASTSPELL_ENTANGLE_5 = 102; -IP_CONST_CASTSPELL_ENTROPIC_SHIELD_5 = 349; -IP_CONST_CASTSPELL_ETHEREAL_VISAGE_15 = 196; -IP_CONST_CASTSPELL_ETHEREAL_VISAGE_9 = 195; -IP_CONST_CASTSPELL_ETHEREALNESS_18 = 374; -IP_CONST_CASTSPELL_EVARDS_BLACK_TENTACLES_15 = 325; -IP_CONST_CASTSPELL_EVARDS_BLACK_TENTACLES_7 = 324; -IP_CONST_CASTSPELL_EXPEDITIOUS_RETREAT_5 = 387; -IP_CONST_CASTSPELL_FEAR_5 = 103; -IP_CONST_CASTSPELL_FEEBLEMIND_9 = 104; -IP_CONST_CASTSPELL_FIND_TRAPS_3 = 327; -IP_CONST_CASTSPELL_FINGER_OF_DEATH_13 = 105; -IP_CONST_CASTSPELL_FIRE_STORM_13 = 106; -IP_CONST_CASTSPELL_FIRE_STORM_18 = 107; -IP_CONST_CASTSPELL_FIREBALL_10 = 109; -IP_CONST_CASTSPELL_FIREBALL_5 = 108; -IP_CONST_CASTSPELL_FIREBRAND_15 = 371; -IP_CONST_CASTSPELL_FLAME_ARROW_12 = 111; -IP_CONST_CASTSPELL_FLAME_ARROW_18 = 112; -IP_CONST_CASTSPELL_FLAME_ARROW_5 = 110; -IP_CONST_CASTSPELL_FLAME_LASH_10 = 114; -IP_CONST_CASTSPELL_FLAME_LASH_3 = 113; -IP_CONST_CASTSPELL_FLAME_STRIKE_12 = 116; -IP_CONST_CASTSPELL_FLAME_STRIKE_18 = 117; -IP_CONST_CASTSPELL_FLAME_STRIKE_7 = 115; -IP_CONST_CASTSPELL_FLARE_1 = 347; -IP_CONST_CASTSPELL_FLESH_TO_STONE_5 = 398; -IP_CONST_CASTSPELL_FOXS_CUNNING_10 = 295; -IP_CONST_CASTSPELL_FOXS_CUNNING_15 = 296; -IP_CONST_CASTSPELL_FOXS_CUNNING_3 = 294; -IP_CONST_CASTSPELL_FREEDOM_OF_MOVEMENT_7 = 118; -IP_CONST_CASTSPELL_GATE_17 = 119; -IP_CONST_CASTSPELL_GHOSTLY_VISAGE_15 = 194; -IP_CONST_CASTSPELL_GHOSTLY_VISAGE_3 = 192; -IP_CONST_CASTSPELL_GHOSTLY_VISAGE_9 = 193; -IP_CONST_CASTSPELL_GHOUL_TOUCH_3 = 120; -IP_CONST_CASTSPELL_GLOBE_OF_INVULNERABILITY_11 = 121; -IP_CONST_CASTSPELL_GREASE_2 = 122; -IP_CONST_CASTSPELL_GREATER_BULLS_STRENGTH_11 = 300; -IP_CONST_CASTSPELL_GREATER_CATS_GRACE_11 = 301; -IP_CONST_CASTSPELL_GREATER_DISPELLING_15 = 124; -IP_CONST_CASTSPELL_GREATER_DISPELLING_7 = 123; -IP_CONST_CASTSPELL_GREATER_EAGLES_SPLENDOR_11 = 297; -IP_CONST_CASTSPELL_GREATER_ENDURANCE_11 = 302; -IP_CONST_CASTSPELL_GREATER_FOXS_CUNNING_11 = 299; -IP_CONST_CASTSPELL_GREATER_MAGIC_FANG_9 = 384; -IP_CONST_CASTSPELL_GREATER_OWLS_WISDOM_11 = 298; -IP_CONST_CASTSPELL_GREATER_PLANAR_BINDING_15 = 126; -IP_CONST_CASTSPELL_GREATER_RESTORATION_13 = 127; -IP_CONST_CASTSPELL_GREATER_SHADOW_CONJURATION_9 = 128; -IP_CONST_CASTSPELL_GREATER_SPELL_BREACH_11 = 129; -IP_CONST_CASTSPELL_GREATER_SPELL_MANTLE_17 = 130; -IP_CONST_CASTSPELL_GREATER_STONESKIN_11 = 131; -IP_CONST_CASTSPELL_GRENADE_ACID_1 = 341; -IP_CONST_CASTSPELL_GRENADE_CALTROPS_1 = 343; -IP_CONST_CASTSPELL_GRENADE_CHICKEN_1 = 342; -IP_CONST_CASTSPELL_GRENADE_CHOKING_1 = 339; -IP_CONST_CASTSPELL_GRENADE_FIRE_1 = 336; -IP_CONST_CASTSPELL_GRENADE_HOLY_1 = 338; -IP_CONST_CASTSPELL_GRENADE_TANGLE_1 = 337; -IP_CONST_CASTSPELL_GRENADE_THUNDERSTONE_1 = 340; -IP_CONST_CASTSPELL_GUST_OF_WIND_10 = 410; -IP_CONST_CASTSPELL_HAMMER_OF_THE_GODS_12 = 134; -IP_CONST_CASTSPELL_HAMMER_OF_THE_GODS_7 = 133; -IP_CONST_CASTSPELL_HARM_11 = 136; -IP_CONST_CASTSPELL_HASTE_10 = 138; -IP_CONST_CASTSPELL_HASTE_5 = 137; -IP_CONST_CASTSPELL_HEAL_11 = 139; -IP_CONST_CASTSPELL_HEALING_CIRCLE_16 = 141; -IP_CONST_CASTSPELL_HEALING_CIRCLE_9 = 140; -IP_CONST_CASTSPELL_HOLD_ANIMAL_3 = 142; -IP_CONST_CASTSPELL_HOLD_MONSTER_7 = 143; -IP_CONST_CASTSPELL_HOLD_PERSON_3 = 144; -IP_CONST_CASTSPELL_HORRID_WILTING_15 = 308; -IP_CONST_CASTSPELL_HORRID_WILTING_20 = 309; -IP_CONST_CASTSPELL_ICE_STORM_9 = 310; -IP_CONST_CASTSPELL_IDENTIFY_3 = 147; -IP_CONST_CASTSPELL_IMPLOSION_17 = 148; -IP_CONST_CASTSPELL_IMPROVED_INVISIBILITY_7 = 149; -IP_CONST_CASTSPELL_INCENDIARY_CLOUD_15 = 150; -IP_CONST_CASTSPELL_INFERNO_15 = 377; -IP_CONST_CASTSPELL_INFLICT_CRITICAL_WOUNDS_12 = 366; -IP_CONST_CASTSPELL_INFLICT_LIGHT_WOUNDS_5 = 363; -IP_CONST_CASTSPELL_INFLICT_MINOR_WOUNDS_1 = 362; -IP_CONST_CASTSPELL_INFLICT_MODERATE_WOUNDS_7 = 364; -IP_CONST_CASTSPELL_INFLICT_SERIOUS_WOUNDS_9 = 365; -IP_CONST_CASTSPELL_INVISIBILITY_3 = 151; -IP_CONST_CASTSPELL_INVISIBILITY_PURGE_5 = 152; -IP_CONST_CASTSPELL_INVISIBILITY_SPHERE_5 = 153; -IP_CONST_CASTSPELL_ISAACS_GREATER_MISSILE_STORM_15 = 379; -IP_CONST_CASTSPELL_ISAACS_LESSER_MISSILE_STORM_13 = 378; -IP_CONST_CASTSPELL_KNOCK_3 = 154; -IP_CONST_CASTSPELL_LEGEND_LORE_5 = 326; -IP_CONST_CASTSPELL_LESSER_DISPEL_3 = 155; -IP_CONST_CASTSPELL_LESSER_DISPEL_5 = 156; -IP_CONST_CASTSPELL_LESSER_MIND_BLANK_9 = 157; -IP_CONST_CASTSPELL_LESSER_PLANAR_BINDING_9 = 158; -IP_CONST_CASTSPELL_LESSER_RESTORATION_3 = 159; -IP_CONST_CASTSPELL_LESSER_SPELL_BREACH_7 = 160; -IP_CONST_CASTSPELL_LESSER_SPELL_MANTLE_9 = 161; -IP_CONST_CASTSPELL_LIGHT_1 = 162; -IP_CONST_CASTSPELL_LIGHT_5 = 163; -IP_CONST_CASTSPELL_LIGHTNING_BOLT_10 = 165; -IP_CONST_CASTSPELL_LIGHTNING_BOLT_5 = 164; -IP_CONST_CASTSPELL_MAGE_ARMOR_2 = 167; -IP_CONST_CASTSPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT_5 = 286; -IP_CONST_CASTSPELL_MAGIC_FANG_5 = 383; -IP_CONST_CASTSPELL_MAGIC_MISSILE_3 = 172; -IP_CONST_CASTSPELL_MAGIC_MISSILE_5 = 173; -IP_CONST_CASTSPELL_MAGIC_MISSILE_9 = 174; -IP_CONST_CASTSPELL_MANIPULATE_PORTAL_STONE = 344; -IP_CONST_CASTSPELL_MASS_BLINDNESS_DEAFNESS_15 = 179; -IP_CONST_CASTSPELL_MASS_CAMOFLAGE_13 = 386; -IP_CONST_CASTSPELL_MASS_CHARM_15 = 180; -IP_CONST_CASTSPELL_MASS_HASTE_11 = 182; -IP_CONST_CASTSPELL_MASS_HEAL_15 = 183; -IP_CONST_CASTSPELL_MELFS_ACID_ARROW_3 = 184; -IP_CONST_CASTSPELL_MELFS_ACID_ARROW_6 = 185; -IP_CONST_CASTSPELL_MELFS_ACID_ARROW_9 = 186; -IP_CONST_CASTSPELL_METEOR_SWARM_17 = 187; -IP_CONST_CASTSPELL_MIND_BLANK_15 = 188; -IP_CONST_CASTSPELL_MIND_FOG_9 = 189; -IP_CONST_CASTSPELL_MINOR_GLOBE_OF_INVULNERABILITY_15 = 191; -IP_CONST_CASTSPELL_MINOR_GLOBE_OF_INVULNERABILITY_7 = 190; -IP_CONST_CASTSPELL_MORDENKAINENS_DISJUNCTION_17 = 197; -IP_CONST_CASTSPELL_MORDENKAINENS_SWORD_13 = 198; -IP_CONST_CASTSPELL_MORDENKAINENS_SWORD_18 = 199; -IP_CONST_CASTSPELL_NATURES_BALANCE_15 = 200; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_BURST_10 = 315; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_BURST_5 = 314; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_PROTECTION_10 = 202; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_PROTECTION_15 = 203; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_PROTECTION_5 = 201; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_RAY_1 = 316; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_RAY_3 = 317; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_RAY_5 = 318; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_RAY_7 = 319; -IP_CONST_CASTSPELL_NEGATIVE_ENERGY_RAY_9 = 320; -IP_CONST_CASTSPELL_NEUTRALIZE_POISON_5 = 204; -IP_CONST_CASTSPELL_ONE_WITH_THE_LAND_7 = 351; -IP_CONST_CASTSPELL_OWLS_INSIGHT_15 = 369; -IP_CONST_CASTSPELL_OWLS_WISDOM_10 = 292; -IP_CONST_CASTSPELL_OWLS_WISDOM_15 = 293; -IP_CONST_CASTSPELL_OWLS_WISDOM_3 = 291; -IP_CONST_CASTSPELL_PHANTASMAL_KILLER_7 = 205; -IP_CONST_CASTSPELL_PLANAR_ALLY_15 = 382; -IP_CONST_CASTSPELL_PLANAR_BINDING_11 = 206; -IP_CONST_CASTSPELL_POISON_5 = 207; -IP_CONST_CASTSPELL_POLYMORPH_SELF_7 = 208; -IP_CONST_CASTSPELL_POWER_WORD_KILL_17 = 209; -IP_CONST_CASTSPELL_POWER_WORD_STUN_13 = 210; -IP_CONST_CASTSPELL_PRAYER_5 = 211; -IP_CONST_CASTSPELL_PREMONITION_15 = 212; -IP_CONST_CASTSPELL_PRISMATIC_SPRAY_13 = 213; -IP_CONST_CASTSPELL_PROTECTION_FROM_ALIGNMENT_2 = 284; -IP_CONST_CASTSPELL_PROTECTION_FROM_ALIGNMENT_5 = 285; -IP_CONST_CASTSPELL_PROTECTION_FROM_ELEMENTS_10 = 217; -IP_CONST_CASTSPELL_PROTECTION_FROM_ELEMENTS_3 = 216; -IP_CONST_CASTSPELL_PROTECTION_FROM_SPELLS_13 = 224; -IP_CONST_CASTSPELL_PROTECTION_FROM_SPELLS_20 = 225; -IP_CONST_CASTSPELL_QUILLFIRE_8 = 356; -IP_CONST_CASTSPELL_RAISE_DEAD_9 = 226; -IP_CONST_CASTSPELL_RAY_OF_ENFEEBLEMENT_2 = 227; -IP_CONST_CASTSPELL_RAY_OF_FROST_1 = 228; -IP_CONST_CASTSPELL_REGENERATE_13 = 323; -IP_CONST_CASTSPELL_REMOVE_BLINDNESS_DEAFNESS_5 = 229; -IP_CONST_CASTSPELL_REMOVE_CURSE_5 = 230; -IP_CONST_CASTSPELL_REMOVE_DISEASE_5 = 231; -IP_CONST_CASTSPELL_REMOVE_FEAR_2 = 232; -IP_CONST_CASTSPELL_REMOVE_PARALYSIS_3 = 233; -IP_CONST_CASTSPELL_RESIST_ELEMENTS_10 = 235; -IP_CONST_CASTSPELL_RESIST_ELEMENTS_3 = 234; -IP_CONST_CASTSPELL_RESISTANCE_2 = 236; -IP_CONST_CASTSPELL_RESISTANCE_5 = 237; -IP_CONST_CASTSPELL_RESTORATION_7 = 238; -IP_CONST_CASTSPELL_RESURRECTION_13 = 239; -IP_CONST_CASTSPELL_ROGUES_CUNNING_3 = 328; -IP_CONST_CASTSPELL_SANCTUARY_2 = 240; -IP_CONST_CASTSPELL_SCARE_2 = 241; -IP_CONST_CASTSPELL_SEARING_LIGHT_5 = 242; -IP_CONST_CASTSPELL_SEE_INVISIBILITY_3 = 243; -IP_CONST_CASTSPELL_SHADES_11 = 244; -IP_CONST_CASTSPELL_SHADOW_CONJURATION_7 = 245; -IP_CONST_CASTSPELL_SHADOW_SHIELD_13 = 246; -IP_CONST_CASTSPELL_SHAPECHANGE_17 = 247; -IP_CONST_CASTSPELL_SHIELD_5 = 348; -IP_CONST_CASTSPELL_SHIELD_OF_FAITH_5 = 381; -IP_CONST_CASTSPELL_SILENCE_3 = 249; -IP_CONST_CASTSPELL_SLAY_LIVING_9 = 250; -IP_CONST_CASTSPELL_SLEEP_2 = 251; -IP_CONST_CASTSPELL_SLEEP_5 = 252; -IP_CONST_CASTSPELL_SLOW_5 = 253; -IP_CONST_CASTSPELL_SOUND_BURST_3 = 254; -IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_BEER = 330; -IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_SPIRITS = 332; -IP_CONST_CASTSPELL_SPECIAL_ALCOHOL_WINE = 331; -IP_CONST_CASTSPELL_SPECIAL_HERB_BELLADONNA = 333; -IP_CONST_CASTSPELL_SPECIAL_HERB_GARLIC = 334; -IP_CONST_CASTSPELL_SPELL_MANTLE_13 = 257; -IP_CONST_CASTSPELL_SPELL_RESISTANCE_15 = 256; -IP_CONST_CASTSPELL_SPELL_RESISTANCE_9 = 255; -IP_CONST_CASTSPELL_SPIKE_GROWTH_9 = 385; -IP_CONST_CASTSPELL_STINKING_CLOUD_5 = 259; -IP_CONST_CASTSPELL_STONE_TO_FLESH_5 = 399; -IP_CONST_CASTSPELL_STONESKIN_7 = 260; -IP_CONST_CASTSPELL_STORM_OF_VENGEANCE_17 = 261; -IP_CONST_CASTSPELL_SUMMON_CREATURE_I_2 = 262; -IP_CONST_CASTSPELL_SUMMON_CREATURE_I_5 = 263; -IP_CONST_CASTSPELL_SUMMON_CREATURE_II_3 = 264; -IP_CONST_CASTSPELL_SUMMON_CREATURE_III_5 = 265; -IP_CONST_CASTSPELL_SUMMON_CREATURE_IV_7 = 266; -IP_CONST_CASTSPELL_SUMMON_CREATURE_IX_17 = 267; -IP_CONST_CASTSPELL_SUMMON_CREATURE_V_9 = 268; -IP_CONST_CASTSPELL_SUMMON_CREATURE_VI_11 = 269; -IP_CONST_CASTSPELL_SUMMON_CREATURE_VII_13 = 270; -IP_CONST_CASTSPELL_SUMMON_CREATURE_VIII_15 = 271; -IP_CONST_CASTSPELL_SUNBEAM_13 = 272; -IP_CONST_CASTSPELL_SUNBURST_20 = 358; -IP_CONST_CASTSPELL_TASHAS_HIDEOUS_LAUGHTER_7 = 388; -IP_CONST_CASTSPELL_TENSERS_TRANSFORMATION_11 = 273; -IP_CONST_CASTSPELL_TIME_STOP_17 = 274; -IP_CONST_CASTSPELL_TRUE_SEEING_9 = 275; -IP_CONST_CASTSPELL_TRUE_STRIKE_5 = 346; -IP_CONST_CASTSPELL_UNDEATHS_ETERNAL_FOE_20 = 375; -IP_CONST_CASTSPELL_UNIQUE_POWER = 329; -IP_CONST_CASTSPELL_UNIQUE_POWER_SELF_ONLY = 335; -IP_CONST_CASTSPELL_VAMPIRIC_TOUCH_5 = 277; -IP_CONST_CASTSPELL_VIRTUE_1 = 278; -IP_CONST_CASTSPELL_WAIL_OF_THE_BANSHEE_17 = 279; -IP_CONST_CASTSPELL_WALL_OF_FIRE_9 = 280; -IP_CONST_CASTSPELL_WAR_CRY_7 = 322; -IP_CONST_CASTSPELL_WEB_3 = 281; -IP_CONST_CASTSPELL_WEIRD_17 = 282; -IP_CONST_CASTSPELL_WORD_OF_FAITH_13 = 283; -IP_CONST_CASTSPELL_WOUNDING_WHISPERS_9 = 372; -IP_CONST_SPELLSCHOOL_ABJURATION = 0; -IP_CONST_SPELLSCHOOL_CONJURATION = 1; -IP_CONST_SPELLSCHOOL_DIVINATION = 2; -IP_CONST_SPELLSCHOOL_ENCHANTMENT = 3; -IP_CONST_SPELLSCHOOL_EVOCATION = 4; -IP_CONST_SPELLSCHOOL_ILLUSION = 5; -IP_CONST_SPELLSCHOOL_NECROMANCY = 6; -IP_CONST_SPELLSCHOOL_TRANSMUTATION = 7; -IP_CONST_SPELLRESISTANCEBONUS_10 = 0; -IP_CONST_SPELLRESISTANCEBONUS_12 = 1; -IP_CONST_SPELLRESISTANCEBONUS_14 = 2; -IP_CONST_SPELLRESISTANCEBONUS_16 = 3; -IP_CONST_SPELLRESISTANCEBONUS_18 = 4; -IP_CONST_SPELLRESISTANCEBONUS_20 = 5; -IP_CONST_SPELLRESISTANCEBONUS_22 = 6; -IP_CONST_SPELLRESISTANCEBONUS_24 = 7; -IP_CONST_SPELLRESISTANCEBONUS_26 = 8; -IP_CONST_SPELLRESISTANCEBONUS_28 = 9; -IP_CONST_SPELLRESISTANCEBONUS_30 = 10; -IP_CONST_SPELLRESISTANCEBONUS_32 = 11; -IP_CONST_TRAPTYPE_SPIKE = 1; -IP_CONST_TRAPTYPE_HOLY = 2; -IP_CONST_TRAPTYPE_TANGLE = 3; -IP_CONST_TRAPTYPE_BLOBOFACID = 4; -IP_CONST_TRAPTYPE_FIRE = 5; -IP_CONST_TRAPTYPE_ELECTRICAL = 6; -IP_CONST_TRAPTYPE_GAS = 7; -IP_CONST_TRAPTYPE_FROST = 8; -IP_CONST_TRAPTYPE_ACID_SPLASH = 9; -IP_CONST_TRAPTYPE_SONIC = 10; -IP_CONST_TRAPTYPE_NEGATIVE = 11; -IP_CONST_TRAPSTRENGTH_MINOR = 0; -IP_CONST_TRAPSTRENGTH_AVERAGE = 1; -IP_CONST_TRAPSTRENGTH_STRONG = 2; -IP_CONST_TRAPSTRENGTH_DEADLY = 3; -IP_CONST_REDUCEDWEIGHT_80_PERCENT = 1; -IP_CONST_REDUCEDWEIGHT_60_PERCENT = 2; -IP_CONST_REDUCEDWEIGHT_40_PERCENT = 3; -IP_CONST_REDUCEDWEIGHT_20_PERCENT = 4; -IP_CONST_REDUCEDWEIGHT_10_PERCENT = 5; -IP_CONST_WEIGHTINCREASE_5_LBS = 0; -IP_CONST_WEIGHTINCREASE_10_LBS = 1; -IP_CONST_WEIGHTINCREASE_15_LBS = 2; -IP_CONST_WEIGHTINCREASE_30_LBS = 3; -IP_CONST_WEIGHTINCREASE_50_LBS = 4; -IP_CONST_WEIGHTINCREASE_100_LBS = 5; -IP_CONST_CLASS_BARBARIAN = 0; -IP_CONST_CLASS_BARD = 1; -IP_CONST_CLASS_CLERIC = 2; -IP_CONST_CLASS_DRUID = 3; -IP_CONST_CLASS_FIGHTER = 4; -IP_CONST_CLASS_MONK = 5; -IP_CONST_CLASS_PALADIN = 6; -IP_CONST_CLASS_RANGER = 7; -IP_CONST_CLASS_ROGUE = 8; -IP_CONST_CLASS_SORCERER = 9; -IP_CONST_CLASS_WIZARD = 10; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_50_PERCENT = 0; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_45_PERCENT = 1; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_40_PERCENT = 2; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_35_PERCENT = 3; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_30_PERCENT = 4; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_25_PERCENT = 5; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_20_PERCENT = 6; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_15_PERCENT = 7; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_10_PERCENT = 8; -IP_CONST_ARCANE_SPELL_FAILURE_MINUS_5_PERCENT = 9; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_5_PERCENT = 10; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_10_PERCENT = 11; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_15_PERCENT = 12; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_20_PERCENT = 13; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_25_PERCENT = 14; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_30_PERCENT = 15; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_35_PERCENT = 16; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_40_PERCENT = 17; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_45_PERCENT = 18; -IP_CONST_ARCANE_SPELL_FAILURE_PLUS_50_PERCENT = 19; -ACTION_MODE_DETECT = 0; -ACTION_MODE_STEALTH = 1; -ACTION_MODE_PARRY = 2; -ACTION_MODE_POWER_ATTACK = 3; -ACTION_MODE_IMPROVED_POWER_ATTACK = 4; -ACTION_MODE_COUNTERSPELL = 5; -ACTION_MODE_FLURRY_OF_BLOWS = 6; -ACTION_MODE_RAPID_SHOT = 7; -ACTION_MODE_EXPERTISE = 8; -ACTION_MODE_IMPROVED_EXPERTISE = 9; -ACTION_MODE_DEFENSIVE_CAST = 10; -ACTION_MODE_DIRTY_FIGHTING = 11; -ITEM_VISUAL_ACID = 0; -ITEM_VISUAL_COLD = 1; -ITEM_VISUAL_ELECTRICAL = 2; -ITEM_VISUAL_FIRE = 3; -ITEM_VISUAL_SONIC = 4; -ITEM_VISUAL_HOLY = 5; -ITEM_VISUAL_EVIL = 6; --- these constants must match those in the skyboxes.2da -SKYBOX_NONE = 0; -SKYBOX_GRASS_CLEAR = 1; -SKYBOX_GRASS_STORM = 2; -SKYBOX_DESERT_CLEAR = 3; -SKYBOX_WINTER_CLEAR = 4; -SKYBOX_ICY = 5; -FOG_TYPE_ALL = 0; -FOG_TYPE_SUN = 1; -FOG_TYPE_MOON = 2; -FOG_COLOR_RED = 16711680; -FOG_COLOR_RED_DARK = 6684672; -FOG_COLOR_GREEN = 65280; -FOG_COLOR_GREEN_DARK = 23112; -FOG_COLOR_BLUE = 255; -FOG_COLOR_BLUE_DARK = 102; -FOG_COLOR_BLACK = 0; -FOG_COLOR_WHITE = 16777215; -FOG_COLOR_GREY = 10066329; -FOG_COLOR_YELLOW = 16776960; -FOG_COLOR_YELLOW_DARK = 11184640; -FOG_COLOR_CYAN = 65535; -FOG_COLOR_MAGENTA = 16711935; -FOG_COLOR_ORANGE = 16750848; -FOG_COLOR_ORANGE_DARK = 13395456; -FOG_COLOR_BROWN = 10053120; -FOG_COLOR_BROWN_DARK = 6697728; --- these constants must match those in the AmbientSound.2da -AMBIENT_SOUND_NONE = 0; -AMBIENT_SOUND_MEN_WHISPER_INSIDE = 1; -AMBIENT_SOUND_WOMEN_WHISPER_INSIDE = 2; -AMBIENT_SOUND_PEOPLE_WHISPER_INSIDE = 3; -AMBIENT_SOUND_SMALL_GROUP_TALKS_INSIDE = 4; -AMBIENT_SOUND_MEDIUM_GROUP_TALKS_INSIDE = 5; -AMBIENT_SOUND_LARGE_GROUP_TALKS_INSIDE = 6; -AMBIENT_SOUND_COMMONER_TAVERN_TALK = 7; -AMBIENT_SOUND_NOBLE_TAVERN_TALK = 8; -AMBIENT_SOUND_CITY_SLUMS_DAY_CROWDED = 9; -AMBIENT_SOUND_CITY_SLUMS_DAY_SPARSE = 10; -AMBIENT_SOUND_CITY_SLUMS_NIGHT = 11; -AMBIENT_SOUND_CITY_DAY_CROWDED = 12; -AMBIENT_SOUND_CITY_DAY_SPARSE = 13; -AMBIENT_SOUND_CITY_NIGHT = 14; -AMBIENT_SOUND_CITY_MARKET = 15; -AMBIENT_SOUND_CITY_TEMPLE_DISTRICT = 16; -AMBIENT_SOUND_TOWN_DAY_CROWDED = 17; -AMBIENT_SOUND_TOWN_DAY_SPARSE = 18; -AMBIENT_SOUND_TOWN_NIGHT = 19; -AMBIENT_SOUND_BORDELLO_WOMEN = 20; -AMBIENT_SOUND_BORDELLO_MEN_AND_WOMEN = 21; -AMBIENT_SOUND_RIOT_OUTSIDE = 22; -AMBIENT_SOUND_RIOT_MUFFLED = 23; -AMBIENT_SOUND_COMBAT_OUTSIDE_1 = 24; -AMBIENT_SOUND_COMBAT_OUTSIDE_2 = 25; -AMBIENT_SOUND_COMBAT_MUFFLED_1 = 26; -AMBIENT_SOUND_COMBAT_MUFFLED_2 = 27; -AMBIENT_SOUND_DUNGEON_LAKE_LAVA = 28; -AMBIENT_SOUND_SEWER_SLUDGE_LAKE = 29; -AMBIENT_SOUND_WIND_SOFT = 30; -AMBIENT_SOUND_WIND_MEDIUM = 31; -AMBIENT_SOUND_WIND_STRONG = 32; -AMBIENT_SOUND_WIND_FOREST = 33; -AMBIENT_SOUND_GUST_CHASM = 34; -AMBIENT_SOUND_GUST_CAVERN = 35; -AMBIENT_SOUND_GUST_GRASS = 36; -AMBIENT_SOUND_GUST_DRAFT = 37; -AMBIENT_SOUND_RAIN_LIGHT = 38; -AMBIENT_SOUND_RAIN_HARD = 39; -AMBIENT_SOUND_RAIN_STORM_SMALL = 40; -AMBIENT_SOUND_RAIN_STORM_BIG = 41; -AMBIENT_SOUND_CAVE_INSECTS_1 = 42; -AMBIENT_SOUND_CAVE_INSECTS_2 = 43; -AMBIENT_SOUND_INTERIOR_INSECTS_1 = 44; -AMBIENT_SOUND_INTERIOR_INSECTS_2 = 45; -AMBIENT_SOUND_LIZARD_FOLK_CAVE_CRYSTALS = 46; -AMBIENT_SOUND_SEWERS_1 = 47; -AMBIENT_SOUND_SEWERS_2 = 48; -AMBIENT_SOUND_FOREST_DAY_1 = 49; -AMBIENT_SOUND_FOREST_DAY_2 = 50; -AMBIENT_SOUND_FOREST_DAY_3 = 51; -AMBIENT_SOUND_FOREST_DAY_SCARY = 52; -AMBIENT_SOUND_FOREST_NIGHT_1 = 53; -AMBIENT_SOUND_FOREST_NIGHT_2 = 54; -AMBIENT_SOUND_FOREST_NIGHT_SCARY = 55; -AMBIENT_SOUND_FOREST_MAGICAL = 56; -AMBIENT_SOUND_EVIL_DUNGEON_SMALL = 57; -AMBIENT_SOUND_EVIL_DUNGEON_MEDIUM = 58; -AMBIENT_SOUND_EVIL_DUNGEON_LARGE = 59; -AMBIENT_SOUND_CAVE_SMALL = 60; -AMBIENT_SOUND_CAVE_MEDIUM = 61; -AMBIENT_SOUND_CAVE_LARGE = 62; -AMBIENT_SOUND_MINE_SMALL = 63; -AMBIENT_SOUND_MINE_MEDIUM = 64; -AMBIENT_SOUND_MINE_LARGE = 65; -AMBIENT_SOUND_CASTLE_INTERIOR_SMALL = 66; -AMBIENT_SOUND_CASTLE_INTERIOR_MEDIUM = 67; -AMBIENT_SOUND_CASTLE_INTERIOR_LARGE = 68; -AMBIENT_SOUND_CRYPT_SMALL = 69; -AMBIENT_SOUND_CRYPT_MEDIUM_1 = 70; -AMBIENT_SOUND_CRYPT_MEDIUM_2 = 71; -AMBIENT_SOUND_HOUSE_INTERIOR_1 = 72; -AMBIENT_SOUND_HOUSE_INTERIOR_2 = 73; -AMBIENT_SOUND_HOUSE_INTERIOR_3 = 74; -AMBIENT_SOUND_KITCHEN_INTERIOR_SMALL = 75; -AMBIENT_SOUND_KITCHEN_INTERIOR_LARGE = 76; -AMBIENT_SOUND_HAUNTED_INTERIOR_1 = 77; -AMBIENT_SOUND_HAUNTED_INTERIOR_2 = 78; -AMBIENT_SOUND_HAUNTED_INTERIOR_3 = 79; -AMBIENT_SOUND_BLACK_SMITH = 80; -AMBIENT_SOUND_PIT_CRIES = 81; -AMBIENT_SOUND_MAGIC_INTERIOR_SMALL = 82; -AMBIENT_SOUND_MAGIC_INTERIOR_MEDIUM = 83; -AMBIENT_SOUND_MAGIC_INTERIOR_LARGE = 84; -AMBIENT_SOUND_MAGIC_INTERIOR_EVIL = 85; -AMBIENT_SOUND_MAGICAL_INTERIOR_FIRELAB = 86; -AMBIENT_SOUND_MAGICAL_INTERIOR_EARTHLAB = 87; -AMBIENT_SOUND_MAGICAL_INTERIOR_AIRLAB = 88; -AMBIENT_SOUND_MAGICAL_INTERIOR_WATERLAB = 89; -AMBIENT_SOUND_WINTER_DAY_WET_XP1 = 90; -AMBIENT_SOUND_WINTER_DAY_WINDY_XP1 = 91; -AMBIENT_SOUND_DESERT_DAY_XP1 = 92; -AMBIENT_SOUND_DESERT_NIGHT_XP1 = 93; -AMBIENT_SOUND_MONASTERY_INTERIOR_XP1 = 94; -AMBIENT_SOUND_RUIN_WET_XP1 = 96; -AMBIENT_SOUND_RUIN_RUMBLING_XP1 = 97; -AMBIENT_SOUND_RUIN_HAUNTED_XP1 = 98; -AMBIENT_SOUND_SAND_STORM_LIGHT_XP1 = 99; -AMBIENT_SOUND_SAND_STORM_EXTREME_XP1 = 100; -AMBIENT_SOUND_EVIL_DRONE_XP2 = 101; -AMBIENT_SOUND_PLAIN_OF_FIRE_XP2 = 102; -AMBIENT_SOUND_FROZEN_HELL_XP2 = 103; -AMBIENT_SOUND_CAVE_EVIL_1_XP2 = 104; -AMBIENT_SOUND_CAVE_EVIL_2_XP2 = 105; -AMBIENT_SOUND_CAVE_EVIL_3_XP2 = 106; -AMBIENT_SOUND_TAVERN_ROWDY = 107; --- these constants must match those in the FootstepSounds.2da -FOOTSTEP_TYPE_INVALID = -1; -FOOTSTEP_TYPE_NORMAL = 0; -FOOTSTEP_TYPE_LARGE = 1; -FOOTSTEP_TYPE_DRAGON = 2; -FOOTSTEP_TYPE_SOFT = 3; -FOOTSTEP_TYPE_HOOF = 4; -FOOTSTEP_TYPE_HOOF_LARGE = 5; -FOOTSTEP_TYPE_BEETLE = 6; -FOOTSTEP_TYPE_SPIDER = 7; -FOOTSTEP_TYPE_SKELETON = 8; -FOOTSTEP_TYPE_LEATHER_WING = 9; -FOOTSTEP_TYPE_FEATHER_WING = 10; --- int FOOTSTEP_TYPE_LIZARD = 11; -- Was not ever used/fully implemented. -FOOTSTEP_TYPE_NONE = 12; -FOOTSTEP_TYPE_SEAGULL = 13; -FOOTSTEP_TYPE_SHARK = 14; -FOOTSTEP_TYPE_WATER_NORMAL = 15; -FOOTSTEP_TYPE_WATER_LARGE = 16; -FOOTSTEP_TYPE_HORSE = 17; -FOOTSTEP_TYPE_DEFAULT = 65535; --- these constants must match those in the WingModel.2da -CREATURE_WING_TYPE_NONE = 0; -CREATURE_WING_TYPE_DEMON = 1; -CREATURE_WING_TYPE_ANGEL = 2; -CREATURE_WING_TYPE_BAT = 3; -CREATURE_WING_TYPE_DRAGON = 4; -CREATURE_WING_TYPE_BUTTERFLY = 5; -CREATURE_WING_TYPE_BIRD = 6; --- these constants must match those in the TailModel.2da -CREATURE_TAIL_TYPE_NONE = 0; -CREATURE_TAIL_TYPE_LIZARD = 1; -CREATURE_TAIL_TYPE_BONE = 2; -CREATURE_TAIL_TYPE_DEVIL = 3; --- these constants must match those in the CAPart.2da -CREATURE_PART_RIGHT_FOOT = 0; -CREATURE_PART_LEFT_FOOT = 1; -CREATURE_PART_RIGHT_SHIN = 2; -CREATURE_PART_LEFT_SHIN = 3; -CREATURE_PART_LEFT_THIGH = 4; -CREATURE_PART_RIGHT_THIGH = 5; -CREATURE_PART_PELVIS = 6; -CREATURE_PART_TORSO = 7; -CREATURE_PART_BELT = 8; -CREATURE_PART_NECK = 9; -CREATURE_PART_RIGHT_FOREARM = 10; -CREATURE_PART_LEFT_FOREARM = 11; -CREATURE_PART_RIGHT_BICEP = 12; -CREATURE_PART_LEFT_BICEP = 13; -CREATURE_PART_RIGHT_SHOULDER = 14; -CREATURE_PART_LEFT_SHOULDER = 15; -CREATURE_PART_RIGHT_HAND = 16; -CREATURE_PART_LEFT_HAND = 17; -CREATURE_PART_HEAD = 20; -CREATURE_MODEL_TYPE_NONE = 0; -CREATURE_MODEL_TYPE_SKIN = 1; -CREATURE_MODEL_TYPE_TATTOO = 2; -CREATURE_MODEL_TYPE_UNDEAD = 255; -COLOR_CHANNEL_SKIN = 0; -COLOR_CHANNEL_HAIR = 1; -COLOR_CHANNEL_TATTOO_1 = 2; -COLOR_CHANNEL_TATTOO_2 = 3; --- The following resrefs must match those in the tileset's set file. -TILESET_RESREF_BEHOLDER_CAVES = "tib01"; -TILESET_RESREF_CASTLE_INTERIOR = "tic01"; -TILESET_RESREF_CITY_EXTERIOR = "tcn01"; -TILESET_RESREF_CITY_INTERIOR = "tin01"; -TILESET_RESREF_CRYPT = "tdc01"; -TILESET_RESREF_DESERT = "ttd01"; -TILESET_RESREF_DROW_INTERIOR = "tid01"; -TILESET_RESREF_DUNGEON = "tde01"; -TILESET_RESREF_FOREST = "ttf01"; -TILESET_RESREF_FROZEN_WASTES = "tti01"; -TILESET_RESREF_ILLITHID_INTERIOR = "tii01"; -TILESET_RESREF_MICROSET = "tms01"; -TILESET_RESREF_MINES_AND_CAVERNS = "tdm01"; -TILESET_RESREF_RUINS = "tdr01"; -TILESET_RESREF_RURAL = "ttr01"; -TILESET_RESREF_RURAL_WINTER = "tts01"; -TILESET_RESREF_SEWERS = "tds01"; -TILESET_RESREF_UNDERDARK = "ttu01"; --- These constants determine which name table to use when generating random names. -NAME_FIRST_GENERIC_MALE = -1; -NAME_ANIMAL = 0; -NAME_FAMILIAR = 1; -NAME_FIRST_DWARF_MALE = 2; -NAME_FIRST_DWARF_FEMALE = 3; -NAME_LAST_DWARF = 4; -NAME_FIRST_ELF_MALE = 5; -NAME_FIRST_ELF_FEMALE = 6; -NAME_LAST_ELF = 7; -NAME_FIRST_GNOME_MALE = 8; -NAME_FIRST_GNOME_FEMALE = 9; -NAME_LAST_GNOME = 10; -NAME_FIRST_HALFELF_MALE = 11; -NAME_FIRST_HALFELF_FEMALE = 12; -NAME_LAST_HALFELF = 13; -NAME_FIRST_HALFLING_MALE = 14; -NAME_FIRST_HALFLING_FEMALE = 15; -NAME_LAST_HALFLING = 16; -NAME_FIRST_HALFORC_MALE = 17; -NAME_FIRST_HALFORC_FEMALE = 18; -NAME_LAST_HALFORC = 19; -NAME_FIRST_HUMAN_MALE = 20; -NAME_FIRST_HUMAN_FEMALE = 21; -NAME_LAST_HUMAN = 22; -EVENT_SCRIPT_MODULE_ON_HEARTBEAT = 3000; -EVENT_SCRIPT_MODULE_ON_USER_DEFINED_EVENT = 3001; -EVENT_SCRIPT_MODULE_ON_MODULE_LOAD = 3002; -EVENT_SCRIPT_MODULE_ON_MODULE_START = 3003; -EVENT_SCRIPT_MODULE_ON_CLIENT_ENTER = 3004; -EVENT_SCRIPT_MODULE_ON_CLIENT_EXIT = 3005; -EVENT_SCRIPT_MODULE_ON_ACTIVATE_ITEM = 3006; -EVENT_SCRIPT_MODULE_ON_ACQUIRE_ITEM = 3007; -EVENT_SCRIPT_MODULE_ON_LOSE_ITEM = 3008; -EVENT_SCRIPT_MODULE_ON_PLAYER_DEATH = 3009; -EVENT_SCRIPT_MODULE_ON_PLAYER_DYING = 3010; -EVENT_SCRIPT_MODULE_ON_RESPAWN_BUTTON_PRESSED = 3011; -EVENT_SCRIPT_MODULE_ON_PLAYER_REST = 3012; -EVENT_SCRIPT_MODULE_ON_PLAYER_LEVEL_UP = 3013; -EVENT_SCRIPT_MODULE_ON_PLAYER_CANCEL_CUTSCENE = 3014; -EVENT_SCRIPT_MODULE_ON_EQUIP_ITEM = 3015; -EVENT_SCRIPT_MODULE_ON_UNEQUIP_ITEM = 3016; -EVENT_SCRIPT_MODULE_ON_PLAYER_CHAT = 3017; -EVENT_SCRIPT_AREA_ON_HEARTBEAT = 4000; -EVENT_SCRIPT_AREA_ON_USER_DEFINED_EVENT = 4001; -EVENT_SCRIPT_AREA_ON_ENTER = 4002; -EVENT_SCRIPT_AREA_ON_EXIT = 4003; -EVENT_SCRIPT_AREAOFEFFECT_ON_HEARTBEAT = 11000; -EVENT_SCRIPT_AREAOFEFFECT_ON_USER_DEFINED_EVENT = 11001; -EVENT_SCRIPT_AREAOFEFFECT_ON_OBJECT_ENTER = 11002; -EVENT_SCRIPT_AREAOFEFFECT_ON_OBJECT_EXIT = 11003; -EVENT_SCRIPT_CREATURE_ON_HEARTBEAT = 5000; -EVENT_SCRIPT_CREATURE_ON_NOTICE = 5001; -EVENT_SCRIPT_CREATURE_ON_SPELLCASTAT = 5002; -EVENT_SCRIPT_CREATURE_ON_MELEE_ATTACKED = 5003; -EVENT_SCRIPT_CREATURE_ON_DAMAGED = 5004; -EVENT_SCRIPT_CREATURE_ON_DISTURBED = 5005; -EVENT_SCRIPT_CREATURE_ON_END_COMBATROUND = 5006; -EVENT_SCRIPT_CREATURE_ON_DIALOGUE = 5007; -EVENT_SCRIPT_CREATURE_ON_SPAWN_IN = 5008; -EVENT_SCRIPT_CREATURE_ON_RESTED = 5009; -EVENT_SCRIPT_CREATURE_ON_DEATH = 5010; -EVENT_SCRIPT_CREATURE_ON_USER_DEFINED_EVENT = 5011; -EVENT_SCRIPT_CREATURE_ON_BLOCKED_BY_DOOR = 5012; -EVENT_SCRIPT_TRIGGER_ON_HEARTBEAT = 7000; -EVENT_SCRIPT_TRIGGER_ON_OBJECT_ENTER = 7001; -EVENT_SCRIPT_TRIGGER_ON_OBJECT_EXIT = 7002; -EVENT_SCRIPT_TRIGGER_ON_USER_DEFINED_EVENT = 7003; -EVENT_SCRIPT_TRIGGER_ON_TRAPTRIGGERED = 7004; -EVENT_SCRIPT_TRIGGER_ON_DISARMED = 7005; -EVENT_SCRIPT_TRIGGER_ON_CLICKED = 7006; -EVENT_SCRIPT_PLACEABLE_ON_CLOSED = 9000; -EVENT_SCRIPT_PLACEABLE_ON_DAMAGED = 9001; -EVENT_SCRIPT_PLACEABLE_ON_DEATH = 9002; -EVENT_SCRIPT_PLACEABLE_ON_DISARM = 9003; -EVENT_SCRIPT_PLACEABLE_ON_HEARTBEAT = 9004; -EVENT_SCRIPT_PLACEABLE_ON_INVENTORYDISTURBED = 9005; -EVENT_SCRIPT_PLACEABLE_ON_LOCK = 9006; -EVENT_SCRIPT_PLACEABLE_ON_MELEEATTACKED = 9007; -EVENT_SCRIPT_PLACEABLE_ON_OPEN = 9008; -EVENT_SCRIPT_PLACEABLE_ON_SPELLCASTAT = 9009; -EVENT_SCRIPT_PLACEABLE_ON_TRAPTRIGGERED = 9010; -EVENT_SCRIPT_PLACEABLE_ON_UNLOCK = 9011; -EVENT_SCRIPT_PLACEABLE_ON_USED = 9012; -EVENT_SCRIPT_PLACEABLE_ON_USER_DEFINED_EVENT = 9013; -EVENT_SCRIPT_PLACEABLE_ON_DIALOGUE = 9014; -EVENT_SCRIPT_PLACEABLE_ON_LEFT_CLICK = 9015; -EVENT_SCRIPT_DOOR_ON_OPEN = 10000; -EVENT_SCRIPT_DOOR_ON_CLOSE = 10001; -EVENT_SCRIPT_DOOR_ON_DAMAGE = 10002; -EVENT_SCRIPT_DOOR_ON_DEATH = 10003; -EVENT_SCRIPT_DOOR_ON_DISARM = 10004; -EVENT_SCRIPT_DOOR_ON_HEARTBEAT = 10005; -EVENT_SCRIPT_DOOR_ON_LOCK = 10006; -EVENT_SCRIPT_DOOR_ON_MELEE_ATTACKED = 10007; -EVENT_SCRIPT_DOOR_ON_SPELLCASTAT = 10008; -EVENT_SCRIPT_DOOR_ON_TRAPTRIGGERED = 10009; -EVENT_SCRIPT_DOOR_ON_UNLOCK = 10010; -EVENT_SCRIPT_DOOR_ON_USERDEFINED = 10011; -EVENT_SCRIPT_DOOR_ON_CLICKED = 10012; -EVENT_SCRIPT_DOOR_ON_DIALOGUE = 10013; -EVENT_SCRIPT_DOOR_ON_FAIL_TO_OPEN = 10014; -EVENT_SCRIPT_ENCOUNTER_ON_OBJECT_ENTER = 13000; -EVENT_SCRIPT_ENCOUNTER_ON_OBJECT_EXIT = 13001; -EVENT_SCRIPT_ENCOUNTER_ON_HEARTBEAT = 13002; -EVENT_SCRIPT_ENCOUNTER_ON_ENCOUNTER_EXHAUSTED = 13003; -EVENT_SCRIPT_ENCOUNTER_ON_USER_DEFINED_EVENT = 13004; -EVENT_SCRIPT_STORE_ON_OPEN = 14000; -EVENT_SCRIPT_STORE_ON_CLOSE = 14001; --- 1.75 -OBJECT_VISUAL_TRANSFORM_SCALE = 10; -OBJECT_VISUAL_TRANSFORM_ROTATE_X = 21; -OBJECT_VISUAL_TRANSFORM_ROTATE_Y = 22; -OBJECT_VISUAL_TRANSFORM_ROTATE_Z = 23; -OBJECT_VISUAL_TRANSFORM_TRANSLATE_X = 31; -OBJECT_VISUAL_TRANSFORM_TRANSLATE_Y = 32; -OBJECT_VISUAL_TRANSFORM_TRANSLATE_Z = 33; -OBJECT_VISUAL_TRANSFORM_ANIMATION_SPEED = 40; ---sLanguage = "nwscript"; - diff --git a/Plugins/Lua/lua/iterators.lua b/Plugins/Lua/lua/iterators.lua deleted file mode 100644 index 9e38cdba388..00000000000 --- a/Plugins/Lua/lua/iterators.lua +++ /dev/null @@ -1,113 +0,0 @@ --- Iterators Functions - -local function first_next_iterator(FirstFunction, NextFunction, CheckFunc, ...) - local obj, prevobj = FirstFunction(...) - local arguments = {...} - return function() - while CheckFunc(obj) do - prevobj, obj = obj, NextFunction(unpack(arguments)) - return prevobj - end - end -end - -function GetNearestObjects(nObjectType, oTarget) - local nNth = 1 - nObjectType = nObjectType or 32767 --OBJECT_TYPE_ALL - oTarget = oTarget or OBJECT_SELF - local obj, prevobj = GetNearestObject(nObjectType, oTarget, nNth) - return function() - while obj ~= OBJECT_INVALID do - nNth = nNth + 1 - prevobj, obj = obj, GetNearestObject(nObjectType, oTarget, nNth) - return prevobj - end - end -end - ---GetNearestCreature(nFirstCriteriaType, nFirstCriteriaValue, oTarget, nNth, nSecondCriteriaType,nSecondCriteriaValue,nThirdCriteriaType,nThirdCriteriaValue); -function GetNearestCreatures(nFirstCriteriaType, nFirstCriteriaValue, oTarget, nNth, nSecondCriteriaType,nSecondCriteriaValue,nThirdCriteriaType,nThirdCriteriaValue) - nNth = nNth or 1 - nSecondCriteriaType = nSecondCriteriaType or -1 - nSecondCriteriaValue = nSecondCriteriaValue or -1 - nThirdCriteriaType = nThirdCriteriaType or -1 - nThirdCriteriaValue = nThirdCriteriaValue or -1 - local obj, prevobj = GetNearestCreature(nFirstCriteriaType, nFirstCriteriaValue, oTarget, nNth, nSecondCriteriaType,nSecondCriteriaValue,nThirdCriteriaType,nThirdCriteriaValue) - return function() - while obj ~= OBJECT_INVALID do - nNth = nNth + 1 - prevobj, obj = obj, GetNearestCreature(nFirstCriteriaType, nFirstCriteriaValue, oTarget, nNth, nSecondCriteriaType,nSecondCriteriaValue,nThirdCriteriaType,nThirdCriteriaValue) - return prevobj - end - end -end - -function GetObjectsByTag(sTag) - local nNth = 0 - local obj, prevobj = GetObjectByTag(sTag, nNth) - return function() - while obj ~= OBJECT_INVALID do - nNth = nNth + 1 - prevobj, obj = obj, GetObjectByTag(sTag, nNth) - return prevobj - end - end -end - ---for creatures use 0 or lose one -function GetNearestObjectsByTag(sTag, oObject, nNth) - nNth = nNth or 1 --!!docs say 1 - local obj, prevobj = GetNearestObjectByTag(sTag, oObject, nNth) - return function() - while obj ~= OBJECT_INVALID do - nNth = nNth + 1 - prevobj, obj = obj, GetNearestObjectByTag(sTag, oObject, nNth) - return prevobj - end - end -end - -function ItemsInSlot(oPC) - local nslot = -1 - return function() - --while (nslot < (nwC.NUM_INVENTORY_SLOTS -2)) do - while (nslot < 16) do --(18 - 2) - nslot = nslot + 1 - local item = GetItemInSlot(nslot, oPC) - if item ~= OBJECT_INVALID then return nslot, item end - end - end -end - -function Effects(oPC) - return first_next_iterator(GetFirstEffect, GetNextEffect, GetIsEffectValid, oPC) -end - -function ObjectsInArea(oArea) - return first_next_iterator(GetFirstObjectInArea, GetNextObjectInArea, GetIsObjectValid, oArea) -end - -function AllInPersistentObject(oObject, ObjectType) - return first_next_iterator(GetFirstInPersistentObject, GetNextInPersistentObject, GetIsObjectValid, oObject, ObjectType) -end - -function ItemsInInventory(oTarget) - return first_next_iterator(GetFirstItemInInventory, GetNextItemInInventory, GetIsObjectValid, oTarget) -end - -function FactionMembers(oMember, bPCOnly) - return first_next_iterator(GetFirstFactionMember, GetNextFactionMember, GetIsObjectValid, oMember, bPCOnly) -end - -function AllPCs() - return first_next_iterator(GetFirstPC, GetNextPC, GetIsObjectValid) -end - -function ItemProperties(oItem) - return first_next_iterator(GetFirstItemProperty, GetNextItemProperty, GetIsItemPropertyValid, oItem) -end - -function AllAreas() - return first_next_iterator(GetFirstArea, GetNextArea, GetIsObjectValid) -end - diff --git a/Plugins/Lua/lua/nwn.lua b/Plugins/Lua/lua/nwn.lua deleted file mode 100644 index 5c129eb261d..00000000000 --- a/Plugins/Lua/lua/nwn.lua +++ /dev/null @@ -1,9653 +0,0 @@ - ---helper function to push booleans -function StackPushBoolean(bCond) - StackPushInteger(bCond and 1 or 0) -end - ---helper function to pop booleans -function StackPopBoolean() - return StackPopInteger() > 0 -end - --- Start NWN Functions - --- Get an integer between 0 and nMaxInteger-1. --- Return value on error: 0 -function Random(nMaxInteger) - StackPushInteger(nMaxInteger) - VM_ExecuteCommand(0, 1) - return StackPopInteger() -end - --- Output sString to the log file. -function PrintString(sString) - StackPushString(sString) - VM_ExecuteCommand(1, 1) -end - --- Output a formatted float to the log file. --- - nWidth should be a value from 0 to 18 inclusive. --- - nDecimals should be a value from 0 to 9 inclusive. -function PrintFloat(fFloat, nWidth, nDecimals) - nWidth = nWidth or 18 - nDecimals = nDecimals or 9 - - StackPushInteger(nDecimals) - StackPushInteger(nWidth) - StackPushFloat(fFloat) - VM_ExecuteCommand(2, 3) -end - --- Convert fFloat into a string. --- - nWidth should be a value from 0 to 18 inclusive. --- - nDecimals should be a value from 0 to 9 inclusive. -function FloatToString(fFloat, nWidth, nDecimals) - nWidth = nWidth or 18 - nDecimals = nDecimals or 9 - - StackPushInteger(nDecimals) - StackPushInteger(nWidth) - StackPushFloat(fFloat) - VM_ExecuteCommand(3, 3) - return StackPopString() -end - --- Output nInteger to the log file. -function PrintInteger(nInteger) - StackPushInteger(nInteger) - VM_ExecuteCommand(4, 1) -end - --- Output oObject's ID to the log file. -function PrintObject(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(5, 1) -end - --- Make oTarget run sScript and then return execution to the calling script. --- If sScript does not specify a compiled script, nothing happens. -function ExecuteScript(sScript, oTarget) - StackPushObject(oTarget) - StackPushString(sScript) - VM_ExecuteCommand(8, 2) -end - --- Clear all the actions of the caller. --- * No return value, but if an error occurs, the log file will contain --- "ClearAllActions failed.". --- - nClearCombatState: if true, this will immediately clear the combat state --- on a creature, which will stop the combat music and allow them to rest, --- engage in dialog, or other actions that they would normally have to wait for. -function ClearAllActions(bClearCombatState) - bClearCombatState = bClearCombatState or false - - StackPushBoolean(bClearCombatState) - VM_ExecuteCommand(9, 1) -end - --- Cause the caller to face fDirection. --- - fDirection is expressed as anticlockwise degrees from Due East. --- DIRECTION_EAST, DIRECTION_NORTH, DIRECTION_WEST and DIRECTION_SOUTH are --- predefined. (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South) -function SetFacing(fDirection) - StackPushFloat(fDirection) - VM_ExecuteCommand(10, 1) -end - --- Set the calendar to the specified date. --- - nYear should be from 0 to 32000 inclusive --- - nMonth should be from 1 to 12 inclusive --- - nDay should be from 1 to 28 inclusive --- 1) Time can only be advanced forwards attempting to set the time backwards --- will result in no change to the calendar. --- 2) If values larger than the month or day are specified, they will be wrapped --- around and the overflow will be used to advance the next field. --- e.g. Specifying a year of 1350, month of 33 and day of 10 will result in --- the calender being set to a year of 1352, a month of 9 and a day of 10. -function SetCalendar(nYear, nMonth, nDay) - StackPushInteger(nDay) - StackPushInteger(nMonth) - StackPushInteger(nYear) - VM_ExecuteCommand(11, 3) -end - --- Set the time to the time specified. --- - nHour should be from 0 to 23 inclusive --- - nMinute should be from 0 to 59 inclusive --- - nSecond should be from 0 to 59 inclusive --- - nMillisecond should be from 0 to 999 inclusive --- 1) Time can only be advanced forwards attempting to set the time backwards --- will result in the day advancing and then the time being set to that --- specified, e.g. if the current hour is 15 and then the hour is set to 3, --- the day will be advanced by 1 and the hour will be set to 3. --- 2) If values larger than the max hour, minute, second or millisecond are --- specified, they will be wrapped around and the overflow will be used to --- advance the next field, e.g. specifying 62 hours, 250 minutes, 10 seconds --- and 10 milliseconds will result in the calendar day being advanced by 2 --- and the time being set to 18 hours, 10 minutes, 10 milliseconds. -function SetTime(nHour, nMinute, nSecond, nMillisecond) - StackPushInteger(nMillisecond) - StackPushInteger(nSecond) - StackPushInteger(nMinute) - StackPushInteger(nHour) - VM_ExecuteCommand(12, 4) -end - --- Get the current calendar year. -function GetCalendarYear() - VM_ExecuteCommand(13, 0) - return StackPopInteger() -end - --- Get the current calendar month. -function GetCalendarMonth() - VM_ExecuteCommand(14, 0) - return StackPopInteger() -end - --- Get the current calendar day. -function GetCalendarDay() - VM_ExecuteCommand(15, 0) - return StackPopInteger() -end - --- Get the current hour. -function GetTimeHour() - VM_ExecuteCommand(16, 0) - return StackPopInteger() -end - --- Get the current minute -function GetTimeMinute() - VM_ExecuteCommand(17, 0) - return StackPopInteger() -end - --- Get the current second -function GetTimeSecond() - VM_ExecuteCommand(18, 0) - return StackPopInteger() -end - --- Get the current millisecond -function GetTimeMillisecond() - VM_ExecuteCommand(19, 0) - return StackPopInteger() -end - --- The action subject will generate a random location near its current location --- and pathfind to it. ActionRandomwalk never ends, which means it is neccessary --- to call ClearAllActions in order to allow a creature to perform any other action --- once ActionRandomWalk has been called. --- * No return value, but if an error occurs the log file will contain --- "ActionRandomWalk failed." -function ActionRandomWalk() - VM_ExecuteCommand(20, 0) -end - --- The action subject will move to lDestination. --- - lDestination: The object will move to this location. If the location is --- invalid or a path cannot be found to it, the command does nothing. --- - bRun: If this is TRUE, the action subject will run rather than walk --- * No return value, but if an error occurs the log file will contain --- "MoveToPoint failed." -function ActionMoveToLocation(lDestination, bRun) - bRun = bRun or false - - StackPushBoolean(bRun) - StackPushLocation(lDestination) - VM_ExecuteCommand(21, 2) -end - --- Cause the action subject to move to a certain distance from oMoveTo. --- If there is no path to oMoveTo, this command will do nothing. --- - oMoveTo: This is the object we wish the action subject to move to --- - bRun: If this is TRUE, the action subject will run rather than walk --- - fRange: This is the desired distance between the action subject and oMoveTo --- * No return value, but if an error occurs the log file will contain --- "ActionMoveToObject failed." -function ActionMoveToObject(oMoveTo, bRun, fRange) - bRun = bRun or false - fRange = fRange or 1.0 - - StackPushFloat(fRange) - StackPushBoolean(bRun) - StackPushObject(oMoveTo) - VM_ExecuteCommand(22, 3) -end - --- Cause the action subject to move to a certain distance away from oFleeFrom. --- - oFleeFrom: This is the object we wish the action subject to move away from. --- If oFleeFrom is not in the same area as the action subject, nothing will --- happen. --- - bRun: If this is TRUE, the action subject will run rather than walk --- - fMoveAwayRange: This is the distance we wish the action subject to put --- between themselves and oFleeFrom --- * No return value, but if an error occurs the log file will contain --- "ActionMoveAwayFromObject failed." -function ActionMoveAwayFromObject(oFleeFrom, bRun, fMoveAwayRange) - bRun = bRun or false - fMoveAwayRange = fMoveAwayRange or 40.0 - - StackPushFloat(fMoveAwayRange) - StackPushBoolean(bRun) - StackPushObject(oFleeFrom) - VM_ExecuteCommand(23, 3) -end - --- Get the area that oTarget is currently in --- * Return value on error: OBJECT_INVALID -function GetArea(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(24, 1) - return StackPopObject() -end - --- The value returned by this function depends on the object type of the caller: --- 1) If the caller is a door it returns the object that last --- triggered it. --- 2) If the caller is a trigger, area of effect, module, area or encounter it --- returns the object that last entered it. --- * Return value on error: OBJECT_INVALID --- When used for doors, this should only be called from the OnAreaTransitionClick --- event. Otherwise, it should only be called in OnEnter scripts. -function GetEnteringObject() - VM_ExecuteCommand(25, 0) - return StackPopObject() -end - --- Get the object that last left the caller. This function works on triggers, --- areas of effect, modules, areas and encounters. --- * Return value on error: OBJECT_INVALID --- Should only be called in OnExit scripts. -function GetExitingObject() - VM_ExecuteCommand(26, 0) - return StackPopObject() -end - --- Get the position of oTarget --- * Return value on error: vector (0.0f, 0.0f, 0.0f) -function GetPosition(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(27, 1) - return StackPopVector() -end - --- Get the direction in which oTarget is facing, expressed as a float between --- 0.0f and 360.0f --- * Return value on error: -1.0f -function GetFacing(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(28, 1) - return StackPopFloat() -end - --- Get the possessor of oItem --- * Return value on error: OBJECT_INVALID -function GetItemPossessor(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(29, 1) - return StackPopObject() -end - --- Get the object possessed by oCreature with the tag sItemTag --- * Return value on error: OBJECT_INVALID -function GetItemPossessedBy(oCreature, sItemTag) - StackPushString(sItemTag) - StackPushObject(oCreature) - VM_ExecuteCommand(30, 2) - return StackPopObject() -end - --- Create an item with the template sItemTemplate in oTarget's inventory. --- - nStackSize: This is the stack size of the item to be created --- - sNewTag: If this string is not empty, it will replace the default tag from the template --- * Return value: The object that has been created. On error, this returns --- OBJECT_INVALID. --- If the item created was merged into an existing stack of similar items, --- the function will return the merged stack object. If the merged stack --- overflowed, the function will return the overflowed stack that was created. -function CreateItemOnObject(sItemTemplate, oTarget, nStackSize, sNewTag) - oTarget = oTarget or OBJECT_SELF - nStackSize = nStackSize or 1 - sNewTag = sNewTag or "" - - StackPushString(sNewTag) - StackPushInteger(nStackSize) - StackPushObject(oTarget) - StackPushString(sItemTemplate) - VM_ExecuteCommand(31, 4) - return StackPopObject() -end - --- Equip oItem into nInventorySlot. --- - nInventorySlot: INVENTORY_SLOT_* --- * No return value, but if an error occurs the log file will contain --- "ActionEquipItem failed." --- --- Note: --- If the creature already has an item equipped in the slot specified, it will be --- unequipped automatically by the call to ActionEquipItem. --- --- In order for ActionEquipItem to succeed the creature must be able to equip the --- item oItem normally. This means that: --- 1) The item is in the creature's inventory. --- 2) The item must already be identified (if magical). --- 3) The creature has the level required to equip the item (if magical and ILR is on). --- 4) The creature possesses the required feats to equip the item (such as weapon proficiencies). -function ActionEquipItem(oItem, nInventorySlot) - StackPushInteger(nInventorySlot) - StackPushObject(oItem) - VM_ExecuteCommand(32, 2) -end - --- Unequip oItem from whatever slot it is currently in. -function ActionUnequipItem(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(33, 1) -end - --- Pick up oItem from the ground. --- * No return value, but if an error occurs the log file will contain --- "ActionPickUpItem failed." -function ActionPickUpItem(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(34, 1) -end - --- Put down oItem on the ground. --- * No return value, but if an error occurs the log file will contain --- "ActionPutDownItem failed." -function ActionPutDownItem(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(35, 1) -end - --- Get the last attacker of oAttackee. This should only be used ONLY in the --- OnAttacked events for creatures, placeables and doors. --- * Return value on error: OBJECT_INVALID -function GetLastAttacker(oAttackee) - oAttackee = oAttackee or OBJECT_SELF - - StackPushObject(oAttackee) - VM_ExecuteCommand(36, 1) - return StackPopObject() -end - --- Attack oAttackee. --- - bPassive: If this is TRUE, attack is in passive mode. -function ActionAttack(oAttackee, bPassive) - bPassive = bPassive or false - - StackPushBoolean(bPassive) - StackPushObject(oAttackee) - VM_ExecuteCommand(37, 2) -end - --- Get the creature nearest to oTarget, subject to all the criteria specified. --- - nFirstCriteriaType: CREATURE_TYPE_* --- - nFirstCriteriaValue: --- -> CLASS_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_CLASS --- -> SPELL_* if nFirstCriteriaType was CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT --- or CREATURE_TYPE_HAS_SPELL_EFFECT --- -> TRUE or FALSE if nFirstCriteriaType was CREATURE_TYPE_IS_ALIVE --- -> PERCEPTION_* if nFirstCriteriaType was CREATURE_TYPE_PERCEPTION --- -> PLAYER_CHAR_IS_PC or PLAYER_CHAR_NOT_PC if nFirstCriteriaType was --- CREATURE_TYPE_PLAYER_CHAR --- -> RACIAL_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_RACIAL_TYPE --- -> REPUTATION_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_REPUTATION --- For example, to get the nearest PC, use: --- (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC) --- - oTarget: We're trying to find the creature of the specified type that is --- nearest to oTarget --- - nNth: We don't have to find the first nearest: we can find the Nth nearest... --- - nSecondCriteriaType: This is used in the same way as nFirstCriteriaType to --- further specify the type of creature that we are looking for. --- - nSecondCriteriaValue: This is used in the same way as nFirstCriteriaValue --- to further specify the type of creature that we are looking for. --- - nThirdCriteriaType: This is used in the same way as nFirstCriteriaType to --- further specify the type of creature that we are looking for. --- - nThirdCriteriaValue: This is used in the same way as nFirstCriteriaValue to --- further specify the type of creature that we are looking for. --- * Return value on error: OBJECT_INVALID -function GetNearestCreature(nFirstCriteriaType, nFirstCriteriaValue, oTarget, nNth, nSecondCriteriaType, nSecondCriteriaValue, nThirdCriteriaType, nThirdCriteriaValue) - oTarget = oTarget or OBJECT_SELF - nNth = nNth or 1 - nSecondCriteriaType = nSecondCriteriaType or -1 - nSecondCriteriaValue = nSecondCriteriaValue or -1 - nThirdCriteriaType = nThirdCriteriaType or -1 - nThirdCriteriaValue = nThirdCriteriaValue or -1 - - StackPushInteger(nThirdCriteriaValue) - StackPushInteger(nThirdCriteriaType) - StackPushInteger(nSecondCriteriaValue) - StackPushInteger(nSecondCriteriaType) - StackPushInteger(nNth) - StackPushObject(oTarget) - StackPushInteger(nFirstCriteriaValue) - StackPushInteger(nFirstCriteriaType) - VM_ExecuteCommand(38, 8) - return StackPopObject() -end - --- Add a speak action to the action subject. --- - sStringToSpeak: String to be spoken --- - nTalkVolume: TALKVOLUME_* -function ActionSpeakString(sStringToSpeak, nTalkVolume) - nTalkVolume = nTalkVolume or 0 --TALKVOLUME_TALK - - StackPushInteger(nTalkVolume) - StackPushString(sStringToSpeak) - VM_ExecuteCommand(39, 2) -end - --- Cause the action subject to play an animation --- - nAnimation: ANIMATION_* --- - fSpeed: Speed of the animation --- - fDurationSeconds: Duration of the animation (this is not used for Fire and --- Forget animations) -function ActionPlayAnimation(nAnimation, fSpeed, fDurationSeconds) - fSpeed = fSpeed or 1.0 - fDurationSeconds = fDurationSeconds or 1.0 - - StackPushFloat(fDurationSeconds) - StackPushFloat(fSpeed) - StackPushInteger(nAnimation) - VM_ExecuteCommand(40, 3) -end - --- Get the distance from the caller to oObject in metres. --- * Return value on error: -1.0f -function GetDistanceToObject(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(41, 1) - return StackPopFloat() -end - --- * Returns TRUE if oObject is a valid object. -function GetIsObjectValid(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(42, 1) - return StackPopBoolean() -end - --- Cause the action subject to open oDoor -function ActionOpenDoor(oDoor) - StackPushObject(oDoor) - VM_ExecuteCommand(43, 1) -end - --- Cause the action subject to close oDoor -function ActionCloseDoor(oDoor) - StackPushObject(oDoor) - VM_ExecuteCommand(44, 1) -end - --- Change the direction in which the camera is facing --- - fDirection is expressed as anticlockwise degrees from Due East. --- (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South) --- A value of -1.0f for any parameter will be ignored and instead it will --- use the current camera value. --- This can be used to change the way the camera is facing after the player --- emerges from an area transition. --- - nTransitionType: CAMERA_TRANSITION_TYPE_* SNAP will immediately move the --- camera to the new position, while the other types will result in the camera moving gradually into position --- Pitch and distance are limited to valid values for the current camera mode: --- Top Down: Distance = 5-20, Pitch = 1-50 --- Driving camera: Distance = 6 (can't be changed), Pitch = 1-62 --- Chase: Distance = 5-20, Pitch = 1-50 --- *** NOTE *** In NWN:Hordes of the Underdark the camera limits have been relaxed to the following: --- Distance 1-25 --- Pitch 1-89 -function SetCameraFacing(fDirection, fDistance, fPitch, nTransitionType) - fDistance = fDistance or -1.0 - fPitch = fPitch or -1.0 - nTransitionType = nTransitionType or 0 --CAMERA_TRANSITION_TYPE_SNAP - - StackPushInteger(nTransitionType) - StackPushFloat(fPitch) - StackPushFloat(fDistance) - StackPushFloat(fDirection) - VM_ExecuteCommand(45, 4) -end - --- Play sSoundName --- - sSoundName: TBD - SS --- This will play a mono sound from the location of the object running the command. -function PlaySound(sSoundName) - StackPushString(sSoundName) - VM_ExecuteCommand(46, 1) -end - --- Get the object at which the caller last cast a spell --- * Return value on error: OBJECT_INVALID -function GetSpellTargetObject() - VM_ExecuteCommand(47, 0) - return StackPopObject() -end - --- This action casts a spell at oTarget. --- - nSpell: SPELL_* --- - oTarget: Target for the spell --- - nMetamagic: METAMAGIC_* --- - bCheat: If this is TRUE, then the executor of the action doesn't have to be --- able to cast the spell. --- - nDomainLevel: TBD - SS --- - nProjectilePathType: PROJECTILE_PATH_TYPE_* --- - bInstantSpell: If this is TRUE, the spell is cast immediately. This allows --- the end-user to simulate a high-level magic-user having lots of advance --- warning of impending trouble -function ActionCastSpellAtObject(nSpell, oTarget, nMetaMagic, bCheat, nDomainLevel, nProjectilePathType, bInstantSpell) - nMetaMagic = nMetaMagic or 255 --METAMAGIC_ANY - bCheat = bCheat or false - nDomainLevel = nDomainLevel or 0 - nProjectilePathType = nProjectilePathType or 0 --PROJECTILE_PATH_TYPE_DEFAULT - bInstantSpell = bInstantSpell or false - - StackPushBoolean(bInstantSpell) - StackPushInteger(nProjectilePathType) - StackPushInteger(nDomainLevel) - StackPushBoolean(bCheat) - StackPushInteger(nMetaMagic) - StackPushObject(oTarget) - StackPushInteger(nSpell) - VM_ExecuteCommand(48, 7) -end - --- Get the current hitpoints of oObject --- * Return value on error: 0 -function GetCurrentHitPoints(oObject) - oObject = oObject or OBJECT_SELF - StackPushObject(oObject) - VM_ExecuteCommand(49, 1) - return StackPopInteger() -end - --- Get the maximum hitpoints of oObject --- * Return value on error: 0 -function GetMaxHitPoints(oObject) - oObject = oObject or OBJECT_SELF - StackPushObject(oObject) - VM_ExecuteCommand(50, 1) - return StackPopInteger() -end - --- Get oObject's local integer variable sVarName --- * Return value on error: 0 -function GetLocalInt(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(51, 2) - return StackPopInteger() -end - --- Get oObject's local float variable sVarName --- * Return value on error: 0.0f -function GetLocalFloat(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(52, 2) - return StackPopFloat() -end - --- Get oObject's local string variable sVarName --- * Return value on error: "" -function GetLocalString(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(53, 2) - return StackPopString() -end - --- Get oObject's local object variable sVarName --- * Return value on error: OBJECT_INVALID -function GetLocalObject(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(54, 2) - return StackPopObject() -end - --- Set oObject's local integer variable sVarName to nValue -function SetLocalInt(oObject, sVarName, nValue) - StackPushInteger(nValue) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(55, 3) -end - --- Set oObject's local float variable sVarName to nValue -function SetLocalFloat(oObject, sVarName, fValue) - StackPushFloat(fValue) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(56, 3) -end - --- Set oObject's local string variable sVarName to nValue -function SetLocalString(oObject, sVarName, sValue) - StackPushString(sValue) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(57, 3) -end - --- Set oObject's local object variable sVarName to nValue -function SetLocalObject(oObject, sVarName, oValue) - StackPushObject(oValue) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(58, 3) -end - --- Get the length of sString --- * Return value on error: -1 -function GetStringLength(sString) - StackPushString(sString) - VM_ExecuteCommand(59, 1) - return StackPopInteger() -end - --- Convert sString into upper case --- * Return value on error: "" -function GetStringUpperCase(sString) - StackPushString(sString) - VM_ExecuteCommand(60, 1) - return StackPopString() -end - --- Convert sString into lower case --- * Return value on error: "" -function GetStringLowerCase(sString) - StackPushString(sString) - VM_ExecuteCommand(61, 1) - return StackPopString() -end - --- Get nCount characters from the right end of sString --- * Return value on error: "" -function GetStringRight(sString, nCount) - StackPushInteger(nCount) - StackPushString(sString) - VM_ExecuteCommand(62, 2) - return StackPopString() -end - --- Get nCounter characters from the left end of sString --- * Return value on error: "" -function GetStringLeft(sString, nCount) - StackPushInteger(nCount) - StackPushString(sString) - VM_ExecuteCommand(63, 2) - return StackPopString() -end - --- Insert sString into sDestination at nPosition --- * Return value on error: "" -function InsertString(sDestination, sString, nPosition) - StackPushInteger(nPosition) - StackPushString(sString) - StackPushString(sDestination) - VM_ExecuteCommand(64, 3) - return StackPopString() -end - --- Get nCount characters from sString, starting at nStart --- * Return value on error: "" -function GetSubString(sString, nStart, nCount) - StackPushInteger(nCount) - StackPushInteger(nStart) - StackPushString(sString) - VM_ExecuteCommand(65, 3) - return StackPopString() -end - --- Find the position of sSubstring inside sString --- - nStart: The character position to start searching at (from the left end of the string). --- * Return value on error: -1 -function FindSubString(sString, sSubString, nStart) - nStart = nStart or 0 - - StackPushInteger(nStart) - StackPushString(sSubString) - StackPushString(sString) - VM_ExecuteCommand(66, 3) - return StackPopInteger() -end - --- math operations --- Maths operation: absolute value of fValue -function fabs(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(67, 1) - return StackPopFloat() -end - --- Maths operation: cosine of fValue -function cos(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(68, 1) - return StackPopFloat() -end - --- Maths operation: sine of fValue -function sin(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(69, 1) - return StackPopFloat() -end - --- Maths operation: tan of fValue -function tan(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(70, 1) - return StackPopFloat() -end - --- Maths operation: arccosine of fValue --- * Returns zero if fValue > 1 or fValue < -1 -function acos(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(71, 1) - return StackPopFloat() -end - --- Maths operation: arcsine of fValue --- * Returns zero if fValue >1 or fValue < -1 -function asin(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(72, 1) - return StackPopFloat() -end - --- Maths operation: arctan of fValue -function atan(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(73, 1) - return StackPopFloat() -end - --- Maths operation: log of fValue --- * Returns zero if fValue <= zero -function log(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(74, 1) - return StackPopFloat() -end - --- Maths operation: fValue is raised to the power of fExponent --- * Returns zero if fValue ==0 and fExponent <0 -function pow(fValue, fExponent) - StackPushFloat(fExponent) - StackPushFloat(fValue) - VM_ExecuteCommand(75, 2) - return StackPopFloat() -end - --- Maths operation: square root of fValue --- * Returns zero if fValue <0 -function sqrt(fValue) - StackPushFloat(fValue) - VM_ExecuteCommand(76, 1) - return StackPopFloat() -end - --- Maths operation: integer absolute value of nValue --- * Return value on error: 0 -function abs(nValue) - StackPushInteger(nValue) - VM_ExecuteCommand(77, 1) - return StackPopInteger() -end - --- Create a Heal effect. This should be applied as an instantaneous effect. --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nDamageToHeal < 0. -function EffectHeal(nDamageToHeal) - StackPushInteger(nDamageToHeal) - VM_ExecuteCommand(78, 1) - return StackPopEffect() -end - --- Create a Damage effect --- - nDamageAmount: amount of damage to be dealt. This should be applied as an --- instantaneous effect. --- - nDamageType: DAMAGE_TYPE_* --- - nDamagePower: DAMAGE_POWER_* -function EffectDamage(nDamageAmount, nDamageType, nDamagePower) - nDamageType = nDamageType or 8 --DAMAGE_TYPE_MAGICAL - nDamagePower = nDamagePower or 0 --DAMAGE_POWER_NORMAL - - StackPushInteger(nDamagePower) - StackPushInteger(nDamageType) - StackPushInteger(nDamageAmount) - VM_ExecuteCommand(79, 3) - return StackPopEffect() -end - --- Create an Ability Increase effect --- - bAbilityToIncrease: ABILITY_* -function EffectAbilityIncrease(nAbilityToIncrease, nModifyBy) - StackPushInteger(nModifyBy) - StackPushInteger(nAbilityToIncrease) - VM_ExecuteCommand(80, 2) - return StackPopEffect() -end - --- Create a Damage Resistance effect that removes the first nAmount points of --- damage of type nDamageType, up to nLimit (or infinite if nLimit is 0) --- - nDamageType: DAMAGE_TYPE_* --- - nAmount --- - nLimit -function EffectDamageResistance(nDamageType, nAmount, nLimit) - nLimit = nLimit or 0 - - StackPushInteger(nLimit) - StackPushInteger(nAmount) - StackPushInteger(nDamageType) - VM_ExecuteCommand(81, 3) - return StackPopEffect() -end - --- Create a Resurrection effect. This should be applied as an instantaneous effect. -function EffectResurrection() - VM_ExecuteCommand(82, 0) - return StackPopEffect() -end - --- Create a Summon Creature effect. The creature is created and placed into the --- caller's party/faction. --- - sCreatureResref: Identifies the creature to be summoned --- - nVisualEffectId: VFX_* --- - fDelaySeconds: There can be delay between the visual effect being played, and the --- creature being added to the area --- - nUseAppearAnimation: should this creature play it's "appear" animation when it is --- summoned. If zero, it will just fade in somewhere near the target. If the value is 1 --- it will use the appear animation, and if it's 2 it will use appear2 (which doesn't exist for most creatures) -function EffectSummonCreature(sCreatureResref, nVisualEffectId, fDelaySeconds, bUseAppearAnimation) - nVisualEffectId = nVisualEffectId or -1 --VFX_NONE - fDelaySeconds = fDelaySeconds or 0.0 - bUseAppearAnimation = bUseAppearAnimation or false - - StackPushBoolean(bUseAppearAnimation) - StackPushFloat(fDelaySeconds) - StackPushInteger(nVisualEffectId) - StackPushString(sCreatureResref) - VM_ExecuteCommand(83, 4) - return StackPopEffect() -end - --- Get the level at which this creature cast it's last spell (or spell-like ability) --- * Return value on error, or if oCreature has not yet cast a spell: 0 -function GetCasterLevel(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(84, 1) - return StackPopInteger() -end - --- Get the first in-game effect on oCreature. -function GetFirstEffect(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(85, 1) - return StackPopEffect() -end - --- Get the next in-game effect on oCreature. -function GetNextEffect(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(86, 1) - return StackPopEffect() -end - --- Remove eEffect from oCreature. --- * No return value -function RemoveEffect(oCreature, eEffect) - StackPushEffect(eEffect) - StackPushObject(oCreature) - VM_ExecuteCommand(87, 2) -end - --- * Returns TRUE if eEffect is a valid effect. The effect must have been applied to --- * an object or else it will return FALSE -function GetIsEffectValid(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(88, 1) - return StackPopBoolean() -end - --- Get the duration type (DURATION_TYPE_*) of eEffect. --- * Return value if eEffect is not valid: -1 -function GetEffectDurationType(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(89, 1) - return StackPopInteger() -end - --- Get the subtype (SUBTYPE_*) of eEffect. --- * Return value on error: 0 -function GetEffectSubType(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(90, 1) - return StackPopInteger() -end - --- Get the object that created eEffect. --- * Returns OBJECT_INVALID if eEffect is not a valid effect. -function GetEffectCreator(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(91, 1) - return StackPopObject() -end - --- Convert nInteger into a string. --- * Return value on error: "" -function IntToString(nInteger) - StackPushInteger(nInteger) - VM_ExecuteCommand(92, 1) - return StackPopString() -end - --- Get the first object in oArea. --- If no valid area is specified, it will use the caller's area. --- * Return value on error: OBJECT_INVALID -function GetFirstObjectInArea(oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - VM_ExecuteCommand(93, 1) - return StackPopObject() -end - --- Get the next object in oArea. --- If no valid area is specified, it will use the caller's area. --- * Return value on error: OBJECT_INVALID -function GetNextObjectInArea(oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - VM_ExecuteCommand(94, 1) - return StackPopObject() -end - --- Get the total from rolling (nNumDice x d2 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d2(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(95, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d3 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d3(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(96, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d4 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d4(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(97, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d6 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d6(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(98, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d8 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d8(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(99, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d10 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d10(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(100, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d12 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d12(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(101, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d20 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d20(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(102, 1) - return StackPopInteger() -end - --- Get the total from rolling (nNumDice x d100 dice). --- - nNumDice: If this is less than 1, the value 1 will be used. -function d100(nNumDice) - nNumDice = nNumDice or 1 - - StackPushInteger(nNumDice) - VM_ExecuteCommand(103, 1) - return StackPopInteger() -end - --- Get the magnitude of vVector this can be used to determine the --- distance between two points. --- * Return value on error: 0.0f -function VectorMagnitude(vVector) - StackPushVector(vVector) - VM_ExecuteCommand(104, 1) - return StackPopFloat() -end - --- Get the metamagic type (METAMAGIC_*) of the last spell cast by the caller --- * Return value if the caster is not a valid object: -1 -function GetMetaMagicFeat() - VM_ExecuteCommand(105, 0) - return StackPopInteger() -end - --- Get the object type (OBJECT_TYPE_*) of oTarget --- * Return value if oTarget is not a valid object: -1 -function GetObjectType(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(106, 1) - return StackPopInteger() -end - --- Get the racial type (RACIAL_TYPE_*) of oCreature --- * Return value if oCreature is not a valid creature: RACIAL_TYPE_INVALID -function GetRacialType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(107, 1) - return StackPopInteger() -end - --- Do a Fortitude Save check for the given DC --- - oCreature --- - nDC: Difficulty check --- - nSaveType: SAVING_THROW_TYPE_* --- - oSaveVersus --- Returns: 0 if the saving throw roll failed --- Returns: 1 if the saving throw roll succeeded --- Returns: 2 if the target was immune to the save type specified --- Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass --- GetAreaOfEffectCreator() into oSaveVersus!! -function FortitudeSave(oCreature, nDC, nSaveType, oSaveVersus) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_NONE - oSaveVersus = oSaveVersus or OBJECT_SELF - - StackPushObject(oSaveVersus) - StackPushInteger(nSaveType) - StackPushInteger(nDC) - StackPushObject(oCreature) - VM_ExecuteCommand(108, 4) - return StackPopInteger() -end - --- Does a Reflex Save check for the given DC --- - oCreature --- - nDC: Difficulty check --- - nSaveType: SAVING_THROW_TYPE_* --- - oSaveVersus --- Returns: 0 if the saving throw roll failed --- Returns: 1 if the saving throw roll succeeded --- Returns: 2 if the target was immune to the save type specified --- Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass --- GetAreaOfEffectCreator() into oSaveVersus!! -function ReflexSave(oCreature, nDC, nSaveType, oSaveVersus) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_NONE - oSaveVersus = oSaveVersus or OBJECT_SELF - - StackPushObject(oSaveVersus) - StackPushInteger(nSaveType) - StackPushInteger(nDC) - StackPushObject(oCreature) - VM_ExecuteCommand(109, 4) - return StackPopInteger() -end - --- Does a Will Save check for the given DC --- - oCreature --- - nDC: Difficulty check --- - nSaveType: SAVING_THROW_TYPE_* --- - oSaveVersus --- Returns: 0 if the saving throw roll failed --- Returns: 1 if the saving throw roll succeeded --- Returns: 2 if the target was immune to the save type specified --- Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass --- GetAreaOfEffectCreator() into oSaveVersus!! -function WillSave(oCreature, nDC, nSaveType, oSaveVersus) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_NONE - oSaveVersus = oSaveVersus or OBJECT_SELF - - StackPushObject(oSaveVersus) - StackPushInteger(nSaveType) - StackPushInteger(nDC) - StackPushObject(oCreature) - VM_ExecuteCommand(110, 4) - return StackPopInteger() -end - --- Get the DC to save against for a spell (10 + spell level + relevant ability --- bonus). This can be called by a creature or by an Area of Effect object. -function GetSpellSaveDC() - VM_ExecuteCommand(111, 0) - return StackPopInteger() -end - --- Set the subtype of eEffect to Magical and return eEffect. --- (Effects default to magical if the subtype is not set) --- Magical effects are removed by resting, and by dispel magic -function MagicalEffect(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(112, 1) - return StackPopEffect() -end - --- Set the subtype of eEffect to Supernatural and return eEffect. --- (Effects default to magical if the subtype is not set) --- Permanent supernatural effects are not removed by resting -function SupernaturalEffect(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(113, 1) - return StackPopEffect() -end - --- Set the subtype of eEffect to Extraordinary and return eEffect. --- (Effects default to magical if the subtype is not set) --- Extraordinary effects are removed by resting, but not by dispel magic -function ExtraordinaryEffect(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(114, 1) - return StackPopEffect() -end - --- Create an AC Increase effect --- - nValue: size of AC increase --- - nModifyType: AC_*_BONUS --- - nDamageType: DAMAGE_TYPE_* --- * Default value for nDamageType should only ever be used in this function prototype. -function EffectACIncrease(nValue, nModifyType, nDamageType) - nModifyType = nModifyType or 0 --AC_DODGE_BONUS - nDamageType = nDamageType or 4103 --AC_VS_DAMAGE_TYPE_ALL - - StackPushInteger(nDamageType) - StackPushInteger(nModifyType) - StackPushInteger(nValue) - VM_ExecuteCommand(115, 3) - return StackPopEffect() -end - --- If oObject is a creature, this will return that creature's armour class --- If oObject is an item, door or placeable, this will return zero. --- - nForFutureUse: this parameter is not currently used --- * Return value if oObject is not a creature, item, door or placeable: -1 -function GetAC(oObject, nForFutureUse) - nForFutureUse = nForFutureUse or 0 - - StackPushInteger(nForFutureUse) - StackPushObject(oObject) - VM_ExecuteCommand(116, 2) - return StackPopInteger() -end - --- Create a Saving Throw Increase effect --- - nSave: SAVING_THROW_* (not SAVING_THROW_TYPE_*) --- SAVING_THROW_ALL --- SAVING_THROW_FORT --- SAVING_THROW_REFLEX --- SAVING_THROW_WILL --- - nValue: size of the Saving Throw increase --- - nSaveType: SAVING_THROW_TYPE_* (e.g. SAVING_THROW_TYPE_ACID ) -function EffectSavingThrowIncrease(nSave, nValue, nSaveType) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_ALL - - StackPushInteger(nSaveType) - StackPushInteger(nValue) - StackPushInteger(nSave) - VM_ExecuteCommand(117, 3) - return StackPopEffect() -end - --- Create an Attack Increase effect --- - nBonus: size of attack bonus --- - nModifierType: ATTACK_BONUS_* -function EffectAttackIncrease(nBonus, nModifierType) - nModifierType = nModifierType or 0 --ATTACK_BONUS_MISC - - StackPushInteger(nModifierType) - StackPushInteger(nBonus) - VM_ExecuteCommand(118, 2) - return StackPopEffect() -end - --- Create a Damage Reduction effect --- - nAmount: amount of damage reduction --- - nDamagePower: DAMAGE_POWER_* --- - nLimit: How much damage the effect can absorb before disappearing. --- Set to zero for infinite -function EffectDamageReduction(nAmount, nDamagePower, nLimit) - nLimit = nLimit or 0 - - StackPushInteger(nLimit) - StackPushInteger(nDamagePower) - StackPushInteger(nAmount) - VM_ExecuteCommand(119, 3) - return StackPopEffect() -end - --- Create a Damage Increase effect --- - nBonus: DAMAGE_BONUS_* --- - nDamageType: DAMAGE_TYPE_* --- NOTE! You *must* use the DAMAGE_BONUS_* constants! Using other values may --- result in odd behaviour. -function EffectDamageIncrease(nBonus, nDamageType) - nDamageType = nDamageType or 8 --DAMAGE_TYPE_MAGICAL - - StackPushInteger(nDamageType) - StackPushInteger(nBonus) - VM_ExecuteCommand(120, 2) - return StackPopEffect() -end - --- Convert nRounds into a number of seconds --- A round is always 6.0 seconds -function RoundsToSeconds(nRounds) - StackPushInteger(nRounds) - VM_ExecuteCommand(121, 1) - return StackPopFloat() -end - --- Convert nHours into a number of seconds --- The result will depend on how many minutes there are per hour (game-time) -function HoursToSeconds(nHours) - StackPushInteger(nHours) - VM_ExecuteCommand(122, 1) - return StackPopFloat() -end - --- Convert nTurns into a number of seconds --- A turn is always 60.0 seconds -function TurnsToSeconds(nTurns) - StackPushInteger(nTurns) - VM_ExecuteCommand(123, 1) - return StackPopFloat() -end - --- Get an integer between 0 and 100 (inclusive) to represent oCreature's --- Law/Chaos alignment --- (100=law, 0=chaos) --- * Return value if oCreature is not a valid creature: -1 -function GetLawChaosValue(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(124, 1) - return StackPopInteger() -end - --- Get an integer between 0 and 100 (inclusive) to represent oCreature's --- Good/Evil alignment --- (100=good, 0=evil) --- * Return value if oCreature is not a valid creature: -1 -function GetGoodEvilValue(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(125, 1) - return StackPopInteger() -end - --- Return an ALIGNMENT_* constant to represent oCreature's law/chaos alignment --- * Return value if oCreature is not a valid creature: -1 -function GetAlignmentLawChaos(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(126, 1) - return StackPopInteger() -end - --- Return an ALIGNMENT_* constant to represent oCreature's good/evil alignment --- * Return value if oCreature is not a valid creature: -1 -function GetAlignmentGoodEvil(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(127, 1) - return StackPopInteger() -end - --- Create an Entangle effect --- When applied, this effect will restrict the creature's movement and apply a --- (-2) to all attacks and a -4 to AC. -function EffectEntangle() - VM_ExecuteCommand(130, 0) - return StackPopEffect() -end - --- Causes object oObject to run the event evToRun. The script on the object that is --- associated with the event specified will run. --- Events can be created using the following event functions: --- EventActivateItem() - This creates an OnActivateItem module event. The script for handling --- this event can be set in Module Properties on the Event Tab. --- EventConversation() - This creates on OnConversation creature event. The script for handling --- this event can be set by viewing the Creature Properties on a --- creature and then clicking on the Scripts Tab. --- EventSpellCastAt() - This creates an OnSpellCastAt event. The script for handling this --- event can be set in the Scripts Tab of the Properties menu --- for the object. --- EventUserDefined() - This creates on OnUserDefined event. The script for handling this event --- can be set in the Scripts Tab of the Properties menu for the object/area/module. -function SignalEvent(oObject, eEvent) - StackPushEvent(eEvent) - StackPushObject(oObject) - VM_ExecuteCommand(131, 2) -end - --- Create an event of the type nUserDefinedEventNumber --- Note: This only creates the event. The event wont actually trigger until SignalEvent() --- is called using this created UserDefined event as an argument. --- For example: --- SignalEvent(oObject, EventUserDefined(9999)) --- Once the event has been signaled. The script associated with the OnUserDefined event will --- run on the object oObject. --- --- To specify the OnUserDefined script that should run, view the object's Properties --- and click on the Scripts Tab. Then specify a script for the OnUserDefined event. --- From inside the OnUserDefined script call: --- GetUserDefinedEventNumber() to retrieve the value of nUserDefinedEventNumber --- that was used when the event was signaled. -function EventUserDefined(nUserDefinedEventNumber) - StackPushInteger(nUserDefinedEventNumber) - VM_ExecuteCommand(132, 1) - return StackPopEvent() -end - --- Create a Death effect --- - nSpectacularDeath: if this is TRUE, the creature to which this effect is --- applied will die in an extraordinary fashion --- - nDisplayFeedback -function EffectDeath(bSpectacularDeath, bDisplayFeedback) - bSpectacularDeath = bSpectacularDeath or false - if bDisplayFeedback == nil then bDisplayFeedback = true end - - StackPushBoolean(bDisplayFeedback) - StackPushBoolean(bSpectacularDeath) - VM_ExecuteCommand(133, 2) - return StackPopEffect() -end - --- Create a Knockdown effect --- This effect knocks creatures off their feet, they will sit until the effect --- is removed. This should be applied as a temporary effect with a 3 second --- duration minimum (1 second to fall, 1 second sitting, 1 second to get up). -function EffectKnockdown() - VM_ExecuteCommand(134, 0) - return StackPopEffect() -end - --- Give oItem to oGiveTo --- If oItem is not a valid item, or oGiveTo is not a valid object, nothing will --- happen. -function ActionGiveItem(oItem, oGiveTo) - StackPushObject(oGiveTo) - StackPushObject(oItem) - VM_ExecuteCommand(135, 2) -end - --- Take oItem from oTakeFrom --- If oItem is not a valid item, or oTakeFrom is not a valid object, nothing --- will happen. -function ActionTakeItem(oItem, oTakeFrom) - StackPushObject(oTakeFrom) - StackPushObject(oItem) - VM_ExecuteCommand(136, 2) -end - --- Normalize vVector -function VectorNormalize(vVector) - StackPushVector(vVector) - VM_ExecuteCommand(137, 1) - return StackPopVector() -end - --- Create a Curse effect. --- - nStrMod: strength modifier --- - nDexMod: dexterity modifier --- - nConMod: constitution modifier --- - nIntMod: intelligence modifier --- - nWisMod: wisdom modifier --- - nChaMod: charisma modifier -function EffectCurse(nStrMod, nDexMod, nConMod, nIntMod, nWisMod, nChaMod) - nStrMod = nStrMod or 1 - nDexMod = nDexMod or 1 - nConMod = nConMod or 1 - nIntMod = nIntMod or 1 - nWisMod = nWisMod or 1 - nChaMod = nChaMod or 1 - - StackPushInteger(nChaMod) - StackPushInteger(nWisMod) - StackPushInteger(nIntMod) - StackPushInteger(nConMod) - StackPushInteger(nDexMod) - StackPushInteger(nStrMod) - VM_ExecuteCommand(138, 6) - return StackPopEffect() -end - --- Get the ability score of type nAbility for a creature (otherwise 0) --- - oCreature: the creature whose ability score we wish to find out --- - nAbilityType: ABILITY_* --- - nBaseAbilityScore: if set to true will return the base ability score without --- bonuses (e.g. ability bonuses granted from equipped items). --- Return value on error: 0 -function GetAbilityScore(oCreature, nAbilityType, bBaseAbilityScore) - bBaseAbilityScore = bBaseAbilityScore or false - - StackPushBoolean(bBaseAbilityScore) - StackPushInteger(nAbilityType) - StackPushObject(oCreature) - VM_ExecuteCommand(139, 3) - return StackPopInteger() -end - --- * Returns TRUE if oCreature is a dead NPC, dead PC or a dying PC. -function GetIsDead(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(140, 1) - return StackPopBoolean() -end - --- Output vVector to the logfile. --- - vVector --- - bPrepend: if this is TRUE, the message will be prefixed with "PRINTVECTOR:" -function PrintVector(vVector, bPrepend) - StackPushBoolean(bPrepend) - StackPushVector(vVector) - VM_ExecuteCommand(141, 2) -end - --- Create a vector with the specified values for x, y and z -function Vector(x, y, z) - x = x or 0.0 - y = y or 0.0 - z = z or 0.0 - - StackPushFloat(z) - StackPushFloat(y) - StackPushFloat(x) - VM_ExecuteCommand(142, 3) - return StackPopVector() -end - --- Cause the caller to face vTarget -function SetFacingPoint(vTarget) - StackPushVector(vTarget) - VM_ExecuteCommand(143, 1) -end - --- Convert fAngle to a vector -function AngleToVector(fAngle) - StackPushFloat(fAngle) - VM_ExecuteCommand(144, 1) - return StackPopVector() -end - --- Convert vVector to an angle -function VectorToAngle(vVector) - StackPushVector(vVector) - VM_ExecuteCommand(145, 1) - return StackPopFloat() -end - --- The caller will perform a Melee Touch Attack on oTarget --- This is not an action, and it assumes the caller is already within range of --- oTarget --- * Returns 0 on a miss, 1 on a hit and 2 on a critical hit -function TouchAttackMelee(oTarget, bDisplayFeedback) - if bDisplayFeedback == nil then bDisplayFeedback = true end - - StackPushBoolean(bDisplayFeedback) - StackPushObject(oTarget) - VM_ExecuteCommand(146, 2) - return StackPopInteger() -end - --- The caller will perform a Ranged Touch Attack on oTarget --- * Returns 0 on a miss, 1 on a hit and 2 on a critical hit -function TouchAttackRanged(oTarget, bDisplayFeedback) - if bDisplayFeedback == nil then bDisplayFeedback = true end - - StackPushBoolean(bDisplayFeedback) - StackPushObject(oTarget) - VM_ExecuteCommand(147, 2) - return StackPopInteger() -end - --- Create a Paralyze effect -function EffectParalyze() - VM_ExecuteCommand(148, 0) - return StackPopEffect() -end - --- Create a Spell Immunity effect. --- There is a known bug with this function. There *must* be a parameter specified --- when this is called (even if the desired parameter is SPELL_ALL_SPELLS), --- otherwise an effect of type EFFECT_TYPE_INVALIDEFFECT will be returned. --- - nImmunityToSpell: SPELL_* --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nImmunityToSpell is --- invalid. -function EffectSpellImmunity(nImmunityToSpell) - nImmunityToSpell = nImmunityToSpell or -1 --SPELL_ALL_SPELLS - - StackPushInteger(nImmunityToSpell) - VM_ExecuteCommand(149, 1) - return StackPopEffect() -end - --- Create a Deaf effect -function EffectDeaf() - VM_ExecuteCommand(150, 0) - return StackPopEffect() -end - --- Get the distance in metres between oObjectA and oObjectB. --- * Return value if either object is invalid: 0.0f -function GetDistanceBetween(oObjectA, oObjectB) - StackPushObject(oObjectB) - StackPushObject(oObjectA) - VM_ExecuteCommand(151, 2) - return StackPopFloat() -end - --- Set oObject's local location variable sVarname to lValue -function SetLocalLocation(oObject, sVarName, lValue) - StackPushLocation(lValue) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(152, 3) -end - --- Get oObject's local location variable sVarname -function GetLocalLocation(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(153, 2) - return StackPopLocation() -end - --- Create a Sleep effect -function EffectSleep() - VM_ExecuteCommand(154, 0) - return StackPopEffect() -end - --- Get the object which is in oCreature's specified inventory slot --- - nInventorySlot: INVENTORY_SLOT_* --- - oCreature --- * Returns OBJECT_INVALID if oCreature is not a valid creature or there is no --- item in nInventorySlot. -function GetItemInSlot(nInventorySlot, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nInventorySlot) - VM_ExecuteCommand(155, 2) - return StackPopObject() -end - --- Create a Charm effect -function EffectCharmed() - VM_ExecuteCommand(156, 0) - return StackPopEffect() -end - --- Create a Confuse effect -function EffectConfused() - VM_ExecuteCommand(157, 0) - return StackPopEffect() -end - --- Create a Frighten effect -function EffectFrightened() - VM_ExecuteCommand(158, 0) - return StackPopEffect() -end - --- Create a Dominate effect -function EffectDominated() - VM_ExecuteCommand(159, 0) - return StackPopEffect() -end - --- Create a Daze effect -function EffectDazed() - VM_ExecuteCommand(160, 0) - return StackPopEffect() -end - --- Create a Stun effect -function EffectStunned() - VM_ExecuteCommand(161, 0) - return StackPopEffect() -end - --- Set whether oTarget's action stack can be modified -function SetCommandable(bCommandable, oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - StackPushBoolean(bCommandable) - VM_ExecuteCommand(162, 2) -end - --- Determine whether oTarget's action stack can be modified. -function GetCommandable(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(163, 1) - return StackPopBoolean() -end - --- Create a Regenerate effect. --- - nAmount: amount of damage to be regenerated per time interval --- - fIntervalSeconds: length of interval in seconds -function EffectRegenerate(nAmount, fIntervalSeconds) - StackPushFloat(fIntervalSeconds) - StackPushInteger(nAmount) - VM_ExecuteCommand(164, 2) - return StackPopEffect() -end - --- Create a Movement Speed Increase effect. --- - nPercentChange - range 0 through 99 --- eg. --- 0 = no change in speed --- 50 = 50% faster --- 99 = almost twice as fast -function EffectMovementSpeedIncrease(nPercentChange) - StackPushInteger(nPercentChange) - VM_ExecuteCommand(165, 1) - return StackPopEffect() -end - --- Get the number of hitdice for oCreature. --- * Return value if oCreature is not a valid creature: 0 -function GetHitDice(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(166, 1) - return StackPopInteger() -end - --- The action subject will follow oFollow until a ClearAllActions() is called. --- - oFollow: this is the object to be followed --- - fFollowDistance: follow distance in metres --- * No return value -function ActionForceFollowObject(oFollow, fFollowDistance) - fFollowDistance = fFollowDistance or 0.0 - - StackPushFloat(fFollowDistance) - StackPushObject(oFollow) - VM_ExecuteCommand(167, 2) -end - --- Get the Tag of oObject --- * Return value if oObject is not a valid object: "" -function GetTag(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(168, 1) - return StackPopString() -end - --- Do a Spell Resistance check between oCaster and oTarget, returning TRUE if --- the spell was resisted. --- * Return value if oCaster or oTarget is an invalid object: FALSE --- * Return value if spell cast is not a player spell: - 1 --- * Return value if spell resisted: 1 --- * Return value if spell resisted via magic immunity: 2 --- * Return value if spell resisted via spell absorption: 3 -function ResistSpell(oCaster, oTarget) - StackPushObject(oTarget) - StackPushObject(oCaster) - VM_ExecuteCommand(169, 2) - return StackPopInteger() -end - --- Get the effect type (EFFECT_TYPE_*) of eEffect. --- * Return value if eEffect is invalid: EFFECT_INVALIDEFFECT -function GetEffectType(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(170, 1) - return StackPopInteger() -end - --- Create an Area Of Effect effect in the area of the creature it is applied to. --- If the scripts are not specified, default ones will be used. -function EffectAreaOfEffect(nAreaEffectId, sOnEnterScript, sHeartbeatScript, sOnExitScript) - sOnEnterScript = sOnEnterScript or "" - sHeartbeatScript = sHeartbeatScript or "" - sOnExitScript = sOnExitScript or "" - - StackPushString(sOnExitScript) - StackPushString(sHeartbeatScript) - StackPushString(sOnEnterScript) - StackPushInteger(nAreaEffectId) - VM_ExecuteCommand(171, 4) - return StackPopEffect() -end - --- * Returns TRUE if the Faction Ids of the two objects are the same -function GetFactionEqual(oFirstObject, oSecondObject) - oSecondObject = oSecondObject or OBJECT_SELF - - StackPushObject(oSecondObject) - StackPushObject(oFirstObject) - VM_ExecuteCommand(172, 2) - return StackPopBoolean() -end - --- Make oObjectToChangeFaction join the faction of oMemberOfFactionToJoin. --- NB. ** This will only work for two NPCs ** -function ChangeFaction(oObjectToChangeFaction, oMemberOfFactionToJoin) - StackPushObject(oMemberOfFactionToJoin) - StackPushObject(oObjectToChangeFaction) - VM_ExecuteCommand(173, 2) -end - --- * Returns TRUE if oObject is listening for something -function GetIsListening(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(174, 1) - return StackPopBoolean() -end - --- Set whether oObject is listening. -function SetListening(oObject, bValue) - StackPushBoolean(bValue) - StackPushObject(oObject) - VM_ExecuteCommand(175, 2) -end - --- Set the string for oObject to listen for. --- Note: this does not set oObject to be listening. -function SetListenPattern(oObject, sPattern, nNumber) - nNumber = nNumber or 0 - - StackPushInteger(nNumber) - StackPushString(sPattern) - StackPushObject(oObject) - VM_ExecuteCommand(176, 3) -end - --- * Returns TRUE if sStringToTest matches sPattern. -function TestStringAgainstPattern(sPattern, sStringToTest) - StackPushString(sStringToTest) - StackPushString(sPattern) - VM_ExecuteCommand(177, 2) - return StackPopBoolean() -end - --- Get the appropriate matched string (this should only be used in --- OnConversation scripts). --- * Returns the appropriate matched string, otherwise returns "" -function GetMatchedSubstring(nString) - StackPushInteger(nString) - VM_ExecuteCommand(178, 1) - return StackPopString() -end - --- Get the number of string parameters available. --- * Returns -1 if no string matched (this could be because of a dialogue event) -function GetMatchedSubstringsCount() - VM_ExecuteCommand(179, 0) - return StackPopInteger() -end - --- * Create a Visual Effect that can be applied to an object. --- - nVisualEffectId --- - nMissEffect: if this is TRUE, a random vector near or past the target will --- be generated, on which to play the effect -function EffectVisualEffect(nVisualEffectId, bMissEffect) - bMissEffect = bMissEffect or false - - StackPushBoolean(nMissEffect) - StackPushInteger(nVisualEffectId) - VM_ExecuteCommand(180, 2) - return StackPopEffect() -end - --- Get the weakest member of oFactionMember's faction. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionWeakestMember(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(181, 2) - return StackPopObject() -end - --- Get the strongest member of oFactionMember's faction. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionStrongestMember(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(182, 2) - return StackPopObject() -end - --- Get the member of oFactionMember's faction that has taken the most hit points --- of damage. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionMostDamagedMember(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(183, 2) - return StackPopObject() -end - --- Get the member of oFactionMember's faction that has taken the fewest hit --- points of damage. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionLeastDamagedMember(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(184, 2) - return StackPopObject() -end - --- Get the amount of gold held by oFactionMember's faction. --- * Returns -1 if oFactionMember's faction is invalid. -function GetFactionGold(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(185, 1) - return StackPopInteger() -end - --- Get an integer between 0 and 100 (inclusive) that represents how --- oSourceFactionMember's faction feels about oTarget. --- * Return value on error: -1 -function GetFactionAverageReputation(oSourceFactionMember, oTarget) - StackPushObject(oTarget) - StackPushObject(oSourceFactionMember) - VM_ExecuteCommand(186, 2) - return StackPopInteger() -end - --- Get an integer between 0 and 100 (inclusive) that represents the average --- good/evil alignment of oFactionMember's faction. --- * Return value on error: -1 -function GetFactionAverageGoodEvilAlignment(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(187, 1) - return StackPopInteger() -end - --- Get an integer between 0 and 100 (inclusive) that represents the average --- law/chaos alignment of oFactionMember's faction. --- * Return value on error: -1 -function GetFactionAverageLawChaosAlignment(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(188, 1) - return StackPopInteger() -end - --- Get the average level of the members of the faction. --- * Return value on error: -1 -function GetFactionAverageLevel(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(189, 1) - return StackPopInteger() -end - --- Get the average XP of the members of the faction. --- * Return value on error: -1 -function GetFactionAverageXP(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(190, 1) - return StackPopInteger() -end - --- Get the most frequent class in the faction - this can be compared with the --- constants CLASS_TYPE_*. --- * Return value on error: -1 -function GetFactionMostFrequentClass(oFactionMember) - StackPushObject(oFactionMember) - VM_ExecuteCommand(191, 1) - return StackPopInteger() -end - --- Get the object faction member with the lowest armour class. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionWorstAC(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(192, 2) - return StackPopObject() -end - --- Get the object faction member with the highest armour class. --- * Returns OBJECT_INVALID if oFactionMember's faction is invalid. -function GetFactionBestAC(oFactionMember, bMustBeVisible) - oFactionMember = oFactionMember or OBJECT_SELF - if bMustBeVisible == nil then bMustBeVisible = true end - - StackPushBoolean(bMustBeVisible) - StackPushObject(oFactionMember) - VM_ExecuteCommand(193, 2) - return StackPopObject() -end - --- Sit in oChair. --- Note: Not all creatures will be able to sit and not all --- objects can be sat on. --- The object oChair must also be marked as usable in the toolset. --- --- For Example: To get a player to sit in oChair when they click on it, --- place the following script in the OnUsed event for the object oChair. --- void main() --- { --- object oChair = OBJECT_SELF --- AssignCommand(GetLastUsedBy(),ActionSit(oChair)) --- end -function ActionSit(oChair) - StackPushObject(oChair) - VM_ExecuteCommand(194, 1) -end - --- In an onConversation script this gets the number of the string pattern --- matched (the one that triggered the script). --- * Returns -1 if no string matched -function GetListenPatternNumber() - VM_ExecuteCommand(195, 0) - return StackPopInteger() -end - --- Jump to an object ID, or as near to it as possible. -function ActionJumpToObject(oToJumpTo, bWalkStraightLineToPoint) - if bWalkStraightLineToPoint == nil then bWalkStraightLineToPoint = true end - - StackPushBoolean(bWalkStraightLineToPoint) - StackPushObject(oToJumpTo) - VM_ExecuteCommand(196, 2) -end - --- Get the first waypoint with the specified tag. --- * Returns OBJECT_INVALID if the waypoint cannot be found. -function GetWaypointByTag(sWaypointTag) - StackPushString(sWaypointTag) - VM_ExecuteCommand(197, 1) - return StackPopObject() -end - --- Get the destination object for the given object. --- --- All objects can hold a transition target, but only Doors and Triggers --- will be made clickable by the game engine (This may change in the --- future). You can set and query transition targets on other objects for --- your own scripted purposes. --- --- * Returns OBJECT_INVALID if oTransition does not hold a target. -function GetTransitionTarget(oTransition) - StackPushObject(oTransition) - VM_ExecuteCommand(198, 1) - return StackPopObject() -end - --- Link the two supplied effects, returning eChildEffect as a child of --- eParentEffect. --- Note: When applying linked effects if the target is immune to all valid --- effects all other effects will be removed as well. This means that if you --- apply a visual effect and a silence effect (in a link) and the target is --- immune to the silence effect that the visual effect will get removed as well. --- Visual Effects are not considered "valid" effects for the purposes of --- determining if an effect will be removed or not and as such should never be --- packaged *only* with other visual effects in a link. -function EffectLinkEffects(eChildEffect, eParentEffect) - StackPushEffect(eParentEffect) - StackPushEffect(eChildEffect) - VM_ExecuteCommand(199, 2) - return StackPopEffect() -end - --- Get the nNth object with the specified tag. --- - sTag --- - nNth: the nth object with this tag may be requested --- * Returns OBJECT_INVALID if the object cannot be found. --- Note: The module cannot be retrieved by GetObjectByTag(), use GetModule() instead. -function GetObjectByTag(sTag, nNth) - nNth = nNth or 0 - - StackPushInteger(nNth) - StackPushString(sTag) - VM_ExecuteCommand(200, 2) - return StackPopObject() -end - --- Adjust the alignment of oSubject. --- - oSubject --- - nAlignment: --- -> ALIGNMENT_LAWFUL/ALIGNMENT_CHAOTIC/ALIGNMENT_GOOD/ALIGNMENT_EVIL: oSubject's --- alignment will be shifted in the direction specified --- -> ALIGNMENT_ALL: nShift will be added to oSubject's law/chaos and --- good/evil alignment values --- -> ALIGNMENT_NEUTRAL: nShift is applied to oSubject's law/chaos and --- good/evil alignment values in the direction which is towards neutrality. --- e.g. If oSubject has a law/chaos value of 10 (i.e. chaotic) and a --- good/evil value of 80 (i.e. good) then if nShift is 15, the --- law/chaos value will become (10+15)=25 and the good/evil value will --- become (80-25)=55 --- Furthermore, the shift will at most take the alignment value to 50 and --- not beyond. --- e.g. If oSubject has a law/chaos value of 40 and a good/evil value of 70, --- then if nShift is 15, the law/chaos value will become 50 and the --- good/evil value will become 55 --- - nShift: this is the desired shift in alignment --- - bAllPartyMembers: when TRUE the alignment shift of oSubject also has a --- diminished affect all members of oSubject's party (if oSubject is a Player). --- When FALSE the shift only affects oSubject. --- * No return value -function AdjustAlignment(oSubject, nAlignment, nShift, bAllPartyMembers) - if bAllPartyMembers == nil then bAllPartyMembers = true end - - StackPushBoolean(bAllPartyMembers) - StackPushInteger(nShift) - StackPushInteger(nAlignment) - StackPushObject(oSubject) - VM_ExecuteCommand(201, 4) -end - --- Do nothing for fSeconds seconds. -function ActionWait(fSeconds) - StackPushFloat(fSeconds) - VM_ExecuteCommand(202, 1) -end - --- Set the transition bitmap of a player this should only be called in area --- transition scripts. This action should be run by the person "clicking" the --- area transition via AssignCommand. --- - nPredefinedAreaTransition: --- -> To use a predefined area transition bitmap, use one of AREA_TRANSITION_* --- -> To use a custom, user-defined area transition bitmap, use --- AREA_TRANSITION_USER_DEFINED and specify the filename in the second --- parameter --- - sCustomAreaTransitionBMP: this is the filename of a custom, user-defined --- area transition bitmap -function SetAreaTransitionBMP(nPredefinedAreaTransition, sCustomAreaTransitionBMP) - sCustomAreaTransitionBMP = sCustomAreaTransitionBMP or "" - - StackPushString(sCustomAreaTransitionBMP) - StackPushInteger(nPredefinedAreaTransition) - VM_ExecuteCommand(203, 2) -end - --- Starts a conversation with oObjectToConverseWith - this will cause their --- OnDialog event to fire. --- - oObjectToConverseWith --- - sDialogResRef: If this is blank, the creature's own dialogue file will be used --- - bPrivateConversation --- Turn off bPlayHello if you don't want the initial greeting to play -function ActionStartConversation(oObjectToConverseWith, sDialogResRef, bPrivateConversation, bPlayHello) - sDialogResRef = sDialogResRef or "" - bPrivateConversation = bPrivateConversation or false - if bPlayHello == nil then bPlayHello = true end - - StackPushBoolean(bPlayHello) - StackPushBoolean(bPrivateConversation) - StackPushString(sDialogResRef) - StackPushObject(oObjectToConverseWith) - VM_ExecuteCommand(204, 4) -end - --- Pause the current conversation. -function ActionPauseConversation() - VM_ExecuteCommand(205, 0) -end - --- Resume a conversation after it has been paused. -function ActionResumeConversation() - VM_ExecuteCommand(206, 0) -end - --- Create a Beam effect. --- - nBeamVisualEffect: VFX_BEAM_* --- - oEffector: the beam is emitted from this creature --- - nBodyPart: BODY_NODE_* --- - bMissEffect: If this is TRUE, the beam will fire to a random vector near or --- past the target --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nBeamVisualEffect is --- not valid. -function EffectBeam(nBeamVisualEffect, oEffector, nBodyPart, bMissEffect) - bMissEffect = bMissEffect or false - - StackPushBoolean(bMissEffect) - StackPushInteger(nBodyPart) - StackPushObject(oEffector) - StackPushInteger(nBeamVisualEffect) - VM_ExecuteCommand(207, 4) - return StackPopEffect() -end - --- Get an integer between 0 and 100 (inclusive) that represents how oSource --- feels about oTarget. --- -> 0-10 means oSource is hostile to oTarget --- -> 11-89 means oSource is neutral to oTarget --- -> 90-100 means oSource is friendly to oTarget --- * Returns -1 if oSource or oTarget does not identify a valid object -function GetReputation(oSource, oTarget) - StackPushObject(oTarget) - StackPushObject(oSource) - VM_ExecuteCommand(208, 2) - return StackPopInteger() -end - --- Adjust how oSourceFactionMember's faction feels about oTarget by the --- specified amount. --- Note: This adjusts Faction Reputation, how the entire faction that --- oSourceFactionMember is in, feels about oTarget. --- * No return value --- Note: You can't adjust a player character's (PC) faction towards --- NPCs, so attempting to make an NPC hostile by passing in a PC object --- as oSourceFactionMember in the following call will fail: --- AdjustReputation(oNPC,oPC,-100) --- Instead you should pass in the PC object as the first --- parameter as in the following call which should succeed: --- AdjustReputation(oPC,oNPC,-100) --- Note: Will fail if oSourceFactionMember is a plot object. -function AdjustReputation(oTarget, oSourceFactionMember, nAdjustment) - StackPushInteger(nAdjustment) - StackPushObject(oSourceFactionMember) - StackPushObject(oTarget) - VM_ExecuteCommand(209, 3) -end - --- Get the creature that is currently sitting on the specified object. --- - oChair --- * Returns OBJECT_INVALID if oChair is not a valid placeable. -function GetSittingCreature(oChair) - StackPushObject(oChair) - VM_ExecuteCommand(210, 1) - return StackPopObject() -end - --- Get the creature that is going to attack oTarget. --- Note: This value is cleared out at the end of every combat round and should --- not be used in any case except when getting a "going to be attacked" shout --- from the master creature (and this creature is a henchman) --- * Returns OBJECT_INVALID if oTarget is not a valid creature. -function GetGoingToBeAttackedBy(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(211, 1) - return StackPopObject() -end - --- Create a Spell Resistance Increase effect. --- - nValue: size of spell resistance increase -function EffectSpellResistanceIncrease(nValue) - StackPushInteger(nValue) - VM_ExecuteCommand(212, 1) - return StackPopEffect() -end - --- Get the location of oObject. -function GetLocation(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(213, 1) - return StackPopLocation() -end - --- The subject will jump to lLocation instantly (even between areas). --- If lLocation is invalid, nothing will happen. -function ActionJumpToLocation(lLocation) - StackPushLocation(lLocation) - VM_ExecuteCommand(214, 1) -end - --- Create a location. -function Location(oArea, vPosition, fOrientation) - StackPushFloat(fOrientation) - StackPushVector(vPosition) - StackPushObject(oArea) - VM_ExecuteCommand(215, 3) - return StackPopLocation() -end - --- Apply eEffect at lLocation. -function ApplyEffectAtLocation(nDurationType, eEffect, lLocation, fDuration) - fDuration = fDuration or 0.0 - - StackPushFloat(fDuration) - StackPushLocation(lLocation) - StackPushEffect(eEffect) - StackPushInteger(nDurationType) - VM_ExecuteCommand(216, 4) -end - --- * Returns TRUE if oCreature is a Player Controlled character. -function GetIsPC(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(217, 1) - return StackPopBoolean() -end - --- Convert fFeet into a number of meters. -function FeetToMeters(fFeet) - StackPushFloat(fFeet) - VM_ExecuteCommand(218, 1) - return StackPopFloat() -end - --- Convert fYards into a number of meters. -function YardsToMeters(fYards) - StackPushFloat(fYards) - VM_ExecuteCommand(219, 1) - return StackPopFloat() -end - --- Apply eEffect to oTarget. -function ApplyEffectToObject(nDurationType, eEffect, oTarget, fDuration) - fDuration = fDuration or 0.0 - StackPushFloat(fDuration) - StackPushObject(oTarget) - StackPushEffect(eEffect) - StackPushInteger(nDurationType) - VM_ExecuteCommand(220, 4) -end - --- The caller will immediately speak sStringToSpeak (this is different from --- ActionSpeakString) --- - sStringToSpeak --- - nTalkVolume: TALKVOLUME_* -function SpeakString(sStringToSpeak, nTalkVolume) - nTalkVolume = nTalkVolume or 0 --TALKVOLUME_TALK - - StackPushInteger(nTalkVolume) - StackPushString(sStringToSpeak) - VM_ExecuteCommand(221, 2) -end - --- Get the location of the caller's last spell target. -function GetSpellTargetLocation() - VM_ExecuteCommand(222, 0) - return StackPopLocation() -end - --- Get the position vector from lLocation. -function GetPositionFromLocation(lLocation) - StackPushLocation(lLocation) - VM_ExecuteCommand(223, 1) - return StackPopVector() -end - --- Get the area's object ID from lLocation. -function GetAreaFromLocation(lLocation) - StackPushLocation(lLocation) - VM_ExecuteCommand(224, 1) - return StackPopObject() -end - --- Get the orientation value from lLocation. -function GetFacingFromLocation(lLocation) - StackPushLocation(lLocation) - VM_ExecuteCommand(225, 1) - return StackPopFloat() -end - --- Get the creature nearest to lLocation, subject to all the criteria specified. --- - nFirstCriteriaType: CREATURE_TYPE_* --- - nFirstCriteriaValue: --- -> CLASS_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_CLASS --- -> SPELL_* if nFirstCriteriaType was CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT --- or CREATURE_TYPE_HAS_SPELL_EFFECT --- -> TRUE or FALSE if nFirstCriteriaType was CREATURE_TYPE_IS_ALIVE --- -> PERCEPTION_* if nFirstCriteriaType was CREATURE_TYPE_PERCEPTION --- -> PLAYER_CHAR_IS_PC or PLAYER_CHAR_NOT_PC if nFirstCriteriaType was --- CREATURE_TYPE_PLAYER_CHAR --- -> RACIAL_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_RACIAL_TYPE --- -> REPUTATION_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_REPUTATION --- For example, to get the nearest PC, use --- (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC) --- - lLocation: We're trying to find the creature of the specified type that is --- nearest to lLocation --- - nNth: We don't have to find the first nearest: we can find the Nth nearest.... --- - nSecondCriteriaType: This is used in the same way as nFirstCriteriaType to --- further specify the type of creature that we are looking for. --- - nSecondCriteriaValue: This is used in the same way as nFirstCriteriaValue --- to further specify the type of creature that we are looking for. --- - nThirdCriteriaType: This is used in the same way as nFirstCriteriaType to --- further specify the type of creature that we are looking for. --- - nThirdCriteriaValue: This is used in the same way as nFirstCriteriaValue to --- further specify the type of creature that we are looking for. --- * Return value on error: OBJECT_INVALID -function GetNearestCreatureToLocation(nFirstCriteriaType, nFirstCriteriaValue, lLocation, nNth, nSecondCriteriaType, nSecondCriteriaValue, nThirdCriteriaType, nThirdCriteriaValue) - nNth = nNth or 1 - nSecondCriteriaType = nSecondCriteriaType or -1 - nSecondCriteriaValue = nSecondCriteriaValue or -1 - nThirdCriteriaType = nThirdCriteriaType or -1 - nThirdCriteriaValue = nThirdCriteriaValue or -1 - - StackPushInteger(nThirdCriteriaValue) - StackPushInteger(nThirdCriteriaType) - StackPushInteger(nSecondCriteriaValue) - StackPushInteger(nSecondCriteriaType) - StackPushInteger(nNth) - StackPushLocation(lLocation) - StackPushInteger(nFirstCriteriaValue) - StackPushInteger(nFirstCriteriaType) - VM_ExecuteCommand(226, 8) - return StackPopObject() -end - --- Get the Nth object nearest to oTarget that is of the specified type. --- - nObjectType: OBJECT_TYPE_* --- - oTarget --- - nNth --- * Return value on error: OBJECT_INVALID -function GetNearestObject(nObjectType, oTarget, nNth) - - nObjectType = nObjectType or 32767 --OBJECT_TYPE_ALL - oTarget = oTarget or OBJECT_SELF - nNth = nNth or 1 - - StackPushInteger(nNth) - StackPushObject(oTarget) - StackPushInteger(nObjectType) - VM_ExecuteCommand(227, 3) - return StackPopObject() -end - --- Get the nNth object nearest to lLocation that is of the specified type. --- - nObjectType: OBJECT_TYPE_* --- - lLocation --- - nNth --- * Return value on error: OBJECT_INVALID -function GetNearestObjectToLocation(nObjectType, lLocation, nNth) - nNth = nNth or 1 - - StackPushInteger(nNth) - StackPushLocation(lLocation) - StackPushInteger(nObjectType) - VM_ExecuteCommand(228, 3) - return StackPopObject() -end - --- Get the nth Object nearest to oTarget that has sTag as its tag. --- * Return value on error: OBJECT_INVALID -function GetNearestObjectByTag(sTag, oTarget, nNth) - oTarget = oTarget or OBJECT_SELF - nNth = nNth or 1 - - StackPushInteger(nNth) - StackPushObject(oTarget) - StackPushString(sTag) - VM_ExecuteCommand(229, 3) - return StackPopObject() -end - --- Convert nInteger into a floating point number. -function IntToFloat(nInteger) - StackPushInteger(nInteger) - VM_ExecuteCommand(230, 1) - return StackPopFloat() -end - --- Convert fFloat into the nearest integer. -function FloatToInt() - StackPushFloat(fFloat) - VM_ExecuteCommand(231, 1) - return StackPopInteger() -end - --- Convert sNumber into an integer. -function StringToInt(sNumber) - StackPushString(sNumber) - VM_ExecuteCommand(232, 1) - return StackPopInteger() -end - --- Convert sNumber into a floating point number. -function StringToFloat(sNumber) - StackPushString(sNumber) - VM_ExecuteCommand(233, 1) - return StackPopFloat(fRetVal) -end - --- Cast spell nSpell at lTargetLocation. --- - nSpell: SPELL_* --- - lTargetLocation --- - nMetaMagic: METAMAGIC_* --- - bCheat: If this is TRUE, then the executor of the action doesn't have to be --- able to cast the spell. --- - nProjectilePathType: PROJECTILE_PATH_TYPE_* --- - bInstantSpell: If this is TRUE, the spell is cast immediately this allows --- the end-user to simulate --- a high-level magic user having lots of advance warning of impending trouble. -function ActionCastSpellAtLocation(nSpell, lTargetLocation, nMetaMagic, bCheat, nProjectilePathType, bInstantSpell) - nMetaMagic = nMetaMagic or 255 --METAMAGIC_ANY - bCheat = bCheat or false - nProjectilePathType = nProjectilePathType or 0 --PROJECTILE_PATH_TYPE_DEFAULT - bInstantSpell = bInstantSpell or false - - StackPushBoolean(bInstantSpell) - StackPushInteger(nProjectilePathType) - StackPushBoolean(bCheat) - StackPushInteger(nMetaMagic) - StackPushLocation(lTargetLocation) - StackPushInteger(nSpell) - VM_ExecuteCommand(234, 6) -end - --- * Returns TRUE if oSource considers oTarget as an enemy. -function GetIsEnemy(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(235, 2) - return StackPopBoolean() -end - --- * Returns TRUE if oSource considers oTarget as a friend. -function GetIsFriend(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(236, 2) - return StackPopBoolean() -end - --- * Returns TRUE if oSource considers oTarget as neutral. -function GetIsNeutral(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(237, 2) - return StackPopBoolean() -end - --- Get the PC that is involved in the conversation. --- * Returns OBJECT_INVALID on error. -function GetPCSpeaker() - VM_ExecuteCommand(238, 0) - return StackPopObject() -end - --- Get a string from the talk table using nStrRef. -function GetStringByStrRef(nStrRef, nGender) - nGender = nGender or 0 --GENDER_MALE - - StackPushInteger(nGender) - StackPushInteger(nStrRef) - VM_ExecuteCommand(239, 2) - return StackPopString() -end - --- Causes the creature to speak a translated string. --- - nStrRef: Reference of the string in the talk table --- - nTalkVolume: TALKVOLUME_* -function ActionSpeakStringByStrRef(nStrRef, nTalkVolume) - nTalkVolume = nTalkVolume or 0 --TALKVOLUME_TALK - - StackPushInteger(nTalkVolume) - StackPushInteger(nStrRef) - VM_ExecuteCommand(240, 2) -end - --- Destroy oObject (irrevocably). --- This will not work on modules and areas. -function DestroyObject(oDestroy, fDelay) - fDelay = fDelay or 0.0 - - StackPushFloat(fDelay) - StackPushObject(oDestroy) - VM_ExecuteCommand(241, 2) -end - --- Get the module. --- * Return value on error: OBJECT_INVALID -function GetModule() - VM_ExecuteCommand(242, 0) - return StackPopObject() -end - --- Create an object of the specified type at lLocation. --- - nObjectType: OBJECT_TYPE_ITEM, OBJECT_TYPE_CREATURE, OBJECT_TYPE_PLACEABLE, --- OBJECT_TYPE_STORE, OBJECT_TYPE_WAYPOINT --- - sTemplate --- - lLocation --- - bUseAppearAnimation --- - sNewTag - if this string is not empty, it will replace the default tag from the template -function CreateObject(nObjectType, sTemplate, lLocation, bUseAppearAnimation, sNewTag) - bUseAppearAnimation = bUseAppearAnimation or false - sNewTag = sNewTag or "" - - StackPushString(sNewTag) - StackPushBoolean(bUseAppearAnimation) - StackPushLocation(lLocation) - StackPushString(sTemplate) - StackPushInteger(nObjectType) - VM_ExecuteCommand(243, 5) - return StackPopObject() -end - --- Create an event which triggers the "SpellCastAt" script --- Note: This only creates the event. The event wont actually trigger until SignalEvent() --- is called using this created SpellCastAt event as an argument. --- For example: --- SignalEvent(oCreature, EventSpellCastAt(oCaster, SPELL_MAGIC_MISSILE, TRUE)) --- This function doesn't cast the spell specified, it only creates an event so that --- when the event is signaled on an object, the object will use its OnSpellCastAt script --- to react to the spell being cast. --- --- To specify the OnSpellCastAt script that should run, view the Object's Properties --- and click on the Scripts Tab. Then specify a script for the OnSpellCastAt event. --- From inside the OnSpellCastAt script call: --- GetLastSpellCaster() to get the object that cast the spell (oCaster). --- GetLastSpell() to get the type of spell cast (nSpell) --- GetLastSpellHarmful() to determine if the spell cast at the object was harmful. -function EventSpellCastAt(oCaster, nSpell, bHarmful) - if bHarmful == nil then bHarmful = true end - - StackPushBoolean(bHarmful) - StackPushInteger(nSpell) - StackPushObject(oCaster) - VM_ExecuteCommand(244, 3) - return StackPopEvent() -end - --- This is for use in a "Spell Cast" script, it gets who cast the spell. --- The spell could have been cast by a creature, placeable or door. --- * Returns OBJECT_INVALID if the caller is not a creature, placeable or door. -function GetLastSpellCaster() - VM_ExecuteCommand(245, 0) - return StackPopObject() -end - --- This is for use in a "Spell Cast" script, it gets the ID of the spell that --- was cast. -function GetLastSpell() - VM_ExecuteCommand(246, 0) - return StackPopInteger() -end - --- This is for use in a user-defined script, it gets the event number. -function GetUserDefinedEventNumber() - VM_ExecuteCommand(247, 0) - return StackPopInteger() -end - --- This is for use in a Spell script, it gets the ID of the spell that is being --- cast (SPELL_*). -function GetSpellId() - VM_ExecuteCommand(248, 0) - return StackPopInteger() -end - --- Generate a random name. --- nNameType: The type of random name to be generated (NAME_*) -function RandomName() - nNameType = nNameType or -1 --NAME_FIRST_GENERIC_MALE - - StackPushInteger(nNameType) - VM_ExecuteCommand(249, 1) - return StackPopString() -end - --- Create a Poison effect. --- - nPoisonType: POISON_* -function EffectPoison(nPoisonType) - StackPushInteger(nPoisonType) - VM_ExecuteCommand(250, 1) - return StackPopEffect() -end - --- Create a Disease effect. --- - nDiseaseType: DISEASE_* -function EffectDisease(nDiseaseType) - StackPushInteger(nDiseaseType) - VM_ExecuteCommand(251, 1) - return StackPopEffect() -end - --- Create a Silence effect. -function EffectSilence() - VM_ExecuteCommand(252, 0) - return StackPopEffect() -end - --- Set the name of oObject. --- --- - oObject: the object for which you are changing the name (area, creature, placeable, item, or door). --- - sNewName: the new name that the object will use. --- Note: SetName() does not work on player objects. --- Setting an object's name to "" will make the object --- revert to using the name it had originally before any --- SetName() calls were made on the object. -function GetName(oObject, bOriginalName) - bOriginalName = bOriginalName or false - - StackPushBoolean(bOriginalName) - StackPushObject(oObject) - VM_ExecuteCommand(253, 2) - return StackPopString() -end - --- Use this in a conversation script to get the person with whom you are conversing. --- * Returns OBJECT_INVALID if the caller is not a valid creature. -function GetLastSpeaker() - VM_ExecuteCommand(254, 0) - return StackPopObject() -end - --- Use this in an OnDialog script to start up the dialog tree. --- - sResRef: if this is not specified, the default dialog file will be used --- - oObjectToDialog: if this is not specified the person that triggered the --- event will be used -function BeginConversation(sResRef, oObjectToDialog) - sResRef = sResRef or "" - oObjectToDialog = oObjectToDialog or OBJECT_INVALID - - StackPushObject(oObjectToDialog) - StackPushString(sResRef) - VM_ExecuteCommand(255, 2) - return StackPopInteger() -end - --- Use this in an OnPerception script to get the object that was perceived. --- * Returns OBJECT_INVALID if the caller is not a valid creature. -function GetLastPerceived() - VM_ExecuteCommand(256, 0) - return StackPopObject() -end - --- Use this in an OnPerception script to determine whether the object that was --- perceived was heard. -function GetLastPerceptionHeard() - VM_ExecuteCommand(257, 0) - return StackPopInteger() -end - --- Use this in an OnPerception script to determine whether the object that was --- perceived has become inaudible. -function GetLastPerceptionInaudible() - VM_ExecuteCommand(258, 0) - return StackPopInteger() -end - --- Use this in an OnPerception script to determine whether the object that was --- perceived was seen. -function GetLastPerceptionSeen() - VM_ExecuteCommand(259, 0) - return StackPopInteger() -end - --- Use this in an OnClosed script to get the object that closed the door or placeable. --- * Returns OBJECT_INVALID if the caller is not a valid door or placeable. -function GetLastClosedBy() - VM_ExecuteCommand(260, 0) - return StackPopObject() -end - --- Use this in an OnPerception script to determine whether the object that was --- perceived has vanished. -function GetLastPerceptionVanished() - VM_ExecuteCommand(261, 0) - return StackPopInteger() -end - --- Get the first object within oPersistentObject. --- - oPersistentObject --- - nResidentObjectType: OBJECT_TYPE_* --- - nPersistentZone: PERSISTENT_ZONE_ACTIVE. [This could also take the value --- PERSISTENT_ZONE_FOLLOW, but this is no longer used.] --- * Returns OBJECT_INVALID if no object is found. -function GetFirstInPersistentObject(oPersistentObject, nResidentObjectType, nPersistentZone) - oPersistentObject = oPersistentObject or OBJECT_SELF - nResidentObjectType = nResidentObjectType or 1 --OBJECT_TYPE_CREATURE - nPersistentZone = nPersistentZone or 0 --PERSISTENT_ZONE_ACTIVE - - StackPushInteger(nPersistentZone) - StackPushInteger(nResidentObjectType) - StackPushObject(oPersistentObject) - VM_ExecuteCommand(262, 3) - return StackPopObject() -end - --- Get the next object within oPersistentObject. --- - oPersistentObject --- - nResidentObjectType: OBJECT_TYPE_* --- - nPersistentZone: PERSISTENT_ZONE_ACTIVE. [This could also take the value --- PERSISTENT_ZONE_FOLLOW, but this is no longer used.] --- * Returns OBJECT_INVALID if no object is found. -function GetNextInPersistentObject(oPersistentObject, nResidentObjectType, nPersistentZone) - oPersistentObject = oPersistentObject or OBJECT_SELF - nResidentObjectType = nResidentObjectType or 1 --OBJECT_TYPE_CREATURE - nPersistentZone = nPersistentZone or 0 --PERSISTENT_ZONE_ACTIVE - - StackPushInteger(nPersistentZone) - StackPushInteger(nResidentObjectType) - StackPushObject(oPersistentObject) - VM_ExecuteCommand(263, 3) - return StackPopObject() -end - --- This returns the creator of oAreaOfEffectObject. --- * Returns OBJECT_INVALID if oAreaOfEffectObject is not a valid Area of Effect object. -function GetAreaOfEffectCreator(oAreaOfEffectObject) - oAreaOfEffectObject = oAreaOfEffectObject or OBJECT_SELF - - StackPushObject(oAreaOfEffectObject) - VM_ExecuteCommand(264, 1) - return StackPopObject() -end - --- Delete oObject's local integer variable sVarName -function DeleteLocalInt(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(265, 2) -end - --- Delete oObject's local float variable sVarName -function DeleteLocalFloat(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(266, 2) -end - --- Delete oObject's local string variable sVarName -function DeleteLocalString(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(267, 2) -end - --- Delete oObject's local object variable sVarName -function DeleteLocalObject(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(268, 2) -end - --- Delete oObject's local location variable sVarName -function DeleteLocalLocation(oObject, sVarName) - StackPushString(sVarName) - StackPushObject(oObject) - VM_ExecuteCommand(269, 2) -end - --- Create a Haste effect. -function EffectHaste() - VM_ExecuteCommand(270, 0) - return StackPopEffect() -end - --- Create a Slow effect. -function EffectSlow() - VM_ExecuteCommand(271, 0) - return StackPopEffect() -end - --- Convert oObject into a hexadecimal string. -function ObjectToString(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(272, 1) - return StackPopString() -end - --- Create an Immunity effect. --- - nImmunityType: IMMUNITY_TYPE_* -function EffectImmunity(nImmunityType) - StackPushInteger(nImmunityType) - VM_ExecuteCommand(273, 1) - return StackPopEffect() -end - --- - oCreature --- - nImmunityType: IMMUNITY_TYPE_* --- - oVersus: if this is specified, then we also check for the race and --- alignment of oVersus --- * Returns TRUE if oCreature has immunity of type nImmunity versus oVersus. -function GetIsImmune(oCreature, nImmunityType, oVersus) - oVersus = oVersus or OBJECT_INVALID - - StackPushObject(oVersus) - StackPushInteger(nImmunityType) - StackPushObject(oCreature) - VM_ExecuteCommand(274, 3) - return StackPopBoolean() -end - --- Creates a Damage Immunity Increase effect. --- - nDamageType: DAMAGE_TYPE_* --- - nPercentImmunity -function EffectDamageImmunityIncrease(nDamageType, nPercentImmunity) - StackPushInteger(nPercentImmunity) - StackPushInteger(nDamageType) - VM_ExecuteCommand(275, 2) - return StackPopEffect() -end - --- Determine whether oEncounter is active. -function GetEncounterActive(oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - VM_ExecuteCommand(276, 1) - return StackPopBoolean() -end - --- Set oEncounter's active state to nNewValue. --- - nNewValue: TRUE/FALSE --- - oEncounter -function SetEncounterActive(bNewValue, oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - StackPushBoolean(bNewValue) - VM_ExecuteCommand(277, 2) -end - --- Get the maximum number of times that oEncounter will spawn. -function GetEncounterSpawnsMax(oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - VM_ExecuteCommand(278, 1) - return StackPopInteger() -end - --- Set the maximum number of times that oEncounter can spawn -function SetEncounterSpawnsMax(nNewValue, oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - StackPushInteger(nNewValue) - VM_ExecuteCommand(279, 2) -end - --- Get the number of times that oEncounter has spawned so far -function GetEncounterSpawnsCurrent(oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - VM_ExecuteCommand(280, 1) - return StackPopInteger() -end - --- Set the number of times that oEncounter has spawned so far -function SetEncounterSpawnsCurrent(nNewValue, oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - StackPushInteger(nNewValue) - VM_ExecuteCommand(281, 2) -end - --- Use this in an OnItemAcquired script to get the item that was acquired. --- * Returns OBJECT_INVALID if the module is not valid. -function GetModuleItemAcquired() - VM_ExecuteCommand(282, 0) - return StackPopObject() -end - --- Use this in an OnItemAcquired script to get the creatre that previously --- possessed the item. --- * Returns OBJECT_INVALID if the item was picked up from the ground. -function GetModuleItemAcquiredFrom() - VM_ExecuteCommand(283, 0) - return StackPopObject() -end - --- Set the value for a custom token. -function SetCustomToken(nCustomTokenNumber, sTokenValue) - StackPushString(sTokenValue) - StackPushInteger(nCustomTokenNumber) - VM_ExecuteCommand(284, 2) -end - --- Determine whether oCreature has nFeat, and nFeat is useable. --- - nFeat: FEAT_* --- - oCreature -function GetHasFeat(nFeat, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nFeat) - VM_ExecuteCommand(285, 2) - return StackPopBoolean() -end - --- Determine whether oCreature has nSkill, and nSkill is useable. --- - nSkill: SKILL_* --- - oCreature -function GetHasSkill(nSkill, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nSkill) - VM_ExecuteCommand(286, 2) - return StackPopBoolean() -end - --- Use nFeat on oTarget. --- - nFeat: FEAT_* --- - oTarget -function ActionUseFeat(nFeat, oTarget) - StackPushObject(oTarget) - StackPushInteger(nFeat) - VM_ExecuteCommand(287, 2) -end - --- Runs the action "UseSkill" on the current creature --- Use nSkill on oTarget. --- - nSkill: SKILL_* --- - oTarget --- - nSubSkill: SUBSKILL_* --- - oItemUsed: Item to use in conjunction with the skill -function ActionUseSkill(nSkill, oTarget, nSubSkill, oItemUsed) - nSubSkill = nSubSkill or 0 - oItemUsed = oItemUsed or OBJECT_INVALID - - StackPushObject(oItemUsed) - StackPushInteger(nSubSkill) - StackPushObject(oTarget) - StackPushInteger(nSkill) - VM_ExecuteCommand(288, 4) -end - --- Determine whether oSource sees oTarget. --- NOTE: This *only* works on creatures, as visibility lists are not --- maintained for non-creature objects. -function GetObjectSeen(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(289, 2) - return StackPopBoolean() -end - --- Determine whether oSource hears oTarget. --- NOTE: This *only* works on creatures, as visibility lists are not --- maintained for non-creature objects. -function GetObjectHeard(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(290, 2) - return StackPopBoolean() -end - --- Use this in an OnPlayerDeath module script to get the last player that died. -function GetLastPlayerDied() - VM_ExecuteCommand(291, 0) - return StackPopObject() -end - --- Use this in an OnItemLost script to get the item that was lost/dropped. --- * Returns OBJECT_INVALID if the module is not valid. -function GetModuleItemLost() - VM_ExecuteCommand(292, 0) - return StackPopObject() -end - --- Use this in an OnItemLost script to get the creature that lost the item. --- * Returns OBJECT_INVALID if the module is not valid. -function GetModuleItemLostBy() - VM_ExecuteCommand(293, 0) - return StackPopObject() -end ---[[ -function ActionDoCommand(VALUE aActionToDo) - - //ERROR: Undefined variable type: action - VM_ExecuteCommand(294, 1) - -end ---]] --- Do aActionToDo. --- Creates a conversation event. --- Note: This only creates the event. The event wont actually trigger until SignalEvent() --- is called using this created conversation event as an argument. --- For example: --- SignalEvent(oCreature, EventConversation()) --- Once the event has been signaled. The script associated with the OnConversation event will --- run on the creature oCreature. --- --- To specify the OnConversation script that should run, view the Creature Properties on --- the creature and click on the Scripts Tab. Then specify a script for the OnConversation event. -function EventConversation() - VM_ExecuteCommand(295, 0) - return StackPopEvent() -end - --- Set the difficulty level of oEncounter. --- - nEncounterDifficulty: ENCOUNTER_DIFFICULTY_* --- - oEncounter -function SetEncounterDifficulty(nEncounterDifficulty, oEncounter) - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - StackPushInteger(nEncounterDifficulty) - VM_ExecuteCommand(296, 2) -end - --- Get the difficulty level of oEncounter. -function GetEncounterDifficulty() - oEncounter = oEncounter or OBJECT_SELF - - StackPushObject(oEncounter) - VM_ExecuteCommand(297, 1) - return StackPopInteger() -end - --- Get the distance between lLocationA and lLocationB. -function GetDistanceBetweenLocations(lLocationA, lLocationB) - StackPushLocation(lLocationB) - StackPushLocation(lLocationA) - VM_ExecuteCommand(298, 2) - return StackPopFloat() -end - --- Use this in spell scripts to get nDamage adjusted by oTarget's reflex and --- evasion saves. --- - nDamage --- - oTarget --- - nDC: Difficulty check --- - nSaveType: SAVING_THROW_TYPE_* --- - oSaveVersus -function GetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType, oSaveVersus) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_NONE - oSaveVersus = oSaveVersus or OBJECT_SELF - - StackPushObject(oSaveVersus) - StackPushInteger(nSaveType) - StackPushInteger(nDC) - StackPushObject(oTarget) - StackPushInteger(nDamage) - VM_ExecuteCommand(299, 5) - return StackPopInteger() -end - --- Play nAnimation immediately. --- - nAnimation: ANIMATION_* --- - fSpeed --- - fSeconds -function PlayAnimation(nAnimation, fSpeed, fSeconds) - fSpeed = fSpeed or 1.0 - fSeconds = fSeconds or 0.0 - - StackPushFloat(fSeconds) - StackPushFloat(fSpeed) - StackPushInteger(nAnimation) - VM_ExecuteCommand(300, 3) -end - --- Create a Spell Talent. --- - nSpell: SPELL_* -function TalentSpell(nSpell) - StackPushInteger(nSpell) - VM_ExecuteCommand(301, 1) - return StackPopTalent() -end - --- Create a Feat Talent. --- - nFeat: FEAT_* -function TalentFeat(nFeat) - StackPushInteger(nFeat) - VM_ExecuteCommand(302, 1) - return StackPopTalent() -end - --- Create a Skill Talent. --- - nSkill: SKILL_* -function TalentSkill(nSkill) - StackPushInteger(nSkill) - VM_ExecuteCommand(303, 1) - return StackPopTalent() -end - --- Determines whether oObject has any effects applied by nSpell --- - nSpell: SPELL_* --- - oObject --- * The spell id on effects is only valid if the effect is created --- when the spell script runs. If it is created in a delayed command --- then the spell id on the effect will be invalid. -function GetHasSpellEffect(nSpell, oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - StackPushInteger(nSpell) - VM_ExecuteCommand(304, 2) - return StackPopBoolean() -end - --- Get the spell (SPELL_*) that applied eSpellEffect. --- * Returns -1 if eSpellEffect was applied outside a spell script. -function GetEffectSpellId(eSpellEffect) - StackPushEffect(eSpellEffect) - VM_ExecuteCommand(305, 1) - return StackPopInteger() -end - --- Determine whether oCreature has tTalent. -function GetCreatureHasTalent(tTalent, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushTalent(tTalent) - VM_ExecuteCommand(306, 2) - return StackPopBoolean() -end - --- Get a random talent of oCreature, within nCategory. --- - nCategory: TALENT_CATEGORY_* --- - oCreature -function GetCreatureTalentRandom(nCategory, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nCategory) - VM_ExecuteCommand(307, 2) - return StackPopTalent() -end - --- Get the best talent (i.e. closest to nCRMax without going over) of oCreature, --- within nCategory. --- - nCategory: TALENT_CATEGORY_* --- - nCRMax: Challenge Rating of the talent --- - oCreature -function GetCreatureTalentBest(nCategory, nCRMax, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nCRMax) - StackPushInteger(nCategory) - VM_ExecuteCommand(308, 3) - return StackPopTalent() -end - --- Use tChosenTalent on oTarget. -function ActionUseTalentOnObject(tChosenTalent, oTarget) - StackPushObject(oTarget) - StackPushTalent(tChosenTalent) - VM_ExecuteCommand(309, 2) -end - --- Use tChosenTalent at lTargetLocation. -function ActionUseTalentAtLocation(tChosenTalent, lTargetLocation) - StackPushLocation(lTargetLocation) - StackPushTalent(tChosenTalent) - VM_ExecuteCommand(310, 2) -end - --- Get the gold piece value of oItem. --- * Returns 0 if oItem is not a valid item. -function GetGoldPieceValue(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(311, 1) - return StackPopInteger() -end - --- * Returns TRUE if oCreature is of a playable racial type. -function GetIsPlayableRacialType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(312, 1) - return StackPopBoolean() -end - --- Jump to lDestination. The action is added to the TOP of the action queue. -function JumpToLocation(lDestination) - StackPushLocation(lDestination) - VM_ExecuteCommand(313, 1) -end - --- Create a Temporary Hitpoints effect. --- - nHitPoints: a positive integer --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nHitPoints < 0. -function EffectTemporaryHitpoints(nHitPoints) - StackPushInteger(nHitPoints) - VM_ExecuteCommand(314, 1) - return StackPopEffect() -end - --- Get the number of ranks that oTarget has in nSkill. --- - nSkill: SKILL_* --- - oTarget --- - nBaseSkillRank: if set to true returns the number of base skill ranks the target --- has (i.e. not including any bonuses from ability scores, feats, etc). --- * Returns -1 if oTarget doesn't have nSkill. --- * Returns 0 if nSkill is untrained. -function GetSkillRank(nSkill, oTarget, nBaseSkillRank) - oTarget = oTarget or OBJECT_SELF - nBaseSkillRank = nBaseSkillRank or false - - StackPushBoolean(nBaseSkillRank) - StackPushObject(oTarget) - StackPushInteger(nSkill) - VM_ExecuteCommand(315, 3) - return StackPopInteger() -end - --- Get the attack target of oCreature. --- This only works when oCreature is in combat. -function GetAttackTarget(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(316, 1) - return StackPopObject() -end - --- Get the attack type (SPECIAL_ATTACK_*) of oCreature's last attack. --- This only works when oCreature is in combat. -function GetLastAttackType(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(317, 1) - return StackPopInteger() -end - --- Get the attack mode (COMBAT_MODE_*) of oCreature's last attack. --- This only works when oCreature is in combat. -function GetLastAttackMode(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(318, 1) - return StackPopInteger() -end - --- Get the master of oAssociate. -function GetMaster(oAssociate) - oAssociate = oAssociate or OBJECT_SELF - - StackPushObject(oAssociate) - VM_ExecuteCommand(319, 1) - return StackPopObject() -end - --- * Returns TRUE if oCreature is in combat. -function GetIsInCombat(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(320, 1) - return StackPopBoolean() -end - --- Get the last command (ASSOCIATE_COMMAND_*) issued to oAssociate. -function GetLastAssociateCommand(oAssociate) - oAssociate = oAssociate or OBJECT_SELF - - StackPushObject(oAssociate) - VM_ExecuteCommand(321, 1) - return StackPopInteger() -end - --- Give nGP gold to oCreature. -function GiveGoldToCreature(oCreature, nGP) - StackPushInteger(nGP) - StackPushObject(oCreature) - VM_ExecuteCommand(322, 2) -end - --- Set the destroyable status of the caller. --- - bDestroyable: If this is FALSE, the caller does not fade out on death, but --- sticks around as a corpse. --- - bRaiseable: If this is TRUE, the caller can be raised via resurrection. --- - bSelectableWhenDead: If this is TRUE, the caller is selectable after death. -function SetIsDestroyable(bDestroyable, bRaiseable, bSelectableWhenDead) - if bRaiseable == nil then bRaiseable = true end - bSelectableWhenDead = bSelectableWhenDead or false - - StackPushBoolean(bSelectableWhenDead) - StackPushBoolean(bRaiseable) - StackPushBoolean(bDestroyable) - VM_ExecuteCommand(323, 3) -end - --- Set the locked state of oTarget, which can be a door or a placeable object. -function SetLocked(oTarget, bLocked) - StackPushBoolean(bLocked) - StackPushObject(oTarget) - VM_ExecuteCommand(324, 2) -end - --- Get the locked state of oTarget, which can be a door or a placeable object. -function GetLocked(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(325, 1) - return StackPopBoolean() -end - --- Use this in a trigger's OnClick event script to get the object that last --- clicked on it. --- This is identical to GetEnteringObject. --- GetClickingObject() should not be called from a placeable's OnClick event, --- instead use GetPlaceableLastClickedBy() -function GetClickingObject() - VM_ExecuteCommand(326, 0) - return StackPopObject() -end - --- Initialise oTarget to listen for the standard Associates commands. -function SetAssociateListenPatterns(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(327, 1) -end - --- Get the last weapon that oCreature used in an attack. --- * Returns OBJECT_INVALID if oCreature did not attack, or has no weapon equipped. -function GetLastWeaponUsed(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(328, 1) - return StackPopObject() -end - --- Use oPlaceable. -function ActionInteractObject(oPlaceable) - StackPushObject(oPlaceable) - VM_ExecuteCommand(329, 1) -end - --- Get the last object that used the placeable object that is calling this function. --- * Returns OBJECT_INVALID if it is called by something other than a placeable or --- a door. -function GetLastUsedBy() - VM_ExecuteCommand(330, 0) - return StackPopObject() -end - --- Returns the ability modifier for the specified ability --- Get oCreature's ability modifier for nAbility. --- - nAbility: ABILITY_* --- - oCreature -function GetAbilityModifier(nAbility) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nAbility) - VM_ExecuteCommand(331, 2) - return StackPopInteger() -end - --- Determined whether oItem has been identified. -function GetIdentified(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(332, 1) - return StackPopBoolean() -end - --- Set whether oItem has been identified. -function SetIdentified(oItem, bIdentified) - StackPushBoolean(bIdentified) - StackPushObject(oItem) - VM_ExecuteCommand(333, 2) -end - --- Summon an Animal Companion -function SummonAnimalCompanion(oMaster) - oMaster = oMaster or OBJECT_SELF - - StackPushObject(oMaster) - VM_ExecuteCommand(334, 1) -end - --- Summon a Familiar -function SummonFamiliar(oMaster) - oMaster = oMaster or OBJECT_SELF - - StackPushObject(oMaster) - VM_ExecuteCommand(335, 1) -end - --- Get the last blocking door encountered by the caller of this function. --- * Returns OBJECT_INVALID if the caller is not a valid creature. -function GetBlockingDoor() - VM_ExecuteCommand(336, 0) - return StackPopObject() -end - --- - oTargetDoor --- - nDoorAction: DOOR_ACTION_* --- * Returns TRUE if nDoorAction can be performed on oTargetDoor. -function GetIsDoorActionPossible(oTargetDoor, nDoorAction) - StackPushInteger(nDoorAction) - StackPushObject(oTargetDoor) - VM_ExecuteCommand(337, 2) - return StackPopBoolean() -end - --- Perform nDoorAction on oTargetDoor. -function DoDoorAction(oTargetDoor, nDoorAction) - StackPushInteger(nDoorAction) - StackPushObject(oTargetDoor) - VM_ExecuteCommand(338, 2) -end - --- Get the first item in oTarget's inventory (start to cycle through oTarget's --- inventory). --- * Returns OBJECT_INVALID if the caller is not a creature, item, placeable or store, --- or if no item is found. -function GetFirstItemInInventory(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(339, 1) - return StackPopObject() -end - --- Get the next item in oTarget's inventory (continue to cycle through oTarget's --- inventory). --- * Returns OBJECT_INVALID if the caller is not a creature, item, placeable or store, --- or if no item is found. -function GetNextItemInInventory(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(340, 1) - return StackPopObject() -end - --- A creature can have up to three classes. This function determines the --- creature's class (CLASS_TYPE_*) based on nClassPosition. --- - nClassPosition: 1, 2 or 3 --- - oCreature --- * Returns CLASS_TYPE_INVALID if the oCreature does not have a class in --- nClassPosition (i.e. a single-class creature will only have a value in --- nClassLocation=1) or if oCreature is not a valid creature. -function GetClassByPosition(nClassPosition, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nClassPosition) - VM_ExecuteCommand(341, 2) - return StackPopInteger() -end - --- A creature can have up to three classes. This function determines the --- creature's class level based on nClass Position. --- - nClassPosition: 1, 2 or 3 --- - oCreature --- * Returns 0 if oCreature does not have a class in nClassPosition --- (i.e. a single-class creature will only have a value in nClassLocation=1) --- or if oCreature is not a valid creature. -function GetLevelByPosition(nClassPosition, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nClassPosition) - VM_ExecuteCommand(342, 2) - return StackPopInteger() -end - --- Determine the levels that oCreature holds in nClassType. --- - nClassType: CLASS_TYPE_* --- - oCreature -function GetLevelByClass(nClassType, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nClassType) - VM_ExecuteCommand(343, 2) - return StackPopInteger() -end - --- Get the amount of damage of type nDamageType that has been dealt to the caller. --- - nDamageType: DAMAGE_TYPE_* -function GetDamageDealtByType(nDamageType) - StackPushInteger(nDamageType) - VM_ExecuteCommand(344, 1) - return StackPopInteger() -end - --- Get the total amount of damage that has been dealt to the caller. -function GetTotalDamageDealt() - VM_ExecuteCommand(345, 0) - return StackPopInteger() -end - --- Get the last object that damaged oObject --- * Returns OBJECT_INVALID if the passed in object is not a valid object. -function GetLastDamager(oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - VM_ExecuteCommand(346, 1) - return StackPopObject() -end - --- Get the last object that disarmed the trap on the caller. --- * Returns OBJECT_INVALID if the caller is not a valid placeable, trigger or --- door. -function GetLastDisarmed() - VM_ExecuteCommand(347, 0) - return StackPopObject() -end - --- Get the last object that disturbed the inventory of the caller. --- * Returns OBJECT_INVALID if the caller is not a valid creature or placeable. -function GetLastDisturbed() - VM_ExecuteCommand(348, 0) - return StackPopObject() -end - --- Get the last object that locked the caller. --- * Returns OBJECT_INVALID if the caller is not a valid door or placeable. -function GetLastLocked() - VM_ExecuteCommand(349, 0) - return StackPopObject() -end - --- Get the last object that unlocked the caller. --- * Returns OBJECT_INVALID if the caller is not a valid door or placeable. -function GetLastUnlocked() - VM_ExecuteCommand(350, 0) - return StackPopObject() -end - --- Create a Skill Increase effect. --- - nSkill: SKILL_* --- - nValue --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nSkill is invalid. -function EffectSkillIncrease(nSkill, nValue) - StackPushInteger(nValue) - StackPushInteger(nSkill) - VM_ExecuteCommand(351, 2) - return StackPopEffect() -end - --- Get the type of disturbance (INVENTORY_DISTURB_*) that caused the caller's --- OnInventoryDisturbed script to fire. This will only work for creatures and --- placeables. -function GetInventoryDisturbType() - VM_ExecuteCommand(352, 0) - return StackPopInteger() -end - --- get the item that caused the caller's OnInventoryDisturbed script to fire. --- * Returns OBJECT_INVALID if the caller is not a valid object. -function GetInventoryDisturbItem() - VM_ExecuteCommand(353, 0) - return StackPopObject() -end - --- Get the henchman belonging to oMaster. --- * Return OBJECT_INVALID if oMaster does not have a henchman. --- -nNth: Which henchman to return. -function GetHenchman(oMaster, nNth) - oMaster = oMaster or OBJECT_SELF - nNth = nNth or 1 - - StackPushInteger(nNth) - StackPushObject(oMaster) - VM_ExecuteCommand(354, 2) - return StackPopObject() -end - --- Set eEffect to be versus a specific alignment. --- - eEffect --- - nLawChaos: ALIGNMENT_LAWFUL/ALIGNMENT_CHAOTIC/ALIGNMENT_ALL --- - nGoodEvil: ALIGNMENT_GOOD/ALIGNMENT_EVIL/ALIGNMENT_ALL -function VersusAlignmentEffect(eEffect, nLawChaos, nGoodEvil) - nLawChaos = nLawChaos or 0 --ALIGNMENT_ALL - nGoodEvil = nGoodEvil or 0 --ALIGNMENT_ALL - - StackPushInteger(nGoodEvil) - StackPushInteger(nLawChaos) - StackPushEffect(eEffect) - VM_ExecuteCommand(355, 3) - return StackPopEffect() -end - --- Set eEffect to be versus nRacialType. --- - eEffect --- - nRacialType: RACIAL_TYPE_* -function VersusRacialTypeEffect(eEffect, nRacialType) - StackPushInteger(nRacialType) - StackPushEffect(eEffect) - VM_ExecuteCommand(356, 2) - return StackPopEffect() -end - --- Set eEffect to be versus traps. -function VersusTrapEffect(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(357, 1) - return StackPopEffect() -end - --- Get the gender of oCreature. -function GetGender(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(358, 1) - return StackPopInteger() -end - --- * Returns TRUE if tTalent is valid. -function GetIsTalentValid(tTalent) - StackPushTalent(tTalent) - VM_ExecuteCommand(359, 1) - return StackPopBoolean() -end - --- Causes the action subject to move away from lMoveAwayFrom. -function ActionMoveAwayFromLocation(lMoveAwayFrom, bRun, fMoveAwayRange) - bRun = bRun or false - fMoveAwayRange = fMoveAwayRange or 40.0 - - StackPushFloat(fMoveAwayRange) - StackPushBoolean(bRun) - StackPushLocation(lMoveAwayFrom) - VM_ExecuteCommand(360, 3) -end - --- Get the target that the caller attempted to attack - this should be used in --- conjunction with GetAttackTarget(). This value is set every time an attack is --- made, and is reset at the end of combat. --- * Returns OBJECT_INVALID if the caller is not a valid creature. -function GetAttemptedAttackTarget() - VM_ExecuteCommand(361, 0) - return StackPopObject() -end - --- Get the type (TALENT_TYPE_*) of tTalent. -function GetTypeFromTalent(tTalent) - StackPushTalent(tTalent) - VM_ExecuteCommand(362, 1) - return StackPopInteger() -end - --- Get the ID of tTalent. This could be a SPELL_*, FEAT_* or SKILL_*. -function GetIdFromTalent(tTalent) - StackPushTalent(tTalent) - VM_ExecuteCommand(363, 1) - return StackPopInteger() -end - --- Get the associate of type nAssociateType belonging to oMaster. --- - nAssociateType: ASSOCIATE_TYPE_* --- - nMaster --- - nTh: Which associate of the specified type to return --- * Returns OBJECT_INVALID if no such associate exists. -function GetAssociate(nAssociateType, oMaster, nNth) - oMaster = oMaster or OBJECT_SELF - inNth = nNth or 1 - - StackPushInteger(nNth) - StackPushObject(oMaster) - StackPushInteger(nAssociateType) - VM_ExecuteCommand(364, 3) - return StackPopObject() -end - --- Add oHenchman as a henchman to oMaster --- If oHenchman is either a DM or a player character, this will have no effect. -function AddHenchman(oMaster, oHenchman) - oHenchman = oHenchman or OBJECT_SELF - - StackPushObject(oHenchman) - StackPushObject(oMaster) - VM_ExecuteCommand(365, 2) -end - --- Remove oHenchman from the service of oMaster, returning them to their original faction. -function RemoveHenchman(oMaster, oHenchman) - oHenchman = oHenchman or OBJECT_SELF - - StackPushObject(oHenchman) - StackPushObject(oMaster) - VM_ExecuteCommand(366, 2) - -end - --- Add a journal quest entry to oCreature. --- - szPlotID: the plot identifier used in the toolset's Journal Editor --- - nState: the state of the plot as seen in the toolset's Journal Editor --- - oCreature --- - bAllPartyMembers: If this is TRUE, the entry will show up in the journal of --- everyone in the party --- - bAllPlayers: If this is TRUE, the entry will show up in the journal of --- everyone in the world --- - bAllowOverrideHigher: If this is TRUE, you can set the state to a lower --- number than the one it is currently on -function AddJournalQuestEntry(szPlotID, nState, oCreature, bAllPartyMembers, bAllPlayers, bAllowOverrideHigher) - if bAllPartyMembers == nil then bAllPartyMembers = true end - bAllPlayers = bAllPlayers or false - bAllowOverrideHigher = bAllowOverrideHigher or false - - StackPushBoolean(bAllowOverrideHigher) - StackPushBoolean(bAllPlayers) - StackPushBoolean(bAllPartyMembers) - StackPushObject(oCreature) - StackPushInteger(nState) - StackPushString(szPlotID) - VM_ExecuteCommand(367, 6) -end - --- Remove a journal quest entry from oCreature. --- - szPlotID: the plot identifier used in the toolset's Journal Editor --- - oCreature --- - bAllPartyMembers: If this is TRUE, the entry will be removed from the --- journal of everyone in the party --- - bAllPlayers: If this is TRUE, the entry will be removed from the journal of --- everyone in the world -function RemoveJournalQuestEntry(szPlotID, oCreature, bAllPartyMembers, bAllPlayers) - if bAllPartyMembers == nil then bAllPartyMembers = true end - bAllPlayers = bAllPlayers or false - - StackPushBoolean(bAllPlayers) - StackPushBoolean(bAllPartyMembers) - StackPushObject(oCreature) - StackPushString(szPlotID) - VM_ExecuteCommand(368, 4) -end - --- Get the public part of the CD Key that oPlayer used when logging in. --- - nSinglePlayerCDKey: If set to TRUE, the player's public CD Key will --- be returned when the player is playing in single player mode --- (otherwise returns an empty string in single player mode). -function GetPCPublicCDKey(oPlayer, bSinglePlayerCDKey) - bSinglePlayerCDKey = bSinglePlayerCDKey or false - - StackPushBoolean(bSinglePlayerCDKey) - StackPushObject(oPlayer) - VM_ExecuteCommand(369, 2) - return StackPopString() -end - --- Get the IP address from which oPlayer has connected. -function GetPCIPAddress(oPlayer) - StackPushObject(oPlayer) - VM_ExecuteCommand(370, 1) - return StackPopString() -end - --- Get the name of oPlayer. -function GetPCPlayerName(oPlayer) - StackPushObject(oPlayer) - VM_ExecuteCommand(371, 1) - return StackPopString() -end - --- Sets oPlayer and oTarget to like each other. -function SetPCLike(oPlayer, oTarget) - StackPushObject(oTarget) - StackPushObject(oPlayer) - VM_ExecuteCommand(372, 2) -end - --- Sets oPlayer and oTarget to dislike each other. -function SetPCDislike(oPlayer, oTarget) - StackPushObject(oTarget) - StackPushObject(oPlayer) - VM_ExecuteCommand(373, 2) -end - --- Send a server message (szMessage) to the oPlayer. -function SendMessageToPC(oPlayer, sMessage) - StackPushString(sMessage) - StackPushObject(oPlayer) - VM_ExecuteCommand(374, 2) -end - --- Get the target at which the caller attempted to cast a spell. --- This value is set every time a spell is cast and is reset at the end of --- combat. --- * Returns OBJECT_INVALID if the caller is not a valid creature. -function GetAttemptedSpellTarget() - VM_ExecuteCommand(375, 0) - return StackPopObject() -end - --- Get the last creature that opened the caller. --- * Returns OBJECT_INVALID if the caller is not a valid door, placeable or store. -function GetLastOpenedBy() - VM_ExecuteCommand(376, 0) - return StackPopObject() -end - --- Determines the number of times that oCreature has nSpell memorised. --- - nSpell: SPELL_* --- - oCreature -function GetHasSpell(nSpell, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nSpell) - VM_ExecuteCommand(377, 2) - return StackPopInteger() -end - --- Open oStore for oPC. --- - nBonusMarkUp is added to the stores default mark up percentage on items sold (-100 to 100) --- - nBonusMarkDown is added to the stores default mark down percentage on items bought (-100 to 100) -function OpenStore(oStore, oPC, nBonusMarkUp, nBonusMarkDown) - nBonusMarkUp = nBonusMarkUp or 0 - nBonusMarkDown = nBonusMarkDown or 0 - - StackPushInteger(nBonusMarkDown) - StackPushInteger(nBonusMarkUp) - StackPushObject(oPC) - StackPushObject(oStore) - VM_ExecuteCommand(378, 4) -end - --- Create a Turned effect. --- Turned effects are supernatural by default. -function EffectTurned() - VM_ExecuteCommand(379, 0) - return StackPopEffect() -end - --- Get the first member of oMemberOfFaction's faction (start to cycle through --- oMemberOfFaction's faction). --- * Returns OBJECT_INVALID if oMemberOfFaction's faction is invalid. -function GetFirstFactionMember(oMemberOfFaction, bPCOnly) - if bPCOnly == nil then bPCOnly = true end - - StackPushInteger(bPCOnly) - StackPushObject(oMemberOfFaction) - VM_ExecuteCommand(380, 2) - return StackPopObject() -end - --- Get the next member of oMemberOfFaction's faction (continue to cycle through --- oMemberOfFaction's faction). --- * Returns OBJECT_INVALID if oMemberOfFaction's faction is invalid. -function GetNextFactionMember(oMemberOfFaction, bPCOnly) - if bPCOnly == nil then bPCOnly = true end - - StackPushBoolean(bPCOnly) - StackPushObject(oMemberOfFaction) - VM_ExecuteCommand(381, 2) - return StackPopObject() -end - --- Force the action subject to move to lDestination. -function ActionForceMoveToLocation(lDestination, bRun, fTimeout) - bRun = bRun or false - fTimeout = fTimeout or 30.0 - - StackPushFloat(fTimeout) - StackPushInteger(bRun) - StackPushLocation(lDestination) - VM_ExecuteCommand(382, 3) -end - --- Force the action subject to move to oMoveTo. -function ActionForceMoveToObject(oMoveTo, bRun, fRange, fTimeout) - bRun = bRun or false - fRange = fRange or 1.0 - fTimeout = fTimeout or 30.0 - - StackPushFloat(fTimeout) - StackPushFloat(fRange) - StackPushInteger(bRun) - StackPushObject(oMoveTo) - VM_ExecuteCommand(383, 4) -end - --- Get the experience assigned in the journal editor for szPlotID. -function GetJournalQuestExperience(szPlotID) - StackPushString(szPlotID) - VM_ExecuteCommand(384, 1) - return StackPopInteger() -end - --- Jump to oToJumpTo (the action is added to the top of the action queue). -function JumpToObject(oToJumpTo, bWalkStraightLineToPoint) - if bWalkStraightLineToPoint == nil then bWalkStraightLineToPoint = true end - - StackPushBoolean(bWalkStraightLineToPoint) - StackPushObject(oToJumpTo) - VM_ExecuteCommand(385, 2) - -end - --- Set whether oMapPin is enabled. --- - oMapPin --- - nEnabled: 0=Off, 1=On -function SetMapPinEnabled(oMapPin, bEnabled) - StackPushBoolean(bEnabled) - StackPushObject(oMapPin) - VM_ExecuteCommand(386, 2) -end - --- Create a Hit Point Change When Dying effect. --- - fHitPointChangePerRound: this can be positive or negative, but not zero. --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if fHitPointChangePerRound is 0. -function EffectHitPointChangeWhenDying(fHitPointChangePerRound) - StackPushFloat(fHitPointChangePerRound) - VM_ExecuteCommand(387, 1) - return StackPopEffect() -end - --- Spawn a GUI panel for the client that controls oPC. --- - oPC --- - nGUIPanel: GUI_PANEL_* --- * Nothing happens if oPC is not a player character or if an invalid value is --- used for nGUIPanel. -function PopUpGUIPanel(oPC, nGUIPanel) - StackPushInteger(nGUIPanel) - StackPushObject(oPC) - VM_ExecuteCommand(388, 2) -end - --- Clear all personal feelings that oSource has about oTarget. -function ClearPersonalReputation(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(389, 2) -end - --- oSource will temporarily be friends towards oTarget. --- bDecays determines whether the personal reputation value decays over time --- fDurationInSeconds is the length of time that the temporary friendship lasts --- Make oSource into a temporary friend of oTarget using personal reputation. --- - oTarget --- - oSource --- - bDecays: If this is TRUE, the friendship decays over fDurationInSeconds --- otherwise it is indefinite. --- - fDurationInSeconds: This is only used if bDecays is TRUE, it is how long --- the friendship lasts. --- Note: If bDecays is TRUE, the personal reputation amount decreases in size --- over fDurationInSeconds. Friendship will only be in effect as long as --- (faction reputation + total personal reputation) >= REPUTATION_TYPE_FRIEND. -function SetIsTemporaryFriend(oTarget, oSource, bDecays, fDurationInSeconds) - oSource = oSource or OBJECT_SELF - bDecays = bDecays or false - fDurationInSeconds = fDurationInSeconds or 180.0 - - StackPushFloat(fDurationInSeconds) - StackPushBoolean(bDecays) - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(390, 4) -end - --- Make oSource into a temporary enemy of oTarget using personal reputation. --- - oTarget --- - oSource --- - bDecays: If this is TRUE, the enmity decays over fDurationInSeconds --- otherwise it is indefinite. --- - fDurationInSeconds: This is only used if bDecays is TRUE, it is how long --- the enmity lasts. --- Note: If bDecays is TRUE, the personal reputation amount decreases in size --- over fDurationInSeconds. Enmity will only be in effect as long as --- (faction reputation + total personal reputation) <= REPUTATION_TYPE_ENEMY. -function SetIsTemporaryEnemy(oTarget, oSource, bDecays, fDurationInSeconds) - oSource = oSource or OBJECT_SELF - bDecays = bDecays or false - fDurationInSeconds = fDurationInSeconds or 180.0 - - StackPushFloat(fDurationInSeconds) - StackPushBoolean(bDecays) - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(391, 4) -end - --- Make oSource temporarily neutral to oTarget using personal reputation. --- - oTarget --- - oSource --- - bDecays: If this is TRUE, the neutrality decays over fDurationInSeconds --- otherwise it is indefinite. --- - fDurationInSeconds: This is only used if bDecays is TRUE, it is how long --- the neutrality lasts. --- Note: If bDecays is TRUE, the personal reputation amount decreases in size --- over fDurationInSeconds. Neutrality will only be in effect as long as --- (faction reputation + total personal reputation) > REPUTATION_TYPE_ENEMY and --- (faction reputation + total personal reputation) < REPUTATION_TYPE_FRIEND. -function SetIsTemporaryNeutral(oTarget, oSource, bDecays, fDurationInSeconds) - oSource = oSource or OBJECT_SELF - bDecays = bDecays or false - fDurationInSeconds = fDurationInSeconds or 180.0 - - StackPushFloat(fDurationInSeconds) - StackPushBoolean(bDecays) - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(392, 4) -end - --- Gives nXpAmount to oCreature. -function GiveXPToCreature(oCreature, nXpAmount) - StackPushInteger(nXpAmount) - StackPushObject(oCreature) - VM_ExecuteCommand(393, 2) -end - --- Sets oCreature's experience to nXpAmount. -function SetXP(oCreature, nXpAmount) - StackPushInteger(nXpAmount) - StackPushObject(oCreature) - VM_ExecuteCommand(394, 2) -end - --- Get oCreature's experience. -function GetXP(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(395, 1) - return StackPopInteger() -end - --- Convert nInteger to hex, returning the hex value as a string. --- * Return value has the format "0x????????" where each ? will be a hex digit --- (8 digits in total). -function IntToHexString(nInteger) - StackPushInteger(nInteger) - VM_ExecuteCommand(396, 1) - return StackPopString() -end - --- Get the base item type (BASE_ITEM_*) of oItem. --- * Returns BASE_ITEM_INVALID if oItem is an invalid item. -function GetBaseItemType(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(397, 1) - return StackPopInteger() -end - --- Determines whether oItem has nProperty. --- - oItem --- - nProperty: ITEM_PROPERTY_* --- * Returns FALSE if oItem is not a valid item, or if oItem does not have --- nProperty. -function GetItemHasItemProperty(oItem, nProperty) - StackPushInteger(nProperty) - StackPushObject(oItem) - VM_ExecuteCommand(398, 2) - return StackPopBoolean() -end - --- The creature will equip the melee weapon in its possession that can do the --- most damage. If no valid melee weapon is found, it will equip the most --- damaging range weapon. This function should only ever be called in the --- EndOfCombatRound scripts, because otherwise it would have to stop the combat --- round to run simulation. --- - oVersus: You can try to get the most damaging weapon against oVersus --- - bOffHand -function ActionEquipMostDamagingMelee(oVersus, bOffHand) - oVersus = oVersus or OBJECT_INVALID - bOffHand = bOffHand or false - - StackPushBoolean(bOffHand) - StackPushObject(oVersus) - VM_ExecuteCommand(399, 2) -end - --- The creature will equip the range weapon in its possession that can do the --- most damage. --- If no valid range weapon can be found, it will equip the most damaging melee --- weapon. --- - oVersus: You can try to get the most damaging weapon against oVersus -function ActionEquipMostDamagingRanged(oVersus) - oVersus = oVersus or OBJECT_INVALID - - StackPushObject(oVersus) - VM_ExecuteCommand(400, 1) -end - --- Get the Armour Class of oItem. --- * Return 0 if the oItem is not a valid item, or if oItem has no armour value. -function GetItemACValue(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(401, 1) - return StackPopInteger() -end - --- The creature will rest if not in combat and no enemies are nearby. --- - bCreatureToEnemyLineOfSightCheck: TRUE to allow the creature to rest if enemies --- are nearby, but the creature can't see the enemy. --- FALSE the creature will not rest if enemies are --- nearby regardless of whether or not the creature --- can see them, such as if an enemy is close by, --- but is in a different room behind a closed door. -function ActionRest(bCreatureToEnemyLineOfSightCheck) - bCreatureToEnemyLineOfSightCheck = bCreatureToEnemyLineOfSightCheck or false - - StackPushBoolean(bCreatureToEnemyLineOfSightCheck) - VM_ExecuteCommand(402, 1) -end - --- Expose/Hide the entire map of oArea for oPlayer. --- - oArea: The area that the map will be exposed/hidden for. --- - oPlayer: The player the map will be exposed/hidden for. --- - bExplored: TRUE/FALSE. Whether the map should be completely explored or hidden. -function ExploreAreaForPlayer(oArea, oPlayer, bExplored) - if bExplored == nil then bExplored = true end - - StackPushBoolean(bExplored) - StackPushObject(oPlayer) - StackPushObject(oArea) - VM_ExecuteCommand(403, 3) -end - --- The creature will equip the armour in its possession that has the highest --- armour class. -function ActionEquipMostEffectiveArmor() - VM_ExecuteCommand(404, 0) -end - --- * Returns TRUE if it is currently day. -function GetIsDay() - VM_ExecuteCommand(405, 0) - return StackPopBoolean() -end - --- * Returns TRUE if it is currently night. -function GetIsNight() - VM_ExecuteCommand(406, 0) - return StackPopBoolean() -end - --- * Returns TRUE if it is currently dawn. -function GetIsDawn() - VM_ExecuteCommand(407, 0) - return StackPopBoolean() -end - --- * Returns TRUE if it is currently dusk. -function GetIsDusk() - VM_ExecuteCommand(408, 0) - return StackPopBoolean() -end - --- * Returns TRUE if oCreature was spawned from an encounter. -function GetIsEncounterCreature(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(409, 1) - return StackPopBoolean() -end - --- Use this in an OnPlayerDying module script to get the last player who is dying. -function GetLastPlayerDying() - VM_ExecuteCommand(410, 0) - return StackPopObject() -end - --- Get the starting location of the module. -function GetStartingLocation() - VM_ExecuteCommand(411, 0) - return StackPopLocation() -end - --- Make oCreatureToChange join one of the standard factions. --- ** This will only work on an NPC ** --- - nStandardFaction: STANDARD_FACTION_* -function ChangeToStandardFaction(oCreatureToChange,nStandardFaction ) - StackPushInteger(nStandardFaction) - StackPushObject(oCreatureToChange) - VM_ExecuteCommand(412, 2) -end - --- Play oSound. -function SoundObjectPlay(oSound) - StackPushObject(oSound) - VM_ExecuteCommand(413, 1) -end - --- Stop playing oSound. -function SoundObjectStop(oSound) - StackPushObject(oSound) - VM_ExecuteCommand(414, 1) -end - --- Set the volume of oSound. --- - oSound --- - nVolume: 0-127 -function SoundObjectSetVolume(oSound, nVolume) - StackPushInteger(nVolume) - StackPushObject(oSound) - VM_ExecuteCommand(415, 2) -end - --- Set the position of oSound. -function SoundObjectSetPosition(oSound, vPosition) - StackPushVector(vPosition) - StackPushObject(oSound) - VM_ExecuteCommand(416, 2) -end - --- Immediately speak a conversation one-liner. --- - sDialogResRef --- - oTokenTarget: This must be specified if there are creature-specific tokens --- in the string. -function SpeakOneLinerConversation(sDialogResRef, oTokenTarget) - sDialogResRef = sDialogResRef or "" - oTokenTarget = oTokenTarget or 32767 --OBJECT_TYPE_INVALID - - StackPushObject(oTokenTarget) - StackPushString(sDialogResRef) - VM_ExecuteCommand(417, 2) -end - --- Get the amount of gold possessed by oTarget. -function GetGold(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(418, 1) - return StackPopInteger() -end - --- Use this in an OnRespawnButtonPressed module script to get the object id of --- the player who last pressed the respawn button. -function GetLastRespawnButtonPresser() - VM_ExecuteCommand(419, 0) - return StackPopObject() -end - --- * Returns TRUE if oCreature is the Dungeon Master. --- Note: This will return FALSE if oCreature is a DM Possessed creature. --- To determine if oCreature is a DM Possessed creature, use GetIsDMPossessed() -function GetIsDM(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(420, 1) - return StackPopBoolean() -end - --- Play a voice chat. --- - nVoiceChatID: VOICE_CHAT_* --- - oTarget -function PlayVoiceChat(nVoiceChatID, oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - StackPushInteger(nVoiceChatID) - VM_ExecuteCommand(421, 2) -end - --- * Returns TRUE if the weapon equipped is capable of damaging oVersus. -function GetIsWeaponEffective(oVersus, bOffHand) - oVersus = oVersus or OBJECT_INVALID - bOffHand = bOffHand or false - - StackPushBoolean(bOffHand) - StackPushObject(oVersus) - VM_ExecuteCommand(422, 2) - return StackPopBoolean() -end - --- Use this in a SpellCast script to determine whether the spell was considered --- harmful. --- * Returns TRUE if the last spell cast was harmful. -function GetLastSpellHarmful() - VM_ExecuteCommand(423, 0) - return StackPopBoolean() -end - --- Activate oItem. -function EventActivateItem(oItem, lTarget, oTarget) - oTarget = oTarget or OBJECT_INVALID - - StackPushObject(oTarget) - StackPushLocation(lTarget) - StackPushObject(oItem) - VM_ExecuteCommand(424, 3) - return StackPopEvent() -end - --- Play the background music for oArea. -function MusicBackgroundPlay(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(425, 1) -end - --- Stop the background music for oArea. -function MusicBackgroundStop(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(426, 1) -end - --- Set the delay for the background music for oArea. --- - oArea --- - nDelay: delay in milliseconds -function MusicBackgroundSetDelay(oArea, nDelay) - StackPushInteger(nDelay) - StackPushObject(oArea) - VM_ExecuteCommand(427, 2) -end - --- Change the background day track for oArea to nTrack. --- - oArea --- - nTrack -function MusicBackgroundChangeDay(oArea, nTrack) - StackPushInteger(nTrack) - StackPushObject(oArea) - VM_ExecuteCommand(428, 2) -end - --- Change the background night track for oArea to nTrack. --- - oArea --- - nTrack -function MusicBackgroundChangeNight(oArea, nTrack) - StackPushInteger(nTrack) - StackPushObject(oArea) - VM_ExecuteCommand(429, 2) -end - --- Play the battle music for oArea. -function MusicBattlePlay(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(430, 1) -end - --- Stop the battle music for oArea. -function MusicBattleStop(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(431, 1) -end - --- Change the battle track for oArea. --- - oArea --- - nTrack -function MusicBattleChange(oArea, nTrack) - StackPushInteger(nTrack) - StackPushObject(oArea) - VM_ExecuteCommand(432, 2) -end - --- Play the ambient sound for oArea. -function AmbientSoundPlay(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(433, 1) -end - --- Stop the ambient sound for oArea. -function AmbientSoundStop(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(434, 1) -end - --- Change the ambient day track for oArea to nTrack. --- - oArea --- - nTrack -function AmbientSoundChangeDay(oArea, nTrack) - StackPushInteger(nTrack) - StackPushObject(oArea) - VM_ExecuteCommand(435, 2) -end - --- Change the ambient night track for oArea to nTrack. --- - oArea --- - nTrack -function AmbientSoundChangeNight(oArea, nTrack) - StackPushInteger(nTrack) - StackPushObject(oArea) - VM_ExecuteCommand(436, 2) -end - --- Get the object that killed the caller. -function GetLastKiller() - VM_ExecuteCommand(437, 0) - return StackPopObject() -end - --- Use this in a spell script to get the item used to cast the spell. -function GetSpellCastItem() - VM_ExecuteCommand(438, 0) - return StackPopObject() -end - --- Use this in an OnItemActivated module script to get the item that was activated. -function GetItemActivated() - VM_ExecuteCommand(439, 0) - return StackPopObject() -end - --- Use this in an OnItemActivated module script to get the creature that --- activated the item. -function GetItemActivator() - VM_ExecuteCommand(440, 0) - return StackPopObject() -end - --- Use this in an OnItemActivated module script to get the location of the item's --- target. -function GetItemActivatedTargetLocation() - VM_ExecuteCommand(441, 0) - return StackPopLocation() -end - --- Use this in an OnItemActivated module script to get the item's target. -function GetItemActivatedTarget() - VM_ExecuteCommand(442, 0) - return StackPopObject() -end - --- * Returns TRUE if oObject (which is a placeable or a door) is currently open. -function GetIsOpen(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(443, 1) - return StackPopBoolean() -end - --- Take nAmount of gold from oCreatureToTakeFrom. --- - nAmount --- - oCreatureToTakeFrom: If this is not a valid creature, nothing will happen. --- - bDestroy: If this is TRUE, the caller will not get the gold. Instead, the --- gold will be destroyed and will vanish from the game. -function TakeGoldFromCreature(nAmount, oCreatureToTakeFrom, bDestroy) - bDestroy = bDestroy or false - - StackPushBoolean(bDestroy) - StackPushObject(oCreatureToTakeFrom) - StackPushInteger(nAmount) - VM_ExecuteCommand(444, 3) -end - --- Determine whether oObject is in conversation. -function IsInConversation(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(445, 1) - return StackPopBoolean() -end - --- Create an Ability Decrease effect. --- - nAbility: ABILITY_* --- - nModifyBy: This is the amount by which to decrement the ability -function EffectAbilityDecrease(nAbility, nModifyBy) - StackPushInteger(nModifyBy) - StackPushInteger(nAbility) - VM_ExecuteCommand(446, 2) - return StackPopEffect() -end - --- Create an Attack Decrease effect. --- - nPenalty --- - nModifierType: ATTACK_BONUS_* -function EffectAttackDecrease(nPenalty, nModifierType) - nModifierType = nModifierType or 0 --ATTACK_BONUS_MISC - - StackPushInteger(nModifierType) - StackPushInteger(nPenalty) - VM_ExecuteCommand(447, 2) - return StackPopEffect() -end - --- Create a Damage Decrease effect. --- - nPenalty --- - nDamageType: DAMAGE_TYPE_* -function EffectDamageDecrease(nPenalty, nDamageType) - nDamageType = nDamageType or 8 --DAMAGE_TYPE_MAGICAL - - StackPushInteger(nDamageType) - StackPushInteger(nPenalty) - VM_ExecuteCommand(448, 2) - return StackPopEffect() -end - --- Create a Damage Immunity Decrease effect. --- - nDamageType: DAMAGE_TYPE_* --- - nPercentImmunity -function EffectDamageImmunityDecrease(nDamageType, nPercentImmunity) - StackPushInteger(nPercentImmunity) - StackPushInteger(nDamageType) - VM_ExecuteCommand(449, 2) - return StackPopEffect() -end - --- Create an AC Decrease effect. --- - nValue --- - nModifyType: AC_* --- - nDamageType: DAMAGE_TYPE_* --- * Default value for nDamageType should only ever be used in this function prototype. -function EffectACDecrease(nValue, nModifyType, nDamageType) - nModifyType = nModifyType or 0 --AC_DODGE_BONUS - nDamageType = nDamageType or 4103 --AC_VS_DAMAGE_TYPE_ALL - - StackPushInteger(nDamageType) - StackPushInteger(nModifyType) - StackPushInteger(nValue) - VM_ExecuteCommand(450, 3) - return StackPopEffect() -end - --- Create a Movement Speed Decrease effect. --- - nPercentChange - range 0 through 99 --- eg. --- 0 = no change in speed --- 50 = 50% slower --- 99 = almost immobile -function EffectMovementSpeedDecrease(nPercentChange) - StackPushInteger(nPercentChange) - VM_ExecuteCommand(451, 1) - return StackPopEffect() -end - --- Create a Saving Throw Decrease effect. --- - nSave: SAVING_THROW_* (not SAVING_THROW_TYPE_*) --- SAVING_THROW_ALL --- SAVING_THROW_FORT --- SAVING_THROW_REFLEX --- SAVING_THROW_WILL --- - nValue: size of the Saving Throw decrease --- - nSaveType: SAVING_THROW_TYPE_* (e.g. SAVING_THROW_TYPE_ACID ) -function EffectSavingThrowDecrease(nSave, nValue, nSaveType) - nSaveType = nSaveType or 0 --SAVING_THROW_TYPE_ALL - - StackPushInteger(nSaveType) - StackPushInteger(nValue) - StackPushInteger(nSave) - VM_ExecuteCommand(452, 3) - return StackPopEffect() -end - --- Create a Skill Decrease effect. --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nSkill is invalid. -function EffectSkillDecrease(nSkill, nValue) - StackPushInteger(nValue) - StackPushInteger(nSkill) - VM_ExecuteCommand(453, 2) - return StackPopEffect() -end - --- Create a Spell Resistance Decrease effect. -function EffectSpellResistanceDecrease(nValue) - StackPushInteger(nValue) - VM_ExecuteCommand(454, 1) - return StackPopEffect() -end - --- Determine whether oTarget is a plot object. -function GetPlotFlag(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(455, 1) - return StackPopBoolean() -end - --- Set oTarget's plot object status. -function SetPlotFlag(oTarget, bPlotFlag) - StackPushBoolean(bPlotFlag) - StackPushObject(oTarget) - VM_ExecuteCommand(456, 2) -end - --- Create an Invisibility effect. --- - nInvisibilityType: INVISIBILITY_TYPE_* --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nInvisibilityType --- is invalid. -function EffectInvisibility(nInvisibilityType) - StackPushInteger(nInvisibilityType) - VM_ExecuteCommand(457, 1) - return StackPopEffect() -end - --- Create a Concealment effect. --- - nPercentage: 1-100 inclusive --- - nMissChanceType: MISS_CHANCE_TYPE_* --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nPercentage < 1 or --- nPercentage > 100. -function EffectConcealment(nPercentage, nMissType) - nMissType = nMissType or 0 --MISS_CHANCE_TYPE_NORMAL - - StackPushInteger(nMissType) - StackPushInteger(nPercentage) - VM_ExecuteCommand(458, 2) - return StackPopEffect() -end - --- Create a Darkness effect. -function EffectDarkness() - VM_ExecuteCommand(459, 0) - return StackPopEffect() -end - --- Create a Dispel Magic All effect. --- If no parameter is specified, USE_CREATURE_LEVEL will be used. This will --- cause the dispel effect to use the level of the creature that created the --- effect. -function EffectDispelMagicAll(nCasterLevel) - nCasterLevel = nCasterLevel or 0 --USE_CREATURE_LEVEL - - StackPushInteger(nCasterLevel) - VM_ExecuteCommand(460, 1) - return StackPopEffect() -end - --- Create an Ultravision effect. -function EffectUltravision() - VM_ExecuteCommand(461, 0) - return StackPopEffect() -end - --- Create a Negative Level effect. --- - nNumLevels: the number of negative levels to apply. --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nNumLevels > 100. -function EffectNegativeLevel(nNumLevels, bHPBonus) - bHPBonus = bHPBonus or false - - StackPushBoolean(bHPBonus) - StackPushInteger(nNumLevels) - VM_ExecuteCommand(462, 2) - return StackPopEffect() -end - --- Create a Polymorph effect. -function EffectPolymorph(nPolymorphSelection, bLocked) - bLocked = bLocked or false - - StackPushBoolean(bLocked) - StackPushInteger(nPolymorphSelection) - VM_ExecuteCommand(463, 2) - return StackPopEffect() -end - --- Create a Sanctuary effect. --- - nDifficultyClass: must be a non-zero, positive number --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nDifficultyClass <= 0. -function EffectSanctuary(nDifficultyClass) - StackPushInteger(nDifficultyClass) - VM_ExecuteCommand(464, 1) - return StackPopEffect() -end - --- Create a True Seeing effect. -function EffectTrueSeeing() - VM_ExecuteCommand(465, 0) - return StackPopEffect() -end - --- Create a See Invisible effect. -function EffectSeeInvisible() - VM_ExecuteCommand(466, 0) - return StackPopEffect() -end - --- Create a Time Stop effect. -function EffectTimeStop() - VM_ExecuteCommand(467, 0) - return StackPopEffect() -end - --- Create a Blindness effect. -function EffectBlindness() - VM_ExecuteCommand(468, 0) - return StackPopEffect() -end - --- Determine whether oSource has a friendly reaction towards oTarget, depending --- on the reputation, PVP setting and (if both oSource and oTarget are PCs), --- oSource's Like/Dislike setting for oTarget. --- Note: If you just want to know how two objects feel about each other in terms --- of faction and personal reputation, use GetIsFriend() instead. --- * Returns TRUE if oSource has a friendly reaction towards oTarget -function GetIsReactionTypeFriendly(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(469, 2) - return StackPopBoolean() -end - --- Determine whether oSource has a neutral reaction towards oTarget, depending --- on the reputation, PVP setting and (if both oSource and oTarget are PCs), --- oSource's Like/Dislike setting for oTarget. --- Note: If you just want to know how two objects feel about each other in terms --- of faction and personal reputation, use GetIsNeutral() instead. --- * Returns TRUE if oSource has a neutral reaction towards oTarget -function GetIsReactionTypeNeutral(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(470, 2) - return StackPopBoolean() -end - --- Determine whether oSource has a Hostile reaction towards oTarget, depending --- on the reputation, PVP setting and (if both oSource and oTarget are PCs), --- oSource's Like/Dislike setting for oTarget. --- Note: If you just want to know how two objects feel about each other in terms --- of faction and personal reputation, use GetIsEnemy() instead. --- * Returns TRUE if oSource has a hostile reaction towards oTarget -function GetIsReactionTypeHostile(oTarget, oSource) - oSource = oSource or OBJECT_SELF - - StackPushObject(oSource) - StackPushObject(oTarget) - VM_ExecuteCommand(471, 2) - return StackPopBoolean() -end - --- Create a Spell Level Absorption effect. --- - nMaxSpellLevelAbsorbed: maximum spell level that will be absorbed by the --- effect --- - nTotalSpellLevelsAbsorbed: maximum number of spell levels that will be --- absorbed by the effect --- - nSpellSchool: SPELL_SCHOOL_* --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if: --- nMaxSpellLevelAbsorbed is not between -1 and 9 inclusive, or nSpellSchool --- is invalid. -function EffectSpellLevelAbsorption(nMaxSpellLevelAbsorbed, nTotalSpellLevelsAbsorbed, nSpellSchool) - nTotalSpellLevelsAbsorbed = nTotalSpellLevelsAbsorbed or 0 - nSpellSchool = nSpellSchool or 0 --SPELL_SCHOOL_GENERAL - - StackPushInteger(nSpellSchool) - StackPushInteger(nTotalSpellLevelsAbsorbed) - StackPushInteger(nMaxSpellLevelAbsorbed) - VM_ExecuteCommand(472, 3) - return StackPopEffect() -end - --- Create a Dispel Magic Best effect. --- If no parameter is specified, USE_CREATURE_LEVEL will be used. This will --- cause the dispel effect to use the level of the creature that created the --- effect. -function EffectDispelMagicBest(nCasterLevel) - nCasterLevel = nCasterLevel or 0 --USE_CREATURE_LEVEL - - StackPushInteger(nCasterLevel) - VM_ExecuteCommand(473, 1) - return StackPopEffect() -end - --- Try to send oTarget to a new server defined by sIPaddress. --- - oTarget --- - sIPaddress: this can be numerical "192.168.0.84" or alphanumeric --- "www.bioware.com". It can also contain a port "192.168.0.84:5121" or --- "www.bioware.com:5121" if the port is not specified, it will default to --- 5121. --- - sPassword: login password for the destination server --- - sWaypointTag: if this is set, after portalling the character will be moved --- to this waypoint if it exists --- - bSeamless: if this is set, the client wil not be prompted with the --- information window telling them about the server, and they will not be --- allowed to save a copy of their character if they are using a local vault --- character. -function ActivatePortal(oTarget, sIPaddress, sPassword, sWaypointTag, bSeemless) - sIPaddress = sIPaddress or "" - sPassword = sPassword or "" - sWaypointTag = sWaypointTag or "" - bSeemless = bSeemless or false - - StackPushBoolean(bSeemless) - StackPushString(sWaypointTag) - StackPushString(sPassword) - StackPushString(sIPaddress) - StackPushObject(oTarget) - VM_ExecuteCommand(474, 5) -end - --- Get the number of stacked items that oItem comprises. -function GetNumStackedItems(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(475, 1) - return StackPopInteger() -end - --- Use this on an NPC to cause all creatures within a 10-metre radius to stop --- what they are doing and sets the NPC's enemies within this range to be --- neutral towards the NPC for roughly 3 minutes. If this command is run on a PC --- or an object that is not a creature, nothing will happen. -function SurrenderToEnemies() - VM_ExecuteCommand(476, 0) -end - --- Create a Miss Chance effect. --- - nPercentage: 1-100 inclusive --- - nMissChanceType: MISS_CHANCE_TYPE_* --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nPercentage < 1 or --- nPercentage > 100. -function EffectMissChance(nPercentage, nMissChanceType) - nMissChanceType = nMissChanceType or 0 --MISS_CHANCE_TYPE_NORMAL - - StackPushInteger(nMissChanceType) - StackPushInteger(nPercentage) - VM_ExecuteCommand(477, 2) - return StackPopEffect() -end - --- Get the number of Hitdice worth of Turn Resistance that oUndead may have. --- This will only work on undead creatures. -function GetTurnResistanceHD(oUndead) - oUndead = oUndead or OBJECT_SELF - - StackPushObject(oUndead) - VM_ExecuteCommand(478, 1) - return StackPopInteger() -end - --- Get the size (CREATURE_SIZE_*) of oCreature. -function GetCreatureSize(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(479, 1) - return StackPopInteger() -end - --- Create a Disappear/Appear effect. --- The object will "fly away" for the duration of the effect and will reappear --- at lLocation. --- - nAnimation determines which appear and disappear animations to use. Most creatures --- only have animation 1, although a few have 2 (like beholders) -function EffectDisappearAppear(lLocation, nAnimation) - nAnimation = nAnimation or 1 - - StackPushInteger(nAnimation) - StackPushLocation(lLocation) - VM_ExecuteCommand(480, 2) - return StackPopEffect() -end - --- Create a Disappear effect to make the object "fly away" and then destroy --- itself. --- - nAnimation determines which appear and disappear animations to use. Most creatures --- only have animation 1, although a few have 2 (like beholders) -function EffectDisappear(nAnimation) - nAnimation = nAnimation or 1 - - StackPushInteger(nAnimation) - VM_ExecuteCommand(481, 1) - return StackPopEffect() -end - --- Create an Appear effect to make the object "fly in". --- - nAnimation determines which appear and disappear animations to use. Most creatures --- only have animation 1, although a few have 2 (like beholders) -function EffectAppear(nAnimation) - nAnimation = nAnimation or 1 - - StackPushInteger(nAnimation) - VM_ExecuteCommand(482, 1) - return StackPopEffect() -end - --- The action subject will unlock oTarget, which can be a door or a placeable --- object. -function ActionUnlockObject(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(483, 1) -end - --- The action subject will lock oTarget, which can be a door or a placeable --- object. -function ActionLockObject(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(484, 1) -end - --- Create a Modify Attacks effect to add attacks. --- - nAttacks: maximum is 5, even with the effect stacked --- * Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nAttacks > 5. -function EffectModifyAttacks(nAttacks) - StackPushInteger(nAttacks) - VM_ExecuteCommand(485, 1) - return StackPopEffect() -end - --- Get the last trap detected by oTarget. --- * Return value on error: OBJECT_INVALID -function GetLastTrapDetected(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(486, 1) - return StackPopObject() -end - --- Create a Damage Shield effect which does (nDamageAmount + nRandomAmount) --- damage to any melee attacker on a successful attack of damage type nDamageType. --- - nDamageAmount: an integer value --- - nRandomAmount: DAMAGE_BONUS_* --- - nDamageType: DAMAGE_TYPE_* --- NOTE! You *must* use the DAMAGE_BONUS_* constants! Using other values may --- result in odd behaviour. -function EffectDamageShield(nDamageAmount, nRandomAmount, nDamageType) - StackPushInteger(nDamageType) - StackPushInteger(nRandomAmount) - StackPushInteger(nDamageAmount) - VM_ExecuteCommand(487, 3) - return StackPopEffect() -end - --- Get the trap nearest to oTarget. --- Note : "trap objects" are actually any trigger, placeable or door that is --- trapped in oTarget's area. --- - oTarget --- - nTrapDetected: if this is TRUE, the trap returned has to have been detected --- by oTarget. -function GetNearestTrapToObject(oTarget, bTrapDetected) - oTarget = oTarget or OBJECT_SELF - if bTrapDetected == nil then bTrapDetected = true end - - StackPushBoolean(bTrapDetected) - StackPushObject(oTarget) - VM_ExecuteCommand(488, 2) - return StackPopObject() -end - --- Get the name of oCreature's deity. --- * Returns "" if oCreature is invalid (or if the deity name is blank for --- oCreature). -function GetDeity(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(489, 1) - return StackPopString() -end - --- Get the name of oCreature's sub race. --- * Returns "" if oCreature is invalid (or if sub race is blank for oCreature). -function GetSubRace(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(490, 1) - return StackPopString() -end - --- Get oTarget's base fortitude saving throw value (this will only work for --- creatures, doors, and placeables). --- * Returns 0 if oTarget is invalid. -function GetFortitudeSavingThrow(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(491, 1) - return StackPopInteger() -end - --- Get oTarget's base will saving throw value (this will only work for creatures, --- doors, and placeables). --- * Returns 0 if oTarget is invalid. -function GetWillSavingThrow(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(492, 1) - return StackPopInteger() -end - --- Get oTarget's base reflex saving throw value (this will only work for --- creatures, doors, and placeables). --- * Returns 0 if oTarget is invalid. -function GetReflexSavingThrow(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(493, 1) - return StackPopInteger() -end - --- Get oCreature's challenge rating. --- * Returns 0.0 if oCreature is invalid. -function GetChallengeRating(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(494, 1) - return StackPopFloat() -end - --- Get oCreature's age. --- * Returns 0 if oCreature is invalid. -function GetAge(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(495, 1) - return StackPopInteger() -end - --- Get oCreature's movement rate. --- * Returns 0 if oCreature is invalid. -function GetMovementRate(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(496, 1) - return StackPopInteger() -end - --- Get oCreature's familiar creature type (FAMILIAR_CREATURE_TYPE_*). --- * Returns FAMILIAR_CREATURE_TYPE_NONE if oCreature is invalid or does not --- currently have a familiar. -function GetFamiliarCreatureType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(497, 1) - return StackPopInteger() -end - --- Get oCreature's animal companion creature type --- (ANIMAL_COMPANION_CREATURE_TYPE_*). --- * Returns ANIMAL_COMPANION_CREATURE_TYPE_NONE if oCreature is invalid or does --- not currently have an animal companion. -function GetAnimalCompanionCreatureType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(498, 1) - return StackPopInteger() -end - --- Get oCreature's familiar's name. --- * Returns "" if oCreature is invalid, does not currently --- have a familiar or if the familiar's name is blank. -function GetFamiliarName(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(499, 1) - return StackPopString() -end - --- Get oCreature's animal companion's name. --- * Returns "" if oCreature is invalid, does not currently --- have an animal companion or if the animal companion's name is blank. -function GetAnimalCompanionName(oTarget) - StackPushObject(oTarget) - VM_ExecuteCommand(500, 1) - return StackPopString() -end - --- The action subject will fake casting a spell at oTarget the conjure and cast --- animations and visuals will occur, nothing else. --- - nSpell --- - oTarget --- - nProjectilePathType: PROJECTILE_PATH_TYPE_* -function ActionCastFakeSpellAtObject(nSpell, oTarget, nProjectilePathType) - nProjectilePathType = nProjectilePathType or 0 --PROJECTILE_PATH_TYPE_DEFAULT - - StackPushInteger(nProjectilePathType) - StackPushObject(oTarget) - StackPushInteger(nSpell) - VM_ExecuteCommand(501, 3) -end - --- The action subject will fake casting a spell at lLocation the conjure and --- cast animations and visuals will occur, nothing else. --- - nSpell --- - lTarget --- - nProjectilePathType: PROJECTILE_PATH_TYPE_* -function ActionCastFakeSpellAtLocation(nSpell, lTarget, nProjectilePathType) - nProjectilePathType = nProjectilePathType or 0 --PROJECTILE_PATH_TYPE_DEFAULT - - StackPushInteger(nProjectilePathType) - StackPushLocation(lTarget) - StackPushInteger(nSpell) - VM_ExecuteCommand(502, 3) -end - --- Removes oAssociate from the service of oMaster, returning them to their --- original faction. -function RemoveSummonedAssociate(oMaster, oAssociate) - oAssociate = oAssociate or OBJECT_SELF - - StackPushObject(oAssociate) - StackPushObject(oMaster) - VM_ExecuteCommand(503, 2) -end - --- Set the camera mode for oPlayer. --- - oPlayer --- - nCameraMode: CAMERA_MODE_* --- * If oPlayer is not player-controlled or nCameraMode is invalid, nothing --- happens. -function SetCameraMode(oPlayer, nCameraMode) - StackPushInteger(nCameraMode) - StackPushObject(oPlayer) - VM_ExecuteCommand(504, 2) -end - --- * Returns TRUE if oCreature is resting. -function GetIsResting(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(505, 1) - return StackPopBoolean() -end - --- Get the last PC that has rested in the module. -function GetLastPCRested() - VM_ExecuteCommand(506, 0) - return StackPopObject() -end - --- Set the weather for oTarget. --- - oTarget: if this is GetModule(), all outdoor areas will be modified by the --- weather constant. If it is an area, oTarget will play the weather only if --- it is an outdoor area. --- - nWeather: WEATHER_* --- -> WEATHER_USER_AREA_SETTINGS will set the area back to random weather. --- -> WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW will make the weather go to --- the appropriate precipitation *without stopping*. -function SetWeather(oTarget, nWeather) - StackPushInteger(nWeather) - StackPushObject(oTarget) - VM_ExecuteCommand(507, 2) -end - --- Determine the type (REST_EVENTTYPE_REST_*) of the last rest event (as --- returned from the OnPCRested module event). -function GetLastRestEventType() - VM_ExecuteCommand(508, 0) - return StackPopInteger() -end - --- Shut down the currently loaded module and start a new one (moving all --- currently-connected players to the starting point. -function StartNewModule(sModuleName) - StackPushString(sModuleName) - VM_ExecuteCommand(509, 1) -end - --- Create a Swarm effect. --- - nLooping: If this is TRUE, for the duration of the effect when one creature --- created by this effect dies, the next one in the list will be created. If --- the last creature in the list dies, we loop back to the beginning and --- sCreatureTemplate1 will be created, and so on... --- - sCreatureTemplate1 --- - sCreatureTemplate2 --- - sCreatureTemplate3 --- - sCreatureTemplate4 -function EffectSwarm(nLooping, sCreatureTemplate1, sCreatureTemplate2, sCreatureTemplate3, sCreatureTemplate4) - sCreatureTemplate2 = sCreatureTemplate2 or "" - sCreatureTemplate3 = sCreatureTemplate3 or "" - sCreatureTemplate4 = sCreatureTemplate4 or "" - - StackPushString(sCreatureTemplate4) - StackPushString(sCreatureTemplate3) - StackPushString(sCreatureTemplate2) - StackPushString(sCreatureTemplate1) - StackPushInteger(nLooping) - VM_ExecuteCommand(510, 5) - return StackPopEffect() -end - --- * Returns TRUE if oItem is a ranged weapon. -function GetWeaponRanged(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(511, 1) - return StackPopInteger() -end - --- Only if we are in a single player game, AutoSave the game. -function DoSinglePlayerAutoSave() - VM_ExecuteCommand(512, 0) -end - --- Get the game difficulty (GAME_DIFFICULTY_*). -function GetGameDifficulty() - VM_ExecuteCommand(513, 0) - return StackPopInteger() -end - --- Set the main light color on the tile at lTileLocation. --- - lTileLocation: the vector part of this is the tile grid (x,y) coordinate of --- the tile. --- - nMainLight1Color: TILE_MAIN_LIGHT_COLOR_* --- - nMainLight2Color: TILE_MAIN_LIGHT_COLOR_* -function SetTileMainLightColor(lTileLocation, nMainLight1Color, nMainLight2Color) - StackPushInteger(nMainLight2Color) - StackPushInteger(nMainLight1Color) - StackPushLocation(lTileLocation) - VM_ExecuteCommand(514, 3) -end - --- Set the source light color on the tile at lTileLocation. --- - lTileLocation: the vector part of this is the tile grid (x,y) coordinate of --- the tile. --- - nSourceLight1Color: TILE_SOURCE_LIGHT_COLOR_* --- - nSourceLight2Color: TILE_SOURCE_LIGHT_COLOR_* -function SetTileSourceLightColor(lTileLocation, nSourceLight1Color, nSourceLight2Color) - StackPushInteger(nSourceLight2Color) - StackPushInteger(nSourceLight1Color) - StackPushLocation(lTileLocation) - VM_ExecuteCommand(515, 3) -end - --- All clients in oArea will recompute the static lighting. --- This can be used to update the lighting after changing any tile lights or if --- placeables with lights have been added/deleted. -function RecomputeStaticLighting(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(516, 1) -end - --- Get the color (TILE_MAIN_LIGHT_COLOR_*) for the main light 1 of the tile at --- lTile. --- - lTile: the vector part of this is the tile grid (x,y) coordinate of the tile. -function GetTileMainLight1Color(lTile) - StackPushLocation(lTile) - VM_ExecuteCommand(517, 1) - return StackPopInteger() -end - --- Get the color (TILE_MAIN_LIGHT_COLOR_*) for the main light 2 of the tile at --- lTile. --- - lTile: the vector part of this is the tile grid (x,y) coordinate of the --- tile. -function GetTileMainLight2Color(lTile) - StackPushLocation(lTile) - VM_ExecuteCommand(518, 1) - return StackPopInteger() -end - --- Get the color (TILE_SOURCE_LIGHT_COLOR_*) for the source light 1 of the tile --- at lTile. --- - lTile: the vector part of this is the tile grid (x,y) coordinate of the --- tile. -function GetTileSourceLight1Color(lTile) - StackPushLocation(lTile) - VM_ExecuteCommand(519, 1) - return StackPopInteger() -end - --- Get the color (TILE_SOURCE_LIGHT_COLOR_*) for the source light 2 of the tile --- at lTile. --- - lTile: the vector part of this is the tile grid (x,y) coordinate of the --- tile. -function GetTileSourceLight2Color(lTile) - StackPushLocation(lTile) - VM_ExecuteCommand(520, 1) - return StackPopInteger() -end - --- Make the corresponding panel button on the player's client start or stop --- flashing. --- - oPlayer --- - nButton: PANEL_BUTTON_* --- - nEnableFlash: if this is TRUE nButton will start flashing. It if is FALSE, --- nButton will stop flashing. -function SetPanelButtonFlash(oPlayer, nButton, bEnableFlash) - StackPushBoolean(bEnableFlash) - StackPushInteger(nButton) - StackPushObject(oPlayer) - VM_ExecuteCommand(521, 3) -end - --- Get the current action (ACTION_*) that oObject is executing. -function GetCurrentAction(oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - VM_ExecuteCommand(522, 1) - return StackPopInteger() -end - --- Set how nStandardFaction feels about oCreature. --- - nStandardFaction: STANDARD_FACTION_* --- - nNewReputation: 0-100 (inclusive) --- - oCreature -function SetStandardFactionReputation(nStandardFaction, nNewReputation, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nNewReputation) - StackPushInteger(nStandardFaction) - VM_ExecuteCommand(523, 3) -end - --- Find out how nStandardFaction feels about oCreature. --- - nStandardFaction: STANDARD_FACTION_* --- - oCreature --- Returns -1 on an error. --- Returns 0-100 based on the standing of oCreature within the faction nStandardFaction. --- 0-10 : Hostile. --- 11-89 : Neutral. --- 90-100 : Friendly. -function GetStandardFactionReputation(nStandardFaction, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nStandardFaction) - VM_ExecuteCommand(524, 2) - return StackPopInteger() -end - --- Display floaty text above the specified creature. --- The text will also appear in the chat buffer of each player that receives the --- floaty text. --- - nStrRefToDisplay: String ref (therefore text is translated) --- - oCreatureToFloatAbove --- - bBroadcastToFaction: If this is TRUE then only creatures in the same faction --- as oCreatureToFloatAbove --- will see the floaty text, and only if they are within range (30 metres). -function FloatingTextStrRefOnCreature(nStrRefToDisplay, oCreatureToFloatAbove, bBroadcastToFaction) - if bBroadcastToFaction == nil then bBroadcastToFaction = true end - - StackPushBoolean(bBroadcastToFaction) - StackPushObject(oCreatureToFloatAbove) - StackPushInteger(nStrRefToDisplay) - VM_ExecuteCommand(525, 3) - -end - --- Display floaty text above the specified creature. --- The text will also appear in the chat buffer of each player that receives the --- floaty text. --- - sStringToDisplay: String --- - oCreatureToFloatAbove --- - bBroadcastToFaction: If this is TRUE then only creatures in the same faction --- as oCreatureToFloatAbove --- will see the floaty text, and only if they are within range (30 metres). -function FloatingTextStringOnCreature(sStringToDisplay, oCreatureToFloatAbove, bBroadcastToFaction) - if bBroadcastToFaction == nil then bBroadcastToFaction = true end - - StackPushBoolean(bBroadcastToFaction) - StackPushObject(oCreatureToFloatAbove) - StackPushString(sStringToDisplay) - VM_ExecuteCommand(526, 3) - -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject is disarmable. -function GetTrapDisarmable(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(527, 1) - return StackPopBoolean() -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject is detectable. -function GetTrapDetectable(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(528, 1) - return StackPopBoolean() -end - --- - oTrapObject: a placeable, door or trigger --- - oCreature --- * Returns TRUE if oCreature has detected oTrapObject -function GetTrapDetectedBy(oTrapObject, oCreature) - StackPushObject(oCreature) - StackPushObject(oTrapObject) - VM_ExecuteCommand(529, 2) - return StackPopBoolean() -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject has been flagged as visible to all creatures. -function GetTrapFlagged(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(530, 1) - return StackPopBoolean() -end - --- Get the trap base type (TRAP_BASE_TYPE_*) of oTrapObject. --- - oTrapObject: a placeable, door or trigger -function GetTrapBaseType(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(531, 1) - return StackPopInteger() -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject is one-shot (i.e. it does not reset itself --- after firing. -function GetTrapOneShot(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(532, 1) - return StackPopBoolean() -end - --- Get the creator of oTrapObject, the creature that set the trap. --- - oTrapObject: a placeable, door or trigger --- * Returns OBJECT_INVALID if oTrapObject was created in the toolset. -function GetTrapCreator(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(533, 1) - return StackPopObject() -end - --- Get the tag of the key that will disarm oTrapObject. --- - oTrapObject: a placeable, door or trigger -function GetTrapKeyTag(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(534, 1) - return StackPopString() -end - --- Get the DC for disarming oTrapObject. --- - oTrapObject: a placeable, door or trigger -function GetTrapDisarmDC(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(535, 1) - return StackPopInteger() -end - --- Get the DC for detecting oTrapObject. --- - oTrapObject: a placeable, door or trigger -function GetTrapDetectDC(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(536, 1) - return StackPopInteger() -end - --- * Returns TRUE if a specific key is required to open the lock on oObject. -function GetLockKeyRequired(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(537, 1) - return StackPopBoolean() -end - --- Get the tag of the key that will open the lock on oObject. -function GetLockKeyTag(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(538, 1) - return StackPopString() -end - --- * Returns TRUE if the lock on oObject is lockable. -function GetLockLockable(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(539, 1) - return StackPopBoolean() -end - --- Get the DC for unlocking oObject. -function GetLockUnlockDC(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(540, 1) - return StackPopInteger() -end - --- Get the DC for locking oObject. -function GetLockLockDC(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(541, 1) - return StackPopInteger() -end - --- Get the last PC that levelled up. -function GetPCLevellingUp() - VM_ExecuteCommand(542, 0) - return StackPopObject() -end - --- - nFeat: FEAT_* --- - oObject --- * Returns TRUE if oObject has effects on it originating from nFeat. -function GetHasFeatEffect(nFeat, oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - StackPushInteger(nFeat) - VM_ExecuteCommand(543, 2) - return StackPopBoolean() -end - --- Set the status of the illumination for oPlaceable. --- - oPlaceable --- - bIlluminate: if this is TRUE, oPlaceable's illumination will be turned on. --- If this is FALSE, oPlaceable's illumination will be turned off. --- Note: You must call RecomputeStaticLighting() after calling this function in --- order for the changes to occur visually for the players. --- SetPlaceableIllumination() buffers the illumination changes, which are then --- sent out to the players once RecomputeStaticLighting() is called. As such, --- it is best to call SetPlaceableIllumination() for all the placeables you wish --- to set the illumination on, and then call RecomputeStaticLighting() once after --- all the placeable illumination has been set. --- * If oPlaceable is not a placeable object, or oPlaceable is a placeable that --- doesn't have a light, nothing will happen. -function SetPlaceableIllumination(oPlaceable, bIlluminate) - oPlaceable = oPlaceable or OBJECT_SELF - if bIlluminate == nil then bIlluminate = true end - - StackPushBoolean(bIlluminate) - StackPushObject(oPlaceable) - VM_ExecuteCommand(544, 2) -end - --- * Returns TRUE if the illumination for oPlaceable is on -function GetPlaceableIllumination(oPlaceable) - oPlaceable = oPlaceable or OBJECT_SELF - - StackPushObject(oPlaceable) - VM_ExecuteCommand(545, 1) - return StackPopBoolean() -end - --- - oPlaceable --- - nPlaceableAction: PLACEABLE_ACTION_* --- * Returns TRUE if nPlacebleAction is valid for oPlaceable. -function GetIsPlaceableObjectActionPossible(oPlaceable, nPlaceableAction) - StackPushInteger(nPlaceableAction) - StackPushObject(oPlaceable) - VM_ExecuteCommand(546, 2) - return StackPopBoolean() -end - --- The caller performs nPlaceableAction on oPlaceable. --- - oPlaceable --- - nPlaceableAction: PLACEABLE_ACTION_* -function DoPlaceableObjectAction(oPlaceable, nPlaceableAction) - StackPushInteger(nPlaceableAction) - StackPushObject(oPlaceable) - VM_ExecuteCommand(547, 2) -end - --- Get the first PC in the player list. --- This resets the position in the player list for GetNextPC(). -function GetFirstPC() - VM_ExecuteCommand(548, 0) - return StackPopObject() -end - --- Get the next PC in the player list. --- This picks up where the last GetFirstPC() or GetNextPC() left off. -function GetNextPC() - VM_ExecuteCommand(549, 0) - return StackPopObject() -end - --- Set whether or not the creature oDetector has detected the trapped object oTrap. --- - oTrap: A trapped trigger, placeable or door object. --- - oDetector: This is the creature that the detected status of the trap is being adjusted for. --- - bDetected: A Boolean that sets whether the trapped object has been detected or not. -function SetTrapDetectedBy(oTrap, oDetector, bDetected) - bDetected = bDetected or TRUE - - StackPushBoolean(bDetected) - StackPushObject(oDetector) - StackPushObject(oTrap) - VM_ExecuteCommand(550, 3) - return StackPopInteger() -end - --- Note: Only placeables, doors and triggers can be trapped. --- * Returns TRUE if oObject is trapped. -function GetIsTrapped(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(551, 1) - return StackPopBoolean() -end - --- Create a Turn Resistance Decrease effect. --- - nHitDice: a positive number representing the number of hit dice for the --- / decrease -function EffectTurnResistanceDecrease(nHitDice) - StackPushInteger(nHitDice) - VM_ExecuteCommand(552, 1) - return StackPopEffect() -end - --- Create a Turn Resistance Increase effect. --- - nHitDice: a positive number representing the number of hit dice for the --- increase -function EffectTurnResistanceIncrease(nHitDice) - StackPushInteger(nHitDice) - VM_ExecuteCommand(553, 1) - return StackPopEffect() -end - --- Spawn in the Death GUI. --- The default (as defined by BioWare) can be spawned in by PopUpGUIPanel, but --- if you want to turn off the "Respawn" or "Wait for Help" buttons, this is the --- function to use. --- - oPC --- - bRespawnButtonEnabled: if this is TRUE, the "Respawn" button will be enabled --- on the Death GUI. --- - bWaitForHelpButtonEnabled: if this is TRUE, the "Wait For Help" button will --- be enabled on the Death GUI (Note: This button will not appear in single player games). --- - nHelpStringReference --- - sHelpString -function PopUpDeathGUIPanel(oPC, bRespawnButtonEnabled, bWaitForHelpButtonEnabled, nHelpStringReference, sHelpString) - if bRespawnButtonEnabled == nil then bRespawnButtonEnabled = true end - if bWaitForHelpButtonEnabled == nil then bWaitForHelpButtonEnabled = true end - nHelpStringReference = nHelpStringReference or 0 - sHelpString = sHelpString or "" - - StackPushString(sHelpString) - StackPushInteger(nHelpStringReference) - StackPushBoolean(bWaitForHelpButtonEnabled) - StackPushBoolean(bRespawnButtonEnabled) - StackPushObject(oPC) - VM_ExecuteCommand(554, 5) -end - --- Disable oTrap. --- - oTrap: a placeable, door or trigger. -function SetTrapDisabled(oTrap) - StackPushObject(oTrap) - VM_ExecuteCommand(555, 1) -end - --- Get the last object that was sent as a GetLastAttacker(), GetLastDamager(), --- GetLastSpellCaster() (for a hostile spell), or GetLastDisturbed() (when a --- creature is pickpocketed). --- Note: Return values may only ever be: --- 1) A Creature --- 2) Plot Characters will never have this value set --- 3) Area of Effect Objects will return the AOE creator if they are registered --- as this value, otherwise they will return INVALID_OBJECT_ID --- 4) Traps will not return the creature that set the trap. --- 5) This value will never be overwritten by another non-creature object. --- 6) This value will never be a dead/destroyed creature -function GetLastHostileActor(oVictim) - oVictim = oVictim or OBJECT_SELF - - StackPushObject(oVictim) - VM_ExecuteCommand(556, 1) - return StackPopObject() -end - --- Force all the characters of the players who are currently in the game to --- be exported to their respective directories i.e. LocalVault/ServerVault/ etc. -function ExportAllCharacters() - VM_ExecuteCommand(557, 0) -end - --- Get the Day Track for oArea. -function MusicBackgroundGetDayTrack(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(558, 1) - return StackPopInteger() -end - --- Get the Night Track for oArea. -function MusicBackgroundGetNightTrack(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(559, 1) - return StackPopInteger() -end - --- Write sLogEntry as a timestamped entry into the log file -function WriteTimestampedLogEntry(sLogEntry) - StackPushString(sLogEntry) - VM_ExecuteCommand(560, 1) -end - --- Get the module's name in the language of the server that's running it. --- * If there is no entry for the language of the server, it will return an --- empty string -function GetModuleName() - VM_ExecuteCommand(561, 0) - return StackPopString() -end - --- Get the player leader of the faction of which oMemberOfFaction is a member. --- * Returns OBJECT_INVALID if oMemberOfFaction is not a valid creature, --- or oMemberOfFaction is a member of a NPC faction. -function GetFactionLeader(oMemberOfFaction) - StackPushObject(oMemberOfFaction) - VM_ExecuteCommand(562, 1) - return StackPopObject() -end - --- Sends szMessage to all the Dungeon Masters currently on the server. -function SendMessageToAllDMs(szMessage) - StackPushString(szMessage) - VM_ExecuteCommand(563, 1) -end - --- End the currently running game, play sEndMovie then return all players to the --- game's main menu. -function EndGame(sEndMovie) - StackPushString(sEndMovie) - VM_ExecuteCommand(564, 1) -end - --- Remove oPlayer from the server. --- You can optionally specify a reason to override the text shown to the player. -function BootPC(oPlayer, sReason) - sReason = sReason or "" - StackPushString(sReason) - StackPushObject(oPlayer) - VM_ExecuteCommand(565, 2) -end - --- Counterspell oCounterSpellTarget. -function ActionCounterSpell(oCounterSpellTarget) - StackPushObject(oCounterSpellTarget) - VM_ExecuteCommand(566, 1) -end - --- Set the ambient day volume for oArea to nVolume. --- - oArea --- - nVolume: 0 - 100 -function AmbientSoundSetDayVolume(oArea, nVolume) - StackPushInteger(nVolume) - StackPushObject(oArea) - VM_ExecuteCommand(567, 2) -end - --- Set the ambient night volume for oArea to nVolume. --- - oArea --- - nVolume: 0 - 100 -function AmbientSoundSetNightVolume(oArea, nVolume) - StackPushInteger(nVolume) - StackPushObject(oArea) - VM_ExecuteCommand(568, 2) -end - --- Get the Battle Track for oArea. -function MusicBackgroundGetBattleTrack(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(569, 1) - return StackPopInteger() -end - --- Determine whether oObject has an inventory. --- * Returns TRUE for creatures and stores, and checks to see if an item or placeable object is a container. --- * Returns FALSE for all other object types. -function GetHasInventory(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(570, 1) - return StackPopBoolean() -end - --- Get the duration (in seconds) of the sound attached to nStrRef --- * Returns 0.0f if no duration is stored or if no sound is attached -function GetStrRefSoundDuration(nStrRef) - StackPushInteger(nStrRef) - VM_ExecuteCommand(571, 1) - return StackPopFloat() -end - --- Add oPC to oPartyLeader's party. This will only work on two PCs. --- - oPC: player to add to a party --- - oPartyLeader: player already in the party -function AddToParty(oPC, oPartyLeader) - StackPushObject(oPartyLeader) - StackPushObject(oPC) - VM_ExecuteCommand(572, 2) -end - --- Remove oPC from their current party. This will only work on a PC. --- - oPC: removes this player from whatever party they're currently in. -function RemoveFromParty(oPC) - StackPushObject(oPC) - VM_ExecuteCommand(573, 1) -end - --- Returns the stealth mode of the specified creature. --- - oCreature --- * Returns a constant STEALTH_MODE_* -function GetStealthMode(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(574, 1) - return StackPopInteger() -end - --- Returns the detection mode of the specified creature. --- - oCreature --- * Returns a constant DETECT_MODE_* -function GetDetectMode(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(575, 1) - return StackPopInteger() -end - --- Returns the defensive casting mode of the specified creature. --- - oCreature --- * Returns a constant DEFENSIVE_CASTING_MODE_* -function GetDefensiveCastingMode(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(576, 1) - return StackPopInteger() -end - --- returns the appearance type of the specified creature. --- * returns a constant APPEARANCE_TYPE_* for valid creatures --- * returns APPEARANCE_TYPE_INVALID for non creatures/invalid creatures -function GetAppearanceType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(577, 1) - return StackPopInteger() -end - --- SpawnScriptDebugger() will cause the script debugger to be executed --- after this command is executed! --- In order to compile the script for debugging go to Tools->Options->Script Editor --- and check the box labeled "Generate Debug Information When Compiling Scripts" --- After you have checked the above box, recompile the script that you want to debug. --- If the script file isn't compiled for debugging, this command will do nothing. --- Remove any SpawnScriptDebugger() calls once you have finished --- debugging the script. -function SpawnScriptDebugger() - VM_ExecuteCommand(578, 0) -end - --- in an onItemAcquired script, returns the size of the stack of the item --- that was just acquired. --- * returns the stack size of the item acquired -function GetModuleItemAcquiredStackSize() - VM_ExecuteCommand(579, 0) - return StackPopInteger() -end - --- Decrement the remaining uses per day for this creature by one. --- - oCreature: creature to modify --- - nFeat: constant FEAT_* -function DecrementRemainingFeatUses(oCreature, nFeat) - StackPushInteger(nFeat) - StackPushObject(oCreature) - VM_ExecuteCommand(580, 2) -end - --- Decrement the remaining uses per day for this creature by one. --- - oCreature: creature to modify --- - nSpell: constant SPELL_* -function DecrementRemainingSpellUses(oCreature, nSpell) - StackPushInteger(nSpell) - StackPushObject(oCreature) - VM_ExecuteCommand(581, 2) -end - --- returns the template used to create this object (if appropriate) --- * returns an empty string when no template found -function GetResRef(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(582, 1) - return StackPopString() -end - --- returns an effect that will petrify the target --- * currently applies EffectParalyze and the stoneskin visual effect. -function EffectPetrify() - VM_ExecuteCommand(583, 0) - return StackPopEffect() -end - --- duplicates the item and returns a new object --- oItem - item to copy --- oTargetInventory - create item in this object's inventory. If this parameter --- is not valid, the item will be created in oItem's location --- bCopyVars - copy the local variables from the old item to the new one --- * returns the new item --- * returns OBJECT_INVALID for non-items. --- * can only copy empty item containers. will return OBJECT_INVALID if oItem contains --- other items. --- * if it is possible to merge this item with any others in the target location, --- then it will do so and return the merged object. -function CopyItem(oItem, oTargetInventory, bCopyVars) - oTargetInventory = oTargetInventory or OBJECT_INVALID - bCopyVars = bCopyVars or false - - StackPushBoolean(bCopyVars) - StackPushObject(oTargetInventory) - StackPushObject(oItem) - VM_ExecuteCommand(584, 3) - return StackPopObject() -end - --- returns an effect that is guaranteed to paralyze a creature. --- this effect is identical to EffectParalyze except that it cannot be resisted. -function EffectCutsceneParalyze() - VM_ExecuteCommand(585, 0) - return StackPopEffect() -end - --- returns TRUE if the item CAN be dropped --- Droppable items will appear on a creature's remains when the creature is killed. -function GetDroppableFlag(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(586, 1) - return StackPopBoolean() -end - --- returns TRUE if the placeable object is usable -function GetUseableFlag(oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - VM_ExecuteCommand(587, 1) - return StackPopBoolean() -end - --- returns TRUE if the item is stolen -function GetStolenFlag(oStolen) - StackPushObject(oStolen) - VM_ExecuteCommand(588, 1) - return StackPopBoolean() -end - --- This stores a float out to the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function SetCampaignFloat(sCampaignName, sVarName, flFloat, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushFloat(flFloat) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(589, 4) -end - --- This stores an int out to the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function SetCampaignInt(sCampaignName, sVarName, nInt, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushInteger(nInt) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(590, 4) -end - --- This stores a vector out to the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function SetCampaignVector(sCampaignName, sVarName, vVector, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushVector(vVector) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(591, 4) -end - --- This stores a location out to the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function SetCampaignLocation(sCampaignName, sVarName, locLocation, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushLocation(locLocation) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(592, 4) -end - --- This stores a string out to the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function SetCampaignString(sCampaignName, sVarName, sString, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sString) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(593, 4) -end - --- This will delete the entire campaign database if it exists. -function DestroyCampaignDatabase(sCampaignName) - StackPushString(sCampaignName) - VM_ExecuteCommand(594, 1) -end - --- This will read a float from the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function GetCampaignFloat(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(595, 3) - return StackPopFloat() -end - --- This will read an int from the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function GetCampaignInt(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(596, 3) - return StackPopInteger() -end - --- This will read a vector from the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function GetCampaignVector(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(597, 3) - return StackPopVector() -end - --- This will read a location from the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function GetCampaignLocation(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(598, 3) - return StackPopLocation() -end - --- This will read a string from the specified campaign database --- The database name IS case sensitive and it must be the same for both set and get functions. --- The var name must be unique across the entire database, regardless of the variable type. --- If you want a variable to pertain to a specific player in the game, provide a player object. -function GetCampaignString(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(599, 3) - return StackPopString() -end - --- Duplicates the object specified by oSource. --- ONLY creatures and items can be specified. --- If an owner is specified and the object is an item, it will be put into their inventory --- If the object is a creature, they will be created at the location. --- If a new tag is specified, it will be assigned to the new object. -function CopyObject(oSource, locLocation, oOwner, sNewTag) - oOwner = oOwner or OBJECT_INVALID - sNewTag = sNewTag or "" - - StackPushString(sNewTag) - StackPushObject(oOwner) - StackPushLocation(locLocation) - StackPushObject(oSource) - VM_ExecuteCommand(600, 4) - return StackPopObject() -end - --- This will remove ANY campaign variable. Regardless of type. --- Note that by normal database standards, deleting does not actually removed the entry from --- the database, but flags it as deleted. Do not expect the database files to shrink in size --- from this command. If you want to 'pack' the database, you will have to do it externally --- from the game. -function DeleteCampaignVariable(sCampaignName, sVarName, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(601, 3) -end - --- Stores an object with the given id. --- NOTE: this command can only be used for storing Creatures and Items. --- Returns 0 if it failled, 1 if it worked. -function StoreCampaignObject(sCampaignName, sVarName, oObject, oPlayer) - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushObject(oObject) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(602, 4) - return StackPopBoolean() -end - --- Use RetrieveCampaign with the given id to restore it. --- If you specify an owner, the object will try to be created in their repository --- If the owner can't handle the item (or if it's a creature) it will be created on the ground. -function RetrieveCampaignObject(sCampaignName, sVarName, locLocation, oOwner, oPlayer) - oOwner = oOwner or OBJECT_INVALID - oPlayer = oPlayer or OBJECT_INVALID - - StackPushObject(oPlayer) - StackPushObject(oOwner) - StackPushLocation(locLocation) - StackPushString(sVarName) - StackPushString(sCampaignName) - VM_ExecuteCommand(603, 5) - return StackPopObject() -end - --- Returns an effect that is guaranteed to dominate a creature --- Like EffectDominated but cannot be resisted -function EffectCutsceneDominated() - VM_ExecuteCommand(604, 0) - return StackPopEffect() -end - --- Returns stack size of an item --- - oItem: item to query -function GetItemStackSize(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(605, 1) - return StackPopInteger() -end - --- Sets stack size of an item. --- - oItem: item to change --- - nSize: new size of stack. Will be restricted to be between 1 and the --- maximum stack size for the item type. If a value less than 1 is passed it --- will set the stack to 1. If a value greater than the max is passed --- then it will set the stack to the maximum size -function SetItemStackSize(oItem, nSize) - StackPushInteger(nSize) - StackPushObject(oItem) - VM_ExecuteCommand(606, 2) -end - --- Returns charges left on an item --- - oItem: item to query -function GetItemCharges(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(607, 1) - return StackPopInteger() -end - --- Sets charges left on an item. --- - oItem: item to change --- - nCharges: number of charges. If value below 0 is passed, # charges will --- be set to 0. If value greater than maximum is passed, # charges will --- be set to maximum. If the # charges drops to 0 the item --- will be destroyed. -function SetItemCharges(oItem, nCharges) - StackPushInteger(nCharges) - StackPushObject(oItem) - VM_ExecuteCommand(608, 2) -end - --- *********************** START OF ITEM PROPERTY FUNCTIONS ********************** --- adds an item property to the specified item --- Only temporary and permanent duration types are allowed. -function AddItemProperty(nDurationType, ipProperty, oItem, fDuration) - fDuration = fDuration or 0.0 - - StackPushFloat(fDuration) - StackPushObject(oItem) - StackPushItemProperty(ipProperty) - StackPushInteger(nDurationType) - VM_ExecuteCommand(609, 4) -end - --- removes an item property from the specified item -function RemoveItemProperty(oItem, ipProperty) - StackPushItemProperty(ipProperty) - StackPushObject(oItem) - VM_ExecuteCommand(610, 2) -end - --- if the item property is valid this will return true -function GetIsItemPropertyValid(ipProperty) - StackPushItemProperty(ipProperty) - VM_ExecuteCommand(611, 1) - return StackPopBoolean() -end - --- Gets the first item property on an item -function GetFirstItemProperty(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(612, 1) - return StackPopItemProperty() -end - --- Will keep retrieving the next and the next item property on an Item, --- will return an invalid item property when the list is empty. -function GetNextItemProperty(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(613, 1) - return StackPopItemProperty() -end - --- will return the item property type (ie. holy avenger) -function GetItemPropertyType(ip) - StackPushItemProperty(ip) - VM_ExecuteCommand(614, 1) - return StackPopInteger() -end - --- will return the duration type of the item property -function GetItemPropertyDurationType(ip) - StackPushItemProperty(ip) - VM_ExecuteCommand(615, 1) - return StackPopInteger() -end - --- Returns Item property ability bonus. You need to specify an --- ability constant(IP_CONST_ABILITY_*) and the bonus. The bonus should --- be a positive integer between 1 and 12. -function ItemPropertyAbilityBonus(nAbility, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nAbility) - VM_ExecuteCommand(616, 2) - return StackPopItemProperty() -end - --- Returns Item property AC bonus. You need to specify the bonus. --- The bonus should be a positive integer between 1 and 20. The modifier --- type depends on the item it is being applied to. -function ItemPropertyACBonus(nBonus) - StackPushInteger(nBonus) - VM_ExecuteCommand(617, 1) - return StackPopItemProperty() -end - --- Returns Item property AC bonus vs. alignment group. An example of --- an alignment group is Chaotic, or Good. You need to specify the --- alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and the AC bonus. --- The AC bonus should be an integer between 1 and 20. The modifier --- type depends on the item it is being applied to. -function ItemPropertyACBonusVsAlign(nAlignGroup, nACBonus) - StackPushInteger(nACBonus) - StackPushInteger(nAlignGroup) - VM_ExecuteCommand(618, 2) - return StackPopItemProperty() -end - --- Returns Item property AC bonus vs. Damage type (ie. piercing). You --- need to specify the damage type constant(IP_CONST_DAMAGETYPE_*) and the --- AC bonus. The AC bonus should be an integer between 1 and 20. The --- modifier type depends on the item it is being applied to. --- NOTE: Only the first 3 damage types may be used here, the 3 basic --- physical types. -function ItemPropertyACBonusVsDmgType(nDamageType, nACBonus) - StackPushInteger(nACBonus) - StackPushInteger(nDamageType) - VM_ExecuteCommand(619, 2) - return StackPopItemProperty() -end - --- Returns Item property AC bonus vs. Racial group. You need to specify --- the racial group constant(IP_CONST_RACIALTYPE_*) and the AC bonus. The AC --- bonus should be an integer between 1 and 20. The modifier type depends --- on the item it is being applied to. -function ItemPropertyACBonusVsRace(nRace, nACBonus) - StackPushInteger(nACBonus) - StackPushInteger(nRace) - VM_ExecuteCommand(620, 2) - return StackPopItemProperty() -end - --- Returns Item property AC bonus vs. Specific alignment. You need to --- specify the specific alignment constant(IP_CONST_ALIGNMENT_*) and the AC --- bonus. The AC bonus should be an integer between 1 and 20. The --- modifier type depends on the item it is being applied to. -function ItemPropertyACBonusVsSAlign(nAlign, nACBonus) - StackPushInteger(nACBonus) - StackPushInteger(nAlign) - VM_ExecuteCommand(621, 2) - return StackPopItemProperty() -end - --- Returns Item property Enhancement bonus. You need to specify the --- enhancement bonus. The Enhancement bonus should be an integer between --- 1 and 20. -function ItemPropertyEnhancementBonus(nEnhancementBonus) - StackPushInteger(nEnhancementBonus) - VM_ExecuteCommand(622, 1) - return StackPopItemProperty() -end - --- Returns Item property Enhancement bonus vs. an Alignment group. You --- need to specify the alignment group constant(IP_CONST_ALIGNMENTGROUP_*) --- and the enhancement bonus. The Enhancement bonus should be an integer --- between 1 and 20. -function ItemPropertyEnhancementBonusVsAlign(nAlignGroup, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nAlignGroup) - VM_ExecuteCommand(623, 2) - return StackPopItemProperty() -end - --- Returns Item property Enhancement bonus vs. Racial group. You need --- to specify the racial group constant(IP_CONST_RACIALTYPE_*) and the --- enhancement bonus. The enhancement bonus should be an integer between --- 1 and 20. -function ItemPropertyEnhancementBonusVsRace(nRace, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nRace) - VM_ExecuteCommand(624, 2) - return StackPopItemProperty() -end - --- Returns Item property Enhancement bonus vs. a specific alignment. You --- need to specify the alignment constant(IP_CONST_ALIGNMENT_*) and the --- enhancement bonus. The enhancement bonus should be an integer between --- 1 and 20. -function ItemPropertyEnhancementBonusVsSAlign(nAlign, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nAlign) - VM_ExecuteCommand(625, 2) - return StackPopItemProperty() -end - --- Returns Item property Enhancment penalty. You need to specify the --- enhancement penalty. The enhancement penalty should be a POSITIVE --- integer between 1 and 5 (ie. 1 = -1). -function ItemPropertyEnhancementPenalty(nPenalty) - StackPushInteger(nPenalty) - VM_ExecuteCommand(626, 1) - return StackPopItemProperty() -end - --- Returns Item property weight reduction. You need to specify the weight --- reduction constant(IP_CONST_REDUCEDWEIGHT_*). -function ItemPropertyWeightReduction(nReduction) - StackPushInteger(nReduction) - VM_ExecuteCommand(627, 1) - return StackPopItemProperty() -end - --- Returns Item property Bonus Feat. You need to specify the the feat --- constant(IP_CONST_FEAT_*). -function ItemPropertyBonusFeat(nFeat) - StackPushInteger(nFeat) - VM_ExecuteCommand(628, 1) - return StackPopItemProperty() -end - --- Returns Item property Bonus level spell (Bonus spell of level). You must --- specify the class constant(IP_CONST_CLASS_*) of the bonus spell(MUST BE a --- spell casting class) and the level of the bonus spell. The level of the --- bonus spell should be an integer between 0 and 9. -function ItemPropertyBonusLevelSpell(nClass, nSpellLevel) - StackPushInteger(nSpellLevel) - StackPushInteger(nClass) - VM_ExecuteCommand(629, 2) - return StackPopItemProperty() -end - --- Returns Item property Cast spell. You must specify the spell constant --- (IP_CONST_CASTSPELL_*) and the number of uses constant(IP_CONST_CASTSPELL_NUMUSES_*). --- NOTE: The number after the name of the spell in the constant is the level --- at which the spell will be cast. Sometimes there are multiple copies --- of the same spell but they each are cast at a different level. The higher --- the level, the more cost will be added to the item. --- NOTE: The list of spells that can be applied to an item will depend on the --- item type. For instance there are spells that can be applied to a wand --- that cannot be applied to a potion. Below is a list of the types and the --- spells that are allowed to be placed on them. If you try to put a cast --- spell effect on an item that is not allowed to have that effect it will --- not work. --- NOTE: Even if spells have multiple versions of different levels they are only --- listed below once. --- --- WANDS: --- Acid_Splash --- Activate_Item --- Aid --- Amplify --- Animate_Dead --- AuraOfGlory --- BalagarnsIronHorn --- Bane --- Banishment --- Barkskin --- Bestow_Curse --- Bigbys_Clenched_Fist --- Bigbys_Crushing_Hand --- Bigbys_Forceful_Hand --- Bigbys_Grasping_Hand --- Bigbys_Interposing_Hand --- Bless --- Bless_Weapon --- Blindness/Deafness --- Blood_Frenzy --- Bombardment --- Bulls_Strength --- Burning_Hands --- Call_Lightning --- Camoflage --- Cats_Grace --- Charm_Monster --- Charm_Person --- Charm_Person_or_Animal --- Clairaudience/Clairvoyance --- Clarity --- Color_Spray --- Confusion --- Continual_Flame --- Cure_Critical_Wounds --- Cure_Light_Wounds --- Cure_Minor_Wounds --- Cure_Moderate_Wounds --- Cure_Serious_Wounds --- Darkness --- Darkvision --- Daze --- Death_Ward --- Dirge --- Dismissal --- Dispel_Magic --- Displacement --- Divine_Favor --- Divine_Might --- Divine_Power --- Divine_Shield --- Dominate_Animal --- Dominate_Person --- Doom --- Dragon_Breath_Acid --- Dragon_Breath_Cold --- Dragon_Breath_Fear --- Dragon_Breath_Fire --- Dragon_Breath_Gas --- Dragon_Breath_Lightning --- Dragon_Breath_Paralyze --- Dragon_Breath_Sleep --- Dragon_Breath_Slow --- Dragon_Breath_Weaken --- Drown --- Eagle_Spledor --- Earthquake --- Electric_Jolt --- Elemental_Shield --- Endurance --- Endure_Elements --- Enervation --- Entangle --- Entropic_Shield --- Etherealness --- Expeditious_Retreat --- Fear --- Find_Traps --- Fireball --- Firebrand --- Flame_Arrow --- Flame_Lash --- Flame_Strike --- Flare --- Foxs_Cunning --- Freedom_of_Movement --- Ghostly_Visage --- Ghoul_Touch --- Grease --- Greater_Magic_Fang --- Greater_Magic_Weapon --- Grenade_Acid --- Grenade_Caltrops --- Grenade_Chicken --- Grenade_Choking --- Grenade_Fire --- Grenade_Holy --- Grenade_Tangle --- Grenade_Thunderstone --- Gust_of_wind --- Hammer_of_the_Gods --- Haste --- Hold_Animal --- Hold_Monster --- Hold_Person --- Ice_Storm --- Identify --- Improved_Invisibility --- Inferno --- Inflict_Critical_Wounds --- Inflict_Light_Wounds --- Inflict_Minor_Wounds --- Inflict_Moderate_Wounds --- Inflict_Serious_Wounds --- Invisibility --- Invisibility_Purge --- Invisibility_Sphere --- Isaacs_Greater_Missile_Storm --- Isaacs_Lesser_Missile_Storm --- Knock --- Lesser_Dispel --- Lesser_Restoration --- Lesser_Spell_Breach --- Light --- Lightning_Bolt --- Mage_Armor --- Magic_Circle_against_Alignment --- Magic_Fang --- Magic_Missile --- Manipulate_Portal_Stone --- Mass_Camoflage --- Melfs_Acid_Arrow --- Meteor_Swarm --- Mind_Blank --- Mind_Fog --- Negative_Energy_Burst --- Negative_Energy_Protection --- Negative_Energy_Ray --- Neutralize_Poison --- One_With_The_Land --- Owls_Insight --- Owls_Wisdom --- Phantasmal_Killer --- Planar_Ally --- Poison --- Polymorph_Self --- Prayer --- Protection_from_Alignment --- Protection_From_Elements --- Quillfire --- Ray_of_Enfeeblement --- Ray_of_Frost --- Remove_Blindness/Deafness --- Remove_Curse --- Remove_Disease --- Remove_Fear --- Remove_Paralysis --- Resist_Elements --- Resistance --- Restoration --- Sanctuary --- Scare --- Searing_Light --- See_Invisibility --- Shadow_Conjuration --- Shield --- Shield_of_Faith --- Silence --- Sleep --- Slow --- Sound_Burst --- Spike_Growth --- Stinking_Cloud --- Stoneskin --- Summon_Creature_I --- Summon_Creature_I --- Summon_Creature_II --- Summon_Creature_III --- Summon_Creature_IV --- Sunburst --- Tashas_Hideous_Laughter --- True_Strike --- Undeaths_Eternal_Foe --- Unique_Power --- Unique_Power_Self_Only --- Vampiric_Touch --- Virtue --- Wall_of_Fire --- Web --- Wounding_Whispers --- --- POTIONS: --- Activate_Item --- Aid --- Amplify --- AuraOfGlory --- Bane --- Barkskin --- Barkskin --- Barkskin --- Bless --- Bless_Weapon --- Bless_Weapon --- Blood_Frenzy --- Bulls_Strength --- Bulls_Strength --- Bulls_Strength --- Camoflage --- Cats_Grace --- Cats_Grace --- Cats_Grace --- Clairaudience/Clairvoyance --- Clairaudience/Clairvoyance --- Clairaudience/Clairvoyance --- Clarity --- Continual_Flame --- Cure_Critical_Wounds --- Cure_Critical_Wounds --- Cure_Critical_Wounds --- Cure_Light_Wounds --- Cure_Light_Wounds --- Cure_Minor_Wounds --- Cure_Moderate_Wounds --- Cure_Moderate_Wounds --- Cure_Moderate_Wounds --- Cure_Serious_Wounds --- Cure_Serious_Wounds --- Cure_Serious_Wounds --- Darkness --- Darkvision --- Darkvision --- Death_Ward --- Dispel_Magic --- Dispel_Magic --- Displacement --- Divine_Favor --- Divine_Might --- Divine_Power --- Divine_Shield --- Dragon_Breath_Acid --- Dragon_Breath_Cold --- Dragon_Breath_Fear --- Dragon_Breath_Fire --- Dragon_Breath_Gas --- Dragon_Breath_Lightning --- Dragon_Breath_Paralyze --- Dragon_Breath_Sleep --- Dragon_Breath_Slow --- Dragon_Breath_Weaken --- Eagle_Spledor --- Eagle_Spledor --- Eagle_Spledor --- Elemental_Shield --- Elemental_Shield --- Endurance --- Endurance --- Endurance --- Endure_Elements --- Entropic_Shield --- Ethereal_Visage --- Ethereal_Visage --- Etherealness --- Expeditious_Retreat --- Find_Traps --- Foxs_Cunning --- Foxs_Cunning --- Foxs_Cunning --- Freedom_of_Movement --- Ghostly_Visage --- Ghostly_Visage --- Ghostly_Visage --- Globe_of_Invulnerability --- Greater_Bulls_Strength --- Greater_Cats_Grace --- Greater_Dispelling --- Greater_Dispelling --- Greater_Eagles_Splendor --- Greater_Endurance --- Greater_Foxs_Cunning --- Greater_Magic_Weapon --- Greater_Owls_Wisdom --- Greater_Restoration --- Greater_Spell_Mantle --- Greater_Stoneskin --- Grenade_Acid --- Grenade_Caltrops --- Grenade_Chicken --- Grenade_Choking --- Grenade_Fire --- Grenade_Holy --- Grenade_Tangle --- Grenade_Thunderstone --- Haste --- Haste --- Heal --- Hold_Animal --- Hold_Monster --- Hold_Person --- Identify --- Invisibility --- Lesser_Dispel --- Lesser_Dispel --- Lesser_Mind_Blank --- Lesser_Restoration --- Lesser_Spell_Mantle --- Light --- Light --- Mage_Armor --- Manipulate_Portal_Stone --- Mass_Camoflage --- Mind_Blank --- Minor_Globe_of_Invulnerability --- Minor_Globe_of_Invulnerability --- Mordenkainens_Disjunction --- Negative_Energy_Protection --- Negative_Energy_Protection --- Negative_Energy_Protection --- Neutralize_Poison --- One_With_The_Land --- Owls_Insight --- Owls_Wisdom --- Owls_Wisdom --- Owls_Wisdom --- Polymorph_Self --- Prayer --- Premonition --- Protection_From_Elements --- Protection_From_Elements --- Protection_from_Spells --- Protection_from_Spells --- Raise_Dead --- Remove_Blindness/Deafness --- Remove_Curse --- Remove_Disease --- Remove_Fear --- Remove_Paralysis --- Resist_Elements --- Resist_Elements --- Resistance --- Resistance --- Restoration --- Resurrection --- Rogues_Cunning --- See_Invisibility --- Shadow_Shield --- Shapechange --- Shield --- Shield_of_Faith --- Special_Alcohol_Beer --- Special_Alcohol_Spirits --- Special_Alcohol_Wine --- Special_Herb_Belladonna --- Special_Herb_Garlic --- Spell_Mantle --- Spell_Resistance --- Spell_Resistance --- Stoneskin --- Tensers_Transformation --- True_Seeing --- True_Strike --- Unique_Power --- Unique_Power_Self_Only --- Virtue --- --- GENERAL USE (ie. everything else): --- Just about every spell is useable by all the general use items so instead we --- will only list the ones that are not allowed: --- Special_Alcohol_Beer --- Special_Alcohol_Spirits --- Special_Alcohol_Wine --- -function ItemPropertyCastSpell(nSpell, nNumUses) - StackPushInteger(nNumUses) - StackPushInteger(nSpell) - VM_ExecuteCommand(630, 2) - return StackPopItemProperty() -end - --- Returns Item property damage bonus. You must specify the damage type constant --- (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*). --- NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning, --- Cold, Electrical, Fire, Piercing, Slashing, Sonic. -function ItemPropertyDamageBonus(nDamageType, nDamage) - StackPushInteger(nDamage) - StackPushInteger(nDamageType) - VM_ExecuteCommand(631, 2) - return StackPopItemProperty() -end - --- Returns Item property damage bonus vs. Alignment groups. You must specify the --- alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and the damage type constant --- (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*). --- NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning, --- Cold, Electrical, Fire, Piercing, Slashing, Sonic. -function ItemPropertyDamageBonusVsAlign(nAlignGroup, nDamageType, nDamage) - StackPushInteger(nDamage) - StackPushInteger(nDamageType) - StackPushInteger(nAlignGroup) - VM_ExecuteCommand(632, 3) - return StackPopItemProperty() -end - --- Returns Item property damage bonus vs. specific race. You must specify the --- racial group constant(IP_CONST_RACIALTYPE_*) and the damage type constant --- (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*). --- NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning, --- Cold, Electrical, Fire, Piercing, Slashing, Sonic. -function ItemPropertyDamageBonusVsRace(nRace, nDamageType, nDamage) - StackPushInteger(nDamage) - StackPushInteger(nDamageType) - StackPushInteger(nRace) - VM_ExecuteCommand(633, 3) - return StackPopItemProperty() -end - --- Returns Item property damage bonus vs. specific alignment. You must specify the --- specific alignment constant(IP_CONST_ALIGNMENT_*) and the damage type constant --- (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*). --- NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning, --- Cold, Electrical, Fire, Piercing, Slashing, Sonic. -function ItemPropertyDamageBonusVsSAlign(nAlign, nDamageType, nDamage) - StackPushInteger(nDamage) - StackPushInteger(nDamageType) - StackPushInteger(nAlign) - VM_ExecuteCommand(634, 3) - return StackPopItemProperty() -end - --- Returns Item property damage immunity. You must specify the damage type constant --- (IP_CONST_DAMAGETYPE_*) that you want to be immune to and the immune bonus percentage --- constant(IP_CONST_DAMAGEIMMUNITY_*). --- NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning, --- Cold, Electrical, Fire, Piercing, Slashing, Sonic. -function ItemPropertyDamageImmunity(nImmuneBonus, nDamageType) - StackPushInteger(nImmuneBonus) - StackPushInteger(nDamageType) - VM_ExecuteCommand(635, 2) - return StackPopItemProperty() -end - --- Returns Item property damage penalty. You must specify the damage penalty. --- The damage penalty should be a POSITIVE integer between 1 and 5 (ie. 1 = -1). -function ItemPropertyDamagePenalty(nPenalty) - StackPushInteger(nPenalty) - VM_ExecuteCommand(636, 1) - return StackPopItemProperty() -end - --- Returns Item property damage reduction. You must specify the enhancment level --- (IP_CONST_DAMAGEREDUCTION_*) that is required to get past the damage reduction --- and the amount of HP of damage constant(IP_CONST_DAMAGESOAK_*) will be soaked --- up if your weapon is not of high enough enhancement. -function ItemPropertyDamageReduction(nEnhancement, nHPSoak) - StackPushInteger(nHPSoak) - StackPushInteger(nEnhancement) - VM_ExecuteCommand(637, 2) - return StackPopItemProperty() -end - --- Returns Item property damage resistance. You must specify the damage type --- constant(IP_CONST_DAMAGETYPE_*) and the amount of HP of damage constant --- (IP_CONST_DAMAGERESIST_*) that will be resisted against each round. -function ItemPropertyDamageResistance(nDamageType, nHPResist) - StackPushInteger(nHPResist) - StackPushInteger(nDamageType) - VM_ExecuteCommand(638, 2) - return StackPopItemProperty() -end - --- Returns Item property damage vulnerability. You must specify the damage type --- constant(IP_CONST_DAMAGETYPE_*) that you want the user to be extra vulnerable to --- and the percentage vulnerability constant(IP_CONST_DAMAGEVULNERABILITY_*). -function ItemPropertyDamageVulnerability(nDamageType, nVulnerability) - StackPushInteger(nVulnerability) - StackPushInteger(nDamageType) - VM_ExecuteCommand(639, 2) - return StackPopItemProperty() -end - --- Return Item property Darkvision. -function ItemPropertyDarkvision() - VM_ExecuteCommand(640, 0) - return StackPopItemProperty() -end - --- Return Item property decrease ability score. You must specify the ability --- constant(IP_CONST_ABILITY_*) and the modifier constant. The modifier must be --- a POSITIVE integer between 1 and 10 (ie. 1 = -1). -function ItemPropertyDecreaseAbility(nAbility, nModifier) - StackPushInteger(nModifier) - StackPushInteger(nAbility) - VM_ExecuteCommand(641, 2) - return StackPopItemProperty() -end - --- Returns Item property decrease Armor Class. You must specify the armor --- modifier type constant(IP_CONST_ACMODIFIERTYPE_*) and the armor class penalty. --- The penalty must be a POSITIVE integer between 1 and 5 (ie. 1 = -1). -function ItemPropertyDecreaseAC(nModifierType, nPenalty) - StackPushInteger(nPenalty) - StackPushInteger(nModifierType) - VM_ExecuteCommand(642, 2) - return StackPopItemProperty() -end - --- Returns Item property decrease skill. You must specify the constant for the --- skill to be decreased(SKILL_*) and the amount of the penalty. The penalty --- must be a POSITIVE integer between 1 and 10 (ie. 1 = -1). -function ItemPropertyDecreaseSkill(nSkill, nPenalty) - StackPushInteger(nPenalty) - StackPushInteger(nSkill) - VM_ExecuteCommand(643, 2) - return StackPopItemProperty() -end - --- Returns Item property container reduced weight. This is used for special --- containers that reduce the weight of the objects inside them. You must --- specify the container weight reduction type constant(IP_CONST_CONTAINERWEIGHTRED_*). -function ItemPropertyContainerReducedWeight(nContainerType) - StackPushInteger(nContainerType) - VM_ExecuteCommand(644, 1) - return StackPopItemProperty() -end - --- Returns Item property extra melee damage type. You must specify the extra --- melee base damage type that you want applied. It is a constant(IP_CONST_DAMAGETYPE_*). --- NOTE: only the first 3 base types (piercing, slashing, & bludgeoning are applicable --- here. --- NOTE: It is also only applicable to melee weapons. -function ItemPropertyExtraMeleeDamageType(nDamageType) - StackPushInteger(nDamageType) - VM_ExecuteCommand(645, 1) - return StackPopItemProperty() -end - --- Returns Item property extra ranged damage type. You must specify the extra --- melee base damage type that you want applied. It is a constant(IP_CONST_DAMAGETYPE_*). --- NOTE: only the first 3 base types (piercing, slashing, & bludgeoning are applicable --- here. --- NOTE: It is also only applicable to ranged weapons. -function ItemPropertyExtraRangeDamageType(nDamageType) - StackPushInteger(nDamageType) - VM_ExecuteCommand(646, 1) - return StackPopItemProperty() -end - --- Returns Item property haste. -function ItemPropertyHaste() - VM_ExecuteCommand(647, 0) - return StackPopItemProperty() -end - --- Returns Item property Holy Avenger. -function ItemPropertyHolyAvenger() - VM_ExecuteCommand(648, 0) - return StackPopItemProperty() -end - --- Returns Item property immunity to miscellaneous effects. You must specify the --- effect to which the user is immune, it is a constant(IP_CONST_IMMUNITYMISC_*). -function ItemPropertyImmunityMisc(nImmunityType) - StackPushInteger(nImmunityType) - VM_ExecuteCommand(649, 1) - return StackPopItemProperty() -end - --- Returns Item property improved evasion. -function ItemPropertyImprovedEvasion() - VM_ExecuteCommand(650, 0) - return StackPopItemProperty() -end - --- Returns Item property bonus spell resistance. You must specify the bonus spell --- resistance constant(IP_CONST_SPELLRESISTANCEBONUS_*). -function ItemPropertyBonusSpellResistance(nBonus) - StackPushInteger(nBonus) - VM_ExecuteCommand(651, 1) - return StackPopItemProperty() -end - --- Returns Item property saving throw bonus vs. a specific effect or damage type. --- You must specify the save type constant(IP_CONST_SAVEVS_*) that the bonus is --- applied to and the bonus that is be applied. The bonus must be an integer --- between 1 and 20. -function ItemPropertyBonusSavingThrowVsX(nBonusType, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nBonusType) - VM_ExecuteCommand(652, 2) - return StackPopItemProperty() -end - --- Returns Item property saving throw bonus to the base type (ie. will, reflex, --- fortitude). You must specify the base type constant(IP_CONST_SAVEBASETYPE_*) --- to which the user gets the bonus and the bonus that he/she will get. The --- bonus must be an integer between 1 and 20. -function ItemPropertyBonusSavingThrow(nBaseSaveType, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nBaseSaveType) - VM_ExecuteCommand(653, 2) - return StackPopItemProperty() -end - --- Returns Item property keen. This means a critical threat range of 19-20 on a --- weapon will be increased to 17-20 etc. -function ItemPropertyKeen() - VM_ExecuteCommand(654, 0) - return StackPopItemProperty() -end - --- Returns Item property light. You must specify the intesity constant of the --- light(IP_CONST_LIGHTBRIGHTNESS_*) and the color constant of the light --- (IP_CONST_LIGHTCOLOR_*). -function ItemPropertyLight(nBrightness, nColor) - StackPushInteger(nColor) - StackPushInteger(nBrightness) - VM_ExecuteCommand(655, 2) - return StackPopItemProperty() -end - --- Returns Item property Max range strength modification (ie. mighty). You must --- specify the maximum modifier for strength that is allowed on a ranged weapon. --- The modifier must be a positive integer between 1 and 20. -function ItemPropertyMaxRangeStrengthMod(nModifier) - StackPushInteger(nModifier) - VM_ExecuteCommand(656, 1) - return StackPopItemProperty() -end - --- Returns Item property no damage. This means the weapon will do no damage in --- combat. -function ItemPropertyNoDamage() - VM_ExecuteCommand(657, 0) - return StackPopItemProperty() -end - --- Returns Item property on hit -> do effect property. You must specify the on --- hit property constant(IP_CONST_ONHIT_*) and the save DC constant(IP_CONST_ONHIT_SAVEDC_*). --- Some of the item properties require a special parameter as well. If the --- property does not require one you may leave out the last one. The list of --- the ones with 3 parameters and what they are are as follows: --- ABILITYDRAIN :nSpecial is the ability it is to drain. --- constant(IP_CONST_ABILITY_*) --- BLINDNESS :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- CONFUSION :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- DAZE :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- DEAFNESS :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- DISEASE :nSpecial is the type of desease that will effect the victim. --- constant(DISEASE_*) --- DOOM :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- FEAR :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- HOLD :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- ITEMPOISON :nSpecial is the type of poison that will effect the victim. --- constant(IP_CONST_POISON_*) --- SILENCE :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- SLAYRACE :nSpecial is the race that will be slain. --- constant(IP_CONST_RACIALTYPE_*) --- SLAYALIGNMENTGROUP:nSpecial is the alignment group that will be slain(ie. chaotic). --- constant(IP_CONST_ALIGNMENTGROUP_*) --- SLAYALIGNMENT :nSpecial is the specific alignment that will be slain. --- constant(IP_CONST_ALIGNMENT_*) --- SLEEP :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- SLOW :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) --- STUN :nSpecial is the duration/percentage of effecting victim. --- constant(IP_CONST_ONHIT_DURATION_*) -function ItemPropertyOnHitProps(nProperty, nSaveDC, nSpecial) - nSpecial = nSpecial or 0 - - StackPushInteger(nSpecial) - StackPushInteger(nSaveDC) - StackPushInteger(nProperty) - VM_ExecuteCommand(658, 3) - return StackPopItemProperty() -end - --- Returns Item property reduced saving throw vs. an effect or damage type. You must --- specify the constant to which the penalty applies(IP_CONST_SAVEVS_*) and the --- penalty to be applied. The penalty must be a POSITIVE integer between 1 and 20 --- (ie. 1 = -1). -function ItemPropertyReducedSavingThrowVsX(nBaseSaveType, nPenalty) - StackPushInteger(nPenalty) - StackPushInteger(nBaseSaveType) - VM_ExecuteCommand(659, 2) - return StackPopItemProperty() -end - --- Returns Item property reduced saving to base type. You must specify the base --- type to which the penalty applies (ie. will, reflex, or fortitude) and the penalty --- to be applied. The constant for the base type starts with (IP_CONST_SAVEBASETYPE_*). --- The penalty must be a POSITIVE integer between 1 and 20 (ie. 1 = -1). -function ItemPropertyReducedSavingThrow(nBonusType, nPenalty) - StackPushInteger(nPenalty) - StackPushInteger(nBonusType) - VM_ExecuteCommand(660, 2) - return StackPopItemProperty() -end - --- Returns Item property regeneration. You must specify the regeneration amount. --- The amount must be an integer between 1 and 20. -function ItemPropertyRegeneration(nRegenAmount) - StackPushInteger(nRegenAmount) - VM_ExecuteCommand(661, 1) - return StackPopItemProperty() -end - --- Returns Item property skill bonus. You must specify the skill to which the user --- will get a bonus(SKILL_*) and the amount of the bonus. The bonus amount must --- be an integer between 1 and 50. -function ItemPropertySkillBonus(nSkill, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nSkill) - VM_ExecuteCommand(662, 2) - return StackPopItemProperty() -end - --- Returns Item property spell immunity vs. specific spell. You must specify the --- spell to which the user will be immune(IP_CONST_IMMUNITYSPELL_*). -function ItemPropertySpellImmunitySpecific(nSpell) - StackPushInteger(nSpell) - VM_ExecuteCommand(663, 1) - return StackPopItemProperty() -end - --- Returns Item property spell immunity vs. spell school. You must specify the --- school to which the user will be immune(IP_CONST_SPELLSCHOOL_*). -function ItemPropertySpellImmunitySchool(nSchool) - StackPushInteger(nSchool) - VM_ExecuteCommand(664, 1) - return StackPopItemProperty() -end - --- Returns Item property Thieves tools. You must specify the modifier you wish --- the tools to have. The modifier must be an integer between 1 and 12. -function ItemPropertyThievesTools(nModifier) - StackPushInteger(nModifier) - VM_ExecuteCommand(665, 1) - return StackPopItemProperty() -end - --- Returns Item property Attack bonus. You must specify an attack bonus. The bonus --- must be an integer between 1 and 20. -function ItemPropertyAttackBonus(nBonus) - StackPushInteger(nBonus) - VM_ExecuteCommand(666, 1) - return StackPopItemProperty() -end - --- Returns Item property Attack bonus vs. alignment group. You must specify the --- alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and the attack bonus. The --- bonus must be an integer between 1 and 20. -function ItemPropertyAttackBonusVsAlign(nAlignGroup, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nAlignGroup) - VM_ExecuteCommand(667, 2) - return StackPopItemProperty() -end - --- Returns Item property attack bonus vs. racial group. You must specify the --- racial group constant(IP_CONST_RACIALTYPE_*) and the attack bonus. The bonus --- must be an integer between 1 and 20. -function ItemPropertyAttackBonusVsRace(nRace, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nRace) - VM_ExecuteCommand(668, 2) - return StackPopItemProperty() -end - --- Returns Item property attack bonus vs. a specific alignment. You must specify --- the alignment you want the bonus to work against(IP_CONST_ALIGNMENT_*) and the --- attack bonus. The bonus must be an integer between 1 and 20. -function ItemPropertyAttackBonusVsSAlign(nAlignment, nBonus) - StackPushInteger(nBonus) - StackPushInteger(nAlignment) - VM_ExecuteCommand(669, 2) - return StackPopItemProperty() -end - --- Returns Item property attack penalty. You must specify the attack penalty. --- The penalty must be a POSITIVE integer between 1 and 5 (ie. 1 = -1). -function ItemPropertyAttackPenalty(nPenalty) - StackPushInteger(nPenalty) - VM_ExecuteCommand(670, 1) - return StackPopItemProperty() -end - --- Returns Item property unlimited ammo. If you leave the parameter field blank --- it will be just a normal bolt, arrow, or bullet. However you may specify that --- you want the ammunition to do special damage (ie. +1d6 Fire, or +1 enhancement --- bonus). For this parmeter you use the constants beginning with: --- (IP_CONST_UNLIMITEDAMMO_*). -function ItemPropertyUnlimitedAmmo(nAmmoDamage) - nAmmoDamage = nAmmoDamage or 1 --IP_CONST_UNLIMITEDAMMO_BASIC - - StackPushInteger(nAmmoDamage) - VM_ExecuteCommand(671, 1) - return StackPopItemProperty() -end - --- Returns Item property limit use by alignment group. You must specify the --- alignment group(s) that you want to be able to use this item(IP_CONST_ALIGNMENTGROUP_*). -function ItemPropertyLimitUseByAlign(nAlignGroup) - StackPushInteger(nAlignGroup) - VM_ExecuteCommand(672, 1) - return StackPopItemProperty() -end - --- Returns Item property limit use by class. You must specify the class(es) who --- are able to use this item(IP_CONST_CLASS_*). -function ItemPropertyLimitUseByClass(nClass) - StackPushInteger(nClass) - VM_ExecuteCommand(673, 1) - return StackPopItemProperty() -end - --- Returns Item property limit use by race. You must specify the race(s) who are --- allowed to use this item(IP_CONST_RACIALTYPE_*). -function ItemPropertyLimitUseByRace(nRace) - StackPushInteger(nRace) - VM_ExecuteCommand(674, 1) - return StackPopItemProperty() -end - --- Returns Item property limit use by specific alignment. You must specify the --- alignment(s) of those allowed to use the item(IP_CONST_ALIGNMENT_*). -function ItemPropertyLimitUseBySAlign(nAlignment) - StackPushInteger(nAlignment) - VM_ExecuteCommand(675, 1) - return StackPopItemProperty() -end - --- replace this function it does nothing. -function BadBadReplaceMeThisDoesNothing() - VM_ExecuteCommand(676, 0) - return StackPopItemProperty() -end - --- Returns Item property vampiric regeneration. You must specify the amount of --- regeneration. The regen amount must be an integer between 1 and 20. -function ItemPropertyVampiricRegeneration(nRegenAmount) - StackPushInteger(nRegenAmount) - VM_ExecuteCommand(677, 1) - return StackPopItemProperty() -end - --- Returns Item property Trap. You must specify the trap level constant --- (IP_CONST_TRAPSTRENGTH_*) and the trap type constant(IP_CONST_TRAPTYPE_*). -function ItemPropertyTrap(nTrapLevel, nTrapType) - StackPushInteger(nTrapType) - StackPushInteger(nTrapLevel) - VM_ExecuteCommand(678, 2) - return StackPopItemProperty() -end - --- Returns Item property true seeing. -function ItemPropertyTrueSeeing() - VM_ExecuteCommand(679, 0) - return StackPopItemProperty() -end - --- Returns Item property Monster on hit apply effect property. You must specify --- the property that you want applied on hit. There are some properties that --- require an additional special parameter to be specified. The others that --- don't require any additional parameter you may just put in the one. The --- special cases are as follows: --- ABILITYDRAIN:nSpecial is the ability to drain. --- constant(IP_CONST_ABILITY_*) --- DISEASE :nSpecial is the disease that you want applied. --- constant(DISEASE_*) --- LEVELDRAIN :nSpecial is the number of levels that you want drained. --- integer between 1 and 5. --- POISON :nSpecial is the type of poison that will effect the victim. --- constant(IP_CONST_POISON_*) --- WOUNDING :nSpecial is the amount of wounding. --- integer between 1 and 5. --- NOTE: Any that do not appear in the above list do not require the second --- parameter. --- NOTE: These can only be applied to monster NATURAL weapons (ie. bite, claw, --- gore, and slam). IT WILL NOT WORK ON NORMAL WEAPONS. -function ItemPropertyOnMonsterHitProperties(nProperty, nSpecial) - nSpecial = nSpecial or 0 - - StackPushInteger(nSpecial) - StackPushInteger(nProperty) - VM_ExecuteCommand(680, 2) - return StackPopItemProperty() -end - --- Returns Item property turn resistance. You must specify the resistance bonus. --- The bonus must be an integer between 1 and 50. -function ItemPropertyTurnResistance(nModifier) - StackPushInteger(nModifier) - VM_ExecuteCommand(681, 1) - return StackPopItemProperty() -end - --- Returns Item property Massive Critical. You must specify the extra damage --- constant(IP_CONST_DAMAGEBONUS_*) of the criticals. -function ItemPropertyMassiveCritical(nDamage) - StackPushInteger(nDamage) - VM_ExecuteCommand(682, 1) - return StackPopItemProperty() -end - --- Returns Item property free action. -function ItemPropertyFreeAction() - VM_ExecuteCommand(683, 0) - return StackPopItemProperty() -end - --- Returns Item property monster damage. You must specify the amount of damage --- the monster's attack will do(IP_CONST_MONSTERDAMAGE_*). --- NOTE: These can only be applied to monster NATURAL weapons (ie. bite, claw, --- gore, and slam). IT WILL NOT WORK ON NORMAL WEAPONS. -function ItemPropertyMonsterDamage(nDamage) - StackPushInteger(nDamage) - VM_ExecuteCommand(684, 1) - return StackPopItemProperty() -end - --- Returns Item property immunity to spell level. You must specify the level of --- which that and below the user will be immune. The level must be an integer --- between 1 and 9. By putting in a 3 it will mean the user is immune to all --- 3rd level and lower spells. -function ItemPropertyImmunityToSpellLevel(nLevel) - StackPushInteger(nLevel) - VM_ExecuteCommand(685, 1) - return StackPopItemProperty() -end - --- Returns Item property special walk. If no parameters are specified it will --- automatically use the zombie walk. This will apply the special walk animation --- to the user. -function ItemPropertySpecialWalk(nWalkType) - nWalkType = nWalkType or 0 - - StackPushInteger(nWalkType) - VM_ExecuteCommand(686, 1) - return StackPopItemProperty() -end - --- Returns Item property healers kit. You must specify the level of the kit. --- The modifier must be an integer between 1 and 12. -function ItemPropertyHealersKit(nModifier) - StackPushInteger(nModifier) - VM_ExecuteCommand(687, 1) - return StackPopItemProperty() -end - --- Returns Item property weight increase. You must specify the weight increase --- constant(IP_CONST_WEIGHTINCREASE_*). -function ItemPropertyWeightIncrease(nWeight) - StackPushInteger(nWeight) - VM_ExecuteCommand(688, 1) - return StackPopItemProperty() -end - --- *********************** END OF ITEM PROPERTY FUNCTIONS ************************** --- Returns true if 1d20 roll + skill rank is greater than or equal to difficulty --- - oTarget: the creature using the skill --- - nSkill: the skill being used --- - nDifficulty: Difficulty class of skill -function GetIsSkillSuccessful(oTarget, nSkill, nDifficulty) - StackPushInteger(nDifficulty) - StackPushInteger(nSkill) - StackPushObject(oTarget) - VM_ExecuteCommand(689, 3) - return StackPopBoolean() -end - --- Creates an effect that inhibits spells --- - nPercent - percentage of failure --- - nSpellSchool - the school of spells affected. -function EffectSpellFailure(nPercent, nSpellSchool) - nPercent = nPercent or 100 - nSpellSchool = nSpellSchool or 0 --SPELL_SCHOOL_GENERAL - - StackPushInteger(nSpellSchool) - StackPushInteger(nPercent) - VM_ExecuteCommand(690, 2) - return StackPopEffect() -end - --- Causes the object to instantly speak a translated string. --- (not an action, not blocked when uncommandable) --- - nStrRef: Reference of the string in the talk table --- - nTalkVolume: TALKVOLUME_* -function SpeakStringByStrRef(nStrRef, nTalkVolume) - nTalkVolume = nTalkVolume or 0 --TALKVOLUME_TALK - - StackPushInteger(nTalkVolume) - StackPushInteger(nStrRef) - VM_ExecuteCommand(691, 2) -end - --- Sets the given creature into cutscene mode. This prevents the player from --- using the GUI and camera controls. --- - oCreature: creature in a cutscene --- - nInCutscene: TRUE to move them into cutscene, FALSE to remove cutscene mode --- - nLeftClickingEnabled: TRUE to allow the user to interact with the game world using the left mouse button only. --- FALSE to stop the user from interacting with the game world. --- Note: SetCutsceneMode(oPlayer, TRUE) will also make the player 'plot' (unkillable). --- SetCutsceneMode(oPlayer, FALSE) will restore the player's plot flag to what it --- was when SetCutsceneMode(oPlayer, TRUE) was called. -function SetCutsceneMode(oCreature, bInCutscene, bLeftClickingEnabled) - if bInCutscene == nil then bInCutscene = true end - bLeftClickingEnabled = bLeftClickingEnabled or false - - StackPushBoolean(bLeftClickingEnabled) - StackPushBoolean(bInCutscene) - StackPushObject(oCreature) - VM_ExecuteCommand(692, 3) -end - --- Gets the last player character to cancel from a cutscene. -function GetLastPCToCancelCutscene() - VM_ExecuteCommand(693, 0) - return StackPopObject() -end - --- Gets the length of the specified wavefile, in seconds --- Only works for sounds used for dialog. -function GetDialogSoundLength(nStrRef) - StackPushInteger(nStrRef) - VM_ExecuteCommand(694, 1) - return StackPopFloat() -end - --- Fades the screen for the given creature/player from black to regular screen --- - oCreature: creature controlled by player that should fade from black -function FadeFromBlack(oCreature, fSpeed) - fSpeed = fSpeed or 0.01 --FADE_SPEED_MEDIUM - - StackPushFloat(fSpeed) - StackPushObject(oCreature) - VM_ExecuteCommand(695, 2) -end - --- Fades the screen for the given creature/player from regular screen to black --- - oCreature: creature controlled by player that should fade to black -function FadeToBlack(oCreature, fSpeed) - fSpeed = fSpeed or 0.01 --FADE_SPEED_MEDIUM - - StackPushFloat(fSpeed) - StackPushObject(oCreature) - VM_ExecuteCommand(696, 2) -end - --- Removes any fading or black screen. --- - oCreature: creature controlled by player that should be cleared -function StopFade(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(697, 1) -end - --- Sets the screen to black. Can be used in preparation for a fade-in (FadeFromBlack) --- Can be cleared by either doing a FadeFromBlack, or by calling StopFade. --- - oCreature: creature controlled by player that should see black screen -function BlackScreen(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(698, 1) -end - --- Returns the base attach bonus for the given creature. -function GetBaseAttackBonus(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(699, 1) - return StackPopInteger() -end - --- Set a creature's immortality flag. --- -oCreature: creature affected --- -bImmortal: TRUE = creature is immortal and cannot be killed (but still takes damage) --- FALSE = creature is not immortal and is damaged normally. --- This scripting command only works on Creature objects. -function SetImmortal(oCreature, bImmortal) - StackPushBoolean(bImmortal) - StackPushObject(oCreature) - VM_ExecuteCommand(700, 2) -end - --- Open's this creature's inventory panel for this player --- - oCreature: creature to view --- - oPlayer: the owner of this creature will see the panel pop up --- * DM's can view any creature's inventory --- * Players can view their own inventory, or that of their henchman, familiar or animal companion -function OpenInventory(oCreature, oPlayer) - StackPushObject(oPlayer) - StackPushObject(oCreature) - VM_ExecuteCommand(701, 2) -end - --- Stores the current camera mode and position so that it can be restored (using --- RestoreCameraFacing()) -function StoreCameraFacing() - VM_ExecuteCommand(702, 0) -end - --- Restores the camera mode and position to what they were last time StoreCameraFacing --- was called. RestoreCameraFacing can only be called once, and must correspond to a --- previous call to StoreCameraFacing. -function RestoreCameraFacing() - VM_ExecuteCommand(703, 0) -end - --- Levels up a creature using default settings. --- If successfull it returns the level the creature now is, or 0 if it fails. --- If you want to give them a different level (ie: Give a Fighter a level of Wizard) --- you can specify that in the nClass. --- However, if you specify a class to which the creature no package specified, --- they will use the default package for that class for their levelup choices. --- (ie: no Barbarian Savage/Wizard Divination combinations) --- If you turn on bReadyAllSpells, all memorized spells will be ready to cast without resting. --- if nPackage is PACKAGE_INVALID then it will use the starting package assigned to that class or just the class package -function LevelUpHenchman(oCreature, nClass, bReadyAllSpells, nPackage) - nClass = nClass or 255 --CLASS_TYPE_INVALID - bReadyAllSpells = bReadyAllSpells or false - nPackage = nPackage or 255 --PACKAGE_INVALID - - StackPushInteger(nPackage ) - StackPushBoolean(bReadyAllSpells ) - StackPushInteger(nClass ) - StackPushObject(oCreature) - VM_ExecuteCommand(704, 4) - return StackPopInteger() -end - --- Sets the droppable flag on an item --- - oItem: the item to change --- - bDroppable: TRUE or FALSE, whether the item should be droppable --- Droppable items will appear on a creature's remains when the creature is killed. -function SetDroppableFlag(oItem, bDroppable) - StackPushBoolean(bDroppable) - StackPushObject(oItem) - VM_ExecuteCommand(705, 2) -end - --- Gets the weight of an item, or the total carried weight of a creature in tenths --- of pounds (as per the baseitems.2da). --- - oTarget: the item or creature for which the weight is needed -function GetWeight(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(706, 1) - return StackPopInteger() -end - --- Gets the object that acquired the module item. May be a creature, item, or placeable -function GetModuleItemAcquiredBy() - VM_ExecuteCommand(707, 0) - return StackPopObject() -end - --- Get the immortal flag on a creature -function GetImmortal(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(708, 1) - return StackPopBoolean() -end - --- Does a single attack on every hostile creature within 10ft. of the attacker --- and determines damage accordingly. If the attacker has a ranged weapon --- equipped, this will have no effect. --- ** NOTE ** This is meant to be called inside the spell script for whirlwind --- attack, it is not meant to be used to queue up a new whirlwind attack. To do --- that you need to call ActionUseFeat(FEAT_WHIRLWIND_ATTACK, oEnemy) --- - int bDisplayFeedback: TRUE or FALSE, whether or not feedback should be --- displayed --- - int bImproved: If TRUE, the improved version of whirlwind is used -function DoWhirlwindAttack(bDisplayFeedback, bImproved) - if bDisplayFeedback == nil then bDisplayFeedback = true end - bImproved = bImproved or false - - StackPushBoolean(bImproved) - StackPushBoolean(bDisplayFeedback) - VM_ExecuteCommand(709, 2) -end - --- Gets a value from a 2DA file on the server and returns it as a string --- avoid using this function in loops --- - s2DA: the name of the 2da file, 16 chars max --- - sColumn: the name of the column in the 2da --- - nRow: the row in the 2da --- * returns an empty string if file, row, or column not found -function Get2DAString(s2DA, sColumn, nRow) - StackPushInteger(nRow) - StackPushString(sColumn) - StackPushString(s2DA) - VM_ExecuteCommand(710, 3) - return StackPopString() -end - --- Returns an effect of type EFFECT_TYPE_ETHEREAL which works just like EffectSanctuary --- except that the observers get no saving throw -function EffectEthereal() - VM_ExecuteCommand(711, 0) - return StackPopEffect() -end - --- Gets the current AI Level that the creature is running at. --- Returns one of the following: --- AI_LEVEL_INVALID, AI_LEVEL_VERY_LOW, AI_LEVEL_LOW, AI_LEVEL_NORMAL, AI_LEVEL_HIGH, AI_LEVEL_VERY_HIGH -function GetAILevel(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(712, 1) - return StackPopInteger() -end - --- Sets the current AI Level of the creature to the value specified. Does not work on Players. --- The game by default will choose an appropriate AI level for --- creatures based on the circumstances that the creature is in. --- Explicitly setting an AI level will over ride the game AI settings. --- The new setting will last until SetAILevel is called again with the argument AI_LEVEL_DEFAULT. --- AI_LEVEL_DEFAULT - Default setting. The game will take over seting the appropriate AI level when required. --- AI_LEVEL_VERY_LOW - Very Low priority, very stupid, but low CPU usage for AI. Typically used when no players are in the area. --- AI_LEVEL_LOW - Low priority, mildly stupid, but slightly more CPU usage for AI. Typically used when not in combat, but a player is in the area. --- AI_LEVEL_NORMAL - Normal priority, average AI, but more CPU usage required for AI. Typically used when creature is in combat. --- AI_LEVEL_HIGH - High priority, smartest AI, but extremely high CPU usage required for AI. Avoid using this. It is most likely only ever needed for cutscenes. -function SetAILevel(oTarget, nAILevel) - StackPushInteger(nAILevel) - StackPushObject(oTarget) - VM_ExecuteCommand(713, 2) -end - --- This will return TRUE if the creature running the script is a familiar currently --- possessed by his master. --- returns FALSE if not or if the creature object is invalid -function GetIsPossessedFamiliar(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(714, 1) - return StackPopBoolean() -end - --- This will cause a Player Creature to unpossess his/her familiar. It will work if run --- on the player creature or the possessed familiar. It does not work in conjunction with --- any DM possession. -function UnpossessFamiliar(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(715, 1) -end - --- This will return TRUE if the area is flagged as either interior or underground. -function GetIsAreaInterior(oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - VM_ExecuteCommand(716, 1) - return StackPopBoolean() -end - --- Send a server message (szMessage) to the oPlayer. -function SendMessageToPCByStrRef(oPlayer, nStrRef) - StackPushInteger(nStrRef) - StackPushObject(oPlayer) - VM_ExecuteCommand(717, 2) -end - --- Increment the remaining uses per day for this creature by one. --- Total number of feats per day can not exceed the maximum. --- - oCreature: creature to modify --- - nFeat: constant FEAT_* -function IncrementRemainingFeatUses(oCreature, nFeat) - StackPushInteger(nFeat) - StackPushObject(oCreature) - VM_ExecuteCommand(718, 2) -end - --- Force the character of the player specified to be exported to its respective directory --- i.e. LocalVault/ServerVault/ etc. -function ExportSingleCharacter(oPlayer) - StackPushObject(oPlayer) - VM_ExecuteCommand(719, 1) -end - --- This will play a sound that is associated with a stringRef, it will be a mono sound from the location of the object running the command. --- if nRunAsAction is off then the sound is forced to play intantly. -function PlaySoundByStrRef(nStrRef, bRunAsAction) - if bRunAsAction == nil then bRunAsAction = true end - - StackPushBoolean(bRunAsAction) - StackPushInteger(nStrRef) - VM_ExecuteCommand(720, 2) -end - --- Set the name of oCreature's sub race to sSubRace. -function SetSubRace(oCreature, sSubRace) - StackPushString(sSubRace) - StackPushObject(oCreature) - VM_ExecuteCommand(721, 2) -end - --- Set the name of oCreature's Deity to sDeity. -function SetDeity(oCreature, sDeity) - StackPushString(sDeity) - StackPushObject(oCreature) - VM_ExecuteCommand(722, 2) -end - --- Returns TRUE if the creature oCreature is currently possessed by a DM character. --- Returns FALSE otherwise. --- Note: GetIsDMPossessed() will return FALSE if oCreature is the DM character. --- To determine if oCreature is a DM character use GetIsDM() -function GetIsDMPossessed(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(723, 1) - return StackPopBoolean() -end - --- Gets the current weather conditions for the area oArea. --- Returns: WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW, WEATHER_INVALID --- Note: If called on an Interior area, this will always return WEATHER_CLEAR. -function GetWeather(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(724, 1) - return StackPopInteger() -end - --- Returns AREA_NATURAL if the area oArea is natural, AREA_ARTIFICIAL otherwise. --- Returns AREA_INVALID, on an error. -function GetIsAreaNatural(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(725, 1) - return StackPopInteger() -end - --- Returns AREA_ABOVEGROUND if the area oArea is above ground, AREA_UNDERGROUND otherwise. --- Returns AREA_INVALID, on an error. -function GetIsAreaAboveGround(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(726, 1) - return StackPopInteger() -end - --- Use this to get the item last equipped by a player character in OnPlayerEquipItem.. -function GetPCItemLastEquipped() - VM_ExecuteCommand(727, 0) - return StackPopObject() -end - --- Use this to get the player character who last equipped an item in OnPlayerEquipItem.. -function GetPCItemLastEquippedBy() - VM_ExecuteCommand(728, 0) - return StackPopObject() -end - --- Use this to get the item last unequipped by a player character in OnPlayerEquipItem.. -function GetPCItemLastUnequipped() - VM_ExecuteCommand(729, 0) - return StackPopObject() -end - --- Use this to get the player character who last unequipped an item in OnPlayerUnEquipItem.. -function GetPCItemLastUnequippedBy() - VM_ExecuteCommand(730, 0) - return StackPopObject() -end - --- Creates a new copy of an item, while making a single change to the appearance of the item. --- Helmet models and simple items ignore iIndex. --- iType iIndex iNewValue --- ITEM_APPR_TYPE_SIMPLE_MODEL [Ignored] Model # --- ITEM_APPR_TYPE_WEAPON_COLOR ITEM_APPR_WEAPON_COLOR_* 1-4 --- ITEM_APPR_TYPE_WEAPON_MODEL ITEM_APPR_WEAPON_MODEL_* Model # --- ITEM_APPR_TYPE_ARMOR_MODEL ITEM_APPR_ARMOR_MODEL_* Model # --- ITEM_APPR_TYPE_ARMOR_COLOR ITEM_APPR_ARMOR_COLOR_* [0] 0-175 [1] --- --- [0] Alternatively, where ITEM_APPR_TYPE_ARMOR_COLOR is specified, if per-part coloring is --- desired, the following equation can be used for nIndex to achieve that: --- --- ITEM_APPR_ARMOR_NUM_COLORS + (ITEM_APPR_ARMOR_MODEL_ * ITEM_APPR_ARMOR_NUM_COLORS) + ITEM_APPR_ARMOR_COLOR_ --- --- For example, to change the CLOTH1 channel of the torso, nIndex would be: --- --- 6 + (7 * 6) + 2 = 50 --- --- [1] When specifying per-part coloring, the value 255 is allowed and corresponds with the logical --- function 'clear colour override', which clears the per-part override for that part. -function CopyItemAndModify(oItem, nType, nIndex, nNewValue, bCopyVars) - bCopyVars = bCopyVars or false - - StackPushBoolean(bCopyVars) - StackPushInteger(nNewValue) - StackPushInteger(nIndex) - StackPushInteger(nType) - StackPushObject(oItem) - VM_ExecuteCommand(731, 5) - return StackPopObject() -end - --- Queries the current value of the appearance settings on an item. The parameters are --- identical to those of CopyItemAndModify(). -function GetItemAppearance(oItem, nType, nIndex) - StackPushInteger(nIndex) - StackPushInteger(nType) - StackPushObject(oItem) - VM_ExecuteCommand(732, 3) - return StackPopInteger() -end - --- Creates an item property that (when applied to a weapon item) causes a spell to be cast --- when a successful strike is made, or (when applied to armor) is struck by an opponent. --- - nSpell uses the IP_CONST_ONHIT_CASTSPELL_* constants -function ItemPropertyOnHitCastSpell(nSpell, nLevel) - StackPushInteger(nLevel) - StackPushInteger(nSpell) - VM_ExecuteCommand(733, 2) - return StackPopItemProperty() -end - --- Returns the SubType number of the item property. See the 2DA files for value definitions. -function GetItemPropertySubType(iProperty) - StackPushItemProperty(iProperty) - VM_ExecuteCommand(734, 1) - return StackPopInteger() -end - --- Gets the status of ACTION_MODE_* modes on a creature. -function GetActionMode(oCreature, nMode) - StackPushInteger(nMode) - StackPushObject(oCreature) - VM_ExecuteCommand(735, 2) - return StackPopBoolean() -end - --- Sets the status of modes ACTION_MODE_* on a creature. -function SetActionMode(oCreature, nMode, bStatus) - StackPushBoolean(bStatus) - StackPushInteger(nMode) - StackPushObject(oCreature) - VM_ExecuteCommand(736, 3) -end - --- Returns the current arcane spell failure factor of a creature -function GetArcaneSpellFailure(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(737, 1) - return StackPopInteger() -end - --- Makes a player examine the object oExamine. This causes the examination --- pop-up box to appear for the object specified. -function ActionExamine(oExamine) - StackPushObject(oExamine) - VM_ExecuteCommand(738, 1) -end - --- Creates a visual effect (ITEM_VISUAL_*) that may be applied to --- melee weapons only. -function ItemPropertyVisualEffect(nEffect) - StackPushInteger(nEffect) - VM_ExecuteCommand(739, 1) - return StackPopItemProperty() -end - --- Sets the lootable state of a *living* NPC creature. --- This function will *not* work on players or dead creatures. -function SetLootable(oCreature, bLootable) - StackPushBoolean(bLootable) - StackPushObject(oCreature) - VM_ExecuteCommand(740, 2) -end - --- Returns the lootable state of a creature. -function GetLootable(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(741, 1) - return StackPopBoolean() -end - --- Returns the current movement rate factor --- of the cutscene 'camera man'. --- NOTE: This will be a value between 0.1, 2.0 (10%-200%) -function GetCutsceneCameraMoveRate(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(742, 1) - return StackPopFloat() -end - --- Sets the current movement rate factor for the cutscene --- camera man. --- NOTE: You can only set values between 0.1, 2.0 (10%-200%) -function SetCutsceneCameraMoveRate(oCreature, fRate) - StackPushFloat(fRate) - StackPushObject(oCreature) - VM_ExecuteCommand(743, 2) -end - --- Returns TRUE if the item is cursed and cannot be dropped -function GetItemCursedFlag(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(744, 1) - return StackPopBoolean() -end - --- When cursed, items cannot be dropped -function SetItemCursedFlag(oItem, bCursed) - StackPushBoolean(bCursed) - StackPushObject(oItem) - VM_ExecuteCommand(745, 2) -end - --- Sets the maximum number of henchmen -function SetMaxHenchmen(nNumHenchmen) - StackPushInteger(nNumHenchmen) - VM_ExecuteCommand(746, 1) -end - --- Gets the maximum number of henchmen -function GetMaxHenchmen() - VM_ExecuteCommand(747, 0) - return StackPopInteger() -end - --- Returns the associate type of the specified creature. --- - Returns ASSOCIATE_TYPE_NONE if the creature is not the associate of anyone. -function GetAssociateType(oAssociate) - StackPushObject(oAssociate) - VM_ExecuteCommand(748, 1) - return StackPopInteger() -end - --- Returns the spell resistance of the specified creature. --- - Returns 0 if the creature has no spell resistance or an invalid --- creature is passed in. -function GetSpellResistance(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(749, 1) - return StackPopInteger() -end - --- Changes the current Day/Night cycle for this player to night --- - oPlayer: which player to change the lighting for --- - fTransitionTime: how long the transition should take -function DayToNight(oPlayer, fTransitionTime) - fTransitionTime = fTransitionTime or 0.0 - - StackPushFloat(fTransitionTime) - StackPushObject(oPlayer) - VM_ExecuteCommand(750, 2) -end - --- Changes the current Day/Night cycle for this player to daylight --- - oPlayer: which player to change the lighting for --- - fTransitionTime: how long the transition should take -function NightToDay(oPlayer, fTransitionTime) - fTransitionTime = fTransitionTime or 0.0 - - StackPushFloat(fTransitionTime) - StackPushObject(oPlayer) - VM_ExecuteCommand(751, 2) -end - --- Returns whether or not there is a direct line of sight --- between the two objects. (Not blocked by any geometry). --- --- PLEASE NOTE: This is an expensive function and may --- degrade performance if used frequently. -function LineOfSightObject(oSource, oTarget) - StackPushObject(oTarget) - StackPushObject(oSource) - VM_ExecuteCommand(752, 2) - return StackPopBoolean() -end - --- Returns whether or not there is a direct line of sight --- between the two vectors. (Not blocked by any geometry). --- --- This function must be run on a valid object in the area --- it will not work on the module or area. --- --- PLEASE NOTE: This is an expensive function and may --- degrade performance if used frequently. -function LineOfSightVector(vSource, vTarget) - StackPushVector(vTarget) - StackPushVector(vSource) - VM_ExecuteCommand(753, 2) - return StackPopBoolean() -end - --- Returns the class that the spellcaster cast the --- spell as. --- - Returns CLASS_TYPE_INVALID if the caster has --- no valid class (placeables, etc...) -function GetLastSpellCastClass() - VM_ExecuteCommand(754, 0) - return StackPopInteger() -end - --- Sets the number of base attacks for the specified --- creatures. The range of values accepted are from --- 1 to 6 --- Note: This function does not work on Player Characters -function SetBaseAttackBonus(nBaseAttackBonus, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nBaseAttackBonus) - VM_ExecuteCommand(755, 2) -end - --- Restores the number of base attacks back to it's --- original state. -function RestoreBaseAttackBonus(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(756, 1) -end - --- Creates a cutscene ghost effect, this will allow creatures --- to pathfind through other creatures without bumping into them --- for the duration of the effect. -function EffectCutsceneGhost() - VM_ExecuteCommand(757, 0) - return StackPopEffect() -end - --- Creates an item property that offsets the effect on arcane spell failure --- that a particular item has. Parameters come from the ITEM_PROP_ASF_* group. -function ItemPropertyArcaneSpellFailure(nModLevel) - StackPushInteger(nModLevel) - VM_ExecuteCommand(758, 1) - return StackPopItemProperty() -end - --- Returns the amount of gold a store currently has. -1 indicates it is not using gold. --- -2 indicates the store could not be located. -function GetStoreGold(oidStore) - StackPushObject(oidStore) - VM_ExecuteCommand(759, 1) - return StackPopInteger() -end - --- Sets the amount of gold a store has. -1 means the store does not use gold. -function SetStoreGold(oidStore, nGold) - StackPushInteger(nGold) - StackPushObject(oidStore) - VM_ExecuteCommand(760, 2) -end - --- Gets the maximum amount a store will pay for any item. -1 means price unlimited. --- -2 indicates the store could not be located. -function GetStoreMaxBuyPrice(oidStore) - StackPushObject(oidStore) - VM_ExecuteCommand(761, 1) - return StackPopInteger() -end - --- Sets the maximum amount a store will pay for any item. -1 means price unlimited. -function SetStoreMaxBuyPrice(oidStore, nMaxBuy) - StackPushInteger(nMaxBuy) - StackPushObject(oidStore) - VM_ExecuteCommand(762, 2) -end - --- Gets the amount a store charges for identifying an item. Default is 100. -1 means --- the store will not identify items. --- -2 indicates the store could not be located. -function GetStoreIdentifyCost(oidStore) - StackPushObject(oidStore) - VM_ExecuteCommand(763, 1) - return StackPopInteger() -end - --- Sets the amount a store charges for identifying an item. Default is 100. -1 means --- the store will not identify items. -function SetStoreIdentifyCost(oidStore, nCost) - StackPushInteger(nCost) - StackPushObject(oidStore) - VM_ExecuteCommand(764, 2) -end - --- Sets the creature's appearance type to the value specified (uses the APPEARANCE_TYPE_XXX constants) -function SetCreatureAppearanceType(oCreature, nAppearanceType) - StackPushInteger(nAppearanceType) - StackPushObject(oCreature) - VM_ExecuteCommand(765, 2) -end - --- Returns the default package selected for this creature to level up with --- - returns PACKAGE_INVALID if error occurs -function GetCreatureStartingPackage(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(766, 1) - return StackPopInteger() -end - --- Returns an effect that when applied will paralyze the target's legs, rendering --- them unable to walk but otherwise unpenalized. This effect cannot be resisted. -function EffectCutsceneImmobilize() - VM_ExecuteCommand(767, 0) - return StackPopEffect() -end - --- Is this creature in the given subarea? (trigger, area of effect object, etc..) --- This function will tell you if the creature has triggered an onEnter event, --- not if it is physically within the space of the subarea -function GetIsInSubArea(oCreature, oSubArea) - oSubArea = oSubArea or OBJECT_SELF - - StackPushObject(oSubArea) - StackPushObject(oCreature) - VM_ExecuteCommand(768, 2) - return StackPopBoolean() -end - --- Returns the Cost Table number of the item property. See the 2DA files for value definitions. -function GetItemPropertyCostTable(iProp) - StackPushItemProperty(iProp) - VM_ExecuteCommand(769, 1) - return StackPopInteger() -end - --- Returns the Cost Table value (index of the cost table) of the item property. --- See the 2DA files for value definitions. -function GetItemPropertyCostTableValue(iProp) - StackPushItemProperty(iProp) - VM_ExecuteCommand(770, 1) - return StackPopInteger() -end - --- Returns the Param1 number of the item property. See the 2DA files for value definitions. -function GetItemPropertyParam1(iProp) - StackPushItemProperty(iProp) - VM_ExecuteCommand(771, 1) - return StackPopInteger() -end - --- Returns the Param1 value of the item property. See the 2DA files for value definitions. -function GetItemPropertyParam1Value(iProp) - StackPushItemProperty(iProp) - VM_ExecuteCommand(772, 1) - return StackPopInteger() -end - --- Is this creature able to be disarmed? (checks disarm flag on creature, and if --- the creature actually has a weapon equipped in their right hand that is droppable) -function GetIsCreatureDisarmable(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(773, 1) - return StackPopBoolean() -end - --- Sets whether this item is 'stolen' or not -function SetStolenFlag(oItem, bStolenFlag) - StackPushBoolean(bStolenFlag) - StackPushObject(oItem) - VM_ExecuteCommand(774, 2) -end - --- Instantly gives this creature the benefits of a rest (restored hitpoints, spells, feats, etc..) -function ForceRest(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(775, 1) -end - --- Forces this player's camera to be set to this height. Setting this value to zero will --- restore the camera to the racial default height. -function SetCameraHeight(oPlayer, fHeight) - fHeight = fHeight or 0.0 - - StackPushFloat(fHeight) - StackPushObject(oPlayer) - VM_ExecuteCommand(776, 2) -end - --- Changes the sky that is displayed in the specified area. --- nSkyBox = SKYBOX_* constants (associated with skyboxes.2da) --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function SetSkyBox(nSkyBox, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nSkyBox) - VM_ExecuteCommand(777, 2) -end - --- Returns the creature's currently set PhenoType (body type). -function GetPhenoType(oCreature) - StackPushObject(oCreature) - VM_ExecuteCommand(778, 1) - return StackPopInteger() -end - --- Sets the creature's PhenoType (body type) to the type specified. --- nPhenoType = PHENOTYPE_NORMAL --- nPhenoType = PHENOTYPE_BIG --- nPhenoType = PHENOTYPE_CUSTOM* - The custom PhenoTypes should only ever --- be used if you have specifically created your own custom content that --- requires the use of a new PhenoType and you have specified the appropriate --- custom PhenoType in your custom content. --- SetPhenoType will only work on part based creature (i.e. the starting --- default playable races). -function SetPhenoType(nPhenoType, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nPhenoType) - VM_ExecuteCommand(779, 2) -end - --- Sets the fog color in the area specified. --- nFogType = FOG_TYPE_* specifies wether the Sun, Moon, or both fog types are set. --- nFogColor = FOG_COLOR_* specifies the color the fog is being set to. --- The fog 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. --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function SetFogColor(nFogType, nFogColor, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nFogColor) - StackPushInteger(nFogType) - VM_ExecuteCommand(780, 3) -end - --- Gets the current cutscene state of the player specified by oCreature. --- Returns TRUE if the player is in cutscene mode. --- Returns FALSE if the player is not in cutscene mode, or on an error --- (such as specifying a non creature object). -function GetCutsceneMode(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(781, 1) - return StackPopInteger() -end - --- Gets the skybox that is currently displayed in the specified area. --- Returns: --- SKYBOX_* constant --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function GetSkyBox(oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - VM_ExecuteCommand(782, 1) - return StackPopInteger() -end - --- Gets the fog color in the area specified. --- nFogType specifies wether the Sun, or Moon fog type is returned. --- Valid values for nFogType are FOG_TYPE_SUN or FOG_TYPE_MOON. --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function GetFogColor(nFogType, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nFogType) - VM_ExecuteCommand(783, 2) - return StackPopInteger() -end - --- Sets the fog amount in the area specified. --- nFogType = FOG_TYPE_* specifies wether the Sun, Moon, or both fog types are set. --- nFogAmount = specifies the density that the fog is being set to. --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function SetFogAmount(nFogType, nFogAmount, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nFogAmount) - StackPushInteger(nFogType) - VM_ExecuteCommand(784, 3) -end - --- Gets the fog amount in the area specified. --- nFogType = nFogType specifies wether the Sun, or Moon fog type is returned. --- Valid values for nFogType are FOG_TYPE_SUN or FOG_TYPE_MOON. --- If no valid area (or object) is specified, it uses the area of caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function GetFogAmount(nFogType, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nFogType) - VM_ExecuteCommand(785, 2) - return StackPopInteger() -end - --- returns TRUE if the item CAN be pickpocketed -function GetPickpocketableFlag(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(786, 1) - return StackPopBoolean() -end - --- Sets the Pickpocketable flag on an item --- - oItem: the item to change --- - bPickpocketable: TRUE or FALSE, whether the item can be pickpocketed. -function SetPickpocketableFlag(oItem, bPickpocketable) - StackPushBoolean(bPickpocketable) - StackPushObject(oItem) - VM_ExecuteCommand(787, 2) -end - --- returns the footstep type of the creature specified. --- The footstep type determines what the creature's footsteps sound --- like when ever they take a step. --- returns FOOTSTEP_TYPE_INVALID if used on a non-creature object, or if --- used on creature that has no footstep sounds by default (e.g. Will-O'-Wisp). -function GetFootstepType(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(788, 1) - return StackPopInteger() -end - --- Sets the footstep type of the creature specified. --- Changing a creature's footstep type will change the sound that --- its feet make when ever the creature makes takes a step. --- By default a creature's footsteps are detemined by the appearance --- type of the creature. SetFootstepType() allows you to make a --- creature use a difference footstep type than it would use by default --- for its given appearance. --- - nFootstepType (FOOTSTEP_TYPE_*): --- FOOTSTEP_TYPE_NORMAL --- FOOTSTEP_TYPE_LARGE --- FOOTSTEP_TYPE_DRAGON --- FOOTSTEP_TYPE_SoFT --- FOOTSTEP_TYPE_HOOF --- FOOTSTEP_TYPE_HOOF_LARGE --- FOOTSTEP_TYPE_BEETLE --- FOOTSTEP_TYPE_SPIDER --- FOOTSTEP_TYPE_SKELETON --- FOOTSTEP_TYPE_LEATHER_WING --- FOOTSTEP_TYPE_FEATHER_WING --- FOOTSTEP_TYPE_DEFAULT - Makes the creature use its original default footstep sounds. --- FOOTSTEP_TYPE_NONE --- - oCreature: the creature to change the footstep sound for. -function SetFootstepType(nFootstepType, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nFootstepType) - VM_ExecuteCommand(789, 2) -end - --- returns the Wing type of the creature specified. --- CREATURE_WING_TYPE_NONE --- CREATURE_WING_TYPE_DEMON --- CREATURE_WING_TYPE_ANGEL --- CREATURE_WING_TYPE_BAT --- CREATURE_WING_TYPE_DRAGON --- CREATURE_WING_TYPE_BUTTERFLY --- CREATURE_WING_TYPE_BIRD --- returns CREATURE_WING_TYPE_NONE if used on a non-creature object, --- if the creature has no wings, or if the creature can not have its --- wing type changed in the toolset. -function GetCreatureWingType(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(790, 1) - return StackPopInteger() -end - --- Sets the Wing type of the creature specified. --- - nWingType (CREATURE_WING_TYPE_*) --- CREATURE_WING_TYPE_NONE --- CREATURE_WING_TYPE_DEMON --- CREATURE_WING_TYPE_ANGEL --- CREATURE_WING_TYPE_BAT --- CREATURE_WING_TYPE_DRAGON --- CREATURE_WING_TYPE_BUTTERFLY --- CREATURE_WING_TYPE_BIRD --- - oCreature: the creature to change the wing type for. --- Note: Only two creature model types will support wings. --- The MODELTYPE for the part based (playable races) 'P' --- and MODELTYPE 'W'in the appearance.2da -function SetCreatureWingType(nWingType, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nWingType) - VM_ExecuteCommand(791, 2) -end - --- returns the model number being used for the body part and creature specified --- The model number returned is for the body part when the creature is not wearing --- armor (i.e. whether or not the creature is wearing armor does not affect --- the return value). --- Note: Only works on part based creatures, which is typically restricted to --- the playable races (unless some new part based custom content has been --- added to the module). --- --- returns CREATURE_PART_INVALID if used on a non-creature object, --- or if the creature does not use a part based model. --- --- - nPart (CREATURE_PART_*) --- CREATURE_PART_RIGHT_FOOT --- CREATURE_PART_LEFT_FOOT --- CREATURE_PART_RIGHT_SHIN --- CREATURE_PART_LEFT_SHIN --- CREATURE_PART_RIGHT_THIGH --- CREATURE_PART_LEFT_THIGH --- CREATURE_PART_PELVIS --- CREATURE_PART_TORSO --- CREATURE_PART_BELT --- CREATURE_PART_NECK --- CREATURE_PART_RIGHT_FOREARM --- CREATURE_PART_LEFT_FOREARM --- CREATURE_PART_RIGHT_BICEP --- CREATURE_PART_LEFT_BICEP --- CREATURE_PART_RIGHT_SHOULDER --- CREATURE_PART_LEFT_SHOULDER --- CREATURE_PART_RIGHT_HAND --- CREATURE_PART_LEFT_HAND --- CREATURE_PART_HEAD -function GetCreatureBodyPart(nPart, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nPart) - VM_ExecuteCommand(792, 2) - return StackPopInteger() -end - --- Sets the body part model to be used on the creature specified. --- The model names for parts need to be in the following format: --- p_.mdl --- --- - nPart (CREATURE_PART_*) --- CREATURE_PART_RIGHT_FOOT --- CREATURE_PART_LEFT_FOOT --- CREATURE_PART_RIGHT_SHIN --- CREATURE_PART_LEFT_SHIN --- CREATURE_PART_RIGHT_THIGH --- CREATURE_PART_LEFT_THIGH --- CREATURE_PART_PELVIS --- CREATURE_PART_TORSO --- CREATURE_PART_BELT --- CREATURE_PART_NECK --- CREATURE_PART_RIGHT_FOREARM --- CREATURE_PART_LEFT_FOREARM --- CREATURE_PART_RIGHT_BICEP --- CREATURE_PART_LEFT_BICEP --- CREATURE_PART_RIGHT_SHOULDER --- CREATURE_PART_LEFT_SHOULDER --- CREATURE_PART_RIGHT_HAND --- CREATURE_PART_LEFT_HAND --- CREATURE_PART_HEAD --- - nModelNumber: CREATURE_MODEL_TYPE_* --- CREATURE_MODEL_TYPE_NONE --- CREATURE_MODEL_TYPE_SKIN (not for use on shoulders, pelvis or head). --- CREATURE_MODEL_TYPE_TATTOO (for body parts that support tattoos, i.e. not heads/feet/hands). --- CREATURE_MODEL_TYPE_UNDEAD (undead model only exists for the right arm parts). --- - oCreature: the creature to change the body part for. --- Note: Only part based creature appearance types are supported. --- i.e. The model types for the playable races ('P') in the appearance.2da -function SetCreatureBodyPart(nPart, nModelNumber, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nModelNumber) - StackPushInteger(nPart) - VM_ExecuteCommand(793, 3) -end - --- returns the Tail type of the creature specified. --- CREATURE_TAIL_TYPE_NONE --- CREATURE_TAIL_TYPE_LIZARD --- CREATURE_TAIL_TYPE_BONE --- CREATURE_TAIL_TYPE_DEVIL --- returns CREATURE_TAIL_TYPE_NONE if used on a non-creature object, --- if the creature has no Tail, or if the creature can not have its --- Tail type changed in the toolset. -function GetCreatureTailType(oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - VM_ExecuteCommand(794, 1) - return StackPopInteger() -end - --- Sets the Tail type of the creature specified. --- - nTailType (CREATURE_TAIL_TYPE_*) --- CREATURE_TAIL_TYPE_NONE --- CREATURE_TAIL_TYPE_LIZARD --- CREATURE_TAIL_TYPE_BONE --- CREATURE_TAIL_TYPE_DEVIL --- - oCreature: the creature to change the Tail type for. --- Note: Only two creature model types will support Tails. --- The MODELTYPE for the part based (playable) races 'P' --- and MODELTYPE 'T'in the appearance.2da -function SetCreatureTailType(nTailType, oCreature) - oCreature = oCreature or OBJECT_SELF - - StackPushObject(oCreature) - StackPushInteger(nTailType) - VM_ExecuteCommand(795, 2) -end - --- returns the Hardness of a Door or Placeable object. --- - oObject: a door or placeable object. --- returns -1 on an error or if used on an object that is --- neither a door nor a placeable object. -function GetHardness(oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - VM_ExecuteCommand(796, 1) - return StackPopInteger() -end - --- Sets the Hardness of a Door or Placeable object. --- - nHardness: must be between 0 and 250. --- - oObject: a door or placeable object. --- Does nothing if used on an object that is neither --- a door nor a placeable. -function SetHardness(nHardness, oObject) - oObject = oObject or OBJECT_SELF - - StackPushObject(oObject) - StackPushInteger(nHardness) - VM_ExecuteCommand(797, 2) -end - --- When set the object can not be opened unless the --- opener possesses the required key. The key tag required --- can be specified either in the toolset, or by using --- the SetLockKeyTag() scripting command. --- - oObject: a door, or placeable. --- - nKeyRequired: TRUE/FALSE -function SetLockKeyRequired(oObject, bKeyRequired) - if bKeyRequired == nil then bKeyRequired = true end - - StackPushBoolean(bKeyRequired) - StackPushObject(oObject) - VM_ExecuteCommand(798, 2) -end - --- Set the key tag required to open object oObject. --- This will only have an effect if the object is set to --- "Key required to unlock or lock" either in the toolset --- or by using the scripting command SetLockKeyRequired(). --- - oObject: a door, placeable or trigger. --- - sNewKeyTag: the key tag required to open the locked object. -function SetLockKeyTag(oObject, sNewKeyTag) - StackPushString(sNewKeyTag) - StackPushObject(oObject) - VM_ExecuteCommand(799, 2) -end - --- Sets whether or not the object can be locked. --- - oObject: a door or placeable. --- - nLockable: TRUE/FALSE -function SetLockLockable(oObject, bLockable) - if bLockable == nil then bLockable = true end - - StackPushBoolean(bLockable) - StackPushObject(oObject) - VM_ExecuteCommand(800, 2) -end - --- Sets the DC for unlocking the object. --- - oObject: a door or placeable object. --- - nNewUnlockDC: must be between 0 and 250. -function SetLockUnlockDC(oObject, nNewUnlockDC) - StackPushInteger(nNewUnlockDC) - StackPushObject(oObject) - VM_ExecuteCommand(801, 2) -end - --- Sets the DC for locking the object. --- - oObject: a door or placeable object. --- - nNewLockDC: must be between 0 and 250. -function SetLockLockDC(oObject, nNewLockDC) - StackPushInteger(nNewLockDC) - StackPushObject(oObject) - VM_ExecuteCommand(802, 2) -end - --- Sets whether or not the trapped object can be disarmed. --- - oTrapObject: a placeable, door or trigger --- - nDisarmable: TRUE/FALSE -function SetTrapDisarmable(oTrapObject, bDisarmable) - if bDisarmable == nil then bDisarmable = true end - - StackPushInteger(bDisarmable) - StackPushObject(oTrapObject) - VM_ExecuteCommand(803, 2) -end - --- Sets whether or not the trapped object can be detected. --- - oTrapObject: a placeable, door or trigger --- - nDetectable: TRUE/FALSE --- Note: Setting a trapped object to not be detectable will --- not make the trap disappear if it has already been detected. -function SetTrapDetectable(oTrapObject, bDetectable) - if bDetectable == nil then bDetectable = true end - - StackPushBoolean(bDetectable) - StackPushObject(oTrapObject) - VM_ExecuteCommand(804, 2) -end - --- Sets whether or not the trap is a one-shot trap --- (i.e. whether or not the trap resets itself after firing). --- - oTrapObject: a placeable, door or trigger --- - nOneShot: TRUE/FALSE -function SetTrapOneShot(oTrapObject, bOneShot) - if bOneShot == nil then bOneShot = true end - - StackPushBoolean(bOneShot) - StackPushObject(oTrapObject) - VM_ExecuteCommand(805, 2) -end - --- Set the tag of the key that will disarm oTrapObject. --- - oTrapObject: a placeable, door or trigger -function SetTrapKeyTag(oTrapObject, sKeyTag) - StackPushString(sKeyTag) - StackPushObject(oTrapObject) - VM_ExecuteCommand(806, 2) -end - --- Set the DC for disarming oTrapObject. --- - oTrapObject: a placeable, door or trigger --- - nDisarmDC: must be between 0 and 250. -function SetTrapDisarmDC(oTrapObject, nDisarmDC) - StackPushInteger(nDisarmDC) - StackPushObject(oTrapObject) - VM_ExecuteCommand(807, 2) -end - --- Set the DC for detecting oTrapObject. --- - oTrapObject: a placeable, door or trigger --- - nDetectDC: must be between 0 and 250. -function SetTrapDetectDC(oTrapObject, nDetectDC) - StackPushInteger(nDetectDC) - StackPushObject(oTrapObject) - VM_ExecuteCommand(808, 2) -end - --- Creates a square Trap object. --- - nTrapType: The base type of trap (TRAP_BASE_TYPE_*) --- - lLocation: The location and orientation that the trap will be created at. --- - fSize: The size of the trap. Minimum size allowed is 1.0f. --- - sTag: The tag of the trap being created. --- - nFaction: The faction of the trap (STANDARD_FACTION_*). --- - sOnDisarmScript: The OnDisarm script that will fire when the trap is disarmed. --- If "" no script will fire. --- - sOnTrapTriggeredScript: The OnTrapTriggered script that will fire when the --- trap is triggered. --- If "" the default OnTrapTriggered script for the trap --- type specified will fire instead (as specified in the --- traps.2da). -function CreateTrapAtLocation(nTrapType, lLocation, fSize, sTag, nFaction, sOnDisarmScript, sOnTrapTriggeredScript) - fSize = fSize or 2.0 - sTag = sTag or "" - nFaction = nFaction or 0 --STANDARD_FACTION_HOSTILE - sOnDisarmScript = sOnDisarmScript or "" - sOnTrapTriggeredScript = sOnTrapTriggeredScript or "" - - StackPushString(sOnTrapTriggeredScript) - StackPushString(sOnDisarmScript) - StackPushInteger(nFaction) - StackPushString(sTag) - StackPushFloat(fSize) - StackPushLocation(lLocation) - StackPushInteger(nTrapType) - VM_ExecuteCommand(809, 7) - return StackPopObject() -end - --- Creates a Trap on the object specified. --- - nTrapType: The base type of trap (TRAP_BASE_TYPE_*) --- - oObject: The object that the trap will be created on. Works only on Doors and Placeables. --- - nFaction: The faction of the trap (STANDARD_FACTION_*). --- - sOnDisarmScript: The OnDisarm script that will fire when the trap is disarmed. --- If "" no script will fire. --- - sOnTrapTriggeredScript: The OnTrapTriggered script that will fire when the --- trap is triggered. --- If "" the default OnTrapTriggered script for the trap --- type specified will fire instead (as specified in the --- traps.2da). --- Note: After creating a trap on an object, you can change the trap's properties --- using the various SetTrap* scripting commands by passing in the object --- that the trap was created on (i.e. oObject) to any subsequent SetTrap* commands. -function CreateTrapOnObject(nTrapType, oObject, nFaction, sOnDisarmScript, sOnTrapTriggeredScript) - nFaction = nFaction or 0 --STANDARD_FACTION_HOSTILE - sOnDisarmScript = sOnDisarmScript or "" - sOnTrapTriggeredScript = sOnTrapTriggeredScript or "" - - StackPushString(sOnTrapTriggeredScript) - StackPushString(sOnDisarmScript) - StackPushInteger(nFaction) - StackPushObject(oObject) - StackPushInteger(nTrapType) - VM_ExecuteCommand(810, 5) -end - --- Set the Will saving throw value of the Door or Placeable object oObject. --- - oObject: a door or placeable object. --- - nWillSave: must be between 0 and 250. -function SetWillSavingThrow(oObject, nWillSave) - StackPushInteger(nWillSave) - StackPushObject(oObject) - VM_ExecuteCommand(811, 2) -end - --- Set the Reflex saving throw value of the Door or Placeable object oObject. --- - oObject: a door or placeable object. --- - nReflexSave: must be between 0 and 250. -function SetReflexSavingThrow(oObject, nReflexSave) - StackPushInteger(nReflexSave) - StackPushObject(oObject) - VM_ExecuteCommand(812, 2) -end - --- Set the Fortitude saving throw value of the Door or Placeable object oObject. --- - oObject: a door or placeable object. --- - nFortitudeSave: must be between 0 and 250. -function SetFortitudeSavingThrow(oObject, nFortitudeSave) - StackPushInteger(nFortitudeSave) - StackPushObject(oObject) - VM_ExecuteCommand(813, 2) -end - --- returns the resref (TILESET_RESREF_*) of the tileset used to create area oArea. --- TILESET_RESREF_BEHOLDER_CAVES --- TILESET_RESREF_CASTLE_INTERIOR --- TILESET_RESREF_CITY_EXTERIOR --- TILESET_RESREF_CITY_INTERIOR --- TILESET_RESREF_CRYPT --- TILESET_RESREF_DESERT --- TILESET_RESREF_DROW_INTERIOR --- TILESET_RESREF_DUNGEON --- TILESET_RESREF_FOREST --- TILESET_RESREF_FROZEN_WASTES --- TILESET_RESREF_ILLITHID_INTERIOR --- TILESET_RESREF_MICROSET --- TILESET_RESREF_MINES_AND_CAVERNS --- TILESET_RESREF_RUINS --- TILESET_RESREF_RURAL --- TILESET_RESREF_RURAL_WINTER --- TILESET_RESREF_SEWERS --- TILESET_RESREF_UNDERDARK --- * returns an empty string on an error. -function GetTilesetResRef(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(814, 1) - return StackPopString() -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject can be recovered. -function GetTrapRecoverable(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(815, 1) - return StackPopBoolean() -end - --- Sets whether or not the trapped object can be recovered. --- - oTrapObject: a placeable, door or trigger -function SetTrapRecoverable(oTrapObject, bRecoverable) - if bRecoverable == nil then bRecoverable = true end - - StackPushBoolean(bRecoverable) - StackPushObject(oTrapObject) - VM_ExecuteCommand(816, 2) -end - --- Get the XP scale being used for the module. -function GetModuleXPScale() - VM_ExecuteCommand(817, 0) - return StackPopInteger() -end - --- Set the XP scale used by the module. --- - nXPScale: The XP scale to be used. Must be between 0 and 200. -function SetModuleXPScale(nXPScale) - StackPushInteger(nXPScale) - VM_ExecuteCommand(818, 1) -end - --- Get the feedback message that will be displayed when trying to unlock the object oObject. --- - oObject: a door or placeable. --- Returns an empty string "" on an error or if the game's default feedback message is being used -function GetKeyRequiredFeedback(oObject) - StackPushObject(oObject) - VM_ExecuteCommand(819, 1) - return StackPopString() -end - --- Set the feedback message that is displayed when trying to unlock the object oObject. --- This will only have an effect if the object is set to --- "Key required to unlock or lock" either in the toolset --- or by using the scripting command SetLockKeyRequired(). --- - oObject: a door or placeable. --- - sFeedbackMessage: the string to be displayed in the player's text window. --- to use the game's default message, set sFeedbackMessage to "" -function SetKeyRequiredFeedback(oObject, sFeedbackMessage) - StackPushString(sFeedbackMessage) - StackPushObject(oObject) - VM_ExecuteCommand(820, 2) -end - --- - oTrapObject: a placeable, door or trigger --- * Returns TRUE if oTrapObject is active -function GetTrapActive(oTrapObject) - StackPushObject(oTrapObject) - VM_ExecuteCommand(821, 1) - return StackPopBoolean() -end - --- Sets whether or not the trap is an active trap --- - oTrapObject: a placeable, door or trigger --- - nActive: TRUE/FALSE --- Notes: --- Setting a trap as inactive will not make the --- trap disappear if it has already been detected. --- Call SetTrapDetectedBy() to make a detected trap disappear. --- To make an inactive trap not detectable call SetTrapDetectable() -function SetTrapActive(oTrapObject, bActive) - if bActive == nil then bActive = true end - - StackPushBoolean(bActive) - StackPushObject(oTrapObject) - VM_ExecuteCommand(822, 2) -end - --- Locks the player's camera pitch to its current pitch setting, --- or unlocks the player's camera pitch. --- Stops the player from tilting their camera angle. --- - oPlayer: A player object. --- - bLocked: TRUE/FALSE. -function LockCameraPitch(oPlayer, bLocked) - if bLocked == nil then bLocked = true end - - StackPushBoolean(bLocked) - StackPushObject(oPlayer) - VM_ExecuteCommand(823, 2) -end - --- Locks the player's camera distance to its current distance setting, --- or unlocks the player's camera distance. --- Stops the player from being able to zoom in/out the camera. --- - oPlayer: A player object. --- - bLocked: TRUE/FALSE. -function LockCameraDistance(oPlayer, bLocked) - if bLocked == nil then bLocked = true end - - StackPushBoolean(bLocked) - StackPushObject(oPlayer) - VM_ExecuteCommand(824, 2) -end - --- Locks the player's camera direction to its current direction, --- or unlocks the player's camera direction to enable it to move --- freely again. --- Stops the player from being able to rotate the camera direction. --- - oPlayer: A player object. --- - bLocked: TRUE/FALSE. -function LockCameraDirection(oPlayer, bLocked) - if bLocked == nil then bLocked = true end - - StackPushBoolean(bLocked) - StackPushObject(oPlayer) - VM_ExecuteCommand(825, 2) -end - --- Get the last object that default clicked (left clicked) on the placeable object --- that is calling this function. --- Should only be called from a placeables OnClick event. --- * Returns OBJECT_INVALID if it is called by something other than a placeable. -function GetPlaceableLastClickedBy() - VM_ExecuteCommand(826, 0) - return StackPopObject() -end - --- returns TRUE if the item is flagged as infinite. --- - oItem: an item. --- The infinite property affects the buying/selling behavior of the item in a store. --- An infinite item will still be available to purchase from a store after a player --- buys the item (non-infinite items will disappear from the store when purchased). -function GetInfiniteFlag(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(827, 1) - return StackPopBoolean() -end - --- Sets the Infinite flag on an item --- - oItem: the item to change --- - bInfinite: TRUE or FALSE, whether the item should be Infinite --- The infinite property affects the buying/selling behavior of the item in a store. --- An infinite item will still be available to purchase from a store after a player --- buys the item (non-infinite items will disappear from the store when purchased). -function SetInfiniteFlag(oItem, bInfinite) - if bInfinite == nil then bInfinite = true end - - StackPushBoolean(bInfinite) - StackPushObject(oItem) - VM_ExecuteCommand(828, 2) -end - --- Gets the size of the area. --- - nAreaDimension: The area dimension that you wish to determine. --- AREA_HEIGHT --- AREA_WIDTH --- - oArea: The area that you wish to get the size of. --- Returns: The number of tiles that the area is wide/high, or zero on an error. --- If no valid area (or object) is specified, it uses the area of the caller. --- If an object other than an area is specified, will use the area that the object is currently in. -function GetAreaSize(nAreaDimension, oArea) - oArea = oArea or OBJECT_INVALID - - StackPushObject(oArea) - StackPushInteger(nAreaDimension) - VM_ExecuteCommand(829, 2) - return StackPopInteger() -end - --- Set the name of oObject. --- - oObject: the object for which you are changing the name (a creature, placeable, item, or door). --- - sNewName: the new name that the object will use. --- Note: SetName() does not work on player objects. --- Setting an object's name to "" will make the object --- revert to using the name it had originally before any --- SetName() calls were made on the object. -function SetName(oObject, sNewName) - sNewName = sNewName or "" - - StackPushString(sNewName) - StackPushObject(oObject) - VM_ExecuteCommand(830, 2) -end - --- Get the PortraitId of oTarget. --- - oTarget: the object for which you are getting the portrait Id. --- Returns: The Portrait Id number being used for the object oTarget. --- The Portrait Id refers to the row number of the Portraits.2da --- that this portrait is from. --- If a custom portrait is being used, oTarget is a player object, --- or on an error returns PORTRAIT_INVALID. In these instances --- try using GetPortraitResRef() instead. -function GetPortraitId(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(831, 1) - return StackPopInteger() -end - --- Change the portrait of oTarget to use the Portrait Id specified. --- - oTarget: the object for which you are changing the portrait. --- - nPortraitId: The Id of the new portrait to use. --- nPortraitId refers to a row in the Portraits.2da --- Note: Not all portrait Ids are suitable for use with all object types. --- Setting the portrait Id will also cause the portrait ResRef --- to be set to the appropriate portrait ResRef for the Id specified. -function SetPortraitId(oTarget, nPortraitId) - StackPushInteger(nPortraitId) - StackPushObject(oTarget) - VM_ExecuteCommand(832, 2) -end - --- Get the Portrait ResRef of oTarget. --- - oTarget: the object for which you are getting the portrait ResRef. --- Returns: The Portrait ResRef being used for the object oTarget. --- The Portrait ResRef will not include a trailing size letter. -function GetPortraitResRef(oTarget) - oTarget = oTarget or OBJECT_SELF - - StackPushObject(oTarget) - VM_ExecuteCommand(833, 1) - return StackPopString() -end - --- Change the portrait of oTarget to use the Portrait ResRef specified. --- - oTarget: the object for which you are changing the portrait. --- - sPortraitResRef: The ResRef of the new portrait to use. --- The ResRef should not include any trailing size letter ( e.g. po_el_f_09_ ). --- Note: Not all portrait ResRefs are suitable for use with all object types. --- Setting the portrait ResRef will also cause the portrait Id --- to be set to PORTRAIT_INVALID. -function SetPortraitResRef(oTarget, sPortraitResRef) - StackPushString(sPortraitResRef) - StackPushObject(oTarget) - VM_ExecuteCommand(834, 2) -end - --- Set oPlaceable's useable object status. --- Note: Only works on non-static placeables. -function SetUseableFlag(oPlaceable, bUseableFlag) - StackPushBoolean(bUseableFlag) - StackPushObject(oPlaceable) - VM_ExecuteCommand(835, 2) -end - --- Get the description of oObject. --- - oObject: the object from which you are obtaining the description. --- Can be a creature, item, placeable, door, trigger or module object. --- - bOriginalDescription: if set to true any new description specified via a SetDescription scripting command --- is ignored and the original object's description is returned instead. --- - bIdentified: If oObject is an item, setting this to TRUE will return the identified description, --- setting this to FALSE will return the unidentified description. This flag has no --- effect on objects other than items. -function GetDescription(oObject, bOriginalDescription, bIdentifiedDescription) - bOriginalDescription = bOriginalDescription or false - if bIdentifiedDescription == nil then bIdentifiedDescription = true end - - StackPushBoolean(bIdentifiedDescription) - StackPushBoolean(bOriginalDescription) - StackPushObject(oObject) - VM_ExecuteCommand(836, 3) - return StackPopString() -end - --- Set the description of oObject. --- - oObject: the object for which you are changing the description --- Can be a creature, placeable, item, door, or trigger. --- - sNewDescription: the new description that the object will use. --- - bIdentified: If oObject is an item, setting this to TRUE will set the identified description, --- setting this to FALSE will set the unidentified description. This flag has no --- effect on objects other than items. --- Note: Setting an object's description to "" will make the object --- revert to using the description it originally had before any --- SetDescription() calls were made on the object. -function SetDescription(oObject, sNewDescription, bIdentifiedDescription) - sNewDescription = sNewDescription or "" - if bIdentifiedDescription == nil then bIdentifiedDescription = true end - - StackPushBoolean(bIdentifiedDescription) - StackPushString(sNewDescription) - StackPushObject(oObject) - VM_ExecuteCommand(837, 3) -end - --- Get the PC that sent the last player chat(text) message. --- Should only be called from a module's OnPlayerChat event script. --- * Returns OBJECT_INVALID on error. --- Note: Private tells do not trigger a OnPlayerChat event. -function GetPCChatSpeaker() - VM_ExecuteCommand(838, 0) - return StackPopObject() -end - --- Get the last player chat(text) message that was sent. --- Should only be called from a module's OnPlayerChat event script. --- * Returns empty string "" on error. --- Note: Private tells do not trigger a OnPlayerChat event. -function GetPCChatMessage() - VM_ExecuteCommand(839, 0) - return StackPopString() -end - --- Get the volume of the last player chat(text) message that was sent. --- Returns one of the following TALKVOLUME_* constants based on the volume setting --- that the player used to send the chat message. --- TALKVOLUME_TALK --- TALKVOLUME_WHISPER --- TALKVOLUME_SHOUT --- TALKVOLUME_SILENT_SHOUT (used for DM chat channel) --- TALKVOLUME_PARTY --- Should only be called from a module's OnPlayerChat event script. --- * Returns -1 on error. --- Note: Private tells do not trigger a OnPlayerChat event. -function GetPCChatVolume() - VM_ExecuteCommand(840, 0) - return StackPopInteger() -end - --- Set the last player chat(text) message before it gets sent to other players. --- - sNewChatMessage: The new chat text to be sent onto other players. --- Setting the player chat message to an empty string "", --- will cause the chat message to be discarded --- (i.e. it will not be sent to other players). --- Note: The new chat message gets sent after the OnPlayerChat script exits. -function SetPCChatMessage(sNewChatMessage) - sNewChatMessage = sNewChatMessage or "" - - StackPushString(sNewChatMessage) - VM_ExecuteCommand(841, 1) -end - --- Set the last player chat(text) volume before it gets sent to other players. --- - nTalkVolume: The new volume of the chat text to be sent onto other players. --- TALKVOLUME_TALK --- TALKVOLUME_WHISPER --- TALKVOLUME_SHOUT --- TALKVOLUME_SILENT_SHOUT (used for DM chat channel) --- TALKVOLUME_PARTY --- TALKVOLUME_TELL (sends the chat message privately back to the original speaker) --- Note: The new chat message gets sent after the OnPlayerChat script exits. -function SetPCChatVolume(nTalkVolume) - nTalkVolume = nTalkVolume or 0 --TALKVOLUME_TALK - - StackPushInteger(nTalkVolume) - VM_ExecuteCommand(842, 1) -end - --- Get the Color of oObject from the color channel specified. --- - oObject: the object from which you are obtaining the color. --- Can be a creature that has color information (i.e. the playable races). --- - nColorChannel: The color channel that you want to get the color value of. --- COLOR_CHANNEL_SKIN --- COLOR_CHANNEL_HAIR --- COLOR_CHANNEL_TATTOO_1 --- COLOR_CHANNEL_TATTOO_2 --- * Returns -1 on error. -function GetColor(oObject, nColorChannel) - StackPushInteger(nColorChannel) - StackPushObject(oObject) - VM_ExecuteCommand(843, 2) - return StackPopInteger() -end - --- Set the color channel of oObject to the color specified. --- - oObject: the object for which you are changing the color. --- Can be a creature that has color information (i.e. the playable races). --- - nColorChannel: The color channel that you want to set the color value of. --- COLOR_CHANNEL_SKIN --- COLOR_CHANNEL_HAIR --- COLOR_CHANNEL_TATTOO_1 --- COLOR_CHANNEL_TATTOO_2 --- - nColorValue: The color you want to set (0-175). -function SetColor(oObject, nColorChannel, nColorValue) - StackPushInteger(nColorValue) - StackPushInteger(nColorChannel) - StackPushObject(oObject) - VM_ExecuteCommand(844, 3) -end - --- Returns Item property Material. You need to specify the Material Type. --- - nMasterialType: The Material Type should be a positive integer between 0 and 77 (see iprp_matcost.2da). --- Note: The Material Type property will only affect the cost of the item if you modify the cost in the iprp_matcost.2da. -function ItemPropertyMaterial(nMaterialType) - StackPushInteger(nMaterialType) - VM_ExecuteCommand(845, 1) - return StackPopItemProperty() -end - --- Returns Item property Quality. You need to specify the Quality. --- - nQuality: The Quality of the item property to create (see iprp_qualcost.2da). --- IP_CONST_QUALITY_* --- Note: The quality property will only affect the cost of the item if you modify the cost in the iprp_qualcost.2da. -function ItemPropertyQuality(nQuality) - StackPushInteger(nQuality) - VM_ExecuteCommand(846, 1) - return StackPopItemProperty() -end - --- Returns a generic Additional Item property. You need to specify the Additional property. --- - nProperty: The item property to create (see iprp_addcost.2da). --- IP_CONST_ADDITIONAL_* --- Note: The additional property only affects the cost of the item if you modify the cost in the iprp_addcost.2da. -function ItemPropertyAdditional(nAdditionalProperty) - StackPushInteger(nAdditionalProperty) - VM_ExecuteCommand(847, 1) - return StackPopItemProperty() -end - --- NEW EE Functions - --- Sets a new tag for oObject. --- Will do nothing for invalid objects or the module object. --- --- Note: Care needs to be taken with this function. --- Changing the tag for creature with waypoints will make them stop walking them. --- Changing waypoint, door or trigger tags will break their area transitions. -function SetTag(oObject, sNewTag) - StackPushString(sNewTag) - StackPushObject(oObject) - VM_ExecuteCommand(848, 2) -end - --- Returns the string tag set for the provided effect. --- - If no tag has been set, returns an empty string. -function GetEffectTag(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(849, 1) - return StackPopString() -end - --- Tags the effect with the provided string. --- - Any other tags in the link will be overwritten. -function TagEffect(eEffect, sNewTag) - StackPushString(sNewTag) - StackPushEffect(eEffect) - VM_ExecuteCommand(850, 2) - return StackPopEffect() -end - --- Returns the caster level of the creature who created the effect. --- - If not created by a creature, returns 0. --- - If created by a spell-like ability, returns 0. -function GetEffectCasterLevel(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(851, 1) - return StackPopInteger() -end - --- Returns the total duration of the effect in seconds. --- - Returns 0 if the duration type of the effect is not DURATION_TYPE_TEMPORARY. -function GetEffectDuration(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(852, 1) - return StackPopInteger() -end - --- Returns the remaining duration of the effect in seconds. --- - Returns 0 if the duration type of the effect is not DURATION_TYPE_TEMPORARY. -function GetEffectDurationRemaining(eEffect) - StackPushEffect(eEffect) - VM_ExecuteCommand(853, 1) - return StackPopInteger() -end - --- Returns the string tag set for the provided item property. --- - If no tag has been set, returns an empty string. -function GetItemPropertyTag(nProperty) - StackPushItemProperty(nProperty) - VM_ExecuteCommand(854, 1) - return StackPopString() -end - --- Tags the item property with the provided string. --- - Any tags currently set on the item property will be overwritten. -function TagItemProperty(nProperty, sNewTag) - StackPushString(sNewTag) - StackPushItemProperty(nProperty) - VM_ExecuteCommand(855, 2) - return StackPopItemProperty() -end - --- Returns the total duration of the item property in seconds. --- - Returns 0 if the duration type of the item property is not DURATION_TYPE_TEMPORARY. -function GetItemPropertyDuration(nProperty) - StackPushItemProperty(nProperty) - VM_ExecuteCommand(856, 1) - return StackPopInteger() -end - --- Returns the remaining duration of the item property in seconds. --- - Returns 0 if the duration type of the item property is not DURATION_TYPE_TEMPORARY. -function GetItemPropertyDurationRemaining(nProperty) - StackPushItemProperty(nProperty) - VM_ExecuteCommand(857, 1) - return StackPopInteger() -end - --- Instances a new area from the given resref, which needs to be a existing module area. --- Will optionally set a new area tag and displayed name. The new area is accessible --- immediately, but initialisation scripts for the area and all contained creatures will only --- run after the current script finishes (so you can clean up objects before returning). --- --- Returns the new area, or OBJECT_INVALID on failure. --- --- Note: When spawning a second instance of a existing area, you will have to manually --- adjust all transitions (doors, triggers) with the relevant script commands, --- or players might end up in the wrong area. -function CreateArea(sResRef, sNewTag, sNewName) -sNewTag = sNewTag or "" -sNewName = sNewName or "" - StackPushString(sNewName) - StackPushString(sNewTag) - StackPushString(sResRef) - VM_ExecuteCommand(858, 3) - return StackPopObject() -end - --- Destroys the given area object and everything in it. --- --- Return values: --- 0: Object not an area or invalid. --- -1: Area contains spawn location and removal would leave module without entrypoint. --- -2: Players in area. --- 1: Area destroyed successfully. -function DestroyArea(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(859, 1) - return StackPopInteger() -end - --- Creates a copy of a existing area, including everything inside of it (except players). --- --- Returns the new area, or OBJECT_INVALID on error. --- --- Note: You will have to manually adjust all transitions (doors, triggers) with the --- relevant script commands, or players might end up in the wrong area. -function CopyArea(oArea) - StackPushObject(oArea) - VM_ExecuteCommand(860, 1) - return StackPopObject() -end - --- Returns the first area in the module. -function GetFirstArea() - VM_ExecuteCommand(861, 0) - return StackPopObject() -end - --- Returns the next area in the module (after GetFirstArea), or OBJECT_INVALID if no more --- areas are loaded. -function GetNextArea() - VM_ExecuteCommand(862, 0) - return StackPopObject() -end - --- Sets the transition target for oTransition. --- --- Notes: --- - oTransition can be any valid game object, except areas. --- - oTarget can be any valid game object with a location, or OBJECT_INVALID (to unlink). --- - Rebinding a transition will NOT change the other end of the transition for example, --- with normal doors you will have to do either end separately. --- - Any valid game object can hold a transition target, but only some are used by the game engine --- (doors and triggers). This might change in the future. You can still set and query them for --- other game objects from nwscript. --- - Transition target objects are cached: The toolset-configured destination tag is --- used for a lookup only once, at first use. Thus, attempting to use SetTag() to change the --- destination for a transition will not work in a predictable fashion. -function SetTransitionTarget(oTransition, oTarget) - StackPushObject(oTarget) - StackPushObject(oTransition) - VM_ExecuteCommand(863, 2) -end - --- Sets whether the provided item should be hidden when equipped. --- - The intended usage of this function is to provide an easy way to hide helmets, but it --- can be used equally for any slot which has creature mesh visibility when equipped, --- e.g.: armour, helm, cloak, left hand, and right hand. --- - nValue should be TRUE or FALSE. -function SetHiddenWhenEquipped(oItem, bValue) - StackPushBoolean(bValue) - StackPushObject(oItem) - VM_ExecuteCommand(864, 2) -end - --- Returns whether the provided item is hidden when equipped. -function GetHiddenWhenEquipped(oItem) - StackPushObject(oItem) - VM_ExecuteCommand(865, 1) - return StackPopBoolean() -end - --- Sets if the given creature has explored tile at x, y of the given area. --- Note that creature needs to be a player- or player-possessed creature. --- --- Keep in mind that tile exploration also controls object visibility in areas --- and the fog of war for interior and underground areas. --- --- Return values: --- -1: Area or creature invalid. --- 0: Tile was not explored before setting newState. --- 1: Tile was explored before setting newState. -function SetTileExplored(creature, area, x, y, bnewState) - StackPushBoolean(bnewState) - StackPushInteger(y) - StackPushInteger(x) - StackPushObject(area) - StackPushObject(creature) - VM_ExecuteCommand(866, 5) - return StackPopInteger() -end - --- Returns whether the given tile at x, y, for the given creature in the stated --- area is visible on the map. --- Note that creature needs to be a player- or player-possessed creature. --- --- Keep in mind that tile exploration also controls object visibility in areas --- and the fog of war for interior and underground areas. --- --- Return values: --- -1: Area or creature invalid. --- 0: Tile is not explored yet. --- 1: Tile is explored. -function GetTileExplored(creature, area, x, y) - StackPushInteger(y) - StackPushInteger(x) - StackPushObject(area) - StackPushObject(creature) - VM_ExecuteCommand(867, 4) - return StackPopInteger() -end - --- Sets the creature to auto-explore the map as it walks around. --- --- Keep in mind that tile exploration also controls object visibility in areas --- and the fog of war for interior and underground areas. --- --- This means that if you turn off auto exploration, it falls to you to manage this --- through SetTileExplored() otherwise, the player will not be able to see anything. --- --- Valid arguments: TRUE and FALSE. --- Does nothing for non-creatures. --- Returns the previous state (or -1 if non-creature). -function SetCreatureExploresMinimap(creature, bnewState) - StackPushBoolean(bnewState) - StackPushObject(creature) - VM_ExecuteCommand(868, 2) - return StackPopInteger() -end - --- Returns TRUE if the creature is set to auto-explore the map as it walks around (on by default). --- Returns FALSE if creature is not actually a creature. -function GetCreatureExploresMinimap(creature) - StackPushObject(creature) - VM_ExecuteCommand(869, 1) - return StackPopBoolean() -end - --- Get the surface material at the given location. (This is --- equivalent to the walkmesh type). --- Returns 0 if the location is invalid or has no surface type. -function GetSurfaceMaterial(at) - StackPushLocation(at) - VM_ExecuteCommand(870, 1) - return StackPopInteger() -end - --- Returns the z-offset at which the walkmesh is at the given location. --- Returns -6.0 for invalid locations. -function GetGroundHeight(at) - StackPushLocation(at) - VM_ExecuteCommand(871, 1) - return StackPopFloat() -end - --- Gets the attack bonus limit. --- - The default value is 20. -function GetAttackBonusLimit() - VM_ExecuteCommand(872, 0) - return StackPopInteger() -end - --- Gets the damage bonus limit. --- - The default value is 100. -function GetDamageBonusLimit() - VM_ExecuteCommand(873, 0) - return StackPopInteger() -end - --- Gets the saving throw bonus limit. --- - The default value is 20. -function GetSavingThrowBonusLimit() - VM_ExecuteCommand(874, 0) - return StackPopInteger() -end - --- Gets the ability bonus limit. --- - The default value is 12. -function GetAbilityBonusLimit() - VM_ExecuteCommand(875, 0) - return StackPopInteger() -end - --- Gets the ability penalty limit. --- - The default value is 30. -function GetAbilityPenaltyLimit() - VM_ExecuteCommand(876, 0) - return StackPopInteger() -end - --- Gets the skill bonus limit. --- - The default value is 50. -function GetSkillBonusLimit() - VM_ExecuteCommand(877, 0) - return StackPopInteger() -end - --- Sets the attack bonus limit. --- - The minimum value is 0. -function SetAttackBonusLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(878, 1) -end - --- Sets the damage bonus limit. --- - The minimum value is 0. -function SetDamageBonusLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(879, 1) -end - --- Sets the saving throw bonus limit. --- - The minimum value is 0. -function SetSavingThrowBonusLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(880, 1) -end - --- Sets the ability bonus limit. --- - The minimum value is 0. -function SetAbilityBonusLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(881, 1) -end - --- Sets the ability penalty limit. --- - The minimum value is 0. -function SetAbilityPenaltyLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(882, 1) -end - --- Sets the skill bonus limit. --- - The minimum value is 0. -function SetSkillBonusLimit(nNewLimit) - StackPushInteger(nNewLimit) - VM_ExecuteCommand(883, 1) -end - --- Get if oPlayer is currently connected over a relay (instead of directly). --- Returns FALSE for any other object, including OBJECT_INVALID. -function GetIsPlayerConnectionRelayed(oPlayer) - StackPushObject(oPlayer) - VM_ExecuteCommand(884, 1) - return StackPopBoolean() -end - --- Returns the event script for the given object and handler. --- Will return "" if unset, the object is invalid, or the object cannot --- have the requested handler. -function GetEventScript(oObject, nHandler) - StackPushInteger(nHandler) - StackPushObject(oObject) - VM_ExecuteCommand(885, 2) - return StackPopString() -end - --- Sets the given event script for the given object and handler. --- Returns 1 on success, 0 on failure. --- Will fail if oObject is invalid or does not have the requested handler. -function SetEventScript(oObject, nHandler, sScript) - StackPushString(sScript) - StackPushInteger(nHandler) - StackPushObject(oObject) - VM_ExecuteCommand(886, 3) - return StackPopBoolean() -end - --- 1.75 - --- Gets a visual transform on the given object. --- - oObject can be any valid Creature, Placeable, Item or Door. --- - nTransform is one of OBJECT_VISUAL_TRANSFORM_* --- Returns the current (or default) value. -function GetObjectVisualTransform(oObject, nTransform) - StackPushInteger(nTransform) - StackPushObject(oObject) - VM_ExecuteCommand(887, 2) - return StackPopFloat() -end - --- Sets a visual transform on the given object. --- - oObject can be any valid Creature, Placeable, Item or Door. --- - nTransform is one of OBJECT_VISUAL_TRANSFORM_* --- - fValue depends on the transformation to apply. --- Returns the old/previous value. -function SetObjectVisualTransform(oObject, nTransform, fValue) - StackPushFloat(fValue) - StackPushInteger(nTransform) - StackPushObject(oObject) - VM_ExecuteCommand(888, 3) - return StackPopFloat() -end - --- Sets an integer material shader uniform override. --- - sMaterial needs to be a material on that object. --- - sParam needs to be a valid shader parameter already defined on the material. -function SetMaterialShaderUniformInt(oObject, sMaterial, sParam, nValue) - StackPushInteger(nValue) - StackPushString(sParam) - StackPushString(sMaterial) - StackPushObject(oObject) - VM_ExecuteCommand(889, 4) -end - --- Sets a vec4 material shader uniform override. --- - sMaterial needs to be a material on that object. --- - sParam needs to be a valid shader parameter already defined on the material. --- - You can specify a single float value to set just a float, instead of a vec4. -function SetMaterialShaderUniformVec4(oObject, sMaterial, sParam, fValue1, fValue2, fValue3, fValue4) - fValue4 = fValue4 or 0.0 - fValue3 = fValue3 or 0.0 - fValue2 = fValue2 or 0.0 - - StackPushFloat(fValue4) - StackPushFloat(fValue3) - StackPushFloat(fValue2) - StackPushFloat(fValue1) - StackPushString(sParam) - StackPushString(sMaterial) - StackPushObject(oObject) - VM_ExecuteCommand(890, 7) -end --- Resets material shader parameters on the given object: --- - Supply a material to only reset shader uniforms for meshes with that material. --- - Supply a parameter to only reset shader uniforms of that name. --- - Supply both to only reset shader uniforms of that name on meshes with that material. -function ResetMaterialShaderUniforms(oObject, sMaterial, sParam) - sParam = sParam or "" - sMaterial = sMaterial or "" - - StackPushString(sParam) - StackPushString(sMaterial) - StackPushObject(oObject) - VM_ExecuteCommand(891, 3) -end - --- reworked functions - --- Delay aActionToDelay by fSeconds. --- * No return value, but if an error occurs, the log file will contain --- "DelayCommand failed.". --- It is suggested that functions which create effects should not be used --- as parameters to delayed actions. Instead, the effect should be created in the --- script and then passed into the action. For example: --- effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL) --- DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget) -function DelayCommand(obj, t, action, ...) - local scmd = AddToken(action, ...) - delaycommand(obj, scmd, t) -end - --- Assign aActionToAssign to oActionSubject. --- * No return value, but if an error occurs, the log file will contain --- "AssignCommand failed." --- (If the object doesn't exist, nothing happens.) -function AssignCommand(obj, action, ...) - local scmd = AddToken(action, ...) - delaycommand(obj, scmd) -end - -function ActionDoCommand(action, ...) - local scmd = AddToken(action, ...) - actiondocommand(OBJECT_SELF, scmd) -end diff --git a/Plugins/Lua/lua/preload.lua b/Plugins/Lua/lua/preload.lua deleted file mode 100644 index e4e8b862aa8..00000000000 --- a/Plugins/Lua/lua/preload.lua +++ /dev/null @@ -1,131 +0,0 @@ ---USER_DIR is already defined by the plugin as the user directory -package.path = USER_DIR.."/lua/?.lua;"..USER_DIR.."/lua/libs/?.lua;"..package.path - -require "compat" -require "nwn" -require "additions" -require "iterators" - --- GLOBALS --- start values for globals -oModule = 0x0 -OBJECT_INVALID = 0x7F000000 -OBJECT_SELF = 0x7F000000 - --- optional function ---function SetObjectSelf(oid) --- OBJECT_SELF = NWObject.new(oid) ---end - ---add you scripts here to load them on module load -local scripts = { - 'systems.chat' - } - --- loading functions -function loadscript(sScript) - -- forcing reloading - package.loaded[sScript] = nil - require(sScript) -end - --- re-load all scripts -function loadscripts() - for _, v in ipairs(scripts) do - loadscript(v) - end -end - - --- EVENT FRAMEWORK -local Events={} - --- Add an event listener for a Module --- Mod its the name of the module adding callback listener --- event is the name of the event, you can add more listeners to the same event but they have to come from different Modules. --- callback is a function accepting an object and an extra optional string parameter, --- priority is a number, lower comes first. -function AddEvent(Mod, event, callback, priority) - priority = priority or 10 - if not Events[event] then Events[event] = {} end - local r = {modl = Mod, callback = callback, priority = priority} - table.insert(Events[event], r) - table.sort(Events[event], function(a,b) return (a.priority < b.priority) end) -end - --- remove all listeners for a Module -function RemoveEvents(Mod) - for k,v in pairs(Events) do - if (type(v) == 'table') then - for i,n in ipairs(v) do if (n['modl'] == Mod) then table.remove(Events[k], i) end end - end - end -end - --- run event callback from inside nwn script -function RunEvent(event, object, extra) - local ev = Events[event] - if (type(ev) ~= 'table') then - return - end - for i,v in ipairs(ev) do - if (type(v['callback']) == 'function') then v['callback'](object, extra) end - end -end - ---Add the event that load scripts on module load -AddEvent('Events', 'mod_load', loadscripts, 1) - - --- TOKEN FRAMEWORK, internal use -local Tokens = {current=0} - --- call token function, for AssignCommand, DelayCommand, ActionDoCommand -function CallToken(sToken) - if not sToken then - return - end - if Tokens[sToken] ~= nil then - local f, a = Tokens[sToken]["f"], Tokens[sToken]["a"] - Tokens[sToken] = nil - f(unpack(a)) - end -end - --- add a token -function AddToken(action, ...) - Tokens.current = Tokens.current + 1 - local scmd = tostring(Tokens.current) - Tokens[scmd] = {f=action, a={...}, t=os.time()} - return scmd -end - --- you can call this function sometimes to remove unused tokens, --- shoud not be necessary --- remove tokens olders than nSeconds, default 600 -function FlushTokens(nSeconds) - nSeconds = nSeconds or 600 - local i, n = 0, os.time() - for k, v in pairs(Tokens) do - if type(v) == "table" then - if n > (Tokens[k]['t'] + nSeconds) then - i = i + 1 - Tokens[k] = nil - end - end - end - return i -end - --- Example of a run script hook table, the basic definition must be present here in the preload --- For how to use look at the RUNSCRIPT_TABLE env documentation --- if you dont set the RUNSCRIPT_TABLE env to 'Scripts' you can delete this line -Scripts = {} - --- better to define the mod_load script hook function here in the preload --- so it's already defined on module load ---[[ -Scripts.mod_on_load = function() - RunEvent('mod_load', GetModule()) -end -]] \ No newline at end of file diff --git a/Plugins/Lua/lua/systems/chat.lua b/Plugins/Lua/lua/systems/chat.lua deleted file mode 100644 index 9a3c737a82c..00000000000 --- a/Plugins/Lua/lua/systems/chat.lua +++ /dev/null @@ -1,28 +0,0 @@ - -local function eval_chat(sString, ...) - local status, msg = pcall(loadstring(string.format(sString, ...))) - if status then - msg = msg or "Command executed" - else - msg = msg or "Error parsing command" - end - return tostring(msg) -end - -local on_chat = function (oPC) - local sMessage = GetPCChatMessage() - if sMessage:sub(1 ,3) == "/c " then - SetPCChatMessage("") - sMessage = sMessage:sub(4) - if sMessage:sub(1, 1) == "=" then - sMessage = "return "..sMessage:sub(2) - end - local sresult = eval_chat("local oPC = %d\n%s", oPC, sMessage) - if sresult then SendMessageToPC(oPC, sresult ) end - end -end - --- we remove events before in case we want to hot reload this script -RemoveEvents('Chat') --- add the event listener, the on_chat function defined before (could be local!!) -AddEvent('Chat', 'mod_chat', on_chat, 1) \ No newline at end of file diff --git a/Plugins/SpellChecker/CMakeLists.txt b/Plugins/SpellChecker/CMakeLists.txt deleted file mode 100644 index eb298105d59..00000000000 --- a/Plugins/SpellChecker/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -find_package(HUNSPELL) -if(HUNSPELL_FOUND) - add_plugin(SpellChecker - "SpellChecker.cpp") - target_include_directories(SpellChecker PRIVATE "${HUNSPELL_INCLUDE_DIR}") - target_link_libraries(SpellChecker "${HUNSPELL_LIBRARIES}") -endif(HUNSPELL_FOUND) diff --git a/Plugins/SpellChecker/NWScript/nwnx_spellcheck.nss b/Plugins/SpellChecker/NWScript/nwnx_spellcheck.nss deleted file mode 100644 index 45a0e65983a..00000000000 --- a/Plugins/SpellChecker/NWScript/nwnx_spellcheck.nss +++ /dev/null @@ -1,39 +0,0 @@ -/// @addtogroup spellchecker SpellChecker -/// @brief Functions related to spellchecking -/// @{ -/// @file nwnx_spellcheck.nss - -const string NWNX_SpellChecker = "NWNX_SpellChecker"; ///< @private - -/// @brief Finds misspells in a string. -/// @param sentence The sentence to check. -/// @return The spelling mistakes in the sentence, comma delimited. Returns blank if no errors or if .so file -/// is improperly installed. -/// @note If it returns an error in every word, even when spelled correctly, the dictionary is not set up correctly. -/// @warning These functions can be performance heavy, do limit how many calls and/or how long of a sentence is passed. -/// Make use of **DelayCommands** and **AssignCommands** -string NWNX_SpellChecker_FindMisspell(string sentence); - -/// @brief Get suggestions on a single word, comma delimited. -/// @param word The string to check for suggestions. -/// @return A comma delimited lists of suggestions for a word. Returns blank if no errors or if .so file is improperly -/// installed. -/// @warning These functions can be performance heavy, do limit how many calls and/or how long of a sentence is passed. -/// Make use of **DelayCommands** and **AssignCommands** -string NWNX_SpellChecker_GetSuggestSpell(string word); - -/// @} - -string NWNX_SpellChecker_FindMisspell(string sentence) -{ - NWNXPushString(sentence); - NWNXCall(NWNX_SpellChecker, "FindMisspell"); - return NWNXPopString(); -} - -string NWNX_SpellChecker_GetSuggestSpell(string word) -{ - NWNXPushString(word); - NWNXCall(NWNX_SpellChecker, "GetSuggestSpell"); - return NWNXPopString(); -} diff --git a/Plugins/SpellChecker/README.md b/Plugins/SpellChecker/README.md deleted file mode 100644 index a738ce971cf..00000000000 --- a/Plugins/SpellChecker/README.md +++ /dev/null @@ -1,41 +0,0 @@ -@page spellchecker Readme -@ingroup spellchecker - -Spell checking through Hunspell 1.4.1 and up - -## How to install? - -Note: More heavily tested on 1.4.1 but works on 1.6. - -Hunspell is installed by default on some systems, if it's not: -`sudo apt-get install libhunspell-1.4-0:i386` - -If you wish to build (which you likely do if you're here) This also includes the necessary files above -`sudo apt-get install libhunspell-dev:i386` - - -Alternatively, you can find hunspell's source here: https://github.com/hunspell/hunspell/releases - -For easily installed dictionary list: - -`apt-cache search hunspell` - -`sudo apt-get install hunspell-en-us for English (United States)` - - -The package requires a 32-bit version of libhunspell.so - -If this doesn't exist with your OS's i386 libraries and you have libhunspell 1.4 or above installed try running: - -Example for Debian: -`sudo ln -s /usr/lib/i386-linux-gnu/libhunspell-1.4.so.0 /usr/lib/i386-linux-gnu/libhunspell.so` - -You can also use the above method to update hunspell to a newer version (may not be supported) - - -## Environment Variables - -``` -NWNX_SPELL_PATH_AFF [optional]: The path to the aff file. By default /usr/share/hunspell/en_US.aff is used. -NWNX_SPELL_PATH_DIC [optional]: The path to the dic file. By default /usr/share/hunspell/en_US.dic is used. -``` diff --git a/Plugins/SpellChecker/SpellChecker.cpp b/Plugins/SpellChecker/SpellChecker.cpp deleted file mode 100644 index 428ad616227..00000000000 --- a/Plugins/SpellChecker/SpellChecker.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include "SpellChecker.hpp" - -#include "API/CAppManager.hpp" -#include "API/Constants.hpp" -#include "API/Globals.hpp" -#include -#include - -#include - -using namespace NWNXLib; -using namespace NWNXLib::API; -using namespace NWNXLib::Services; - -static SpellChecker::SpellChecker* g_plugin; - -NWNX_PLUGIN_ENTRY Plugin* PluginLoad(Services::ProxyServiceList* services) -{ - g_plugin = new SpellChecker::SpellChecker(services); - return g_plugin; -} - - -namespace SpellChecker { - -SpellChecker::SpellChecker(Services::ProxyServiceList* services) - : Plugin(services) -{ - -#define REGISTER(func) \ - ScriptAPI::RegisterEvent(PLUGIN_NAME, #func, \ - [this](ArgumentStack&& args){ return func(std::move(args)); }) - - REGISTER(FindMisspell); - REGISTER(GetSuggestSpell); - SpellChecker::Init(); -#undef REGISTER - -} - -SpellChecker::~SpellChecker() -{ - SpellChecker::dest_e(SpellChecker::created); - dlclose(SpellChecker::handle); -} - -uintptr_t SpellChecker::EstbSymFunction(const std::string& symbol) -{ - uintptr_t var = reinterpret_cast(dlsym(SpellChecker::handle, symbol.c_str())); - - if (!var) - { - throw std::runtime_error("Dynamic link symbol error"); - } - return var; -} -void SpellChecker::Init() -{ - SpellChecker::handle = dlopen("libhunspell.so", RTLD_NOW | RTLD_NODELETE); - - if(!SpellChecker::handle) - { - throw std::runtime_error("Dynamic link handler error"); - } - - SpellChecker::setcreate = reinterpret_cast(EstbSymFunction("Hunspell_create")); - SpellChecker::spell_e = reinterpret_cast(EstbSymFunction("Hunspell_spell")); - - SpellChecker::suggest_e = reinterpret_cast(EstbSymFunction("Hunspell_suggest")); - - SpellChecker::dest_e = reinterpret_cast(EstbSymFunction("Hunspell_destroy")); - - - SpellChecker::free_e = reinterpret_cast(EstbSymFunction( "Hunspell_free_list")); - - SpellChecker::dic = Config::Get("PATH_DIC", "/usr/share/hunspell/en_US.dic"); - SpellChecker::aff = Config::Get("PATH_AFF", "/usr/share/hunspell/en_US.aff"); - - SpellChecker::created = setcreate(SpellChecker::aff.c_str(), SpellChecker::dic.c_str()); - -} -ArgumentStack SpellChecker::FindMisspell(ArgumentStack&& args) -{ - std::string sentence = ScriptAPI::ExtractArgument(args); - - std::string word; - std::vector list; - for(char& c : sentence) { - if(isalpha(c) || c == '.' || c == '-' || c == '\'') - word += c; - else if(c == ' ' && !word.empty()) { - list.push_back(word); - word = ""; - } - } - if(!word.empty()) - list.push_back(word); - std::string output = ""; - int sc; - - for(uint i=0; i(args); - - const char* cword; - int sc; - std::string output = ""; - if(!word.empty()) - { - cword = word.c_str(); - sc = SpellChecker::spell_e(SpellChecker::created, cword); - if(sc == 0) - { - char** wlst; - int ns = SpellChecker::suggest_e(SpellChecker::created, &wlst, cword); - for (int i = 0; i < ns; i++) { - output += (std::string)wlst[i] + ","; - } - - SpellChecker::free_e(SpellChecker::created, &wlst, ns); - } - } - return ScriptAPI::Arguments(output); -} - - -} diff --git a/Plugins/SpellChecker/SpellChecker.hpp b/Plugins/SpellChecker/SpellChecker.hpp deleted file mode 100644 index 0608123fd2b..00000000000 --- a/Plugins/SpellChecker/SpellChecker.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "nwnx.hpp" -#include - - -using ArgumentStack = NWNXLib::ArgumentStack; -using HandleType = void*; - -namespace SpellChecker { - -class SpellChecker : public NWNXLib::Plugin -{ - typedef struct SplHandle SplHandle; - typedef SplHandle* (*Create_Exp)(const char*, const char*); - typedef int (*Spell_Exp)(SplHandle* e, const char*); - typedef int (*Suggest_Exp)(SplHandle* e, char***, const char*); - typedef void (*Des_Exp)(SplHandle* e); - typedef void (*Free_Exp)(SplHandle* e, char***, int); - -public: - SpellChecker(NWNXLib::Services::ProxyServiceList* services); - virtual ~SpellChecker(); - - -private: - ArgumentStack FindMisspell (ArgumentStack&& args); - ArgumentStack GetSuggestSpell (ArgumentStack&& args); - std::string dic; - std::string aff; - void Init(); - uintptr_t EstbSymFunction(const std::string& symbol); - Create_Exp setcreate; - SplHandle* created; - Spell_Exp spell_e; - Suggest_Exp suggest_e; - Des_Exp dest_e; - Free_Exp free_e; - HandleType handle; -}; - -}