Instructions Jenkins Doxygen

[added] Hunt mission type to themepark logic to support quests that 28/2128/3
authorMiztah <myztah@gmail.com>
Sun, 20 Jul 2014 20:21:21 +0000 (20:21 +0000)
committerMiztah <myztah@gmail.com>
Mon, 21 Jul 2014 16:38:28 +0000 (16:38 +0000)
involve killing a world spawned mobile
[added] Tolan Nokkar quest to kill a Tusken King (Tatooine)
[fixed] Escort npcs can no longer be conversed with after being brought
back to the quest giver

Change-Id: Ia85b56a24ca232b10365801a660c4a8b2571895d

MMOCoreORB/bin/scripts/mobile/conversations/themepark/logic/mission_giver_conv.lua
MMOCoreORB/bin/scripts/mobile/quest/serverobjects.lua
MMOCoreORB/bin/scripts/mobile/quest/tatooine/tolan_nokkar.lua [new file with mode: 0644]
MMOCoreORB/bin/scripts/mobile/quest/tatooine/tusken_king_quest.lua [new file with mode: 0644]
MMOCoreORB/bin/scripts/screenplays/screenplays.lua
MMOCoreORB/bin/scripts/screenplays/static_spawns/tatooine_static_spawns_south.lua
MMOCoreORB/bin/scripts/screenplays/tasks/tatooine/tolan_nokkar.lua [new file with mode: 0644]
MMOCoreORB/bin/scripts/screenplays/themepark/themeParkLogic.lua

index 6eb811a..d9efb80 100644 (file)
@@ -279,6 +279,7 @@ createMissionGiverConvoTemplate("lorne_prestar_mission_giver_convotemplate", "lo
 createMissionGiverConvoTemplate("phinea_shantee_mission_giver_convotemplate", "phinea_shantee_mission_giver_conv_handler")
 createMissionGiverConvoTemplate("prefect_talmont_mission_giver_convotemplate", "prefect_talmont_mission_giver_conv_handler")
 createMissionGiverConvoTemplate("gramm_rile_mission_giver_convotemplate", "gramm_rile_mission_giver_conv_handler")
+createMissionGiverConvoTemplate("tolan_nokkar_mission_giver_convotemplate", "tolan_nokkar_mission_giver_conv_handler")
 
 
 -- Naboo
index 64b18ae..21bd4ff 100644 (file)
@@ -532,8 +532,10 @@ includeFile("quest/tatooine/theme_park_jabba_veterinarian.lua")
 includeFile("quest/tatooine/theme_park_jawa.lua")
 includeFile("quest/tatooine/thermal_det.lua")
 includeFile("quest/tatooine/tiem_rutnar.lua")
+includeFile("quest/tatooine/tolan_nokkar.lua")
 includeFile("quest/tatooine/triggo_binz.lua")
 includeFile("quest/tatooine/trone_thanamiroc.lua")
+includeFile("quest/tatooine/tusken_king_quest.lua")
 includeFile("quest/tatooine/valarian_chief_assassin.lua")
 includeFile("quest/tatooine/valarian_compound_guard_quest.lua")
 includeFile("quest/tatooine/valarian_courier.lua")
diff --git a/MMOCoreORB/bin/scripts/mobile/quest/tatooine/tolan_nokkar.lua b/MMOCoreORB/bin/scripts/mobile/quest/tatooine/tolan_nokkar.lua
new file mode 100644 (file)
index 0000000..5fcba20
--- /dev/null
@@ -0,0 +1,80 @@
+tolan_nokkar = Creature:new {
+       objectName = "",
+       customName = "Tolan Nokkar",
+       socialGroup = "townsperson",
+       pvpFaction = "townsperson",
+       faction = "townsperson",
+       level = 4,
+       chanceHit = 0.24,
+       damageMin = 40,
+       damageMax = 45,
+       baseXp = 62,
+       baseHAM = 113,
+       baseHAMmax = 138,
+       armor = 0,
+       resists = {15,15,15,15,15,15,15,-1,-1},
+       meatType = "",
+       meatAmount = 0,
+       hideType = "",
+       hideAmount = 0,
+       boneType = "",
+       boneAmount = 0,
+       milk = 0,
+       tamingChance = 0,
+       ferocity = 0,
+       pvpBitmask = NONE,
+       creatureBitmask = HERD,
+       optionsBitmask = 136,
+       diet = HERBIVORE,
+
+       templates = {"object/mobile/dressed_commoner_tatooine_aqualish_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_05.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_06.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_07.iff",
+                                       "object/mobile/dressed_commoner_tatooine_aqualish_male_08.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_05.iff",
+                                       "object/mobile/dressed_commoner_tatooine_bith_male_06.iff",
+                                       "object/mobile/dressed_commoner_tatooine_devaronian_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_devaronian_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_devaronian_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_devaronian_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_ishitib_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_ishitib_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_ishitib_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_05.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_06.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_07.iff",
+                                       "object/mobile/dressed_commoner_tatooine_nikto_male_08.iff",
+                                       "object/mobile/dressed_commoner_tatooine_rodian_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_rodian_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_rodian_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_rodian_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_02.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_03.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_04.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_05.iff",
+                                       "object/mobile/dressed_commoner_tatooine_sullustan_male_06.iff",
+                                       "object/mobile/dressed_commoner_tatooine_trandoshan_male_01.iff",
+                                       "object/mobile/dressed_commoner_tatooine_trandoshan_male_02.iff"
+                                       },
+                               
+       lootGroups = {},
+       weapons = {},
+       conversationTemplate = "tolan_nokkar_mission_giver_convotemplate",
+       attacks = {
+       }
+}
+
+CreatureTemplates:addCreatureTemplate(tolan_nokkar, "tolan_nokkar")
\ No newline at end of file
diff --git a/MMOCoreORB/bin/scripts/mobile/quest/tatooine/tusken_king_quest.lua b/MMOCoreORB/bin/scripts/mobile/quest/tatooine/tusken_king_quest.lua
new file mode 100644 (file)
index 0000000..1a9c54d
--- /dev/null
@@ -0,0 +1,51 @@
+tusken_king_quest = Creature:new {
+       objectName = "@mob/creature_names:tusken_king_quest",
+       socialGroup = "tusken_raider",
+       pvpFaction = "tusken_raider",
+       faction = "tusken_raider",
+       level = 95,
+       chanceHit = 0.9,
+       damageMin = 630,
+       damageMax = 970,
+       baseXp = 9057,
+       baseHAM = 22000,
+       baseHAMmax = 27000,
+       armor = 2,
+       resists = {45,35,5,80,-1,50,5,5,-1},
+       meatType = "",
+       meatAmount = 0,
+       hideType = "",
+       hideAmount = 0,
+       boneType = "",
+       boneAmount = 0,
+       milk = 0,
+       tamingChance = 0,
+       ferocity = 0,
+       pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY,
+       creatureBitmask = PACK + STALKER,
+       optionsBitmask = 128,
+       diet = HERBIVORE,
+
+       templates = {"object/mobile/tusken_raider.iff"},
+       lootGroups = {
+               {
+                       groups = {
+                               {group = "junk", chance = 1500000},
+                               {group = "tusken_common", chance = 3000000},
+                               {group = "wearables_all", chance = 2000000},                            
+                               {group = "bone_armor", chance = 750000},
+                               {group = "chitin_armor", chance = 750000},
+                               {group = "armor_attachments", chance = 500000},
+                               {group = "clothing_attachments", chance = 500000},
+                               {group = "color_crystals", chance = 500000},
+                               {group = "crystals_quality", chance = 500000}
+                       },
+                       lootChance = 4000000
+               }                       
+       },
+       weapons = {"tusken_weapons"},
+       conversationTemplate = "",
+       attacks = merge(marksmanmaster,brawlermaster,fencermaster,riflemanmaster)
+}
+
+CreatureTemplates:addCreatureTemplate(tusken_king_quest, "tusken_king_quest")
\ No newline at end of file
index 71bb51a..4fde6e6 100644 (file)
@@ -119,6 +119,7 @@ includeFile("tasks/tatooine/phinea_shantee.lua")
 includeFile("tasks/tatooine/prefect_talmont.lua")
 includeFile("tasks/tatooine/rakir_banai.lua")
 includeFile("tasks/tatooine/tekil_barje.lua")
+includeFile("tasks/tatooine/tolan_nokkar.lua")
 includeFile("tasks/tatooine/vardias_tyne.lua")
 includeFile("tasks/yavin4/gins_darone.lua")
 includeFile("tasks/yavin4/lian_byrne.lua")
index 5b7fd13..d451588 100644 (file)
@@ -40,7 +40,7 @@ end
 function TatooineStaticSpawnsSouthScreenPlay:spawnMobiles()
 
        --Tusken King Quest
-       spawnMobile("tatooine", "tusken_chief", 300, -5350.2, 40, -4442.5, 139, 0)--entrance, spawns clock wise
+       spawnMobile("tatooine", "tusken_king_quest", 300, -5350.2, 40, -4442.5, 139, 0)--entrance, spawns clock wise
 
        spawnMobile("tatooine", "tusken_bantha", 300, -5342.5, 40, -4430.6, 151, 0)
 
diff --git a/MMOCoreORB/bin/scripts/screenplays/tasks/tatooine/tolan_nokkar.lua b/MMOCoreORB/bin/scripts/screenplays/tasks/tatooine/tolan_nokkar.lua
new file mode 100644 (file)
index 0000000..dfc2abb
--- /dev/null
@@ -0,0 +1,39 @@
+tolan_nokkar_missions =
+       {
+               {
+                       missionType = "hunt",
+                       huntTarget = { npcTemplate = "tusken_king_quest", npcName = "A Tusken King", planetName = "tatooine", waypointX = -5320, waypointY = -4442 },
+                       rewards =
+                       {
+                               { rewardType = "credits", amount = 20000 },
+                       }
+               },
+
+       }
+
+npcMapTolanNokkar =
+       {
+               {
+                       spawnData = { planetName = "tatooine", npcTemplate = "tolan_nokkar", x = -5477, z = 30.0, y = -3881, direction = 118, cellID = 0, position = STAND },
+                       worldPosition = { x = -5477, y = -3881 },
+                       npcNumber = 1,
+                       stfFile = "@spawning/static_npc/tusken_village_quest_npc",
+                       missions = tolan_nokkar_missions
+               },
+       }
+
+TolanNokkar = ThemeParkLogic:new {
+       numberOfActs = 1,
+       npcMap = npcMapTolanNokkar,
+       className = "TolanNokkar",
+       screenPlayState = "tolan_nokkar_quest",
+}
+
+registerScreenPlay("TolanNokkar", true)
+
+tolan_nokkar_mission_giver_conv_handler = mission_giver_conv_handler:new {
+       themePark = TolanNokkar
+}
+tolan_nokkar_mission_target_conv_handler = mission_target_conv_handler:new {
+       themePark = TolanNokkar
+}
\ No newline at end of file
index 4e33706..f8ce27a 100644 (file)
@@ -362,6 +362,8 @@ function ThemeParkLogic:handleMissionAccept(npcNumber, missionNumber, pConversin
                return self:handleConfiscateMissionAccept(mission, pConversingPlayer, missionNumber)
        elseif mission.missionType == "destroy" then
                return self:handleDestroyMissionAccept(mission, pConversingPlayer, missionNumber)
+       elseif mission.missionType == "hunt" then
+               return self:handleHuntMissionAccept(mission, pConversingPlayer, missionNumber)
        end
 end
 
@@ -433,6 +435,15 @@ function ThemeParkLogic:handleAssassinateMissionAccept(mission, pConversingPlaye
        end
 end
 
+function ThemeParkLogic:handleHuntMissionAccept(mission, pConversingPlayer, missionNumber)
+       if self:startHuntMission(mission, pConversingPlayer) == true then
+               self:writeData(pConversingPlayer, ":activeMission", 1)
+               return true
+       else
+               return false
+       end
+end
+
 function ThemeParkLogic:handleConfiscateMissionAccept(mission, pConversingPlayer, missionNumber)
        if self:spawnMissionNpcs(mission, pConversingPlayer) == true then
                self:writeData(pConversingPlayer, ":activeMission", 1)
@@ -510,6 +521,38 @@ function ThemeParkLogic:spawnMissionStaticObjects(mission, pConversingPlayer, x,
        end)
 end
 
+function ThemeParkLogic:startHuntMission(mission, pConversingPlayer)
+       if pConversingPlayer == nil then
+               return false
+       end
+       printf("planet: " .. mission.huntTarget.planetName .. " " .. mission.huntTarget.waypointX .. " " .. mission.huntTarget.waypointY .. "\n")
+       self:updateWaypoint(pConversingPlayer, mission.huntTarget.planetName, mission.huntTarget.waypointX, mission.huntTarget.waypointY, "target")
+       createObserver(KILLEDCREATURE, self.className, "notifyKilledHuntTarget", pConversingPlayer)
+
+       return true
+end
+
+function ThemeParkLogic:notifyKilledHuntTarget(pAttacker, pVictim)
+       if pVictim == nil or pAttacker == nil then
+               return 0
+       end
+
+       local victim = LuaCreatureObject(pVictim)
+       local attacker = LuaCreatureObject(pAttacker)
+
+
+       ObjectManager.withSceneObject(pVictim, function(victim)
+               local npcNumber = self:getActiveNpcNumber(pAttacker)
+               local missionNumber = self:getCurrentMissionNumber(npcNumber, pAttacker)
+               local mission = self:getMission(npcNumber, missionNumber)
+               
+               if (victim:getObjectName() == mission.huntTarget.npcTemplate) then
+                       self:completeMission(pAttacker)
+               end
+       end)
+       return 1
+end
+
 function ThemeParkLogic:spawnMissionNpcs(mission, pConversingPlayer)
        if pConversingPlayer == nil then
                return false
@@ -1040,6 +1083,8 @@ function ThemeParkLogic:getDefaultWaypointName(pConversingPlayer, direction)
                if currentMissionType == "deliver" then
                        local missionItemName = missionItem[1].itemName
                        return "Deliver " .. missionItemName
+               elseif currentMissionType == "hunt" then
+                       return "Hunt " .. mission.huntTarget.npcName
                elseif currentMissionType == "escort" then
                        return "Escort " .. mainNpcName
                elseif currentMissionType == "retrieve" then
@@ -1096,6 +1141,7 @@ function ThemeParkLogic:notifyEnteredEscortArea(pActiveArea, pCreature)
                        local escortNpcID = readData(activeArea:getObjectID() .. ":escortNpcID")
 
                        if (objectID == escortNpcID) then
+                               creature:setOptionsBitmask(128)
                                local ownerID = readData(escortNpcID .. ":missionOwnerID")
                                local pPlayer = getCreatureObject(ownerID)