Instructions Jenkins Doxygen

[fixed] Issue with retrieve mission giver conversation - mantis 5146 00/1800/2
authorMiztah <myztah@gmail.com>
Mon, 16 Jun 2014 22:23:43 +0000 (22:23 +0000)
committerMiztah <myztah@gmail.com>
Mon, 16 Jun 2014 22:26:05 +0000 (22:26 +0000)
Change-Id: I2a136e46a80b1ef5e7343b888ea20e2bdb65b0b1

MMOCoreORB/bin/scripts/screenplays/themepark/conversations/mission_giver_conv_handler.lua
MMOCoreORB/bin/scripts/screenplays/themepark/conversations/mission_target_conv_handler.lua
MMOCoreORB/bin/scripts/screenplays/themepark/themeParkLogic.lua

index 8bec6bf..c1c4318 100644 (file)
@@ -44,7 +44,7 @@ function mission_giver_conv_handler:runScreenHandlers(pConversationTemplate, pCo
        local screen = LuaConversationScreen(pConversationScreen)
 
        local screenID = screen:getScreenID()
-
+       
        if screenID == "init" then
                pConversationScreen = self:handleScreenInit(pConversationTemplate, pConversingPlayer, pConversingNpc, selectedOption, pConversationScreen)
        elseif screenID == "accept" then
@@ -107,15 +107,17 @@ function mission_giver_conv_handler:handleScreenInit(pConversationTemplate, pCon
                        if self.themePark:missionStatus(pConversingPlayer) == 1 then
                                if self.themePark:getMissionType(activeNpcNumber, pConversingPlayer) == "escort" and self.themePark:escortedNpcCloseEnough(pConversingPlayer) == true then
                                        nextScreenName = "npc_reward_n"
-                               elseif self.themePark:getMissionType(activeNpcNumber, pConversingPlayer) == "retrieve" and self.themePark:hasRequiredItem(pConversingPlayer) == true then
-                                       self.themePark:removeDeliverItem(pConversingPlayer)
-                                       nextScreenName = "npc_reward_n"
                                else
                                        nextScreenName = "npc_work_n"
                                end
                        elseif self.themePark:missionStatus(pConversingPlayer) == 2 then
                                if self.themePark:getMissionType(activeNpcNumber, pConversingPlayer) == "confiscate" and not self.themePark:hasLootedRequiredItem(activeNpcNumber, pConversingPlayer) == true then
                                        nextScreenName = "npc_work_n"
+                               elseif self.themePark:getMissionType(activeNpcNumber, pConversingPlayer) == "retrieve" and self.themePark:hasRequiredItem(pConversingPlayer) == true then
+                                       self.themePark:removeDeliverItem(pConversingPlayer)
+                                       nextScreenName = "npc_reward_n"
+                               elseif self.themePark:getMissionType(activeNpcNumber, pConversingPlayer) == "retrieve" and self.themePark:hasRequiredItem(pConversingPlayer) == false then
+                                       nextScreenName = "npc_work_n"
                                else
                                        nextScreenName = "npc_reward_n"
                                end
index 99d002b..50a95e4 100644 (file)
@@ -180,7 +180,7 @@ function mission_target_conv_handler:handleScreenMissionType(pConversationTempla
                end
        elseif mission.missionType == "retrieve" then
                if correctNpc == true then
-                       if activeMission ~= 1 then
+                       if activeMission ~= 2 then
                                self.themePark:giveMissionItems(mission, pConversingPlayer)
                                self.themePark:updateWaypoint(pConversingPlayer, npcData.spawnData.planetName, worldPosition.x, worldPosition.y, "return")
                        end
index 058d442..7129e03 100644 (file)
@@ -371,7 +371,7 @@ end
 
 function ThemeParkLogic:handleRetrieveMissionAccept(mission, pConversingPlayer, missionNumber)
        if self:spawnMissionNpcs(mission, pConversingPlayer) == true then
-               self:writeData(pConversingPlayer, ":activeMission", 0)
+               self:writeData(pConversingPlayer, ":activeMission", 1)
                return true
        else
                return false
@@ -655,7 +655,15 @@ function ThemeParkLogic:giveMissionItems(mission, pConversingPlayer)
        end
 
        local creature = LuaCreatureObject(pConversingPlayer)
-       writeData(creature:getObjectID() .. ":activeMission", 1)
+       
+       local activeNpcNumber = self:getActiveNpcNumber(pConversingPlayer)
+       local currentMissionType = self:getMissionType(activeNpcNumber, pConversingPlayer)
+       
+       if (currentMissionType == "retrieve") then
+               writeData(creature:getObjectID() .. ":activeMission", 2)
+       else
+               writeData(creature:getObjectID() .. ":activeMission", 1)
+       end
 
        local itemsToGive = mission.itemSpawns