Instructions Jenkins Doxygen

[fixed] Some screenplays 73/2373/2
authorMiztah <myztah@gmail.com>
Tue, 26 Aug 2014 00:10:20 +0000 (00:10 +0000)
committerMiztah <myztah@gmail.com>
Tue, 26 Aug 2014 00:24:01 +0000 (00:24 +0000)
Change-Id: Iba91b9d06b82877d221537e2f2449c7d1fdce22d

MMOCoreORB/bin/scripts/screenplays/themepark/conversations/goru_conv_handler.lua
MMOCoreORB/bin/scripts/screenplays/themepark/conversations/nym_conv_handler.lua
MMOCoreORB/bin/scripts/screenplays/treasure_map/TreasureMapMenuComponent.lua

index c5c38b8..ea9dd91 100644 (file)
@@ -26,9 +26,7 @@ function GoruConvoHandler:runScreenHandlers(conversationTemplate, conversingPlay
                        local pItemCheck = getContainerObjectByTemplate(pInventory, "object/tangible/loot/quest/quest_item_goru_calling_card.iff", true)
                        if pItemCheck == nil then
                                local pItem = giveItem(pInventory, "object/tangible/loot/quest/quest_item_goru_calling_card.iff", -1)
-                               ObjectManager.withSceneObject(pItem, function(item)
-                                       item:sendTo(conversingPlayer)
-                               end)
+                               SceneObject(pItem):sendTo(conversingPlayer)
                        end
                elseif screenID == "fine_quit_then" or screenID == "go_away_then" then
                        self.themePark:removeState(player, 1, "zicx_bug_bomb_goruNpc")
@@ -37,20 +35,16 @@ function GoruConvoHandler:runScreenHandlers(conversationTemplate, conversingPlay
                        local pInventory = player:getSlottedObject("inventory")
                        local pItem = getContainerObjectByTemplate(pInventory, "object/tangible/loot/quest/quest_item_goru_calling_card.iff", true)
                        if pItem ~= nil then
-                               ObjectManager.withSceneObject(pItem, function(item)
-                                       item:destroyObjectFromWorld()
-                                       item:destroyObjectFromDatabase()
-                               end)
+                               SceneObject(pItem):destroyObjectFromWorld()
+                               SceneObject(pItem):destroyObjectFromDatabase()
                        end
                elseif screenID == "heres_your_bomb" then
-                               local pInventory = player:getSlottedObject("inventory")
-                               local pItem = giveItem(pInventory, "object/weapon/ranged/grenade/grenade_bug_bomb.iff", -1)
-                               if (pItem ~= nil) then
-                                       ObjectManager.withSceneObject(pItem, function(item)
-                                               item:sendTo(conversingPlayer)
-                                       end)
-                               end
-                               self.themePark:setState(player, 8, "zicx_bug_bomb_goruNpc")
+                       local pInventory = player:getSlottedObject("inventory")
+                       local pItem = giveItem(pInventory, "object/weapon/ranged/grenade/grenade_bug_bomb.iff", -1)
+                       if (pItem ~= nil) then
+                               SceneObject(pItem):sendTo(conversingPlayer)
+                       end
+                       self.themePark:setState(player, 8, "zicx_bug_bomb_goruNpc")
                end
                return conversationScreen
        end)
index 94868da..548be64 100644 (file)
@@ -260,13 +260,9 @@ end
 function NymConvoHandler:cellPlayerPermissionsObserver(pCreature, pCreature2)
        return ObjectManager.withSceneObject(pCreature, function(creatureSceneObject)
                if creatureSceneObject:isCreatureObject() then
-                       return ObjectManager.withSceneObject(pRegion, function(region)
-                               for i = 1, # self.themePark.permissionMap, 1 do
-                                       if self.themePark.permissionMap[i].regionName == region:getObjectName() then
-                                               self.themePark:setCellPermissions(self.themePark.permissionMap[i], pCreature)
-                                       end
-                               end
-                       end)
+                       for i = 1, # self.themePark.permissionMap, 1 do
+                               self.themePark:setCellPermissions(self.themePark.permissionMap[i], pCreature)
+                       end
                end
                return 0
        end)
index 7af130a..3ea4885 100644 (file)
@@ -26,27 +26,25 @@ function TreasureMapMenuComponent:handleObjectMenuSelect(pObject, pPlayer, selec
                return 0
        end
 
-       return ObjectManager.withCreatureAndPlayerObject(pPlayer, function(creature, player)
-               return ObjectManager.withSceneObject(pObject, function(object)
-                       if (object:isASubChildOf(pPlayer) == false) then
-                               creature:sendSystemMessage("@treasure_map/treasure_map:sys_not_in_inv") -- The treasure map must be in your inventory for you to use it!
-                               return 0
-                       end
-
-                       if (TreasureMapMenuComponent:getMapType(pObject) == 0) then
-                               creature:sendSystemMessage("@treasure_map/treasure_map:map_fail") -- This map is obviously a fake.
-                               return 0
-                       end
+       return ObjectManager.withCreatureObject(pPlayer, function(creature)
+               if (SceneObject(pObject):isASubChildOf(pPlayer) == false) then
+                       creature:sendSystemMessage("@treasure_map/treasure_map:sys_not_in_inv") -- The treasure map must be in your inventory for you to use it!
+                       return 0
+               end
 
-                       if (selectedID == 120) then
-                               TreasureMapMenuComponent:doReadMap(pObject, pPlayer)
-                       elseif (selectedID == 121) then
-                               TreasureMapMenuComponent:doSearchArea(pObject, pPlayer)
-                       elseif (selectedID == 122) then
-                               TreasureMapMenuComponent:doExtractTreasure(pObject, pPlayer)
-                       end
+               if (TreasureMapMenuComponent:getMapType(pObject) == 0) then
+                       creature:sendSystemMessage("@treasure_map/treasure_map:map_fail") -- This map is obviously a fake.
                        return 0
-               end)
+               end
+
+               if (selectedID == 120) then
+                       TreasureMapMenuComponent:doReadMap(pObject, pPlayer)
+               elseif (selectedID == 121) then
+                       TreasureMapMenuComponent:doSearchArea(pObject, pPlayer)
+               elseif (selectedID == 122) then
+                       TreasureMapMenuComponent:doExtractTreasure(pObject, pPlayer)
+               end
+               return 0
        end)
 end
 
@@ -71,9 +69,7 @@ function TreasureMapMenuComponent:doSearchArea(pObject, pPlayer)
                        local pWaypoint = getSceneObject(waypointID)
 
                        local pActiveArea = getSceneObject(searchAreaID)
-                       ObjectManager.withSceneObject(pActiveArea, function(area)
-                               area:destroyObjectFromWorld()
-                       end)
+                       SceneObject(pActiveArea):destroyObjectFromWorld()
 
                        local spawnPoint
                        ObjectManager.withSceneObject(pWaypoint, function(waypoint)
@@ -98,87 +94,76 @@ end
 
 function TreasureMapMenuComponent:doExtractTreasure(pObject, pPlayer)
        local mapType = TreasureMapMenuComponent:getMapType(pObject)
-       ObjectManager.withSceneObject(pPlayer, function(playerSceo)
-               ObjectManager.withCreatureAndPlayerObject(pPlayer, function(creature, player)
-                       local mapData = treasureMapData[mapType]
-                       local waypointID = readData(creature:getObjectID() .. ":treasureMapExactWaypointID")
-                       local x, z, y
+       ObjectManager.withCreatureObject(pPlayer, function(creature)
+               local mapData = treasureMapData[mapType]
+               local waypointID = readData(creature:getObjectID() .. ":treasureMapExactWaypointID")
+               local x, z, y
+
+               local pWaypoint = getSceneObject(waypointID)
+               ObjectManager.withSceneObject(pWaypoint, function(waypoint)
+                       x = waypoint:getWorldPositionX()
+                       y = waypoint:getWorldPositionY()
+                       z = getTerrainHeight(pPlayer, x, y)
+               end)
 
-                       local pWaypoint = getSceneObject(waypointID)
-                       ObjectManager.withSceneObject(pWaypoint, function(waypoint)
-                               x = waypoint:getWorldPositionX()
-                               y = waypoint:getWorldPositionY()
-                               z = getTerrainHeight(pPlayer, x, y)
-                       end)
+               if (SceneObject(pPlayer):getDistanceToPosition(x, z, y) > 5) then
+                       creature:sendSystemMessage("@treasure_map/treasure_map:sys_dist_far") -- You aren't close enough to extract the treasure.
+                       return 0
+               end
 
-                       if (playerSceo:getDistanceToPosition(x, z, y) > 5) then
-                               creature:sendSystemMessage("@treasure_map/treasure_map:sys_dist_far") -- You aren't close enough to extract the treasure.
-                               return 0
-                       end
+               local treasureChestID = readData(creature:getObjectID() .. ":treasureChestID")
 
-                       local treasureChestID = readData(creature:getObjectID() .. ":treasureChestID")
-                       
-                       if (treasureChestID ~= nil) then
-                               local pExistingChest = getSceneObject(treasureChestID)
-                               if (pExistingChest ~= nil) then
-                                       self:removeTreasureChest(pExistingChest)
-                               end
+               if (treasureChestID ~= nil) then
+                       local pExistingChest = getSceneObject(treasureChestID)
+                       if (pExistingChest ~= nil) then
+                               self:removeTreasureChest(pExistingChest)
                        end
+               end
 
-                       creature:sendSystemMessage("@treasure_map/treasure_map:sys_found") -- You successfully extract the treasure!
-
-                       local pChest = spawnSceneObject(mapData.planet, "object/tangible/container/drum/treasure_drum.iff", x, z, y, 0, 0, 0, 0, 0)
-                       ObjectManager.withSceneObject(pChest, function(chest)
-                               writeData(creature:getObjectID() .. ":treasureChestID", chest:getObjectID())
-                               writeData(chest:getObjectID() .. ":ownerID", creature:getObjectID())
-                               chest:setContainerOwnerID(creature:getObjectID())
-                               createObserver(OPENCONTAINER, "TreasureMapMenuComponent", "openChestEvent", pChest)
-                               createObserver(CONTAINERCONTENTSCHANGED, "TreasureMapMenuComponent", "chestLootedEvent", pChest)
-                               TreasureMapMenuComponent:spawnTreasureLoot(pChest, pPlayer, mapType)
-                               createEvent(TREASURE_CHEST_LIFESPAN, "TreasureMapMenuComponent", "removeTreasureChest", pChest)
-                       end)
-                       TreasureMapMenuComponent:spawnTreasureDefenders(pObject, pPlayer, x, z, y)
-                       ObjectManager.withSceneObject(pObject, function(map)
-                               map:destroyObjectFromWorld()
-                               map:destroyObjectFromDatabase(true)
-                       end)
+               creature:sendSystemMessage("@treasure_map/treasure_map:sys_found") -- You successfully extract the treasure!
+
+               local pChest = spawnSceneObject(mapData.planet, "object/tangible/container/drum/treasure_drum.iff", x, z, y, 0, 0, 0, 0, 0)
+               ObjectManager.withSceneObject(pChest, function(chest)
+                       writeData(creature:getObjectID() .. ":treasureChestID", chest:getObjectID())
+                       writeData(chest:getObjectID() .. ":ownerID", creature:getObjectID())
+                       chest:setContainerOwnerID(creature:getObjectID())
+                       createObserver(OPENCONTAINER, "TreasureMapMenuComponent", "openChestEvent", pChest)
+                       createObserver(CONTAINERCONTENTSCHANGED, "TreasureMapMenuComponent", "chestLootedEvent", pChest)
+                       TreasureMapMenuComponent:spawnTreasureLoot(pChest, pPlayer, mapType)
+                       createEvent(TREASURE_CHEST_LIFESPAN, "TreasureMapMenuComponent", "removeTreasureChest", pChest)
                end)
+               TreasureMapMenuComponent:spawnTreasureDefenders(pObject, pPlayer, x, z, y)
+               SceneObject(pObject):destroyObjectFromWorld()
+               SceneObject(pObject):destroyObjectFromDatabase(true)
        end)
 end
 
 function TreasureMapMenuComponent:chestLootedEvent(pChest, pCreature)
-       ObjectManager.withSceneObject(pChest, function(chest)
-               if (chest:getContainerObjectsSize() == 0) then
-                       TreasureMapMenuComponent:removeTreasureChest(pChest)
-               end
-       end)
+       if (SceneObject(pChest):getContainerObjectsSize() == 0) then
+               TreasureMapMenuComponent:removeTreasureChest(pChest)
+       end
 end
 
 function TreasureMapMenuComponent:openChestEvent(pChest, pCreature)
-       ObjectManager.withSceneObject(pChest, function(chest)
-               ObjectManager.withCreatureObject(pCreature, function(creature)
-                       local chestOwnerID = readData(chest:getObjectID() .. ":ownerID")
-                       if (chestOwnerID ~= creature:getObjectID()) then
-                               creature:sendSystemMessage("@treasure_map/treasure_map:sys_not_yours") -- That treasure chest doesn't belong to you.
-                               return 0
-                       end
-                       local hasOpenedChest = readData(creature:getObjectID() .. ":hasOpenedChest")
-                       if (hasOpenedChest ~= 1) then
-                               local credits = getRandomNumber(500, 5000)
-                               creature:addCashCredits(credits, true)
-                               creature:sendSystemMessage("You find " .. credits .. " credits in the chest.")
-                               writeData(creature:getObjectID() .. ":hasOpenedChest", 1)
-                       end
-               end)
+       ObjectManager.withCreatureObject(pCreature, function(creature)
+               local chestOwnerID = readData(SceneObject(pChest):getObjectID() .. ":ownerID")
+               if (chestOwnerID ~= creature:getObjectID()) then
+                       creature:sendSystemMessage("@treasure_map/treasure_map:sys_not_yours") -- That treasure chest doesn't belong to you.
+                       return 0
+               end
+               local hasOpenedChest = readData(creature:getObjectID() .. ":hasOpenedChest")
+               if (hasOpenedChest ~= 1) then
+                       local credits = getRandomNumber(500, 5000)
+                       creature:addCashCredits(credits, true)
+                       creature:sendSystemMessage("You find " .. credits .. " credits in the chest.")
+                       writeData(creature:getObjectID() .. ":hasOpenedChest", 1)
+               end
        end)
 end
 
 function TreasureMapMenuComponent:spawnTreasureLoot(pChest, pPlayer, mapType)
        if (mapType == 1 or mapType == 2 or mapType == 3) then
-               local playerLevelRange = 10
-               ObjectManager.withCreatureObject(pPlayer, function(creature)
-                       playerLevelRange = getRandomNumber(creature:getLevel() - 5, creature:getLevel() + 5)
-               end)
+               local playerLevelRange = getRandomNumber(CreatureObject(pPlayer):getLevel() - 5, CreatureObject(pPlayer):getLevel() + 5)
 
                for i = 1, 5 do
                        createLoot(pChest, "treasure_map_group", playerLevelRange, false)
@@ -290,12 +275,8 @@ function TreasureMapMenuComponent:spawnSearchArea(mapType, pCreature, x, y)
        local z = getTerrainHeight(pCreature, x, y)
        local pActiveArea = spawnSceneObject(mapData.planet, "object/active_area.iff", x, z, y, 0, 0, 0, 0, 0)
 
-       ObjectManager.withActiveArea(pActiveArea, function(activeArea)
-               activeArea:setRadius(64)
-       end)
-       return ObjectManager.withSceneObject(pActiveArea, function(activeSceo)
-               return activeSceo:getObjectID()
-       end)
+       ActiveArea(pActiveArea):setRadius(64)
+       return SceneObject(pActiveArea):getObjectID()
 end
 
 function TreasureMapMenuComponent:getMapType(pObject)