mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
New Feature: The number of merchants has increased, and their values have been externalised.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5744 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-1
@@ -20,8 +20,9 @@ extern CHAR16 zTrackingNumber[16];
|
||||
//
|
||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||
// you will invalidate the saved game file
|
||||
#define SAVE_GAME_VERSION 136 // 134 // 133 // 132 //131 //125 //124 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
|
||||
#define SAVE_GAME_VERSION 137 // 134 // 133 // 132 //131 //125 //124 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
|
||||
|
||||
#define EXTERNALISED_MERCHANTS 137 // Flugente: increased the number of merchants and externalised their data
|
||||
#define PRISON_SYSTEM 136 // Flugente: added var to the sector structure. Shouldn't break compatibility, but let's be safe
|
||||
#define DUAL_BURST_ADDED 135
|
||||
#define MORE_ROOMS 134 // changed room numbers from 8 to 16 bit by DBrot
|
||||
|
||||
@@ -384,6 +384,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
strcat(fileName, FOODFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInFoodStats(fileName),FOODFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, MERCHANTSFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInMerchantStats(fileName),MERCHANTSFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, CLOTHESFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInClothesStats(fileName),CLOTHESFILENAME);
|
||||
@@ -465,9 +469,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
strcat(fileName, IMPITEMCHOICESFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInIMPItemChoicesStats(fileName),IMPITEMCHOICESFILENAME);
|
||||
|
||||
std::copy(DefaultarmsDealerInfo,
|
||||
// Flugente 2012-12-19: merchant data has been externalised - see XML_Merchants.cpp
|
||||
/*std::copy(DefaultarmsDealerInfo,
|
||||
DefaultarmsDealerInfo + sizeof(DefaultarmsDealerInfo)/sizeof(*DefaultarmsDealerInfo),
|
||||
armsDealerInfo.begin());
|
||||
armsDealerInfo.begin());*/
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, TONYINVENTORYFILENAME);
|
||||
@@ -560,7 +565,91 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
strcat(fileName, FREDOINVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gFredoInventory,fileName),FREDOINVENTORYFILENAME);
|
||||
|
||||
// Flugente: added new merchants
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, TINAINVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gTinaInventory,fileName),TINAINVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_1_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[0],fileName),ADITIONALDEALER_1_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_2_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[1],fileName),ADITIONALDEALER_2_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_3_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[2],fileName),ADITIONALDEALER_3_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_4_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[3],fileName),ADITIONALDEALER_4_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_5_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[4],fileName),ADITIONALDEALER_5_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_6_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[5],fileName),ADITIONALDEALER_6_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_7_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[6],fileName),ADITIONALDEALER_7_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_8_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[7],fileName),ADITIONALDEALER_8_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_9_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[8],fileName),ADITIONALDEALER_9_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_10_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[9],fileName),ADITIONALDEALER_10_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_11_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[10],fileName),ADITIONALDEALER_11_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_12_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[11],fileName),ADITIONALDEALER_12_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_13_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[12],fileName),ADITIONALDEALER_13_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_14_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[13],fileName),ADITIONALDEALER_14_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_15_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[14],fileName),ADITIONALDEALER_15_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_16_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[15],fileName),ADITIONALDEALER_16_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_17_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[16],fileName),ADITIONALDEALER_17_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_18_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[17],fileName),ADITIONALDEALER_18_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_19_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[18],fileName),ADITIONALDEALER_19_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ADITIONALDEALER_20_INVENTORYFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInInventoryStats(gArmsDealerAdditional[19],fileName),ADITIONALDEALER_20_INVENTORYFILENAME);
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, CITYTABLEFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
|
||||
|
||||
@@ -43,7 +43,8 @@ void ConvertCreatureBloodToElixir( void );
|
||||
|
||||
UINT8 gubLastSpecialItemAddedAtElement = 255;
|
||||
|
||||
|
||||
// Flugente 2012-12-19: merchant data has been externalised - see XML_Merchants.cpp
|
||||
#if 0
|
||||
// THIS STRUCTURE HAS UNCHANGING INFO THAT DOESN'T GET SAVED/RESTORED/RESET
|
||||
// TODO: externalize
|
||||
const ARMS_DEALER_INFO DefaultarmsDealerInfo[ NUM_ARMS_DEALERS ] =
|
||||
@@ -94,6 +95,8 @@ const ARMS_DEALER_INFO DefaultarmsDealerInfo[ NUM_ARMS_DEALERS ] =
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
std::vector<ARMS_DEALER_INFO> armsDealerInfo (NUM_ARMS_DEALERS);
|
||||
|
||||
|
||||
@@ -1301,6 +1304,16 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
// Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can
|
||||
if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
|
||||
{
|
||||
if ( !( Item[ usItemIndex ].electronic ) )
|
||||
return(TRUE);
|
||||
else
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
AssertMsg( FALSE, String( "CanDealerRepairItem(), Arms Dealer %d is not a recognized repairman!. AM 1.", ubArmsDealer ) );
|
||||
}
|
||||
|
||||
|
||||
+56
-47
@@ -1,9 +1,9 @@
|
||||
#ifndef _ARMS_DEALERS_INIT__H_
|
||||
#define _ARMS_DEALERS_INIT__H_
|
||||
|
||||
|
||||
#include "Store Inventory.h"
|
||||
|
||||
#define ADDITIONAL_ARMS_DEALERS 20 // Flugente: this does NOT include Tina, this is for the as-of-yet undetermined slots
|
||||
|
||||
//enums for the various arms dealers
|
||||
enum
|
||||
@@ -50,7 +50,12 @@ enum
|
||||
ARMS_DEALER_BETTY,
|
||||
#endif
|
||||
|
||||
NUM_ARMS_DEALERS,
|
||||
// Flugente: added new merchants (and slots for even more of them)
|
||||
ARMS_DEALER_TINA,
|
||||
|
||||
ARMS_DEALER_ADDITIONAL_1,
|
||||
|
||||
NUM_ARMS_DEALERS = ARMS_DEALER_ADDITIONAL_1 + ADDITIONAL_ARMS_DEALERS,
|
||||
};
|
||||
|
||||
#define NUM_ORIGINAL_ARMS_DEALERS 19
|
||||
@@ -66,79 +71,78 @@ enum
|
||||
|
||||
|
||||
//The following defines indicate what items can be sold by the arms dealer
|
||||
#define ARMS_DEALER_HANDGUNCLASS 0x00000001
|
||||
#define ARMS_DEALER_SMGCLASS 0x00000002
|
||||
#define ARMS_DEALER_RIFLECLASS 0x00000004
|
||||
#define ARMS_DEALER_MGCLASS 0x00000008
|
||||
#define ARMS_DEALER_SHOTGUNCLASS 0x00000010
|
||||
#define ARMS_DEALER_HANDGUNCLASS 0x00000001 // 1
|
||||
#define ARMS_DEALER_SMGCLASS 0x00000002 // 2
|
||||
#define ARMS_DEALER_RIFLECLASS 0x00000004 // 4
|
||||
#define ARMS_DEALER_MGCLASS 0x00000008 // 8
|
||||
#define ARMS_DEALER_SHOTGUNCLASS 0x00000010 // 16
|
||||
|
||||
#define ARMS_DEALER_KNIFECLASS 0x00000020
|
||||
#define ARMS_DEALER_KNIFECLASS 0x00000020 // 32
|
||||
|
||||
#define ARMS_DEALER_BLADE 0x00000040
|
||||
#define ARMS_DEALER_LAUNCHER 0x00000080
|
||||
#define ARMS_DEALER_BLADE 0x00000040 // 64
|
||||
#define ARMS_DEALER_LAUNCHER 0x00000080 // 128
|
||||
|
||||
#define ARMS_DEALER_ARMOUR 0x00000100
|
||||
#define ARMS_DEALER_MEDKIT 0x00000200
|
||||
#define ARMS_DEALER_MISC 0x00000400
|
||||
#define ARMS_DEALER_AMMO 0x00000800
|
||||
#define ARMS_DEALER_ARMOUR 0x00000100 // 256
|
||||
#define ARMS_DEALER_MEDKIT 0x00000200 // 512
|
||||
#define ARMS_DEALER_MISC 0x00000400 // 1024
|
||||
#define ARMS_DEALER_AMMO 0x00000800 // 2048
|
||||
|
||||
#define ARMS_DEALER_GRENADE 0x00001000
|
||||
#define ARMS_DEALER_BOMB 0x00002000
|
||||
#define ARMS_DEALER_EXPLOSV 0x00004000
|
||||
#define ARMS_DEALER_GRENADE 0x00001000 // 4096
|
||||
#define ARMS_DEALER_BOMB 0x00002000 // 8192
|
||||
#define ARMS_DEALER_EXPLOSV 0x00004000 // 16384
|
||||
|
||||
#define ARMS_DEALER_KIT 0x00008000
|
||||
#define ARMS_DEALER_KIT 0x00008000 // 32764
|
||||
|
||||
#define ARMS_DEALER_FACE 0x00010000
|
||||
//#define ARMS_DEALER_THROWN 0x00020000
|
||||
//#define ARMS_DEALER_KEY 0x00040000
|
||||
#define ARMS_DEALER_FACE 0x00010000 // 65536
|
||||
//#define ARMS_DEALER_THROWN 0x00020000 // 131072
|
||||
//#define ARMS_DEALER_KEY 0x00040000 // 262144
|
||||
|
||||
//#define ARMS_DEALER_VIDEO_CAMERA 0x00020000
|
||||
//#define ARMS_DEALER_VIDEO_CAMERA 0x00020000 // 131072
|
||||
|
||||
#define ARMS_DEALER_DETONATORS 0x00040000
|
||||
#define ARMS_DEALER_DETONATORS 0x00040000 // 262144
|
||||
|
||||
#define ARMS_DEALER_ATTACHMENTS 0x00080000
|
||||
#define ARMS_DEALER_ATTACHMENTS 0x00080000 // 524288
|
||||
|
||||
|
||||
#define ARMS_DEALER_ALCOHOL 0x00100000
|
||||
#define ARMS_DEALER_ELECTRONICS 0x00200000
|
||||
#define ARMS_DEALER_HARDWARE 0x00400000 | ARMS_DEALER_KIT
|
||||
#define ARMS_DEALER_ALCOHOL 0x00100000 // 1048576
|
||||
#define ARMS_DEALER_ELECTRONICS 0x00200000 // 2097152
|
||||
#define ARMS_DEALER_HARDWARE 0x00400000 | ARMS_DEALER_KIT
|
||||
|
||||
#define ARMS_DEALER_MEDICAL 0x00800000 | ARMS_DEALER_MEDKIT
|
||||
#define ARMS_DEALER_MEDICAL 0x00800000 | ARMS_DEALER_MEDKIT
|
||||
|
||||
//#define ARMS_DEALER_EMPTY_JAR 0x01000000
|
||||
#define ARMS_DEALER_CREATURE_PARTS 0x02000000
|
||||
#define ARMS_DEALER_ROCKET_RIFLE 0x04000000
|
||||
//#define ARMS_DEALER_EMPTY_JAR 0x01000000 // 16777216
|
||||
#define ARMS_DEALER_CREATURE_PARTS 0x02000000 // 33554432
|
||||
#define ARMS_DEALER_ROCKET_RIFLE 0x04000000 // 67108864
|
||||
|
||||
#define ARMS_DEALER_ONLY_USED_ITEMS 0x08000000
|
||||
#define ARMS_DEALER_GIVES_CHANGE 0x10000000 //The arms dealer will give the required change when doing a transaction
|
||||
#define ARMS_DEALER_ACCEPTS_GIFTS 0x20000000 //The arms dealer is the kind of person who will accept gifts
|
||||
#define ARMS_DEALER_SOME_USED_ITEMS 0x40000000 //The arms dealer can have used items in his inventory
|
||||
#define ARMS_DEALER_HAS_NO_INVENTORY 0x80000000 //The arms dealer does not carry any inventory
|
||||
#define ARMS_DEALER_ONLY_USED_ITEMS 0x08000000 // 134217728
|
||||
#define ARMS_DEALER_GIVES_CHANGE 0x10000000 // 268435456 //The arms dealer will give the required change when doing a transaction
|
||||
#define ARMS_DEALER_ACCEPTS_GIFTS 0x20000000 // 536870912 //The arms dealer is the kind of person who will accept gifts
|
||||
#define ARMS_DEALER_SOME_USED_ITEMS 0x40000000 // 1073741824 //The arms dealer can have used items in his inventory
|
||||
#define ARMS_DEALER_HAS_NO_INVENTORY 0x80000000 // 2147483648 //The arms dealer does not carry any inventory
|
||||
|
||||
|
||||
#define ARMS_DEALER_ALL_GUNS ARMS_DEALER_HANDGUNCLASS | ARMS_DEALER_SMGCLASS | ARMS_DEALER_RIFLECLASS | ARMS_DEALER_MGCLASS | ARMS_DEALER_SHOTGUNCLASS
|
||||
|
||||
#define ARMS_DEALER_BIG_GUNS ARMS_DEALER_SMGCLASS | ARMS_DEALER_RIFLECLASS | ARMS_DEALER_MGCLASS | ARMS_DEALER_SHOTGUNCLASS
|
||||
|
||||
#define ARMS_DEALER_ALL_WEAPONS ARMS_DEALER_ALL_GUNS | ARMS_DEALER_BLADE | ARMS_DEALER_LAUNCHER | ARMS_DEALER_KNIFECLASS
|
||||
#define ARMS_DEALER_ALL_GUNS ARMS_DEALER_HANDGUNCLASS | ARMS_DEALER_BIG_GUNS
|
||||
|
||||
#define ARMS_DEALER_ALL_WEAPONS ARMS_DEALER_ALL_GUNS | ARMS_DEALER_BLADE | ARMS_DEALER_LAUNCHER | ARMS_DEALER_KNIFECLASS
|
||||
|
||||
#ifdef JA2UB
|
||||
//Raul
|
||||
#define ARMS_DEALER_FLAG__RAUL_HAS_SOLD_BARRETT_TO_PLAYER 0x00000001 // Raul has sold the Barrett to the player
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_48 0x00000002 // Raul said the quote for when the player first puts the hand cannon down
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_49 0x00000004 // Quote for when player removes hand cannon from players offer area
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_50 0x00000008 // Quote for when player adds the hand cannon AGAIN into the players offer area
|
||||
#define ARMS_DEALER_FLAG__RAUL_HAS_SOLD_BARRETT_TO_PLAYER 0x00000001 // Raul has sold the Barrett to the player
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_48 0x00000002 // Raul said the quote for when the player first puts the hand cannon down
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_49 0x00000004 // Quote for when player removes hand cannon from players offer area
|
||||
#define ARMS_DEALER_FLAG__RAUL_SAID_QUOTE_50 0x00000008 // Quote for when player adds the hand cannon AGAIN into the players offer area
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Specific Dealer Flags
|
||||
// NOTE: Each dealer has 8 flags, but different dealers can and SHOULD share the same flag #s!
|
||||
//
|
||||
|
||||
// Alex Fredo
|
||||
#define ARMS_DEALER_FLAG__FREDO_HAS_SAID_ROCKET_RIFLE_QUOTE 0x00000001 // Alex Fredo has already repaired the Rocket Rifle
|
||||
#define ARMS_DEALER_FLAG__FREDO_HAS_SAID_ROCKET_RIFLE_QUOTE 0x00000001 // Alex Fredo has already repaired the Rocket Rifle
|
||||
// Franz Hinkle
|
||||
#define ARMS_DEALER_FLAG__FRANZ_HAS_SOLD_VIDEO_CAMERA_TO_PLAYER 0x00000001 // Franz Hinkle has sold the video camera to the player
|
||||
|
||||
@@ -146,6 +150,10 @@ enum
|
||||
// THIS STRUCTURE HAS UNCHANGING INFO THAT DOESN'T GET SAVED/RESTORED/RESET
|
||||
typedef struct
|
||||
{
|
||||
// added for xml externalisation by Flugente 2012-12-18
|
||||
UINT16 uiIndex;
|
||||
CHAR16 szName[80]; // name of this merchant (used in xml, not used ingame)
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
@@ -163,7 +171,7 @@ typedef struct
|
||||
UINT8 ubShopKeeperID; // Merc Id for the dealer
|
||||
UINT8 ubTypeOfArmsDealer; // Whether he buys/sells, sells, buys, or repairs
|
||||
INT32 iInitialCash; // How much cash dealer starts with (we now reset to this amount once / day)
|
||||
UINT32 uiFlags; // various flags which control the dealer's operations
|
||||
UINT32 uiFlags; // various flags which control the dealer's operations
|
||||
|
||||
UINT32 dailyIncrement;
|
||||
UINT32 dailyMaximum;
|
||||
@@ -320,7 +328,8 @@ typedef std::list<DEALER_SPECIAL_ITEM> DealerItemList;
|
||||
extern std::vector<DealerItemList> gArmsDealersInventory;
|
||||
void OrderDealerItems(int armsDealer, int usItem, int numItems, int arrivalDay);
|
||||
|
||||
extern const ARMS_DEALER_INFO DefaultarmsDealerInfo[ NUM_ARMS_DEALERS ];
|
||||
// Flugente 2012-12-19: merchant data has been externalised - see XML_Merchants.cpp
|
||||
//extern const ARMS_DEALER_INFO DefaultarmsDealerInfo[ NUM_ARMS_DEALERS ];
|
||||
extern std::vector<ARMS_DEALER_INFO> armsDealerInfo;
|
||||
extern ARMS_DEALER_STATUS gArmsDealerStatus[ NUM_ARMS_DEALERS ];
|
||||
|
||||
|
||||
@@ -691,7 +691,9 @@ DEALER_POSSIBLE_INV gFredoInventory[MAXITEMS+1];// =
|
||||
// { LAST_DEALER_ITEM, NO_DEALER_ITEM }, //Last One
|
||||
//};
|
||||
|
||||
DEALER_POSSIBLE_INV gTinaInventory[MAXITEMS+1];
|
||||
|
||||
DEALER_POSSIBLE_INV gArmsDealerAdditional[ADDITIONAL_ARMS_DEALERS][MAXITEMS+1];
|
||||
|
||||
// prototypes
|
||||
|
||||
@@ -792,7 +794,18 @@ INT8 GetDealersMaxItemAmount( UINT8 ubDealerID, UINT16 usItemIndex )
|
||||
return( GetMaxItemAmount( gMannyInventory, usItemIndex ) );
|
||||
break;
|
||||
|
||||
case ARMS_DEALER_TINA:
|
||||
return( GetMaxItemAmount( gTinaInventory, usItemIndex ) );
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
if ( ubDealerID < NUM_ARMS_DEALERS )
|
||||
{
|
||||
UINT8 additionaldealernumber = ubDealerID - ARMS_DEALER_ADDITIONAL_1;
|
||||
return( GetMaxItemAmount( gArmsDealerAdditional[additionaldealernumber], usItemIndex ) );
|
||||
}
|
||||
}
|
||||
Assert( FALSE );
|
||||
return( 0 );
|
||||
break;
|
||||
@@ -911,7 +924,18 @@ DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT8 ubArmsDealerID
|
||||
return( gMannyInventory );
|
||||
break;
|
||||
|
||||
case ARMS_DEALER_TINA:
|
||||
return( gTinaInventory );
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
if ( ubArmsDealerID < NUM_ARMS_DEALERS )
|
||||
{
|
||||
UINT8 additionaldealernumber = ubArmsDealerID - ARMS_DEALER_ADDITIONAL_1;
|
||||
return( gArmsDealerAdditional[additionaldealernumber] );
|
||||
}
|
||||
}
|
||||
return( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define _ARMS_DEALER_INV_INIT__H_
|
||||
|
||||
#include "Item Types.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
|
||||
#define LAST_DEALER_ITEM 0//-1
|
||||
#define NO_DEALER_ITEM 0
|
||||
@@ -82,4 +83,8 @@ extern DEALER_POSSIBLE_INV gPerkoInventory[MAXITEMS+1];
|
||||
#endif
|
||||
extern DEALER_POSSIBLE_INV gFredoInventory[MAXITEMS+1];
|
||||
|
||||
// added by Flugente 2012-12-19
|
||||
extern DEALER_POSSIBLE_INV gTinaInventory[MAXITEMS+1];
|
||||
extern DEALER_POSSIBLE_INV gArmsDealerAdditional[ADDITIONAL_ARMS_DEALERS][MAXITEMS+1];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -218,6 +218,7 @@
|
||||
<ClCompile Include="XML_LBEPocketPopup.cpp" />
|
||||
<ClCompile Include="XML_LoadBearingEquipment.cpp" />
|
||||
<ClCompile Include="XML_Magazine.cpp" />
|
||||
<ClCompile Include="XML_Merchants.cpp" />
|
||||
<ClCompile Include="XML_MercStartingGear.cpp" />
|
||||
<ClCompile Include="XML_Merge.cpp" />
|
||||
<ClCompile Include="XML_NewFaceGear.cpp" />
|
||||
|
||||
@@ -635,5 +635,8 @@
|
||||
<ClCompile Include="XML_RandomItem.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_Merchants.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -67,6 +67,7 @@ typedef PARSE_STAGE;
|
||||
#define EXPLOSIVESFILENAME "Explosives.xml"
|
||||
#define DRUGSFILENAME "Drugs.xml"
|
||||
#define FOODFILENAME "Food.xml"
|
||||
#define MERCHANTSFILENAME "NPCInventory\\Merchants.xml"
|
||||
#define CLOTHESFILENAME "Clothes.xml"
|
||||
#define RANDOMITEMFILENAME "RandomItem.xml"
|
||||
#define AMMOFILENAME "AmmoStrings.xml"
|
||||
@@ -108,6 +109,27 @@ typedef PARSE_STAGE;
|
||||
#define ARNIEINVENTORYFILENAME "NPCInventory\\ArnieInventory.xml"
|
||||
#define PERKOINVENTORYFILENAME "NPCInventory\\PerkoInventory.xml"
|
||||
#define FREDOINVENTORYFILENAME "NPCInventory\\FredoInventory.xml"
|
||||
#define TINAINVENTORYFILENAME "NPCInventory\\TinaInventory.xml"
|
||||
#define ADITIONALDEALER_1_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_1_Inventory.xml"
|
||||
#define ADITIONALDEALER_2_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_2_Inventory.xml"
|
||||
#define ADITIONALDEALER_3_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_3_Inventory.xml"
|
||||
#define ADITIONALDEALER_4_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_4_Inventory.xml"
|
||||
#define ADITIONALDEALER_5_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_5_Inventory.xml"
|
||||
#define ADITIONALDEALER_6_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_6_Inventory.xml"
|
||||
#define ADITIONALDEALER_7_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_7_Inventory.xml"
|
||||
#define ADITIONALDEALER_8_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_8_Inventory.xml"
|
||||
#define ADITIONALDEALER_9_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_9_Inventory.xml"
|
||||
#define ADITIONALDEALER_10_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_10_Inventory.xml"
|
||||
#define ADITIONALDEALER_11_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_11_Inventory.xml"
|
||||
#define ADITIONALDEALER_12_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_12_Inventory.xml"
|
||||
#define ADITIONALDEALER_13_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_13_Inventory.xml"
|
||||
#define ADITIONALDEALER_14_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_14_Inventory.xml"
|
||||
#define ADITIONALDEALER_15_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_15_Inventory.xml"
|
||||
#define ADITIONALDEALER_16_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_16_Inventory.xml"
|
||||
#define ADITIONALDEALER_17_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_17_Inventory.xml"
|
||||
#define ADITIONALDEALER_18_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_18_Inventory.xml"
|
||||
#define ADITIONALDEALER_19_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_19_Inventory.xml"
|
||||
#define ADITIONALDEALER_20_INVENTORYFILENAME "NPCInventory\\AdditionalDealer_20_Inventory.xml"
|
||||
|
||||
#ifdef JA2UB
|
||||
#define BETTYINVENTORYFILENAME "NPCInventory\\BettyInventory.xml"
|
||||
@@ -308,6 +330,10 @@ extern BOOLEAN WriteDrugsStats();
|
||||
extern BOOLEAN ReadInFoodStats(STR fileName);
|
||||
extern BOOLEAN WriteFoodStats();
|
||||
|
||||
// Flugente: merchants
|
||||
extern BOOLEAN ReadInMerchantStats(STR fileName);
|
||||
extern BOOLEAN WriteMerchantStats();
|
||||
|
||||
// Flugente: clothes
|
||||
extern BOOLEAN ReadInClothesStats(STR fileName);
|
||||
extern BOOLEAN WriteClothesStats();
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "overhead.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||
ARMS_DEALER_INFO curMerchant;
|
||||
ARMS_DEALER_INFO * curArray;
|
||||
UINT32 maxArraySize;
|
||||
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
}
|
||||
typedef merchantParseData;
|
||||
|
||||
static void XMLCALL
|
||||
merchantStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
merchantParseData * pData = (merchantParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
if(strcmp(name, "MERCHANTSLIST") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
memset(pData->curArray,0,sizeof(ARMS_DEALER_INFO)*pData->maxArraySize);
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "MERCHANT") == 0 && pData->curElement == ELEMENT_LIST)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
memset(&pData->curMerchant,0,sizeof(ARMS_DEALER_INFO));
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "uiIndex") == 0 ||
|
||||
strcmp(name, "szName") == 0 ||
|
||||
strcmp(name, "dBuyModifier") == 0 ||
|
||||
strcmp(name, "dSellModifier") == 0 ||
|
||||
strcmp(name, "ubShopKeeperID") == 0 ||
|
||||
strcmp(name, "ubTypeOfArmsDealer") == 0 ||
|
||||
strcmp(name, "iInitialCash") == 0 ||
|
||||
strcmp(name, "uiFlags") == 0 ||
|
||||
strcmp(name, "dailyIncrement") == 0 ||
|
||||
strcmp(name, "dailyMaximum") == 0 ||
|
||||
strcmp(name, "dailyRetained") == 0 ||
|
||||
strcmp(name, "minCoolness") == 0 ||
|
||||
strcmp(name, "maxCoolness") == 0 ||
|
||||
strcmp(name, "addToCoolness") == 0 ||
|
||||
strcmp(name, "coolnessProgressRate") == 0 ||
|
||||
strcmp(name, "daysDelayMin") == 0 ||
|
||||
strcmp(name, "daysDelayMax") == 0 ||
|
||||
strcmp(name, "useBRSetting") == 0 ||
|
||||
strcmp(name, "allInventoryAlwaysAvailable") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
pData->szCharData[0] = '\0';
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
merchantCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
merchantParseData * pData = (merchantParseData *)userData;
|
||||
|
||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
||||
){
|
||||
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void XMLCALL
|
||||
merchantEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
merchantParseData * pData = (merchantParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //we're at the end of an element that we've been reading
|
||||
{
|
||||
if(strcmp(name, "MERCHANTSLIST") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "MERCHANT") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
// we do NOT want to read the first entry -> move stuff by 1
|
||||
if(pData->curMerchant.uiIndex < pData->maxArraySize)
|
||||
{
|
||||
pData->curArray[pData->curMerchant.uiIndex] = pData->curMerchant; //write the merchant into the table
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.uiIndex = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "szName") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
// not needed, but it's there for informational purposes
|
||||
}
|
||||
else if(strcmp(name, "dBuyModifier") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.dBuyModifier = (FLOAT) atof(pData->szCharData);
|
||||
|
||||
// fit for reasonable values
|
||||
pData->curMerchant.dBuyModifier = min(5.0f, max(0.1f, pData->curMerchant.dBuyModifier) );
|
||||
}
|
||||
else if(strcmp(name, "dSellModifier") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.dSellModifier = (FLOAT) atof(pData->szCharData);
|
||||
|
||||
// fit for reasonable values
|
||||
pData->curMerchant.dSellModifier = min(5.0f, max(0.1f, pData->curMerchant.dSellModifier) );
|
||||
}
|
||||
else if(strcmp(name, "ubShopKeeperID") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.ubShopKeeperID = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ubTypeOfArmsDealer") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.ubTypeOfArmsDealer = (UINT8) atol(pData->szCharData);
|
||||
|
||||
// fit for reasonable values
|
||||
pData->curMerchant.ubTypeOfArmsDealer = min(ARMS_DEALER_REPAIRS, pData->curMerchant.ubTypeOfArmsDealer);
|
||||
}
|
||||
else if(strcmp(name, "iInitialCash") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.iInitialCash = (INT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "uiFlags") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.uiFlags = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "dailyIncrement") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.dailyIncrement = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "dailyMaximum") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.dailyMaximum = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "dailyRetained") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.dailyRetained = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "minCoolness") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.minCoolness = (UINT32) atol(pData->szCharData);
|
||||
|
||||
// fit for reasonable values
|
||||
pData->curMerchant.minCoolness = min(10, max(1, pData->curMerchant.minCoolness) );
|
||||
}
|
||||
else if(strcmp(name, "maxCoolness") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.maxCoolness = (UINT32) atol(pData->szCharData);
|
||||
|
||||
// fit for reasonable values
|
||||
pData->curMerchant.maxCoolness = min(10, max(1, pData->curMerchant.maxCoolness) );
|
||||
}
|
||||
else if(strcmp(name, "addToCoolness") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.addToCoolness = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "coolnessProgressRate") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.coolnessProgressRate = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "daysDelayMin") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.daysDelayMin = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "daysDelayMax") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.daysDelayMax = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "useBRSetting") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.useBRSetting = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "allInventoryAlwaysAvailable") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMerchant.allInventoryAlwaysAvailable = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ReadInMerchantStats(STR fileName)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
merchantParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Merchants.xml" );
|
||||
|
||||
// Open merchants file
|
||||
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
uiFSize = FileGetSize(hFile);
|
||||
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
|
||||
|
||||
//Read in block
|
||||
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
|
||||
{
|
||||
MemFree(lpcBuffer);
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
lpcBuffer[uiFSize] = 0; //add a null terminator
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
XML_SetElementHandler(parser, merchantStartElementHandle, merchantEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, merchantCharacterDataHandle);
|
||||
|
||||
ARMS_DEALER_INFO Merchants[NUM_ARMS_DEALERS]; // exists solely for this xml
|
||||
|
||||
memset(&pData,0,sizeof(pData));
|
||||
pData.curArray = Merchants;
|
||||
pData.maxArraySize = NUM_ARMS_DEALERS;
|
||||
|
||||
XML_SetUserData(parser, &pData);
|
||||
|
||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||
{
|
||||
CHAR8 errorBuf[511];
|
||||
|
||||
sprintf(errorBuf, "XML Parser Error in Merchant.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
|
||||
LiveMessage(errorBuf);
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
|
||||
// now fill the internal merchant vector
|
||||
std::copy(Merchants, Merchants + sizeof(Merchants)/sizeof(*Merchants), armsDealerInfo.begin());
|
||||
|
||||
XML_ParserFree(parser);
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN WriteMerchantStats()
|
||||
{
|
||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"writemerchantsstats");
|
||||
HWFILE hFile;
|
||||
|
||||
//Debug code; make sure that what we got from the file is the same as what's there
|
||||
// Open a new file
|
||||
hFile = FileOpen( "TABLEDATA\\Merchant out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
FilePrintf(hFile,"<MERCHANTSLIST>\r\n");
|
||||
for(cnt = 0; cnt < NUM_ARMS_DEALERS; ++cnt)
|
||||
{
|
||||
FilePrintf(hFile,"\t<MERCHANT>\r\n");
|
||||
|
||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", armsDealerInfo[cnt].uiIndex );
|
||||
|
||||
FilePrintf(hFile,"\t\t<dBuyModifier>%2.2f</dBuyModifier>\r\n", armsDealerInfo[cnt].dBuyModifier );
|
||||
FilePrintf(hFile,"\t\t<dSellModifier>%2.2f</dSellModifier>\r\n", armsDealerInfo[cnt].dSellModifier );
|
||||
FilePrintf(hFile,"\t\t<ubShopKeeperID>%d</ubShopKeeperID>\r\n", armsDealerInfo[cnt].ubShopKeeperID );
|
||||
FilePrintf(hFile,"\t\t<ubTypeOfArmsDealer>%d</ubTypeOfArmsDealer>\r\n", armsDealerInfo[cnt].ubTypeOfArmsDealer );
|
||||
FilePrintf(hFile,"\t\t<iInitialCash>%d</iInitialCash>\r\n", armsDealerInfo[cnt].iInitialCash );
|
||||
FilePrintf(hFile,"\t\t<uiFlags>%d</uiFlags>\r\n", armsDealerInfo[cnt].uiFlags );
|
||||
FilePrintf(hFile,"\t\t<dailyIncrement>%d</dailyIncrement>\r\n", armsDealerInfo[cnt].dailyIncrement );
|
||||
FilePrintf(hFile,"\t\t<dailyMaximum>%d</dailyMaximum>\r\n", armsDealerInfo[cnt].dailyMaximum );
|
||||
FilePrintf(hFile,"\t\t<dailyRetained>%d</dailyRetained>\r\n", armsDealerInfo[cnt].dailyRetained );
|
||||
FilePrintf(hFile,"\t\t<minCoolness>%d</minCoolness>\r\n", armsDealerInfo[cnt].minCoolness );
|
||||
FilePrintf(hFile,"\t\t<maxCoolness>%d</maxCoolness>\r\n", armsDealerInfo[cnt].maxCoolness );
|
||||
FilePrintf(hFile,"\t\t<addToCoolness>%d</addToCoolness>\r\n", armsDealerInfo[cnt].addToCoolness );
|
||||
FilePrintf(hFile,"\t\t<coolnessProgressRate>%d</coolnessProgressRate>\r\n", armsDealerInfo[cnt].coolnessProgressRate );
|
||||
FilePrintf(hFile,"\t\t<daysDelayMin>%d</daysDelayMin>\r\n", armsDealerInfo[cnt].daysDelayMin );
|
||||
FilePrintf(hFile,"\t\t<daysDelayMax>%d</daysDelayMax>\r\n", armsDealerInfo[cnt].daysDelayMax );
|
||||
FilePrintf(hFile,"\t\t<useBRSetting>%d</useBRSetting>\r\n", armsDealerInfo[cnt].useBRSetting );
|
||||
FilePrintf(hFile,"\t\t<allInventoryAlwaysAvailable>%d</allInventoryAlwaysAvailable>\r\n", armsDealerInfo[cnt].allInventoryAlwaysAvailable );
|
||||
|
||||
FilePrintf(hFile,"\t</MERCHANT>\r\n");
|
||||
}
|
||||
FilePrintf(hFile,"</MERCHANTSLIST>\r\n");
|
||||
}
|
||||
FileClose( hFile );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
Reference in New Issue
Block a user