Rework of eq_dictionary

This commit is contained in:
Uleat
2016-04-07 17:21:55 -04:00
parent 6ea061dc55
commit e75a53b775
70 changed files with 2786 additions and 2779 deletions
+159 -159
View File
@@ -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
View File
@@ -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
View File
@@ -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)
+50 -40
View File
@@ -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
View File
@@ -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)
+49 -39
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;