diff --git a/gamedir/Data-1.13/Scripts/Quests.lua b/gamedir/Data-1.13/Scripts/Quests.lua index eed1a57b5..ed1b1c49e 100644 --- a/gamedir/Data-1.13/Scripts/Quests.lua +++ b/gamedir/Data-1.13/Scripts/Quests.lua @@ -33,6 +33,7 @@ nQuests = 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 + QUEST_KINGPIN_ANGEL_MARIA = 26, -- max Quests 254 } @@ -47,6 +48,9 @@ Profiles = { DYNAMO = 66, CARMEN = 78, + KINGPIN = 86, + MARIA = 88, + ANGEL = 89, MADAME = 107, } @@ -55,23 +59,37 @@ nHistory = { HISTORY_QUEST_FINISHED = 16, } -nFacts = { +Facts = { + FACT_MARIA_ESCAPE_NOTICED = 119, FACT_ESTONI_REFUELLING_POSSIBLE = 277, + FACT_KINGPIN_DEAD = 308, + FACT_KINGPIN_IS_ENEMY = 359, + FACT_BOUNTYHUNTER_SECTOR_1 = 380, + FACT_BOUNTYHUNTER_SECTOR_2 = 381, + FACT_BOUNTYHUNTER_KILLED_1 = 382, + FACT_BOUNTYHUNTER_KILLED_2 = 383, +} +nEvents = { + EVENT_KINGPIN_BOUNTY_INITIAL = 85, + EVENT_KINGPIN_BOUNTY_END_KILLEDTHEM = 86, + EVENT_KINGPIN_BOUNTY_END_TIME_PASSED = 87, } local NO_PROFILE = 200 function InternalStartQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) -if ( CheckQuest(ubQuest) == qStatus.QUESTNOTSTARTED ) then + 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 + + 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 @@ -167,7 +185,131 @@ function InternalEndQuest( ubQuest, sSectorX, sSectorY, fUpdateHistory ) -- still in the brothel with Maria... SetNPCData1(Profiles.MADAME, 0) SetNPCData2(Profiles.MADAME, 0) + + -- if the escape was not noticed, initiate 'bounty hunter' quest. Set a timer, at some point in the future, if we aren't hostile to him etc., + if ( (CheckFact( Facts.FACT_MARIA_ESCAPE_NOTICED, 0 ) == false) and (CheckFact( Facts.FACT_KINGPIN_DEAD, 0 ) == false) and + (CheckFact( Facts.FACT_KINGPIN_IS_ENEMY, 0 ) == false) and (CheckMercIsDead ( Profiles.KINGPIN ) == false) ) then + + -- start the quest + StartQuest( nQuests.QUEST_KINGPIN_ANGEL_MARIA, sSectorX, sSectorY ) + + -- set email from kingpin with a small delay + -- also set up the end of the quest in 7 days + AddFutureDayStrategicEvent(nEvents.EVENT_KINGPIN_BOUNTY_INITIAL, 120, 0, 0) + AddFutureDayStrategicEvent(nEvents.EVENT_KINGPIN_BOUNTY_END_TIME_PASSED, 120, 0, 7) + + -- the silva siblings are placed in one of several sectors and hide there for a week + -- possible sectors: a11, b5, b6, b8, b12, b14, c3, d7 + -- two groups of bounty hunters are hunting them and will be placed in those sectors (but not in the sector the DaSilvas are in) + -- if the player kills off all bounty hunters, the Silvas can escape after one week + + -- select location randomly + local sector_silva = math.random(1, 8) + local sector_hunter1 = math.random(1, 8) + local sector_hunter2 = math.random(1, 8) + + -- we have to make sure no sector is picked twice + while (sector_silva == sector_hunter1) do + sector_hunter1 = math.random(1, 8) + end + + while (sector_silva == sector_hunter2 or sector_hunter1 == sector_hunter2) do + sector_hunter2 = math.random(1, 8) + end + + if sector_silva == 1 then + -- A11 + AddNPCtoSector (Profiles.MARIA,11,1,0) + AddNPCtoSector (Profiles.ANGEL,11,1,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 11245) + SetProfileStrategicInsertionData(Profiles.ANGEL, 10765) + elseif sector_silva == 2 then + -- B5 + AddNPCtoSector (Profiles.MARIA,5,2,0) + AddNPCtoSector (Profiles.ANGEL,5,2,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 9050) + SetProfileStrategicInsertionData(Profiles.ANGEL, 8088) + elseif sector_silva == 3 then + -- B6 + AddNPCtoSector (Profiles.MARIA,6,2,0) + AddNPCtoSector (Profiles.ANGEL,6,2,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 15585) + SetProfileStrategicInsertionData(Profiles.ANGEL, 15906) + elseif sector_silva == 4 then + -- B8 + AddNPCtoSector (Profiles.MARIA,8,2,0) + AddNPCtoSector (Profiles.ANGEL,8,2,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 7092) + SetProfileStrategicInsertionData(Profiles.ANGEL, 7089) + elseif sector_silva == 5 then + -- B12 + AddNPCtoSector (Profiles.MARIA,12,2,0) + AddNPCtoSector (Profiles.ANGEL,12,2,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 4870) + SetProfileStrategicInsertionData(Profiles.ANGEL, 4557) + elseif sector_silva == 6 then + -- B14 + AddNPCtoSector (Profiles.MARIA,14,2,0) + AddNPCtoSector (Profiles.ANGEL,14,2,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 16685) + SetProfileStrategicInsertionData(Profiles.ANGEL, 16045) + elseif sector_silva == 7 then + -- C3 + AddNPCtoSector (Profiles.MARIA,3,3,0) + AddNPCtoSector (Profiles.ANGEL,3,3,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 12345) + SetProfileStrategicInsertionData(Profiles.ANGEL, 12338) + elseif sector_silva == 8 then + -- D7 + AddNPCtoSector (Profiles.MARIA,7,4,0) + AddNPCtoSector (Profiles.ANGEL,7,4,0) + SetProfileStrategicInsertionData(Profiles.MARIA, 19133) + SetProfileStrategicInsertionData(Profiles.ANGEL, 19766) + end + + if sector_hunter1 == 1 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(11, 1) ) + elseif sector_hunter1 == 2 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(5, 2) ) + elseif sector_hunter1 == 3 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(6, 2) ) + elseif sector_hunter1 == 4 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(8, 2) ) + elseif sector_hunter1 == 5 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(12, 2) ) + elseif sector_hunter1 == 6 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(14, 2) ) + elseif sector_hunter1 == 7 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(3, 3) ) + elseif sector_hunter1 == 8 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_1, SECTOR(7, 4) ) + end + + if sector_hunter2 == 1 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(11, 1) ) + elseif sector_hunter2 == 2 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(5, 2) ) + elseif sector_hunter2 == 3 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(6, 2) ) + elseif sector_hunter2 == 4 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(8, 2) ) + elseif sector_hunter2 == 5 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(12, 2) ) + elseif sector_hunter2 == 6 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(14, 2) ) + elseif sector_hunter2 == 7 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(3, 3) ) + elseif sector_hunter2 == 8 then + SetFact(Facts.FACT_BOUNTYHUNTER_SECTOR_2, SECTOR(7, 4) ) + end + end end - + if ( ubQuest == nQuests.QUEST_KINGPIN_ANGEL_MARIA ) then + -- once this quest is over, make sure Maria and Angel are gone + SetCharacterSectorX(Profiles.MARIA, 0) + SetCharacterSectorY(Profiles.MARIA, 0) + SetCharacterSectorX(Profiles.ANGEL, 0) + SetCharacterSectorY(Profiles.ANGEL, 0) + end end \ No newline at end of file diff --git a/gamedir/Data-1.13/Scripts/strategicmap.lua b/gamedir/Data-1.13/Scripts/strategicmap.lua index 4d1e6a29b..d49e22d87 100644 --- a/gamedir/Data-1.13/Scripts/strategicmap.lua +++ b/gamedir/Data-1.13/Scripts/strategicmap.lua @@ -68,6 +68,7 @@ Quests = 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 + QUEST_KINGPIN_ANGEL_MARIA = 26, -- max Quests 254 } @@ -77,6 +78,10 @@ Facts = { FACT_KINGPIN_KNOWS_MONEY_GONE = 103, FACT_KINGPIN_DEAD = 308, FACT_ALL_TERRORISTS_KILLED = 156, + FACT_BOUNTYHUNTER_SECTOR_1 = 380, + FACT_BOUNTYHUNTER_SECTOR_2 = 381, + FACT_BOUNTYHUNTER_KILLED_1 = 382, + FACT_BOUNTYHUNTER_KILLED_2 = 383, } History = { @@ -172,11 +177,26 @@ Profil = MIGUEL = 57, KYLE = 95, } + +SoldierClass = +{ + SOLDIER_CLASS_NONE = 0, + SOLDIER_CLASS_ADMINISTRATOR = 1, + SOLDIER_CLASS_ELITE = 2, + SOLDIER_CLASS_ARMY = 3, +} + +CivGroup = +{ + BOUNTYHUNTER_CIV_GROUP = 25, +} + local gsRobotGridNo function HandleQuestCodeOnSectorEntry( sNewSectorX, sNewSectorY, bNewSectorZ ) - if ( sNewSectorX == 6 and sNewSectorY == SectorY.MAP_ROW_C and gubQuest( Quests.QUEST_RESCUE_MARIA ) == qStatus.QUESTDONE ) then + if ( sNewSectorX == 6 and sNewSectorY == SectorY.MAP_ROW_C and gubQuest( Quests.QUEST_RESCUE_MARIA ) == qStatus.QUESTDONE + and not( gubQuest( Quests.QUEST_KINGPIN_ANGEL_MARIA ) == qStatus.QUESTINPROGRESS) ) then -- make sure Maria and Angel are gone SetCharacterSectorX(Profil.MARIA, 0) SetCharacterSectorY(Profil.MARIA, 0) @@ -259,6 +279,14 @@ function HandleSectorLiberation( sNewSectorX, sNewSectorY, bNewSectorZ, fFirstTi end end end + + -- extra volunteers on freeing Tixa underground. As enemy troops are not replenished underground, this only happens once + if ( bNewSectorZ == 1 ) then + -- Tixa + if ( sNewSectorX == 9 and sNewSectorY == SectorY.MAP_ROW_J ) then + AddVolunteers( 5 ) + end + end end -- this function is called whenever we recruit a RPC @@ -269,3 +297,59 @@ function RecruitRPCAdditionalHandling( usProfile ) AddVolunteers( 10 ) end end + +-- this function is called whenever we enter a sector in tactical +function HandleSectorTacticalEntry( sSectorX, sSectorY, bSectorZ ) + + if ( gubQuest( Quests.QUEST_KINGPIN_ANGEL_MARIA ) == qStatus.QUESTINPROGRESS ) then + + -- Flugente: if the bounty hunter quest is active, add bounty hunters to sectors (location determined on quest start) + if ( (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_1, 0 ) == false) or (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_2, 0 ) == false) and (bSectorZ == 0) ) then + + sector = SECTOR(sSectorX, sSectorY) + sector_hunter1 = GetFact( Facts.FACT_BOUNTYHUNTER_SECTOR_1 ) + sector_hunter2 = GetFact( Facts.FACT_BOUNTYHUNTER_SECTOR_2 ) + + if ( (sector == sector_hunter1) and (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_1, 0 ) == false) ) then + + hostile = 0 + if ( (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_2, 0 ) == true) ) then + hostile = 1 + end + + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ADMINISTRATOR, 13000, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ARMY, 7447, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ARMY, 13032, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 19291, hostile) + + -- dont spawn in deep water + if (sSectorX == 14 and sSectorY == 2) then + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 16533, hostile) + else + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 13557, hostile) + end + end + + if ( (sector == sector_hunter2) and (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_2, 0 ) == false) ) then + + hostile = 0 + if ( (CheckFact( Facts.FACT_BOUNTYHUNTER_KILLED_1, 0 ) == true) ) then + hostile = 1 + end + + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ADMINISTRATOR, 13000, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ARMY, 7447, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ARMY, 13032, hostile) + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 19291, hostile) + + -- dont spawn in deep water + if (sSectorX == 14 and sSectorY == 2) then + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 16533, hostile) + else + CreateArmedCivilain(CivGroup.BOUNTYHUNTER_CIV_GROUP, SoldierClass.SOLDIER_CLASS_ELITE, 13557, hostile) + end + end + end + + end +end diff --git a/gamedir/Data-1.13/TableData/CivGroupNames.xml b/gamedir/Data-1.13/TableData/CivGroupNames.xml index 37a2b67a6..1e800383c 100644 --- a/gamedir/Data-1.13/TableData/CivGroupNames.xml +++ b/gamedir/Data-1.13/TableData/CivGroupNames.xml @@ -165,14 +165,13 @@ 0 0 + - 22 - 1 - Volunteer - 1 - 1 - 0 + 0 + Empty Slot22 + 0 + 0 23 @@ -182,18 +181,22 @@ 0 + 24 - 0 - Empty Slot24 - 0 - 0 + 1 + Volunteer + 1 + 1 + 0 + 25 - 0 - Empty Slot25 - 0 + 1 + Bounty hunter + 1 0 + 1 26 diff --git a/gamedir/Data-1.13/TableData/Email/EmailSenderNameList.xml b/gamedir/Data-1.13/TableData/Email/EmailSenderNameList.xml index 74a502309..904ea9f51 100644 --- a/gamedir/Data-1.13/TableData/Email/EmailSenderNameList.xml +++ b/gamedir/Data-1.13/TableData/Email/EmailSenderNameList.xml @@ -236,7 +236,7 @@ Each A.I.M merc has an entry here in the file, mapped to a specific uiIndex. 52 - None + Angel DaSilva 53 diff --git a/gamedir/Data/NPCData/civ58.edt b/gamedir/Data/NPCData/civ58.edt index 65521df06..11bda2617 100644 Binary files a/gamedir/Data/NPCData/civ58.edt and b/gamedir/Data/NPCData/civ58.edt differ diff --git a/gamedir/Data/NPCData/civ60.edt b/gamedir/Data/NPCData/civ60.edt index 65521df06..5cf8065b0 100644 Binary files a/gamedir/Data/NPCData/civ60.edt and b/gamedir/Data/NPCData/civ60.edt differ diff --git a/gamedir/Data/NPCData/civ61.edt b/gamedir/Data/NPCData/civ61.edt index 65521df06..548f29303 100644 Binary files a/gamedir/Data/NPCData/civ61.edt and b/gamedir/Data/NPCData/civ61.edt differ