From 63a3172b43bbc69b3a9ce973c3cf49d271cce67f Mon Sep 17 00:00:00 2001 From: Redacted by Stellabellum INC Date: Sun, 12 Oct 2014 00:56:38 -0700 Subject: [PATCH] Added code for reading the new roof column on Storyteller datatable. Storyteller objects can now be placed on player structure roofs if object is flagged as allowed on roofs. When making a blueprint, objects inside buildings or on player structure roofs do not get added to the blueprint. --- .../game/script/library/storyteller.scriptlib | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/library/storyteller.scriptlib diff --git a/sku.0/sys.server/compiled/game/script/library/storyteller.scriptlib b/sku.0/sys.server/compiled/game/script/library/storyteller.scriptlib old mode 100644 new mode 100755 index 3bf64b0b1..b6d4e1c9b --- a/sku.0/sys.server/compiled/game/script/library/storyteller.scriptlib +++ b/sku.0/sys.server/compiled/game/script/library/storyteller.scriptlib @@ -492,6 +492,17 @@ boolean allowTokenPlacementInInteriors(string tokenName) return allowInInteriors == 1; } +boolean allowTokenPlacementOnRoofs(obj_id token) +{ + return allowTokenPlacementOnRoofs(getStaticItemName(token)); +} + +boolean allowTokenPlacementOnRoofs(string tokenName) +{ + int allowOnRoofs = dataTableGetInt(STORYTELLER_DATATABLE, tokenName, "allow_roof"); + return allowOnRoofs == 1; +} + obj_id getStorytellerBeingAssisted(obj_id player) { obj_id storytellerBeingAssisted = null; @@ -787,11 +798,24 @@ boolean canDeployStorytellerToken(obj_id player, location here, string tokenName // block storyteller object placement on player structure roofs and balconies // unless the object is flagged as allowed in interiors + // UPDATE 9/14/14: Storyteller objects can now be placed on player structure + // roofs if the object is flagged as allowed on roofs obj_id whatAmIStandingOn = getStandingOn(player); if( isIdValid(whatAmIStandingOn) && player_structure.isBuilding(whatAmIStandingOn) ) { - sendSystemMessage(player, new string_id("storyteller", "placement_not_on_a_building")); - return false; + if( !allowTokenPlacementOnRoofs(tokenName) ) + { + sendSystemMessage(player, new string_id("storyteller", "placement_not_on_a_building")); + return false; + } + else + { + if ( !player_structure.isAdmin(whatAmIStandingOn, player) && !player_structure.isAdmin(whatAmIStandingOn, storytellerBeingAssisted) ) + { + sendSystemMessage(player, new string_id("storyteller", "placement_not_building_admin")); + return false; + } + } } // city or outpost @@ -1015,9 +1039,11 @@ string[] recordBlueprintData(obj_id blueprint, obj_id[] storytellerObjects, obj_ string[] excludedTokens = { "st_fn_storyteller_vendor" }; boolean isExcludedToken = false; + location tokLoc = getLocation(object); + obj_id whatAmIStandingOn = getStandingOn(object); for ( int q=0; q