diff --git a/_module/are/valeford.are.json b/_module/are/valeford.are.json index 0e625d5b..519a1e7d 100644 --- a/_module/are/valeford.are.json +++ b/_module/are/valeford.are.json @@ -11173,7 +11173,7 @@ }, "Version": { "type": "dword", - "value": 89 + "value": 91 }, "Width": { "type": "int", diff --git a/_module/are/valefordtemple.are.json b/_module/are/valefordtemple.are.json index 70c54ff6..d0314011 100644 --- a/_module/are/valefordtemple.are.json +++ b/_module/are/valefordtemple.are.json @@ -1713,7 +1713,7 @@ }, "Version": { "type": "dword", - "value": 17 + "value": 19 }, "Width": { "type": "int", diff --git a/_module/git/valeford.git.json b/_module/git/valeford.git.json index 51dc3529..a24bd791 100644 --- a/_module/git/valeford.git.json +++ b/_module/git/valeford.git.json @@ -90136,7 +90136,7 @@ }, "XPosition": { "type": "float", - "value": 145.43106079101562 + "value": 145.7196044921875 }, "YOrientation": { "type": "float", @@ -90144,7 +90144,7 @@ }, "YPosition": { "type": "float", - "value": 108.6772689819336 + "value": 107.3787612915039 }, "ZPosition": { "type": "float", @@ -92058,7 +92058,7 @@ }, "XPosition": { "type": "float", - "value": 142.741943359375 + "value": 139.95135498046875 }, "YOrientation": { "type": "float", @@ -92066,11 +92066,11 @@ }, "YPosition": { "type": "float", - "value": 111.9538345336914 + "value": 111.28477478027344 }, "ZPosition": { "type": "float", - "value": 0.7951282262802124 + "value": 0.19976425170898438 } }, { diff --git a/_module/ifo/module.ifo.json b/_module/ifo/module.ifo.json index 50355418..a24c4474 100644 --- a/_module/ifo/module.ifo.json +++ b/_module/ifo/module.ifo.json @@ -1264,6 +1264,36 @@ "type": "int", "value": 0 } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_WEREWOLF_HYBRID_USE_SHIFTER_SHAPECHANGE" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_WILDSHAPE_ALLOWS_ARMS_SLOT" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } } ] } diff --git a/_module/ncs/0e_nui.ncs b/_module/ncs/0e_nui.ncs index efebaf45..ff7475f7 100644 Binary files a/_module/ncs/0e_nui.ncs and b/_module/ncs/0e_nui.ncs differ diff --git a/_module/ncs/0e_onclientload.ncs b/_module/ncs/0e_onclientload.ncs index 512c0696..43313252 100644 Binary files a/_module/ncs/0e_onclientload.ncs and b/_module/ncs/0e_onclientload.ncs differ diff --git a/_module/ncs/door_click.ncs b/_module/ncs/door_click.ncs index e1b14cd5..952e5e31 100644 Binary files a/_module/ncs/door_click.ncs and b/_module/ncs/door_click.ncs differ diff --git a/_module/ncs/hif_modongui.ncs b/_module/ncs/hif_modongui.ncs new file mode 100644 index 00000000..5aeb6cad Binary files /dev/null and b/_module/ncs/hif_modongui.ncs differ diff --git a/_module/ncs/mod_gui.ncs b/_module/ncs/mod_gui.ncs index 08978ffa..04d0acfd 100644 Binary files a/_module/ncs/mod_gui.ncs and b/_module/ncs/mod_gui.ncs differ diff --git a/_module/ncs/ms_name_inc.ncs b/_module/ncs/ms_name_inc.ncs deleted file mode 100644 index ecb1c72d..00000000 Binary files a/_module/ncs/ms_name_inc.ncs and /dev/null differ diff --git a/_module/ncs/nw_c2_default1.ncs b/_module/ncs/nw_c2_default1.ncs index b6db1e8a..82360ddf 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_default9.ncs b/_module/ncs/nw_c2_default9.ncs new file mode 100644 index 00000000..dee36083 Binary files /dev/null and b/_module/ncs/nw_c2_default9.ncs differ diff --git a/_module/ncs/nw_ch_ac1.ncs b/_module/ncs/nw_ch_ac1.ncs index 0fed4263..efdc9ca2 100644 Binary files a/_module/ncs/nw_ch_ac1.ncs and b/_module/ncs/nw_ch_ac1.ncs differ diff --git a/_module/ncs/nw_o2_generalmed.ncs b/_module/ncs/nw_o2_generalmed.ncs index 74c9f3ef..a779149c 100644 Binary files a/_module/ncs/nw_o2_generalmed.ncs and b/_module/ncs/nw_o2_generalmed.ncs differ diff --git a/_module/ncs/prc_pw_petrific.ncs b/_module/ncs/prc_pw_petrific.ncs index 5610d0bb..7e758d29 100644 Binary files a/_module/ncs/prc_pw_petrific.ncs and b/_module/ncs/prc_pw_petrific.ncs differ diff --git a/_module/ncs/prc_pwonspawn.ncs b/_module/ncs/prc_pwonspawn.ncs index 227f6a62..ec736105 100644 Binary files a/_module/ncs/prc_pwonspawn.ncs and b/_module/ncs/prc_pwonspawn.ncs differ diff --git a/_module/ncs/ss_treasure_spwn.ncs b/_module/ncs/ss_treasure_spwn.ncs index 626b3ad2..be200516 100644 Binary files a/_module/ncs/ss_treasure_spwn.ncs and b/_module/ncs/ss_treasure_spwn.ncs differ diff --git a/_module/nss/0e_gui_events.nss b/_module/nss/0e_gui_events.nss index 401c8254..e24e9c2b 100644 --- a/_module/nss/0e_gui_events.nss +++ b/_module/nss/0e_gui_events.nss @@ -16,7 +16,7 @@ void main() //object oEventObject = GetLastGuiEventObject(); switch(nEventType) { - case GUIEVENT_EFFECTICON_CLICK: + case GUIEVENT_EFFECTICON_CLICK: { if(ai_GetMagicMode(oPC, AI_MAGIC_EFFECT_ICON_REPORT)) { diff --git a/_module/nss/0i_gui_events.nss b/_module/nss/0i_gui_events.nss index bc90d25f..fde6e846 100644 --- a/_module/nss/0i_gui_events.nss +++ b/_module/nss/0i_gui_events.nss @@ -14,6 +14,8 @@ #include "0i_nui" void ai_SetupModuleGUIEvents() { + return; //:: Disabled + object oModule = GetModule(); string sModuleGUIEvents = GetEventScript(oModule, EVENT_SCRIPT_MODULE_ON_PLAYER_GUIEVENT); if(sModuleGUIEvents != "" || sModuleGUIEvents != "0e_gui_events") diff --git a/_module/nss/door_click.nss b/_module/nss/door_click.nss index 02e29fe6..c523a9f4 100644 --- a/_module/nss/door_click.nss +++ b/_module/nss/door_click.nss @@ -1,97 +1,151 @@ -void main() -{ - object oPC = GetEnteringObject(); - - if (GetIsPC(oPC) != TRUE) return; - -//:: Get own ID number - string sSelf = GetTag(OBJECT_SELF); - int iLength = GetStringLength(sSelf); - string sID; - int iChosen = 0; - - switch (iLength) - { - case 6: - sID = GetStringRight(sSelf,1); - break; - - case 7: - sID = GetStringRight(sSelf,2); - break; - - case 8: - sID = GetStringRight(sSelf,3); - break; - } - - //SendMessageToPC(oPC,"my area ID is "+sID); - - int iMatch = GetLocalInt(OBJECT_SELF,"match"); //:: Current door's match - string sEntryDir = GetStringLeft(GetTag(OBJECT_SELF),1); //:: Current door's direction - string sExitDir; - -//:: This inverts the directions - if (sEntryDir == "n") - sExitDir="s"; - - else if (sEntryDir == "s") - sExitDir="n"; - - else if (sEntryDir == "w") - sExitDir="e"; - - else if (sEntryDir == "e") - sExitDir="w"; - - //SendMessageToPC(oPC,"i should be on the "+sExitDir+" side of the map"); - -//:: Now determine if there is already a match - if (iMatch != 0) //:: Door already has a match, teleport PC - { - //SendMessageToPC(oPC,"door has a match"); - string sTag = "area4_"+IntToString(iMatch); - object oArea = GetObjectByTag(sTag); - object oTarget = GetObjectByTag("wp4_"+IntToString(iMatch)+sExitDir); - location lTarget = GetLocation(oTarget); - float fFace = GetFacing(oPC); - AssignCommand(oPC,ActionJumpToLocation(lTarget)); - AssignCommand(oPC,SetFacing(fFace)); - iChosen = 1; - return; - } - - int iRand = Random(41)+1; //:: Random # for area selection - string sTag = "area4_"+IntToString(iRand); - object oArea = GetObjectByTag(sTag); - int iUsed = GetLocalInt(oArea,"ispop"); - float fFace = GetFacing(oPC); - - - - while (iChosen == 0)//selecting new areas - { - iRand = Random(41)+1; - sTag = "area4_"+IntToString(iRand); - oArea = GetObjectByTag(sTag); - iUsed = GetLocalInt(oArea,"ispop"); - - if (iUsed == 0) - { - // SendMessageToPC(oPC,"unused area chosen"); - object oTarget = GetObjectByTag("wp4_"+IntToString(iRand)+sExitDir); - location lTarget = GetLocation(oTarget); - AssignCommand(oPC,ActionJumpToLocation(lTarget)); - AssignCommand(oPC,SetFacing(fFace)); - SetLocalInt(oArea,"ispop",1); - object oDoor = GetObjectByTag(sExitDir+"door"+IntToString(iRand)); - SetLocalInt(OBJECT_SELF,"match",iRand); - SetLocalInt(oDoor,"match",StringToInt(sID)); - iChosen = 1; - break; - } - - //choose new area and try again until successful or TMI error - } - +void main() +{ + //object oPC = GetEnteringObject(); + object oPC = GetClickingObject(); + if (GetIsPC(oPC) != TRUE) return; + + //:: Get own ID number + string sSelf = GetTag(OBJECT_SELF); + int iLength = GetStringLength(sSelf); + string sID; + int iChosen = 0; + + switch (iLength) + { + case 6: + sID = GetStringRight(sSelf,1); + break; + + case 7: + sID = GetStringRight(sSelf,2); + break; + + case 8: + sID = GetStringRight(sSelf,3); + break; + + default: + SendMessageToPC(oPC, "Valid door tag not found."); + sID = ""; // Initialize to empty string for unexpected lengths + break; + } + + //SendMessageToPC(oPC,"my area ID is "+sID); + + int iMatch = GetLocalInt(OBJECT_SELF,"match"); //:: Current door's match + string sEntryDir = GetStringLeft(GetTag(OBJECT_SELF),1); //:: Current door's direction + string sExitDir; + + //:: This inverts the directions + if (sEntryDir == "n") + sExitDir="s"; + + else if (sEntryDir == "s") + sExitDir="n"; + + else if (sEntryDir == "w") + sExitDir="e"; + + else if (sEntryDir == "e") + sExitDir="w"; + + //SendMessageToPC(oPC,"i should be on the "+sExitDir+" side of the map"); + + //:: Now determine if there is already a match + if (iMatch != 0) //:: Door already has a match, teleport PC + { + //SendMessageToPC(oPC,"door has a match"); + string sTag = "area4_"+IntToString(iMatch); + object oArea = GetObjectByTag(sTag); + object oTarget = GetObjectByTag("wp4_"+IntToString(iMatch)+sExitDir); + location lTarget = GetLocation(oTarget); + float fFace = GetFacing(oPC); + AssignCommand(oPC,ActionJumpToLocation(lTarget)); + AssignCommand(oPC,SetFacing(fFace)); + iChosen = 1; + return; + } + + int iRand = Random(41)+1; //:: Random # for area selection + string sTag = "area4_"+IntToString(iRand); + object oArea = GetObjectByTag(sTag); + int iUsed = GetLocalInt(oArea,"ispop_"+sExitDir); + float fFace = GetFacing(oPC); + + int iRetryCount = 0; + // Extract current area ID before the while loop + string sCurrentAreaTag = GetTag(GetArea(OBJECT_SELF)); + int iCurrentAreaID = StringToInt(GetStringRight(sCurrentAreaTag, GetStringLength(sCurrentAreaTag) - 6)); + + while (iChosen == 0)//selecting new areas + { + iRand = Random(41)+1; + + // Skip if this is the current area + if (iRand == iCurrentAreaID) continue; + + sTag = "area4_"+IntToString(iRand); + oArea = GetObjectByTag(sTag); + iUsed = GetLocalInt(oArea,"ispop_"+sExitDir); + + if (iUsed == 0) + { + // SendMessageToPC(oPC,"unused area chosen"); + object oTarget = GetObjectByTag("wp4_"+IntToString(iRand)+sExitDir); + location lTarget = GetLocation(oTarget); + AssignCommand(oPC,ActionJumpToLocation(lTarget)); + AssignCommand(oPC,SetFacing(fFace)); + SetLocalInt(oArea,"ispop_"+sExitDir,1); + object oDoor = GetObjectByTag(sExitDir+"door"+IntToString(iRand)); + SetLocalInt(OBJECT_SELF,"match",iRand); + SetLocalInt(oDoor,"match",StringToInt(sID)); + iChosen = 1; + break; + } + + // Fallback: reset empty areas if we've tried too many times + iRetryCount++; + if (iRetryCount > 50) + { + int iResetCount = 0; + // Check each area before resetting + int i; + for (i = 1; i <= 41; i++) { + object oCheckArea = GetObjectByTag("area4_"+IntToString(i)); + if (GetIsObjectValid(oCheckArea)) { + // Check if all four directions are used + int bNorthUsed = GetLocalInt(oCheckArea, "ispop_n"); + int bSouthUsed = GetLocalInt(oCheckArea, "ispop_s"); + int bEastUsed = GetLocalInt(oCheckArea, "ispop_e"); + int bWestUsed = GetLocalInt(oCheckArea, "ispop_w"); + + // Only reset if all directions are used AND no players present + if (bNorthUsed && bSouthUsed && bEastUsed && bWestUsed) { + // Check if area has players (using same logic as area_onexit.nss) + object oCheck = GetFirstObjectInArea(oCheckArea); + int bHasPlayers = FALSE; + while (oCheck != OBJECT_INVALID) { + if (GetIsPC(oCheck)) { + bHasPlayers = TRUE; + break; + } + oCheck = GetNextObjectInArea(oCheckArea); + } + + // Only reset if no players present + if (!bHasPlayers) { + // Reset all four direction flags + SetLocalInt(oCheckArea, "ispop_n", 0); + SetLocalInt(oCheckArea, "ispop_s", 0); + SetLocalInt(oCheckArea, "ispop_e", 0); + SetLocalInt(oCheckArea, "ispop_w", 0); + iResetCount++; + } + } + } + } + WriteTimestampedLogEntry("door_click: Reset " + IntToString(iResetCount) + " fully exhausted areas"); + iRetryCount = 0; + } + } } \ No newline at end of file diff --git a/_module/nss/hif_modongui.nss b/_module/nss/hif_modongui.nss new file mode 100644 index 00000000..86135636 --- /dev/null +++ b/_module/nss/hif_modongui.nss @@ -0,0 +1,5 @@ +void main() +{ + ExecuteScript("prc_onplayergui", OBJECT_SELF); + ExecuteScript("mod_gui", OBJECT_SELF); +} \ No newline at end of file diff --git a/_module/nss/mod_gui.nss b/_module/nss/mod_gui.nss index c9b0b481..9469f469 100644 --- a/_module/nss/mod_gui.nss +++ b/_module/nss/mod_gui.nss @@ -1,4 +1,6 @@ #include "inc_examine" +#include "nw_inc_nui" +#include "prc_nui_consts" void main() { @@ -6,9 +8,17 @@ void main() int nType = GetLastGuiEventType(); object oTarget = GetLastGuiEventObject(); int nValue = GetLastGuiEventInteger(); - - ExecuteScript("prc_onplayergui", oPlayer); + if (nType == GUIEVENT_EFFECTICON_CLICK) + { + int windowId = NuiFindWindow(oPlayer, DURATION_NUI_WINDOW_ID); + if (!windowId) + { + SetScriptParam(NUI_DURATION_MANUALLY_OPENED_PARAM, "1"); + ExecuteScript("prc_nui_dur_view", oPlayer); + } + } + if (nType == GUIEVENT_DISABLED_PANEL_ATTEMPT_OPEN) { if (nValue == GUI_PANEL_EXAMINE_CREATURE || nValue == GUI_PANEL_EXAMINE_ITEM || diff --git a/_module/nss/nw_c2_default9.nss b/_module/nss/nw_c2_default9.nss new file mode 100644 index 00000000..8b193704 --- /dev/null +++ b/_module/nss/nw_c2_default9.nss @@ -0,0 +1,327 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT9 +/* + * Default OnSpawn handler with XP1 revisions. + * This corresponds to and produces the same results + * as the default OnSpawn handler in the OC. + * + * This can be used to customize creature behavior in three main ways: + * + * - Uncomment the existing lines of code to activate certain + * common desired behaviors from the moment when the creature + * spawns in. + * + * - Uncomment the user-defined event signals to cause the + * creature to fire events that you can then handle with + * a custom OnUserDefined event handler script. + * + * - Add new code _at the end_ to alter the initial + * behavior in a more customized way. + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/11/2002 +//::////////////////////////////////////////////////// +//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript + + +#include "x0_i0_anims" +// #include "x0_i0_walkway" - in x0_i0_anims +#include "x0_i0_treasure" + +#include "x2_inc_switches" + +void main() +{ + // ***** Spawn-In Conditions ***** // + + // * REMOVE COMMENTS (// ) before the "Set..." functions to activate + // * them. Do NOT touch lines commented out with // *, those are + // * real comments for information. + + // * This causes the creature to say a one-line greeting in their + // * conversation file upon perceiving the player. Put [NW_D2_GenCheck] + // * in the "Text Seen When" field of the greeting in the conversation + // * file. Don't attach any player responses. + // * + // SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + + // * Same as above, but for hostile creatures to make them say + // * a line before attacking. + // * + // SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + + // * This NPC will attack when its allies call for help + // * + // SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + + // * If the NPC has the Hide skill they will go into stealth mode + // * while doing WalkWayPoints(). + // * + // SetSpawnInCondition(NW_FLAG_STEALTH); + + //-------------------------------------------------------------------------- + // Enable stealth mode by setting a variable on the creature + // Great for ambushes + // See x2_inc_switches for more information about this + //-------------------------------------------------------------------------- + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE) + { + SetSpawnInCondition(NW_FLAG_STEALTH); + } + // * Same, but for Search mode + // * + // SetSpawnInCondition(NW_FLAG_SEARCH); + + //-------------------------------------------------------------------------- + // Make creature enter search mode after spawning by setting a variable + // Great for guards, etc + // See x2_inc_switches for more information about this + //-------------------------------------------------------------------------- + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE) + { + SetSpawnInCondition(NW_FLAG_SEARCH); + } + // * This will set the NPC to give a warning to non-enemies + // * before attacking. + // * NN -- no clue what this really does yet + // * + // SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + + // * Separate the NPC's waypoints into day & night. + // * See comment on WalkWayPoints() for use. + // * + // SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + + // * If this is set, the NPC will appear using the "EffectAppear" + // * animation instead of fading in, *IF* SetListeningPatterns() + // * is called below. + // * + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + + // * This will cause an NPC to use common animations it possesses, + // * and use social ones to any other nearby friendly NPCs. + // * + // SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + + //-------------------------------------------------------------------------- + // Enable immobile ambient animations by setting a variable + // See x2_inc_switches for more information about this + //-------------------------------------------------------------------------- + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE) + { + SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + } + // * Same as above, except NPC will wander randomly around the + // * area. + // * + // SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + + + //-------------------------------------------------------------------------- + // Enable mobile ambient animations by setting a variable + // See x2_inc_switches for more information about this + //-------------------------------------------------------------------------- + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE) + { + SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + } + // **** Animation Conditions **** // + // * These are extra conditions you can put on creatures with ambient + // * animations. + + // * Civilized creatures interact with placeables in + // * their area that have the tag "NW_INTERACTIVE" + // * and "talk" to each other. + // * + // * Humanoid races are civilized by default, so only + // * set this flag for monster races that you want to + // * behave the same way. + // SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED); + + // * If this flag is set, this creature will constantly + // * be acting. Otherwise, creatures will only start + // * performing their ambient animations when they + // * first perceive a player, and they will stop when + // * the player moves away. + // SetAnimationCondition(NW_ANIM_FLAG_CONSTANT); + + // * Civilized creatures with this flag set will + // * randomly use a few voicechats. It's a good + // * idea to avoid putting this on multiple + // * creatures using the same voiceset. + // SetAnimationCondition(NW_ANIM_FLAG_CHATTER); + + // * Creatures with _immobile_ ambient animations + // * can have this flag set to make them mobile in a + // * close range. They will never leave their immediate + // * area, but will move around in it, frequently + // * returning to their starting point. + // * + // * Note that creatures spawned inside interior areas + // * that contain a waypoint with one of the tags + // * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically + // * have this condition set. + // SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE); + + + // **** Special Combat Tactics *****// + // * These are special flags that can be set on creatures to + // * make them follow certain specialized combat tactics. + // * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE. + + // * Ranged attacker + // * Will attempt to stay at ranged distance from their + // * target. + // SetCombatCondition(X0_COMBAT_FLAG_RANGED); + + // * Defensive attacker + // * Will use defensive combat feats and parry + // SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE); + + // * Ambusher + // * Will go stealthy/invisible and attack, then + // * run away and try to go stealthy again before + // * attacking anew. + // SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER); + + // * Cowardly + // * Cowardly creatures will attempt to flee + // * attackers. + // SetCombatCondition(X0_COMBAT_FLAG_COWARDLY); + + + // **** Escape Commands ***** // + // * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME. + // * NOTE2: Not clear that these actually work. -- NN + + // * Flee to a way point and return a short time later. + // * + // SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); + + // * Flee to a way point and do not return. + // * + // SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); + + // * Teleport to safety and do not return. + // * + // SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); + + // * Teleport to safety and return a short time later. + // * + // SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); + + + + // ***** CUSTOM USER DEFINED EVENTS ***** / + + + /* + If you uncomment any of these conditions, the creature will fire + a specific user-defined event number on each event. That will then + allow you to write custom code in the "OnUserDefinedEvent" handler + script to go on top of the default NPC behaviors for that event. + + Example: I want to add some custom behavior to my NPC when they + are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create + a new user-defined script that has something like this in it: + + if (GetUserDefinedEventNumber() == 1006) { + // Custom code for my NPC to execute when it's damaged + } + + These user-defined events are in the range 1001-1007. + */ + + // * Fire User Defined Event 1001 in the OnHeartbeat + // * + // SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); + + // * Fire User Defined Event 1002 + // * + // SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); + + // * Fire User Defined Event 1005 + // * + // SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); + + // * Fire User Defined Event 1006 + // * + SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); + + // * Fire User Defined Event 1008 + // * + // SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); + + // * Fire User Defined Event 1003 + // * + // SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); + + // * Fire User Defined Event 1004 + // * + // SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); + + + + // ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** // + + // * Goes through and sets up which shouts the NPC will listen to. + // * + SetListeningPatterns(); + + // * Walk among a set of waypoints. + // * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk + // * among them in order. + // * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there + // * and return to it after combat. + // + // * Optional Parameters: + // * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // + // * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also + // * create waypoints with the tags "WN_" + NPC Tag + "_##" + // * and those will be walked at night. (The standard waypoints + // * will be walked during the day.) + // * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag. + WalkWayPoints(); + + //* Create a small amount of treasure on the creature + if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) && + (GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) ) + { + CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); + } + + + // ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** // + + // * If Incorporeal, apply changes + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE) + { + effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL); + eConceal = ExtraordinaryEffect(eConceal); + effect eGhost = EffectCutsceneGhost(); + eGhost = ExtraordinaryEffect(eGhost); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF); + + } + + // * Give the create a random name. + // * If you create a script named x3_name_gen in your module, you can + // * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside + // * the script to override the creature's default name. + if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE) + { + ExecuteScript("x3_name_gen",OBJECT_SELF); + string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME"); + if ( sName == "" ) + { + sName = RandomName(); + } + SetName(OBJECT_SELF,sName); + } + + ExecuteScript("prc_pwonspawn", OBJECT_SELF); +} diff --git a/_module/nss/prc_pwonspawn.nss b/_module/nss/prc_pwonspawn.nss index f1cd5622..5718fb05 100644 --- a/_module/nss/prc_pwonspawn.nss +++ b/_module/nss/prc_pwonspawn.nss @@ -2,9 +2,10 @@ void main() { + ms_Nomenclature(OBJECT_SELF); + ExecuteScript("ss_treasure",OBJECT_SELF); - DelayCommand(0.3,ExecuteScript("ss_treas_auto_on",OBJECT_SELF)); - - ms_Nomenclature(OBJECT_SELF); + DelayCommand(0.5,ExecuteScript("ss_treas_auto_on",OBJECT_SELF)); + } \ No newline at end of file diff --git a/_module/nss/ss_treasure_spwn.nss b/_module/nss/ss_treasure_spwn.nss index 6835645a..46e73bbe 100644 --- a/_module/nss/ss_treasure_spwn.nss +++ b/_module/nss/ss_treasure_spwn.nss @@ -299,7 +299,7 @@ void main() ExecuteScript("ss_treasure",OBJECT_SELF); -DelayCommand(0.3,ExecuteScript("ss_treas_auto_on",OBJECT_SELF)); +DelayCommand(0.5,ExecuteScript("ss_treas_auto_on",OBJECT_SELF)); // ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** // diff --git a/_module/utc/1_und_5b.utc.json b/_module/utc/1_und_5b.utc.json index 4bd43be2..87801ff7 100644 --- a/_module/utc/1_und_5b.utc.json +++ b/_module/utc/1_und_5b.utc.json @@ -669,7 +669,7 @@ "__struct_id": 0, "Name": { "type": "cexostring", - "value": "SET_NAMEs" + "value": "SET_NAME" }, "Type": { "type": "dword",