diff --git a/_module/ncs/dv_spawner.ncs b/_module/ncs/dv_spawner.ncs index 48bee00b..7fcdd431 100644 Binary files a/_module/ncs/dv_spawner.ncs and b/_module/ncs/dv_spawner.ncs differ diff --git a/_module/ncs/gz_mod_onstart.ncs b/_module/ncs/gz_mod_onstart.ncs index 6ef29464..4cae1a61 100644 Binary files a/_module/ncs/gz_mod_onstart.ncs and b/_module/ncs/gz_mod_onstart.ncs differ diff --git a/_module/ncs/item_droguesword.ncs b/_module/ncs/item_droguesword.ncs index 88f39043..dddbd441 100644 Binary files a/_module/ncs/item_droguesword.ncs and b/_module/ncs/item_droguesword.ncs differ diff --git a/_module/ncs/mhspkspwn.ncs b/_module/ncs/mhspkspwn.ncs index 4d7707d1..d00d9db8 100644 Binary files a/_module/ncs/mhspkspwn.ncs and b/_module/ncs/mhspkspwn.ncs differ diff --git a/_module/ncs/no_spn_clr.ncs b/_module/ncs/no_spn_clr.ncs index 5405b084..e54c0593 100644 Binary files a/_module/ncs/no_spn_clr.ncs and b/_module/ncs/no_spn_clr.ncs differ diff --git a/_module/ncs/no_spn_fiend.ncs b/_module/ncs/no_spn_fiend.ncs index 21533cce..5500a067 100644 Binary files a/_module/ncs/no_spn_fiend.ncs and b/_module/ncs/no_spn_fiend.ncs differ diff --git a/_module/ncs/no_spn_melcast2.ncs b/_module/ncs/no_spn_melcast2.ncs index 8ccb3b5f..3cfece24 100644 Binary files a/_module/ncs/no_spn_melcast2.ncs and b/_module/ncs/no_spn_melcast2.ncs differ diff --git a/_module/ncs/no_spn_melenh.ncs b/_module/ncs/no_spn_melenh.ncs index 7d273eac..d05ef7e3 100644 Binary files a/_module/ncs/no_spn_melenh.ncs and b/_module/ncs/no_spn_melenh.ncs differ diff --git a/_module/ncs/no_spn_rftrcast1.ncs b/_module/ncs/no_spn_rftrcast1.ncs index 432d8dd3..49d6eb34 100644 Binary files a/_module/ncs/no_spn_rftrcast1.ncs and b/_module/ncs/no_spn_rftrcast1.ncs differ diff --git a/_module/ncs/no_spn_rog.ncs b/_module/ncs/no_spn_rog.ncs index f61ca2e6..6599ae53 100644 Binary files a/_module/ncs/no_spn_rog.ncs and b/_module/ncs/no_spn_rog.ncs differ diff --git a/_module/ncs/no_spn_rogcast1.ncs b/_module/ncs/no_spn_rogcast1.ncs index 744cc8a2..5add8ace 100644 Binary files a/_module/ncs/no_spn_rogcast1.ncs and b/_module/ncs/no_spn_rogcast1.ncs differ diff --git a/_module/ncs/no_spn_rogenh.ncs b/_module/ncs/no_spn_rogenh.ncs index cb774385..9f05a933 100644 Binary files a/_module/ncs/no_spn_rogenh.ncs and b/_module/ncs/no_spn_rogenh.ncs differ diff --git a/_module/ncs/no_spn_summ.ncs b/_module/ncs/no_spn_summ.ncs index 79a35d3a..d19c4073 100644 Binary files a/_module/ncs/no_spn_summ.ncs and b/_module/ncs/no_spn_summ.ncs differ diff --git a/_module/ncs/nui_f_storage.ncs b/_module/ncs/nui_f_storage.ncs new file mode 100644 index 00000000..ae01731a Binary files /dev/null and b/_module/ncs/nui_f_storage.ncs differ diff --git a/_module/ncs/nw_c2_default1.ncs b/_module/ncs/nw_c2_default1.ncs index 3cd4c74f..1bd08b3b 100644 Binary files a/_module/ncs/nw_c2_default1.ncs and b/_module/ncs/nw_c2_default1.ncs differ diff --git a/_module/ncs/nw_c2_default2.ncs b/_module/ncs/nw_c2_default2.ncs index 5ad704ec..44b3a040 100644 Binary files a/_module/ncs/nw_c2_default2.ncs and b/_module/ncs/nw_c2_default2.ncs differ diff --git a/_module/ncs/nw_c2_default3.ncs b/_module/ncs/nw_c2_default3.ncs index e5599759..319af57c 100644 Binary files a/_module/ncs/nw_c2_default3.ncs and b/_module/ncs/nw_c2_default3.ncs differ diff --git a/_module/ncs/nw_c2_default4.ncs b/_module/ncs/nw_c2_default4.ncs index 14626ccb..a015c4d1 100644 Binary files a/_module/ncs/nw_c2_default4.ncs and b/_module/ncs/nw_c2_default4.ncs differ diff --git a/_module/ncs/nw_c2_default5.ncs b/_module/ncs/nw_c2_default5.ncs index 9d52b2d1..a91b4267 100644 Binary files a/_module/ncs/nw_c2_default5.ncs and b/_module/ncs/nw_c2_default5.ncs differ diff --git a/_module/ncs/nw_c2_default6.ncs b/_module/ncs/nw_c2_default6.ncs index 6ec1b103..d8a273a5 100644 Binary files a/_module/ncs/nw_c2_default6.ncs and b/_module/ncs/nw_c2_default6.ncs differ diff --git a/_module/ncs/nw_c2_default7.ncs b/_module/ncs/nw_c2_default7.ncs deleted file mode 100644 index e4858a01..00000000 Binary files a/_module/ncs/nw_c2_default7.ncs and /dev/null differ diff --git a/_module/ncs/nw_c2_default8.ncs b/_module/ncs/nw_c2_default8.ncs index 80361339..f120bd88 100644 Binary files a/_module/ncs/nw_c2_default8.ncs and b/_module/ncs/nw_c2_default8.ncs differ diff --git a/_module/ncs/nw_c2_defaultb.ncs b/_module/ncs/nw_c2_defaultb.ncs index 4ac42af4..8857688f 100644 Binary files a/_module/ncs/nw_c2_defaultb.ncs and b/_module/ncs/nw_c2_defaultb.ncs differ diff --git a/_module/ncs/nw_c2_defaulte.ncs b/_module/ncs/nw_c2_defaulte.ncs index 953e07bd..ce10b922 100644 Binary files a/_module/ncs/nw_c2_defaulte.ncs and b/_module/ncs/nw_c2_defaulte.ncs differ diff --git a/_module/ncs/nw_o2_boss.ncs b/_module/ncs/nw_o2_boss.ncs index ff528bfd..586fa995 100644 Binary files a/_module/ncs/nw_o2_boss.ncs and b/_module/ncs/nw_o2_boss.ncs differ diff --git a/_module/ncs/scarespawn.ncs b/_module/ncs/scarespawn.ncs index 0d260ae6..ca2abe27 100644 Binary files a/_module/ncs/scarespawn.ncs and b/_module/ncs/scarespawn.ncs differ diff --git a/_module/ncs/thenspawn1.ncs b/_module/ncs/thenspawn1.ncs index 489a8680..b2d77458 100644 Binary files a/_module/ncs/thenspawn1.ncs and b/_module/ncs/thenspawn1.ncs differ diff --git a/_module/ncs/thenspawn2.ncs b/_module/ncs/thenspawn2.ncs index 5ec081bb..eeb79094 100644 Binary files a/_module/ncs/thenspawn2.ncs and b/_module/ncs/thenspawn2.ncs differ diff --git a/_module/ncs/thenspawn3.ncs b/_module/ncs/thenspawn3.ncs index 122465a3..ffb63895 100644 Binary files a/_module/ncs/thenspawn3.ncs and b/_module/ncs/thenspawn3.ncs differ diff --git a/_module/ncs/thenspawn4.ncs b/_module/ncs/thenspawn4.ncs index d232d142..99b57284 100644 Binary files a/_module/ncs/thenspawn4.ncs and b/_module/ncs/thenspawn4.ncs differ diff --git a/_module/ncs/towncrierspawn.ncs b/_module/ncs/towncrierspawn.ncs index 00887f29..9434007c 100644 Binary files a/_module/ncs/towncrierspawn.ncs and b/_module/ncs/towncrierspawn.ncs differ diff --git a/_module/ncs/winkiecapt2os.ncs b/_module/ncs/winkiecapt2os.ncs index 07f8bc3a..7b0ab991 100644 Binary files a/_module/ncs/winkiecapt2os.ncs and b/_module/ncs/winkiecapt2os.ncs differ diff --git a/_module/ncs/winkiecapt3os.ncs b/_module/ncs/winkiecapt3os.ncs index c775639d..32f788cf 100644 Binary files a/_module/ncs/winkiecapt3os.ncs and b/_module/ncs/winkiecapt3os.ncs differ diff --git a/_module/ncs/witch1os.ncs b/_module/ncs/witch1os.ncs index 56e95e62..e35ddc4d 100644 Binary files a/_module/ncs/witch1os.ncs and b/_module/ncs/witch1os.ncs differ diff --git a/_module/ncs/witch7os.ncs b/_module/ncs/witch7os.ncs index 6f1f3487..32eaa9a7 100644 Binary files a/_module/ncs/witch7os.ncs and b/_module/ncs/witch7os.ncs differ diff --git a/_module/ncs/woa_mod_onnui.ncs b/_module/ncs/woa_mod_onnui.ncs index 2375c91a..1a6f941c 100644 Binary files a/_module/ncs/woa_mod_onnui.ncs and b/_module/ncs/woa_mod_onnui.ncs differ diff --git a/_module/ncs/wp_speakspawn.ncs b/_module/ncs/wp_speakspawn.ncs index 3487810a..5314119a 100644 Binary files a/_module/ncs/wp_speakspawn.ncs and b/_module/ncs/wp_speakspawn.ncs differ diff --git a/_module/nss/nui_i_main.nss b/_module/nss/nui_i_main.nss index 2b47a6aa..f28ab6b9 100644 --- a/_module/nss/nui_i_main.nss +++ b/_module/nss/nui_i_main.nss @@ -7,12 +7,13 @@ #include "util_i_csvlists" #include "util_i_color" #include "nui_c_config" +#include "nw_inc_nui" // ----------------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------------- -const string NUI_VERSION = "0.4.7"; +const string NUI_VERSION = "0.5.0"; const string NUI_DATABASE = "nui_form_data"; const int NUI_ORIENTATION_ROW = 0; @@ -28,42 +29,23 @@ const int NUI_DRAW_MOUSELEFT = 3; const int NUI_DRAW_MOUSERIGHT = 4; const int NUI_DRAW_MOUSEMIDDLE = 5; -const int NUI_SCROLLBARS_NONE = 0; -const int NUI_SCROLLBARS_X = 1; -const int NUI_SCROLLBARS_Y = 2; -const int NUI_SCROLLBARS_BOTH = 3; -const int NUI_SCROLLBARS_AUTO = 4; - const int NUI_CHART_LINE = 0; const int NUI_CHART_BAR = 1; -const int NUI_ASPECT_FIT = 0; -const int NUI_ASPECT_FILL = 1; -const int NUI_ASPECT_FIT100 = 2; -const int NUI_ASPECT_EXACT = 3; -const int NUI_ASPECT_EXACTSCALED = 4; -const int NUI_ASPECT_STRETCH = 5; - -const int NUI_HALIGN_CENTER = 0; -const int NUI_HALIGN_LEFT = 1; -const int NUI_HALIGN_RIGHT = 2; - -const int NUI_VALIGN_MIDDLE = 0; -const int NUI_VALIGN_TOP = 1; -const int NUI_VALIGN_BOTTOM = 2; - const string NUI_DEFINE = "DefineForm"; const string NUI_BIND = "BindForm"; const string NUI_EVENT_NUI = "HandleNUIEvents"; const string NUI_EVENT_MOD = "HandleModuleEvents"; const string NUI_OBJECT = "NUI_OBJECT"; +const string NUI_FUNCTION = "NUI_FUNCTION"; +const string NUI_ARGS = "NUI_ARGS"; const int NUI_FI_EVENT_UPDATE_FORMS = 100001; const int NUI_FI_EVENT_UPDATE_EVENTS = 100002; -json jTrue = JsonBool(TRUE); -json jFalse = JsonBool(FALSE); +json jTrue = JSON_TRUE; +json jFalse = JSON_FALSE; const int NUI_USE_CAMPAIGN_DATABASE = FALSE; const string NUI_FORMFILE_PREFIX = "nui_f_"; @@ -976,8 +958,10 @@ void NUI_DefineForms(string sFormfile = ""); /// @param oPC Client to display the form on. /// @param sFormID ID of the form to display. /// @param sProfile Optional form profile. +/// @param bSelfManage If TRUE, call the formfile directly instead of the +/// game's NUI event handler. /// @returns Form's token as assigned by the game engine. -int NUI_DisplayForm(object oPC, string sFormID, string sProfile = "default"); +int NUI_DisplayForm(object oPC, string sFormID, string sProfile = "", int bSelfManage = FALSE); /// @brief Close an open form. /// @param oPC Client on which to close the form. @@ -1301,7 +1285,7 @@ int nui_InitializeDatabase() "timestamp INTEGER);"; SqlStep(nui_PrepareQuery(sQuery)); - sQuery = "SELECT * FROM nui_forms;"; + sQuery = "SELECT COUNT(*) FROM nui_forms;"; return SqlStep(nui_PrepareQuery(sQuery)); } @@ -1332,9 +1316,9 @@ void nui_CopyDefinitions(string sTable = "nui_forms") string sQuery = "WITH forms AS (SELECT json_object('form', form, 'definition', definition) AS f " + "FROM " + sTable + ") SELECT json_group_array(json(f)) FROM forms;"; sqlquery sql = nui_PrepareQuery(sQuery, TRUE); - json jForms = SqlStep(sql) ? SqlGetJson(sql, 0) : JsonNull(); + json jForms = SqlStep(sql) ? SqlGetJson(sql, 0) : JSON_NULL; - if (jForms == JsonNull()) + if (jForms == JSON_NULL) return; sQuery = "INSERT OR REPLACE INTO " + sTable + " (form, definition) " + @@ -1554,7 +1538,7 @@ void NUI_SaveBindState(object oPC, string sFormID) void NUI_RestoreBindState(object oPC, string sFormID) { json jState = GetLocalJson(oPC, "NUI_STATE:" + sFormID); - if (jState == JsonNull()) + if (jState == JSON_NULL) return; json jKeys = JsonObjectKeys(jState); @@ -1732,6 +1716,11 @@ void NUI_CloseRow() {nui_DecrementPath();} void NUI_CloseLayout() {nui_DecrementPath();} +void NUI_AddLayout(json jLayout) +{ + nui_SetProperty("root", JsonDump(jLayout)); +} + // Controls -------------------------------------------------------------------- void NUI_AddCheckbox(string sID = "") {nui_CreateControl("check", sID);} @@ -2269,7 +2258,7 @@ json nui_GetForm(string sFormID, int bForceModule = FALSE) sqlquery sql = nui_PrepareQuery("SELECT definition FROM nui_forms WHERE form = @form;", bForceModule); SqlBindString(sql, "@form", sFormID); - return SqlStep(sql) ? SqlGetJson(sql, 0) : JsonNull(); + return SqlStep(sql) ? SqlGetJson(sql, 0) : JSON_NULL; } string nui_GetFormsByPrefix(string sForms, string sPrefix, int nResType) @@ -2294,8 +2283,8 @@ int nui_ExecuteFunction(string sFile, string sFunction, object oTarget = OBJECT_ if (ResManFindPrefix(sFile, RESTYPE_NCS) == sFile) { - SetScriptParam("NUI_FUNCTION", sFunction); - SetScriptParam("NUI_ARGS", sArguments); + SetScriptParam(NUI_FUNCTION, sFunction); + SetScriptParam(NUI_ARGS, sArguments); ExecuteScript(sFile, oTarget); return TRUE; } @@ -2314,7 +2303,7 @@ json nui_GetWatchedBinds(string sFormID) "nui_forms.definition, path || '.watch') = true AND form = @form);"; sqlquery sql = nui_PrepareQuery(sQuery); SqlBindString(sql, "@form", sFormID); - return SqlStep(sql) ? SqlGetJson(sql, 0) : JsonArray(); + return SqlStep(sql) ? SqlGetJson(sql, 0) : JSON_ARRAY; } json NUI_GetOrphanBinds(string sFormID) @@ -2325,7 +2314,7 @@ json NUI_GetOrphanBinds(string sFormID) "'$.profiles.default') AS value WHERE form = @form));"; sqlquery sql = nui_PrepareQuery(sQuery); SqlBindString(sql, "@form", sFormID); - return SqlStep(sql) ? SqlGetJson(sql, 0) : JsonArray(); + return SqlStep(sql) ? SqlGetJson(sql, 0) : JSON_ARRAY; } // ----------------------------------------------------------------------------- @@ -2377,7 +2366,7 @@ json nui_GetProfileBinds(string sFormID, string sProfile = "") sqlquery sql = nui_PrepareQuery(sQuery); SqlBindString(sql, "@form", sFormID); SqlBindString(sql, "@profile", sProfile); - return SqlStep(sql) ? SqlGetJson(sql, 0) : JsonObject(); + return SqlStep(sql) ? SqlGetJson(sql, 0) : JSON_OBJECT; } /// @private Called during form opening, sets the initial values for all default binds. @@ -2426,7 +2415,7 @@ void NUI_DefineForms(string sFormfile = "") int n; for (n; n < CountList(NUI_FORMFILE_PREFIX); n++) { string sFormfiles = nui_GetForms(GetListItem(NUI_FORMFILE_PREFIX, n)); - if (sFormfiles == "") return; + if (sFormfiles == "") break; int f; for (f; f < CountList(sFormfiles); f++) { @@ -2443,14 +2432,16 @@ void NUI_DefineForms(string sFormfile = "") nui_CommitTransaction(); } -int NUI_DisplayForm(object oPC, string sFormID, string sProfile = "default") +int NUI_DisplayForm(object oPC, string sFormID, string sProfile = "", int bSelfManage = FALSE) { json jForm = nui_GetForm(sFormID); - if (jForm != JsonNull()) + if (jForm != JSON_NULL) { - int nToken = NuiCreate(oPC, jForm, sFormID); - json jData = JsonObjectSet(JsonObject(), "profile", JsonString(sProfile)); - jData = JsonObjectSet(jData, "formfile", JsonString(nui_GetDefinitionValue(sFormID, "formfile"))); + string sFormfile = nui_GetDefinitionValue(sFormID, "formfile"); + + int nToken = NuiCreate(oPC, jForm, sFormID, (bSelfManage ? sFormfile : "")); + json jData = JsonObjectSet(JSON_OBJECT, "profile", JsonString(sProfile == "" ? "default" : sProfile)); + jData = JsonObjectSet(jData, "formfile", JsonString(sFormfile)); NuiSetUserData(oPC, NuiFindWindow(oPC, sFormID), jData); return nToken; @@ -2490,7 +2481,7 @@ void NUI_CreateProfile(string sProfile, string sBase = "") void NUI_SetProfileBind(string sBind, string sJson) { - if (sBind == "" || sJson == "" || JsonParse(sJson) == JsonNull()) + if (sBind == "" || sJson == "" || JsonParse(sJson) == JSON_NULL) return; nui_SetProfileBind(sBind, sJson); @@ -2503,7 +2494,7 @@ void NUI_SetProfileBindJ(string sBind, json jValue) void NUI_SetProfileBinds(string sBinds, string sJson) { - if (sBinds == "" || sJson == "" || JsonParse(sJson) == JsonNull()) + if (sBinds == "" || sJson == "" || JsonParse(sJson) == JSON_NULL) return; int n; for (n; n < CountList(sBinds); n++) diff --git a/_module/nss/nw_c2_default1.nss b/_module/nss/nw_c2_default1.nss index 6d717da3..51e5a857 100644 --- a/_module/nss/nw_c2_default1.nss +++ b/_module/nss/nw_c2_default1.nss @@ -11,7 +11,8 @@ void main() // If not runnning normal or better AI then exit for performance reasons if (GetAILevel(OBJECT_SELF) == AI_LEVEL_VERY_LOW) return; object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_hb", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_hb", oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default1", "16", GetName(oCreature) + " Heartbeat." + " OnSpawn: " + IntToString(GetLocalInt(oCreature, AI_ONSPAWN_EVENT))); // We run our OnSpawn in the heartbeat so the creator can use the original diff --git a/_module/nss/nw_c2_default2.nss b/_module/nss/nw_c2_default2.nss index fa6f5f82..0afa64e4 100644 --- a/_module/nss/nw_c2_default2.nss +++ b/_module/nss/nw_c2_default2.nss @@ -16,7 +16,8 @@ void main() // * if not runnning normal or better AI then exit for performance reasons //if (GetAILevel() == AI_LEVEL_VERY_LOW) return; object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_percep", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_percep", oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default2", "19", "AI_ONSPAWN_EVENT: " + IntToString(GetLocalInt(oCreature, AI_ONSPAWN_EVENT))); if(!GetLocalInt(oCreature, AI_ONSPAWN_EVENT)) return; if(GetLastPerceptionSeen()) diff --git a/_module/nss/nw_c2_default3.nss b/_module/nss/nw_c2_default3.nss index 6e364125..bbd8a89d 100644 --- a/_module/nss/nw_c2_default3.nss +++ b/_module/nss/nw_c2_default3.nss @@ -17,7 +17,8 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_combat", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_combat", oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default3", "20", GetName(oCreature) + " ends combat round." + " Current action: " + IntToString(GetCurrentAction(oCreature))); if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT)) diff --git a/_module/nss/nw_c2_default4.nss b/_module/nss/nw_c2_default4.nss index 38603f10..820f71b0 100644 --- a/_module/nss/nw_c2_default4.nss +++ b/_module/nss/nw_c2_default4.nss @@ -12,7 +12,8 @@ void ai_MonsterCommands(object oCreature, object oSpeaker, int nMatch); void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_conv", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_conv", oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default4", "15", GetName(oCreature) + " listens " + IntToString(GetListenPatternNumber()) + " to " + GetName(GetLastSpeaker()) + "." + " AI_AM_I_SEARCHING: " + IntToString(GetLocalInt(oCreature, AI_AM_I_SEARCHING))); diff --git a/_module/nss/nw_c2_default5.nss b/_module/nss/nw_c2_default5.nss index c2e663dd..4d22e9fe 100644 --- a/_module/nss/nw_c2_default5.nss +++ b/_module/nss/nw_c2_default5.nss @@ -10,7 +10,8 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_physatt", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_physatt", oCreature); object oAttacker = GetLastAttacker(oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default5", "14", GetName(oCreature) + " was attacked by " + GetName(oAttacker) + "."); diff --git a/_module/nss/nw_c2_default6.nss b/_module/nss/nw_c2_default6.nss index 60aef49b..9f52d093 100644 --- a/_module/nss/nw_c2_default6.nss +++ b/_module/nss/nw_c2_default6.nss @@ -13,7 +13,9 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_damaged", oCreature); + //:: Disabled for World of Amon + //:: ExecuteScript("prc_npc_damaged", oCreature); + // Send the user-defined event signal if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT)) { diff --git a/_module/nss/nw_c2_default7.nss b/_module/nss/nw_c2_default7.nss deleted file mode 100644 index 3ec7191c..00000000 --- a/_module/nss/nw_c2_default7.nss +++ /dev/null @@ -1,113 +0,0 @@ -//::////////////////////////////////////////////////// -//:: NW_C2_DEFAULT7 -/* - Default OnDeath event handler for NPCs. - - Adjusts killer's alignment if appropriate and - alerts allies to our death. - */ -//::////////////////////////////////////////////////// -//:: Copyright (c) 2002 Floodgate Entertainment -//:: Created By: Naomi Novik -//:: Created On: 12/22/2002 -//::////////////////////////////////////////////////// -//::////////////////////////////////////////////////// -//:: Modified By: Deva Winblood -//:: Modified On: April 1st, 2008 -//:: Added Support for Dying Wile Mounted -//::///////////////////////////////////////////////// - -const string sHenchSummonedFamiliar = "HenchSummonedFamiliar"; -const string sHenchSummonedAniComp = "HenchSummonedAniComp"; -const string sHenchLastHeardOrSeen = "LastSeenOrHeard"; - -#include "x2_inc_compon" -#include "x0_i0_spawncond" - -// Clears the last unheard, unseen enemy location -void ClearEnemyLocation(); - -void main() -{ - object oKiller = GetLastKiller(); - object oMaster = GetMaster(); - - int nAlign = GetAlignmentGoodEvil(OBJECT_SELF); - - if(GetLocalInt(GetModule(), "X3_ENABLE_MOUNT_DB") && GetIsObjectValid(oMaster)) - SetLocalInt(oMaster, "bX3_STORE_MOUNT_INFO", TRUE); - - // If we're a good/neutral commoner, - // adjust the killer's alignment evil - if(GetLevelByClass(CLASS_TYPE_COMMONER) - && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL)) - { - AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5); - } - -//Start Hench AI - if(GetLocalInt(OBJECT_SELF, "GaveHealing")) - { - // Pausanias: destroy potions of healing - object oItem = GetFirstItemInInventory(); - while(GetIsObjectValid(oItem)) - { - if(GetTag(oItem) == "NW_IT_MPOTION003") - DestroyObject(oItem); - oItem = GetNextItemInInventory(); - } - } - - if(GetLocalInt(OBJECT_SELF, sHenchSummonedFamiliar)) - { - object oFam = GetLocalObject(OBJECT_SELF, sHenchSummonedFamiliar); - if(GetIsObjectValid(oFam)) - { - //if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy familiar"); - DestroyObject(oFam, 0.1); - ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oFam)); - } - } - if(GetLocalInt(OBJECT_SELF, sHenchSummonedAniComp)) - { - object oAni = GetLocalObject(OBJECT_SELF, sHenchSummonedAniComp); - if(GetIsObjectValid(oAni)) - { - //if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy ani comp"); - DestroyObject(oAni, 0.1); - ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oAni)); - } - } - - ClearEnemyLocation(); -//End Hench AI - - // Call to allies to let them know we're dead - SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK); - - //Shout Attack my target, only works with the On Spawn In setup - SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); - - // NOTE: the OnDeath user-defined event does not - // trigger reliably and should probably be removed - if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT)) - SignalEvent(OBJECT_SELF, EventUserDefined(1007)); - - craft_drop_items(oKiller); - - ExecuteScript("prc_npc_death", OBJECT_SELF); - ExecuteScript("prc_pwondeath", OBJECT_SELF); -} - -void ClearEnemyLocation() -{ - DeleteLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen); - DeleteLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen); - - object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); - if (GetIsObjectValid(oInvisTarget)) - { - DestroyObject(oInvisTarget); - DeleteLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); - } -} \ No newline at end of file diff --git a/_module/nss/nw_c2_default8.nss b/_module/nss/nw_c2_default8.nss index ef07c733..573f2caa 100644 --- a/_module/nss/nw_c2_default8.nss +++ b/_module/nss/nw_c2_default8.nss @@ -11,7 +11,8 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_disturb", oCreature); + //:: Disabled for World of Amon + //:: ExecuteScript("prc_npc_disturb", oCreature); if(AI_DEBUG) ai_Debug("nw_c2_default8", "13", GetName(oCreature) + " is been disturbed!"); // We do nothing at the moment... lets not mess up our factions ok? // This should be defined by the server admins and is commented out. diff --git a/_module/nss/nw_c2_defaultb.nss b/_module/nss/nw_c2_defaultb.nss index 050a3ea2..4aa9e86f 100644 --- a/_module/nss/nw_c2_defaultb.nss +++ b/_module/nss/nw_c2_defaultb.nss @@ -10,7 +10,8 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_spellat", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_spellat", oCreature); object oCaster = GetLastSpellCaster(); SetLocalObject(oCaster, AI_ATTACKED_SPELL, oCreature); if(ai_Disabled(oCreature)) return; diff --git a/_module/nss/nw_c2_defaulte.nss b/_module/nss/nw_c2_defaulte.nss index 98e43646..d5e5dc4b 100644 --- a/_module/nss/nw_c2_defaulte.nss +++ b/_module/nss/nw_c2_defaulte.nss @@ -9,7 +9,8 @@ void main() { object oCreature = OBJECT_SELF; - ExecuteScript("prc_npc_blocked", oCreature); + //:: Disabled for World of Amon + //ExecuteScript("prc_npc_blocked", oCreature); // This actually gets either a Creature or Door that is blocking OBJECT_SELF. object oObject = GetBlockingDoor(); if(AI_DEBUG) ai_Debug("nw_c2_defaulte", "14", GetName(oCreature) + " is being blocked by " + GetName(oObject));