mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
new feature: allowed to re-hire RPCs in case they are fired from team
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9052 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -77,6 +77,8 @@
|
||||
extern BOOLEAN gfProfileDataLoaded;
|
||||
#endif
|
||||
|
||||
extern INT32 GetTheStateOfDepartedMerc(INT32 iId);
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -1732,6 +1734,8 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
bool first_time_recruited = GetTheStateOfDepartedMerc(ubCharNum) == -1;
|
||||
|
||||
// OK, set recruit flag..
|
||||
gMercProfiles[ ubCharNum ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED;
|
||||
|
||||
@@ -1760,12 +1764,12 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
||||
|
||||
KickOutWheelchair( pNewSoldier );
|
||||
}
|
||||
else if ( ubCharNum == DYNAMO && gubQuest[ QUEST_FREE_DYNAMO ] == QUESTINPROGRESS )
|
||||
else if ( ubCharNum == DYNAMO && gubQuest[ QUEST_FREE_DYNAMO ] == QUESTINPROGRESS && first_time_recruited)
|
||||
{
|
||||
EndQuest( QUEST_FREE_DYNAMO, pSoldier->sSectorX, pSoldier->sSectorY );
|
||||
}
|
||||
// SANDRO - give exp and records quest point, if finally recruiting Miguel
|
||||
else if ( ubCharNum == MIGUEL )
|
||||
else if ( ubCharNum == MIGUEL && first_time_recruited)
|
||||
{
|
||||
GiveQuestRewardPoint( pSoldier->sSectorX, pSoldier->sSectorY, 6, MIGUEL );
|
||||
}
|
||||
@@ -1784,7 +1788,8 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
||||
}
|
||||
|
||||
// handle town loyalty adjustment
|
||||
HandleTownLoyaltyForNPCRecruitment( pNewSoldier );
|
||||
if(first_time_recruited)
|
||||
HandleTownLoyaltyForNPCRecruitment( pNewSoldier );
|
||||
|
||||
// Try putting them into the current squad
|
||||
if ( AddCharacterToSquad( pNewSoldier, (INT8)CurrentSquad( ) ) == FALSE )
|
||||
@@ -1820,7 +1825,7 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
||||
#ifdef JA2UB
|
||||
// no Ja25 UB
|
||||
#else
|
||||
if ( ubCharNum == IRA )
|
||||
if ( ubCharNum == IRA && first_time_recruited)
|
||||
{
|
||||
// trigger 0th PCscript line
|
||||
TriggerNPCRecord( IRA, 0 );
|
||||
@@ -1852,7 +1857,8 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
|
||||
AdditionalTacticalCharacterDialogue_AllInSectorRadiusCall( ubCharNum, ADE_DIALOGUE_RPC_RECRUIT_SUCCESS, ubCharNum );
|
||||
|
||||
// Flugente: external scripts might have extra functionality on recruiting someone
|
||||
LuaRecruitRPCAdditionalHandling( ubCharNum );
|
||||
if (first_time_recruited)
|
||||
LuaRecruitRPCAdditionalHandling( ubCharNum );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user