From a136707d4def1bfc7942dbacdaff3d32d0ba6c53 Mon Sep 17 00:00:00 2001 From: Wanne Date: Wed, 19 Jun 2013 11:22:57 +0000 Subject: [PATCH] New Lua Externalization (Quests.lua) (by Jazz) - New File "Quests.lua" - Modders can now define new events relating to tasks (from 0 to 254) - Fixed missing laptop history quest text when escorted S. to Estoni git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@1679 4f8fa57e-7814-0410-bad4-adc449f26b7c --- .../Data-1.13/Scripts/InterfaceDialogue.lua | 55 +++--- gamedir/Data-1.13/Scripts/Overhead.lua | 57 +++--- gamedir/Data-1.13/Scripts/Quests.lua | 173 ++++++++++++++++++ .../Scripts/StrategicEventHandler.lua | 52 +++--- gamedir/Data-1.13/Scripts/strategicmap.lua | 54 +++--- gamedir/Data-UB/Scripts/InterfaceDialogue.lua | 57 +++--- gamedir/Data-UB/Scripts/Overhead.lua | 54 +++--- gamedir/Data-UB/Scripts/Quests.lua | 173 ++++++++++++++++++ .../Data-UB/Scripts/StrategicEventHandler.lua | 55 +++--- gamedir/Data-UB/Scripts/strategicmap.lua | 61 +++--- gamedir/Data/Scripts/InterfaceDialogue.lua | 55 +++--- gamedir/Data/Scripts/Overhead.lua | 57 +++--- gamedir/Data/Scripts/Quests.lua | 173 ++++++++++++++++++ .../Data/Scripts/StrategicEventHandler.lua | 52 +++--- gamedir/Data/Scripts/strategicmap.lua | 54 +++--- 15 files changed, 894 insertions(+), 288 deletions(-) create mode 100644 gamedir/Data-1.13/Scripts/Quests.lua create mode 100644 gamedir/Data-UB/Scripts/Quests.lua create mode 100644 gamedir/Data/Scripts/Quests.lua diff --git a/gamedir/Data-1.13/Scripts/InterfaceDialogue.lua b/gamedir/Data-1.13/Scripts/InterfaceDialogue.lua index 7bf830846..169428e21 100644 --- a/gamedir/Data-1.13/Scripts/InterfaceDialogue.lua +++ b/gamedir/Data-1.13/Scripts/InterfaceDialogue.lua @@ -41,30 +41,37 @@ QUESTINPROGRESS = 1, QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, +Quests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + + -- max Quests 254 } SectorY = { diff --git a/gamedir/Data-1.13/Scripts/Overhead.lua b/gamedir/Data-1.13/Scripts/Overhead.lua index 8c00da030..cc5fb3f3c 100644 --- a/gamedir/Data-1.13/Scripts/Overhead.lua +++ b/gamedir/Data-1.13/Scripts/Overhead.lua @@ -13,6 +13,7 @@ Facts = FACT_FIRST_ROBOT_DESTROYED = 203, FACT_ROBOT_READY_SECOND_TIME = 205, FACT_SECOND_ROBOT_DESTROYED = 206, + FACT_ESTONI_REFUELLING_POSSIBLE = 277, } Attitude = @@ -29,29 +30,35 @@ Attitude = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + + -- max Quests 254 } Profil = @@ -227,6 +234,10 @@ end function HandleAtNewGridNo( ProfileId ) + if ( CheckFact ( Facts.FACT_ESTONI_REFUELLING_POSSIBLE, 0) == true and CheckQuest(Quests.QUEST_ESCORT_SHANK) == pQuest.QUESTINPROGRESS ) then + EndQuest( Quests.QUEST_ESCORT_SHANK, gWorldSectorX, gWorldSectorY ) + end + TeamSoldier = FindSoldierTeam (ProfileId) if ( TeamSoldier == Team.OUR_TEAM ) then -- Team diff --git a/gamedir/Data-1.13/Scripts/Quests.lua b/gamedir/Data-1.13/Scripts/Quests.lua new file mode 100644 index 000000000..eed1a57b5 --- /dev/null +++ b/gamedir/Data-1.13/Scripts/Quests.lua @@ -0,0 +1,173 @@ +--[[ +http://legion.itzg.pl/mzgb/pmwiki/pmwiki.php?n=JaggedAlliance2UBV1.Jav113lua +Remember! Not to use function EndQuest(QuestID, x, y) and StartQuest(QuestID, x, y) in the file "Quests.lua". +]] + + +nQuests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + QUEST_23 = 23, -- Start quest 46, End quest 47 + QUEST_24 = 24, -- Start quest 48, End quest 49 + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 + + -- max Quests 254 +} + +qStatus = { + QUESTNOTSTARTED = 0, + QUESTINPROGRESS = 1, + QUESTDONE = 2, + } + +Profiles = +{ + DYNAMO = 66, + CARMEN = 78, + MADAME = 107, +} + +nHistory = { + HISTORY_QUEST_STARTED = 15, + HISTORY_QUEST_FINISHED = 16, + } + +nFacts = { + + FACT_ESTONI_REFUELLING_POSSIBLE = 277, + +} + +local NO_PROFILE = 200 + +function InternalStartQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + +if ( CheckQuest(ubQuest) == qStatus.QUESTNOTSTARTED ) then + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + if ( fUpdateHistory == true) then + if ( is_networked == 0 ) then + SetHistoryFact( nHistory.HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY ) + end + end + else + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + end + +end + +function InternalEndQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + + if ( not ( CheckQuest(ubQuest) == qStatus.QUESTDONE ) and fUpdateHistory == true ) then + + if ( ubQuest == nQuests.QUEST_FOOD_ROUTE ) then + -- food quest is handled differently (completing when spoken to father Walker) + elseif ( ubQuest == nQuests.QUEST_DELIVER_LETTER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_LEATHER_SHOP_DREAM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_SKYRIDER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHOPPER_PILOT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_CHILDREN ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_SCIENTIST ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_DELIVER_VIDEO_CAMERA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_HERMIT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_DYNAMO ) then + + -- don't give Dynamo reward for himself + if ( CheckMercIsDead ( Profiles.DYNAMO ) == false ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, Profiles.DYNAMO ) + end + + elseif ( ubQuest == nQuests.QUEST_KINGPIN_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHITZENA_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_HELD_IN_ALMA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RUNAWAY_JOEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_TOURISTS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ARMY_FARM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KINGPIN_MONEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_BLOODCATS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 7, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_INTERROGATION ) then + -- we get here only if wiped out enemies after interrogation + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CREATURES ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KILL_TERRORISTS ) then + + -- only reduced experiences if we chosen Slay over Carmen + if ( CheckMercIsDead ( Profiles.CARMEN ) == true ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 9, NO_PROFILE ) + end + + elseif ( ubQuest == nQuests.QUEST_KILL_DEIDRANNA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 25, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_SHANK ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + end + + + end + + if ( CheckQuest(ubQuest) == qStatus.QUESTINPROGRESS ) then + + SetQuest( ubQuest, qStatus.QUESTDONE ) + + if ( fUpdateHistory == true ) then + ResetHistoryFact( ubQuest, sSectorX, sSectorY ) + end + else + SetQuest( ubQuest, qStatus.QUESTDONE ) + end + + if ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + + -- cheap hack to try to prevent Madame Layla from thinking that you are + -- still in the brothel with Maria... + SetNPCData1(Profiles.MADAME, 0) + SetNPCData2(Profiles.MADAME, 0) + end + + +end \ No newline at end of file diff --git a/gamedir/Data-1.13/Scripts/StrategicEventHandler.lua b/gamedir/Data-1.13/Scripts/StrategicEventHandler.lua index 02f34ff8a..7dcdebeae 100644 --- a/gamedir/Data-1.13/Scripts/StrategicEventHandler.lua +++ b/gamedir/Data-1.13/Scripts/StrategicEventHandler.lua @@ -373,29 +373,35 @@ qStatus = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + + -- max Quests 254 } ProfileType = diff --git a/gamedir/Data-1.13/Scripts/strategicmap.lua b/gamedir/Data-1.13/Scripts/strategicmap.lua index f07b09b10..9a0b8aa8e 100644 --- a/gamedir/Data-1.13/Scripts/strategicmap.lua +++ b/gamedir/Data-1.13/Scripts/strategicmap.lua @@ -39,31 +39,37 @@ qStatus = { QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, -- JA2 +Quests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + -- max Quests 254 } Facts = { diff --git a/gamedir/Data-UB/Scripts/InterfaceDialogue.lua b/gamedir/Data-UB/Scripts/InterfaceDialogue.lua index ae538dc5e..d8edab460 100644 --- a/gamedir/Data-UB/Scripts/InterfaceDialogue.lua +++ b/gamedir/Data-UB/Scripts/InterfaceDialogue.lua @@ -41,30 +41,39 @@ QUESTINPROGRESS = 1, QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, +Quests = +{ + -- Quests ID -- BinaryData\QUESTS25.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + -- UB Quests + QUEST_DESTROY_MISSLES = 23, -- Start quest 46, End quest 47 + QUEST_FIX_LAPTOP = 24, -- Start quest 48, End quest 49 + QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, -- Start quest 50, End quest 51 + QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, -- Start quest 52, End quest 53 + + -- max Quests 254 } SectorY = { diff --git a/gamedir/Data-UB/Scripts/Overhead.lua b/gamedir/Data-UB/Scripts/Overhead.lua index 3b52e1de2..8129cc704 100644 --- a/gamedir/Data-UB/Scripts/Overhead.lua +++ b/gamedir/Data-UB/Scripts/Overhead.lua @@ -29,29 +29,37 @@ Attitude = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS25.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + -- UB Quests + QUEST_DESTROY_MISSLES = 23, -- Start quest 46, End quest 47 + QUEST_FIX_LAPTOP = 24, -- Start quest 48, End quest 49 + QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, -- Start quest 50, End quest 51 + QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, -- Start quest 52, End quest 53 + + -- max Quests 254 } Profil = diff --git a/gamedir/Data-UB/Scripts/Quests.lua b/gamedir/Data-UB/Scripts/Quests.lua new file mode 100644 index 000000000..7cda30c1b --- /dev/null +++ b/gamedir/Data-UB/Scripts/Quests.lua @@ -0,0 +1,173 @@ +--[[ +http://legion.itzg.pl/mzgb/pmwiki/pmwiki.php?n=JaggedAlliance2UBV1.Jav113lua +Remember! Not to use function EndQuest(QuestID, x, y) and StartQuest(QuestID, x, y) in the file "Quests.lua". +]] + + +nQuests = +{ + -- Quests ID -- BinaryData\QUESTS25.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + -- UB Quests + QUEST_DESTROY_MISSLES = 23, -- Start quest 46, End quest 47 + QUEST_FIX_LAPTOP = 24, -- Start quest 48, End quest 49 + QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, -- Start quest 50, End quest 51 + QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, -- Start quest 52, End quest 53 + + -- max Quests 254 +} + +qStatus = { + QUESTNOTSTARTED = 0, + QUESTINPROGRESS = 1, + QUESTDONE = 2, + } + +Profiles = +{ + DYNAMO = 66, + CARMEN = 78, + MADAME = 107, +} + +nHistory = { + HISTORY_QUEST_STARTED = 15, + HISTORY_QUEST_FINISHED = 16, + } + +nFacts = { + + FACT_ESTONI_REFUELLING_POSSIBLE = 277, + +} + +local NO_PROFILE = 200 + +function InternalStartQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + +if ( CheckQuest(ubQuest) == qStatus.QUESTNOTSTARTED ) then + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + if ( fUpdateHistory == true) then + if ( is_networked == 0 ) then + SetHistoryFact( nHistory.HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY ) + end + end + else + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + end + +end + +function InternalEndQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + + if ( not ( CheckQuest(ubQuest) == qStatus.QUESTDONE ) and fUpdateHistory == true ) then + + if ( ubQuest == nQuests.QUEST_FOOD_ROUTE ) then + -- food quest is handled differently (completing when spoken to father Walker) + elseif ( ubQuest == nQuests.QUEST_DELIVER_LETTER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_LEATHER_SHOP_DREAM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_SKYRIDER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHOPPER_PILOT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_CHILDREN ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_SCIENTIST ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_DELIVER_VIDEO_CAMERA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_HERMIT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_DYNAMO ) then + + -- don't give Dynamo reward for himself + if ( CheckMercIsDead ( Profiles.DYNAMO ) == false ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, Profiles.DYNAMO ) + end + + elseif ( ubQuest == nQuests.QUEST_KINGPIN_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHITZENA_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_HELD_IN_ALMA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RUNAWAY_JOEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_TOURISTS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ARMY_FARM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KINGPIN_MONEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_BLOODCATS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 7, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_INTERROGATION ) then + -- we get here only if wiped out enemies after interrogation + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CREATURES ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KILL_TERRORISTS ) then + + -- only reduced experiences if we chosen Slay over Carmen + if ( CheckMercIsDead ( Profiles.CARMEN ) == true ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 9, NO_PROFILE ) + end + + elseif ( ubQuest == nQuests.QUEST_ESCORT_SHANK ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + end + + + end + + if ( CheckQuest(ubQuest) == qStatus.QUESTINPROGRESS ) then + + SetQuest( ubQuest, qStatus.QUESTDONE ) + + if ( fUpdateHistory == true ) then + ResetHistoryFact( ubQuest, sSectorX, sSectorY ) + end + else + SetQuest( ubQuest, qStatus.QUESTDONE ) + end + + if ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + + -- cheap hack to try to prevent Madame Layla from thinking that you are + -- still in the brothel with Maria... + SetNPCData1(Profiles.MADAME, 0) + SetNPCData2(Profiles.MADAME, 0) + end + + +end \ No newline at end of file diff --git a/gamedir/Data-UB/Scripts/StrategicEventHandler.lua b/gamedir/Data-UB/Scripts/StrategicEventHandler.lua index a81037431..9f78bfec5 100644 --- a/gamedir/Data-UB/Scripts/StrategicEventHandler.lua +++ b/gamedir/Data-UB/Scripts/StrategicEventHandler.lua @@ -372,31 +372,38 @@ qStatus = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS25.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + -- UB Quests + QUEST_DESTROY_MISSLES = 23, -- Start quest 46, End quest 47 + QUEST_FIX_LAPTOP = 24, -- Start quest 48, End quest 49 + QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, -- Start quest 50, End quest 51 + QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, -- Start quest 52, End quest 53 + + -- max Quests 254 } - ProfileType = { None = 0, diff --git a/gamedir/Data-UB/Scripts/strategicmap.lua b/gamedir/Data-UB/Scripts/strategicmap.lua index 30fd3d2f1..7a45b9723 100644 --- a/gamedir/Data-UB/Scripts/strategicmap.lua +++ b/gamedir/Data-UB/Scripts/strategicmap.lua @@ -38,36 +38,39 @@ QUESTINPROGRESS = 1, QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, --- QUEST_KILL_DEIDRANNA = 25, -- JA2 +Quests = +{ + -- Quests ID -- BinaryData\QUESTS25.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + -- UB Quests + QUEST_DESTROY_MISSLES = 23, -- Start quest 46, End quest 47 + QUEST_FIX_LAPTOP = 24, -- Start quest 48, End quest 49 + QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, -- Start quest 50, End quest 51 + QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, -- Start quest 52, End quest 53 --- UB Quests - QUEST_DESTROY_MISSLES = 23, - QUEST_FIX_LAPTOP = 24, - QUEST_GET_RID_BLOODCATS_AT_BETTYS = 25, - QUEST_FIND_ANTIQUE_MUSKET_FOR_RAUL = 26, + -- max Quests 254 } Facts = { diff --git a/gamedir/Data/Scripts/InterfaceDialogue.lua b/gamedir/Data/Scripts/InterfaceDialogue.lua index 7bf830846..169428e21 100644 --- a/gamedir/Data/Scripts/InterfaceDialogue.lua +++ b/gamedir/Data/Scripts/InterfaceDialogue.lua @@ -41,30 +41,37 @@ QUESTINPROGRESS = 1, QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, +Quests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + + -- max Quests 254 } SectorY = { diff --git a/gamedir/Data/Scripts/Overhead.lua b/gamedir/Data/Scripts/Overhead.lua index 8c00da030..dfc3208dd 100644 --- a/gamedir/Data/Scripts/Overhead.lua +++ b/gamedir/Data/Scripts/Overhead.lua @@ -13,6 +13,7 @@ Facts = FACT_FIRST_ROBOT_DESTROYED = 203, FACT_ROBOT_READY_SECOND_TIME = 205, FACT_SECOND_ROBOT_DESTROYED = 206, + FACT_ESTONI_REFUELLING_POSSIBLE = 277, } Attitude = @@ -29,29 +30,35 @@ Attitude = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + QUEST_23 = 23, -- Start quest 46, End quest 47 + QUEST_24 = 24, -- Start quest 48, End quest 49 + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 + + -- max Quests 254 } Profil = @@ -227,6 +234,10 @@ end function HandleAtNewGridNo( ProfileId ) + if ( CheckFact ( Facts.FACT_ESTONI_REFUELLING_POSSIBLE, 0) == true and CheckQuest(Quests.QUEST_ESCORT_SHANK) == pQuest.QUESTINPROGRESS ) then + EndQuest( Quests.QUEST_ESCORT_SHANK, gWorldSectorX, gWorldSectorY ) + end + TeamSoldier = FindSoldierTeam (ProfileId) if ( TeamSoldier == Team.OUR_TEAM ) then -- Team diff --git a/gamedir/Data/Scripts/Quests.lua b/gamedir/Data/Scripts/Quests.lua new file mode 100644 index 000000000..eed1a57b5 --- /dev/null +++ b/gamedir/Data/Scripts/Quests.lua @@ -0,0 +1,173 @@ +--[[ +http://legion.itzg.pl/mzgb/pmwiki/pmwiki.php?n=JaggedAlliance2UBV1.Jav113lua +Remember! Not to use function EndQuest(QuestID, x, y) and StartQuest(QuestID, x, y) in the file "Quests.lua". +]] + + +nQuests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 + QUEST_23 = 23, -- Start quest 46, End quest 47 + QUEST_24 = 24, -- Start quest 48, End quest 49 + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 + + -- max Quests 254 +} + +qStatus = { + QUESTNOTSTARTED = 0, + QUESTINPROGRESS = 1, + QUESTDONE = 2, + } + +Profiles = +{ + DYNAMO = 66, + CARMEN = 78, + MADAME = 107, +} + +nHistory = { + HISTORY_QUEST_STARTED = 15, + HISTORY_QUEST_FINISHED = 16, + } + +nFacts = { + + FACT_ESTONI_REFUELLING_POSSIBLE = 277, + +} + +local NO_PROFILE = 200 + +function InternalStartQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + +if ( CheckQuest(ubQuest) == qStatus.QUESTNOTSTARTED ) then + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + if ( fUpdateHistory == true) then + if ( is_networked == 0 ) then + SetHistoryFact( nHistory.HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY ) + end + end + else + SetQuest( ubQuest, qStatus.QUESTINPROGRESS ) + end + +end + +function InternalEndQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) + + if ( not ( CheckQuest(ubQuest) == qStatus.QUESTDONE ) and fUpdateHistory == true ) then + + if ( ubQuest == nQuests.QUEST_FOOD_ROUTE ) then + -- food quest is handled differently (completing when spoken to father Walker) + elseif ( ubQuest == nQuests.QUEST_DELIVER_LETTER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_LEATHER_SHOP_DREAM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_SKYRIDER ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHOPPER_PILOT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_CHILDREN ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_SCIENTIST ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_DELIVER_VIDEO_CAMERA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FIND_HERMIT ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_FREE_DYNAMO ) then + + -- don't give Dynamo reward for himself + if ( CheckMercIsDead ( Profiles.DYNAMO ) == false ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 4, Profiles.DYNAMO ) + end + + elseif ( ubQuest == nQuests.QUEST_KINGPIN_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CHITZENA_IDOL ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_HELD_IN_ALMA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_RUNAWAY_JOEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_TOURISTS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ARMY_FARM ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KINGPIN_MONEY ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_BLOODCATS ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 7, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_INTERROGATION ) then + -- we get here only if wiped out enemies after interrogation + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_CREATURES ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_KILL_TERRORISTS ) then + + -- only reduced experiences if we chosen Slay over Carmen + if ( CheckMercIsDead ( Profiles.CARMEN ) == true ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 9, NO_PROFILE ) + end + + elseif ( ubQuest == nQuests.QUEST_KILL_DEIDRANNA ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 25, NO_PROFILE ) + elseif ( ubQuest == nQuests.QUEST_ESCORT_SHANK ) then + GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE ) + else + GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE ) + end + + + end + + if ( CheckQuest(ubQuest) == qStatus.QUESTINPROGRESS ) then + + SetQuest( ubQuest, qStatus.QUESTDONE ) + + if ( fUpdateHistory == true ) then + ResetHistoryFact( ubQuest, sSectorX, sSectorY ) + end + else + SetQuest( ubQuest, qStatus.QUESTDONE ) + end + + if ( ubQuest == nQuests.QUEST_RESCUE_MARIA ) then + + -- cheap hack to try to prevent Madame Layla from thinking that you are + -- still in the brothel with Maria... + SetNPCData1(Profiles.MADAME, 0) + SetNPCData2(Profiles.MADAME, 0) + end + + +end \ No newline at end of file diff --git a/gamedir/Data/Scripts/StrategicEventHandler.lua b/gamedir/Data/Scripts/StrategicEventHandler.lua index 02f34ff8a..7dcdebeae 100644 --- a/gamedir/Data/Scripts/StrategicEventHandler.lua +++ b/gamedir/Data/Scripts/StrategicEventHandler.lua @@ -373,29 +373,35 @@ qStatus = Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + + -- max Quests 254 } ProfileType = diff --git a/gamedir/Data/Scripts/strategicmap.lua b/gamedir/Data/Scripts/strategicmap.lua index f07b09b10..9a0b8aa8e 100644 --- a/gamedir/Data/Scripts/strategicmap.lua +++ b/gamedir/Data/Scripts/strategicmap.lua @@ -39,31 +39,37 @@ qStatus = { QUESTDONE = 2, } -Quests = { - QUEST_DELIVER_LETTER = 0, - QUEST_FOOD_ROUTE = 1, - QUEST_KILL_TERRORISTS = 2, - QUEST_KINGPIN_IDOL = 3, - QUEST_KINGPIN_MONEY = 4, - QUEST_RUNAWAY_JOEY = 5, - QUEST_RESCUE_MARIA = 6, - QUEST_CHITZENA_IDOL = 7, - QUEST_HELD_IN_ALMA = 8, - QUEST_INTERROGATION = 9, - QUEST_ARMY_FARM = 10, - QUEST_FIND_SCIENTIST = 11, - QUEST_DELIVER_VIDEO_CAMERA = 12, - QUEST_BLOODCATS = 13, - QUEST_FIND_HERMIT = 14, - QUEST_CREATURES = 15, - QUEST_CHOPPER_PILOT = 16, - QUEST_ESCORT_SKYRIDER = 17, - QUEST_FREE_DYNAMO = 18, - QUEST_ESCORT_TOURISTS = 19, - QUEST_FREE_CHILDREN = 20, - QUEST_LEATHER_SHOP_DREAM = 21, - QUEST_KILL_DEIDRANNA = 25, -- JA2 +Quests = +{ + -- Quests ID -- BinaryData\QUESTS.EDT Record + QUEST_DELIVER_LETTER = 0, -- Start quest 0, End quest 1 - Deliver Letter + QUEST_FOOD_ROUTE = 1, -- Start quest 2, End quest 3 - Food Route + QUEST_KILL_TERRORISTS = 2, -- Start quest 4, End quest 5 - Terrorists + QUEST_KINGPIN_IDOL = 3, -- Start quest 6, End quest 7 - Kingpin Chalice + QUEST_KINGPIN_MONEY = 4, -- Start quest 8, End quest 9 - Kingpin Money + QUEST_RUNAWAY_JOEY = 5, -- Start quest 10, End quest 11 - Runaway Joey + QUEST_RESCUE_MARIA = 6, -- Start quest 12, End quest 13 - Rescue Maria + QUEST_CHITZENA_IDOL = 7, -- Start quest 14, End quest 15 - Chitzena Chalice + QUEST_HELD_IN_ALMA = 8, -- Start quest 16, End quest 17 - Held in Alma + QUEST_INTERROGATION = 9, -- Start quest 18, End quest 19 - Interogation + QUEST_ARMY_FARM = 10, -- Start quest 20, End quest 21 - Hillbilly Problem + QUEST_FIND_SCIENTIST = 11, -- Start quest 22, End quest 23 - Find Scientist + QUEST_DELIVER_VIDEO_CAMERA = 12, -- Start quest 24, End quest 25 - Deliver Video Camera + QUEST_BLOODCATS = 13, -- Start quest 26, End quest 27 - Blood Cats + QUEST_FIND_HERMIT = 14, -- Start quest 28, End quest 29 - Find Hermit + QUEST_CREATURES = 15, -- Start quest 30, End quest 31 - Creatures + QUEST_CHOPPER_PILOT = 16, -- Start quest 32, End quest 33 - Find Chopper Pilot + QUEST_ESCORT_SKYRIDER = 17, -- Start quest 34, End quest 35 - Escort SkyRider + QUEST_FREE_DYNAMO = 18, -- Start quest 36, End quest 37 - Free Dynamo + QUEST_ESCORT_TOURISTS = 19, -- Start quest 38, End quest 39 - Escort Tourists + QUEST_FREE_CHILDREN = 20, -- Start quest 40, End quest 41 - Doreen + QUEST_LEATHER_SHOP_DREAM = 21, -- Start quest 42, End quest 43 - Leather Shop Dream + QUEST_ESCORT_SHANK = 22, -- Start quest 44, End quest 45 - Escort Shank + QUEST_23 = 23, -- Start quest 46, End quest 47 - No 23 Yet + QUEST_24 = 24, -- Start quest 48, End quest 49 - No 24 Yet + QUEST_KILL_DEIDRANNA = 25, -- Start quest 50, End quest 51 - Kill Deidranna + -- max Quests 254 } Facts = {