mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Store the profile type in the profile structure and remove superfluous code
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8620 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -8731,9 +8731,8 @@ INT16 GetTownTrainPtsForCharacter( SOLDIERTYPE *pTrainer, UINT16 *pusMaxPts )
|
||||
}
|
||||
|
||||
// RPCs get a small training bonus for being more familiar with the locals and their customs/needs than outsiders
|
||||
//new profiles by Jazz
|
||||
//if( pTrainer->ubProfile >= FIRST_RPC )
|
||||
if ( gProfilesRPC[pTrainer->ubProfile].ProfilId == pTrainer->ubProfile || gProfilesNPC[pTrainer->ubProfile].ProfilId == pTrainer->ubProfile )
|
||||
if ( gMercProfiles[pTrainer->ubProfile].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[pTrainer->ubProfile].Type == PROFILETYPE_NPC )
|
||||
{
|
||||
sTrainingBonus += gGameExternalOptions.ubRpcBonusToTrainMilitia;
|
||||
}
|
||||
|
||||
@@ -2103,21 +2103,17 @@ void CreateAutoResolveInterface()
|
||||
}
|
||||
|
||||
//add all the faces now
|
||||
for( i = 0; i < gpAR->ubMercs; i++ )
|
||||
for( i = 0; i < gpAR->ubMercs; ++i )
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
//Load the face
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
/*
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
|
||||
*/
|
||||
|
||||
if ( ( gpMercs[ i ].pSoldier->ubProfile >= 0 ) && ( gpMercs[ i ].pSoldier->ubProfile < 100 ) && ( gProfilesIMP[ gpMercs[ i ].pSoldier->ubProfile ].ProfilId == gpMercs[ i ].pSoldier->ubProfile ) )
|
||||
|
||||
if ( ( gpMercs[ i ].pSoldier->ubProfile >= 0 ) && ( gpMercs[ i ].pSoldier->ubProfile < 100 ) && gMercProfiles[gpMercs[i].pSoldier->ubProfile].Type == PROFILETYPE_IMP )
|
||||
{
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
|
||||
}
|
||||
else if ( ( gpMercs[ i ].pSoldier->ubProfile > 99 ) && ( gProfilesIMP[ gpMercs[ i ].pSoldier->ubProfile ].ProfilId == gpMercs[ i ].pSoldier->ubProfile ) )
|
||||
else if ( ( gpMercs[ i ].pSoldier->ubProfile > 99 ) && gMercProfiles[gpMercs[i].pSoldier->ubProfile].Type == PROFILETYPE_IMP )
|
||||
{
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
|
||||
}
|
||||
@@ -2139,7 +2135,6 @@ void CreateAutoResolveInterface()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( GetVideoObject( &hVObject, gpMercs[ i ].uiVObjectID ) )
|
||||
{
|
||||
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 255, 255, 255, FALSE );
|
||||
|
||||
@@ -2091,30 +2091,9 @@ static int l_WhoIs (lua_State *L)
|
||||
UINT8 whois = lua_tointeger(L,1);
|
||||
UINT8 Val = lua_tointeger(L,2);
|
||||
UINT8 Prof = 0;
|
||||
|
||||
switch ( whois )
|
||||
{
|
||||
case 1:
|
||||
Prof = gProfilesAIM[ Val ].ProfilId;
|
||||
break;
|
||||
case 2:
|
||||
Prof = gProfilesMERC[ Val ].ProfilId;
|
||||
break;
|
||||
case 3:
|
||||
Prof = gProfilesRPC[ Val ].ProfilId;
|
||||
break;
|
||||
case 4:
|
||||
Prof = gProfilesNPC[ Val ].ProfilId;
|
||||
break;
|
||||
case 5:
|
||||
Prof = gProfilesVehicle[ Val ].ProfilId;
|
||||
break;
|
||||
case 6:
|
||||
Prof = gProfilesIMP[ Val ].ProfilId;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ( gMercProfiles[Val].Type == whois )
|
||||
Prof = Val;
|
||||
|
||||
lua_pushinteger(L, Prof);
|
||||
}
|
||||
@@ -2124,8 +2103,7 @@ static int l_WhoIs (lua_State *L)
|
||||
|
||||
#ifdef JA2UB
|
||||
static int l_HandlePlayerHittingSwitchToLaunchMissles (lua_State *L)
|
||||
{
|
||||
|
||||
{
|
||||
HandlePlayerHittingSwitchToLaunchMissles( );
|
||||
|
||||
return 0;
|
||||
@@ -8171,7 +8149,7 @@ static int l_AddEmailXML ( lua_State *L )
|
||||
if ( uiIndex != 0 )
|
||||
pMerc = uiIndex + 1;
|
||||
|
||||
if ( gProfilesAIM[uiIndex].ProfilId == uiIndex )
|
||||
if ( gMercProfiles[uiIndex].Type == PROFILETYPE_AIM )
|
||||
AddEmailTypeXML( pMerc, uiIndex, uiIndex, GetWorldTotalMin(), -1, TYPE_EMAIL_AIM_AVAILABLE );
|
||||
}
|
||||
|
||||
@@ -8188,8 +8166,8 @@ static int l_AddEmailLevelUpXML (lua_State *L)
|
||||
UINT8 pMerc = 0;
|
||||
if ( uiIndex != 0 )
|
||||
pMerc = uiIndex + 1;
|
||||
|
||||
if ( gProfilesMERC[uiIndex].ProfilId == uiIndex )
|
||||
|
||||
if ( gMercProfiles[uiIndex].Type == PROFILETYPE_MERC )
|
||||
AddEmailTypeXML( pMerc, uiIndex, uiIndex, GetWorldTotalMin(), -1, TYPE_EMAIL_MERC_LEVEL_UP );
|
||||
}
|
||||
|
||||
|
||||
@@ -4929,11 +4929,11 @@ void AddSoldierToUpdateBox( SOLDIERTYPE *pSoldier )
|
||||
|
||||
|
||||
|
||||
if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
|
||||
if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex < 100 ) && gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_IMP )
|
||||
{
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
|
||||
}
|
||||
else if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
|
||||
else if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex > 99 ) && gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_IMP )
|
||||
{
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
|
||||
}
|
||||
|
||||
@@ -1196,9 +1196,7 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi
|
||||
}
|
||||
|
||||
//if the character is an RPC
|
||||
//if( pSoldier->ubProfile >= FIRST_RPC && pSoldier->ubProfile < FIRST_NPC )
|
||||
//new profiles by Jazz
|
||||
if ( gProfilesRPC[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile )
|
||||
if ( gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_RPC )
|
||||
{
|
||||
if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE )
|
||||
{
|
||||
@@ -1210,7 +1208,6 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi
|
||||
}
|
||||
fInSector = TRUE;
|
||||
}
|
||||
|
||||
// check if drassen controlled
|
||||
else if( StrategicMap[ ( AIRPORT_X + ( MAP_WORLD_X * AIRPORT_Y ) ) ].fEnemyControlled == FALSE )
|
||||
{
|
||||
@@ -1242,7 +1239,6 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi
|
||||
{
|
||||
swprintf( sString, pMercSheLeaveString[ 0 ], pSoldier->GetName(), zShortTownIDString, zDropOffString );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3297,25 +3297,24 @@ void AddNPCsInSectorToArray()
|
||||
|
||||
//Setup array of merc who are in the current sector
|
||||
i=0;
|
||||
for ( pSoldier = Menptr, cnt = 0; cnt < TOTAL_SOLDIERS; pSoldier++, cnt++ )
|
||||
for ( pSoldier = Menptr, cnt = 0; cnt < TOTAL_SOLDIERS; ++pSoldier, ++cnt )
|
||||
{
|
||||
if ( ( pSoldier != NULL ) && pSoldier->bActive )
|
||||
{
|
||||
//if soldier is a NPC, add him to the local NPC array
|
||||
//if( ( pSoldier->ubProfile >= FIRST_RPC ) && ( pSoldier->ubProfile < GASTON ) )
|
||||
//new profiles by Jazz
|
||||
if ( gProfilesRPC[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile || gProfilesNPC[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile || gProfilesVehicle[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile )
|
||||
if ( gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_NPC ||
|
||||
gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_VEHICLE )
|
||||
{
|
||||
gubCurrentNpcInSector[ i ] = pSoldier->ubProfile;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gubNumNPCinSector = (UINT8)i;
|
||||
}
|
||||
|
||||
|
||||
void ChangeQuestState( INT32 iNumber )
|
||||
{
|
||||
if( ( iNumber >= 0 ) && ( iNumber <= 2 ) )
|
||||
@@ -3695,15 +3694,15 @@ void RefreshAllNPCInventory()
|
||||
UINT16 usItemCnt;
|
||||
UINT16 usItem;
|
||||
|
||||
for ( usCnt=0; usCnt < TOTAL_SOLDIERS; usCnt++ )
|
||||
for ( usCnt=0; usCnt < TOTAL_SOLDIERS; ++usCnt )
|
||||
{
|
||||
//if the is active
|
||||
if( Menptr[ usCnt ].bActive == 1 )
|
||||
{
|
||||
//is the merc a rpc or npc
|
||||
//if( Menptr[ usCnt ].ubProfile >= FIRST_RPC && Menptr[ usCnt ].ubProfile < GASTON )
|
||||
//new profiles by Jazz
|
||||
if ( gProfilesRPC[Menptr[ usCnt ].ubProfile].ProfilId == Menptr[ usCnt ].ubProfile || gProfilesNPC[Menptr[ usCnt ].ubProfile].ProfilId == Menptr[ usCnt ].ubProfile || gProfilesVehicle[Menptr[ usCnt ].ubProfile].ProfilId == Menptr[ usCnt ].ubProfile )
|
||||
if ( gMercProfiles[usCnt].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[usCnt].Type == PROFILETYPE_NPC ||
|
||||
gMercProfiles[usCnt].Type == PROFILETYPE_VEHICLE )
|
||||
{
|
||||
//refresh the mercs inventory
|
||||
UINT16 invsize = Menptr[ usCnt ].inv.size();
|
||||
@@ -3988,9 +3987,9 @@ UINT8 WhichPanelShouldTalkingMercUse( )
|
||||
return( QDS_NO_PANEL );
|
||||
}
|
||||
|
||||
//if( gTalkingMercSoldier->ubProfile < FIRST_RPC || gTalkingMercSoldier->ubProfile >= GASTON )
|
||||
//new profiles by Jazz
|
||||
if ( gProfilesAIM[gTalkingMercSoldier->ubProfile].ProfilId == gTalkingMercSoldier->ubProfile || gProfilesMERC[gTalkingMercSoldier->ubProfile].ProfilId == gTalkingMercSoldier->ubProfile || gProfilesIMP[gTalkingMercSoldier->ubProfile].ProfilId == gTalkingMercSoldier->ubProfile )
|
||||
if ( gMercProfiles[gTalkingMercSoldier->ubProfile].Type == PROFILETYPE_AIM ||
|
||||
gMercProfiles[gTalkingMercSoldier->ubProfile].Type == PROFILETYPE_MERC ||
|
||||
gMercProfiles[gTalkingMercSoldier->ubProfile].Type == PROFILETYPE_IMP )
|
||||
{
|
||||
return( QDS_REGULAR_PANEL );
|
||||
}
|
||||
|
||||
@@ -853,11 +853,11 @@ void HandleEarlyMorningEvents( void )
|
||||
UINT32 uiAmount;
|
||||
|
||||
// loop through all *NPCs* and reset "default response used recently" flags
|
||||
//for (cnt = FIRST_RPC; cnt < GASTON; cnt++)
|
||||
for (cnt = 0; cnt < NUM_PROFILES; cnt++)
|
||||
for (cnt = 0; cnt < NUM_PROFILES; ++cnt)
|
||||
{
|
||||
//new profiles by Jazz
|
||||
if ( gProfilesRPC[cnt].ProfilId == cnt || gProfilesNPC[cnt].ProfilId == cnt || gProfilesVehicle[cnt].ProfilId == cnt )
|
||||
if ( gMercProfiles[cnt].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[cnt].Type == PROFILETYPE_NPC ||
|
||||
gMercProfiles[cnt].Type == PROFILETYPE_VEHICLE )
|
||||
{
|
||||
gMercProfiles[cnt].bFriendlyOrDirectDefaultResponseUsedRecently = FALSE;
|
||||
gMercProfiles[cnt].bRecruitDefaultResponseUsedRecently = FALSE;
|
||||
@@ -886,7 +886,6 @@ void HandleEarlyMorningEvents( void )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( gMercProfiles[ TONY ].ubLastDateSpokenTo > 0 && !( gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_C && gbWorldSectorZ == 0 ) )
|
||||
{
|
||||
// San Mona C5 is not loaded so make Tony possibly not availableif
|
||||
@@ -906,7 +905,6 @@ void HandleEarlyMorningEvents( void )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( gMercProfiles[ DEVIN ].ubLastDateSpokenTo == 0 )
|
||||
{
|
||||
// Does Devin move?
|
||||
|
||||
@@ -219,15 +219,12 @@ void MercDailyUpdate()
|
||||
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_1, 0 );
|
||||
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_2, 0 );
|
||||
AddSameDayStrategicEvent( EVENT_BEGIN_CONTRACT_RENEWAL_SEQUENCE, MERC_ARRIVE_TIME_SLOT_3, 0 );
|
||||
|
||||
|
||||
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
|
||||
|
||||
|
||||
//loop though all the mercs
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; ++cnt,++pSoldier)
|
||||
{
|
||||
//if the merc is active
|
||||
if ( ( pSoldier->bActive )&&( pSoldier->bAssignment != ASSIGNMENT_POW ) && ( pSoldier->bAssignment != IN_TRANSIT ) )
|
||||
@@ -246,7 +243,7 @@ void MercDailyUpdate()
|
||||
|
||||
if ( pSoldier->bCorpseQuoteTolerance < 0 )
|
||||
{
|
||||
pSoldier->bCorpseQuoteTolerance = 0;
|
||||
pSoldier->bCorpseQuoteTolerance = 0;
|
||||
}
|
||||
|
||||
// CJC: For some personalities, reset personality quote said flag
|
||||
@@ -266,8 +263,7 @@ void MercDailyUpdate()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//ATE: Try to see if our equipment sucks!
|
||||
if ( SoldierHasWorseEquipmentThanUsedTo( pSoldier ) )
|
||||
{
|
||||
@@ -280,16 +276,13 @@ void MercDailyUpdate()
|
||||
|
||||
// player has hired him, so he'll eligible to get killed off on another job
|
||||
gMercProfiles[pSoldier->ubProfile].ubMiscFlags3 |= PROFILE_MISC_FLAG3_PLAYER_HAD_CHANCE_TO_HIRE;
|
||||
|
||||
|
||||
|
||||
//handle Slay differently if SlayForever is enabled
|
||||
if( pSoldier->ubProfile == SLAY && gGameExternalOptions.fEnableSlayForever == TRUE)
|
||||
{
|
||||
}
|
||||
//if the character is an RPC
|
||||
//else if( pSoldier->ubProfile >= FIRST_RPC && pSoldier->ubProfile < FIRST_NPC )
|
||||
//new profiles by Jazz
|
||||
else if ( gProfilesRPC[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile )
|
||||
else if ( gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_RPC )
|
||||
{
|
||||
INT16 sSalary = gMercProfiles[ pSoldier->ubProfile ].sSalary;
|
||||
INT32 iMoneyOwedToMerc = 0;
|
||||
@@ -488,12 +481,13 @@ void MercDailyUpdate()
|
||||
{
|
||||
oMerc = cnt;
|
||||
iMerc = oMerc * 1;
|
||||
|
||||
|
||||
if ( oMerc != 0 )
|
||||
pMerc = oMerc + 1;
|
||||
else
|
||||
pMerc = 0;
|
||||
if ( gProfilesAIM[cnt].ProfilId == cnt )
|
||||
|
||||
if ( gMercProfiles[cnt].Type == PROFILETYPE_AIM )
|
||||
AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_AIM_AVAILABLE);
|
||||
}
|
||||
else
|
||||
@@ -541,8 +535,7 @@ void MercDailyUpdate()
|
||||
if( IsProfileIdAnAimOrMERCMerc( (UINT8)cnt ) )
|
||||
{
|
||||
// check to see if he goes on another assignment
|
||||
//if (cnt < MAX_NUMBER_MERCS)
|
||||
if ( gProfilesAIM[ cnt ].ProfilId == cnt ) //new profiles by Jazz
|
||||
if ( gMercProfiles[cnt].Type == PROFILETYPE_AIM )
|
||||
{
|
||||
// A.I.M. merc
|
||||
uiChance = 2 * pProfile->bExpLevel;
|
||||
@@ -550,7 +543,7 @@ void MercDailyUpdate()
|
||||
// player has now had a chance to hire him, so he'll eligible to get killed off on another job
|
||||
pProfile->ubMiscFlags3 |= PROFILE_MISC_FLAG3_PLAYER_HAD_CHANCE_TO_HIRE;
|
||||
}
|
||||
else if ( gProfilesMERC[ cnt ].ProfilId == cnt ) //new profiles by Jazz
|
||||
else if ( gMercProfiles[cnt].Type == PROFILETYPE_MERC )
|
||||
{
|
||||
// M.E.R.C. merc - very rarely get other work
|
||||
uiChance = 1 * pProfile->bExpLevel;
|
||||
@@ -562,6 +555,7 @@ void MercDailyUpdate()
|
||||
pProfile->ubMiscFlags3 |= PROFILE_MISC_FLAG3_PLAYER_HAD_CHANCE_TO_HIRE;
|
||||
}
|
||||
}
|
||||
|
||||
// tais: disable mercs being on assignment
|
||||
if (Random(100) < uiChance && gGameExternalOptions.fMercsOnAssignment < 2)
|
||||
{
|
||||
@@ -577,8 +571,7 @@ void MercDailyUpdate()
|
||||
pProfile->ubDaysOfMoraleHangover--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// build quit list
|
||||
//BuildMercQuitList( pQuitList );
|
||||
#ifdef JA2UB
|
||||
@@ -1506,8 +1499,7 @@ void HandleAddingAnyAimAwayEmailsWhenLaptopGoesOnline()
|
||||
UINT32 cnt;
|
||||
INT32 iOffset;
|
||||
MERCPROFILESTRUCT *pProfile;
|
||||
|
||||
|
||||
|
||||
//Loop through all the profiles
|
||||
for( cnt = 0; cnt < NUM_PROFILES; cnt++)
|
||||
{
|
||||
@@ -1539,13 +1531,14 @@ void HandleAddingAnyAimAwayEmailsWhenLaptopGoesOnline()
|
||||
pMerc = oMerc + 1;
|
||||
else
|
||||
pMerc = 0;
|
||||
if ( gProfilesAIM[cnt].ProfilId == cnt )
|
||||
|
||||
if ( gMercProfiles[cnt].Type == PROFILETYPE_AIM )
|
||||
AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_AIM_AVAILABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TO DO: send E-mail to player telling him the merc has returned from an assignment
|
||||
AddEmail( ( UINT8 )( iOffset + ( cnt * AIM_REPLY_LENGTH_BARRY ) ), AIM_REPLY_LENGTH_BARRY, ( UINT8 )( 6 + cnt ), GetWorldTotalMin(),-1 ,-1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
|
||||
// TO DO: send E-mail to player telling him the merc has returned from an assignment
|
||||
AddEmail( ( UINT8 )( iOffset + ( cnt * AIM_REPLY_LENGTH_BARRY ) ), AIM_REPLY_LENGTH_BARRY, ( UINT8 )( 6 + cnt ), GetWorldTotalMin(),-1 ,-1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5720,17 +5720,19 @@ BOOLEAN HandlePlayerGroupEnteringSectorToCheckForNPCsOfNote( GROUP *pGroup )
|
||||
|
||||
BOOLEAN WildernessSectorWithAllProfiledNPCsNotSpokenWith( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||
{
|
||||
UINT8 ubProfile;
|
||||
MERCPROFILESTRUCT * pProfile;
|
||||
BOOLEAN fFoundSomebody = FALSE;
|
||||
|
||||
|
||||
//for ( ubProfile = FIRST_RPC; ubProfile < GASTON; ubProfile++ )
|
||||
//new profiles by Jazz
|
||||
for ( ubProfile = 0; ubProfile < NUM_PROFILES; ubProfile++ )
|
||||
{
|
||||
|
||||
if ( gProfilesRPC[ubProfile].ProfilId == ubProfile || gProfilesNPC[ubProfile].ProfilId == ubProfile || gProfilesVehicle[ubProfile].ProfilId == ubProfile)
|
||||
for ( UINT32 ubProfile = 0; ubProfile < NUM_PROFILES; ++ubProfile )
|
||||
{
|
||||
// skip vehicles
|
||||
if ( gMercProfiles[ubProfile].Type == PROFILETYPE_VEHICLE )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( gMercProfiles[ubProfile].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[ubProfile].Type == PROFILETYPE_NPC )
|
||||
{
|
||||
pProfile = &gMercProfiles[ ubProfile ];
|
||||
|
||||
@@ -5739,14 +5741,7 @@ BOOLEAN WildernessSectorWithAllProfiledNPCsNotSpokenWith( INT16 sSectorX, INT16
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip vehicles
|
||||
//if ( ubProfile >= PROF_HUMMER && ubProfile <= PROF_HELICOPTER )
|
||||
if ( gProfilesVehicle[ubProfile].ProfilId == ubProfile )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// in this sector?
|
||||
if ( pProfile->sSectorX == sSectorX && pProfile->sSectorY == sSectorY && pProfile->bSectorZ == bSectorZ )
|
||||
{
|
||||
|
||||
@@ -36,15 +36,16 @@
|
||||
|
||||
void InitializeProfilesForTownReputation( void )
|
||||
{
|
||||
UINT32 uiProfileId = 0;
|
||||
|
||||
// initialize the town opinion values in each recruitable merc's profile structure
|
||||
//for( uiProfileId = 0; uiProfileId < FIRST_NPC; uiProfileId++ )
|
||||
//new profiles by Jazz
|
||||
for( uiProfileId = 0; uiProfileId < NUM_PROFILES; uiProfileId++ )
|
||||
for( UINT32 uiProfileId = 0; uiProfileId < NUM_PROFILES; ++uiProfileId )
|
||||
{
|
||||
if ( gProfilesIMP[uiProfileId].ProfilId == uiProfileId || gProfilesRPC[uiProfileId].ProfilId == uiProfileId || gProfilesAIM[uiProfileId].ProfilId == uiProfileId || gProfilesMERC[uiProfileId].ProfilId == uiProfileId)
|
||||
memset( &( gMercProfiles[ uiProfileId ].bMercTownReputation ), INITIAL_TOWN_REPUTATION, sizeof( gMercProfiles[ uiProfileId ].bMercTownReputation ) );
|
||||
if ( gMercProfiles[uiProfileId].Type == PROFILETYPE_AIM ||
|
||||
gMercProfiles[uiProfileId].Type == PROFILETYPE_MERC ||
|
||||
gMercProfiles[uiProfileId].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[uiProfileId].Type == PROFILETYPE_IMP )
|
||||
memset( &( gMercProfiles[ uiProfileId ].bMercTownReputation ), INITIAL_TOWN_REPUTATION, sizeof( gMercProfiles[ uiProfileId ].bMercTownReputation ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,22 +132,22 @@ void UpdateTownOpinionOfThisMercForSoldier( SOLDIERTYPE *pSoldier, UINT8 ubTownI
|
||||
|
||||
void HandleSpreadOfAllTownsOpinion( void )
|
||||
{
|
||||
UINT8 ubProfileId;
|
||||
|
||||
// debug message
|
||||
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"%s - Spreading town opinions about mercs", WORLDTIMESTR );
|
||||
|
||||
// run though all player-recruitable profiles and update towns opinion of mercs
|
||||
//for( ubProfileId = 0; ubProfileId < FIRST_NPC; ubProfileId++ )
|
||||
//new profiles by Jazz
|
||||
for( ubProfileId = 0; ubProfileId < NUM_PROFILES; ubProfileId++ )
|
||||
for( int ubProfileId = 0; ubProfileId < NUM_PROFILES; ++ubProfileId )
|
||||
{
|
||||
if ( gProfilesIMP[ubProfileId].ProfilId == ubProfileId || gProfilesAIM[ubProfileId].ProfilId == ubProfileId || gProfilesMERC[ubProfileId].ProfilId == ubProfileId || gProfilesRPC[ubProfileId].ProfilId == ubProfileId)
|
||||
HandleSpreadOfTownOpinionForMerc( ubProfileId );
|
||||
if ( gMercProfiles[ubProfileId].Type == PROFILETYPE_AIM ||
|
||||
gMercProfiles[ubProfileId].Type == PROFILETYPE_MERC ||
|
||||
gMercProfiles[ubProfileId].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[ubProfileId].Type == PROFILETYPE_IMP )
|
||||
HandleSpreadOfTownOpinionForMerc( ubProfileId );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HandleSpreadOfTownOpinionForMerc( UINT8 ubProfileId )
|
||||
{
|
||||
// handle opinion spread for this grunt
|
||||
|
||||
Reference in New Issue
Block a user