From ffeb53c6560f84ca78c8fb7fe3afadd004ca7aa2 Mon Sep 17 00:00:00 2001 From: PrisonCamp Date: Sun, 12 Oct 2014 00:59:40 -0700 Subject: [PATCH] You can no longer place multiple NPCs if player is on a player structure roof. You can now examine Storyteller Tokens to see whether the token can be placed on a roof-top or not. --- .../systems/storyteller/npc_token.script | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/systems/storyteller/npc_token.script diff --git a/sku.0/sys.server/compiled/game/script/systems/storyteller/npc_token.script b/sku.0/sys.server/compiled/game/script/systems/storyteller/npc_token.script old mode 100644 new mode 100755 index e1f7d674c..4f9da4cb7 --- a/sku.0/sys.server/compiled/game/script/systems/storyteller/npc_token.script +++ b/sku.0/sys.server/compiled/game/script/systems/storyteller/npc_token.script @@ -1,4 +1,5 @@ include library.create; +include library.player_structure; include library.static_item; include library.storyteller; include library.sui; @@ -44,8 +45,19 @@ trigger OnObjectMenuRequest(obj_id player, menu_info mi) { placeMultiMenuLabel = "place_all_npcs"; } - mi.addSubMenu(menuPlacement, menu_info_types.SERVER_MENU1, new string_id("storyteller", placeMultiMenuLabel)); - mi.addRootMenu (menu_info_types.ITEM_USE_OTHER, new string_id("storyteller", "set_npc_level")); + // UPDATE 9/14/14: Cannot place multiple npcs if on roof + obj_id whatAmIStandingOn = getStandingOn(player); + // Player is on roof. Do not give them option to place multiple npcs + if( isIdValid(whatAmIStandingOn) && player_structure.isBuilding(whatAmIStandingOn) ) + { + mi.addRootMenu (menu_info_types.ITEM_USE_OTHER, new string_id("storyteller", "set_npc_level")); + } + else + // Player is not on roof. Give them option to place multiple npcs + { + mi.addSubMenu(menuPlacement, menu_info_types.SERVER_MENU1, new string_id("storyteller", placeMultiMenuLabel)); + mi.addRootMenu (menu_info_types.ITEM_USE_OTHER, new string_id("storyteller", "set_npc_level")); + } return SCRIPT_CONTINUE; } @@ -270,6 +282,17 @@ trigger OnGetAttributes(obj_id player, string[] names, string[] attribs) if (idx >= names.length) return SCRIPT_CONTINUE; } + // UPDATE 9/19/14: Can now examine token to see + // whether or not token can be used on roofs + if ( storyteller.allowTokenPlacementOnRoofs(self) ) + { + names[idx] = "storyteller_allow_roof_deploy"; + attribs[idx] = "True"; + idx++; + + if (idx >= names.length) + return SCRIPT_CONTINUE; + } return SCRIPT_CONTINUE; }