added slay

> $$$ 4 iggy
fixed coop
stopped speck talking
preopened merc account
CREATURE_ENABLED = 0 no longer has any effect u can remove it from ur ini
ALLOW_CUSTOM_NIV = 1   -> new server ini variable, please add
added gear cost to MERC's

please feel free to make suggestion on MERC NPC costs...

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2178 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
haydent
2008-05-18 02:53:59 +00:00
parent f17cc948a4
commit 741e5c03bf
7 changed files with 68 additions and 24 deletions
+15 -2
View File
@@ -535,6 +535,7 @@ void DisplayMercsStats( UINT8 ubMercID )
{ {
UINT16 usPosY, usPosX; UINT16 usPosY, usPosX;
CHAR16 sString[128]; CHAR16 sString[128];
CHAR16 NsString[128];
usPosY = MERC_HEALTH_Y; usPosY = MERC_HEALTH_Y;
@@ -599,7 +600,10 @@ void DisplayMercsStats( UINT8 ubMercID )
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT) + 1; usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT) + 1;
swprintf(sString, L"%d %s", gMercProfiles[ ubMercID ].sSalary, MercInfo[MERC_FILES_PER_DAY]); swprintf(sString, L"%d %s", gMercProfiles[ ubMercID ].sSalary, MercInfo[MERC_FILES_PER_DAY]);
swprintf(NsString, L"+ %d gear.",gMercProfiles[ ubMercID ].usOptionalGearCost);
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
if(is_networked && ALLOW_EQUIP)DrawTextToScreen( NsString, usPosX, usPosY+MERC_SPACE_BN_LINES, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
} }
@@ -608,6 +612,7 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
{ {
MERC_HIRE_STRUCT HireMercStruct; MERC_HIRE_STRUCT HireMercStruct;
INT8 bReturnCode; INT8 bReturnCode;
INT32 Namount=0;
memset(&HireMercStruct, 0, sizeof(MERC_HIRE_STRUCT)); memset(&HireMercStruct, 0, sizeof(MERC_HIRE_STRUCT));
@@ -652,7 +657,11 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
//Set the time and ID of the last hired merc will arrive //Set the time and ID of the last hired merc will arrive
// LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = HireMercStruct.ubProfileID; // LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = HireMercStruct.ubProfileID;
// LaptopSaveInfo.sLastHiredMerc.uiArrivalTime = HireMercStruct.uiTimeTillMercArrives; // LaptopSaveInfo.sLastHiredMerc.uiArrivalTime = HireMercStruct.uiTimeTillMercArrives;
if(is_networked && (gMercProfiles[ ubMercID ].sSalary > LaptopSaveInfo.iCurrentBalance) )
Namount += gMercProfiles[ ubMercID ].sSalary * (-1);
if(ALLOW_EQUIP)Namount += gMercProfiles[ubMercID].usOptionalGearCost * (-1);
if(is_networked && (Namount*(-1) > LaptopSaveInfo.iCurrentBalance))
{ {
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
return(FALSE);//not enough big ones $$$sATMText return(FALSE);//not enough big ones $$$sATMText
@@ -673,7 +682,11 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
{ {
//take off nominal fee: hayden, //take off nominal fee: hayden,
if (is_networked) if (is_networked)
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), gMercProfiles[ ubMercID ].sSalary * (-1) ); {
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount );
}
//if we succesfully hired the merc //if we succesfully hired the merc
return(TRUE); return(TRUE);
} }
+6
View File
@@ -27,6 +27,7 @@
#include "Quests.h" #include "Quests.h"
#endif #endif
#include "connect.h"
UINT8 NUMBER_OF_MERCS; UINT8 NUMBER_OF_MERCS;
UINT8 LAST_MERC_ID; UINT8 LAST_MERC_ID;
@@ -362,6 +363,7 @@ void GameInitMercs()
gubMercArray[ 24 ] = 69; gubMercArray[ 24 ] = 69;
gubMercArray[ 25 ] = 70; gubMercArray[ 25 ] = 70;
gubMercArray[ 26 ] = 72; gubMercArray[ 26 ] = 72;
gubMercArray[ 27 ] = 64;
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_NO_ACCOUNT; LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_NO_ACCOUNT;
gubCurMercIndex = 0; gubCurMercIndex = 0;
@@ -1068,6 +1070,8 @@ void InitMercVideoFace()
BOOLEAN StartSpeckTalking(UINT16 usQuoteNum) BOOLEAN StartSpeckTalking(UINT16 usQuoteNum)
{ {
if(is_networked)return( FALSE );
if( usQuoteNum == MERC_VIDEO_SPECK_SPEECH_NOT_TALKING || usQuoteNum == MERC_VIDEO_SPECK_HAS_TO_TALK_BUT_QUOTE_NOT_CHOSEN_YET ) if( usQuoteNum == MERC_VIDEO_SPECK_SPEECH_NOT_TALKING || usQuoteNum == MERC_VIDEO_SPECK_HAS_TO_TALK_BUT_QUOTE_NOT_CHOSEN_YET )
return( FALSE ); return( FALSE );
@@ -2161,6 +2165,8 @@ BOOLEAN ShouldSpeckStartTalkingDueToActionOnSubPage()
BOOLEAN ShouldSpeckSayAQuote() BOOLEAN ShouldSpeckSayAQuote()
{ {
//if we are entering from anywhere except a sub page, and we should say the opening quote //if we are entering from anywhere except a sub page, and we should say the opening quote
if( gfJustEnteredMercSite && gubArrivedFromMercSubSite == MERC_CAME_FROM_OTHER_PAGE ) if( gfJustEnteredMercSite && gubArrivedFromMercSubSite == MERC_CAME_FROM_OTHER_PAGE )
{ {
+2 -3
View File
@@ -8,9 +8,8 @@
extern UINT8 NUMBER_OF_MERCS; extern UINT8 NUMBER_OF_MERCS;
extern UINT8 LAST_MERC_ID; extern UINT8 LAST_MERC_ID;
#define MAX_NUMBER_OF_MERCS 27 #define MAX_NUMBER_OF_MERCS 28
//#define NUMBER_OF_MERCS 27//hayden
//#define LAST_MERC_ID 26//hayden
#define NUMBER_OF_BAD_MERCS 5 #define NUMBER_OF_BAD_MERCS 5
#define NUMBER_MERCS_AFTER_FIRST_MERC_ARRIVES 6 #define NUMBER_MERCS_AFTER_FIRST_MERC_ARRIVES 6
#define NUMBER_MERCS_AFTER_SECOND_MERC_ARRIVES 8 #define NUMBER_MERCS_AFTER_SECOND_MERC_ARRIVES 8
+2 -2
View File
@@ -395,8 +395,8 @@ void InitDependingGameStyleOptions(BOOLEAN isNetworked)
if (isNetworked) if (isNetworked)
{ {
NUMBER_OF_MERCS = 27; NUMBER_OF_MERCS = 28;
LAST_MERC_ID = 26; LAST_MERC_ID = 27;
} }
else else
{ {
+26 -9
View File
@@ -241,6 +241,7 @@ char ckbag[100];
int REPORT_NAME; int REPORT_NAME;
int WEAPON_READIED_BONUS; int WEAPON_READIED_BONUS;
int ALLOW_CUSTOM_NIV;
int ENEMY_ENABLED; int ENEMY_ENABLED;
int CREATURE_ENABLED; int CREATURE_ENABLED;
@@ -567,6 +568,15 @@ void send_hire( UINT8 iNewIndex, UINT8 ubCurrentSoldier, INT16 iTotalContractLen
SOLDIERTYPE *pSoldier = MercPtrs[ iNewIndex ]; SOLDIERTYPE *pSoldier = MercPtrs[ iNewIndex ];
pSoldier->ubStrategicInsertionCode=(atoi(SECT_EDGE)); // this sets the param read from the ini for your starting sector edge... pSoldier->ubStrategicInsertionCode=(atoi(SECT_EDGE)); // this sets the param read from the ini for your starting sector edge...
if(ubCurrentSoldier==64)//slay
{
pSoldier->ubBodyType = REGMALE;
//pSoldier->EVENT_InitNewSoldierAnim( STANDING, 0 , TRUE );
gMercProfiles[ pSoldier->ubProfile ].ubBodyType = REGMALE;
}
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[44], pSoldier->name); ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[44], pSoldier->name);
@@ -645,13 +655,18 @@ void recieveHIRE(RPCParameters *rpcParameters)
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED; gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED;
if(!SAME_MERC)gMercProfiles[ pSoldier->ubProfile ].bMercStatus = MERC_WORKING_ELSEWHERE; if(!SAME_MERC)gMercProfiles[ pSoldier->ubProfile ].bMercStatus = MERC_WORKING_ELSEWHERE;
pSoldier->bSide=0; //default coop only pSoldier->bSide=0; //default coop only
if(MercCreateStruct.ubProfile==64)//slay
{
pSoldier->ubBodyType = REGMALE;
//pSoldier->EVENT_InitNewSoldierAnim( STANDING, 0 , TRUE );
gMercProfiles[ pSoldier->ubProfile ].ubBodyType = REGMALE;
}
if(PLAYER_BSIDE==0)//all vs all only if(PLAYER_BSIDE==0)//all vs all only
{ {
pSoldier->bSide=1; pSoldier->bSide=1;
//if(MercCreateStruct.bTeam==6)pSoldier->bSide=OP_TEAM_1;
// if(MercCreateStruct.bTeam==7)pSoldier->bSide=OP_TEAM_2;
// if(MercCreateStruct.bTeam==8)pSoldier->bSide=OP_TEAM_3;
// if(MercCreateStruct.bTeam==9)pSoldier->bSide=OP_TEAM_4;
} }
if(PLAYER_BSIDE==1) //allow teams if(PLAYER_BSIDE==1) //allow teams
@@ -1846,7 +1861,7 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
gGameOptions.fIronManMode=cl_lan->sofIronManMode; gGameOptions.fIronManMode=cl_lan->sofIronManMode;
gGameOptions.ubBobbyRay=cl_lan->soubBobbyRay; gGameOptions.ubBobbyRay=cl_lan->soubBobbyRay;
//gGameOptions.ubInventorySystem=cl_lan->sofNewInv;
if(!cl_lan->soDis_Bobby)LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE; if(!cl_lan->soDis_Bobby)LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE;
@@ -1879,6 +1894,8 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
InitNewGameClock( ); InitNewGameClock( );
WEAPON_READIED_BONUS=cl_lan->WEAPON_READIED_BONUS; WEAPON_READIED_BONUS=cl_lan->WEAPON_READIED_BONUS;
ALLOW_CUSTOM_NIV=cl_lan->ALLOW_CUSTOM_NIV;
if(ALLOW_CUSTOM_NIV==0)gGameOptions.ubInventorySystem=cl_lan->sofNewInv;
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[26],cl_lan->client_num,szDefault,cl_lan->cl_edge,cl_lan->team ); ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[26],cl_lan->client_num,szDefault,cl_lan->cl_edge,cl_lan->team );
@@ -2598,10 +2615,7 @@ void connect_client ( void )
gTacticalStatus.uiFlags&= (~SHOW_ALL_MERCS ); gTacticalStatus.uiFlags&= (~SHOW_ALL_MERCS );
memset( &readyteamreg , 0 , sizeof (int) * 10); memset( &readyteamreg , 0 , sizeof (int) * 10);
ENEMY_ENABLED=0;
CREATURE_ENABLED=0;
MILITIA_ENABLED=0;
CIV_ENABLED=0;
//retrieve settings from Ja2_mp.ini //retrieve settings from Ja2_mp.ini
char ip[30]; char ip[30];
@@ -2688,6 +2702,8 @@ void connect_client ( void )
LaptopSaveInfo.gubLastMercIndex = LAST_MERC_ID; LaptopSaveInfo.gubLastMercIndex = LAST_MERC_ID;
LaptopSaveInfo.ubLastMercAvailableId = 7; LaptopSaveInfo.ubLastMercAvailableId = 7;
gGameExternalOptions.fEnableSlayForever =1;
LaptopSaveInfo.gubPlayersMercAccountStatus = 4;
extern BOOLEAN gfTemporaryDisablingOfLoadPendingFlag; extern BOOLEAN gfTemporaryDisablingOfLoadPendingFlag;
gfTemporaryDisablingOfLoadPendingFlag = TRUE; gfTemporaryDisablingOfLoadPendingFlag = TRUE;
@@ -2703,6 +2719,7 @@ void connect_client ( void )
gMercProfiles[ 64 ].sSalary = 1500; gMercProfiles[ 64 ].sSalary = 1500;
gMercProfiles[ 72 ].sSalary = 1000; gMercProfiles[ 72 ].sSalary = 1000;
gMercProfiles[ 148 ].sSalary = 100; gMercProfiles[ 148 ].sSalary = 100;
gMercProfiles[ 68 ].sSalary = 2200; //iggy;
//********************** //**********************
+2 -1
View File
@@ -36,7 +36,7 @@ typedef struct
BOOLEAN sofTurnTimeLimit; BOOLEAN sofTurnTimeLimit;
BOOLEAN sofIronManMode; BOOLEAN sofIronManMode;
UINT8 soubBobbyRay; UINT8 soubBobbyRay;
//BOOLEAN sofNewInv; // WANNE - MP: New inventory: Removed, so now each client can decide if playing with old or new inventory BOOLEAN sofNewInv;
INT32 gsMAX_MERCS; INT32 gsMAX_MERCS;
UINT8 client_num; UINT8 client_num;
char client_name[30]; char client_name[30];
@@ -50,6 +50,7 @@ typedef struct
int cl_edge; int cl_edge;
float TIME; float TIME;
int WEAPON_READIED_BONUS; int WEAPON_READIED_BONUS;
int ALLOW_CUSTOM_NIV;
} settings_struct; } settings_struct;
//typedef struct //typedef struct
+15 -7
View File
@@ -48,6 +48,7 @@ INT32 gssecs_per_tick;
INT32 gsstarting_balance; INT32 gsstarting_balance;
float TIME; float TIME;
int sWEAPON_READIED_BONUS; int sWEAPON_READIED_BONUS;
int sALLOW_CUSTOM_NIV;
unsigned char SGetPacketIdentifier(Packet *p); unsigned char SGetPacketIdentifier(Packet *p);
unsigned char SpacketIdentifier; unsigned char SpacketIdentifier;
@@ -342,7 +343,7 @@ void requestSETTINGS(RPCParameters *rpcParameters )
lan.sofIronManMode=gGameOptions.fIronManMode; lan.sofIronManMode=gGameOptions.fIronManMode;
lan.starting_balance=gsstarting_balance; lan.starting_balance=gsstarting_balance;
//lan.sofNewInv=gGameOptions.ubInventorySystem; lan.sofNewInv=gGameOptions.ubInventorySystem;
lan.soDis_Bobby=gsDis_Bobby; lan.soDis_Bobby=gsDis_Bobby;
lan.soDis_Equip=gsDis_Equip; lan.soDis_Equip=gsDis_Equip;
@@ -351,17 +352,15 @@ void requestSETTINGS(RPCParameters *rpcParameters )
memcpy( lan.client_names , client_names, sizeof( char ) * 4 * 30 ); memcpy( lan.client_names , client_names, sizeof( char ) * 4 * 30 );
lan.team=clinf->team; lan.team=clinf->team;
//lan.cl_ops[0]=clinf->cl_ops[0];
//lan.cl_ops[1]=clinf->cl_ops[1];
//lan.cl_ops[2]=clinf->cl_ops[2];
//lan.cl_ops[3]=clinf->cl_ops[3];
//memcpy(lan.cl_ops,clinf->cl_ops,sizeof(int)*4);
////
lan.TESTING=gsTESTING; lan.TESTING=gsTESTING;
lan.cl_edge=clinf->cl_edge; lan.cl_edge=clinf->cl_edge;
lan.TIME=TIME; lan.TIME=TIME;
lan.WEAPON_READIED_BONUS=sWEAPON_READIED_BONUS; lan.WEAPON_READIED_BONUS=sWEAPON_READIED_BONUS;
lan.ALLOW_CUSTOM_NIV=sALLOW_CUSTOM_NIV;
server->RPC("recieveSETTINGS",(const char*)&lan, (int)sizeof(settings_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0); server->RPC("recieveSETTINGS",(const char*)&lan, (int)sizeof(settings_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
@@ -474,6 +473,11 @@ void start_server (void)
gsPLAYER_BSIDE = atoi(player_bside); gsPLAYER_BSIDE = atoi(player_bside);
ENEMY_ENABLED=0;
CREATURE_ENABLED=0;
MILITIA_ENABLED=0;
CIV_ENABLED=0;
if(gsPLAYER_BSIDE==2)//only enable ai during coop if(gsPLAYER_BSIDE==2)//only enable ai during coop
{ {
ENEMY_ENABLED =atoi(bteam1_enabled); ENEMY_ENABLED =atoi(bteam1_enabled);
@@ -499,6 +503,10 @@ if(gsPLAYER_BSIDE==2)//only enable ai during coop
GetPrivateProfileString( "Ja2_mp Settings","WEAPON_READIED_BONUS", "", wpr, MAX_PATH, "..\\Ja2_mp.ini" ); GetPrivateProfileString( "Ja2_mp Settings","WEAPON_READIED_BONUS", "", wpr, MAX_PATH, "..\\Ja2_mp.ini" );
sWEAPON_READIED_BONUS=atoi(wpr); sWEAPON_READIED_BONUS=atoi(wpr);
char acniv[30];
GetPrivateProfileString( "Ja2_mp Settings","ALLOW_CUSTOM_NIV", "", acniv, MAX_PATH, "..\\Ja2_mp.ini" );
sALLOW_CUSTOM_NIV=atoi(acniv);
//********************** //**********************