Instructions Jenkins Doxygen

[Fixed] Incorrect numbering of quests in the quest manager. 52/1652/3
authorLoshult <loshult@swgemu.com>
Sat, 10 May 2014 06:13:02 +0000 (06:13 +0000)
committerLoshult <loshult@swgemu.com>
Sun, 11 May 2014 05:50:16 +0000 (05:50 +0000)
[Fixed] go_to_theater to correctly read the spawned mobile list from the
theater object instead of the creature object.
[Added] extra logging to spawn_mobiles.
[Changed] to a better quest flow in the quest journal for the
sith_shadow_encounter and sith_shadow_intro_theater.

Change-Id: Iec99d8a334b7200cb850b0e9cc188d63b74c95a3

MMOCoreORB/bin/scripts/loot/groups.lua
MMOCoreORB/bin/scripts/managers/jedi/village/sith_shadow_encounter.lua
MMOCoreORB/bin/scripts/managers/jedi/village/sith_shadow_intro_theater.lua
MMOCoreORB/bin/scripts/managers/jedi/village/tests/sith_shadow_encounter_Test.lua
MMOCoreORB/bin/scripts/managers/jedi/village/tests/sith_shadow_intro_theater_Test.lua
MMOCoreORB/bin/scripts/managers/quest/quest_manager.lua
MMOCoreORB/bin/scripts/quest/tasks/go_to_theater.lua
MMOCoreORB/bin/scripts/utils/spawn_mobiles.lua

index a66d627..b3de934 100644 (file)
@@ -18,6 +18,7 @@ includeFile("groups/looted_container.lua")
 includeFile("groups/printer_parts.lua")
 includeFile("groups/rageon_vart_drop.lua")
 includeFile("groups/sith_shadow_encounter_datapad.lua")
+includeFile("groups/sith_shadow_intro_theater_datapad.lua")
 includeFile("groups/skill_buffs.lua")
 includeFile("groups/tailor_components.lua")
 includeFile("groups/test_loot_group.lua")
index 3ce84f4..ba7de2f 100644 (file)
@@ -16,8 +16,8 @@ SithShadowEncounter = Encounter:new {
        -- Encounter properties
        --minimumTimeUntilEncounter = 12 * 60 * 60 * 1000, -- 12 hours
        --maximumTimeUntilEncounter = 24 * 60 * 60 * 1000, -- 24 hours
-       minimumTimeUntilEncounter = 5 * 60 * 1000, -- 12 hours
-       maximumTimeUntilEncounter = 10 * 60 * 1000, -- 24 hours
+       minimumTimeUntilEncounter = 1 * 60 * 1000, -- 12 hours
+       maximumTimeUntilEncounter = 1 * 60 * 1000, -- 24 hours
        --encounterDespawnTime = 5 * 60 * 1000, -- 5 minutes
        encounterDespawnTime = 5 * 60 * 1000, -- 5 minutes
        spawnObjectList = {
@@ -66,7 +66,7 @@ function SithShadowEncounter:onLoot(pLootedCreature, pLooter, nothing)
        if self:isTheFirstSithShadowOfThePlayer(pLootedCreature, pLooter) then
                self:addWaypointDatapadAsLoot(pLootedCreature)
                QuestManager.completeQuest(pLooter, QuestManager.quests.TwO_MILITARY)
-               QuestManager.completeQuest(pLooter, QuestManager.quests.LOOT_DATAPAD_1)
+               QuestManager.completeQuest(pLooter, QuestManager.quests.GOT_DATAPAD_1)
                return 1
        end
 
@@ -86,6 +86,7 @@ function SithShadowEncounter:onPlayerKilled(pCreatureObject, pKiller, nothing)
                OldManEncounter:start(pCreatureObject)
                QuestManager.resetQuest(pCreatureObject, QuestManager.quests.TwO_MILITARY)
                QuestManager.resetQuest(pCreatureObject, QuestManager.quests.LOOT_DATAPAD_1)
+               QuestManager.resetQuest(pCreatureObject, QuestManager.quests.GOT_DATAPAD_1)
                return 1
        end
 
@@ -129,7 +130,7 @@ end
 -- @param pCreatureObject pointer to the creature object who activated the datapad.
 function SithShadowEncounter:useDatapad(pSceneObject, pCreatureObject)
        Logger:log("Player used the looted datapad.", LT_INFO)
-       if QuestManager.hasCompletedQuest(pCreatureObject, QuestManager.quests.LOOT_DATAPAD_1) then
+       if QuestManager.hasCompletedQuest(pCreatureObject, QuestManager.quests.GOT_DATAPAD_1) then
                SithShadowIntroTheater:start(pCreatureObject)
                ObjectManager.withCreatureObject(pCreatureObject, function(creatureObject)
                        creatureObject:sendSystemMessage(READ_DISK_1_STRING)
@@ -137,6 +138,7 @@ function SithShadowEncounter:useDatapad(pSceneObject, pCreatureObject)
                ObjectManager.withSceneObject(pSceneObject, function(sceneObject)
                        sceneObject:destroyObjectFromWorld()
                end)
+               QuestManager.completeQuest(pCreatureObject, QuestManager.quests.LOOT_DATAPAD_1)
        else
                ObjectManager.withCreatureObject(pCreatureObject, function(creatureObject)
                        creatureObject:sendSystemMessage(READ_DISK_ERROR_STRING)
index d82829a..aafdc99 100644 (file)
@@ -28,7 +28,7 @@ SithShadowIntroTheater = GoToTheater:new {
 -- @param pCreatureObject pointer to the creature object of the player.
 -- @return true if the sith shadow is the first one spawned for the player.
 function SithShadowIntroTheater:isTheFirstSithShadowOfThePlayer(pSithShadow, pCreatureObject)
-       local spawnedSithShadows = SpawnMobiles.getSpawnedMobiles(pCreatureObject, self.taskName)
+       local spawnedSithShadows = self:getSpawnedMobileList(pCreatureObject)
 
        if spawnedSithShadows ~= nil then
                return ObjectManager.withCreatureObject(spawnedSithShadows[1], function(sithShadowInList)
@@ -41,7 +41,7 @@ function SithShadowIntroTheater:isTheFirstSithShadowOfThePlayer(pSithShadow, pCr
        end
 end
 
--- Create the waypoint data pad as loot on the sith shadow.
+-- Create the waypoint datapad as loot on the sith shadow.
 -- @param pSithShadow pointer to the creature object of the sith shadow.
 function SithShadowIntroTheater:addWaypointDatapadAsLoot(pSithShadow)
        ObjectManager.withInventoryPointer(pSithShadow, function(pInventory)
@@ -59,6 +59,7 @@ function SithShadowIntroTheater:onLoot(pLootedCreature, pLooter, nothing)
        if self:isTheFirstSithShadowOfThePlayer(pLootedCreature, pLooter) then
                self:addWaypointDatapadAsLoot(pLootedCreature)
                QuestManager.completeQuest(pLooter, QuestManager.quests.FS_THEATER_CAMP)
+               QuestManager.completeQuest(pLooter, QuestManager.quests.GOT_DATAPAD_2)
                return 1
        end
 
@@ -75,6 +76,7 @@ function SithShadowIntroTheater:onEnteredActiveArea(pCreatureObject, spawnedSith
                        mobile:setFollowObject(pCreatureObject)
                end)
        end)
+       QuestManager.activateQuest(pCreatureObject, QuestManager.quests.LOOT_DATAPAD_2)
 end
 
 -- Event handler for the successful spawn event.
index 170c5df..d55c593 100644 (file)
@@ -152,7 +152,8 @@ describe("Sith Shadow Encounter", function()
                                it("Should complete the sith shadow ambush quests.", function()
                                        SithShadowEncounter:onLoot(pFirstSithShadow, pCreatureObject, 0)
 
-                                       assert.spy(QuestManagerMocks.completeQuest).was.called(2)
+                                       assert.spy(QuestManagerMocks.completeQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.TwO_MILITARY)
+                                       assert.spy(QuestManagerMocks.completeQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.GOT_DATAPAD_1)
                                end)
                        end)
 
@@ -215,7 +216,9 @@ describe("Sith Shadow Encounter", function()
                        it("Should reset the sith shadow ambush quests.", function()
                                SithShadowEncounter:onPlayerKilled(pCreatureObject, pFirstSithShadow, 0)
 
-                               assert.spy(QuestManagerMocks.resetQuest).was.called(2)
+                               assert.spy(QuestManagerMocks.resetQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.TwO_MILITARY)
+                               assert.spy(QuestManagerMocks.resetQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.LOOT_DATAPAD_1)
+                               assert.spy(QuestManagerMocks.resetQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.GOT_DATAPAD_1)
                        end)
 
                        it("Should send spatial chat about returning the crystal.", function()
@@ -317,7 +320,7 @@ describe("Sith Shadow Encounter", function()
                        it("Should check if the player object has looted a datapad.", function()
                                SithShadowEncounter:useDatapad(pDatapad, pCreatureObject)
 
-                               assert.spy(QuestManagerMocks.hasCompletedQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.LOOT_DATAPAD_1)
+                               assert.spy(QuestManagerMocks.hasCompletedQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.GOT_DATAPAD_1)
                        end)
 
                        describe("and the player has looted a datapad", function()
@@ -342,6 +345,12 @@ describe("Sith Shadow Encounter", function()
 
                                        assert.spy(datapad.destroyObjectFromWorld).was.called_with(datapad)
                                end)
+
+                               it("Should complete the loot datapad 1 quests.", function()
+                                       SithShadowEncounter:useDatapad(pDatapad, pCreatureObject)
+
+                                       assert.spy(QuestManagerMocks.completeQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.LOOT_DATAPAD_1)
+                               end)
                        end)
 
                        describe("and the player has not looted a datapad", function()
index 32d4766..70f2dad 100644 (file)
@@ -3,8 +3,12 @@ local DirectorManagerMocks = require("screenplays.mocks.director_manager_mocks")
 local QuestManagerMocks = require("managers.quest.mocks.quest_manager_mocks")
 local SpawnMobilesMocks = require("utils.mocks.spawn_mobiles_mocks")
 
+local THEATER_ID_STRING = "theaterId"
+
 describe("SithShadowIntroTheater", function()
        local pCreatureObject = { "creatureObjectPointer" }
+       local creatureObject
+       local playerObjectId = 12345678
        local pFirstSithShadow = { "firstSithShadowObjectPointer" }
        local pSecondSithShadow = { "spawnedMobile2Pointer" }
        local firstSithShadowObject
@@ -15,6 +19,8 @@ describe("SithShadowIntroTheater", function()
        local secondSithShadowId = 23456
        local pDatapad = { "datapadPointer" }
        local datapad
+       local theaterObjectId = 45678901
+       local pTheater = { "theaterObjectPointer" }
 
        setup(function()
                DirectorManagerMocks.mocks.setup()
@@ -33,6 +39,10 @@ describe("SithShadowIntroTheater", function()
                QuestManagerMocks.mocks.before_each()
                SpawnMobilesMocks.mocks.before_each()
 
+               creatureObject = {}
+               creatureObject.getObjectID = spy.new(function() return playerObjectId end)
+               DirectorManagerMocks.creatureObjects[pCreatureObject] = creatureObject
+
                firstSithShadowObject = {}
                firstSithShadowObject.setFollowObject = spy.new(function() end)
                firstSithShadowObject.getObjectID = spy.new(function() return firstSithShadowId end)
@@ -45,6 +55,18 @@ describe("SithShadowIntroTheater", function()
                secondSithShadowObject.getObjectID = spy.new(function() return secondSithShadowId end)
                DirectorManagerMocks.creatureObjects[pSecondSithShadow] = secondSithShadowObject
                DirectorManagerMocks.aiAgents[pSecondSithShadow] = secondSithShadowObject
+
+               readData = spy.new(function(key)
+                       if key == playerObjectId .. SithShadowIntroTheater.taskName .. THEATER_ID_STRING then
+                               return theaterObjectId
+                       end
+               end)
+
+               getSceneObject = spy.new(function(id)
+                       if id == theaterObjectId then
+                               return pTheater
+                       end
+               end)
        end)
 
        describe("onEnteredActiveArea", function()
@@ -55,6 +77,12 @@ describe("SithShadowIntroTheater", function()
                                assert.spy(firstSithShadowObject.setFollowObject).was.called_with(firstSithShadowObject, pCreatureObject)
                                assert.spy(secondSithShadowObject.setFollowObject).was.called_with(secondSithShadowObject, pCreatureObject)
                        end)
+
+                       it("Should activate the loot datapad 2 quest.", function()
+                               SithShadowIntroTheater:onEnteredActiveArea(pCreatureObject, spawnedSithShadowList)
+
+                               assert.spy(QuestManagerMocks.activateQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.LOOT_DATAPAD_2)
+                       end)
                end)
        end)
 
@@ -79,7 +107,7 @@ describe("SithShadowIntroTheater", function()
                        it("Should get the list of spawned sith shadows for the looter.", function()
                                SithShadowIntroTheater:onLoot(pFirstSithShadow, pCreatureObject, 0)
 
-                               assert.spy(SpawnMobilesMocks.getSpawnedMobiles).was.called_with(pCreatureObject, SithShadowIntroTheater.taskName)
+                               assert.spy(SpawnMobilesMocks.getSpawnedMobiles).was.called_with(pTheater, SithShadowIntroTheater.taskName)
                        end)
 
                        describe("and the player has a list of spawned sith shadows", function()
@@ -109,6 +137,13 @@ describe("SithShadowIntroTheater", function()
                                        it("Should return 1 to remove the observer.", function()
                                                assert.same(1, SithShadowIntroTheater:onLoot(pFirstSithShadow, pCreatureObject, 0))
                                        end)
+
+                                       it("Should complete the quests.", function()
+                                               SithShadowIntroTheater:onLoot(pFirstSithShadow, pCreatureObject, 0)
+
+                                               assert.spy(QuestManagerMocks.completeQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.FS_THEATER_CAMP)
+                                               assert.spy(QuestManagerMocks.completeQuest).was.called_with(pCreatureObject, QuestManagerMocks.quests.GOT_DATAPAD_2)
+                                       end)
                                end)
 
                                describe("and both ids are not identical", function()
index 4f211ee..8d394d0 100644 (file)
@@ -142,105 +142,105 @@ QuestManager.quests.FS_PATROL_QUEST_4                           = 84
 QuestManager.quests.FS_PATROL_QUEST_5                          = 85
 QuestManager.quests.FS_PATROL_QUEST_6                          = 86
 QuestManager.quests.FS_PATROL_QUEST_7                          = 87
-QuestManager.quests.FS_PATROL_QUEST_8                          = 89
-QuestManager.quests.FS_PATROL_QUEST_9                          = 90
-QuestManager.quests.FS_PATROL_QUEST_10                                 = 91
-QuestManager.quests.FS_PATROL_QUEST_11                                 = 92
-QuestManager.quests.FS_PATROL_QUEST_12                                 = 93
-QuestManager.quests.FS_PATROL_QUEST_13                                 = 94
-QuestManager.quests.FS_PATROL_QUEST_14                                 = 95
-QuestManager.quests.FS_PATROL_QUEST_15                                 = 96
-QuestManager.quests.FS_PATROL_QUEST_16                                 = 97
-QuestManager.quests.FS_PATROL_QUEST_17                                 = 98
-QuestManager.quests.FS_PATROL_QUEST_18                                 = 99
-QuestManager.quests.FS_PATROL_QUEST_19                                 = 100
-QuestManager.quests.FS_PATROL_QUEST_20                                 = 101
-QuestManager.quests.FS_COMBAT_HEALING_1                        = 102
-QuestManager.quests.FS_COMBAT_HEALING_2                        = 103
-QuestManager.quests.FS_DEFEND_SET_FACTION                      = 104
-QuestManager.quests.FS_DEFEND_01                                       = 105
-QuestManager.quests.FS_DEFEND_02                                       = 106
-QuestManager.quests.FS_DEFEND_REwARD_01                        = 107
-QuestManager.quests.FS_DEFEND_03                                       = 108
-QuestManager.quests.FS_DEFEND_04                                       = 109
-QuestManager.quests.FS_CS_INTRO                                        = 110
-QuestManager.quests.FS_CS_KILL5_GUARDS                                 = 111
-QuestManager.quests.FS_CS_ENSURE_CAPTURE                       = 121
-QuestManager.quests.FS_CS_LAST_CHANCE                          = 113
-QuestManager.quests.FS_CS_ESCORT_COMMANDER_PRI                 = 114
-QuestManager.quests.FS_CS_ESCORT_COMMANDER_SEC                 = 115
-QuestManager.quests.FS_CS_QUEST_DONE                           = 116
-QuestManager.quests.FS_THEATER_FINAL                           = 117
-QuestManager.quests.OLD_MAN_FINAL                                      = 118
-QuestManager.quests.FS_CRAFTING4_QUEST_00                      = 119
-QuestManager.quests.FS_CRAFTING4_QUEST_01                      = 120
-QuestManager.quests.FS_CRAFTING4_QUEST_02                      = 121
-QuestManager.quests.FS_CRAFTING4_QUEST_03                      = 122
-QuestManager.quests.FS_CRAFTING4_QUEST_04                      = 123
-QuestManager.quests.FS_CRAFTING4_QUEST_05                      = 124
-QuestManager.quests.FS_CRAFTING4_QUEST_06                      = 125
-QuestManager.quests.FS_CRAFTING4_QUEST_07                      = 126
-QuestManager.quests.TwO_MILITARY                                       = 127
-QuestManager.quests.FS_DEFEND_REwARD_02                        = 128
-QuestManager.quests.FS_DEFEND_REwARD_03                        = 129
-QuestManager.quests.SURVEY_PHASE2_MAIN                                 = 130
-QuestManager.quests.SURVEY_PHASE2_01                           = 131
-QuestManager.quests.SURVEY_PHASE2_02                           = 132
-QuestManager.quests.SURVEY_PHASE2_03                           = 133
-QuestManager.quests.SURVEY_PHASE2_04                           = 134
-QuestManager.quests.SURVEY_PHASE2_05                           = 135
-QuestManager.quests.SURVEY_PHASE2_06                           = 136
-QuestManager.quests.SURVEY_PHASE2_07                           = 137
-QuestManager.quests.SURVEY_PHASE2_08                           = 138
-QuestManager.quests.SURVEY_PHASE3_MAIN                                 = 139
-QuestManager.quests.SURVEY_PHASE3_01                           = 140
-QuestManager.quests.SURVEY_PHASE3_02                           = 141
-QuestManager.quests.SURVEY_PHASE3_03                           = 142
-QuestManager.quests.SURVEY_PHASE3_04                           = 143
-QuestManager.quests.SURVEY_PHASE3_05                           = 144
-QuestManager.quests.SURVEY_PHASE3_06                           = 145
-QuestManager.quests.SURVEY_PHASE3_07                           = 146
-QuestManager.quests.SURVEY_PHASE3_08                           = 147
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_01      = 148
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_02      = 149
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_03      = 150
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_04      = 151
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_05      = 152
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_06      = 153
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_07      = 154
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_08      = 155
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_09      = 156
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_10      = 157
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_11      = 158
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_12      = 159
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_13      = 160
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_14      = 161
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_15      = 162
-QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_16      = 163
-QuestManager.quests.FS_DATH_wOMAN_TALK                                 = 164
-QuestManager.quests.FS_PATROL_QUEST_START                      = 165
-QuestManager.quests.FS_REFLEX_RESCUE_QUEST_07          = 166
-QuestManager.quests.FS_SURVEY_PHASE2_REwARD            = 167
-QuestManager.quests.FS_SURVEY_PHASE3_REwARD            = 168
-QuestManager.quests.FS_DEFEND_SET_FACTION_02           = 169
-QuestManager.quests.LOOT_DATAPAD_1                                     = 170
-QuestManager.quests.GOT_DATAPAD                                        = 171
-QuestManager.quests.FS_PHASE_2_CRAFT_DEFENSES_01       = 172
-QuestManager.quests.FS_PHASE_3_CRAFT_SHIELDS_01        = 173
-QuestManager.quests.FS_PHASE_2_CRAFT_DEFENSES_MAIN     = 174
-QuestManager.quests.FS_PHASE_3_CRAFT_SHIELDS_MAIN      = 175
-QuestManager.quests.LOOT_DATAPAD_2                                     = 176
-QuestManager.quests.GOT_DATAPAD_2                                      = 177
-QuestManager.quests.FS_CS_QUEST_FAILED_ESCORT          = 178
-QuestManager.quests.FS_PATROL_QUEST_FINISH                     = 179
-QuestManager.quests.FS_MEDIC_PUZZLE_QUEST_FINISH       = 180
-QuestManager.quests.FS_COMBAT_HEALING_FINISH           = 181
-QuestManager.quests.FS_COMBAT_REwARD_PHASE2            = 182
-QuestManager.quests.FS_REFLEX_REwARD_PHASE3            = 183
-QuestManager.quests.FS_DEFEND_wAIT_01                          = 184
-QuestManager.quests.FS_DEFEND_wAIT_02                          = 185
-QuestManager.quests.FS_CRAFTING4_QUEST_FINISH          = 186
-QuestManager.quests.FS_CRAFT_PUZZLE_QUEST_04           = 187
-QuestManager.quests.FS_CS_QUEST_DONE_NOTIFYONLY        = 188
+QuestManager.quests.FS_PATROL_QUEST_8                          = 88
+QuestManager.quests.FS_PATROL_QUEST_9                          = 89
+QuestManager.quests.FS_PATROL_QUEST_10                                 = 90
+QuestManager.quests.FS_PATROL_QUEST_11                                 = 91
+QuestManager.quests.FS_PATROL_QUEST_12                                 = 92
+QuestManager.quests.FS_PATROL_QUEST_13                                 = 93
+QuestManager.quests.FS_PATROL_QUEST_14                                 = 94
+QuestManager.quests.FS_PATROL_QUEST_15                                 = 95
+QuestManager.quests.FS_PATROL_QUEST_16                                 = 96
+QuestManager.quests.FS_PATROL_QUEST_17                                 = 97
+QuestManager.quests.FS_PATROL_QUEST_18                                 = 98
+QuestManager.quests.FS_PATROL_QUEST_19                                 = 99
+QuestManager.quests.FS_PATROL_QUEST_20                                 = 100
+QuestManager.quests.FS_COMBAT_HEALING_1                        = 101
+QuestManager.quests.FS_COMBAT_HEALING_2                        = 102
+QuestManager.quests.FS_DEFEND_SET_FACTION                      = 103
+QuestManager.quests.FS_DEFEND_01                                       = 104
+QuestManager.quests.FS_DEFEND_02                                       = 105
+QuestManager.quests.FS_DEFEND_REwARD_01                        = 106
+QuestManager.quests.FS_DEFEND_03                                       = 107
+QuestManager.quests.FS_DEFEND_04                                       = 108
+QuestManager.quests.FS_CS_INTRO                                        = 109
+QuestManager.quests.FS_CS_KILL5_GUARDS                                 = 110
+QuestManager.quests.FS_CS_ENSURE_CAPTURE                       = 111
+QuestManager.quests.FS_CS_LAST_CHANCE                          = 112
+QuestManager.quests.FS_CS_ESCORT_COMMANDER_PRI                 = 113
+QuestManager.quests.FS_CS_ESCORT_COMMANDER_SEC                 = 114
+QuestManager.quests.FS_CS_QUEST_DONE                           = 115
+QuestManager.quests.FS_THEATER_FINAL                           = 116
+QuestManager.quests.OLD_MAN_FINAL                                      = 117
+QuestManager.quests.FS_CRAFTING4_QUEST_00                      = 118
+QuestManager.quests.FS_CRAFTING4_QUEST_01                      = 119
+QuestManager.quests.FS_CRAFTING4_QUEST_02                      = 120
+QuestManager.quests.FS_CRAFTING4_QUEST_03                      = 121
+QuestManager.quests.FS_CRAFTING4_QUEST_04                      = 122
+QuestManager.quests.FS_CRAFTING4_QUEST_05                      = 123
+QuestManager.quests.FS_CRAFTING4_QUEST_06                      = 124
+QuestManager.quests.FS_CRAFTING4_QUEST_07                      = 125
+QuestManager.quests.TwO_MILITARY                                       = 126
+QuestManager.quests.FS_DEFEND_REwARD_02                        = 127
+QuestManager.quests.FS_DEFEND_REwARD_03                        = 128
+QuestManager.quests.SURVEY_PHASE2_MAIN                                 = 129
+QuestManager.quests.SURVEY_PHASE2_01                           = 130
+QuestManager.quests.SURVEY_PHASE2_02                           = 131
+QuestManager.quests.SURVEY_PHASE2_03                           = 132
+QuestManager.quests.SURVEY_PHASE2_04                           = 133
+QuestManager.quests.SURVEY_PHASE2_05                           = 134
+QuestManager.quests.SURVEY_PHASE2_06                           = 135
+QuestManager.quests.SURVEY_PHASE2_07                           = 136
+QuestManager.quests.SURVEY_PHASE2_08                           = 137
+QuestManager.quests.SURVEY_PHASE3_MAIN                                 = 138
+QuestManager.quests.SURVEY_PHASE3_01                           = 139
+QuestManager.quests.SURVEY_PHASE3_02                           = 140
+QuestManager.quests.SURVEY_PHASE3_03                           = 141
+QuestManager.quests.SURVEY_PHASE3_04                           = 142
+QuestManager.quests.SURVEY_PHASE3_05                           = 143
+QuestManager.quests.SURVEY_PHASE3_06                           = 144
+QuestManager.quests.SURVEY_PHASE3_07                           = 145
+QuestManager.quests.SURVEY_PHASE3_08                           = 146
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_01      = 147
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_02      = 148
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_03      = 159
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_04      = 160
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_05      = 161
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_06      = 162
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_07      = 163
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_08      = 164
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_09      = 165
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_10      = 166
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_11      = 167
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_12      = 168
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_13      = 169
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_14      = 170
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_15      = 171
+QuestManager.quests.FS_SURVEY_SPECIAL_RESOURCE_16      = 172
+QuestManager.quests.FS_DATH_wOMAN_TALK                                 = 173
+QuestManager.quests.FS_PATROL_QUEST_START                      = 174
+QuestManager.quests.FS_REFLEX_RESCUE_QUEST_07          = 175
+QuestManager.quests.FS_SURVEY_PHASE2_REwARD            = 176
+QuestManager.quests.FS_SURVEY_PHASE3_REwARD            = 177
+QuestManager.quests.FS_DEFEND_SET_FACTION_02           = 178
+QuestManager.quests.LOOT_DATAPAD_1                                     = 179
+QuestManager.quests.GOT_DATAPAD                                        = 180
+QuestManager.quests.FS_PHASE_2_CRAFT_DEFENSES_01       = 181
+QuestManager.quests.FS_PHASE_3_CRAFT_SHIELDS_01        = 182
+QuestManager.quests.FS_PHASE_2_CRAFT_DEFENSES_MAIN     = 183
+QuestManager.quests.FS_PHASE_3_CRAFT_SHIELDS_MAIN      = 184
+QuestManager.quests.LOOT_DATAPAD_2                                     = 185
+QuestManager.quests.GOT_DATAPAD_2                                      = 186
+QuestManager.quests.FS_CS_QUEST_FAILED_ESCORT          = 187
+QuestManager.quests.FS_PATROL_QUEST_FINISH                     = 188
+QuestManager.quests.FS_MEDIC_PUZZLE_QUEST_FINISH       = 189
+QuestManager.quests.FS_COMBAT_HEALING_FINISH           = 190
+QuestManager.quests.FS_COMBAT_REwARD_PHASE2            = 191
+QuestManager.quests.FS_REFLEX_REwARD_PHASE3            = 192
+QuestManager.quests.FS_DEFEND_wAIT_01                          = 193
+QuestManager.quests.FS_DEFEND_wAIT_02                          = 194
+QuestManager.quests.FS_CRAFTING4_QUEST_FINISH          = 195
+QuestManager.quests.FS_CRAFT_PUZZLE_QUEST_04           = 196
+QuestManager.quests.FS_CS_QUEST_DONE_NOTIFYONLY        = 197
 
 return QuestManager
index 1102c52..bc2df98 100644 (file)
@@ -39,6 +39,18 @@ GoToTheater = Task:new {
        onEnteredActiveArea = nil
 }
 
+-- Get the spawned mobile list for the theater.
+-- @param pCreatureObject pointer to the creature object of the player.
+-- @return the spawned mobile list for the theater.
+function GoToTheater:getSpawnedMobileList(pCreatureObject)
+       return ObjectManager.withCreatureObject(pCreatureObject, function(creatureObject)
+               Logger:log("Getting the spawned mobile list for " .. self.taskName .. " theater.", LT_INFO)
+               local theaterId = readData(creatureObject:getObjectID() .. self.taskName .. THEATER_ID_STRING)
+               local pTheater = getSceneObject(theaterId)
+               return SpawnMobiles.getSpawnedMobiles(pTheater, self.taskName)
+       end)
+end
+
 -- Setup the active area around the theater.
 -- @param pCreatureObject pointer to the creature object for whom the theater is created for.
 -- @param spawnPoint the coordinates to spawn the active area at.
@@ -68,7 +80,7 @@ function GoToTheater:handleEnteredAreaEvent(pActiveArea, pCreatureObject, nothin
                ObjectManager.withSceneObject(pActiveArea, function(activeArea)
                        if storedActiveAreaId == activeArea:getObjectID() then
                                Logger:log("Player entered active area of " .. self.taskName .. " theater.", LT_INFO)
-                               local spawnedObjects = SpawnMobiles.getSpawnedMobiles(pCreatureObject, self.taskName)
+                               local spawnedObjects = self:getSpawnedMobileList(pCreatureObject)
                                self:callFunctionIfNotNil(self.onEnteredActiveArea, nil, pCreatureObject, spawnedObjects)
                        end
                end)
index 889e7b9..a9d639a 100644 (file)
@@ -40,7 +40,13 @@ local NUMBER_OF_SPAWNS_STRING = "_number_of_spawns"
 -- @return true if the prefix is free to use.
 function SpawnMobiles.isPrefixFree(pSceneObject, prefix)
        return ObjectManager.withSceneObject(pSceneObject, function(sceneObject)
-               return readData(sceneObject:getObjectID() .. prefix .. SPAWN_MOBILES_STRING .. IN_USE_STRING) ~= PREFIX_IN_USE
+               local inUse = readData(sceneObject:getObjectID() .. prefix .. SPAWN_MOBILES_STRING .. IN_USE_STRING)
+               if inUse == PREFIX_IN_USE then
+                       Logger:log(sceneObject:getObjectID() .. prefix .. SPAWN_MOBILES_STRING .. IN_USE_STRING .. " = true")
+               else
+                       Logger:log(sceneObject:getObjectID() .. prefix .. SPAWN_MOBILES_STRING .. IN_USE_STRING .. " = false")
+               end
+               return inUse ~= PREFIX_IN_USE
        end)
 end