mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Rework of eq_dictionary
This commit is contained in:
+7
-7
@@ -705,7 +705,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
||||
|
||||
/* Insert starting inventory... */
|
||||
std::string invquery;
|
||||
for (int16 i=EmuConstants::EQUIPMENT_BEGIN; i<=EmuConstants::BANK_BAGS_END;) {
|
||||
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END;) {
|
||||
const ItemInst* newinv = inv->GetItem(i);
|
||||
if (newinv) {
|
||||
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
||||
@@ -714,16 +714,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
||||
auto results = QueryDatabase(invquery);
|
||||
}
|
||||
|
||||
if (i == MainCursor) {
|
||||
i = EmuConstants::GENERAL_BAGS_BEGIN;
|
||||
if (i == SlotCursor) {
|
||||
i = EQEmu::Constants::GENERAL_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EmuConstants::CURSOR_BAG_END) {
|
||||
i = EmuConstants::BANK_BEGIN;
|
||||
else if (i == EQEmu::Constants::CURSOR_BAG_END) {
|
||||
i = EQEmu::Constants::BANK_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EmuConstants::BANK_END) {
|
||||
i = EmuConstants::BANK_BAGS_BEGIN;
|
||||
else if (i == EQEmu::Constants::BANK_END) {
|
||||
i = EQEmu::Constants::BANK_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Convert {
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ uint32 Items[_MaterialCount];
|
||||
/*510*/ uint32 Items[MaterialCount];
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@@ -227,9 +227,9 @@ namespace Convert {
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0312*/ uint32 item_material[MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ Convert::Color_Struct item_tint[_MaterialCount];
|
||||
/*0392*/ Convert::Color_Struct item_tint[MaterialCount];
|
||||
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@@ -330,7 +330,7 @@ namespace Convert {
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Convert::Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
|
||||
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE];
|
||||
/*7264*/ Convert::Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1416,7 +1416,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
if (rquery != ""){ results = QueryDatabase(rquery); }
|
||||
/* Run Material Color Convert */
|
||||
first_entry = 0; rquery = "";
|
||||
for (i = 0; i < _MaterialCount; i++){
|
||||
for (i = 0; i < MaterialCount; i++){
|
||||
if (pp->item_tint[i].color > 0){
|
||||
if (first_entry != 1){
|
||||
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
|
||||
@@ -1428,7 +1428,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
if (rquery != ""){ results = QueryDatabase(rquery); }
|
||||
/* Run Tribute Convert */
|
||||
first_entry = 0; rquery = "";
|
||||
for (i = 0; i < EmuConstants::TRIBUTE_SIZE; i++){
|
||||
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){
|
||||
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){
|
||||
if (first_entry != 1){
|
||||
rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
|
||||
|
||||
+70
-68
@@ -851,7 +851,7 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ
|
||||
** Material use slots
|
||||
**
|
||||
*/
|
||||
enum MaterialUseSlots : uint8
|
||||
enum MaterialSlots : uint8
|
||||
{
|
||||
MaterialHead = 0,
|
||||
MaterialChest,
|
||||
@@ -862,8 +862,8 @@ enum MaterialUseSlots : uint8
|
||||
MaterialFeet,
|
||||
MaterialPrimary,
|
||||
MaterialSecondary,
|
||||
_MaterialCount,
|
||||
_MaterialInvalid = 255
|
||||
MaterialCount,
|
||||
MaterialInvalid = 255
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -900,71 +900,73 @@ enum MaterialUseSlots : uint8
|
||||
**
|
||||
*/
|
||||
|
||||
enum InventoryMapTypes : int16 {
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo, // 5
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted, // 10
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC, // 15
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived, // 20
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapKrono,
|
||||
MapOther,
|
||||
_MapCount
|
||||
enum InventoryTypes : int16
|
||||
{
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo, // 5
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted, // 10
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC, // 15
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived, // 20
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeKrono,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
};
|
||||
|
||||
enum InventoryMainTypes : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck, // 5
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2, // 10
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1, // 15
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist, // 20
|
||||
MainPowerSource = 9999, // temp
|
||||
MainAmmo = 21, // temp
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4, // 25
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
//MainGeneral9,
|
||||
//MainGeneral10,
|
||||
MainCursor, // 30
|
||||
_MainCount
|
||||
enum PossessionsSlots : int16
|
||||
{
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck, // 5
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2, // 10
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1, // 15
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist, // 20
|
||||
SlotPowerSource = 9999, // temp
|
||||
SlotAmmo = 21, // temp
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4, // 25
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
//SlotGeneral9,
|
||||
//SlotGeneral10,
|
||||
SlotCursor, // 30
|
||||
SlotCount
|
||||
};
|
||||
|
||||
#define INVALID_INDEX -1
|
||||
@@ -973,8 +975,8 @@ enum InventoryMainTypes : int16 {
|
||||
|
||||
// yes..these are redundant... but, they help to identify and define what is actually being performed
|
||||
// plus, since they're pre-op's, they don't affect the actual binary size
|
||||
#define MAP_BEGIN 0
|
||||
#define MAIN_BEGIN 0
|
||||
#define TYPE_BEGIN 0
|
||||
#define SLOT_BEGIN 0
|
||||
#define SUB_BEGIN 0
|
||||
#define AUG_BEGIN 0
|
||||
|
||||
|
||||
+309
-312
File diff suppressed because it is too large
Load Diff
+124
-123
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -42,156 +42,157 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference)
|
||||
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
|
||||
|
||||
class EmuConstants
|
||||
{
|
||||
|
||||
namespace EQEmu {
|
||||
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
|
||||
public:
|
||||
// database
|
||||
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
|
||||
class Constants {
|
||||
public:
|
||||
// database
|
||||
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
|
||||
|
||||
static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 indexMap);
|
||||
//static std::string InventoryLocationName(Location_Struct location);
|
||||
static std::string InventoryMapName(int16 indexMap);
|
||||
static std::string InventoryMainName(int16 indexMain);
|
||||
static std::string InventorySubName(int16 indexSub);
|
||||
static std::string InventoryAugName(int16 indexAug);
|
||||
// inventory
|
||||
static uint16 InventoryTypeSize(int16 type_index);
|
||||
//static const char* InventoryLocationName(Location_Struct location);
|
||||
static const char* InventoryTypeName(int16 type_index);
|
||||
static const char* InventorySlotName(int16 slot_index);
|
||||
static const char* InventorySubName(int16 sub_index);
|
||||
static const char* InventoryAugName(int16 aug_index);
|
||||
|
||||
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = _MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 5; // (need client values)
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = _MainCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = 22;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = 0;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values)
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = 22;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = 0;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = MainCharm;
|
||||
static const int16 EQUIPMENT_END = MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = SlotCharm;
|
||||
static const int16 EQUIPMENT_END = SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
|
||||
static const int16 GENERAL_BEGIN = MainGeneral1;
|
||||
static const int16 GENERAL_END = MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
static const int16 GENERAL_BEGIN = SlotGeneral1;
|
||||
static const int16 GENERAL_END = SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = MAP_WORLD_SIZE;
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = TYPE_WORLD_SIZE;
|
||||
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = MAP_TRIBUTE_SIZE;
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
|
||||
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
|
||||
|
||||
static const int16 MATERIAL_BEGIN = MaterialHead;
|
||||
static const int16 MATERIAL_END = MaterialSecondary;
|
||||
static const int16 MATERIAL_TINT_END = MaterialFeet;
|
||||
static const int16 MATERIAL_SIZE = _MaterialCount;
|
||||
static const int16 MATERIAL_BEGIN = MaterialHead;
|
||||
static const int16 MATERIAL_END = MaterialSecondary;
|
||||
static const int16 MATERIAL_TINT_END = MaterialFeet;
|
||||
static const int16 MATERIAL_SIZE = MaterialCount;
|
||||
|
||||
// items
|
||||
// common and container sizes will not increase until the new 'location' struct is implemented
|
||||
static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE;
|
||||
// items
|
||||
// common and container sizes will not increase until the new 'location' struct is implemented
|
||||
static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE;
|
||||
|
||||
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t BANDOLIERS_SIZE = RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
|
||||
static const size_t BANDOLIER_ITEM_COUNT = RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
|
||||
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t BANDOLIERS_SIZE = RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
|
||||
static const size_t BANDOLIER_ITEM_COUNT = RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
|
||||
|
||||
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
|
||||
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
|
||||
|
||||
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
|
||||
};
|
||||
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
|
||||
};
|
||||
|
||||
class EQLimits
|
||||
{
|
||||
// values should default to a non-beneficial value..unless value conflicts with intended operation
|
||||
//
|
||||
// EmuConstants may be used as references..but, not every reference needs to be in EmuConstants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
|
||||
public:
|
||||
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
|
||||
// use this inside of class Client (limits to actual clients)
|
||||
static bool IsValidPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
|
||||
// EQEmu::Constants may be used as references..but, not every reference needs to be in EQEmu::Constants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
|
||||
class Limits {
|
||||
public:
|
||||
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
|
||||
// use this inside of class Client (limits to actual clients)
|
||||
static bool IsValidPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// basically..any non-client classes - do not when setting a valid client
|
||||
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
|
||||
// basically..any non-client classes - do not when setting a valid client
|
||||
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// these are 'universal' - do not when setting a valid client
|
||||
static bool IsValidMobClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
|
||||
// these are 'universal' - do not when setting a valid client
|
||||
static bool IsValidMobClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// database
|
||||
static size_t CharacterCreationLimit(ClientVersion clientVersion);
|
||||
// database
|
||||
static size_t CharacterCreationLimit(ClientVersion clientVersion);
|
||||
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
|
||||
static uint64 PossessionsBitmask(ClientVersion clientVersion);
|
||||
static uint64 EquipmentBitmask(ClientVersion clientVersion);
|
||||
static uint64 GeneralBitmask(ClientVersion clientVersion);
|
||||
static uint64 CursorBitmask(ClientVersion clientVersion);
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
|
||||
static uint64 PossessionsBitmask(ClientVersion clientVersion);
|
||||
static uint64 EquipmentBitmask(ClientVersion clientVersion);
|
||||
static uint64 GeneralBitmask(ClientVersion clientVersion);
|
||||
static uint64 CursorBitmask(ClientVersion clientVersion);
|
||||
|
||||
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
|
||||
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
|
||||
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
|
||||
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
|
||||
|
||||
// items
|
||||
static uint16 ItemCommonSize(ClientVersion clientVersion);
|
||||
static uint16 ItemContainerSize(ClientVersion clientVersion);
|
||||
// items
|
||||
static uint16 ItemCommonSize(ClientVersion clientVersion);
|
||||
static uint16 ItemContainerSize(ClientVersion clientVersion);
|
||||
|
||||
// player profile
|
||||
static bool CoinHasWeight(ClientVersion clientVersion);
|
||||
};
|
||||
// player profile
|
||||
static bool CoinHasWeight(ClientVersion clientVersion);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* EQ_DICTIONARY_H */
|
||||
|
||||
|
||||
+13
-13
@@ -294,7 +294,7 @@ struct Spawn_Struct {
|
||||
/*0000*/ EquipStruct equip_primary; // Equipment: Main visual
|
||||
/*0000*/ EquipStruct equip_secondary; // Equipment: Off visual
|
||||
} equip;
|
||||
/*0000*/ EquipStruct equipment[_MaterialCount];
|
||||
/*0000*/ EquipStruct equipment[MaterialCount];
|
||||
};
|
||||
/*0233*/ float runspeed; // Speed when running
|
||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||
@@ -340,7 +340,7 @@ union
|
||||
/*0376*/ Color_Struct color_primary; // Color of primary item
|
||||
/*0380*/ Color_Struct color_secondary; // Color of secondary item
|
||||
} equipment_colors;
|
||||
/*0348*/ Color_Struct colors[_MaterialCount]; // Array elements correspond to struct equipment_colors above
|
||||
/*0348*/ Color_Struct colors[MaterialCount]; // Array elements correspond to struct equipment_colors above
|
||||
};
|
||||
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
||||
/*0385*/
|
||||
@@ -777,7 +777,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[EmuConstants::BANDOLIER_ITEM_COUNT];
|
||||
BandolierItem_Struct Items[EQEmu::Constants::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -791,7 +791,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[EmuConstants::POTION_BELT_ITEM_COUNT];
|
||||
PotionBeltItem_Struct Items[EQEmu::Constants::POTION_BELT_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct MovePotionToBelt_Struct
|
||||
@@ -882,7 +882,7 @@ struct SuspendedMinion_Struct
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ uint32 Items[_MaterialCount];
|
||||
/*510*/ uint32 Items[MaterialCount];
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@@ -990,9 +990,9 @@ struct PlayerProfile_Struct
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0312*/ uint32 item_material[MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ Color_Struct item_tint[_MaterialCount];
|
||||
/*0392*/ Color_Struct item_tint[MaterialCount];
|
||||
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@@ -1093,7 +1093,7 @@ struct PlayerProfile_Struct
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
|
||||
/*7224*/ Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE];
|
||||
/*7264*/ Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1120,7 +1120,7 @@ struct PlayerProfile_Struct
|
||||
/*12800*/ uint32 expAA;
|
||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||
/*12808*/ uint8 unknown12844[36];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_SIZE];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::Constants::BANDOLIERS_SIZE];
|
||||
/*14124*/ uint8 unknown14160[4506];
|
||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||
/*19240*/ uint32 timeentitledonaccount;
|
||||
@@ -2125,7 +2125,7 @@ struct Illusion_Struct { //size: 256 - SoF
|
||||
/*092*/ uint32 drakkin_heritage; //
|
||||
/*096*/ uint32 drakkin_tattoo; //
|
||||
/*100*/ uint32 drakkin_details; //
|
||||
/*104*/ uint32 armor_tint[_MaterialCount]; //
|
||||
/*104*/ uint32 armor_tint[MaterialCount]; //
|
||||
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
||||
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
||||
/*142*/ uint8 unknown138[114]; //
|
||||
@@ -3412,7 +3412,7 @@ struct DyeStruct
|
||||
struct Color_Struct secondary; // or this
|
||||
}
|
||||
dyes;
|
||||
struct Color_Struct dye[_MaterialCount];
|
||||
struct Color_Struct dye[MaterialCount];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3473,8 +3473,8 @@ struct SelectTributeReply_Struct {
|
||||
|
||||
struct TributeInfo_Struct {
|
||||
uint32 active; //0 == inactive, 1 == active
|
||||
uint32 tributes[EmuConstants::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EmuConstants::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tributes[EQEmu::Constants::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQEmu::Constants::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tribute_master_id;
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
|
||||
uint16 old_pet_hp; /* Not Used */
|
||||
uint16 old_pet_mana; /* Not Used */
|
||||
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
||||
uint32 pet_items[_MaterialCount]; /* Not Used */
|
||||
uint32 pet_items[MaterialCount]; /* Not Used */
|
||||
char merc_name[64]; /* Used */
|
||||
|
||||
uint32 aa_effects; /* Used */
|
||||
|
||||
+179
-179
File diff suppressed because it is too large
Load Diff
@@ -184,9 +184,9 @@ struct Item_Struct {
|
||||
int32 FactionAmt4; // Faction Amt 4
|
||||
char CharmFile[32]; // ?
|
||||
uint32 AugType;
|
||||
uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
|
||||
uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
|
||||
uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
|
||||
uint8 AugSlotType[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
|
||||
uint8 AugSlotVisible[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
|
||||
uint8 AugSlotUnk2[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
|
||||
uint32 LDoNTheme;
|
||||
uint32 LDoNPrice;
|
||||
uint32 LDoNSold;
|
||||
|
||||
+159
-159
@@ -27,13 +27,13 @@ namespace RoF
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot);
|
||||
static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot);
|
||||
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 serverSlot);
|
||||
static inline structs::TypelessInventorySlot_Struct ServerToRoFTypelessSlot(uint32 serverSlot);
|
||||
static inline uint32 ServerToRoFCorpseSlot(uint32 serverCorpseSlot);
|
||||
|
||||
// client to server inventory location converters
|
||||
static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot);
|
||||
static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot);
|
||||
static inline uint32 RoFToServerSlot(structs::InventorySlot_Struct rofSlot);
|
||||
static inline uint32 RoFToServerTypelessSlot(structs::TypelessInventorySlot_Struct rofSlot);
|
||||
static inline uint32 RoFToServerCorpseSlot(uint32 rofCorpseSlot);
|
||||
|
||||
// server to client text link converter
|
||||
@@ -162,7 +162,7 @@ namespace RoF
|
||||
|
||||
eq->unknown000 = 1;
|
||||
OUT(npcid);
|
||||
eq->slot = ServerToRoFMainInvSlot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot);
|
||||
OUT(charges);
|
||||
OUT(sell_price);
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace RoF
|
||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
OUT(merchant_entity_id);
|
||||
eq->slot_id = ServerToRoFMainInvSlot(emu->slot_id);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id);
|
||||
OUT(charges);
|
||||
OUT(cost);
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace RoF
|
||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
eq->inventorySlot = ServerToRoFMainInvSlot(emu->inventorySlot);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot);
|
||||
OUT(success);
|
||||
|
||||
FINISH_ENCODE();
|
||||
@@ -481,7 +481,7 @@ namespace RoF
|
||||
OUT(slot);
|
||||
|
||||
OUT(spell_id);
|
||||
eq->inventoryslot = ServerToRoFSlot(emu->inventoryslot);
|
||||
eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot);
|
||||
//OUT(inventoryslot);
|
||||
OUT(target_id);
|
||||
|
||||
@@ -1536,7 +1536,7 @@ namespace RoF
|
||||
ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct);
|
||||
SETUP_DIRECT_ENCODE(ItemVerifyReply_Struct, structs::ItemVerifyReply_Struct);
|
||||
|
||||
eq->slot = ServerToRoFSlot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoFSlot(emu->slot);
|
||||
OUT(spell);
|
||||
OUT(target);
|
||||
|
||||
@@ -2342,7 +2342,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (uint32 r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
@@ -2357,7 +2357,7 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
@@ -2369,7 +2369,7 @@ namespace RoF
|
||||
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (uint32 r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2381,7 +2381,7 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (uint32 r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2502,9 +2502,9 @@ namespace RoF
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EmuConstants::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EmuConstants::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -2820,12 +2820,12 @@ namespace RoF
|
||||
OUT(object_type);
|
||||
OUT(some_id);
|
||||
eq->container_slot = ServerToRoFSlot(emu->unknown1);
|
||||
structs::ItemSlotStruct RoFSlot;
|
||||
RoFSlot.SlotType = 8; // Observed
|
||||
structs::InventorySlot_Struct RoFSlot;
|
||||
RoFSlot.Type = 8; // Observed
|
||||
RoFSlot.Unknown02 = 0;
|
||||
RoFSlot.MainSlot = 0xffff;
|
||||
RoFSlot.SubSlot = 0xffff;
|
||||
RoFSlot.AugSlot = 0xffff;
|
||||
RoFSlot.Slot = 0xffff;
|
||||
RoFSlot.Sub = 0xffff;
|
||||
RoFSlot.Aug = 0xffff;
|
||||
RoFSlot.Unknown01 = 0;
|
||||
eq->unknown_slot = RoFSlot;
|
||||
OUT(recipe_id);
|
||||
@@ -3037,7 +3037,7 @@ namespace RoF
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
@@ -3154,7 +3154,7 @@ namespace RoF
|
||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
OUT(npcid);
|
||||
eq->itemslot = ServerToRoFMainInvSlot(emu->itemslot);
|
||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot);
|
||||
//OUT(itemslot);
|
||||
OUT(quantity);
|
||||
OUT(price);
|
||||
@@ -3679,7 +3679,7 @@ namespace RoF
|
||||
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
||||
SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct);
|
||||
|
||||
eq->slot = ServerToRoFSlot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoFSlot(emu->slot);
|
||||
OUT(quantity);
|
||||
OUT(tribute_master_id);
|
||||
OUT(tribute_points);
|
||||
@@ -4164,7 +4164,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct);
|
||||
|
||||
IN(npcid);
|
||||
emu->slot = RoFToServerMainInvSlot(eq->slot);
|
||||
emu->slot = RoFToServerTypelessSlot(eq->inventory_slot);
|
||||
IN(charges);
|
||||
IN(sell_price);
|
||||
|
||||
@@ -4177,7 +4177,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
IN(merchant_entity_id);
|
||||
emu->slot_id = RoFToServerMainInvSlot(eq->slot_id);
|
||||
emu->slot_id = RoFToServerTypelessSlot(eq->inventory_slot);
|
||||
IN(charges);
|
||||
IN(cost);
|
||||
|
||||
@@ -4190,7 +4190,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
|
||||
|
||||
IN(merchant_entity_id);
|
||||
emu->slot_id = RoFToServerMainInvSlot(eq->slot_id);
|
||||
emu->slot_id = RoFToServerTypelessSlot(eq->inventory_slot);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
@@ -4212,7 +4212,7 @@ namespace RoF
|
||||
DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct);
|
||||
SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
emu->inventorySlot = RoFToServerMainInvSlot(eq->inventorySlot);
|
||||
emu->inventorySlot = RoFToServerTypelessSlot(eq->inventory_slot);
|
||||
IN(success);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@@ -4321,7 +4321,7 @@ namespace RoF
|
||||
IN(slot);
|
||||
|
||||
IN(spell_id);
|
||||
emu->inventoryslot = RoFToServerSlot(eq->inventoryslot);
|
||||
emu->inventoryslot = RoFToServerSlot(eq->inventory_slot);
|
||||
//IN(inventoryslot);
|
||||
IN(target_id);
|
||||
|
||||
@@ -4449,7 +4449,7 @@ namespace RoF
|
||||
DECODE_LENGTH_EXACT(structs::Consume_Struct);
|
||||
SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct);
|
||||
|
||||
emu->slot = RoFToServerSlot(eq->slot);
|
||||
emu->slot = RoFToServerSlot(eq->inventory_slot);
|
||||
IN(auto_consumed);
|
||||
IN(type);
|
||||
|
||||
@@ -4810,7 +4810,7 @@ namespace RoF
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
// Max Augs is now 6, but no code to support that many yet
|
||||
@@ -4825,7 +4825,7 @@ namespace RoF
|
||||
DECODE_LENGTH_EXACT(structs::ItemVerifyRequest_Struct);
|
||||
SETUP_DIRECT_DECODE(ItemVerifyRequest_Struct, structs::ItemVerifyRequest_Struct);
|
||||
|
||||
emu->slot = RoFToServerSlot(eq->slot);
|
||||
emu->slot = RoFToServerSlot(eq->inventory_slot);
|
||||
IN(target);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@@ -4866,7 +4866,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
emu->from_slot = RoFToServerSlot(eq->from_slot);
|
||||
emu->to_slot = RoFToServerSlot(eq->to_slot);
|
||||
IN(number_in_stack);
|
||||
@@ -5015,7 +5015,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
IN(npcid);
|
||||
emu->itemslot = RoFToServerMainInvSlot(eq->itemslot);
|
||||
emu->itemslot = RoFToServerTypelessSlot(eq->inventory_slot);
|
||||
//IN(itemslot);
|
||||
IN(quantity);
|
||||
IN(price);
|
||||
@@ -5114,7 +5114,7 @@ namespace RoF
|
||||
DECODE_LENGTH_EXACT(structs::TributeItem_Struct);
|
||||
SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct);
|
||||
|
||||
emu->slot = RoFToServerSlot(eq->slot);
|
||||
emu->slot = RoFToServerSlot(eq->inventory_slot);
|
||||
IN(quantity);
|
||||
IN(tribute_master_id);
|
||||
IN(tribute_points);
|
||||
@@ -5214,12 +5214,12 @@ namespace RoF
|
||||
hdr.stacksize = stackable ? charges : 1;
|
||||
hdr.unknown004 = 0;
|
||||
|
||||
structs::ItemSlotStruct slot_id = ServerToRoFSlot(slot_id_in);
|
||||
structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in);
|
||||
|
||||
hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items?
|
||||
hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot;
|
||||
hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff;
|
||||
hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff;
|
||||
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items?
|
||||
hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
|
||||
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff;
|
||||
hdr.unknown013 = (merchant_slot == 0) ? slot_id.Aug : 0xffff;
|
||||
hdr.price = inst->GetPrice();
|
||||
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
|
||||
//hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff;
|
||||
@@ -5678,7 +5678,7 @@ namespace RoF
|
||||
|
||||
uint32 SubLengths[10];
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
SubSerializations[x] = nullptr;
|
||||
|
||||
@@ -5690,15 +5690,15 @@ namespace RoF
|
||||
|
||||
iqbs.subitem_count++;
|
||||
|
||||
if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor?
|
||||
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
|
||||
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
|
||||
SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // ???????
|
||||
|
||||
@@ -5713,7 +5713,7 @@ namespace RoF
|
||||
|
||||
ss.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
if (SubSerializations[x]) {
|
||||
|
||||
@@ -5733,30 +5733,30 @@ namespace RoF
|
||||
return item_serial;
|
||||
}
|
||||
|
||||
static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot)
|
||||
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 serverSlot)
|
||||
{
|
||||
structs::ItemSlotStruct RoFSlot;
|
||||
RoFSlot.SlotType = INVALID_INDEX;
|
||||
structs::InventorySlot_Struct RoFSlot;
|
||||
RoFSlot.Type = INVALID_INDEX;
|
||||
RoFSlot.Unknown02 = NOT_USED;
|
||||
RoFSlot.MainSlot = INVALID_INDEX;
|
||||
RoFSlot.SubSlot = INVALID_INDEX;
|
||||
RoFSlot.AugSlot = INVALID_INDEX;
|
||||
RoFSlot.Slot = INVALID_INDEX;
|
||||
RoFSlot.Sub = INVALID_INDEX;
|
||||
RoFSlot.Aug = INVALID_INDEX;
|
||||
RoFSlot.Unknown01 = NOT_USED;
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor
|
||||
RoFSlot.SlotType = maps::MapPossessions;
|
||||
RoFSlot.MainSlot = serverSlot;
|
||||
if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor
|
||||
RoFSlot.Type = inventory::TypePossessions;
|
||||
RoFSlot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == MainPowerSource)
|
||||
RoFSlot.MainSlot = slots::MainPowerSource;
|
||||
if (serverSlot == SlotPowerSource)
|
||||
RoFSlot.Slot = inventory::SlotPowerSource;
|
||||
|
||||
else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.MainSlot += 3;
|
||||
else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= MainAmmo) // (> 20)
|
||||
RoFSlot.MainSlot += 1;
|
||||
else if (serverSlot >= SlotAmmo) // (> 20)
|
||||
RoFSlot.Slot += 1;
|
||||
}
|
||||
|
||||
/*else if (ServerSlot < 51) { // Cursor Buffer
|
||||
@@ -5764,51 +5764,51 @@ namespace RoF
|
||||
RoFSlot.MainSlot = ServerSlot - 31;
|
||||
}*/
|
||||
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoFSlot.SlotType = maps::MapPossessions;
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoFSlot.Type = inventory::TypePossessions;
|
||||
TempSlot = serverSlot - 1;
|
||||
RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
|
||||
if (RoFSlot.MainSlot >= slots::MainGeneral9) // (> 30)
|
||||
RoFSlot.MainSlot = slots::MainCursor;
|
||||
if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30)
|
||||
RoFSlot.Slot = inventory::SlotCursor;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute
|
||||
RoFSlot.SlotType = maps::MapTribute;
|
||||
RoFSlot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute
|
||||
RoFSlot.Type = inventory::TypeTribute;
|
||||
RoFSlot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) {
|
||||
RoFSlot.SlotType = maps::MapBank;
|
||||
TempSlot = serverSlot - EmuConstants::BANK_BEGIN;
|
||||
RoFSlot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) {
|
||||
RoFSlot.Type = inventory::TypeBank;
|
||||
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) {
|
||||
RoFSlot.SlotType = maps::MapSharedBank;
|
||||
TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN;
|
||||
RoFSlot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
|
||||
RoFSlot.Type = inventory::TypeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) {
|
||||
RoFSlot.SlotType = maps::MapTrade;
|
||||
TempSlot = serverSlot - EmuConstants::TRADE_BEGIN;
|
||||
RoFSlot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) {
|
||||
RoFSlot.Type = inventory::TypeTrade;
|
||||
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) {
|
||||
RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5825,38 +5825,38 @@ namespace RoF
|
||||
*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) {
|
||||
RoFSlot.SlotType = maps::MapWorld;
|
||||
TempSlot = serverSlot - EmuConstants::WORLD_BEGIN;
|
||||
RoFSlot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) {
|
||||
RoFSlot.Type = inventory::TypeWorld;
|
||||
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, RoFSlot.Unknown01);
|
||||
|
||||
return RoFSlot;
|
||||
}
|
||||
|
||||
static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot)
|
||||
static inline structs::TypelessInventorySlot_Struct ServerToRoFTypelessSlot(uint32 serverSlot)
|
||||
{
|
||||
structs::MainInvItemSlotStruct RoFSlot;
|
||||
RoFSlot.MainSlot = INVALID_INDEX;
|
||||
RoFSlot.SubSlot = INVALID_INDEX;
|
||||
RoFSlot.AugSlot = INVALID_INDEX;
|
||||
structs::TypelessInventorySlot_Struct RoFSlot;
|
||||
RoFSlot.Slot = INVALID_INDEX;
|
||||
RoFSlot.Sub = INVALID_INDEX;
|
||||
RoFSlot.Aug = INVALID_INDEX;
|
||||
RoFSlot.Unknown01 = NOT_USED;
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52)
|
||||
RoFSlot.MainSlot = serverSlot;
|
||||
if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52)
|
||||
RoFSlot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == MainPowerSource)
|
||||
RoFSlot.MainSlot = slots::MainPowerSource;
|
||||
if (serverSlot == SlotPowerSource)
|
||||
RoFSlot.Slot = inventory::SlotPowerSource;
|
||||
|
||||
else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.MainSlot += 3;
|
||||
else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory
|
||||
RoFSlot.MainSlot += 1;
|
||||
else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory
|
||||
RoFSlot.Slot += 1;
|
||||
|
||||
/*else if (ServerSlot >= MainCursor) { // Cursor
|
||||
RoFSlot.MainSlot = slots::MainCursor;
|
||||
@@ -5866,13 +5866,13 @@ namespace RoF
|
||||
}*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) {
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) {
|
||||
TempSlot = serverSlot - 1;
|
||||
RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, RoFSlot.Unknown01);
|
||||
|
||||
return RoFSlot;
|
||||
}
|
||||
@@ -5882,17 +5882,17 @@ namespace RoF
|
||||
return (serverCorpseSlot + 1);
|
||||
}
|
||||
|
||||
static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot)
|
||||
static inline uint32 RoFToServerSlot(structs::InventorySlot_Struct rofSlot)
|
||||
{
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rofSlot.SlotType == maps::MapPossessions && rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rofSlot.MainSlot == slots::MainPowerSource)
|
||||
TempSlot = MainPowerSource;
|
||||
if (rofSlot.Type == inventory::TypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rofSlot.Slot == inventory::SlotPowerSource)
|
||||
TempSlot = SlotPowerSource;
|
||||
|
||||
else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.MainSlot - 3;
|
||||
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.Slot - 3;
|
||||
|
||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots
|
||||
// Need to figure out what to do when we get these
|
||||
@@ -5905,61 +5905,61 @@ namespace RoF
|
||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||
}*/
|
||||
|
||||
else if (rofSlot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rofSlot.MainSlot - 1;
|
||||
else if (rofSlot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rofSlot.Slot - 1;
|
||||
|
||||
else // Worn Slots
|
||||
TempSlot = rofSlot.MainSlot;
|
||||
TempSlot = rofSlot.Slot;
|
||||
|
||||
if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1;
|
||||
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.SlotType == maps::MapBank) {
|
||||
TempSlot = EmuConstants::BANK_BEGIN;
|
||||
else if (rofSlot.Type == inventory::TypeBank) {
|
||||
TempSlot = EQEmu::Constants::BANK_BEGIN;
|
||||
|
||||
if (rofSlot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1;
|
||||
if (rofSlot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
|
||||
|
||||
else
|
||||
TempSlot += rofSlot.MainSlot;
|
||||
TempSlot += rofSlot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.SlotType == maps::MapSharedBank) {
|
||||
TempSlot = EmuConstants::SHARED_BANK_BEGIN;
|
||||
else if (rofSlot.Type == inventory::TypeSharedBank) {
|
||||
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN;
|
||||
|
||||
if (rofSlot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1;
|
||||
if (rofSlot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
|
||||
|
||||
else
|
||||
TempSlot += rofSlot.MainSlot;
|
||||
TempSlot += rofSlot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.SlotType == maps::MapTrade) {
|
||||
TempSlot = EmuConstants::TRADE_BEGIN;
|
||||
else if (rofSlot.Type == inventory::TypeTrade) {
|
||||
TempSlot = EQEmu::Constants::TRADE_BEGIN;
|
||||
|
||||
if (rofSlot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1;
|
||||
if (rofSlot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
|
||||
// OLD CODE:
|
||||
//TempSlot += 100 + (RoFSlot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
|
||||
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::Constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
|
||||
|
||||
else
|
||||
TempSlot += rofSlot.MainSlot;
|
||||
TempSlot += rofSlot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.SlotType == maps::MapWorld) {
|
||||
TempSlot = EmuConstants::WORLD_BEGIN;
|
||||
else if (rofSlot.Type == inventory::TypeWorld) {
|
||||
TempSlot = EQEmu::Constants::WORLD_BEGIN;
|
||||
|
||||
if (rofSlot.MainSlot >= SUB_BEGIN)
|
||||
TempSlot += rofSlot.MainSlot;
|
||||
if (rofSlot.Slot >= SUB_BEGIN)
|
||||
TempSlot += rofSlot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
@@ -5973,26 +5973,26 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}*/
|
||||
|
||||
else if (rofSlot.SlotType == maps::MapGuildTribute) {
|
||||
else if (rofSlot.Type == inventory::TypeGuildTribute) {
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.SlotType, rofSlot.Unknown02, rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
|
||||
static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot)
|
||||
static inline uint32 RoFToServerTypelessSlot(structs::TypelessInventorySlot_Struct rofSlot)
|
||||
{
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rofSlot.MainSlot == slots::MainPowerSource)
|
||||
TempSlot = MainPowerSource;
|
||||
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rofSlot.Slot == inventory::SlotPowerSource)
|
||||
TempSlot = SlotPowerSource;
|
||||
|
||||
else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.MainSlot - 3;
|
||||
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.Slot - 3;
|
||||
|
||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots
|
||||
// Need to figure out what to do when we get these
|
||||
@@ -6000,19 +6000,19 @@ namespace RoF
|
||||
// Same as above
|
||||
}*/
|
||||
|
||||
else if (rofSlot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rofSlot.MainSlot - 1;
|
||||
else if (rofSlot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rofSlot.Slot - 1;
|
||||
|
||||
else
|
||||
TempSlot = rofSlot.MainSlot;
|
||||
TempSlot = rofSlot.Slot;
|
||||
|
||||
if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1;
|
||||
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
@@ -6024,7 +6024,7 @@ namespace RoF
|
||||
|
||||
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
rofTextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -6033,7 +6033,7 @@ namespace RoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
rofTextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -6063,7 +6063,7 @@ namespace RoF
|
||||
|
||||
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = rofTextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+164
-164
@@ -27,13 +27,13 @@ namespace RoF2
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth, ItemPacketType packet_type);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot);
|
||||
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline structs::TypelessInventorySlot_Struct ServerToRoF2TypelessSlot(uint32 serverSlot);
|
||||
static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot);
|
||||
|
||||
// client to server inventory location converters
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot);
|
||||
static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline uint32 RoF2ToServerTypelessSlot(structs::TypelessInventorySlot_Struct rof2Slot);
|
||||
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot);
|
||||
|
||||
// server to client text link converter
|
||||
@@ -228,7 +228,7 @@ namespace RoF2
|
||||
|
||||
eq->unknown000 = 1;
|
||||
OUT(npcid);
|
||||
eq->slot = ServerToRoF2MainInvSlot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot);
|
||||
OUT(charges);
|
||||
OUT(sell_price);
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
OUT(merchant_entity_id);
|
||||
eq->slot_id = ServerToRoF2MainInvSlot(emu->slot_id);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id);
|
||||
OUT(charges);
|
||||
OUT(cost);
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace RoF2
|
||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
eq->inventorySlot = ServerToRoF2MainInvSlot(emu->inventorySlot);
|
||||
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot);
|
||||
OUT(success);
|
||||
|
||||
FINISH_ENCODE();
|
||||
@@ -552,7 +552,7 @@ namespace RoF2
|
||||
OUT(slot);
|
||||
|
||||
OUT(spell_id);
|
||||
eq->inventoryslot = ServerToRoF2Slot(emu->inventoryslot);
|
||||
eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot);
|
||||
//OUT(inventoryslot);
|
||||
OUT(target_id);
|
||||
|
||||
@@ -1607,7 +1607,7 @@ namespace RoF2
|
||||
ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct);
|
||||
SETUP_DIRECT_ENCODE(ItemVerifyReply_Struct, structs::ItemVerifyReply_Struct);
|
||||
|
||||
eq->slot = ServerToRoF2Slot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoF2Slot(emu->slot);
|
||||
OUT(spell);
|
||||
OUT(target);
|
||||
|
||||
@@ -2421,7 +2421,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (uint32 r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
@@ -2436,7 +2436,7 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
@@ -2448,7 +2448,7 @@ namespace RoF2
|
||||
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (uint32 r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2460,7 +2460,7 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (uint32 r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2577,9 +2577,9 @@ namespace RoF2
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EmuConstants::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EmuConstants::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -2910,12 +2910,12 @@ namespace RoF2
|
||||
OUT(object_type);
|
||||
OUT(some_id);
|
||||
eq->container_slot = ServerToRoF2Slot(emu->unknown1);
|
||||
structs::ItemSlotStruct RoF2Slot;
|
||||
RoF2Slot.SlotType = 8; // Observed
|
||||
structs::InventorySlot_Struct RoF2Slot;
|
||||
RoF2Slot.Type = 8; // Observed
|
||||
RoF2Slot.Unknown02 = 0;
|
||||
RoF2Slot.MainSlot = 0xffff;
|
||||
RoF2Slot.SubSlot = 0xffff;
|
||||
RoF2Slot.AugSlot = 0xffff;
|
||||
RoF2Slot.Slot = 0xffff;
|
||||
RoF2Slot.Sub = 0xffff;
|
||||
RoF2Slot.Aug = 0xffff;
|
||||
RoF2Slot.Unknown01 = 0;
|
||||
eq->unknown_slot = RoF2Slot;
|
||||
OUT(recipe_id);
|
||||
@@ -3126,7 +3126,7 @@ namespace RoF2
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
@@ -3225,7 +3225,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
OUT(npcid);
|
||||
eq->itemslot = ServerToRoF2MainInvSlot(emu->itemslot);
|
||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot);
|
||||
//OUT(itemslot);
|
||||
OUT(quantity);
|
||||
OUT(price);
|
||||
@@ -3825,7 +3825,7 @@ namespace RoF2
|
||||
ENCODE_LENGTH_EXACT(TributeItem_Struct);
|
||||
SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct);
|
||||
|
||||
eq->slot = ServerToRoF2Slot(emu->slot);
|
||||
eq->inventory_slot = ServerToRoF2Slot(emu->slot);
|
||||
OUT(quantity);
|
||||
OUT(tribute_master_id);
|
||||
OUT(tribute_points);
|
||||
@@ -4384,7 +4384,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct);
|
||||
|
||||
IN(npcid);
|
||||
emu->slot = RoF2ToServerMainInvSlot(eq->slot);
|
||||
emu->slot = RoF2ToServerTypelessSlot(eq->inventory_slot);
|
||||
IN(charges);
|
||||
IN(sell_price);
|
||||
|
||||
@@ -4397,7 +4397,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||
|
||||
IN(merchant_entity_id);
|
||||
emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id);
|
||||
emu->slot_id = RoF2ToServerTypelessSlot(eq->inventory_slot);
|
||||
IN(charges);
|
||||
IN(cost);
|
||||
|
||||
@@ -4410,7 +4410,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct);
|
||||
|
||||
IN(merchant_entity_id);
|
||||
emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id);
|
||||
emu->slot_id = RoF2ToServerTypelessSlot(eq->inventory_slot);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
@@ -4432,7 +4432,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct);
|
||||
SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||
|
||||
emu->inventorySlot = RoF2ToServerMainInvSlot(eq->inventorySlot);
|
||||
emu->inventorySlot = RoF2ToServerTypelessSlot(eq->inventorySlot);
|
||||
IN(success);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@@ -4540,7 +4540,7 @@ namespace RoF2
|
||||
IN(slot);
|
||||
|
||||
IN(spell_id);
|
||||
emu->inventoryslot = RoF2ToServerSlot(eq->inventoryslot);
|
||||
emu->inventoryslot = RoF2ToServerSlot(eq->inventory_slot);
|
||||
//IN(inventoryslot);
|
||||
IN(target_id);
|
||||
IN(y_pos);
|
||||
@@ -4667,7 +4667,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::Consume_Struct);
|
||||
SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct);
|
||||
|
||||
emu->slot = RoF2ToServerSlot(eq->slot);
|
||||
emu->slot = RoF2ToServerSlot(eq->inventory_slot);
|
||||
IN(auto_consumed);
|
||||
IN(type);
|
||||
|
||||
@@ -5028,7 +5028,7 @@ namespace RoF2
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
IN(link_hash);
|
||||
@@ -5042,7 +5042,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::ItemVerifyRequest_Struct);
|
||||
SETUP_DIRECT_DECODE(ItemVerifyRequest_Struct, structs::ItemVerifyRequest_Struct);
|
||||
|
||||
emu->slot = RoF2ToServerSlot(eq->slot);
|
||||
emu->slot = RoF2ToServerSlot(eq->inventory_slot);
|
||||
IN(target);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@@ -5082,7 +5082,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
emu->from_slot = RoF2ToServerSlot(eq->from_slot);
|
||||
emu->to_slot = RoF2ToServerSlot(eq->to_slot);
|
||||
IN(number_in_stack);
|
||||
@@ -5231,7 +5231,7 @@ namespace RoF2
|
||||
SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||
|
||||
IN(npcid);
|
||||
emu->itemslot = RoF2ToServerMainInvSlot(eq->itemslot);
|
||||
emu->itemslot = RoF2ToServerTypelessSlot(eq->inventory_slot);
|
||||
//IN(itemslot);
|
||||
IN(quantity);
|
||||
IN(price);
|
||||
@@ -5385,7 +5385,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::TributeItem_Struct);
|
||||
SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct);
|
||||
|
||||
emu->slot = RoF2ToServerSlot(eq->slot);
|
||||
emu->slot = RoF2ToServerSlot(eq->inventory_slot);
|
||||
IN(quantity);
|
||||
IN(tribute_master_id);
|
||||
IN(tribute_points);
|
||||
@@ -5485,12 +5485,12 @@ namespace RoF2
|
||||
hdr.stacksize = stackable ? charges : 1;
|
||||
hdr.unknown004 = 0;
|
||||
|
||||
structs::ItemSlotStruct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
||||
structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
||||
|
||||
hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items?
|
||||
hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot;
|
||||
hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff;
|
||||
hdr.aug_slot = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff;
|
||||
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items?
|
||||
hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
|
||||
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff;
|
||||
hdr.aug_slot = (merchant_slot == 0) ? slot_id.Aug : 0xffff;
|
||||
hdr.price = inst->GetPrice();
|
||||
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
|
||||
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
|
||||
@@ -5961,7 +5961,7 @@ namespace RoF2
|
||||
|
||||
uint32 SubLengths[10];
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
SubSerializations[x] = nullptr;
|
||||
|
||||
@@ -5973,15 +5973,15 @@ namespace RoF2
|
||||
|
||||
iqbs.subitem_count++;
|
||||
|
||||
if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor?
|
||||
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
|
||||
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
|
||||
SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // ???????
|
||||
|
||||
@@ -5996,7 +5996,7 @@ namespace RoF2
|
||||
|
||||
ss.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
if (SubSerializations[x]) {
|
||||
|
||||
@@ -6016,38 +6016,38 @@ namespace RoF2
|
||||
return item_serial;
|
||||
}
|
||||
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType)
|
||||
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType)
|
||||
{
|
||||
structs::ItemSlotStruct RoF2Slot;
|
||||
RoF2Slot.SlotType = INVALID_INDEX;
|
||||
structs::InventorySlot_Struct RoF2Slot;
|
||||
RoF2Slot.Type = INVALID_INDEX;
|
||||
RoF2Slot.Unknown02 = NOT_USED;
|
||||
RoF2Slot.MainSlot = INVALID_INDEX;
|
||||
RoF2Slot.SubSlot = INVALID_INDEX;
|
||||
RoF2Slot.AugSlot = INVALID_INDEX;
|
||||
RoF2Slot.Slot = INVALID_INDEX;
|
||||
RoF2Slot.Sub = INVALID_INDEX;
|
||||
RoF2Slot.Aug = INVALID_INDEX;
|
||||
RoF2Slot.Unknown01 = NOT_USED;
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor
|
||||
if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor
|
||||
if (PacketType == ItemPacketLoot)
|
||||
{
|
||||
RoF2Slot.SlotType = maps::MapCorpse;
|
||||
RoF2Slot.MainSlot = serverSlot - EmuConstants::CORPSE_BEGIN;
|
||||
RoF2Slot.Type = inventory::TypeCorpse;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::Constants::CORPSE_BEGIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
RoF2Slot.SlotType = maps::MapPossessions;
|
||||
RoF2Slot.MainSlot = serverSlot;
|
||||
RoF2Slot.Type = inventory::TypePossessions;
|
||||
RoF2Slot.Slot = serverSlot;
|
||||
}
|
||||
|
||||
if (serverSlot == MainPowerSource)
|
||||
RoF2Slot.MainSlot = slots::MainPowerSource;
|
||||
if (serverSlot == SlotPowerSource)
|
||||
RoF2Slot.Slot = inventory::SlotPowerSource;
|
||||
|
||||
else if (serverSlot >= MainCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.MainSlot += 3;
|
||||
else if (serverSlot >= SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= MainAmmo) // (> 20)
|
||||
RoF2Slot.MainSlot += 1;
|
||||
else if (serverSlot >= SlotAmmo) // (> 20)
|
||||
RoF2Slot.Slot += 1;
|
||||
}
|
||||
|
||||
/*else if (ServerSlot < 51) { // Cursor Buffer
|
||||
@@ -6055,51 +6055,51 @@ namespace RoF2
|
||||
RoF2Slot.MainSlot = ServerSlot - 31;
|
||||
}*/
|
||||
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoF2Slot.SlotType = maps::MapPossessions;
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoF2Slot.Type = inventory::TypePossessions;
|
||||
TempSlot = serverSlot - 1;
|
||||
RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
|
||||
if (RoF2Slot.MainSlot >= slots::MainGeneral9) // (> 30)
|
||||
RoF2Slot.MainSlot = slots::MainCursor;
|
||||
if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30)
|
||||
RoF2Slot.Slot = inventory::SlotCursor;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute
|
||||
RoF2Slot.SlotType = maps::MapTribute;
|
||||
RoF2Slot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute
|
||||
RoF2Slot.Type = inventory::TypeTribute;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) {
|
||||
RoF2Slot.SlotType = maps::MapBank;
|
||||
TempSlot = serverSlot - EmuConstants::BANK_BEGIN;
|
||||
RoF2Slot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) {
|
||||
RoF2Slot.Type = inventory::TypeBank;
|
||||
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) {
|
||||
RoF2Slot.SlotType = maps::MapSharedBank;
|
||||
TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN;
|
||||
RoF2Slot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
|
||||
RoF2Slot.Type = inventory::TypeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) {
|
||||
RoF2Slot.SlotType = maps::MapTrade;
|
||||
TempSlot = serverSlot - EmuConstants::TRADE_BEGIN;
|
||||
RoF2Slot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) {
|
||||
RoF2Slot.Type = inventory::TypeTrade;
|
||||
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) {
|
||||
RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
|
||||
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6116,38 +6116,38 @@ namespace RoF2
|
||||
*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) {
|
||||
RoF2Slot.SlotType = maps::MapWorld;
|
||||
TempSlot = serverSlot - EmuConstants::WORLD_BEGIN;
|
||||
RoF2Slot.MainSlot = TempSlot;
|
||||
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) {
|
||||
RoF2Slot.Type = inventory::TypeWorld;
|
||||
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01);
|
||||
|
||||
return RoF2Slot;
|
||||
}
|
||||
|
||||
static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot)
|
||||
static inline structs::TypelessInventorySlot_Struct ServerToRoF2TypelessSlot(uint32 serverSlot)
|
||||
{
|
||||
structs::MainInvItemSlotStruct RoF2Slot;
|
||||
RoF2Slot.MainSlot = INVALID_INDEX;
|
||||
RoF2Slot.SubSlot = INVALID_INDEX;
|
||||
RoF2Slot.AugSlot = INVALID_INDEX;
|
||||
structs::TypelessInventorySlot_Struct RoF2Slot;
|
||||
RoF2Slot.Slot = INVALID_INDEX;
|
||||
RoF2Slot.Sub = INVALID_INDEX;
|
||||
RoF2Slot.Aug = INVALID_INDEX;
|
||||
RoF2Slot.Unknown01 = NOT_USED;
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52)
|
||||
RoF2Slot.MainSlot = serverSlot;
|
||||
if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52)
|
||||
RoF2Slot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == MainPowerSource)
|
||||
RoF2Slot.MainSlot = slots::MainPowerSource;
|
||||
if (serverSlot == SlotPowerSource)
|
||||
RoF2Slot.Slot = inventory::SlotPowerSource;
|
||||
|
||||
else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.MainSlot += 3;
|
||||
else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory
|
||||
RoF2Slot.MainSlot += 1;
|
||||
else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory
|
||||
RoF2Slot.Slot += 1;
|
||||
|
||||
/*else if (ServerSlot >= MainCursor) { // Cursor
|
||||
RoF2Slot.MainSlot = slots::MainCursor;
|
||||
@@ -6157,33 +6157,33 @@ namespace RoF2
|
||||
}*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) {
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) {
|
||||
TempSlot = serverSlot - 1;
|
||||
RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
|
||||
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01);
|
||||
|
||||
return RoF2Slot;
|
||||
}
|
||||
|
||||
static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot)
|
||||
{
|
||||
return (serverCorpseSlot - EmuConstants::CORPSE_BEGIN + 1);
|
||||
return (serverCorpseSlot - EQEmu::Constants::CORPSE_BEGIN + 1);
|
||||
}
|
||||
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType)
|
||||
static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType)
|
||||
{
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rof2Slot.SlotType == maps::MapPossessions && rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rof2Slot.MainSlot == slots::MainPowerSource)
|
||||
TempSlot = MainPowerSource;
|
||||
if (rof2Slot.Type == inventory::TypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rof2Slot.Slot == inventory::SlotPowerSource)
|
||||
TempSlot = SlotPowerSource;
|
||||
|
||||
else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.MainSlot - 3;
|
||||
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.Slot - 3;
|
||||
|
||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots
|
||||
// Need to figure out what to do when we get these
|
||||
@@ -6196,61 +6196,61 @@ namespace RoF2
|
||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rof2Slot.MainSlot - 1;
|
||||
else if (rof2Slot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rof2Slot.Slot - 1;
|
||||
|
||||
else // Worn Slots
|
||||
TempSlot = rof2Slot.MainSlot;
|
||||
TempSlot = rof2Slot.Slot;
|
||||
|
||||
if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1;
|
||||
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapBank) {
|
||||
TempSlot = EmuConstants::BANK_BEGIN;
|
||||
else if (rof2Slot.Type == inventory::TypeBank) {
|
||||
TempSlot = EQEmu::Constants::BANK_BEGIN;
|
||||
|
||||
if (rof2Slot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1;
|
||||
if (rof2Slot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
|
||||
|
||||
else
|
||||
TempSlot += rof2Slot.MainSlot;
|
||||
TempSlot += rof2Slot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapSharedBank) {
|
||||
TempSlot = EmuConstants::SHARED_BANK_BEGIN;
|
||||
else if (rof2Slot.Type == inventory::TypeSharedBank) {
|
||||
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN;
|
||||
|
||||
if (rof2Slot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1;
|
||||
if (rof2Slot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
|
||||
|
||||
else
|
||||
TempSlot += rof2Slot.MainSlot;
|
||||
TempSlot += rof2Slot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapTrade) {
|
||||
TempSlot = EmuConstants::TRADE_BEGIN;
|
||||
else if (rof2Slot.Type == inventory::TypeTrade) {
|
||||
TempSlot = EQEmu::Constants::TRADE_BEGIN;
|
||||
|
||||
if (rof2Slot.SubSlot >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1;
|
||||
if (rof2Slot.Sub >= SUB_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
|
||||
// OLD CODE:
|
||||
//TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot;
|
||||
|
||||
else
|
||||
TempSlot += rof2Slot.MainSlot;
|
||||
TempSlot += rof2Slot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapWorld) {
|
||||
TempSlot = EmuConstants::WORLD_BEGIN;
|
||||
else if (rof2Slot.Type == inventory::TypeWorld) {
|
||||
TempSlot = EQEmu::Constants::WORLD_BEGIN;
|
||||
|
||||
if (rof2Slot.MainSlot >= SUB_BEGIN)
|
||||
TempSlot += rof2Slot.MainSlot;
|
||||
if (rof2Slot.Slot >= SUB_BEGIN)
|
||||
TempSlot += rof2Slot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
@@ -6264,30 +6264,30 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapGuildTribute) {
|
||||
else if (rof2Slot.Type == inventory::TypeGuildTribute) {
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
else if (rof2Slot.SlotType == maps::MapCorpse) {
|
||||
ServerSlot = rof2Slot.MainSlot + EmuConstants::CORPSE_BEGIN;
|
||||
else if (rof2Slot.Type == inventory::TypeCorpse) {
|
||||
ServerSlot = rof2Slot.Slot + EQEmu::Constants::CORPSE_BEGIN;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.SlotType, rof2Slot.Unknown02, rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
|
||||
static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot)
|
||||
static inline uint32 RoF2ToServerTypelessSlot(structs::TypelessInventorySlot_Struct rof2Slot)
|
||||
{
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rof2Slot.MainSlot == slots::MainPowerSource)
|
||||
TempSlot = MainPowerSource;
|
||||
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rof2Slot.Slot == inventory::SlotPowerSource)
|
||||
TempSlot = SlotPowerSource;
|
||||
|
||||
else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.MainSlot - 3;
|
||||
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.Slot - 3;
|
||||
|
||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots
|
||||
// Need to figure out what to do when we get these
|
||||
@@ -6295,31 +6295,31 @@ namespace RoF2
|
||||
// Same as above
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rof2Slot.MainSlot - 1;
|
||||
else if (rof2Slot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rof2Slot.Slot - 1;
|
||||
|
||||
else
|
||||
TempSlot = rof2Slot.MainSlot;
|
||||
TempSlot = rof2Slot.Slot;
|
||||
|
||||
if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1;
|
||||
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
|
||||
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot)
|
||||
{
|
||||
return (rof2CorpseSlot + EmuConstants::CORPSE_BEGIN - 1);
|
||||
return (rof2CorpseSlot + EQEmu::Constants::CORPSE_BEGIN - 1);
|
||||
}
|
||||
|
||||
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
rof2TextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -6328,7 +6328,7 @@ namespace RoF2
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
rof2TextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -6351,7 +6351,7 @@ namespace RoF2
|
||||
|
||||
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = rof2TextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+105
-107
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,126 +25,124 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace RoF2 {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapKrono,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeKrono,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainGeneral9,
|
||||
MainGeneral10,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral10,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotPowerSource,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotGeneral9,
|
||||
SlotGeneral10,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral10,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 200;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 200;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral10;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral10;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 99;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 351;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -174,8 +172,8 @@ namespace RoF2 {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 6;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
|
||||
|
||||
@@ -29,22 +29,24 @@ struct WorldObjectsSent_Struct {
|
||||
};
|
||||
|
||||
// New for RoF2 - Size: 12
|
||||
struct ItemSlotStruct {
|
||||
/*000*/ int16 SlotType; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
|
||||
struct InventorySlot_Struct
|
||||
{
|
||||
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
|
||||
/*002*/ int16 Unknown02;
|
||||
/*004*/ int16 MainSlot;
|
||||
/*006*/ int16 SubSlot;
|
||||
/*008*/ int16 AugSlot; // Guessing - Seen 0xffff
|
||||
/*004*/ int16 Slot;
|
||||
/*006*/ int16 Sub;
|
||||
/*008*/ int16 Aug; // Guessing - Seen 0xffff
|
||||
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
|
||||
/*012*/
|
||||
};
|
||||
|
||||
// New for RoF2 - Used for Merchant_Purchase_Struct
|
||||
// Can't sellfrom other than main inventory so Slot Type is not needed.
|
||||
struct MainInvItemSlotStruct {
|
||||
/*000*/ int16 MainSlot;
|
||||
/*002*/ int16 SubSlot;
|
||||
/*004*/ int16 AugSlot;
|
||||
struct TypelessInventorySlot_Struct
|
||||
{
|
||||
/*000*/ int16 Slot;
|
||||
/*002*/ int16 Sub;
|
||||
/*004*/ int16 Aug;
|
||||
/*006*/ int16 Unknown01;
|
||||
/*008*/
|
||||
};
|
||||
@@ -656,7 +658,7 @@ struct CastSpell_Struct
|
||||
{
|
||||
/*00*/ uint32 slot;
|
||||
/*04*/ uint32 spell_id;
|
||||
/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast
|
||||
/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast
|
||||
/*20*/ uint32 target_id;
|
||||
/*24*/ uint32 cs_unknown[2];
|
||||
/*32*/ float y_pos;
|
||||
@@ -1082,11 +1084,11 @@ union
|
||||
/*00184*/ EquipStruct equipment[22]; // Total Slots
|
||||
};
|
||||
/*00624*/ uint32 equip2_count; // Seen 9
|
||||
/*00628*/ EquipStruct equipment2[_MaterialCount]; // Appears to be Visible slots, but all 0s
|
||||
/*00628*/ EquipStruct equipment2[MaterialCount]; // Appears to be Visible slots, but all 0s
|
||||
/*00808*/ uint32 tint_count; // Seen 9
|
||||
/*00812*/ Color_Struct item_tint[_MaterialCount]; // RR GG BB 00
|
||||
/*00812*/ Color_Struct item_tint[MaterialCount]; // RR GG BB 00
|
||||
/*00848*/ uint32 tint_count2; // Seen 9
|
||||
/*00852*/ Color_Struct item_tint2[_MaterialCount]; // RR GG BB 00
|
||||
/*00852*/ Color_Struct item_tint2[MaterialCount]; // RR GG BB 00
|
||||
/*00888*/ uint8 haircolor; // Player hair color
|
||||
/*00889*/ uint8 beardcolor; // Player beard color
|
||||
/*00890*/ uint32 unknown_rof5; //
|
||||
@@ -1747,7 +1749,7 @@ struct BulkItemPacket_Struct
|
||||
|
||||
struct Consume_Struct
|
||||
{
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click
|
||||
/*016*/ uint32 type; // 0x01=Food 0x02=Water
|
||||
/*020*/ uint32 c_unknown1; // Seen 2
|
||||
@@ -1779,16 +1781,18 @@ struct ItemProperties_Struct {
|
||||
/*008*/
|
||||
};
|
||||
|
||||
struct DeleteItem_Struct {
|
||||
/*0000*/ ItemSlotStruct from_slot;
|
||||
/*0012*/ ItemSlotStruct to_slot;
|
||||
struct DeleteItem_Struct
|
||||
{
|
||||
/*0000*/ InventorySlot_Struct from_slot;
|
||||
/*0012*/ InventorySlot_Struct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
/*0028*/
|
||||
};
|
||||
|
||||
struct MoveItem_Struct {
|
||||
/*0000*/ ItemSlotStruct from_slot;
|
||||
/*0012*/ ItemSlotStruct to_slot;
|
||||
struct MoveItem_Struct
|
||||
{
|
||||
/*0000*/ InventorySlot_Struct from_slot;
|
||||
/*0012*/ InventorySlot_Struct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
/*0028*/
|
||||
};
|
||||
@@ -2222,7 +2226,7 @@ struct Merchant_Sell_Struct {
|
||||
|
||||
struct Merchant_Purchase_Struct {
|
||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
||||
/*004*/ MainInvItemSlotStruct itemslot;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 quantity;
|
||||
/*016*/ uint32 price;
|
||||
/*020*/
|
||||
@@ -2280,9 +2284,10 @@ struct AltCurrencyUpdate_Struct {
|
||||
|
||||
//Client -> Server
|
||||
//When an item is selected while the alt currency merchant window is open
|
||||
struct AltCurrencySelectItem_Struct {
|
||||
struct AltCurrencySelectItem_Struct
|
||||
{
|
||||
/*000*/ uint32 merchant_entity_id;
|
||||
/*004*/ MainInvItemSlotStruct slot_id;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*004*/ //uint32 slot_id;
|
||||
/*008*/ uint32 unknown008;
|
||||
/*012*/ uint32 unknown012;
|
||||
@@ -2338,9 +2343,10 @@ struct AltCurrencyReclaim_Struct {
|
||||
/*012*/ uint32 reclaim_flag; //1 = this is reclaim
|
||||
};
|
||||
|
||||
struct AltCurrencySellItem_Struct {
|
||||
struct AltCurrencySellItem_Struct
|
||||
{
|
||||
/*000*/ uint32 merchant_entity_id;
|
||||
/*004*/ MainInvItemSlotStruct slot_id;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*004*/ //uint32 slot_id;
|
||||
/*016*/ uint32 charges;
|
||||
/*020*/ uint32 cost;
|
||||
@@ -2356,7 +2362,7 @@ struct Adventure_Purchase_Struct {
|
||||
struct Adventure_Sell_Struct {
|
||||
/*000*/ uint32 unknown000; //0x01 - Stack Size/Charges?
|
||||
/*004*/ uint32 npcid;
|
||||
/*008*/ MainInvItemSlotStruct slot;
|
||||
/*008*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*016*/ uint32 charges;
|
||||
/*020*/ uint32 sell_price;
|
||||
/*024*/
|
||||
@@ -2702,9 +2708,9 @@ struct Stun_Struct { // 8 bytes total
|
||||
struct AugmentItem_Struct {
|
||||
/*00*/ uint32 dest_inst_id; // The unique serial number for the item instance that is being augmented
|
||||
/*04*/ uint32 container_index; // Seen 0
|
||||
/*08*/ ItemSlotStruct container_slot; // Slot of the item being augmented
|
||||
/*08*/ InventorySlot_Struct container_slot; // Slot of the item being augmented
|
||||
/*20*/ uint32 augment_index; // Seen 0
|
||||
/*24*/ ItemSlotStruct augment_slot; // Slot of the distiller to use (if one applies)
|
||||
/*24*/ InventorySlot_Struct augment_slot; // Slot of the distiller to use (if one applies)
|
||||
/*36*/ int32 augment_action; // Guessed - 0 = augment, 1 = remove with distiller, 3 = delete aug
|
||||
/*36*/ //int32 augment_slot;
|
||||
/*40*/
|
||||
@@ -3691,7 +3697,7 @@ struct TributeInfo_Struct {
|
||||
|
||||
struct TributeItem_Struct
|
||||
{
|
||||
/*00*/ ItemSlotStruct slot;
|
||||
/*00*/ InventorySlot_Struct inventory_slot;
|
||||
/*12*/ uint32 quantity;
|
||||
/*16*/ uint32 tribute_master_id;
|
||||
/*20*/ int32 tribute_points;
|
||||
@@ -3728,9 +3734,10 @@ struct Split_Struct
|
||||
** Used In: OP_TradeSkillCombine
|
||||
** Last Updated: 01-05-2013
|
||||
*/
|
||||
struct NewCombine_Struct {
|
||||
/*00*/ ItemSlotStruct container_slot;
|
||||
/*12*/ ItemSlotStruct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8)
|
||||
struct NewCombine_Struct
|
||||
{
|
||||
/*00*/ InventorySlot_Struct container_slot;
|
||||
/*12*/ InventorySlot_Struct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8)
|
||||
/*24*/
|
||||
};
|
||||
|
||||
@@ -3769,8 +3776,8 @@ struct RecipeReply_Struct {
|
||||
struct RecipeAutoCombine_Struct {
|
||||
/*00*/ uint32 object_type;
|
||||
/*04*/ uint32 some_id;
|
||||
/*08*/ ItemSlotStruct container_slot; //echoed in reply - Was uint32 unknown1
|
||||
/*20*/ ItemSlotStruct unknown_slot; //echoed in reply
|
||||
/*08*/ InventorySlot_Struct container_slot; //echoed in reply - Was uint32 unknown1
|
||||
/*20*/ InventorySlot_Struct unknown_slot; //echoed in reply
|
||||
/*32*/ uint32 recipe_id;
|
||||
/*36*/ uint32 reply_code;
|
||||
/*40*/
|
||||
@@ -4488,19 +4495,22 @@ struct ExpansionInfo_Struct {
|
||||
/*064*/ uint32 Expansions;
|
||||
};
|
||||
|
||||
struct ApplyPoison_Struct {
|
||||
MainInvItemSlotStruct inventorySlot;
|
||||
struct ApplyPoison_Struct
|
||||
{
|
||||
TypelessInventorySlot_Struct inventorySlot;
|
||||
uint32 success;
|
||||
};
|
||||
|
||||
struct ItemVerifyRequest_Struct {
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
struct ItemVerifyRequest_Struct
|
||||
{
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 target; // Target Entity ID
|
||||
/*016*/
|
||||
};
|
||||
|
||||
struct ItemVerifyReply_Struct {
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
struct ItemVerifyReply_Struct
|
||||
{
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 spell; // Spell ID to cast if different than item effect
|
||||
/*016*/ uint32 target; // Target Entity ID
|
||||
/*020*/
|
||||
|
||||
+104
-106
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,125 +25,123 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace RoF {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainGeneral9,
|
||||
MainGeneral10,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral10,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotPowerSource,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotGeneral9,
|
||||
SlotGeneral10,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral10,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 200;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 200;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral10;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral10;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 99;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 351;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -173,8 +171,8 @@ namespace RoF {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 6;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
|
||||
|
||||
@@ -29,22 +29,24 @@ struct WorldObjectsSent_Struct {
|
||||
};
|
||||
|
||||
// New for RoF - Size: 12
|
||||
struct ItemSlotStruct {
|
||||
/*000*/ int16 SlotType; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
|
||||
struct InventorySlot_Struct
|
||||
{
|
||||
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
|
||||
/*002*/ int16 Unknown02;
|
||||
/*004*/ int16 MainSlot;
|
||||
/*006*/ int16 SubSlot;
|
||||
/*008*/ int16 AugSlot; // Guessing - Seen 0xffff
|
||||
/*004*/ int16 Slot;
|
||||
/*006*/ int16 Sub;
|
||||
/*008*/ int16 Aug; // Guessing - Seen 0xffff
|
||||
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
|
||||
/*012*/
|
||||
};
|
||||
|
||||
// New for RoF - Used for Merchant_Purchase_Struct
|
||||
// Can't sellfrom other than main inventory so Slot Type is not needed.
|
||||
struct MainInvItemSlotStruct {
|
||||
/*000*/ int16 MainSlot;
|
||||
/*002*/ int16 SubSlot;
|
||||
/*004*/ int16 AugSlot;
|
||||
struct TypelessInventorySlot_Struct
|
||||
{
|
||||
/*000*/ int16 Slot;
|
||||
/*002*/ int16 Sub;
|
||||
/*004*/ int16 Aug;
|
||||
/*006*/ int16 Unknown01;
|
||||
/*008*/
|
||||
};
|
||||
@@ -645,7 +647,7 @@ struct CastSpell_Struct
|
||||
{
|
||||
/*00*/ uint32 slot;
|
||||
/*04*/ uint32 spell_id;
|
||||
/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast
|
||||
/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast
|
||||
/*20*/ uint32 target_id;
|
||||
/*24*/ uint32 cs_unknown[2];
|
||||
/*32*/ float y_pos;
|
||||
@@ -1777,7 +1779,7 @@ struct BulkItemPacket_Struct
|
||||
|
||||
struct Consume_Struct
|
||||
{
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click
|
||||
/*016*/ uint32 type; // 0x01=Food 0x02=Water
|
||||
/*020*/ uint32 c_unknown1; // Seen 2
|
||||
@@ -1809,17 +1811,19 @@ struct ItemProperties_Struct {
|
||||
/*008*/
|
||||
};
|
||||
|
||||
struct DeleteItem_Struct {
|
||||
/*0000*/ ItemSlotStruct from_slot;
|
||||
/*0012*/ ItemSlotStruct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
struct DeleteItem_Struct
|
||||
{
|
||||
/*0000*/ InventorySlot_Struct from_slot;
|
||||
/*0012*/ InventorySlot_Struct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
/*0028*/
|
||||
};
|
||||
|
||||
struct MoveItem_Struct {
|
||||
/*0000*/ ItemSlotStruct from_slot;
|
||||
/*0012*/ ItemSlotStruct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
struct MoveItem_Struct
|
||||
{
|
||||
/*0000*/ InventorySlot_Struct from_slot;
|
||||
/*0012*/ InventorySlot_Struct to_slot;
|
||||
/*0024*/ uint32 number_in_stack;
|
||||
/*0028*/
|
||||
};
|
||||
|
||||
@@ -2252,7 +2256,7 @@ struct Merchant_Sell_Struct {
|
||||
|
||||
struct Merchant_Purchase_Struct {
|
||||
/*000*/ uint32 npcid; // Merchant NPC's entity id
|
||||
/*004*/ MainInvItemSlotStruct itemslot;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 quantity;
|
||||
/*016*/ uint32 price;
|
||||
/*020*/
|
||||
@@ -2310,9 +2314,10 @@ struct AltCurrencyUpdate_Struct {
|
||||
|
||||
//Client -> Server
|
||||
//When an item is selected while the alt currency merchant window is open
|
||||
struct AltCurrencySelectItem_Struct {
|
||||
struct AltCurrencySelectItem_Struct
|
||||
{
|
||||
/*000*/ uint32 merchant_entity_id;
|
||||
/*004*/ MainInvItemSlotStruct slot_id;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*008*/ uint32 unknown008;
|
||||
/*012*/ uint32 unknown012;
|
||||
/*016*/ uint32 unknown016;
|
||||
@@ -2369,7 +2374,7 @@ struct AltCurrencyReclaim_Struct {
|
||||
|
||||
struct AltCurrencySellItem_Struct {
|
||||
/*000*/ uint32 merchant_entity_id;
|
||||
/*004*/ MainInvItemSlotStruct slot_id;
|
||||
/*004*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*008*/ uint32 charges;
|
||||
/*012*/ uint32 cost;
|
||||
};
|
||||
@@ -2384,7 +2389,7 @@ struct Adventure_Purchase_Struct {
|
||||
struct Adventure_Sell_Struct {
|
||||
/*000*/ uint32 unknown000; //0x01 - Stack Size/Charges?
|
||||
/*004*/ uint32 npcid;
|
||||
/*008*/ MainInvItemSlotStruct slot;
|
||||
/*008*/ TypelessInventorySlot_Struct inventory_slot;
|
||||
/*016*/ uint32 charges;
|
||||
/*020*/ uint32 sell_price;
|
||||
/*024*/
|
||||
@@ -2730,9 +2735,9 @@ struct Stun_Struct { // 8 bytes total
|
||||
struct AugmentItem_Struct {
|
||||
/*00*/ uint32 dest_inst_id; // The unique serial number for the item instance that is being augmented
|
||||
/*04*/ uint32 container_index; // Seen 0
|
||||
/*08*/ ItemSlotStruct container_slot; // Slot of the item being augmented
|
||||
/*08*/ InventorySlot_Struct container_slot; // Slot of the item being augmented
|
||||
/*20*/ uint32 augment_index; // Seen 0
|
||||
/*24*/ ItemSlotStruct augment_slot; // Slot of the distiller to use (if one applies)
|
||||
/*24*/ InventorySlot_Struct augment_slot; // Slot of the distiller to use (if one applies)
|
||||
/*36*/ int32 augment_action; // Guessed - 0 = augment, 1 = remove with distiller, 3 = delete aug
|
||||
/*36*/ //int32 augment_slot;
|
||||
/*40*/
|
||||
@@ -3692,7 +3697,7 @@ struct TributeInfo_Struct {
|
||||
|
||||
struct TributeItem_Struct
|
||||
{
|
||||
/*00*/ ItemSlotStruct slot;
|
||||
/*00*/ InventorySlot_Struct inventory_slot;
|
||||
/*12*/ uint32 quantity;
|
||||
/*16*/ uint32 tribute_master_id;
|
||||
/*20*/ int32 tribute_points;
|
||||
@@ -3729,9 +3734,10 @@ struct Split_Struct
|
||||
** Used In: OP_TradeSkillCombine
|
||||
** Last Updated: 01-05-2013
|
||||
*/
|
||||
struct NewCombine_Struct {
|
||||
/*00*/ ItemSlotStruct container_slot;
|
||||
/*12*/ ItemSlotStruct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8)
|
||||
struct NewCombine_Struct
|
||||
{
|
||||
/*00*/ InventorySlot_Struct container_slot;
|
||||
/*12*/ InventorySlot_Struct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8)
|
||||
/*24*/
|
||||
};
|
||||
|
||||
@@ -3767,11 +3773,12 @@ struct RecipeReply_Struct {
|
||||
};
|
||||
|
||||
//received and sent back as an ACK with different reply_code
|
||||
struct RecipeAutoCombine_Struct {
|
||||
struct RecipeAutoCombine_Struct
|
||||
{
|
||||
/*00*/ uint32 object_type;
|
||||
/*04*/ uint32 some_id;
|
||||
/*08*/ ItemSlotStruct container_slot; //echoed in reply - Was uint32 unknown1
|
||||
/*20*/ ItemSlotStruct unknown_slot; //echoed in reply
|
||||
/*08*/ InventorySlot_Struct container_slot; //echoed in reply - Was uint32 unknown1
|
||||
/*20*/ InventorySlot_Struct unknown_slot; //echoed in reply
|
||||
/*32*/ uint32 recipe_id;
|
||||
/*36*/ uint32 reply_code;
|
||||
/*40*/
|
||||
@@ -4486,19 +4493,22 @@ struct ExpansionInfo_Struct {
|
||||
/*064*/ uint32 Expansions;
|
||||
};
|
||||
|
||||
struct ApplyPoison_Struct {
|
||||
MainInvItemSlotStruct inventorySlot;
|
||||
struct ApplyPoison_Struct
|
||||
{
|
||||
TypelessInventorySlot_Struct inventory_slot;
|
||||
uint32 success;
|
||||
};
|
||||
|
||||
struct ItemVerifyRequest_Struct {
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
struct ItemVerifyRequest_Struct
|
||||
{
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 target; // Target Entity ID
|
||||
/*016*/
|
||||
};
|
||||
|
||||
struct ItemVerifyReply_Struct {
|
||||
/*000*/ ItemSlotStruct slot;
|
||||
struct ItemVerifyReply_Struct
|
||||
{
|
||||
/*000*/ InventorySlot_Struct inventory_slot;
|
||||
/*012*/ uint32 spell; // Spell ID to cast if different than item effect
|
||||
/*016*/ uint32 target; // Target Entity ID
|
||||
/*020*/
|
||||
|
||||
+24
-24
@@ -1614,7 +1614,7 @@ namespace SoD
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
@@ -1623,7 +1623,7 @@ namespace SoD
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
@@ -1635,13 +1635,13 @@ namespace SoD
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1981,7 +1981,7 @@ namespace SoD
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
@@ -3934,7 +3934,7 @@ namespace SoD
|
||||
|
||||
uint32 SubLengths[10];
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
SubSerializations[x] = nullptr;
|
||||
|
||||
@@ -3946,15 +3946,15 @@ namespace SoD
|
||||
|
||||
iqbs.subitem_count++;
|
||||
|
||||
if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor?
|
||||
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
|
||||
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
|
||||
SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // ???????
|
||||
|
||||
@@ -3993,16 +3993,16 @@ namespace SoD
|
||||
{
|
||||
uint32 SoDSlot = 0;
|
||||
|
||||
if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
|
||||
SoDSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot == MainPowerSource)
|
||||
SoDSlot = slots::MainPowerSource;
|
||||
else if (serverSlot == SlotPowerSource)
|
||||
SoDSlot = inventory::SlotPowerSource;
|
||||
else
|
||||
SoDSlot = serverSlot;
|
||||
return SoDSlot;
|
||||
@@ -4018,7 +4018,7 @@ namespace SoD
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (sodSlot >= slots::MainAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (sodSlot >= inventory::SlotAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot >= consts::GENERAL_BAGS_BEGIN && sodSlot <= consts::CURSOR_BAG_END)
|
||||
ServerSlot = sodSlot - 11;
|
||||
@@ -4026,8 +4026,8 @@ namespace SoD
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot == slots::MainPowerSource)
|
||||
ServerSlot = MainPowerSource;
|
||||
else if (sodSlot == inventory::SlotPowerSource)
|
||||
ServerSlot = SlotPowerSource;
|
||||
else
|
||||
ServerSlot = sodSlot;
|
||||
return ServerSlot;
|
||||
@@ -4041,7 +4041,7 @@ namespace SoD
|
||||
|
||||
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
sodTextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -4050,7 +4050,7 @@ namespace SoD
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
sodTextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -4081,7 +4081,7 @@ namespace SoD
|
||||
|
||||
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = sodTextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+102
-105
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace SoD {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
// this needs work to match actual client equivilents
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral8,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotPowerSource,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral8,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -170,8 +167,8 @@ namespace SoD {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
||||
|
||||
+24
-24
@@ -1271,7 +1271,7 @@ namespace SoF
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
@@ -1280,7 +1280,7 @@ namespace SoF
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
@@ -1292,13 +1292,13 @@ namespace SoF
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1638,7 +1638,7 @@ namespace SoF
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
@@ -3256,7 +3256,7 @@ namespace SoF
|
||||
|
||||
uint32 SubLengths[10];
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
SubSerializations[x] = nullptr;
|
||||
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
|
||||
@@ -3267,15 +3267,15 @@ namespace SoF
|
||||
|
||||
iqbs.subitem_count++;
|
||||
|
||||
if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor?
|
||||
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
|
||||
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
|
||||
SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // ???????
|
||||
|
||||
@@ -3312,16 +3312,16 @@ namespace SoF
|
||||
{
|
||||
uint32 SoFSlot = 0;
|
||||
|
||||
if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
|
||||
SoFSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot == MainPowerSource)
|
||||
SoFSlot = slots::MainPowerSource;
|
||||
else if (serverSlot == SlotPowerSource)
|
||||
SoFSlot = inventory::SlotPowerSource;
|
||||
else
|
||||
SoFSlot = serverSlot;
|
||||
|
||||
@@ -3338,7 +3338,7 @@ namespace SoF
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (sofSlot >= slots::MainAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (sofSlot >= inventory::SlotAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot >= consts::GENERAL_BAGS_BEGIN && sofSlot <= consts::CURSOR_BAG_END)
|
||||
ServerSlot = sofSlot - 11;
|
||||
@@ -3346,8 +3346,8 @@ namespace SoF
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot == slots::MainPowerSource)
|
||||
ServerSlot = MainPowerSource;
|
||||
else if (sofSlot == inventory::SlotPowerSource)
|
||||
ServerSlot = SlotPowerSource;
|
||||
else
|
||||
ServerSlot = sofSlot;
|
||||
|
||||
@@ -3362,7 +3362,7 @@ namespace SoF
|
||||
|
||||
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
sofTextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -3371,7 +3371,7 @@ namespace SoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
sofTextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -3402,7 +3402,7 @@ namespace SoF
|
||||
|
||||
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = sofTextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+102
-105
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace SoF {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
// this needs work to match actual client equivilents
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral8,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotPowerSource,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral8,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -170,8 +167,8 @@ namespace SoF {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
||||
|
||||
+11
-11
@@ -943,7 +943,7 @@ namespace Titanium
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
@@ -952,7 +952,7 @@ namespace Titanium
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
@@ -964,13 +964,13 @@ namespace Titanium
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1199,14 +1199,14 @@ namespace Titanium
|
||||
if (eq->Race[char_index] > 473)
|
||||
eq->Race[char_index] = 1;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
for (int index = 0; index < MaterialCount; ++index) {
|
||||
eq->CS_Colors[char_index][index].Color = emu_cse->Equip[index].Color.Color;
|
||||
}
|
||||
|
||||
eq->BeardColor[char_index] = emu_cse->BeardColor;
|
||||
eq->HairStyle[char_index] = emu_cse->HairStyle;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
for (int index = 0; index < MaterialCount; ++index) {
|
||||
eq->Equip[char_index][index] = emu_cse->Equip[index].Material;
|
||||
}
|
||||
|
||||
@@ -1236,14 +1236,14 @@ namespace Titanium
|
||||
for (; char_index < 10; ++char_index) {
|
||||
eq->Race[char_index] = 0;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
for (int index = 0; index < MaterialCount; ++index) {
|
||||
eq->CS_Colors[char_index][index].Color = 0;
|
||||
}
|
||||
|
||||
eq->BeardColor[char_index] = 0;
|
||||
eq->HairStyle[char_index] = 0;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
for (int index = 0; index < MaterialCount; ++index) {
|
||||
eq->Equip[char_index][index] = 0;
|
||||
}
|
||||
|
||||
@@ -2198,7 +2198,7 @@ namespace Titanium
|
||||
|
||||
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
titaniumTextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -2207,7 +2207,7 @@ namespace Titanium
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
titaniumTextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -2238,7 +2238,7 @@ namespace Titanium
|
||||
|
||||
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = titaniumTextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+101
-104
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,121 +25,118 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace Titanium {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
// this needs work to match actual client equivilents
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral8,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral8,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 16;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 16;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -169,8 +166,8 @@ namespace Titanium {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
||||
|
||||
+24
-24
@@ -1878,7 +1878,7 @@ namespace UF
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
@@ -1887,7 +1887,7 @@ namespace UF
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
@@ -1899,13 +1899,13 @@ namespace UF
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -2274,7 +2274,7 @@ namespace UF
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
for (int equip_index = 0; equip_index < MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
@@ -4263,7 +4263,7 @@ namespace UF
|
||||
|
||||
uint32 SubLengths[10];
|
||||
|
||||
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
|
||||
|
||||
SubSerializations[x] = nullptr;
|
||||
|
||||
@@ -4275,15 +4275,15 @@ namespace UF
|
||||
|
||||
iqbs.subitem_count++;
|
||||
|
||||
if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor?
|
||||
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
|
||||
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
|
||||
SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
|
||||
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
|
||||
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
|
||||
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
|
||||
SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
|
||||
else
|
||||
SubSlotNumber = slot_id_in; // ???????
|
||||
|
||||
@@ -4322,16 +4322,16 @@ namespace UF
|
||||
{
|
||||
uint32 UnderfootSlot = 0;
|
||||
|
||||
if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
|
||||
UnderfootSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot == MainPowerSource)
|
||||
UnderfootSlot = slots::MainPowerSource;
|
||||
else if (serverSlot == SlotPowerSource)
|
||||
UnderfootSlot = inventory::SlotPowerSource;
|
||||
else
|
||||
UnderfootSlot = serverSlot;
|
||||
|
||||
@@ -4348,7 +4348,7 @@ namespace UF
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (ufSlot >= slots::MainAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (ufSlot >= inventory::SlotAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot >= consts::GENERAL_BAGS_BEGIN && ufSlot <= consts::CURSOR_BAG_END)
|
||||
ServerSlot = ufSlot - 11;
|
||||
@@ -4356,8 +4356,8 @@ namespace UF
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot == slots::MainPowerSource)
|
||||
ServerSlot = MainPowerSource;
|
||||
else if (ufSlot == inventory::SlotPowerSource)
|
||||
ServerSlot = SlotPowerSource;
|
||||
else
|
||||
ServerSlot = ufSlot;
|
||||
|
||||
@@ -4372,7 +4372,7 @@ namespace UF
|
||||
|
||||
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
|
||||
{
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||
ufTextLink = serverTextLink;
|
||||
return;
|
||||
}
|
||||
@@ -4381,7 +4381,7 @@ namespace UF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
|
||||
ufTextLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -4412,7 +4412,7 @@ namespace UF
|
||||
|
||||
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
|
||||
{
|
||||
if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
|
||||
serverTextLink = ufTextLink;
|
||||
return;
|
||||
}
|
||||
|
||||
+102
-105
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../types.h"
|
||||
|
||||
namespace UF {
|
||||
namespace maps {
|
||||
namespace inventory {
|
||||
typedef enum : int16 {
|
||||
// this needs work to match actual client equivilents
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapOther,
|
||||
_MapCount
|
||||
} InventoryMaps;
|
||||
}
|
||||
TypePossessions = 0,
|
||||
TypeBank,
|
||||
TypeSharedBank,
|
||||
TypeTrade,
|
||||
TypeWorld,
|
||||
TypeLimbo,
|
||||
TypeTribute,
|
||||
TypeTrophyTribute,
|
||||
TypeGuildTribute,
|
||||
TypeMerchant,
|
||||
TypeDeleted,
|
||||
TypeCorpse,
|
||||
TypeBazaar,
|
||||
TypeInspect,
|
||||
TypeRealEstate,
|
||||
TypeViewMODPC,
|
||||
TypeViewMODBank,
|
||||
TypeViewMODSharedBank,
|
||||
TypeViewMODLimbo,
|
||||
TypeAltStorage,
|
||||
TypeArchived,
|
||||
TypeMail,
|
||||
TypeGuildTrophyTribute,
|
||||
TypeOther,
|
||||
TypeCount
|
||||
} InventoryTypes;
|
||||
|
||||
namespace slots {
|
||||
typedef enum : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource,
|
||||
MainAmmo,
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
MainCursor,
|
||||
_MainCount,
|
||||
_MainEquipmentBegin = MainCharm,
|
||||
_MainEquipmentEnd = MainAmmo,
|
||||
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||
_MainGeneralBegin = MainGeneral1,
|
||||
_MainGeneralEnd = MainGeneral8,
|
||||
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||
} EquipmentSlots;
|
||||
SlotCharm = 0,
|
||||
SlotEar1,
|
||||
SlotHead,
|
||||
SlotFace,
|
||||
SlotEar2,
|
||||
SlotNeck,
|
||||
SlotShoulders,
|
||||
SlotArms,
|
||||
SlotBack,
|
||||
SlotWrist1,
|
||||
SlotWrist2,
|
||||
SlotRange,
|
||||
SlotHands,
|
||||
SlotPrimary,
|
||||
SlotSecondary,
|
||||
SlotFinger1,
|
||||
SlotFinger2,
|
||||
SlotChest,
|
||||
SlotLegs,
|
||||
SlotFeet,
|
||||
SlotWaist,
|
||||
SlotPowerSource,
|
||||
SlotAmmo,
|
||||
SlotGeneral1,
|
||||
SlotGeneral2,
|
||||
SlotGeneral3,
|
||||
SlotGeneral4,
|
||||
SlotGeneral5,
|
||||
SlotGeneral6,
|
||||
SlotGeneral7,
|
||||
SlotGeneral8,
|
||||
SlotCursor,
|
||||
SlotCount,
|
||||
SlotEquipmentBegin = SlotCharm,
|
||||
SlotEquipmentEnd = SlotAmmo,
|
||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
||||
SlotGeneralBegin = SlotGeneral1,
|
||||
SlotGeneralEnd = SlotGeneral8,
|
||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
||||
} PossessionsSlots;
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
||||
|
||||
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||
static const int16 GENERAL_END = slots::MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR = slots::MainCursor;
|
||||
static const int16 CURSOR = inventory::SlotCursor;
|
||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
@@ -170,8 +167,8 @@ namespace UF {
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
|
||||
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
||||
|
||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
||||
|
||||
+19
-19
@@ -104,8 +104,8 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<ItemInst*>::const_iter
|
||||
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i "
|
||||
"AND ((slotid >= 8000 AND slotid <= 8999) "
|
||||
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
|
||||
char_id, MainCursor,
|
||||
EmuConstants::CURSOR_BAG_BEGIN, EmuConstants::CURSOR_BAG_END);
|
||||
char_id, SlotCursor,
|
||||
EQEmu::Constants::CURSOR_BAG_BEGIN, EQEmu::Constants::CURSOR_BAG_END);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
|
||||
@@ -116,7 +116,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<ItemInst*>::const_iter
|
||||
for(auto it = start; it != end; ++it, i++) {
|
||||
if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high
|
||||
ItemInst *inst = *it;
|
||||
int16 use_slot = (i == 8000) ? MainCursor : i;
|
||||
int16 use_slot = (i == 8000) ? SlotCursor : i;
|
||||
if (!SaveInventory(char_id, inst, use_slot)) {
|
||||
return false;
|
||||
}
|
||||
@@ -161,10 +161,10 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite
|
||||
bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) {
|
||||
|
||||
//never save tribute slots:
|
||||
if(slot_id >= EmuConstants::TRIBUTE_BEGIN && slot_id <= EmuConstants::TRIBUTE_END)
|
||||
if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END)
|
||||
return true;
|
||||
|
||||
if (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_BAGS_END) {
|
||||
if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
|
||||
// Shared bank inventory
|
||||
if (!inst) {
|
||||
return DeleteSharedBankSlot(char_id, slot_id);
|
||||
@@ -191,9 +191,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s
|
||||
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
if (inst->IsType(ItemClassCommon)) {
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
ItemInst *auginst = inst->GetItem(i);
|
||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
|
||||
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id))
|
||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||
// messages through attrition (and the modded code in SaveInventory)
|
||||
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
const ItemInst* baginst = inst->GetItem(idx);
|
||||
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
|
||||
}
|
||||
@@ -238,9 +238,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
|
||||
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
if (inst->IsType(ItemClassCommon)) {
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
ItemInst *auginst = inst->GetItem(i);
|
||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
|
||||
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) {
|
||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||
// messages through attrition (and the modded code in SaveInventory)
|
||||
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
const ItemInst* baginst = inst->GetItem(idx);
|
||||
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
|
||||
}
|
||||
@@ -427,7 +427,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
|
||||
uint32 item_id = (uint32)atoi(row[1]);
|
||||
int8 charges = (int8)atoi(row[2]);
|
||||
|
||||
uint32 aug[EmuConstants::ITEM_COMMON_SIZE];
|
||||
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
|
||||
aug[0] = (uint32)atoi(row[3]);
|
||||
aug[1] = (uint32)atoi(row[4]);
|
||||
aug[2] = (uint32)atoi(row[5]);
|
||||
@@ -448,7 +448,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
|
||||
|
||||
ItemInst *inst = CreateBaseItem(item, charges);
|
||||
if (inst && item->ItemClass == ItemClassCommon) {
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
@@ -522,7 +522,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
|
||||
uint16 charges = atoi(row[2]);
|
||||
uint32 color = atoul(row[3]);
|
||||
|
||||
uint32 aug[EmuConstants::ITEM_COMMON_SIZE];
|
||||
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
|
||||
|
||||
aug[0] = (uint32)atoul(row[4]);
|
||||
aug[1] = (uint32)atoul(row[5]);
|
||||
@@ -584,8 +584,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
|
||||
inst->SetOrnamentHeroModel(ornament_hero_model);
|
||||
|
||||
if (instnodrop ||
|
||||
(((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) ||
|
||||
slot_id == MainPowerSource) &&
|
||||
(((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) ||
|
||||
slot_id == SlotPowerSource) &&
|
||||
inst->GetItem()->Attuneable))
|
||||
inst->SetAttuned(true);
|
||||
|
||||
@@ -608,7 +608,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
|
||||
}
|
||||
|
||||
if (item->ItemClass == ItemClassCommon) {
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
@@ -665,7 +665,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
|
||||
int8 charges = atoi(row[2]);
|
||||
uint32 color = atoul(row[3]);
|
||||
|
||||
uint32 aug[EmuConstants::ITEM_COMMON_SIZE];
|
||||
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
|
||||
aug[0] = (uint32)atoi(row[4]);
|
||||
aug[1] = (uint32)atoi(row[5]);
|
||||
aug[2] = (uint32)atoi(row[6]);
|
||||
@@ -726,7 +726,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
|
||||
inst->SetCharges(charges);
|
||||
|
||||
if (item->ItemClass == ItemClassCommon) {
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user