From a92341144686afe4e00f7aa68a7392214f3107ed Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 31 May 2015 15:11:32 +0000 Subject: [PATCH] - Lua function HandleSectorLiberation(...) is called whenever we liberate a sector - Lua function RecruitRPCAdditionalHandling(...) is called whenever we recruit a RPC For the moment, both functions add volunteers once important prisons are liberated or Miguel is recruited. git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@2246 4f8fa57e-7814-0410-bad4-adc449f26b7c --- gamedir/Data-1.13/Scripts/strategicmap.lua | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/gamedir/Data-1.13/Scripts/strategicmap.lua b/gamedir/Data-1.13/Scripts/strategicmap.lua index ffe51d5f2..88b498c79 100644 --- a/gamedir/Data-1.13/Scripts/strategicmap.lua +++ b/gamedir/Data-1.13/Scripts/strategicmap.lua @@ -169,6 +169,7 @@ Profil = CARMEN = 78, MADLAB = 146, ROBOT = 62, + MIGUEL = 57, } local gsRobotGridNo @@ -231,4 +232,32 @@ function HandleQuestCodeOnSectorExit( sOldSectorX, sOldSectorY, bOldSectorZ ) -- reset the state of the museum alarm for Eldin's quotes SetFactFalse( Facts.FACT_MUSEUM_ALARM_WENT_OFF ) -end \ No newline at end of file +end + +-- this function is called whenever we liberate a sector. If fFirstTime is true, this is the first time we liberate this sector +function HandleSectorLiberation( sNewSectorX, sNewSectorY, bNewSectorZ, fFirstTime ) + + -- are we liberating this sector for the first time? + if ( fFirstTime ) then + -- we get a few volunteers for liberating prisons - we assume prisoners would be more than eager to fight against the regime + -- due to code limitations, fFirstTime is only used in surface sectors + if ( bNewSectorZ == 0 ) then + -- Tixa + if ( sNewSectorX == 9 and sNewSectorY == SectorY.MAP_ROW_J ) then + AddVolunteers( 30 ) + -- Alma + elseif ( sNewSectorX == 13 and sNewSectorY == SectorY.MAP_ROW_I ) then + AddVolunteers( 10 ) + end + end + end +end + +-- this function is called whenever we recruit a RPC +function RecruitRPCAdditionalHandling( usProfile ) + + -- if Miguel joins us, the rest of the rebels joins us too + if ( usProfile == Profil.MIGUEL ) then + AddVolunteers( 10 ) + end +end