Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work

This commit is contained in:
Uleat 2016-04-19 04:02:53 -04:00
parent 53c7abf16e
commit 8edb6e9595
65 changed files with 1196 additions and 1186 deletions

View File

@ -1,5 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 04/19/2016 ==
Uleat: Changed the recent EQEmu rework to eliminate the nested class design (possible cause of VS2015 update crashes - unverified)
Uleat: Some more inv2 convergence work
== 04/15/2016 == == 04/15/2016 ==
Uleat: Reworked EQDictionary into namespace EQEmu Uleat: Reworked EQDictionary into namespace EQEmu

View File

@ -708,7 +708,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
/* Insert starting inventory... */ /* Insert starting inventory... */
std::string invquery; std::string invquery;
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END;) { for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::BANK_BAGS_END;) {
const ItemInst* newinv = inv->GetItem(i); const ItemInst* newinv = inv->GetItem(i);
if (newinv) { if (newinv) {
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)", invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
@ -718,15 +718,15 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
} }
if (i == SlotCursor) { if (i == SlotCursor) {
i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i = EQEmu::constants::GENERAL_BAGS_BEGIN;
continue; continue;
} }
else if (i == EQEmu::Constants::CURSOR_BAG_END) { else if (i == EQEmu::constants::CURSOR_BAG_END) {
i = EQEmu::Constants::BANK_BEGIN; i = EQEmu::constants::BANK_BEGIN;
continue; continue;
} }
else if (i == EQEmu::Constants::BANK_END) { else if (i == EQEmu::constants::BANK_END) {
i = EQEmu::Constants::BANK_BAGS_BEGIN; i = EQEmu::constants::BANK_BAGS_BEGIN;
continue; continue;
} }
i++; i++;

View File

@ -330,7 +330,7 @@ namespace Convert {
/*7212*/ uint32 tribute_points; /*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252; /*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active /*7220*/ uint32 tribute_active; //1=active
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE]; /*7224*/ Convert::Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE];
/*7264*/ Convert::Disciplines_Struct disciplines; /*7264*/ Convert::Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use) /*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160]; /*7744*/ char unknown7780[160];
@ -1428,7 +1428,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); } if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Tribute Convert */ /* Run Tribute Convert */
first_entry = 0; rquery = ""; first_entry = 0; rquery = "";
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){ for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){ if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){
if (first_entry != 1){ if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);

View File

@ -20,92 +20,92 @@
#include "deity.h" #include "deity.h"
EQEmu::Deity::TypeBits EQEmu::Deity::ConvertDeityToDeityBit(Types deity) EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityToDeityBit(DeityType deity)
{ {
switch (deity) { switch (deity) {
case DeityBertoxxulous: case DeityBertoxxulous:
return BIT_DeityBertoxxulous; return bit_DeityBertoxxulous;
case DeityBrellSirilis: case DeityBrellSirilis:
return BIT_DeityBrellSirilis; return bit_DeityBrellSirilis;
case DeityCazicThule: case DeityCazicThule:
return BIT_DeityCazicThule; return bit_DeityCazicThule;
case DeityErollisiMarr: case DeityErollisiMarr:
return BIT_DeityErollisiMarr; return bit_DeityErollisiMarr;
case DeityBristlebane: case DeityBristlebane:
return BIT_DeityBristlebane; return bit_DeityBristlebane;
case DeityInnoruuk: case DeityInnoruuk:
return BIT_DeityInnoruuk; return bit_DeityInnoruuk;
case DeityKarana: case DeityKarana:
return BIT_DeityKarana; return bit_DeityKarana;
case DeityMithanielMarr: case DeityMithanielMarr:
return BIT_DeityMithanielMarr; return bit_DeityMithanielMarr;
case DeityPrexus: case DeityPrexus:
return BIT_DeityPrexus; return bit_DeityPrexus;
case DeityQuellious: case DeityQuellious:
return BIT_DeityQuellious; return bit_DeityQuellious;
case DeityRallosZek: case DeityRallosZek:
return BIT_DeityRallosZek; return bit_DeityRallosZek;
case DeityRodcetNife: case DeityRodcetNife:
return BIT_DeityRodcetNife; return bit_DeityRodcetNife;
case DeitySolusekRo: case DeitySolusekRo:
return BIT_DeitySolusekRo; return bit_DeitySolusekRo;
case DeityTheTribunal: case DeityTheTribunal:
return BIT_DeityTheTribunal; return bit_DeityTheTribunal;
case DeityTunare: case DeityTunare:
return BIT_DeityTunare; return bit_DeityTunare;
case DeityVeeshan: case DeityVeeshan:
return BIT_DeityVeeshan; return bit_DeityVeeshan;
case DeityAgnostic_LB: case DeityAgnostic_LB:
case DeityAgnostic: case DeityAgnostic:
return BIT_DeityAgnostic; return bit_DeityAgnostic;
default: default:
return BIT_DeityAll; return bit_DeityAll;
}; };
} }
EQEmu::Deity::Types EQEmu::Deity::ConvertDeityBitToDeity(TypeBits deity_bit) EQEmu::deity::DeityType EQEmu::deity::ConvertDeityBitToDeity(DeityTypeBit deity_bit)
{ {
switch (deity_bit) { switch (deity_bit) {
case BIT_DeityAgnostic: case bit_DeityAgnostic:
return DeityAgnostic; return DeityAgnostic;
case BIT_DeityBertoxxulous: case bit_DeityBertoxxulous:
return DeityBertoxxulous; return DeityBertoxxulous;
case BIT_DeityBrellSirilis: case bit_DeityBrellSirilis:
return DeityBrellSirilis; return DeityBrellSirilis;
case BIT_DeityCazicThule: case bit_DeityCazicThule:
return DeityCazicThule; return DeityCazicThule;
case BIT_DeityErollisiMarr: case bit_DeityErollisiMarr:
return DeityErollisiMarr; return DeityErollisiMarr;
case BIT_DeityBristlebane: case bit_DeityBristlebane:
return DeityBristlebane; return DeityBristlebane;
case BIT_DeityInnoruuk: case bit_DeityInnoruuk:
return DeityInnoruuk; return DeityInnoruuk;
case BIT_DeityKarana: case bit_DeityKarana:
return DeityKarana; return DeityKarana;
case BIT_DeityMithanielMarr: case bit_DeityMithanielMarr:
return DeityMithanielMarr; return DeityMithanielMarr;
case BIT_DeityPrexus: case bit_DeityPrexus:
return DeityPrexus; return DeityPrexus;
case BIT_DeityQuellious: case bit_DeityQuellious:
return DeityQuellious; return DeityQuellious;
case BIT_DeityRallosZek: case bit_DeityRallosZek:
return DeityRallosZek; return DeityRallosZek;
case BIT_DeityRodcetNife: case bit_DeityRodcetNife:
return DeityRodcetNife; return DeityRodcetNife;
case BIT_DeitySolusekRo: case bit_DeitySolusekRo:
return DeitySolusekRo; return DeitySolusekRo;
case BIT_DeityTheTribunal: case bit_DeityTheTribunal:
return DeityTheTribunal; return DeityTheTribunal;
case BIT_DeityTunare: case bit_DeityTunare:
return DeityTunare; return DeityTunare;
case BIT_DeityVeeshan: case bit_DeityVeeshan:
return DeityVeeshan; return DeityVeeshan;
default: default:
return DeityUnknown; return DeityUnknown;
}; };
} }
const char* EQEmu::Deity::GetDeityName(Types deity) const char* EQEmu::deity::GetDeityName(DeityType deity)
{ {
switch (deity) { switch (deity) {
case DeityBertoxxulous: case DeityBertoxxulous:

View File

@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator /* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -15,17 +15,16 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef DEITY_H #ifndef COMMON_DEITY_H
#define DEITY_H #define COMMON_DEITY_H
#include "types.h" #include "types.h"
namespace EQEmu namespace EQEmu
{ {
class Deity { namespace deity {
public: enum DeityType {
enum Types {
DeityUnknown = 0, DeityUnknown = 0,
DeityAgnostic_LB = 140, DeityAgnostic_LB = 140,
DeityBertoxxulous = 201, DeityBertoxxulous = 201,
@ -47,31 +46,31 @@ namespace EQEmu
DeityAgnostic = 396 DeityAgnostic = 396
}; };
enum TypeBits : uint32 { enum DeityTypeBit : uint32 {
BIT_DeityAll = 0x00000000, bit_DeityAll = 0x00000000,
BIT_DeityAgnostic = 0x00000001, bit_DeityAgnostic = 0x00000001,
BIT_DeityBertoxxulous = 0x00000002, bit_DeityBertoxxulous = 0x00000002,
BIT_DeityBrellSirilis = 0x00000004, bit_DeityBrellSirilis = 0x00000004,
BIT_DeityCazicThule = 0x00000008, bit_DeityCazicThule = 0x00000008,
BIT_DeityErollisiMarr = 0x00000010, bit_DeityErollisiMarr = 0x00000010,
BIT_DeityBristlebane = 0x00000020, bit_DeityBristlebane = 0x00000020,
BIT_DeityInnoruuk = 0x00000040, bit_DeityInnoruuk = 0x00000040,
BIT_DeityKarana = 0x00000080, bit_DeityKarana = 0x00000080,
BIT_DeityMithanielMarr = 0x00000100, bit_DeityMithanielMarr = 0x00000100,
BIT_DeityPrexus = 0x00000200, bit_DeityPrexus = 0x00000200,
BIT_DeityQuellious = 0x00000400, bit_DeityQuellious = 0x00000400,
BIT_DeityRallosZek = 0x00000800, bit_DeityRallosZek = 0x00000800,
BIT_DeityRodcetNife = 0x00001000, bit_DeityRodcetNife = 0x00001000,
BIT_DeitySolusekRo = 0x00002000, bit_DeitySolusekRo = 0x00002000,
BIT_DeityTheTribunal = 0x00004000, bit_DeityTheTribunal = 0x00004000,
BIT_DeityTunare = 0x00008000, bit_DeityTunare = 0x00008000,
BIT_DeityVeeshan = 0x00010000 bit_DeityVeeshan = 0x00010000
}; };
static TypeBits ConvertDeityToDeityBit(Types deity); DeityTypeBit ConvertDeityToDeityBit(DeityType deity);
static Types ConvertDeityBitToDeity(TypeBits deity_bit); DeityType ConvertDeityBitToDeity(DeityTypeBit deity_bit);
static const char* GetDeityName(Types deity); const char* GetDeityName(DeityType deity);
}; }
} }
#endif /* DEITY_H */ #endif /* COMMON_DEITY_H */

View File

@ -21,7 +21,7 @@
#include "string_util.h" #include "string_util.h"
uint16 EQEmu::Constants::InventoryTypeSize(int16 type_index) uint16 EQEmu::constants::InventoryTypeSize(int16 type_index)
{ {
switch (type_index) { switch (type_index) {
case TypePossessions: case TypePossessions:
@ -80,7 +80,7 @@ uint16 EQEmu::Constants::InventoryTypeSize(int16 type_index)
} }
/* /*
const char* EQEmu::Constants::InventoryLocationName(Location_Struct location) const char* EQEmu::constants::InventoryLocationName(Location_Struct location)
{ {
// not ready for implementation... // not ready for implementation...
std::string ret_str; std::string ret_str;
@ -89,7 +89,7 @@ const char* EQEmu::Constants::InventoryLocationName(Location_Struct location)
} }
*/ */
const char* EQEmu::Constants::InventoryTypeName(int16 type_index) const char* EQEmu::constants::InventoryTypeName(int16 type_index)
{ {
switch (type_index) { switch (type_index) {
case INVALID_INDEX: case INVALID_INDEX:
@ -149,7 +149,7 @@ const char* EQEmu::Constants::InventoryTypeName(int16 type_index)
} }
} }
const char* EQEmu::Constants::InventorySlotName(int16 slot_index) const char* EQEmu::constants::InventorySlotName(int16 slot_index)
{ {
switch (slot_index) { switch (slot_index) {
case INVALID_INDEX: case INVALID_INDEX:
@ -229,7 +229,7 @@ const char* EQEmu::Constants::InventorySlotName(int16 slot_index)
} }
} }
const char* EQEmu::Constants::InventorySubName(int16 sub_index) const char* EQEmu::constants::InventorySubName(int16 sub_index)
{ {
if (sub_index == INVALID_INDEX) if (sub_index == INVALID_INDEX)
return "Invalid Sub"; return "Invalid Sub";
@ -243,7 +243,7 @@ const char* EQEmu::Constants::InventorySubName(int16 sub_index)
return ret_str.c_str(); return ret_str.c_str();
} }
const char* EQEmu::Constants::InventoryAugName(int16 aug_index) const char* EQEmu::constants::InventoryAugName(int16 aug_index)
{ {
if (aug_index == INVALID_INDEX) if (aug_index == INVALID_INDEX)
return "Invalid Aug"; return "Invalid Aug";

View File

@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef EMU_CONSTANTS_H #ifndef COMMON_EMU_CONSTANTS_H
#define EMU_CONSTANTS_H #define COMMON_EMU_CONSTANTS_H
#include "eq_limits.h" #include "eq_limits.h"
// (future use) // (future use)
@ -42,8 +42,7 @@
namespace EQEmu namespace EQEmu
{ {
// an immutable value is required to initialize arrays, etc... use this class as a repository for those // an immutable value is required to initialize arrays, etc... use this class as a repository for those
class Constants { namespace constants {
public:
// database // database
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
@ -149,7 +148,7 @@ namespace EQEmu
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT; static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH; static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
}; }
} }
#endif /* EMU_CONSTANTS_H */ #endif /* COMMON_EMU_CONSTANTS_H */

View File

@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef EMU_LEGACY_H #ifndef COMMON_EMU_LEGACY_H
#define EMU_LEGACY_H #define COMMON_EMU_LEGACY_H
#include "types.h" #include "types.h"
@ -26,9 +26,8 @@
namespace EQEmu namespace EQEmu
{ {
// this is for perl and other legacy systems // this is for perl and other legacy systems
class Legacy { namespace legacy {
public: enum InventorySlot : int16 {
typedef enum {
SLOT_CHARM = 0, SLOT_CHARM = 0,
SLOT_EAR01 = 1, SLOT_EAR01 = 1,
SLOT_HEAD = 2, SLOT_HEAD = 2,
@ -102,8 +101,8 @@ namespace EQEmu
SLOT_WORLD_BEGIN = 4000, SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009 SLOT_WORLD_END = 4009
} InventorySlot;
}; };
} }
}
#endif /* EMU_LEGACY_H */ #endif /* COMMON_EMU_LEGACY_H */

View File

@ -931,8 +931,8 @@ enum PossessionsSlots : int16
// plus, since they're pre-op's, they don't affect the actual binary size // plus, since they're pre-op's, they don't affect the actual binary size
#define TYPE_BEGIN 0 #define TYPE_BEGIN 0
#define SLOT_BEGIN 0 #define SLOT_BEGIN 0
#define SUB_BEGIN 0 #define SUB_INDEX_BEGIN 0
#define AUG_BEGIN 0 #define AUG_INDEX_BEGIN 0
static const uint32 MAX_SPELL_DB_ID_VAL = 65535; static const uint32 MAX_SPELL_DB_ID_VAL = 65535;

View File

@ -21,7 +21,7 @@
// client validation // client validation
bool EQEmu::Limits::IsValidPCClientVersion(ClientVersion clientVersion) bool EQEmu::limits::IsValidPCClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT) if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return true; return true;
@ -29,7 +29,7 @@ bool EQEmu::Limits::IsValidPCClientVersion(ClientVersion clientVersion)
return false; return false;
} }
ClientVersion EQEmu::Limits::ValidatePCClientVersion(ClientVersion clientVersion) ClientVersion EQEmu::limits::ValidatePCClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT) if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return clientVersion; return clientVersion;
@ -38,7 +38,7 @@ ClientVersion EQEmu::Limits::ValidatePCClientVersion(ClientVersion clientVersion
} }
// npc validation // npc validation
bool EQEmu::Limits::IsValidNPCClientVersion(ClientVersion clientVersion) bool EQEmu::limits::IsValidNPCClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT) if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return true; return true;
@ -46,7 +46,7 @@ bool EQEmu::Limits::IsValidNPCClientVersion(ClientVersion clientVersion)
return false; return false;
} }
ClientVersion EQEmu::Limits::ValidateNPCClientVersion(ClientVersion clientVersion) ClientVersion EQEmu::limits::ValidateNPCClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT) if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return clientVersion; return clientVersion;
@ -55,7 +55,7 @@ ClientVersion EQEmu::Limits::ValidateNPCClientVersion(ClientVersion clientVersio
} }
// mob validation // mob validation
bool EQEmu::Limits::IsValidMobClientVersion(ClientVersion clientVersion) bool EQEmu::limits::IsValidMobClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT) if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return true; return true;
@ -63,7 +63,7 @@ bool EQEmu::Limits::IsValidMobClientVersion(ClientVersion clientVersion)
return false; return false;
} }
ClientVersion EQEmu::Limits::ValidateMobClientVersion(ClientVersion clientVersion) ClientVersion EQEmu::limits::ValidateMobClientVersion(ClientVersion clientVersion)
{ {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT) if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return clientVersion; return clientVersion;
@ -72,7 +72,7 @@ ClientVersion EQEmu::Limits::ValidateMobClientVersion(ClientVersion clientVersio
} }
// database // database
size_t EQEmu::Limits::CharacterCreationLimit(ClientVersion clientVersion) size_t EQEmu::limits::CharacterCreationLimit(ClientVersion clientVersion)
{ {
static const size_t local[CLIENT_VERSION_COUNT] = { static const size_t local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
@ -94,7 +94,7 @@ size_t EQEmu::Limits::CharacterCreationLimit(ClientVersion clientVersion)
} }
// inventory // inventory
uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) uint16 EQEmu::limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion)
{ {
// not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...) // not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...)
// a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified // a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified
@ -105,36 +105,36 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
// //
// TYPE_POSSESSIONS_SIZE does not reflect all actual <client>_constants size due to bitmask-use compatibility // TYPE_POSSESSIONS_SIZE does not reflect all actual <client>_constants size due to bitmask-use compatibility
// //
// when setting NPC-based values, try to adhere to an Constants::<property> or NOT_USED value to avoid unnecessary issues // when setting NPC-based values, try to adhere to an constants::<property> or NOT_USED value to avoid unnecessary issues
static const uint16 local[TypeCount][CLIENT_VERSION_COUNT] = { static const uint16 local[TypeCount][CLIENT_VERSION_COUNT] = {
// server and database are sync'd to current TypePossessions's client as set in 'using namespace RoF::slots;' and // server and database are sync'd to current TypePossessions's client as set in 'using namespace RoF::slots;' and
// 'Constants::TYPE_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask() // 'constants::TYPE_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask()
// for partial range validation checks and 'Constants::TYPE_POSSESSIONS_SIZE' for full range iterations // for partial range validation checks and 'constants::TYPE_POSSESSIONS_SIZE' for full range iterations
{ // local[TypePossessions] { // local[TypePossessions]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_POSSESSIONS_SIZE, /*62*/ constants::TYPE_POSSESSIONS_SIZE,
/*Titanium*/ Constants::TYPE_POSSESSIONS_SIZE, /*Titanium*/ constants::TYPE_POSSESSIONS_SIZE,
/*SoF*/ Constants::TYPE_POSSESSIONS_SIZE, /*SoF*/ constants::TYPE_POSSESSIONS_SIZE,
/*SoD*/ Constants::TYPE_POSSESSIONS_SIZE, /*SoD*/ constants::TYPE_POSSESSIONS_SIZE,
/*Underfoot*/ Constants::TYPE_POSSESSIONS_SIZE, /*Underfoot*/ constants::TYPE_POSSESSIONS_SIZE,
/*RoF*/ Constants::TYPE_POSSESSIONS_SIZE, /*RoF*/ constants::TYPE_POSSESSIONS_SIZE,
/*RoF2*/ Constants::TYPE_POSSESSIONS_SIZE, /*RoF2*/ constants::TYPE_POSSESSIONS_SIZE,
/*NPC*/ Constants::TYPE_POSSESSIONS_SIZE, /*NPC*/ constants::TYPE_POSSESSIONS_SIZE,
/*Merc*/ Constants::TYPE_POSSESSIONS_SIZE, /*Merc*/ constants::TYPE_POSSESSIONS_SIZE,
/*Bot*/ Constants::TYPE_POSSESSIONS_SIZE, /*Bot*/ constants::TYPE_POSSESSIONS_SIZE,
/*Pet*/ Constants::TYPE_POSSESSIONS_SIZE /*Pet*/ constants::TYPE_POSSESSIONS_SIZE
}, },
{ // local[TypeBank] { // local[TypeBank]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ NOT_USED, /*62*/ NOT_USED,
/*Titanium*/ Titanium::consts::TYPE_BANK_SIZE, /*Titanium*/ Titanium::consts::TYPE_BANK_SIZE,
/*SoF*/ Constants::TYPE_BANK_SIZE, /*SoF*/ constants::TYPE_BANK_SIZE,
/*SoD*/ Constants::TYPE_BANK_SIZE, /*SoD*/ constants::TYPE_BANK_SIZE,
/*Underfoot*/ Constants::TYPE_BANK_SIZE, /*Underfoot*/ constants::TYPE_BANK_SIZE,
/*RoF*/ Constants::TYPE_BANK_SIZE, /*RoF*/ constants::TYPE_BANK_SIZE,
/*RoF2*/ Constants::TYPE_BANK_SIZE, /*RoF2*/ constants::TYPE_BANK_SIZE,
/*NPC*/ NOT_USED, /*NPC*/ NOT_USED,
/*Merc*/ NOT_USED, /*Merc*/ NOT_USED,
@ -143,13 +143,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}, },
{ // local[TypeSharedBank] { // local[TypeSharedBank]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_SHARED_BANK_SIZE, /*62*/ constants::TYPE_SHARED_BANK_SIZE,
/*Titanium*/ Constants::TYPE_SHARED_BANK_SIZE, /*Titanium*/ constants::TYPE_SHARED_BANK_SIZE,
/*SoF*/ Constants::TYPE_SHARED_BANK_SIZE, /*SoF*/ constants::TYPE_SHARED_BANK_SIZE,
/*SoD*/ Constants::TYPE_SHARED_BANK_SIZE, /*SoD*/ constants::TYPE_SHARED_BANK_SIZE,
/*Underfoot*/ Constants::TYPE_SHARED_BANK_SIZE, /*Underfoot*/ constants::TYPE_SHARED_BANK_SIZE,
/*RoF*/ Constants::TYPE_SHARED_BANK_SIZE, /*RoF*/ constants::TYPE_SHARED_BANK_SIZE,
/*RoF2*/ Constants::TYPE_SHARED_BANK_SIZE, /*RoF2*/ constants::TYPE_SHARED_BANK_SIZE,
/*NPC*/ NOT_USED, /*NPC*/ NOT_USED,
/*Merc*/ NOT_USED, /*Merc*/ NOT_USED,
@ -158,28 +158,28 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}, },
{ // local[TypeTrade] { // local[TypeTrade]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_TRADE_SIZE, /*62*/ constants::TYPE_TRADE_SIZE,
/*Titanium*/ Constants::TYPE_TRADE_SIZE, /*Titanium*/ constants::TYPE_TRADE_SIZE,
/*SoF*/ Constants::TYPE_TRADE_SIZE, /*SoF*/ constants::TYPE_TRADE_SIZE,
/*SoD*/ Constants::TYPE_TRADE_SIZE, /*SoD*/ constants::TYPE_TRADE_SIZE,
/*Underfoot*/ Constants::TYPE_TRADE_SIZE, /*Underfoot*/ constants::TYPE_TRADE_SIZE,
/*RoF*/ Constants::TYPE_TRADE_SIZE, /*RoF*/ constants::TYPE_TRADE_SIZE,
/*RoF2*/ Constants::TYPE_TRADE_SIZE, /*RoF2*/ constants::TYPE_TRADE_SIZE,
/*NPC*/ 4, /*NPC*/ 4,
/*Merc*/ 4, /*Merc*/ 4,
/*Bot*/ Constants::TYPE_TRADE_SIZE, // client thinks this is another client /*Bot*/ constants::TYPE_TRADE_SIZE, // client thinks this is another client
/*Pet*/ 4 /*Pet*/ 4
}, },
{ // local[TypeWorld] { // local[TypeWorld]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_WORLD_SIZE, /*62*/ constants::TYPE_WORLD_SIZE,
/*Titanium*/ Constants::TYPE_WORLD_SIZE, /*Titanium*/ constants::TYPE_WORLD_SIZE,
/*SoF*/ Constants::TYPE_WORLD_SIZE, /*SoF*/ constants::TYPE_WORLD_SIZE,
/*SoD*/ Constants::TYPE_WORLD_SIZE, /*SoD*/ constants::TYPE_WORLD_SIZE,
/*Underfoot*/ Constants::TYPE_WORLD_SIZE, /*Underfoot*/ constants::TYPE_WORLD_SIZE,
/*RoF*/ Constants::TYPE_WORLD_SIZE, /*RoF*/ constants::TYPE_WORLD_SIZE,
/*RoF2*/ Constants::TYPE_WORLD_SIZE, /*RoF2*/ constants::TYPE_WORLD_SIZE,
/*NPC*/ NOT_USED, /*NPC*/ NOT_USED,
/*Merc*/ NOT_USED, /*Merc*/ NOT_USED,
@ -188,13 +188,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}, },
{ // local[TypeLimbo] { // local[TypeLimbo]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_LIMBO_SIZE, /*62*/ constants::TYPE_LIMBO_SIZE,
/*Titanium*/ Constants::TYPE_LIMBO_SIZE, /*Titanium*/ constants::TYPE_LIMBO_SIZE,
/*SoF*/ Constants::TYPE_LIMBO_SIZE, /*SoF*/ constants::TYPE_LIMBO_SIZE,
/*SoD*/ Constants::TYPE_LIMBO_SIZE, /*SoD*/ constants::TYPE_LIMBO_SIZE,
/*Underfoot*/ Constants::TYPE_LIMBO_SIZE, /*Underfoot*/ constants::TYPE_LIMBO_SIZE,
/*RoF*/ Constants::TYPE_LIMBO_SIZE, /*RoF*/ constants::TYPE_LIMBO_SIZE,
/*RoF2*/ Constants::TYPE_LIMBO_SIZE, /*RoF2*/ constants::TYPE_LIMBO_SIZE,
/*NPC*/ NOT_USED, /*NPC*/ NOT_USED,
/*Merc*/ NOT_USED, /*Merc*/ NOT_USED,
@ -203,13 +203,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}, },
{ // local[TypeTribute] { // local[TypeTribute]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_TRIBUTE_SIZE, /*62*/ constants::TYPE_TRIBUTE_SIZE,
/*Titanium*/ Constants::TYPE_TRIBUTE_SIZE, /*Titanium*/ constants::TYPE_TRIBUTE_SIZE,
/*SoF*/ Constants::TYPE_TRIBUTE_SIZE, /*SoF*/ constants::TYPE_TRIBUTE_SIZE,
/*SoD*/ Constants::TYPE_TRIBUTE_SIZE, /*SoD*/ constants::TYPE_TRIBUTE_SIZE,
/*Underfoot*/ Constants::TYPE_TRIBUTE_SIZE, /*Underfoot*/ constants::TYPE_TRIBUTE_SIZE,
/*RoF*/ Constants::TYPE_TRIBUTE_SIZE, /*RoF*/ constants::TYPE_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_TRIBUTE_SIZE, /*RoF2*/ constants::TYPE_TRIBUTE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -223,8 +223,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE, /*RoF*/ constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE, /*RoF2*/ constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -238,8 +238,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_GUILD_TRIBUTE_SIZE, /*RoF*/ constants::TYPE_GUILD_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_GUILD_TRIBUTE_SIZE, /*RoF2*/ constants::TYPE_GUILD_TRIBUTE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -253,8 +253,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_MERCHANT_SIZE, /*RoF*/ constants::TYPE_MERCHANT_SIZE,
/*RoF2*/ Constants::TYPE_MERCHANT_SIZE, /*RoF2*/ constants::TYPE_MERCHANT_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -268,8 +268,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_DELETED_SIZE, /*RoF*/ constants::TYPE_DELETED_SIZE,
/*RoF2*/ Constants::TYPE_DELETED_SIZE, /*RoF2*/ constants::TYPE_DELETED_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -293,15 +293,15 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}, },
{ // local[TypeBazaar] { // local[TypeBazaar]
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_BAZAAR_SIZE, /*62*/ constants::TYPE_BAZAAR_SIZE,
/*Titanium*/ Constants::TYPE_BAZAAR_SIZE, /*Titanium*/ constants::TYPE_BAZAAR_SIZE,
/*SoF*/ Constants::TYPE_BAZAAR_SIZE, /*SoF*/ constants::TYPE_BAZAAR_SIZE,
/*SoD*/ Constants::TYPE_BAZAAR_SIZE, /*SoD*/ constants::TYPE_BAZAAR_SIZE,
/*Underfoot*/ Constants::TYPE_BAZAAR_SIZE, /*Underfoot*/ constants::TYPE_BAZAAR_SIZE,
/*RoF*/ Constants::TYPE_BAZAAR_SIZE, /*RoF*/ constants::TYPE_BAZAAR_SIZE,
/*RoF2*/ Constants::TYPE_BAZAAR_SIZE, /*RoF2*/ constants::TYPE_BAZAAR_SIZE,
/*NPC*/ 0, // this may need to be 'Constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc /*NPC*/ 0, // this may need to be 'constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc
/*Merc*/ 0, /*Merc*/ 0,
/*Bot*/ 0, /*Bot*/ 0,
/*Pet*/ 0 /*Pet*/ 0
@ -328,8 +328,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_REAL_ESTATE_SIZE, /*RoF*/ constants::TYPE_REAL_ESTATE_SIZE,
/*RoF2*/ Constants::TYPE_REAL_ESTATE_SIZE, /*RoF2*/ constants::TYPE_REAL_ESTATE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -343,8 +343,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_PC_SIZE, /*RoF*/ constants::TYPE_VIEW_MOD_PC_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_PC_SIZE, /*RoF2*/ constants::TYPE_VIEW_MOD_PC_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -358,8 +358,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_BANK_SIZE, /*RoF*/ constants::TYPE_VIEW_MOD_BANK_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_BANK_SIZE, /*RoF2*/ constants::TYPE_VIEW_MOD_BANK_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -373,8 +373,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, /*RoF*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, /*RoF2*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -388,8 +388,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE, /*RoF*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE, /*RoF2*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -403,8 +403,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_ALT_STORAGE_SIZE, /*RoF*/ constants::TYPE_ALT_STORAGE_SIZE,
/*RoF2*/ Constants::TYPE_ALT_STORAGE_SIZE, /*RoF2*/ constants::TYPE_ALT_STORAGE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -418,8 +418,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_ARCHIVED_SIZE, /*RoF*/ constants::TYPE_ARCHIVED_SIZE,
/*RoF2*/ Constants::TYPE_ARCHIVED_SIZE, /*RoF2*/ constants::TYPE_ARCHIVED_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -433,8 +433,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_MAIL_SIZE, /*RoF*/ constants::TYPE_MAIL_SIZE,
/*RoF2*/ Constants::TYPE_MAIL_SIZE, /*RoF2*/ constants::TYPE_MAIL_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -448,8 +448,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, /*RoF*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, /*RoF2*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -463,8 +463,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ NOT_USED, /*SoF*/ NOT_USED,
/*SoD*/ NOT_USED, /*SoD*/ NOT_USED,
/*Underfoot*/ NOT_USED, /*Underfoot*/ NOT_USED,
/*RoF*/ Constants::TYPE_KRONO_SIZE, /*RoF*/ constants::TYPE_KRONO_SIZE,
/*RoF2*/ Constants::TYPE_KRONO_SIZE, /*RoF2*/ constants::TYPE_KRONO_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -478,8 +478,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0, /*SoF*/ 0,
/*SoD*/ 0, /*SoD*/ 0,
/*Underfoot*/ 0, /*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_OTHER_SIZE, /*RoF*/ constants::TYPE_OTHER_SIZE,
/*RoF2*/ Constants::TYPE_OTHER_SIZE, /*RoF2*/ constants::TYPE_OTHER_SIZE,
/*NPC*/ 0, /*NPC*/ 0,
/*Merc*/ 0, /*Merc*/ 0,
@ -494,7 +494,7 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
return NOT_USED; return NOT_USED;
} }
uint64 EQEmu::Limits::PossessionsBitmask(ClientVersion clientVersion) uint64 EQEmu::limits::PossessionsBitmask(ClientVersion clientVersion)
{ {
// these are for the new inventory system (RoF)..not the current (Ti) one... // these are for the new inventory system (RoF)..not the current (Ti) one...
// 0x0000000000200000 is SlotPowerSource (SoF+) // 0x0000000000200000 is SlotPowerSource (SoF+)
@ -521,7 +521,7 @@ uint64 EQEmu::Limits::PossessionsBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; //return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
uint64 EQEmu::Limits::EquipmentBitmask(ClientVersion clientVersion) uint64 EQEmu::limits::EquipmentBitmask(ClientVersion clientVersion)
{ {
static const uint64 local[CLIENT_VERSION_COUNT] = { static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
@ -543,7 +543,7 @@ uint64 EQEmu::Limits::EquipmentBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; //return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
uint64 EQEmu::Limits::GeneralBitmask(ClientVersion clientVersion) uint64 EQEmu::limits::GeneralBitmask(ClientVersion clientVersion)
{ {
static const uint64 local[CLIENT_VERSION_COUNT] = { static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
@ -565,7 +565,7 @@ uint64 EQEmu::Limits::GeneralBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; //return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
uint64 EQEmu::Limits::CursorBitmask(ClientVersion clientVersion) uint64 EQEmu::limits::CursorBitmask(ClientVersion clientVersion)
{ {
static const uint64 local[CLIENT_VERSION_COUNT] = { static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
@ -587,7 +587,7 @@ uint64 EQEmu::Limits::CursorBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; //return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
bool EQEmu::Limits::AllowsEmptyBagInBag(ClientVersion clientVersion) bool EQEmu::limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
{ {
static const bool local[CLIENT_VERSION_COUNT] = { static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false, /*Unknown*/ false,
@ -609,7 +609,7 @@ bool EQEmu::Limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; //return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
bool EQEmu::Limits::AllowsClickCastFromBag(ClientVersion clientVersion) bool EQEmu::limits::AllowsClickCastFromBag(ClientVersion clientVersion)
{ {
static const bool local[CLIENT_VERSION_COUNT] = { static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false, /*Unknown*/ false,
@ -631,49 +631,49 @@ bool EQEmu::Limits::AllowsClickCastFromBag(ClientVersion clientVersion)
} }
// items // items
uint16 EQEmu::Limits::ItemCommonSize(ClientVersion clientVersion) uint16 EQEmu::limits::ItemCommonSize(ClientVersion clientVersion)
{ {
static const uint16 local[CLIENT_VERSION_COUNT] = { static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::ITEM_COMMON_SIZE, /*62*/ constants::ITEM_COMMON_SIZE,
/*Titanium*/ Constants::ITEM_COMMON_SIZE, /*Titanium*/ constants::ITEM_COMMON_SIZE,
/*SoF*/ Constants::ITEM_COMMON_SIZE, /*SoF*/ constants::ITEM_COMMON_SIZE,
/*SoD*/ Constants::ITEM_COMMON_SIZE, /*SoD*/ constants::ITEM_COMMON_SIZE,
/*Underfoot*/ Constants::ITEM_COMMON_SIZE, /*Underfoot*/ constants::ITEM_COMMON_SIZE,
/*RoF*/ Constants::ITEM_COMMON_SIZE, /*RoF*/ constants::ITEM_COMMON_SIZE,
/*RoF2*/ Constants::ITEM_COMMON_SIZE, /*RoF2*/ constants::ITEM_COMMON_SIZE,
/*NPC*/ Constants::ITEM_COMMON_SIZE, /*NPC*/ constants::ITEM_COMMON_SIZE,
/*Merc*/ Constants::ITEM_COMMON_SIZE, /*Merc*/ constants::ITEM_COMMON_SIZE,
/*Bot*/ Constants::ITEM_COMMON_SIZE, /*Bot*/ constants::ITEM_COMMON_SIZE,
/*Pet*/ Constants::ITEM_COMMON_SIZE /*Pet*/ constants::ITEM_COMMON_SIZE
}; };
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
uint16 EQEmu::Limits::ItemContainerSize(ClientVersion clientVersion) uint16 EQEmu::limits::ItemContainerSize(ClientVersion clientVersion)
{ {
static const uint16 local[CLIENT_VERSION_COUNT] = { static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED, /*Unknown*/ NOT_USED,
/*62*/ Constants::ITEM_CONTAINER_SIZE, /*62*/ constants::ITEM_CONTAINER_SIZE,
/*Titanium*/ Constants::ITEM_CONTAINER_SIZE, /*Titanium*/ constants::ITEM_CONTAINER_SIZE,
/*SoF*/ Constants::ITEM_CONTAINER_SIZE, /*SoF*/ constants::ITEM_CONTAINER_SIZE,
/*SoD*/ Constants::ITEM_CONTAINER_SIZE, /*SoD*/ constants::ITEM_CONTAINER_SIZE,
/*Underfoot*/ Constants::ITEM_CONTAINER_SIZE, /*Underfoot*/ constants::ITEM_CONTAINER_SIZE,
/*RoF*/ Constants::ITEM_CONTAINER_SIZE, /*RoF*/ constants::ITEM_CONTAINER_SIZE,
/*RoF2*/ Constants::ITEM_CONTAINER_SIZE, /*RoF2*/ constants::ITEM_CONTAINER_SIZE,
/*NPC*/ Constants::ITEM_CONTAINER_SIZE, /*NPC*/ constants::ITEM_CONTAINER_SIZE,
/*Merc*/ Constants::ITEM_CONTAINER_SIZE, /*Merc*/ constants::ITEM_CONTAINER_SIZE,
/*Bot*/ Constants::ITEM_CONTAINER_SIZE, /*Bot*/ constants::ITEM_CONTAINER_SIZE,
/*Pet*/ Constants::ITEM_CONTAINER_SIZE /*Pet*/ constants::ITEM_CONTAINER_SIZE
}; };
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))]; return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
} }
bool EQEmu::Limits::CoinHasWeight(ClientVersion clientVersion) bool EQEmu::limits::CoinHasWeight(ClientVersion clientVersion)
{ {
static const bool local[CLIENT_VERSION_COUNT] = { static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ true, /*Unknown*/ true,

View File

@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef EQ_LIMITS_H #ifndef COMMON_EQ_LIMITS_H
#define EQ_LIMITS_H #define COMMON_EQ_LIMITS_H
#include "types.h" #include "types.h"
#include "eq_constants.h" #include "eq_constants.h"
@ -42,41 +42,40 @@ namespace EQEmu
// values should default to a non-beneficial value..unless value conflicts with intended operation // values should default to a non-beneficial value..unless value conflicts with intended operation
// //
// EQEmu::Constants may be used as references..but, not every reference needs to be in EQEmu::Constants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...) // EQEmu::Constants may be used as references..but, not every reference needs to be in EQEmu::Constants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
class Limits { namespace limits {
public:
// client version validation (checks to avoid crashing zone server when accessing reference arrays) // client version validation (checks to avoid crashing zone server when accessing reference arrays)
// use this inside of class Client (limits to actual clients) // use this inside of class Client (limits to actual clients)
static bool IsValidPCClientVersion(ClientVersion clientVersion); bool IsValidPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion); ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
// basically..any non-client classes - do not invoke when setting a valid client // basically..any non-client classes - do not invoke when setting a valid client
static bool IsValidNPCClientVersion(ClientVersion clientVersion); bool IsValidNPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion); ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
// these are 'universal' - do not invoke when setting a valid client // these are 'universal' - do not invoke when setting a valid client
static bool IsValidMobClientVersion(ClientVersion clientVersion); bool IsValidMobClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion); ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
// database // database
static size_t CharacterCreationLimit(ClientVersion clientVersion); size_t CharacterCreationLimit(ClientVersion clientVersion);
// inventory // inventory
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion); uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
static uint64 PossessionsBitmask(ClientVersion clientVersion); uint64 PossessionsBitmask(ClientVersion clientVersion);
static uint64 EquipmentBitmask(ClientVersion clientVersion); uint64 EquipmentBitmask(ClientVersion clientVersion);
static uint64 GeneralBitmask(ClientVersion clientVersion); uint64 GeneralBitmask(ClientVersion clientVersion);
static uint64 CursorBitmask(ClientVersion clientVersion); uint64 CursorBitmask(ClientVersion clientVersion);
static bool AllowsEmptyBagInBag(ClientVersion clientVersion); bool AllowsEmptyBagInBag(ClientVersion clientVersion);
static bool AllowsClickCastFromBag(ClientVersion clientVersion); bool AllowsClickCastFromBag(ClientVersion clientVersion);
// items // items
static uint16 ItemCommonSize(ClientVersion clientVersion); uint16 ItemCommonSize(ClientVersion clientVersion);
static uint16 ItemContainerSize(ClientVersion clientVersion); uint16 ItemContainerSize(ClientVersion clientVersion);
// player profile // player profile
static bool CoinHasWeight(ClientVersion clientVersion); bool CoinHasWeight(ClientVersion clientVersion);
}; }
} }
#endif /* EQ_LIMITS_H */ #endif /* COMMON_EQ_LIMITS_H */

View File

@ -776,7 +776,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct struct Bandolier_Struct
{ {
char Name[32]; char Name[32];
BandolierItem_Struct Items[EQEmu::Constants::BANDOLIER_ITEM_COUNT]; BandolierItem_Struct Items[EQEmu::constants::BANDOLIER_ITEM_COUNT];
}; };
//len = 72 //len = 72
@ -790,7 +790,7 @@ struct PotionBeltItem_Struct
//len = 288 //len = 288
struct PotionBelt_Struct struct PotionBelt_Struct
{ {
PotionBeltItem_Struct Items[EQEmu::Constants::POTION_BELT_ITEM_COUNT]; PotionBeltItem_Struct Items[EQEmu::constants::POTION_BELT_ITEM_COUNT];
}; };
struct MovePotionToBelt_Struct struct MovePotionToBelt_Struct
@ -1092,7 +1092,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points; /*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252; /*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active /*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE]; /*7224*/ Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines; /*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use) /*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160]; /*7744*/ char unknown7780[160];
@ -1119,7 +1119,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA; /*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent /*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36]; /*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::Constants::BANDOLIERS_SIZE]; /*12844*/ Bandolier_Struct bandoliers[EQEmu::constants::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506]; /*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use /*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount; /*19240*/ uint32 timeentitledonaccount;
@ -3472,8 +3472,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct { struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active uint32 active; //0 == inactive, 1 == active
uint32 tributes[EQEmu::Constants::TRIBUTE_SIZE]; //-1 == NONE uint32 tributes[EQEmu::constants::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::Constants::TRIBUTE_SIZE]; //all 00's uint32 tiers[EQEmu::constants::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id; uint32 tribute_master_id;
}; };

File diff suppressed because it is too large Load Diff

View File

@ -183,9 +183,9 @@ struct Item_Struct {
int32 FactionAmt4; // Faction Amt 4 int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ? char CharmFile[32]; // ?
uint32 AugType; uint32 AugType;
uint8 AugSlotType[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type uint8 AugSlotType[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible uint8 AugSlotVisible[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related uint8 AugSlotUnk2[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme; uint32 LDoNTheme;
uint32 LDoNPrice; uint32 LDoNPrice;
uint32 LDoNSold; uint32 LDoNSold;

View File

@ -20,7 +20,12 @@
#include "light_source.h" #include "light_source.h"
void EQEmu::LightSource::impl::Clear() EQEmu::lightsource::LightSourceProfile::LightSourceProfile()
{
Clear();
}
void EQEmu::lightsource::LightSourceProfile::Clear()
{ {
Type.Innate = 0; Type.Innate = 0;
Type.Equipment = 0; Type.Equipment = 0;
@ -33,62 +38,62 @@ void EQEmu::LightSource::impl::Clear()
Level.Active = 0; Level.Active = 0;
} }
uint8 EQEmu::LightSource::TypeToLevel(uint8 light_type) uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
{ {
switch (light_type) { switch (light_type) {
case TypeGlobeOfStars: case LightTypeGlobeOfStars:
return LevelBrilliant; // 10 return LightLevelBrilliant; // 10
case TypeFlamelessLantern: case LightTypeFlamelessLantern:
case TypeGreaterLightstone: case LightTypeGreaterLightstone:
return LevelLargeMagic; // 9 return LightLevelLargeMagic; // 9
case TypeLargeLantern: case LightTypeLargeLantern:
return LevelLargeLantern; // 8 return LightLevelLargeLantern; // 8
case TypeSteinOfMoggok: case LightTypeSteinOfMoggok:
case TypeLightstone: case LightTypeLightstone:
return LevelMagicLantern; // 7 return LightLevelMagicLantern; // 7
case TypeSmallLantern: case LightTypeSmallLantern:
return LevelSmallLantern; // 6 return LightLevelSmallLantern; // 6
case TypeColdlight: case LightTypeColdlight:
case TypeUnknown2: case LightTypeUnknown2:
return LevelBlueLight; // 5 return LightLevelBlueLight; // 5
case TypeFireBeetleEye: case LightTypeFireBeetleEye:
case TypeUnknown1: case LightTypeUnknown1:
return LevelRedLight; // 4 return LightLevelRedLight; // 4
case TypeTinyGlowingSkull: case LightTypeTinyGlowingSkull:
case TypeLightGlobe: case LightTypeLightGlobe:
return LevelSmallMagic; // 3 return LightLevelSmallMagic; // 3
case TypeTorch: case LightTypeTorch:
return LevelTorch; // 2 return LightLevelTorch; // 2
case TypeCandle: case LightTypeCandle:
return LevelCandle; // 1 return LightLevelCandle; // 1
default: default:
return LevelUnlit; // 0 return LightLevelUnlit; // 0
} }
} }
bool EQEmu::LightSource::IsLevelGreater(uint8 left_type, uint8 right_type) bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
{ {
static const uint8 light_levels[TypeCount] = { static const uint8 light_levels[LightTypeCount] = {
LevelUnlit, /* TypeNone */ LightLevelUnlit, /* LightTypeNone */
LevelCandle, /* TypeCandle */ LightLevelCandle, /* LightTypeCandle */
LevelTorch, /* TypeTorch */ LightLevelTorch, /* LightTypeTorch */
LevelSmallMagic, /* TypeTinyGlowingSkull */ LightLevelSmallMagic, /* LightTypeTinyGlowingSkull */
LevelSmallLantern, /* TypeSmallLantern */ LightLevelSmallLantern, /* LightTypeSmallLantern */
LevelMagicLantern, /* TypeSteinOfMoggok */ LightLevelMagicLantern, /* LightTypeSteinOfMoggok */
LevelLargeLantern, /* TypeLargeLantern */ LightLevelLargeLantern, /* LightTypeLargeLantern */
LevelLargeMagic, /* TypeFlamelessLantern */ LightLevelLargeMagic, /* LightTypeFlamelessLantern */
LevelBrilliant, /* TypeGlobeOfStars */ LightLevelBrilliant, /* LightTypeGlobeOfStars */
LevelSmallMagic, /* TypeLightGlobe */ LightLevelSmallMagic, /* LightTypeLightGlobe */
LevelMagicLantern, /* TypeLightstone */ LightLevelMagicLantern, /* LightTypeLightstone */
LevelLargeMagic, /* TypeGreaterLightstone */ LightLevelLargeMagic, /* LightTypeGreaterLightstone */
LevelRedLight, /* TypeFireBeetleEye */ LightLevelRedLight, /* LightTypeFireBeetleEye */
LevelBlueLight, /* TypeColdlight */ LightLevelBlueLight, /* LightTypeColdlight */
LevelRedLight, /* TypeUnknown1 */ LightLevelRedLight, /* LightTypeUnknown1 */
LevelBlueLight /* TypeUnknown2 */ LightLevelBlueLight /* LightTypeUnknown2 */
}; };
if (left_type >= TypeCount) { left_type = TypeNone; } if (left_type >= LightTypeCount) { left_type = LightTypeNone; }
if (right_type >= TypeCount) { right_type = TypeNone; } if (right_type >= LightTypeCount) { right_type = LightTypeNone; }
return (light_levels[left_type] > light_levels[right_type]); return (light_levels[left_type] > light_levels[right_type]);
} }

View File

@ -17,52 +17,51 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef LIGHT_SOURCE_H #ifndef COMMON_LIGHT_SOURCE_H
#define LIGHT_SOURCE_H #define COMMON_LIGHT_SOURCE_H
#include "types.h" #include "types.h"
namespace EQEmu namespace EQEmu
{ {
class LightSource { namespace lightsource {
public: enum LightType {
enum Types { LightTypeNone = 0,
TypeNone = 0, LightTypeCandle,
TypeCandle, LightTypeTorch,
TypeTorch, LightTypeTinyGlowingSkull,
TypeTinyGlowingSkull, LightTypeSmallLantern,
TypeSmallLantern, LightTypeSteinOfMoggok, // 5
TypeSteinOfMoggok, // 5 LightTypeLargeLantern,
TypeLargeLantern, LightTypeFlamelessLantern,
TypeFlamelessLantern, LightTypeGlobeOfStars,
TypeGlobeOfStars, LightTypeLightGlobe,
TypeLightGlobe, LightTypeLightstone, // 10
TypeLightstone, // 10 LightTypeGreaterLightstone,
TypeGreaterLightstone, LightTypeFireBeetleEye,
TypeFireBeetleEye, LightTypeColdlight,
TypeColdlight, LightTypeUnknown1,
TypeUnknown1, LightTypeUnknown2, // 15
TypeUnknown2, // 15 LightTypeCount
TypeCount
}; };
enum Levels { enum LightLevel {
LevelUnlit = 0, LightLevelUnlit = 0,
LevelCandle, LightLevelCandle,
LevelTorch, LightLevelTorch,
LevelSmallMagic, LightLevelSmallMagic,
LevelRedLight, LightLevelRedLight,
LevelBlueLight, // 5 LightLevelBlueLight, // 5
LevelSmallLantern, LightLevelSmallLantern,
LevelMagicLantern, LightLevelMagicLantern,
LevelLargeLantern, LightLevelLargeLantern,
LevelLargeMagic, LightLevelLargeMagic,
LevelBrilliant, // 10 LightLevelBrilliant, // 10
LevelCount LightLevelCount
}; };
class impl { struct LightSourceProfile {
/* /*
Current criteria (light types): Current criteria (light types):
Equipment: { 0 .. 15 } Equipment: { 0 .. 15 }
@ -79,8 +78,7 @@ namespace EQEmu
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item) - All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
-- The timer-based update cancels out the invalid light source -- The timer-based update cancels out the invalid light source
*/ */
public: LightSourceProfile();
impl() { Clear(); }
void Clear(); void Clear();
@ -101,9 +99,9 @@ namespace EQEmu
} Level; } Level;
}; };
static uint8 TypeToLevel(uint8 light_type); uint8 TypeToLevel(uint8 light_type);
static bool IsLevelGreater(uint8 left_type, uint8 right_type); bool IsLevelGreater(uint8 left_type, uint8 right_type);
}; };
} }
#endif /* LIGHT_SOURCE_H */ #endif /* COMMON_LIGHT_SOURCE_H */

View File

@ -2342,7 +2342,7 @@ namespace RoF
outapp->WriteUInt32(consts::BANDOLIERS_SIZE); outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::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); 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 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); 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 // Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(""); outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(""); outapp->WriteString("");
@ -2369,7 +2369,7 @@ namespace RoF
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT); outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::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->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID); outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) { 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 // Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::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->WriteString("");
outapp->WriteUInt32(0); outapp->WriteUInt32(0);
outapp->WriteSInt32(-1); outapp->WriteSInt32(-1);
@ -2502,9 +2502,9 @@ namespace RoF
outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE); outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++)
{ {
outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier); outapp->WriteUInt32(emu->tributes[r].tier);
@ -2824,8 +2824,8 @@ namespace RoF
RoFSlot.Type = 8; // Observed RoFSlot.Type = 8; // Observed
RoFSlot.Unknown02 = 0; RoFSlot.Unknown02 = 0;
RoFSlot.Slot = 0xffff; RoFSlot.Slot = 0xffff;
RoFSlot.Sub = 0xffff; RoFSlot.SubIndex = 0xffff;
RoFSlot.Aug = 0xffff; RoFSlot.AugIndex = 0xffff;
RoFSlot.Unknown01 = 0; RoFSlot.Unknown01 = 0;
eq->unknown_slot = RoFSlot; eq->unknown_slot = RoFSlot;
OUT(recipe_id); OUT(recipe_id);
@ -4810,7 +4810,7 @@ namespace RoF
IN(item_id); IN(item_id);
int r; int r;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
IN(augments[r]); IN(augments[r]);
} }
// Max Augs is now 6, but no code to support that many yet // Max Augs is now 6, but no code to support that many yet
@ -4866,7 +4866,7 @@ namespace RoF
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); 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.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.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); 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.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
emu->from_slot = RoFToServerSlot(eq->from_slot); emu->from_slot = RoFToServerSlot(eq->from_slot);
emu->to_slot = RoFToServerSlot(eq->to_slot); emu->to_slot = RoFToServerSlot(eq->to_slot);
IN(number_in_stack); IN(number_in_stack);
@ -5101,7 +5101,7 @@ namespace RoF
int16 slot_id = RoFToServerSlot(eq->container_slot); int16 slot_id = RoFToServerSlot(eq->container_slot);
if (slot_id == 4000) { if (slot_id == 4000) {
slot_id = EQEmu::Legacy::SLOT_TRADESKILL; // 1000 slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
} }
emu->container_slot = slot_id; emu->container_slot = slot_id;
emu->guildtribute_slot = RoFToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented emu->guildtribute_slot = RoFToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
@ -5218,8 +5218,8 @@ namespace RoF
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items? 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.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff; hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubIndex : 0xffff;
hdr.unknown013 = (merchant_slot == 0) ? slot_id.Aug : 0xffff; hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugIndex : 0xffff;
hdr.price = inst->GetPrice(); hdr.price = inst->GetPrice();
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
//hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff; //hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff;
@ -5427,7 +5427,7 @@ namespace RoF
isbs.augdistiller = 65535; isbs.augdistiller = 65535;
isbs.augrestrict = item->AugRestrict; isbs.augrestrict = item->AugRestrict;
for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) for (int x = AUG_INDEX_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
{ {
isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].type = item->AugSlotType[x];
isbs.augslots[x].visible = item->AugSlotVisible[x]; isbs.augslots[x].visible = item->AugSlotVisible[x];
@ -5678,7 +5678,7 @@ namespace RoF
uint32 SubLengths[10]; uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr; SubSerializations[x] = nullptr;
@ -5690,15 +5690,15 @@ namespace RoF
iqbs.subitem_count++; iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::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) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1); 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) 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 - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x); 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) 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 - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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 else
SubSlotNumber = slot_id_in; // ??????? SubSlotNumber = slot_id_in; // ???????
@ -5713,7 +5713,7 @@ namespace RoF
ss.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct)); ss.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
if (SubSerializations[x]) { if (SubSerializations[x]) {
@ -5739,8 +5739,8 @@ namespace RoF
RoFSlot.Type = INVALID_INDEX; RoFSlot.Type = INVALID_INDEX;
RoFSlot.Unknown02 = NOT_USED; RoFSlot.Unknown02 = NOT_USED;
RoFSlot.Slot = INVALID_INDEX; RoFSlot.Slot = INVALID_INDEX;
RoFSlot.Sub = INVALID_INDEX; RoFSlot.SubIndex = INVALID_INDEX;
RoFSlot.Aug = INVALID_INDEX; RoFSlot.AugIndex = INVALID_INDEX;
RoFSlot.Unknown01 = NOT_USED; RoFSlot.Unknown01 = NOT_USED;
uint32 TempSlot = 0; uint32 TempSlot = 0;
@ -5764,51 +5764,51 @@ namespace RoF
RoFSlot.MainSlot = ServerSlot - 31; RoFSlot.MainSlot = ServerSlot - 31;
}*/ }*/
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341) else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341)
RoFSlot.Type = inventory::TypePossessions; RoFSlot.Type = inventory::TypePossessions;
TempSlot = serverSlot - 1; TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30) if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30)
RoFSlot.Slot = inventory::SlotCursor; RoFSlot.Slot = inventory::SlotCursor;
} }
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute
RoFSlot.Type = inventory::TypeTribute; RoFSlot.Type = inventory::TypeTribute;
RoFSlot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN; RoFSlot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN;
} }
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) { else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeBank; RoFSlot.Type = inventory::TypeBank;
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN; TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN;
RoFSlot.Slot = TempSlot; RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30) if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
} }
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) { else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeSharedBank; RoFSlot.Type = inventory::TypeSharedBank;
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN; TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN;
RoFSlot.Slot = TempSlot; RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30) if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
} }
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) { else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) {
RoFSlot.Type = inventory::TypeTrade; RoFSlot.Type = inventory::TypeTrade;
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN; TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN;
RoFSlot.Slot = TempSlot; RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { if (TempSlot > 30) {
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
/* /*
@ -5825,13 +5825,13 @@ namespace RoF
*/ */
} }
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) { else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) {
RoFSlot.Type = inventory::TypeWorld; RoFSlot.Type = inventory::TypeWorld;
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN; TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN;
RoFSlot.Slot = TempSlot; 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.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, 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.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
return RoFSlot; return RoFSlot;
} }
@ -5840,8 +5840,8 @@ namespace RoF
{ {
structs::TypelessInventorySlot_Struct RoFSlot; structs::TypelessInventorySlot_Struct RoFSlot;
RoFSlot.Slot = INVALID_INDEX; RoFSlot.Slot = INVALID_INDEX;
RoFSlot.Sub = INVALID_INDEX; RoFSlot.SubIndex = INVALID_INDEX;
RoFSlot.Aug = INVALID_INDEX; RoFSlot.AugIndex = INVALID_INDEX;
RoFSlot.Unknown01 = NOT_USED; RoFSlot.Unknown01 = NOT_USED;
uint32 TempSlot = 0; uint32 TempSlot = 0;
@ -5866,13 +5866,13 @@ namespace RoF
}*/ }*/
} }
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) {
TempSlot = serverSlot - 1; TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoFSlot.SubIndex = 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.Slot, RoFSlot.Sub, RoFSlot.Aug, 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.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
return RoFSlot; return RoFSlot;
} }
@ -5911,17 +5911,17 @@ namespace RoF
else // Worn Slots else // Worn Slots
TempSlot = rofSlot.Slot; TempSlot = rofSlot.Slot;
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot; ServerSlot = TempSlot;
} }
else if (rofSlot.Type == inventory::TypeBank) { else if (rofSlot.Type == inventory::TypeBank) {
TempSlot = EQEmu::Constants::BANK_BEGIN; TempSlot = EQEmu::constants::BANK_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN) if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
else else
TempSlot += rofSlot.Slot; TempSlot += rofSlot.Slot;
@ -5930,10 +5930,10 @@ namespace RoF
} }
else if (rofSlot.Type == inventory::TypeSharedBank) { else if (rofSlot.Type == inventory::TypeSharedBank) {
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN; TempSlot = EQEmu::constants::SHARED_BANK_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN) if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
else else
TempSlot += rofSlot.Slot; TempSlot += rofSlot.Slot;
@ -5942,12 +5942,12 @@ namespace RoF
} }
else if (rofSlot.Type == inventory::TypeTrade) { else if (rofSlot.Type == inventory::TypeTrade) {
TempSlot = EQEmu::Constants::TRADE_BEGIN; TempSlot = EQEmu::constants::TRADE_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN) if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
// OLD CODE: // OLD CODE:
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::Constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; //TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
else else
TempSlot += rofSlot.Slot; TempSlot += rofSlot.Slot;
@ -5956,9 +5956,9 @@ namespace RoF
} }
else if (rofSlot.Type == inventory::TypeWorld) { else if (rofSlot.Type == inventory::TypeWorld) {
TempSlot = EQEmu::Constants::WORLD_BEGIN; TempSlot = EQEmu::constants::WORLD_BEGIN;
if (rofSlot.Slot >= SUB_BEGIN) if (rofSlot.Slot >= SUB_INDEX_BEGIN)
TempSlot += rofSlot.Slot; TempSlot += rofSlot.Slot;
ServerSlot = TempSlot; ServerSlot = TempSlot;
@ -5977,7 +5977,7 @@ namespace RoF
ServerSlot = INVALID_INDEX; 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.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, 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.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
return ServerSlot; return ServerSlot;
} }
@ -6006,13 +6006,13 @@ namespace RoF
else else
TempSlot = rofSlot.Slot; TempSlot = rofSlot.Slot;
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot; 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.Slot, rofSlot.Sub, rofSlot.Aug, 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.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
return ServerSlot; return ServerSlot;
} }
@ -6024,7 +6024,7 @@ namespace RoF
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink) static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; rofTextLink = serverTextLink;
return; return;
} }
@ -6033,7 +6033,7 @@ namespace RoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
rofTextLink.append(segments[segment_iter]); rofTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -6063,7 +6063,7 @@ namespace RoF
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink) static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = rofTextLink;
return; return;
} }

View File

@ -2421,7 +2421,7 @@ namespace RoF2
outapp->WriteUInt32(consts::BANDOLIERS_SIZE); outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::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); 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 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); 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 // Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(""); outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(""); outapp->WriteString("");
@ -2448,7 +2448,7 @@ namespace RoF2
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT); outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::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->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID); outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) { 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 // Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::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->WriteString("");
outapp->WriteUInt32(0); outapp->WriteUInt32(0);
outapp->WriteSInt32(-1); outapp->WriteSInt32(-1);
@ -2577,9 +2577,9 @@ namespace RoF2
outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE); outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++)
{ {
outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier); outapp->WriteUInt32(emu->tributes[r].tier);
@ -2914,8 +2914,8 @@ namespace RoF2
RoF2Slot.Type = 8; // Observed RoF2Slot.Type = 8; // Observed
RoF2Slot.Unknown02 = 0; RoF2Slot.Unknown02 = 0;
RoF2Slot.Slot = 0xffff; RoF2Slot.Slot = 0xffff;
RoF2Slot.Sub = 0xffff; RoF2Slot.SubIndex = 0xffff;
RoF2Slot.Aug = 0xffff; RoF2Slot.AugIndex = 0xffff;
RoF2Slot.Unknown01 = 0; RoF2Slot.Unknown01 = 0;
eq->unknown_slot = RoF2Slot; eq->unknown_slot = RoF2Slot;
OUT(recipe_id); OUT(recipe_id);
@ -5028,7 +5028,7 @@ namespace RoF2
IN(item_id); IN(item_id);
int r; int r;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
IN(augments[r]); IN(augments[r]);
} }
IN(link_hash); IN(link_hash);
@ -5082,7 +5082,7 @@ namespace RoF2
DECODE_LENGTH_EXACT(structs::MoveItem_Struct); DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
SETUP_DIRECT_DECODE(MoveItem_Struct, 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.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); 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.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->from_slot = RoF2ToServerSlot(eq->from_slot);
emu->to_slot = RoF2ToServerSlot(eq->to_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot);
IN(number_in_stack); IN(number_in_stack);
@ -5372,7 +5372,7 @@ namespace RoF2
int16 slot_id = RoF2ToServerSlot(eq->container_slot); int16 slot_id = RoF2ToServerSlot(eq->container_slot);
if (slot_id == 4000) { if (slot_id == 4000) {
slot_id = EQEmu::Legacy::SLOT_TRADESKILL; // 1000 slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
} }
emu->container_slot = slot_id; emu->container_slot = slot_id;
emu->guildtribute_slot = RoF2ToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented emu->guildtribute_slot = RoF2ToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
@ -5489,8 +5489,8 @@ namespace RoF2
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items? 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.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff; hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubIndex : 0xffff;
hdr.aug_slot = (merchant_slot == 0) ? slot_id.Aug : 0xffff; hdr.aug_slot = (merchant_slot == 0) ? slot_id.AugIndex : 0xffff;
hdr.price = inst->GetPrice(); hdr.price = inst->GetPrice();
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0; hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
@ -5697,7 +5697,7 @@ namespace RoF2
isbs.augrestrict2 = -1; isbs.augrestrict2 = -1;
isbs.augrestrict = item->AugRestrict; isbs.augrestrict = item->AugRestrict;
for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) for (int x = AUG_INDEX_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
{ {
isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].type = item->AugSlotType[x];
isbs.augslots[x].visible = item->AugSlotVisible[x]; isbs.augslots[x].visible = item->AugSlotVisible[x];
@ -5961,7 +5961,7 @@ namespace RoF2
uint32 SubLengths[10]; uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr; SubSerializations[x] = nullptr;
@ -5973,15 +5973,15 @@ namespace RoF2
iqbs.subitem_count++; iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::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) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1); 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) 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 - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x); 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) 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 - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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 else
SubSlotNumber = slot_id_in; // ??????? SubSlotNumber = slot_id_in; // ???????
@ -5996,7 +5996,7 @@ namespace RoF2
ss.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); ss.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
if (SubSerializations[x]) { if (SubSerializations[x]) {
@ -6022,8 +6022,8 @@ namespace RoF2
RoF2Slot.Type = INVALID_INDEX; RoF2Slot.Type = INVALID_INDEX;
RoF2Slot.Unknown02 = NOT_USED; RoF2Slot.Unknown02 = NOT_USED;
RoF2Slot.Slot = INVALID_INDEX; RoF2Slot.Slot = INVALID_INDEX;
RoF2Slot.Sub = INVALID_INDEX; RoF2Slot.SubIndex = INVALID_INDEX;
RoF2Slot.Aug = INVALID_INDEX; RoF2Slot.AugIndex = INVALID_INDEX;
RoF2Slot.Unknown01 = NOT_USED; RoF2Slot.Unknown01 = NOT_USED;
uint32 TempSlot = 0; uint32 TempSlot = 0;
@ -6032,7 +6032,7 @@ namespace RoF2
if (PacketType == ItemPacketLoot) if (PacketType == ItemPacketLoot)
{ {
RoF2Slot.Type = inventory::TypeCorpse; RoF2Slot.Type = inventory::TypeCorpse;
RoF2Slot.Slot = serverSlot - EQEmu::Constants::CORPSE_BEGIN; RoF2Slot.Slot = serverSlot - EQEmu::constants::CORPSE_BEGIN;
} }
else else
{ {
@ -6055,51 +6055,51 @@ namespace RoF2
RoF2Slot.MainSlot = ServerSlot - 31; RoF2Slot.MainSlot = ServerSlot - 31;
}*/ }*/
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341) else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341)
RoF2Slot.Type = inventory::TypePossessions; RoF2Slot.Type = inventory::TypePossessions;
TempSlot = serverSlot - 1; TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30) if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30)
RoF2Slot.Slot = inventory::SlotCursor; RoF2Slot.Slot = inventory::SlotCursor;
} }
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute
RoF2Slot.Type = inventory::TypeTribute; RoF2Slot.Type = inventory::TypeTribute;
RoF2Slot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN; RoF2Slot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN;
} }
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) { else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeBank; RoF2Slot.Type = inventory::TypeBank;
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN; TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN;
RoF2Slot.Slot = TempSlot; RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30) if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
} }
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) { else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeSharedBank; RoF2Slot.Type = inventory::TypeSharedBank;
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN; TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN;
RoF2Slot.Slot = TempSlot; RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30) if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
} }
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) { else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) {
RoF2Slot.Type = inventory::TypeTrade; RoF2Slot.Type = inventory::TypeTrade;
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN; TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN;
RoF2Slot.Slot = TempSlot; RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { if (TempSlot > 30) {
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
} }
/* /*
@ -6116,13 +6116,13 @@ namespace RoF2
*/ */
} }
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) { else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) {
RoF2Slot.Type = inventory::TypeWorld; RoF2Slot.Type = inventory::TypeWorld;
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN; TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN;
RoF2Slot.Slot = TempSlot; 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.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, 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.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
return RoF2Slot; return RoF2Slot;
} }
@ -6131,8 +6131,8 @@ namespace RoF2
{ {
structs::TypelessInventorySlot_Struct RoF2Slot; structs::TypelessInventorySlot_Struct RoF2Slot;
RoF2Slot.Slot = INVALID_INDEX; RoF2Slot.Slot = INVALID_INDEX;
RoF2Slot.Sub = INVALID_INDEX; RoF2Slot.SubIndex = INVALID_INDEX;
RoF2Slot.Aug = INVALID_INDEX; RoF2Slot.AugIndex = INVALID_INDEX;
RoF2Slot.Unknown01 = NOT_USED; RoF2Slot.Unknown01 = NOT_USED;
uint32 TempSlot = 0; uint32 TempSlot = 0;
@ -6157,20 +6157,20 @@ namespace RoF2
}*/ }*/
} }
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) {
TempSlot = serverSlot - 1; TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); RoF2Slot.SubIndex = 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.Slot, RoF2Slot.Sub, RoF2Slot.Aug, 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.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
return RoF2Slot; return RoF2Slot;
} }
static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot) static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot)
{ {
return (serverCorpseSlot - EQEmu::Constants::CORPSE_BEGIN + 1); return (serverCorpseSlot - EQEmu::constants::CORPSE_BEGIN + 1);
} }
static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType) static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType)
@ -6202,17 +6202,17 @@ namespace RoF2
else // Worn Slots else // Worn Slots
TempSlot = rof2Slot.Slot; TempSlot = rof2Slot.Slot;
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot; ServerSlot = TempSlot;
} }
else if (rof2Slot.Type == inventory::TypeBank) { else if (rof2Slot.Type == inventory::TypeBank) {
TempSlot = EQEmu::Constants::BANK_BEGIN; TempSlot = EQEmu::constants::BANK_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN) if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
else else
TempSlot += rof2Slot.Slot; TempSlot += rof2Slot.Slot;
@ -6221,10 +6221,10 @@ namespace RoF2
} }
else if (rof2Slot.Type == inventory::TypeSharedBank) { else if (rof2Slot.Type == inventory::TypeSharedBank) {
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN; TempSlot = EQEmu::constants::SHARED_BANK_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN) if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
else else
TempSlot += rof2Slot.Slot; TempSlot += rof2Slot.Slot;
@ -6233,10 +6233,10 @@ namespace RoF2
} }
else if (rof2Slot.Type == inventory::TypeTrade) { else if (rof2Slot.Type == inventory::TypeTrade) {
TempSlot = EQEmu::Constants::TRADE_BEGIN; TempSlot = EQEmu::constants::TRADE_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN) if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
// OLD CODE: // OLD CODE:
//TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot; //TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot;
@ -6247,9 +6247,9 @@ namespace RoF2
} }
else if (rof2Slot.Type == inventory::TypeWorld) { else if (rof2Slot.Type == inventory::TypeWorld) {
TempSlot = EQEmu::Constants::WORLD_BEGIN; TempSlot = EQEmu::constants::WORLD_BEGIN;
if (rof2Slot.Slot >= SUB_BEGIN) if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
TempSlot += rof2Slot.Slot; TempSlot += rof2Slot.Slot;
ServerSlot = TempSlot; ServerSlot = TempSlot;
@ -6269,10 +6269,10 @@ namespace RoF2
} }
else if (rof2Slot.Type == inventory::TypeCorpse) { else if (rof2Slot.Type == inventory::TypeCorpse) {
ServerSlot = rof2Slot.Slot + EQEmu::Constants::CORPSE_BEGIN; 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.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, 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.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
return ServerSlot; return ServerSlot;
} }
@ -6301,25 +6301,25 @@ namespace RoF2
else else
TempSlot = rof2Slot.Slot; TempSlot = rof2Slot.Slot;
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot; 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.Slot, rof2Slot.Sub, rof2Slot.Aug, 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.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
return ServerSlot; return ServerSlot;
} }
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot) static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot)
{ {
return (rof2CorpseSlot + EQEmu::Constants::CORPSE_BEGIN - 1); return (rof2CorpseSlot + EQEmu::constants::CORPSE_BEGIN - 1);
} }
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink) static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; rof2TextLink = serverTextLink;
return; return;
} }
@ -6328,7 +6328,7 @@ namespace RoF2
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
rof2TextLink.append(segments[segment_iter]); rof2TextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -6351,7 +6351,7 @@ namespace RoF2
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink) static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = rof2TextLink;
return; return;
} }

View File

@ -34,8 +34,8 @@ struct InventorySlot_Struct
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 /*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*002*/ int16 Unknown02; /*002*/ int16 Unknown02;
/*004*/ int16 Slot; /*004*/ int16 Slot;
/*006*/ int16 Sub; /*006*/ int16 SubIndex;
/*008*/ int16 Aug; // Guessing - Seen 0xffff /*008*/ int16 AugIndex; // Guessing - Seen 0xffff
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID /*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
/*012*/ /*012*/
}; };
@ -45,8 +45,8 @@ struct InventorySlot_Struct
struct TypelessInventorySlot_Struct struct TypelessInventorySlot_Struct
{ {
/*000*/ int16 Slot; /*000*/ int16 Slot;
/*002*/ int16 Sub; /*002*/ int16 SubIndex;
/*004*/ int16 Aug; /*004*/ int16 AugIndex;
/*006*/ int16 Unknown01; /*006*/ int16 Unknown01;
/*008*/ /*008*/
}; };

View File

@ -34,8 +34,8 @@ struct InventorySlot_Struct
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 /*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*002*/ int16 Unknown02; /*002*/ int16 Unknown02;
/*004*/ int16 Slot; /*004*/ int16 Slot;
/*006*/ int16 Sub; /*006*/ int16 SubIndex;
/*008*/ int16 Aug; // Guessing - Seen 0xffff /*008*/ int16 AugIndex; // Guessing - Seen 0xffff
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID /*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
/*012*/ /*012*/
}; };
@ -45,8 +45,8 @@ struct InventorySlot_Struct
struct TypelessInventorySlot_Struct struct TypelessInventorySlot_Struct
{ {
/*000*/ int16 Slot; /*000*/ int16 Slot;
/*002*/ int16 Sub; /*002*/ int16 SubIndex;
/*004*/ int16 Aug; /*004*/ int16 AugIndex;
/*006*/ int16 Unknown01; /*006*/ int16 Unknown01;
/*008*/ /*008*/
}; };

View File

@ -1614,7 +1614,7 @@ namespace SoD
// OUT(unknown06160[4]); // OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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); OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true 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); OUT(bandoliers[r].Items[k].ID);
@ -1623,7 +1623,7 @@ namespace SoD
} }
} }
// Nullify bandoliers where server and client indexes diverge, with a client bias // Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0'; 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 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; eq->bandoliers[r].Items[k].ID = 0;
@ -1635,13 +1635,13 @@ namespace SoD
// OUT(unknown07444[5120]); // OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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].ID);
OUT(potionbelt.Items[r].Icon); OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name); OUT_str(potionbelt.Items[r].Name);
} }
// Nullify potion belt where server and client indexes diverge, with a client bias // Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::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].ID = 0;
eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0'; eq->potionbelt.Items[r].Name[0] = '\0';
@ -3934,7 +3934,7 @@ namespace SoD
uint32 SubLengths[10]; uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr; SubSerializations[x] = nullptr;
@ -3946,15 +3946,15 @@ namespace SoD
iqbs.subitem_count++; iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::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) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1); 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) 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 - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x); 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) 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 - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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 else
SubSlotNumber = slot_id_in; // ??????? SubSlotNumber = slot_id_in; // ???????
@ -3995,11 +3995,11 @@ namespace SoD
if (serverSlot >= SlotAmmo && 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; SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
SoDSlot = serverSlot + 11; SoDSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
SoDSlot = serverSlot + 1; SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
SoDSlot = serverSlot + 1; SoDSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource) else if (serverSlot == SlotPowerSource)
SoDSlot = inventory::SlotPowerSource; SoDSlot = inventory::SlotPowerSource;
@ -4041,7 +4041,7 @@ namespace SoD
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink) static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; sodTextLink = serverTextLink;
return; return;
} }
@ -4050,7 +4050,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
sodTextLink.append(segments[segment_iter]); sodTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -4081,7 +4081,7 @@ namespace SoD
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink) static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = sodTextLink;
return; return;
} }

View File

@ -1271,7 +1271,7 @@ namespace SoF
// OUT(unknown06160[4]); // OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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); OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true 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); OUT(bandoliers[r].Items[k].ID);
@ -1280,7 +1280,7 @@ namespace SoF
} }
} }
// Nullify bandoliers where server and client indexes diverge, with a client bias // Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0'; 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 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; eq->bandoliers[r].Items[k].ID = 0;
@ -1292,13 +1292,13 @@ namespace SoF
// OUT(unknown07444[5120]); // OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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].ID);
OUT(potionbelt.Items[r].Icon); OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name); OUT_str(potionbelt.Items[r].Name);
} }
// Nullify potion belt where server and client indexes diverge, with a client bias // Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::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].ID = 0;
eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0'; eq->potionbelt.Items[r].Name[0] = '\0';
@ -3256,7 +3256,7 @@ namespace SoF
uint32 SubLengths[10]; uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr; SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
@ -3267,15 +3267,15 @@ namespace SoF
iqbs.subitem_count++; iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::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) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1); 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) 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 - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x); 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) 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 - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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 else
SubSlotNumber = slot_id_in; // ??????? SubSlotNumber = slot_id_in; // ???????
@ -3314,11 +3314,11 @@ namespace SoF
if (serverSlot >= SlotAmmo && 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; SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
SoFSlot = serverSlot + 11; SoFSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
SoFSlot = serverSlot + 1; SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
SoFSlot = serverSlot + 1; SoFSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource) else if (serverSlot == SlotPowerSource)
SoFSlot = inventory::SlotPowerSource; SoFSlot = inventory::SlotPowerSource;
@ -3362,7 +3362,7 @@ namespace SoF
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink) static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; sofTextLink = serverTextLink;
return; return;
} }
@ -3371,7 +3371,7 @@ namespace SoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
sofTextLink.append(segments[segment_iter]); sofTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -3402,7 +3402,7 @@ namespace SoF
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink) static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = sofTextLink;
return; return;
} }

View File

@ -943,7 +943,7 @@ namespace Titanium
// OUT(unknown06160[4]); // OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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); OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true 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); OUT(bandoliers[r].Items[k].ID);
@ -952,7 +952,7 @@ namespace Titanium
} }
} }
// Nullify bandoliers where server and client indexes diverge, with a client bias // Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0'; 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 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; eq->bandoliers[r].Items[k].ID = 0;
@ -964,13 +964,13 @@ namespace Titanium
// OUT(unknown07444[5120]); // OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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].ID);
OUT(potionbelt.Items[r].Icon); OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name); OUT_str(potionbelt.Items[r].Name);
} }
// Nullify potion belt where server and client indexes diverge, with a client bias // Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::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].ID = 0;
eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0'; eq->potionbelt.Items[r].Name[0] = '\0';
@ -2198,7 +2198,7 @@ namespace Titanium
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink) static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; titaniumTextLink = serverTextLink;
return; return;
} }
@ -2207,7 +2207,7 @@ namespace Titanium
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
titaniumTextLink.append(segments[segment_iter]); titaniumTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -2238,7 +2238,7 @@ namespace Titanium
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink) static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = titaniumTextLink;
return; return;
} }

View File

@ -1878,7 +1878,7 @@ namespace UF
// OUT(unknown06160[4]); // OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge // Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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); OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true 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); OUT(bandoliers[r].Items[k].ID);
@ -1887,7 +1887,7 @@ namespace UF
} }
} }
// Nullify bandoliers where server and client indexes diverge, with a client bias // Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0'; 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 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; eq->bandoliers[r].Items[k].ID = 0;
@ -1899,13 +1899,13 @@ namespace UF
// OUT(unknown07444[5120]); // OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge // Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::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].ID);
OUT(potionbelt.Items[r].Icon); OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name); OUT_str(potionbelt.Items[r].Name);
} }
// Nullify potion belt where server and client indexes diverge, with a client bias // Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::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].ID = 0;
eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0'; eq->potionbelt.Items[r].Name[0] = '\0';
@ -4263,7 +4263,7 @@ namespace UF
uint32 SubLengths[10]; uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr; SubSerializations[x] = nullptr;
@ -4275,15 +4275,15 @@ namespace UF
iqbs.subitem_count++; iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::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) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1); 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) 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 - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x); 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) 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 - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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 else
SubSlotNumber = slot_id_in; // ??????? SubSlotNumber = slot_id_in; // ???????
@ -4324,11 +4324,11 @@ namespace UF
if (serverSlot >= SlotAmmo && 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; UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
UnderfootSlot = serverSlot + 11; UnderfootSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
UnderfootSlot = serverSlot + 1; UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
UnderfootSlot = serverSlot + 1; UnderfootSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource) else if (serverSlot == SlotPowerSource)
UnderfootSlot = inventory::SlotPowerSource; UnderfootSlot = inventory::SlotPowerSource;
@ -4372,7 +4372,7 @@ namespace UF
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink) static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
{ {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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; ufTextLink = serverTextLink;
return; return;
} }
@ -4381,7 +4381,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) { if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
ufTextLink.append(segments[segment_iter]); ufTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error // TODO: log size mismatch error
continue; continue;
@ -4412,7 +4412,7 @@ namespace UF
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink) static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
{ {
if ((EQEmu::Constants::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; serverTextLink = ufTextLink;
return; return;
} }

View File

@ -25,7 +25,12 @@
#include "../zone/zonedb.h" #include "../zone/zonedb.h"
std::string EQEmu::SayLink::impl::GenerateLink() EQEmu::saylink::SayLinkEngine::SayLinkEngine()
{
Reset();
}
std::string EQEmu::saylink::SayLinkEngine::GenerateLink()
{ {
m_Link.clear(); m_Link.clear();
m_LinkBody.clear(); m_LinkBody.clear();
@ -34,7 +39,7 @@ std::string EQEmu::SayLink::impl::GenerateLink()
generate_body(); generate_body();
generate_text(); generate_text();
if ((m_LinkBody.length() == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) { if ((m_LinkBody.length() == EQEmu::constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
m_Link.push_back(0x12); m_Link.push_back(0x12);
m_Link.append(m_LinkBody); m_Link.append(m_LinkBody);
m_Link.append(m_LinkText); m_Link.append(m_LinkText);
@ -53,9 +58,9 @@ std::string EQEmu::SayLink::impl::GenerateLink()
return m_Link; return m_Link;
} }
void EQEmu::SayLink::impl::Reset() void EQEmu::saylink::SayLinkEngine::Reset()
{ {
m_LinkType = LinkBlank; m_LinkType = SayLinkBlank;
m_ItemData = nullptr; m_ItemData = nullptr;
m_LootData = nullptr; m_LootData = nullptr;
m_ItemInst = nullptr; m_ItemInst = nullptr;
@ -80,7 +85,7 @@ void EQEmu::SayLink::impl::Reset()
m_Error = false; m_Error = false;
} }
void EQEmu::SayLink::impl::generate_body() void EQEmu::saylink::SayLinkEngine::generate_body()
{ {
/* /*
Current server mask: EQClientRoF2 Current server mask: EQClientRoF2
@ -96,16 +101,16 @@ void EQEmu::SayLink::impl::generate_body()
const Item_Struct* item_data = nullptr; const Item_Struct* item_data = nullptr;
switch (m_LinkType) { switch (m_LinkType) {
case LinkBlank: case SayLinkBlank:
break; break;
case LinkItemData: case SayLinkItemData:
if (m_ItemData == nullptr) { break; } if (m_ItemData == nullptr) { break; }
m_LinkBodyStruct.item_id = m_ItemData->ID; m_LinkBodyStruct.item_id = m_ItemData->ID;
m_LinkBodyStruct.evolve_group = m_ItemData->LoreGroup; // this probably won't work for all items m_LinkBodyStruct.evolve_group = m_ItemData->LoreGroup; // this probably won't work for all items
//m_LinkBodyStruct.evolve_level = m_ItemData->EvolvingLevel; //m_LinkBodyStruct.evolve_level = m_ItemData->EvolvingLevel;
// TODO: add hash call // TODO: add hash call
break; break;
case LinkLootItem: case SayLinkLootItem:
if (m_LootData == nullptr) { break; } if (m_LootData == nullptr) { break; }
item_data = database.GetItem(m_LootData->item_id); item_data = database.GetItem(m_LootData->item_id);
if (item_data == nullptr) { break; } if (item_data == nullptr) { break; }
@ -120,7 +125,7 @@ void EQEmu::SayLink::impl::generate_body()
//m_LinkBodyStruct.evolve_level = item_data->EvolvingLevel; //m_LinkBodyStruct.evolve_level = item_data->EvolvingLevel;
// TODO: add hash call // TODO: add hash call
break; break;
case LinkItemInst: case SayLinkItemInst:
if (m_ItemInst == nullptr) { break; } if (m_ItemInst == nullptr) { break; }
if (m_ItemInst->GetItem() == nullptr) { break; } if (m_ItemInst->GetItem() == nullptr) { break; }
m_LinkBodyStruct.item_id = m_ItemInst->GetItem()->ID; m_LinkBodyStruct.item_id = m_ItemInst->GetItem()->ID;
@ -189,7 +194,7 @@ void EQEmu::SayLink::impl::generate_body()
); );
} }
void EQEmu::SayLink::impl::generate_text() void EQEmu::saylink::SayLinkEngine::generate_text()
{ {
if (m_ProxyText != nullptr) { if (m_ProxyText != nullptr) {
m_LinkText = m_ProxyText; m_LinkText = m_ProxyText;
@ -199,19 +204,19 @@ void EQEmu::SayLink::impl::generate_text()
const Item_Struct* item_data = nullptr; const Item_Struct* item_data = nullptr;
switch (m_LinkType) { switch (m_LinkType) {
case LinkBlank: case SayLinkBlank:
break; break;
case LinkItemData: case SayLinkItemData:
if (m_ItemData == nullptr) { break; } if (m_ItemData == nullptr) { break; }
m_LinkText = m_ItemData->Name; m_LinkText = m_ItemData->Name;
return; return;
case LinkLootItem: case SayLinkLootItem:
if (m_LootData == nullptr) { break; } if (m_LootData == nullptr) { break; }
item_data = database.GetItem(m_LootData->item_id); item_data = database.GetItem(m_LootData->item_id);
if (item_data == nullptr) { break; } if (item_data == nullptr) { break; }
m_LinkText = item_data->Name; m_LinkText = item_data->Name;
return; return;
case LinkItemInst: case SayLinkItemInst:
if (m_ItemInst == nullptr) { break; } if (m_ItemInst == nullptr) { break; }
if (m_ItemInst->GetItem() == nullptr) { break; } if (m_ItemInst->GetItem() == nullptr) { break; }
m_LinkText = m_ItemInst->GetItem()->Name; m_LinkText = m_ItemInst->GetItem()->Name;
@ -223,10 +228,10 @@ void EQEmu::SayLink::impl::generate_text()
m_LinkText = "null"; m_LinkText = "null";
} }
bool EQEmu::SayLink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body) bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body)
{ {
memset(&say_link_body_struct, 0, sizeof(say_link_body_struct)); memset(&say_link_body_struct, 0, sizeof(say_link_body_struct));
if (say_link_body.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH)
return false; return false;
say_link_body_struct.unknown_1 = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16); say_link_body_struct.unknown_1 = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16);
@ -246,7 +251,7 @@ bool EQEmu::SayLink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct
return true; return true;
} }
bool EQEmu::SayLink::GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct) bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct)
{ {
say_link_body = StringFormat( say_link_body = StringFormat(
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X", "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
@ -265,7 +270,7 @@ bool EQEmu::SayLink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
(0xFFFFFFFF & say_link_body_struct.hash) (0xFFFFFFFF & say_link_body_struct.hash)
); );
if (say_link_body.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH)
return false; return false;
return true; return true;

View File

@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef SAY_LINK_H #ifndef COMMON_SAY_LINK_H
#define SAY_LINK_H #define COMMON_SAY_LINK_H
#include "types.h" #include "types.h"
@ -26,16 +26,13 @@
class ItemInst; class ItemInst;
class Item_Struct; struct Item_Struct;
class ServerLootItem_Struct; struct ServerLootItem_Struct;
namespace EQEmu namespace EQEmu
{ {
class SayLink { namespace saylink {
public:
enum Type { LinkBlank = 0, LinkItemData, LinkLootItem, LinkItemInst };
// Current server mask: EQClientRoF2 // Current server mask: EQClientRoF2
struct SayLinkBody_Struct { struct SayLinkBody_Struct {
uint8 unknown_1; /* %1X */ uint8 unknown_1; /* %1X */
@ -53,11 +50,18 @@ namespace EQEmu
int hash; /* %08X */ int hash; /* %08X */
}; };
class impl { class SayLinkEngine {
public: public:
impl() { Reset(); } enum SayLinkType {
SayLinkBlank = 0,
SayLinkItemData,
SayLinkLootItem,
SayLinkItemInst
};
void SetLinkType(Type link_type) { m_LinkType = link_type; } SayLinkEngine();
void SetLinkType(SayLinkType link_type) { m_LinkType = link_type; }
void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; } void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; }
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; } void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; } void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; }
@ -83,9 +87,9 @@ namespace EQEmu
std::string GenerateLink(); std::string GenerateLink();
bool LinkError() { return m_Error; } bool LinkError() { return m_Error; }
std::string GetLink() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x' std::string Link() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
std::string GetLinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>' std::string LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
std::string GetLinkText() { return m_LinkText; } // contains string format: '<LinkText>' std::string LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
void Reset(); void Reset();
@ -120,11 +124,9 @@ namespace EQEmu
bool m_Error; bool m_Error;
}; };
bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body);
bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
static bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body); }
static bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
};
} }
#endif /* SAY_LINK_H */ #endif /* COMMON_SAY_LINK_H */

View File

@ -105,7 +105,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<ItemInst*>::const_iter
"AND ((slotid >= 8000 AND slotid <= 8999) " "AND ((slotid >= 8000 AND slotid <= 8999) "
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )", "OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
char_id, SlotCursor, char_id, SlotCursor,
EQEmu::Constants::CURSOR_BAG_BEGIN, EQEmu::Constants::CURSOR_BAG_END); EQEmu::constants::CURSOR_BAG_BEGIN, EQEmu::constants::CURSOR_BAG_END);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl; std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
@ -161,10 +161,10 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite
bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) { bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) {
//never save tribute slots: //never save tribute slots:
if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END) if (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END)
return true; return true;
if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) { if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
// Shared bank inventory // Shared bank inventory
if (!inst) { if (!inst) {
return DeleteSharedBankSlot(char_id, slot_id); return DeleteSharedBankSlot(char_id, slot_id);
@ -191,9 +191,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer // need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) { if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i); ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM; augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
} }
@ -223,7 +223,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id))
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID' // Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory) // messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) { for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = inst->GetItem(idx); const ItemInst* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx)); SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
} }
@ -238,9 +238,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer // need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) { if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i); ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM; augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
} }
@ -269,7 +269,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) { if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) {
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID' // Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory) // messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) { for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = inst->GetItem(idx); const ItemInst* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx)); SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
} }
@ -295,7 +295,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id)) if (!Inventory::SupportsContainers(slot_id))
return true; return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_BEGIN); int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i", query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
char_id, base_slot_id, (base_slot_id+10)); char_id, base_slot_id, (base_slot_id+10));
results = QueryDatabase(query); results = QueryDatabase(query);
@ -321,7 +321,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id)) if (!Inventory::SupportsContainers(slot_id))
return true; return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_BEGIN); int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i " query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
"AND slotid >= %i AND slotid < %i", "AND slotid >= %i AND slotid < %i",
account_id, base_slot_id, (base_slot_id+10)); account_id, base_slot_id, (base_slot_id+10));
@ -427,7 +427,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
uint32 item_id = (uint32)atoi(row[1]); uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]); int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE]; uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[3]); aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]); aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]); aug[2] = (uint32)atoi(row[5]);
@ -448,7 +448,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
ItemInst *inst = CreateBaseItem(item, charges); ItemInst *inst = CreateBaseItem(item, charges);
if (inst && item->ItemClass == ItemClassCommon) { if (inst && item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i]) if (aug[i])
inst->PutAugment(this, i, aug[i]); inst->PutAugment(this, i, aug[i]);
} }
@ -522,7 +522,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
uint16 charges = atoi(row[2]); uint16 charges = atoi(row[2]);
uint32 color = atoul(row[3]); uint32 color = atoul(row[3]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE]; uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoul(row[4]); aug[0] = (uint32)atoul(row[4]);
aug[1] = (uint32)atoul(row[5]); aug[1] = (uint32)atoul(row[5]);
@ -584,7 +584,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
inst->SetOrnamentHeroModel(ornament_hero_model); inst->SetOrnamentHeroModel(ornament_hero_model);
if (instnodrop || if (instnodrop ||
(((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) || (((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) ||
slot_id == SlotPowerSource) && slot_id == SlotPowerSource) &&
inst->GetItem()->Attuneable)) inst->GetItem()->Attuneable))
inst->SetAttuned(true); inst->SetAttuned(true);
@ -608,7 +608,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
} }
if (item->ItemClass == ItemClassCommon) { if (item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i]) if (aug[i])
inst->PutAugment(this, i, aug[i]); inst->PutAugment(this, i, aug[i]);
} }
@ -665,7 +665,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
int8 charges = atoi(row[2]); int8 charges = atoi(row[2]);
uint32 color = atoul(row[3]); uint32 color = atoul(row[3]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE]; uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[4]); aug[0] = (uint32)atoi(row[4]);
aug[1] = (uint32)atoi(row[5]); aug[1] = (uint32)atoi(row[5]);
aug[2] = (uint32)atoi(row[6]); aug[2] = (uint32)atoi(row[6]);
@ -726,7 +726,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
inst->SetCharges(charges); inst->SetCharges(charges);
if (item->ItemClass == ItemClassCommon) { if (item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i]) if (aug[i])
inst->PutAugment(this, i, aug[i]); inst->PutAugment(this, i, aug[i]);
} }

View File

@ -211,9 +211,9 @@ void Client::SendMaxCharCreate() {
auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct)); auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct));
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer; MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
mc->max_chars = EQEmu::Limits::CharacterCreationLimit(m_ClientVersion); mc->max_chars = EQEmu::limits::CharacterCreationLimit(m_ClientVersion);
if (mc->max_chars > EQEmu::Constants::CHARACTER_CREATION_LIMIT) if (mc->max_chars > EQEmu::constants::CHARACTER_CREATION_LIMIT)
mc->max_chars = EQEmu::Constants::CHARACTER_CREATION_LIMIT; mc->max_chars = EQEmu::constants::CHARACTER_CREATION_LIMIT;
QueuePacket(outapp); QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);
@ -746,8 +746,8 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
// This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above) // This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above)
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration) // (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
if (!pZoning) { if (!pZoning) {
size_t character_limit = EQEmu::Limits::CharacterCreationLimit(eqs->GetClientVersion()); size_t character_limit = EQEmu::limits::CharacterCreationLimit(eqs->GetClientVersion());
if (character_limit > EQEmu::Constants::CHARACTER_CREATION_LIMIT) { character_limit = EQEmu::Constants::CHARACTER_CREATION_LIMIT; } if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT) { character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT; }
if (eqs->GetClientVersion() == ClientVersion::Titanium) { character_limit = 8; } if (eqs->GetClientVersion() == ClientVersion::Titanium) { character_limit = 8; }
std::string tgh_query = StringFormat( std::string tgh_query = StringFormat(

View File

@ -37,11 +37,11 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
{ {
/* Set Character Creation Limit */ /* Set Character Creation Limit */
ClientVersion client_version = ClientVersionFromBit(clientVersionBit); ClientVersion client_version = ClientVersionFromBit(clientVersionBit);
size_t character_limit = EQEmu::Limits::CharacterCreationLimit(client_version); size_t character_limit = EQEmu::limits::CharacterCreationLimit(client_version);
// Validate against absolute server max // Validate against absolute server max
if (character_limit > EQEmu::Constants::CHARACTER_CREATION_LIMIT) if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT)
character_limit = EQEmu::Constants::CHARACTER_CREATION_LIMIT; character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT;
// Force Titanium clients to use '8' // Force Titanium clients to use '8'
if (client_version == ClientVersion::Titanium) if (client_version == ClientVersion::Titanium)

View File

@ -418,7 +418,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
//gear stuff, need to make sure there's //gear stuff, need to make sure there's
//no situation where this stuff can be duped //no situation where this stuff can be duped
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo
{ {
uint32 sitem = 0; uint32 sitem = 0;
sitem = CorpseToUse->GetWornItem(x); sitem = CorpseToUse->GetWornItem(x);

View File

@ -3642,7 +3642,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
proced = false; proced = false;
if (!proced && inst) { if (!proced && inst) {
for (int r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { for (int r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst *aug_i = inst->GetAugment(r); const ItemInst *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot! if (!aug_i) // no aug, try next slot!
continue; continue;

View File

@ -171,8 +171,8 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
} }
//tribute items //tribute items
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++) { for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::Constants::TRIBUTE_BEGIN + i]; const ItemInst* inst = m_inv[EQEmu::constants::TRIBUTE_BEGIN + i];
if(inst == 0) if(inst == 0)
continue; continue;
AddItemBonuses(inst, newbon, false, true); AddItemBonuses(inst, newbon, false, true);
@ -526,7 +526,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
} }
if (!isAug) { if (!isAug) {
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item); AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
} }
} }
@ -564,7 +564,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
if (!isAug) if (!isAug)
{ {
int i; int i;
for (i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
AdditiveWornBonuses(inst->GetAugment(i),newbon,true); AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
} }
} }
@ -575,7 +575,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
bool food = false; bool food = false;
bool drink = false; bool drink = false;
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_BEGIN; i++) for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_BEGIN; i++)
{ {
if (food && drink) if (food && drink)
break; break;
@ -591,7 +591,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
AddItemBonuses(inst, newbon); AddItemBonuses(inst, newbon);
} }
} }
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++) for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++)
{ {
if (food && drink) if (food && drink)
break; break;
@ -3200,7 +3200,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
{ {
if(newbon){ if(newbon){
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){ for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]); const Item_Struct *cur = database.GetItem(equipment[i]);
if(cur){ if(cur){
//basic stats //basic stats
@ -3278,18 +3278,18 @@ void Client::CalcItemScale() {
bool changed = false; bool changed = false;
// MainAmmo excluded in helper function below // MainAmmo excluded in helper function below
if (CalcItemScale(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) if (CalcItemScale(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true; changed = true;
if (CalcItemScale(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30) if (CalcItemScale(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true; changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END // I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be... // and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (CalcItemScale(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341) if (CalcItemScale(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true; changed = true;
if (CalcItemScale(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405) if (CalcItemScale(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true; changed = true;
//Power Source Slot //Power Source Slot
@ -3320,7 +3320,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items // TEST CODE: test for bazaar trader crashing with charm items
if (Trader) if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) { if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i)); ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue; continue;
@ -3340,7 +3340,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
} }
//iterate all augments //iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{ {
ItemInst * a_inst = inst->GetAugment(x); ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) if(!a_inst)
@ -3372,18 +3372,18 @@ void Client::DoItemEnterZone() {
bool changed = false; bool changed = false;
// MainAmmo excluded in helper function below // MainAmmo excluded in helper function below
if (DoItemEnterZone(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) if (DoItemEnterZone(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true; changed = true;
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30) if (DoItemEnterZone(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true; changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END // I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be... // and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341) if (DoItemEnterZone(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true; changed = true;
if (DoItemEnterZone(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405) if (DoItemEnterZone(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true; changed = true;
//Power Source Slot //Power Source Slot
@ -3413,7 +3413,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items // TEST CODE: test for bazaar trader crashing with charm items
if (Trader) if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) { if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i)); ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue; continue;
@ -3443,7 +3443,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
} }
//iterate all augments //iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{ {
ItemInst *a_inst = inst->GetAugment(x); ItemInst *a_inst = inst->GetAugment(x);
if(!a_inst) if(!a_inst)

View File

@ -93,7 +93,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
timers[i] = 0; timers[i] = 0;
strcpy(this->name, this->GetCleanName()); strcpy(this->name, this->GetCleanName());
memset(&m_Light, 0, sizeof(EQEmu::LightSource::impl)); memset(&m_Light, 0, sizeof(EQEmu::lightsource::LightSourceProfile));
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct)); memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
} }
@ -1722,8 +1722,8 @@ bool Bot::LoadPet()
if (!botdb.LoadPetBuffs(GetBotID(), pet_buffs)) if (!botdb.LoadPetBuffs(GetBotID(), pet_buffs))
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName()); bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName());
uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE]; uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE];
memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE)); memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE));
if (!botdb.LoadPetItems(GetBotID(), pet_items)) if (!botdb.LoadPetItems(GetBotID(), pet_items))
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName()); bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName());
@ -1750,11 +1750,11 @@ bool Bot::SavePet()
char* pet_name = new char[64]; char* pet_name = new char[64];
SpellBuff_Struct pet_buffs[BUFF_COUNT]; SpellBuff_Struct pet_buffs[BUFF_COUNT];
uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE]; uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE];
memset(pet_name, 0, 64); memset(pet_name, 0, 64);
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * BUFF_COUNT)); memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * BUFF_COUNT));
memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE)); memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE));
pet_inst->GetPetState(pet_buffs, pet_items, pet_name); pet_inst->GetPetState(pet_buffs, pet_items, pet_name);
@ -2121,7 +2121,7 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
break; break;
} }
if (item_slot >= EQEmu::Constants::EQUIPMENT_BEGIN){ if (item_slot >= EQEmu::constants::EQUIPMENT_BEGIN){
const ItemInst* inst = GetBotItem(item_slot); const ItemInst* inst = GetBotItem(item_slot);
const Item_Struct* botweapon = 0; const Item_Struct* botweapon = 0;
if(inst) if(inst)
@ -2878,7 +2878,7 @@ void Bot::Spawn(Client* botCharacterOwner) {
// I re-enabled this until I can sort it out // I re-enabled this until I can sort it out
uint32 itemID = 0; uint32 itemID = 0;
uint8 materialFromSlot = 0xFF; uint8 materialFromSlot = 0xFF;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
itemID = GetBotItemBySlot(i); itemID = GetBotItemBySlot(i);
if(itemID != 0) { if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i); materialFromSlot = Inventory::CalcMaterialFromSlot(i);
@ -3361,7 +3361,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
if(tradeType == BotTradeClientNormal) { if(tradeType == BotTradeClientNormal) {
// Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC // Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC
// Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..? // Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..?
PerformTradeWithClient(EQEmu::Constants::TRADE_BEGIN, EQEmu::Constants::TRADE_END, client); // {3000..3007} PerformTradeWithClient(EQEmu::constants::TRADE_BEGIN, EQEmu::constants::TRADE_END, client); // {3000..3007}
} }
else if(tradeType == BotTradeClientNoDropNoTrade) { else if(tradeType == BotTradeClientNoDropNoTrade) {
// Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag. // Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag.
@ -3378,7 +3378,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client) { void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client) {
if(client) { if(client) {
// TODO: Figure out what the actual max slot id is // TODO: Figure out what the actual max slot id is
const int MAX_SLOT_ID = EQEmu::Constants::TRADE_BAGS_END; // was the old incorrect 3179.. const int MAX_SLOT_ID = EQEmu::constants::TRADE_BAGS_END; // was the old incorrect 3179..
uint32 items[MAX_SLOT_ID] = {0}; uint32 items[MAX_SLOT_ID] = {0};
uint8 charges[MAX_SLOT_ID] = {0}; uint8 charges[MAX_SLOT_ID] = {0};
bool botCanWear[MAX_SLOT_ID] = {0}; bool botCanWear[MAX_SLOT_ID] = {0};
@ -3403,7 +3403,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
std::string TempErrorMessage; std::string TempErrorMessage;
const Item_Struct* mWeaponItem = inst->GetItem(); const Item_Struct* mWeaponItem = inst->GetItem();
bool failedLoreCheck = false; bool failedLoreCheck = false;
for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) { for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
ItemInst *itm = inst->GetAugment(m); ItemInst *itm = inst->GetAugment(m);
if(itm) if(itm)
{ {
@ -3423,12 +3423,12 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
botCanWear[i] = BotCanWear; botCanWear[i] = BotCanWear;
ItemInst* swap_item = nullptr; ItemInst* swap_item = nullptr;
const char* equipped[EQEmu::Constants::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", const char* equipped[EQEmu::constants::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back",
"Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand",
"Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo", "Powersource" }; "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo", "Powersource" };
bool success = false; bool success = false;
int how_many_slots = 0; int how_many_slots = 0;
for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) { for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) { if((mWeaponItem->Slots & (1 << j))) {
if (j == 22) if (j == 22)
j = 9999; j = 9999;
@ -3489,14 +3489,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
} }
if(!success) { if(!success) {
for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) { for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) { if((mWeaponItem->Slots & (1 << j))) {
if (j == 22) if (j == 22)
j = 9999; j = 9999;
swap_item = GetBotItem(j); swap_item = GetBotItem(j);
failedLoreCheck = false; failedLoreCheck = false;
for (int k = AUG_BEGIN; k < EQEmu::Constants::ITEM_COMMON_SIZE; ++k) { for (int k = AUG_INDEX_BEGIN; k < EQEmu::constants::ITEM_COMMON_SIZE; ++k) {
ItemInst *itm = swap_item->GetAugment(k); ItemInst *itm = swap_item->GetAugment(k);
if(itm) if(itm)
{ {
@ -4294,7 +4294,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
int32 focus_max = 0; int32 focus_max = 0;
int32 focus_max_real = 0; int32 focus_max_real = 0;
//item focus //item focus
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) { for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) {
TempItem = nullptr; TempItem = nullptr;
ItemInst* ins = GetBotItem(x); ItemInst* ins = GetBotItem(x);
if (!ins) if (!ins)
@ -4319,7 +4319,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
} }
} }
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y) { for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) {
ItemInst *aug = nullptr; ItemInst *aug = nullptr;
aug = ins->GetAugment(y); aug = ins->GetAugment(y);
if(aug) { if(aug) {
@ -4999,7 +4999,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
if(botweaponInst) { if(botweaponInst) {
primaryweapondamage = GetWeaponDamage(other, botweaponInst); primaryweapondamage = GetWeaponDamage(other, botweaponInst);
backstab_dmg = botweaponInst->GetItem()->BackstabDmg; backstab_dmg = botweaponInst->GetItem()->BackstabDmg;
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; ++i) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) {
ItemInst *aug = botweaponInst->GetAugment(i); ItemInst *aug = botweaponInst->GetAugment(i);
if(aug) if(aug)
backstab_dmg += aug->GetItem()->BackstabDmg; backstab_dmg += aug->GetItem()->BackstabDmg;
@ -5374,7 +5374,7 @@ void Bot::EquipBot(std::string* errorMessage) {
GetBotItems(m_inv, errorMessage); GetBotItems(m_inv, errorMessage);
const ItemInst* inst = 0; const ItemInst* inst = 0;
const Item_Struct* item = 0; const Item_Struct* item = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
inst = GetBotItem(i); inst = GetBotItem(i);
if(inst) { if(inst) {
item = inst->GetItem(); item = inst->GetItem();
@ -7192,7 +7192,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
// Modded to display power source items (will only show up on SoF+ client inspect windows though.) // Modded to display power source items (will only show up on SoF+ client inspect windows though.)
// I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list' // I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list'
// to see them on a Titanium client when/if they are activated. // to see them on a Titanium client when/if they are activated.
for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
inst = inspectedBot->GetBotItem(L); inst = inspectedBot->GetBotItem(L);
if(inst) { if(inst) {
@ -7240,7 +7240,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon)
{ {
const Item_Struct* itemtmp = 0; const Item_Struct* itemtmp = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
const ItemInst* item = GetBotItem((i == 22 ? 9999 : i)); const ItemInst* item = GetBotItem((i == 22 ? 9999 : i));
if(item) { if(item) {
AddItemBonuses(item, newbon); AddItemBonuses(item, newbon);
@ -7553,7 +7553,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
if (!isAug) if (!isAug)
{ {
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level); AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
} }
@ -8047,7 +8047,7 @@ int Bot::GetRawACNoShield(int &shield_ac) {
if(inst->GetItem()->ItemType == ItemTypeShield) { if(inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC; ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC; shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if(inst->GetAugment(i)) { if(inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC; ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC;
@ -8062,7 +8062,7 @@ uint32 Bot::CalcCurrentWeight() {
const Item_Struct* TempItem = 0; const Item_Struct* TempItem = 0;
ItemInst* inst; ItemInst* inst;
uint32 Total = 0; uint32 Total = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
inst = GetBotItem(i); inst = GetBotItem(i);
if(inst) { if(inst) {
TempItem = inst->GetItem(); TempItem = inst->GetItem();
@ -8469,8 +8469,8 @@ std::string Bot::CreateSayLink(Client* c, const char* message, const char* name)
uint32 saylink_id = database.LoadSaylinkID(escaped_string); uint32 saylink_id = database.LoadSaylinkID(escaped_string);
safe_delete_array(escaped_string); safe_delete_array(escaped_string);
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
linker.SetProxyItemID(SAYLINK_ITEM_ID); linker.SetProxyItemID(SAYLINK_ITEM_ID);
linker.SetProxyAugment1ID(saylink_id); linker.SetProxyAugment1ID(saylink_id);
linker.SetProxyText(name); linker.SetProxyText(name);

View File

@ -77,9 +77,9 @@ static const std::string bot_stance_name[BOT_STANCE_COUNT] = {
static const char* GetBotStanceName(int stance_id) { return bot_stance_name[VALIDBOTSTANCE(stance_id)].c_str(); } static const char* GetBotStanceName(int stance_id) { return bot_stance_name[VALIDBOTSTANCE(stance_id)].c_str(); }
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::Constants::EQUIPMENT_BEGIN && x <= EQEmu::Constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23))) #define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::constants::EQUIPMENT_BEGIN && x <= EQEmu::constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23)))
static std::string bot_equip_slot_name[EQEmu::Constants::EQUIPMENT_SIZE + 2] = static std::string bot_equip_slot_name[EQEmu::constants::EQUIPMENT_SIZE + 2] =
{ {
"Charm", // MainCharm "Charm", // MainCharm
"Left Ear", // MainEar1 "Left Ear", // MainEar1
@ -386,7 +386,7 @@ public:
void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true); void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
void EquipBot(std::string* errorMessage); void EquipBot(std::string* errorMessage);
bool CheckLoreConflict(const Item_Struct* item); bool CheckLoreConflict(const Item_Struct* item);
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); } virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
// Static Class Methods // Static Class Methods
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped //static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped

View File

@ -2400,7 +2400,7 @@ namespace ActionableBots
continue; continue;
mod_skill_value = base_skill_value; mod_skill_value = base_skill_value;
for (int16 index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::EQUIPMENT_END; ++index) { for (int16 index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; ++index) {
const ItemInst* indexed_item = bot_iter->GetBotItem(index); const ItemInst* indexed_item = bot_iter->GetBotItem(index);
if (indexed_item && indexed_item->GetItem()->SkillModType == skill_type) if (indexed_item && indexed_item->GetItem()->SkillModType == skill_type)
mod_skill_value += (base_skill_value * (((float)indexed_item->GetItem()->SkillModValue) / 100.0f)); mod_skill_value += (base_skill_value * (((float)indexed_item->GetItem()->SkillModValue) / 100.0f));
@ -7066,11 +7066,11 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
bool is2Hweapon = false; bool is2Hweapon = false;
std::string item_link; std::string item_link;
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst); linker.SetLinkType(linker.SayLinkItemInst);
uint32 inventory_count = 0; uint32 inventory_count = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
if ((i == SlotSecondary) && is2Hweapon) if ((i == SlotSecondary) && is2Hweapon)
continue; continue;
@ -7126,7 +7126,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
} }
int slotId = atoi(sep->arg[1]); int slotId = atoi(sep->arg[1]);
if (!sep->IsNumber(1) || ((slotId > EQEmu::Constants::EQUIPMENT_END || slotId < EQEmu::Constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) { if (!sep->IsNumber(1) || ((slotId > EQEmu::constants::EQUIPMENT_END || slotId < EQEmu::constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) {
c->Message(m_fail, "Valid slots are 0-21 or 9999"); c->Message(m_fail, "Valid slots are 0-21 or 9999");
return; return;
} }
@ -7141,7 +7141,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
return; return;
} }
for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) { for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
if (!itminst) if (!itminst)
break; break;
@ -7233,7 +7233,7 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
//Client::TextLink linker; //Client::TextLink linker;
//linker.SetLinkType(linker.linkItemInst); //linker.SetLinkType(linker.linkItemInst);
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
const Item_Struct* item = nullptr; const Item_Struct* item = nullptr;
const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i); const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i);
if (inst) if (inst)

View File

@ -1058,7 +1058,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
int16 slot_id = atoi(row[0]); int16 slot_id = atoi(row[0]);
if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != SlotPowerSource) if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource)
continue; continue;
uint32 item_id = atoi(row[1]); uint32 item_id = atoi(row[1]);
@ -1091,7 +1091,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
if (item_inst->GetItem()->Attuneable) { if (item_inst->GetItem()->Attuneable) {
if (atoi(row[4])) if (atoi(row[4]))
item_inst->SetAttuned(true); item_inst->SetAttuned(true);
else if (((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::Constants::EQUIPMENT_END) || slot_id == SlotPowerSource)) else if (((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || slot_id == SlotPowerSource))
item_inst->SetAttuned(true); item_inst->SetAttuned(true);
} }
@ -1159,7 +1159,7 @@ bool BotDatabase::LoadItemBySlot(Bot* bot_inst)
bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id) bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id)
{ {
if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource)) if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false; return false;
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id); query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
@ -1177,7 +1177,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint
bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const ItemInst* item_inst) bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const ItemInst* item_inst)
{ {
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource)) if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false; return false;
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id)) if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
@ -1187,7 +1187,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item
return true; return true;
uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 }; uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 };
for (int augment_iter = 0; augment_iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++augment_iter) for (int augment_iter = 0; augment_iter < EQEmu::constants::ITEM_COMMON_SIZE; ++augment_iter)
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter); augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
query = StringFormat( query = StringFormat(
@ -1255,7 +1255,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item
bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id) bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id)
{ {
if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource)) if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false; return false;
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id); query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
@ -1294,7 +1294,7 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c
return false; return false;
bool all_flag = (slot_id == -2); bool all_flag = (slot_id == -2);
if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != SlotPowerSource && !all_flag) if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource && !all_flag)
return false; return false;
std::string where_clause; std::string where_clause;
@ -1571,7 +1571,7 @@ bool BotDatabase::LoadPetItems(const uint32 bot_id, uint32* pet_items)
return true; return true;
int item_index = 0; int item_index = 0;
for (auto row = results.begin(); row != results.end() && item_index < EQEmu::Constants::EQUIPMENT_SIZE; ++row) { for (auto row = results.begin(); row != results.end() && item_index < EQEmu::constants::EQUIPMENT_SIZE; ++row) {
pet_items[item_index] = atoi(row[0]); pet_items[item_index] = atoi(row[0]);
++item_index; ++item_index;
} }
@ -1595,7 +1595,7 @@ bool BotDatabase::SavePetItems(const uint32 bot_id, const uint32* pet_items, boo
if (!saved_pet_index) if (!saved_pet_index)
return true; return true;
for (int item_index = 0; item_index < EQEmu::Constants::EQUIPMENT_SIZE; ++item_index) { for (int item_index = 0; item_index < EQEmu::constants::EQUIPMENT_SIZE; ++item_index) {
if (!pet_items[item_index]) if (!pet_items[item_index])
continue; continue;

View File

@ -5392,7 +5392,7 @@ bool Client::TryReward(uint32 claim_id)
// save // save
uint32 free_slot = 0xFFFFFFFF; uint32 free_slot = 0xFFFFFFFF;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; ++i) { for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; ++i) {
ItemInst *item = GetInv().GetItem(i); ItemInst *item = GetInv().GetItem(i);
if (!item) { if (!item) {
free_slot = i; free_slot = i;
@ -6307,7 +6307,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_details = GetDrakkinDetails(); made_npc->drakkin_details = GetDrakkinDetails();
made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary); made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary); made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary);
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++) { for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++) {
made_npc->armor_tint[i] = GetEquipmentColor(i); made_npc->armor_tint[i] = GetEquipmentColor(i);
} }
made_npc->loottable_id = 0; made_npc->loottable_id = 0;
@ -7583,7 +7583,7 @@ void Client::GarbleMessage(char *message, uint8 variance)
for (size_t i = 0; i < strlen(message); i++) { for (size_t i = 0; i < strlen(message); i++) {
// Client expects hex values inside of a text link body // Client expects hex values inside of a text link body
if (message[i] == delimiter) { if (message[i] == delimiter) {
if (!(delimiter_count & 1)) { i += EQEmu::Constants::TEXT_LINK_BODY_LENGTH; } if (!(delimiter_count & 1)) { i += EQEmu::constants::TEXT_LINK_BODY_LENGTH; }
++delimiter_count; ++delimiter_count;
continue; continue;
} }
@ -8008,17 +8008,17 @@ void Client::TickItemCheck()
if(zone->tick_items.empty()) { return; } if(zone->tick_items.empty()) { return; }
//Scan equip slots for items //Scan equip slots for items
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
{ {
TryItemTick(i); TryItemTick(i);
} }
//Scan main inventory + cursor //Scan main inventory + cursor
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
{ {
TryItemTick(i); TryItemTick(i);
} }
//Scan bags //Scan bags
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
{ {
TryItemTick(i); TryItemTick(i);
} }
@ -8034,7 +8034,7 @@ void Client::TryItemTick(int slot)
if(zone->tick_items.count(iid) > 0) if(zone->tick_items.count(iid) > 0)
{ {
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::Constants::EQUIPMENT_END)) if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::constants::EQUIPMENT_END))
{ {
ItemInst* e_inst = (ItemInst*)inst; ItemInst* e_inst = (ItemInst*)inst;
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot); parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
@ -8042,9 +8042,9 @@ void Client::TryItemTick(int slot)
} }
//Only look at augs in main inventory //Only look at augs in main inventory
if (slot > EQEmu::Constants::EQUIPMENT_END) { return; } if (slot > EQEmu::constants::EQUIPMENT_END) { return; }
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{ {
ItemInst * a_inst = inst->GetAugment(x); ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) { continue; } if(!a_inst) { continue; }
@ -8065,17 +8065,17 @@ void Client::TryItemTick(int slot)
void Client::ItemTimerCheck() void Client::ItemTimerCheck()
{ {
int i; int i;
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
{ {
TryItemTimer(i); TryItemTimer(i);
} }
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
{ {
TryItemTimer(i); TryItemTimer(i);
} }
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
{ {
TryItemTimer(i); TryItemTimer(i);
} }
@ -8097,11 +8097,11 @@ void Client::TryItemTimer(int slot)
++it_iter; ++it_iter;
} }
if (slot > EQEmu::Constants::EQUIPMENT_END) { if (slot > EQEmu::constants::EQUIPMENT_END) {
return; return;
} }
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{ {
ItemInst * a_inst = inst->GetAugment(x); ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) { if(!a_inst) {
@ -8389,12 +8389,12 @@ void Client::ShowNumHits()
int Client::GetQuiverHaste(int delay) int Client::GetQuiverHaste(int delay)
{ {
const ItemInst *pi = nullptr; const ItemInst *pi = nullptr;
for (int r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::GENERAL_END; r++) { for (int r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) {
pi = GetInv().GetItem(r); pi = GetInv().GetItem(r);
if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver && if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
pi->GetItem()->BagWR > 0) pi->GetItem()->BagWR > 0)
break; break;
if (r == EQEmu::Constants::GENERAL_END) if (r == EQEmu::constants::GENERAL_END)
// we will get here if we don't find a valid quiver // we will get here if we don't find a valid quiver
return 0; return 0;
} }

View File

@ -736,7 +736,7 @@ public:
#endif #endif
uint32 GetEquipment(uint8 material_slot) const; // returns item id uint32 GetEquipment(uint8 material_slot) const; // returns item id
uint32 GetEquipmentColor(uint8 material_slot) const; uint32 GetEquipmentColor(uint8 material_slot) const;
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); } virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; } inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }

View File

@ -485,7 +485,7 @@ int32 Client::GetRawItemAC()
{ {
int32 Total = 0; int32 Total = 0;
// this skips MainAmmo..add an '=' conditional if that slot is required (original behavior) // this skips MainAmmo..add an '=' conditional if that slot is required (original behavior)
for (int16 slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id < EQEmu::Constants::EQUIPMENT_END; slot_id++) { for (int16 slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id < EQEmu::constants::EQUIPMENT_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if (inst && inst->IsType(ItemClassCommon)) { if (inst && inst->IsType(ItemClassCommon)) {
Total += inst->GetItem()->AC; Total += inst->GetItem()->AC;
@ -1306,7 +1306,7 @@ uint32 Client::CalcCurrentWeight()
ItemInst* ins; ItemInst* ins;
uint32 Total = 0; uint32 Total = 0;
int x; int x;
for (x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not? for (x = EQEmu::constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not?
TempItem = 0; TempItem = 0;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
if (ins) { if (ins) {
@ -1316,7 +1316,7 @@ uint32 Client::CalcCurrentWeight()
Total += TempItem->Weight; Total += TempItem->Weight;
} }
} }
for (x = EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) { // include cursor bags or not? for (x = EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) { // include cursor bags or not?
int TmpWeight = 0; int TmpWeight = 0;
TempItem = 0; TempItem = 0;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
@ -1331,7 +1331,7 @@ uint32 Client::CalcCurrentWeight()
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications) // is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
int bagslot = SlotGeneral1; int bagslot = SlotGeneral1;
int reduction = 0; int reduction = 0;
for (int m = EQEmu::Constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::Constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not? for (int m = EQEmu::constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
if (x >= m) { if (x >= m) {
bagslot += 1; bagslot += 1;
} }
@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight()
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd. This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
*/ */
// SoD+ client has no weight for coin // SoD+ client has no weight for coin
if (EQEmu::Limits::CoinHasWeight(GetClientVersion())) { if (EQEmu::limits::CoinHasWeight(GetClientVersion())) {
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4; Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
} }
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat; float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
@ -2210,7 +2210,7 @@ int Client::GetRawACNoShield(int &shield_ac) const
if (inst->GetItem()->ItemType == ItemTypeShield) { if (inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC; ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC; shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugment(i)) { if (inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC; ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC;

View File

@ -1313,7 +1313,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
} }
/* Set item material tint */ /* Set item material tint */
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++) for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++)
{ {
if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255) if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255)
{ {
@ -7994,7 +7994,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
const Item_Struct* item = nullptr; const Item_Struct* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
const ItemInst* inst = GetInv().GetItem(L); const ItemInst* inst = GetInv().GetItem(L);
item = inst ? inst->GetItem() : nullptr; item = inst ? inst->GetItem() : nullptr;
@ -8474,7 +8474,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
ItemInst* clickaug = 0; ItemInst* clickaug = 0;
Item_Struct* augitem = 0; Item_Struct* augitem = 0;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r); const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i) if (!aug_i)
continue; continue;
@ -9675,7 +9675,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer; MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer;
if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id)) if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id))
{ {
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::Constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
{ {
char *detect = nullptr; char *detect = nullptr;
const ItemInst *itm_from = GetInv().GetItem(mi->from_slot); const ItemInst *itm_from = GetInv().GetItem(mi->from_slot);
@ -9696,8 +9696,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
// Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered. // Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered.
bool mi_hack = false; bool mi_hack = false;
if (mi->from_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::Constants::CURSOR_BAG_END) { if (mi->from_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::constants::CURSOR_BAG_END) {
if (mi->from_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; } if (mi->from_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else { else {
int16 from_parent = m_inv.CalcSlotId(mi->from_slot); int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
if (!m_inv[from_parent]) { mi_hack = true; } if (!m_inv[from_parent]) { mi_hack = true; }
@ -9706,8 +9706,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
} }
} }
if (mi->to_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::Constants::CURSOR_BAG_END) { if (mi->to_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::constants::CURSOR_BAG_END) {
if (mi->to_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; } if (mi->to_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else { else {
int16 to_parent = m_inv.CalcSlotId(mi->to_slot); int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
if (!m_inv[to_parent]) { mi_hack = true; } if (!m_inv[to_parent]) { mi_hack = true; }

View File

@ -742,7 +742,7 @@ void Client::BulkSendInventoryItems() {
// LINKDEAD TRADE ITEMS // LINKDEAD TRADE ITEMS
// Move trade slot items back into normal inventory..need them there now for the proceeding validity checks // Move trade slot items back into normal inventory..need them there now for the proceeding validity checks
for(slot_id = EQEmu::Constants::TRADE_BEGIN; slot_id <= EQEmu::Constants::TRADE_END; slot_id++) { for(slot_id = EQEmu::constants::TRADE_BEGIN; slot_id <= EQEmu::constants::TRADE_END; slot_id++) {
ItemInst* inst = m_inv.PopItem(slot_id); ItemInst* inst = m_inv.PopItem(slot_id);
if(inst) { if(inst) {
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
@ -790,7 +790,7 @@ void Client::BulkSendInventoryItems() {
std::map<uint16, std::string>::iterator itr; std::map<uint16, std::string>::iterator itr;
//Inventory items //Inventory items
for(slot_id = SLOT_BEGIN; slot_id < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; slot_id++) { for(slot_id = SLOT_BEGIN; slot_id < EQEmu::constants::TYPE_POSSESSIONS_SIZE; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if(inst) { if(inst) {
std::string packet = inst->Serialize(slot_id); std::string packet = inst->Serialize(slot_id);
@ -810,7 +810,7 @@ void Client::BulkSendInventoryItems() {
} }
// Bank items // Bank items
for(slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; slot_id++) { for(slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if(inst) { if(inst) {
std::string packet = inst->Serialize(slot_id); std::string packet = inst->Serialize(slot_id);
@ -820,7 +820,7 @@ void Client::BulkSendInventoryItems() {
} }
// Shared Bank items // Shared Bank items
for(slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; slot_id++) { for(slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if(inst) { if(inst) {
std::string packet = inst->Serialize(slot_id); std::string packet = inst->Serialize(slot_id);
@ -851,14 +851,14 @@ void Client::BulkSendInventoryItems()
if(deletenorent){//client was offline for more than 30 minutes, delete no rent items if(deletenorent){//client was offline for more than 30 minutes, delete no rent items
RemoveNoRent(); RemoveNoRent();
} }
for (slot_id=EQEmu::Constants::POSSESSIONS_BEGIN; slot_id<=EQEmu::Constants::POSSESSIONS_END; slot_id++) { for (slot_id=EQEmu::constants::POSSESSIONS_BEGIN; slot_id<=EQEmu::constants::POSSESSIONS_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if (inst){ if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory); SendItemPacket(slot_id, inst, ItemPacketCharInventory);
} }
} }
// Bank items // Bank items
for (slot_id=EQEmu::Constants::BANK_BEGIN; slot_id<=EQEmu::Constants::BANK_END; slot_id++) { // 2015... for (slot_id=EQEmu::constants::BANK_BEGIN; slot_id<=EQEmu::constants::BANK_END; slot_id++) { // 2015...
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if (inst){ if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory); SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@ -866,7 +866,7 @@ void Client::BulkSendInventoryItems()
} }
// Shared Bank items // Shared Bank items
for (slot_id=EQEmu::Constants::SHARED_BANK_BEGIN; slot_id<=EQEmu::Constants::SHARED_BANK_END; slot_id++) { for (slot_id=EQEmu::constants::SHARED_BANK_BEGIN; slot_id<=EQEmu::constants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if (inst){ if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory); SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@ -876,7 +876,7 @@ void Client::BulkSendInventoryItems()
// LINKDEAD TRADE ITEMS // LINKDEAD TRADE ITEMS
// If player went LD during a trade, they have items in the trade inventory // If player went LD during a trade, they have items in the trade inventory
// slots. These items are now being put into their inventory (then queue up on cursor) // slots. These items are now being put into their inventory (then queue up on cursor)
for (int16 trade_slot_id=EQEmu::Constants::TRADE_BEGIN; trade_slot_id<=EQEmu::Constants::TRADE_END; trade_slot_id++) { for (int16 trade_slot_id=EQEmu::constants::TRADE_BEGIN; trade_slot_id<=EQEmu::constants::TRADE_END; trade_slot_id++) {
const ItemInst* inst = m_inv[slot_id]; const ItemInst* inst = m_inv[slot_id];
if (inst) { if (inst) {
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size); int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size);

View File

@ -2413,14 +2413,14 @@ void command_texture(Client *c, const Seperator *sep)
// Player Races Wear Armor, so Wearchange is sent instead // Player Races Wear Armor, so Wearchange is sent instead
int i; int i;
if (!c->GetTarget()) if (!c->GetTarget())
for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++) for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++)
{ {
c->SendTextureWC(i, texture); c->SendTextureWC(i, texture);
} }
else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) || else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) ||
c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 || c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 ||
c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) { c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) {
for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++) for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++)
{ {
c->GetTarget()->SendTextureWC(i, texture); c->GetTarget()->SendTextureWC(i, texture);
} }
@ -2545,13 +2545,13 @@ void command_peekinv(Client *c, const Seperator *sep)
const ItemInst* inst_sub = nullptr; const ItemInst* inst_sub = nullptr;
const Item_Struct* item_data = nullptr; const Item_Struct* item_data = nullptr;
std::string item_link; std::string item_link;
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst); linker.SetLinkType(linker.SayLinkItemInst);
c->Message(0, "Displaying inventory for %s...", targetClient->GetName()); c->Message(0, "Displaying inventory for %s...", targetClient->GetName());
// worn // worn
for (int16 indexMain = EQEmu::Constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::Constants::EQUIPMENT_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::constants::EQUIPMENT_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2574,7 +2574,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
// inv // inv
for (int16 indexMain = EQEmu::Constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::Constants::GENERAL_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::constants::GENERAL_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2584,7 +2584,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -2618,7 +2618,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i",
SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -2633,7 +2633,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
// trib // trib
for (int16 indexMain = EQEmu::Constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::Constants::TRIBUTE_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::constants::TRIBUTE_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2645,7 +2645,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
// bank // bank
for (int16 indexMain = EQEmu::Constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::BANK_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::BANK_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2655,7 +2655,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -2667,7 +2667,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
} }
for (int16 indexMain = EQEmu::Constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::SHARED_BANK_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::SHARED_BANK_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2677,7 +2677,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -2690,7 +2690,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
// trade // trade
for (int16 indexMain = EQEmu::Constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::Constants::TRADE_END); ++indexMain) { for (int16 indexMain = EQEmu::constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::constants::TRADE_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain); inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2700,7 +2700,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -2722,7 +2722,7 @@ void command_peekinv(Client *c, const Seperator *sep)
else { else {
c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID()); c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID());
for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::Constants::TYPE_WORLD_SIZE; ++indexMain) { for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::constants::TYPE_WORLD_SIZE; ++indexMain) {
inst_main = objectTradeskill->GetItem(indexMain); inst_main = objectTradeskill->GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main); linker.SetItemInst(inst_main);
@ -2730,9 +2730,9 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink(); item_link = linker.GenerateLink();
c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i", c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i",
(EQEmu::Constants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); (EQEmu::constants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) { for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub); inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub); linker.SetItemInst(inst_sub);
@ -3140,7 +3140,7 @@ void command_listpetition(Client *c, const Seperator *sep)
void command_equipitem(Client *c, const Seperator *sep) void command_equipitem(Client *c, const Seperator *sep)
{ {
uint32 slot_id = atoi(sep->arg[1]); uint32 slot_id = atoi(sep->arg[1]);
if (sep->IsNumber(1) && ((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::Constants::EQUIPMENT_END) || (slot_id == SlotPowerSource))) { if (sep->IsNumber(1) && ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || (slot_id == SlotPowerSource))) {
const ItemInst* from_inst = c->GetInv().GetItem(SlotCursor); const ItemInst* from_inst = c->GetInv().GetItem(SlotCursor);
const ItemInst* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack) const ItemInst* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
bool partialmove = false; bool partialmove = false;
@ -4341,8 +4341,8 @@ void command_iteminfo(Client *c, const Seperator *sep)
c->Message(13, "Error: This item has no data reference"); c->Message(13, "Error: This item has no data reference");
} }
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst); linker.SetLinkType(linker.SayLinkItemInst);
linker.SetItemInst(inst); linker.SetItemInst(inst);
auto item_link = linker.GenerateLink(); auto item_link = linker.GenerateLink();
@ -5491,9 +5491,9 @@ void command_summonitem(Client *c, const Seperator *sep)
std::string cmd_msg = sep->msg; std::string cmd_msg = sep->msg;
size_t link_open = cmd_msg.find('\x12'); size_t link_open = cmd_msg.find('\x12');
size_t link_close = cmd_msg.find_last_of('\x12'); size_t link_close = cmd_msg.find_last_of('\x12');
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
EQEmu::SayLink::SayLinkBody_Struct link_body; EQEmu::saylink::SayLinkBody_Struct link_body;
EQEmu::SayLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::Constants::TEXT_LINK_BODY_LENGTH)); EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::constants::TEXT_LINK_BODY_LENGTH));
itemid = link_body.item_id; itemid = link_body.item_id;
} }
else if (!sep->IsNumber(1)) { else if (!sep->IsNumber(1)) {
@ -5603,8 +5603,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
const Item_Struct* item = nullptr; const Item_Struct* item = nullptr;
std::string item_link; std::string item_link;
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
if (Seperator::IsNumber(search_criteria)) { if (Seperator::IsNumber(search_criteria)) {
item = database.GetItem(atoi(search_criteria)); item = database.GetItem(atoi(search_criteria));
@ -7114,7 +7114,7 @@ void command_path(Client *c, const Seperator *sep)
} }
void Client::Undye() { void Client::Undye() {
for (int cur_slot = EQEmu::Constants::MATERIAL_BEGIN; cur_slot <= EQEmu::Constants::MATERIAL_END; cur_slot++ ) { for (int cur_slot = EQEmu::constants::MATERIAL_BEGIN; cur_slot <= EQEmu::constants::MATERIAL_END; cur_slot++ ) {
uint8 slot2=SlotConvert(cur_slot); uint8 slot2=SlotConvert(cur_slot);
ItemInst* inst = m_inv.GetItem(slot2); ItemInst* inst = m_inv.GetItem(slot2);

View File

@ -328,7 +328,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
// to go into the regular slots on the player, out of bags // to go into the regular slots on the player, out of bags
std::list<uint32> removed_list; std::list<uint32> removed_list;
for(i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++i) { for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) {
if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) { if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) {
item = client->GetInv().GetItem(SlotPowerSource); item = client->GetInv().GetItem(SlotPowerSource);
if (item != nullptr) { if (item != nullptr) {
@ -410,9 +410,9 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s
while (true) { while (true) {
if (!inst->IsType(ItemClassContainer)) { break; } if (!inst->IsType(ItemClassContainer)) { break; }
if (equipSlot < EQEmu::Constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; } if (equipSlot < EQEmu::constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; }
for (auto sub_index = SUB_BEGIN; sub_index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++sub_index) { for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++sub_index) {
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index); int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
auto bag_inst = client->GetInv().GetItem(real_bag_slot); auto bag_inst = client->GetInv().GetItem(real_bag_slot);
if (bag_inst == nullptr) { continue; } if (bag_inst == nullptr) { continue; }
@ -693,7 +693,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
} }
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) { if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_BEGIN); int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_INDEX_BEGIN);
cur = itemlist.begin(); cur = itemlist.begin();
end = itemlist.end(); end = itemlist.end();
@ -985,7 +985,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
if(inst) { if(inst) {
if (item->RecastDelay) if (item->RecastDelay)
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0); inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
client->SendItemPacket(EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot); client->SendItemPacket(EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
safe_delete(inst); safe_delete(inst);
} }
else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); } else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); }
@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
cur = itemlist.begin(); cur = itemlist.begin();
end = itemlist.end(); end = itemlist.end();
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, client->GetClientVersion()); int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
for(; cur != end; ++cur) { for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur; ServerLootItem_Struct* item_data = *cur;
@ -1019,7 +1019,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
if (item->RecastDelay) if (item->RecastDelay)
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0); inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
// SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor // SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor
client->SendItemPacket(i + EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot); client->SendItemPacket(i + EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
safe_delete(inst); safe_delete(inst);
} }
@ -1119,10 +1119,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
item = database.GetItem(GetPlayerKillItem()); item = database.GetItem(GetPlayerKillItem());
} }
else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1){ else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1){
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward
} }
else{ else{
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN, bag_item_data); item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN, bag_item_data);
} }
if (GetPlayerKillItem()<=1 && item_data != 0) { if (GetPlayerKillItem()<=1 && item_data != 0) {
@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
} }
if (inst->IsAugmented()) { if (inst->IsAugmented()) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *itm = inst->GetAugment(i); ItemInst *itm = inst->GetAugment(i);
if (itm) { if (itm) {
if (client->CheckLoreConflict(itm->GetItem())) { if (client->CheckLoreConflict(itm->GetItem())) {
@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
/* Remove Bag Contents */ /* Remove Bag Contents */
if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) { if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
for (int i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) { for (int i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
if (bag_item_data[i]) { if (bag_item_data[i]) {
/* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */ /* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */
database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id); database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id);
@ -1225,8 +1225,8 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
} }
/* Send message with item link to groups and such */ /* Send message with item link to groups and such */
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst); linker.SetLinkType(linker.SayLinkItemInst);
linker.SetItemInst(inst); linker.SetItemInst(inst);
auto item_link = linker.GenerateLink(); auto item_link = linker.GenerateLink();
@ -1294,13 +1294,13 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin(); cur = itemlist.begin();
end = itemlist.end(); end = itemlist.end();
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, to->GetClientVersion()); int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
for(; cur != end; ++cur) { for(; cur != end; ++cur) {
ServerLootItem_Struct* sitem = *cur; ServerLootItem_Struct* sitem = *cur;
if (IsPlayerCorpse()) { if (IsPlayerCorpse()) {
if (sitem->equip_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::Constants::CURSOR_BAG_END) if (sitem->equip_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::constants::CURSOR_BAG_END)
sitem->lootslot = 0xFFFF; sitem->lootslot = 0xFFFF;
else else
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF; x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
@ -1402,7 +1402,7 @@ void Corpse::Spawn() {
uint32 Corpse::GetEquipment(uint8 material_slot) const { uint32 Corpse::GetEquipment(uint8 material_slot) const {
int16 invslot; int16 invslot;
if(material_slot > EQEmu::Constants::MATERIAL_END) { if(material_slot > EQEmu::constants::MATERIAL_END) {
return NO_ITEM; return NO_ITEM;
} }
@ -1416,7 +1416,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
uint32 Corpse::GetEquipmentColor(uint8 material_slot) const { uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
const Item_Struct *item; const Item_Struct *item;
if(material_slot > EQEmu::Constants::MATERIAL_END) { if(material_slot > EQEmu::constants::MATERIAL_END) {
return 0; return 0;
} }
@ -1436,19 +1436,19 @@ void Corpse::UpdateEquipmentLight()
m_Light.Level.Equipment = 0; m_Light.Level.Equipment = 0;
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) { for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
if (((*iter)->equip_slot < EQEmu::Constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::Constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; } if (((*iter)->equip_slot < EQEmu::constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; }
if ((*iter)->equip_slot == SlotAmmo) { continue; } if ((*iter)->equip_slot == SlotAmmo) { continue; }
auto item = database.GetItem((*iter)->item_id); auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; } if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
m_Light.Type.Equipment = item->Light; m_Light.Type.Equipment = item->Light;
} }
uint8 general_light_type = 0; uint8 general_light_type = 0;
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) { for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
if ((*iter)->equip_slot < EQEmu::Constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::Constants::GENERAL_END) { continue; } if ((*iter)->equip_slot < EQEmu::constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::constants::GENERAL_END) { continue; }
auto item = database.GetItem((*iter)->item_id); auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; } if (item == nullptr) { continue; }
@ -1456,14 +1456,14 @@ void Corpse::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; } if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; } if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light)) if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light; general_light_type = item->Light;
} }
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment)) if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type; m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
} }
void Corpse::AddLooter(Mob* who) { void Corpse::AddLooter(Mob* who) {

View File

@ -258,7 +258,7 @@ void Client::GoFish()
Bait = m_inv.GetItem(bslot); Bait = m_inv.GetItem(bslot);
//if the bait isnt equipped, need to add its skill bonus //if the bait isnt equipped, need to add its skill bonus
if (bslot >= EQEmu::Constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) { if (bslot >= EQEmu::constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) {
fishing_skill += Bait->GetItem()->SkillModValue; fishing_skill += Bait->GetItem()->SkillModValue;
} }

View File

@ -35,7 +35,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
int i; int i;
if(where_to_check & invWhereWorn) { if(where_to_check & invWhereWorn) {
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) { for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -75,7 +75,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
DeleteItemInInventory(SlotCursor, 0, true); DeleteItemInInventory(SlotCursor, 0, true);
} }
for (i = EQEmu::Constants::CURSOR_BAG_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) { for (i = EQEmu::constants::CURSOR_BAG_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -90,7 +90,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
if(where_to_check & invWherePersonal) { if(where_to_check & invWherePersonal) {
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -103,7 +103,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
} }
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++) { for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -118,7 +118,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
if(where_to_check & invWhereBank) { if(where_to_check & invWhereBank) {
for (i = EQEmu::Constants::BANK_BEGIN; i <= EQEmu::Constants::BANK_END; i++) { for (i = EQEmu::constants::BANK_BEGIN; i <= EQEmu::constants::BANK_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -131,7 +131,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
} }
for (i = EQEmu::Constants::BANK_BAGS_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END; i++) { for (i = EQEmu::constants::BANK_BAGS_BEGIN; i <= EQEmu::constants::BANK_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -146,7 +146,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
if(where_to_check & invWhereSharedBank) { if(where_to_check & invWhereSharedBank) {
for (i = EQEmu::Constants::SHARED_BANK_BEGIN; i <= EQEmu::Constants::SHARED_BANK_END; i++) { for (i = EQEmu::constants::SHARED_BANK_BEGIN; i <= EQEmu::constants::SHARED_BANK_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -159,7 +159,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
} }
for (i = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::Constants::SHARED_BANK_BAGS_END; i++) { for (i = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::constants::SHARED_BANK_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i); cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) { if(cur && cur->GetItem()->Stackable) {
@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
} }
*/ */
uint32 augments[EQEmu::Constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; uint32 augments[EQEmu::constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 classes = item->Classes; uint32 classes = item->Classes;
uint32 races = item->Races; uint32 races = item->Races;
@ -246,7 +246,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction); bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction);
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability); bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) { for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
const Item_Struct* augtest = database.GetItem(augments[iter]); const Item_Struct* augtest = database.GetItem(augments[iter]);
if(augtest == nullptr) { if(augtest == nullptr) {
@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
} }
// add any validated augments // add any validated augments
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) { for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
if(augments[iter]) if(augments[iter])
inst->PutAugment(&database, iter, augments[iter]); inst->PutAugment(&database, iter, augments[iter]);
} }
@ -583,7 +583,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
DiscoverItem(item_id); DiscoverItem(item_id);
/* /*
// Augments should have been discovered prior to being placed on an item. // Augments should have been discovered prior to being placed on an item.
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) { for (int iter = AUG_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
if(augments[iter] && !IsDiscovered(augments[iter])) if(augments[iter] && !IsDiscovered(augments[iter]))
DiscoverItem(augments[iter]); DiscoverItem(augments[iter]);
} }
@ -761,7 +761,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5); qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
if(m_inv[slot_id]->IsType(ItemClassContainer)) { if(m_inv[slot_id]->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) { for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx); ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx);
if(bagitem) { if(bagitem) {
@ -906,7 +906,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
} }
if (bag_item_data) { if (bag_item_data) {
for (int index = 0; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++index) { for (int index = 0; index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++index) {
if (bag_item_data[index] == nullptr) if (bag_item_data[index] == nullptr)
continue; continue;
@ -951,7 +951,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
return false; return false;
int16 i; int16 i;
uint32 item_id = item->GetItem()->ID; uint32 item_id = item->GetItem()->ID;
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
ItemInst* tmp_inst = m_inv.GetItem(i); ItemInst* tmp_inst = m_inv.GetItem(i);
if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize){ if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize){
MoveItemCharges(*item, i, type); MoveItemCharges(*item, i, type);
@ -962,8 +962,8 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
return true; return true;
} }
} }
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) { for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
uint16 slotid = Inventory::CalcSlotId(i, j); uint16 slotid = Inventory::CalcSlotId(i, j);
ItemInst* tmp_inst = m_inv.GetItem(slotid); ItemInst* tmp_inst = m_inv.GetItem(slotid);
@ -988,8 +988,8 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
// #1: Try to auto equip // #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) { if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) {
// too messy as-is... <watch> // too messy as-is... <watch>
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22) for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::Constants::GENERAL_BEGIN) { if (i == EQEmu::constants::GENERAL_BEGIN) {
// added power source check for SoF+ clients // added power source check for SoF+ clients
if (this->GetClientVersion() >= ClientVersion::SoF) if (this->GetClientVersion() >= ClientVersion::SoF)
i = SlotPowerSource; i = SlotPowerSource;
@ -1318,15 +1318,15 @@ void Client::SendLootItemInPacket(const ItemInst* inst, int16 slot_id)
bool Client::IsValidSlot(uint32 slot) { bool Client::IsValidSlot(uint32 slot) {
if ((slot == (uint32)INVALID_INDEX) || if ((slot == (uint32)INVALID_INDEX) ||
(slot >= SLOT_BEGIN && slot < EQEmu::Constants::TYPE_POSSESSIONS_SIZE) || (slot >= SLOT_BEGIN && slot < EQEmu::constants::TYPE_POSSESSIONS_SIZE) ||
(slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::Constants::CURSOR_BAG_END) || (slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::constants::CURSOR_BAG_END) ||
(slot >= EQEmu::Constants::TRIBUTE_BEGIN && slot <= EQEmu::Constants::TRIBUTE_END) || (slot >= EQEmu::constants::TRIBUTE_BEGIN && slot <= EQEmu::constants::TRIBUTE_END) ||
(slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) || (slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) || (slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) || (slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END) || (slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END) ||
(slot >= EQEmu::Constants::TRADE_BEGIN && slot <= EQEmu::Constants::TRADE_END) || (slot >= EQEmu::constants::TRADE_BEGIN && slot <= EQEmu::constants::TRADE_END) ||
(slot >= EQEmu::Constants::WORLD_BEGIN && slot <= EQEmu::Constants::WORLD_END) || (slot >= EQEmu::constants::WORLD_BEGIN && slot <= EQEmu::constants::WORLD_END) ||
(slot == SlotPowerSource) (slot == SlotPowerSource)
) { ) {
return true; return true;
@ -1338,10 +1338,10 @@ bool Client::IsValidSlot(uint32 slot) {
bool Client::IsBankSlot(uint32 slot) bool Client::IsBankSlot(uint32 slot)
{ {
if ((slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) || if ((slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) || (slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) || (slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END)) (slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END))
{ {
return true; return true;
} }
@ -1475,13 +1475,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
uint32 dstbagid = 0; uint32 dstbagid = 0;
//if (src_slot_id >= 250 && src_slot_id < 330) { //if (src_slot_id >= 250 && src_slot_id < 330) {
if (src_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) { if (src_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
srcbag = m_inv.GetItem(((int)(src_slot_id / 10)) - 3); srcbag = m_inv.GetItem(((int)(src_slot_id / 10)) - 3);
if (srcbag) if (srcbag)
srcbagid = srcbag->GetItem()->ID; srcbagid = srcbag->GetItem()->ID;
} }
//if (dst_slot_id >= 250 && dst_slot_id < 330) { //if (dst_slot_id >= 250 && dst_slot_id < 330) {
if (dst_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) { if (dst_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
dstbag = m_inv.GetItem(((int)(dst_slot_id / 10)) - 3); dstbag = m_inv.GetItem(((int)(dst_slot_id / 10)) - 3);
if (dstbag) if (dstbag)
dstbagid = dstbag->GetItem()->ID; dstbagid = dstbag->GetItem()->ID;
@ -1494,7 +1494,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 2: Validate item in from_slot // Step 2: Validate item in from_slot
// After this, we can assume src_inst is a valid ptr // After this, we can assume src_inst is a valid ptr
if (!src_inst && (src_slot_id < EQEmu::Constants::WORLD_BEGIN || src_slot_id > EQEmu::Constants::WORLD_END)) { if (!src_inst && (src_slot_id < EQEmu::constants::WORLD_BEGIN || src_slot_id > EQEmu::constants::WORLD_END)) {
if (dst_inst) { if (dst_inst) {
// If there is no source item, but there is a destination item, // If there is no source item, but there is a destination item,
// move the slots around before deleting the invalid source slot item, // move the slots around before deleting the invalid source slot item,
@ -1508,14 +1508,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return false; return false;
} }
//verify shared bank transactions in the database //verify shared bank transactions in the database
if(src_inst && src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) { if(src_inst && src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
DeleteItemInInventory(dst_slot_id,0,true); DeleteItemInInventory(dst_slot_id,0,true);
return(false); return(false);
} }
if(src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){ if(src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) { for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = src_inst->GetItem(idx); const ItemInst* baginst = src_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){ if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false); DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
@ -1523,14 +1523,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
} }
} }
if(dst_inst && dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) { if(dst_inst && dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
DeleteItemInInventory(src_slot_id,0,true); DeleteItemInInventory(src_slot_id,0,true);
return(false); return(false);
} }
if(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){ if(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) { for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = dst_inst->GetItem(idx); const ItemInst* baginst = dst_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){ if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false); DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
@ -1542,8 +1542,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Check for No Drop Hacks // Check for No Drop Hacks
Mob* with = trade->With(); Mob* with = trade->With();
if (((with && with->IsClient() && dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) || if (((with && with->IsClient() && dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) ||
(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END)) (dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END))
&& GetInv().CheckNoDrop(src_slot_id) && GetInv().CheckNoDrop(src_slot_id)
&& RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) { && RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) {
auto ndh_inst = m_inv[src_slot_id]; auto ndh_inst = m_inv[src_slot_id];
@ -1573,7 +1573,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 3: Check for interaction with World Container (tradeskills) // Step 3: Check for interaction with World Container (tradeskills)
if(m_tradeskill_object != nullptr) { if(m_tradeskill_object != nullptr) {
if (src_slot_id >= EQEmu::Constants::WORLD_BEGIN && src_slot_id <= EQEmu::Constants::WORLD_END) { if (src_slot_id >= EQEmu::constants::WORLD_BEGIN && src_slot_id <= EQEmu::constants::WORLD_END) {
// Picking up item from world container // Picking up item from world container
ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id)); ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id));
if (inst) { if (inst) {
@ -1585,7 +1585,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return true; return true;
} }
else if (dst_slot_id >= EQEmu::Constants::WORLD_BEGIN && dst_slot_id <= EQEmu::Constants::WORLD_END) { else if (dst_slot_id >= EQEmu::constants::WORLD_BEGIN && dst_slot_id <= EQEmu::constants::WORLD_END) {
// Putting item into world container, which may swap (or pile onto) with existing item // Putting item into world container, which may swap (or pile onto) with existing item
uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id); uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id);
ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx); ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx);
@ -1658,7 +1658,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
// Step 4: Check for entity trade // Step 4: Check for entity trade
if (dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) { if (dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) {
if (src_slot_id != SlotCursor) { if (src_slot_id != SlotCursor) {
Kick(); Kick();
return false; return false;
@ -1751,12 +1751,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
else { else {
// Not dealing with charges - just do direct swap // Not dealing with charges - just do direct swap
if(src_inst && (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) { if(src_inst && (dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) {
if (src_inst->GetItem()->Attuneable) { if (src_inst->GetItem()->Attuneable) {
src_inst->SetAttuned(true); src_inst->SetAttuned(true);
} }
if (src_inst->IsAugmented()) { if (src_inst->IsAugmented()) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (src_inst->GetAugment(i)) { if (src_inst->GetAugment(i)) {
if (src_inst->GetAugment(i)->GetItem()->Attuneable) { if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
src_inst->GetAugment(i)->SetAttuned(true); src_inst->GetAugment(i)->SetAttuned(true);
@ -1769,7 +1769,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
if(src_slot_id <= EQEmu::Constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) { if(src_slot_id <= EQEmu::constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) {
if(src_inst) { if(src_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id); parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
} }
@ -1779,7 +1779,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
} }
if(dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) { if(dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) {
if(dst_inst) { if(dst_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id); parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
} }
@ -1791,7 +1791,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
int matslot = SlotConvert2(dst_slot_id); int matslot = SlotConvert2(dst_slot_id);
if (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm if (dst_slot_id <= EQEmu::constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm
SendWearChange(matslot); SendWearChange(matslot);
} }
@ -1833,7 +1833,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
Message(15, "Inventory Desyncronization detected: Resending slot data..."); Message(15, "Inventory Desyncronization detected: Resending slot data...");
if((move_slots->from_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) { if((move_slots->from_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot); int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
// This prevents the client from crashing when closing any 'phantom' bags // This prevents the client from crashing when closing any 'phantom' bags
@ -1876,7 +1876,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); } else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
} }
if((move_slots->to_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) { if((move_slots->to_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot); int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
@ -1957,7 +1957,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5); qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
if(from_inst->IsType(ItemClassContainer)) { if(from_inst->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) { for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* from_baginst = from_inst->GetItem(bag_idx); const ItemInst* from_baginst = from_inst->GetItem(bag_idx);
if(from_baginst) { if(from_baginst) {
@ -1990,7 +1990,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5); qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
if(to_inst->IsType(ItemClassContainer)) { if(to_inst->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) { for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* to_baginst = to_inst->GetItem(bag_idx); const ItemInst* to_baginst = to_inst->GetItem(bag_idx);
if(to_baginst) { if(to_baginst) {
@ -2019,7 +2019,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
void Client::DyeArmor(DyeStruct* dye){ void Client::DyeArmor(DyeStruct* dye){
int16 slot=0; int16 slot=0;
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++) { for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) {
if ((m_pp.item_tint[i].Color & 0x00FFFFFF) != (dye->dye[i].Color & 0x00FFFFFF)) { if ((m_pp.item_tint[i].Color & 0x00FFFFFF) != (dye->dye[i].Color & 0x00FFFFFF)) {
slot = m_inv.HasItem(32557, 1, invWherePersonal); slot = m_inv.HasItem(32557, 1, invWherePersonal);
if (slot != INVALID_INDEX){ if (slot != INVALID_INDEX){
@ -2058,7 +2058,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
const Item_Struct* TempItem = 0; const Item_Struct* TempItem = 0;
ItemInst* ins; ItemInst* ins;
int x; int x;
for(x=EQEmu::Constants::POSSESSIONS_BEGIN; x <= EQEmu::Constants::POSSESSIONS_END; x++) for(x=EQEmu::constants::POSSESSIONS_BEGIN; x <= EQEmu::constants::POSSESSIONS_END; x++)
{ {
TempItem = 0; TempItem = 0;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
@ -2080,7 +2080,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
return true; return true;
} }
} }
for(x=EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) for(x=EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
{ {
TempItem = 0; TempItem = 0;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
@ -2111,10 +2111,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
ItemInst* ins = nullptr; ItemInst* ins = nullptr;
int x; int x;
int num = 0; int num = 0;
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
{ {
if (x == SlotCursor + 1) if (x == SlotCursor + 1)
x = EQEmu::Constants::GENERAL_BAGS_BEGIN; x = EQEmu::constants::GENERAL_BAGS_BEGIN;
TempItem = nullptr; TempItem = nullptr;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
if (ins) if (ins)
@ -2128,10 +2128,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
} }
if (num < amt) if (num < amt)
return false; return false;
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END? for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
{ {
if (x == SlotCursor + 1) if (x == SlotCursor + 1)
x = EQEmu::Constants::GENERAL_BAGS_BEGIN; x = EQEmu::constants::GENERAL_BAGS_BEGIN;
TempItem = nullptr; TempItem = nullptr;
ins = GetInv().GetItem(x); ins = GetInv().GetItem(x);
if (ins) if (ins)
@ -2227,7 +2227,7 @@ static bool CopyBagContents(ItemInst* new_bag, const ItemInst* old_bag)
void Client::DisenchantSummonedBags(bool client_update) void Client::DisenchantSummonedBags(bool client_update)
{ {
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) { for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if (!inst) { continue; } if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@ -2248,7 +2248,7 @@ void Client::DisenchantSummonedBags(bool client_update)
safe_delete(new_inst); safe_delete(new_inst);
} }
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) { for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if (!inst) { continue; } if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@ -2269,7 +2269,7 @@ void Client::DisenchantSummonedBags(bool client_update)
safe_delete(new_inst); safe_delete(new_inst);
} }
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) { for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if (!inst) { continue; } if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@ -2338,7 +2338,7 @@ void Client::DisenchantSummonedBags(bool client_update)
void Client::RemoveNoRent(bool client_update) void Client::RemoveNoRent(bool client_update)
{ {
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) { for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2346,7 +2346,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) { for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if (inst && !inst->GetItem()->NoRent) { if (inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2362,7 +2362,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) { for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2370,7 +2370,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) { for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2378,7 +2378,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) { for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2386,7 +2386,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) { for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2394,7 +2394,7 @@ void Client::RemoveNoRent(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END; ++slot_id) { for (auto slot_id = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END; ++slot_id) {
auto inst = m_inv[slot_id]; auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) { if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@ -2432,7 +2432,7 @@ void Client::RemoveNoRent(bool client_update)
// Two new methods to alleviate perpetual login desyncs // Two new methods to alleviate perpetual login desyncs
void Client::RemoveDuplicateLore(bool client_update) void Client::RemoveDuplicateLore(bool client_update)
{ {
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) { for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) { if(CheckLoreConflict(inst->GetItem())) {
@ -2445,7 +2445,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst); safe_delete(inst);
} }
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) { for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
if (CheckLoreConflict(inst->GetItem())) { if (CheckLoreConflict(inst->GetItem())) {
@ -2472,7 +2472,7 @@ void Client::RemoveDuplicateLore(bool client_update)
} }
} }
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) { for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) { if(CheckLoreConflict(inst->GetItem())) {
@ -2485,7 +2485,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst); safe_delete(inst);
} }
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) { for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) { if(CheckLoreConflict(inst->GetItem())) {
@ -2498,7 +2498,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst); safe_delete(inst);
} }
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) { for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) { if(CheckLoreConflict(inst->GetItem())) {
@ -2559,7 +2559,7 @@ void Client::RemoveDuplicateLore(bool client_update)
void Client::MoveSlotNotAllowed(bool client_update) void Client::MoveSlotNotAllowed(bool client_update)
{ {
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) { for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) { if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
auto inst = m_inv.PopItem(slot_id); auto inst = m_inv.PopItem(slot_id);
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
@ -2591,7 +2591,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
int16 invslot; int16 invslot;
const ItemInst *item; const ItemInst *item;
if(material_slot > EQEmu::Constants::MATERIAL_END) if(material_slot > EQEmu::constants::MATERIAL_END)
{ {
return 0; return 0;
} }
@ -2629,7 +2629,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot)
uint32 Client::GetEquipmentColor(uint8 material_slot) const uint32 Client::GetEquipmentColor(uint8 material_slot) const
{ {
if (material_slot > EQEmu::Constants::MATERIAL_END) if (material_slot > EQEmu::constants::MATERIAL_END)
return 0; return 0;
const Item_Struct *item = database.GetItem(GetEquipment(material_slot)); const Item_Struct *item = database.GetItem(GetEquipment(material_slot));
@ -2780,7 +2780,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
slot = SlotCursor; slot = SlotCursor;
} }
else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) { else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) {
for(int16 CursorBagSlot = EQEmu::Constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::Constants::CURSOR_BAG_END; CursorBagSlot++) { for(int16 CursorBagSlot = EQEmu::constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::constants::CURSOR_BAG_END; CursorBagSlot++) {
if (m_inv.GetItem(CursorBagSlot)) { if (m_inv.GetItem(CursorBagSlot)) {
if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID && if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
m_inv.GetItem(CursorBagSlot)->GetCharges() >= 1) { // ditto m_inv.GetItem(CursorBagSlot)->GetCharges() >= 1) { // ditto
@ -2926,7 +2926,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
// //
if(ItemToReturn->IsStackable()) { if(ItemToReturn->IsStackable()) {
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving. for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
ItemInst* InvItem = m_inv.GetItem(i); ItemInst* InvItem = m_inv.GetItem(i);
@ -2952,12 +2952,12 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
// //
if (InvItem && InvItem->IsType(ItemClassContainer)) { if (InvItem && InvItem->IsType(ItemClassContainer)) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN); int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots; uint8 BagSize=InvItem->GetItem()->BagSlots;
uint8 BagSlot; uint8 BagSlot;
for (BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) { for (BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot); InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
if (InvItem && (InvItem->GetItem()->ID == ItemID) && if (InvItem && (InvItem->GetItem()->ID == ItemID) &&
(InvItem->GetCharges() < InvItem->GetItem()->StackSize)) { (InvItem->GetCharges() < InvItem->GetItem()->StackSize)) {
@ -2985,7 +2985,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
// We have tried stacking items, now just try and find an empty slot. // We have tried stacking items, now just try and find an empty slot.
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor. for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
ItemInst* InvItem = m_inv.GetItem(i); ItemInst* InvItem = m_inv.GetItem(i);
@ -3004,11 +3004,11 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
} }
if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) { if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN); int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots; uint8 BagSize=InvItem->GetItem()->BagSlots;
for (uint8 BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) { for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot); InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
@ -3046,27 +3046,27 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
std::map<int16, const ItemInst*> instmap; std::map<int16, const ItemInst*> instmap;
// build reference map // build reference map
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++index) { for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++index) {
auto inst = m_inv[index]; auto inst = m_inv[index];
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[index] = inst; instmap[index] = inst;
} }
for (int16 index = EQEmu::Constants::TRIBUTE_BEGIN; index <= EQEmu::Constants::TRIBUTE_END; ++index) { for (int16 index = EQEmu::constants::TRIBUTE_BEGIN; index <= EQEmu::constants::TRIBUTE_END; ++index) {
auto inst = m_inv[index]; auto inst = m_inv[index];
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[index] = inst; instmap[index] = inst;
} }
for (int16 index = EQEmu::Constants::BANK_BEGIN; index <= EQEmu::Constants::BANK_END; ++index) { for (int16 index = EQEmu::constants::BANK_BEGIN; index <= EQEmu::constants::BANK_END; ++index) {
auto inst = m_inv[index]; auto inst = m_inv[index];
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[index] = inst; instmap[index] = inst;
} }
for (int16 index = EQEmu::Constants::SHARED_BANK_BEGIN; index <= EQEmu::Constants::SHARED_BANK_END; ++index) { for (int16 index = EQEmu::constants::SHARED_BANK_BEGIN; index <= EQEmu::constants::SHARED_BANK_END; ++index) {
auto inst = m_inv[index]; auto inst = m_inv[index];
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[index] = inst; instmap[index] = inst;
} }
for (int16 index = EQEmu::Constants::TRADE_BEGIN; index <= EQEmu::Constants::TRADE_END; ++index) { for (int16 index = EQEmu::constants::TRADE_BEGIN; index <= EQEmu::constants::TRADE_END; ++index) {
auto inst = m_inv[index]; auto inst = m_inv[index];
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[index] = inst; instmap[index] = inst;
@ -3074,10 +3074,10 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
auto tsobject = GetTradeskillObject(); auto tsobject = GetTradeskillObject();
if (tsobject != nullptr) { if (tsobject != nullptr) {
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_WORLD_SIZE; ++index) { for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_WORLD_SIZE; ++index) {
auto inst = tsobject->GetItem(index); auto inst = tsobject->GetItem(index);
if (inst == nullptr) { continue; } if (inst == nullptr) { continue; }
instmap[EQEmu::Constants::WORLD_BEGIN + index] = inst; instmap[EQEmu::constants::WORLD_BEGIN + index] = inst;
} }
} }
@ -3149,7 +3149,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
} }
else { else {
if (inst) { if (inst) {
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available
if (inst->GetItem(sub)) if (inst->GetItem(sub))
InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1); InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
} }
@ -3179,7 +3179,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
} }
if (inst) { if (inst) {
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub) { for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub) {
if (inst->GetItem(sub)) if (inst->GetItem(sub))
InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1); InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
} }
@ -3194,9 +3194,9 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
// very basic error checking - can be elaborated upon if more in-depth testing is needed... // very basic error checking - can be elaborated upon if more in-depth testing is needed...
if ( if (
(head >= EQEmu::Constants::EQUIPMENT_BEGIN && head <= EQEmu::Constants::EQUIPMENT_END) || (head >= EQEmu::constants::EQUIPMENT_BEGIN && head <= EQEmu::constants::EQUIPMENT_END) ||
(head >= EQEmu::Constants::TRIBUTE_BEGIN && head <= EQEmu::Constants::TRIBUTE_END) || (head >= EQEmu::constants::TRIBUTE_BEGIN && head <= EQEmu::constants::TRIBUTE_END) ||
(head >= EQEmu::Constants::WORLD_BEGIN && head <= EQEmu::Constants::WORLD_END) || (head >= EQEmu::constants::WORLD_BEGIN && head <= EQEmu::constants::WORLD_END) ||
(head >= 8000 && head <= 8101) || (head >= 8000 && head <= 8101) ||
(head == SlotPowerSource)) { (head == SlotPowerSource)) {
switch (depth) switch (depth)
@ -3210,7 +3210,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
return true; return true;
if (!parent->IsType(ItemClassCommon)) if (!parent->IsType(ItemClassCommon))
return true; return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE) if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true; return true;
break; break;
default: // requirement: none (something bad happened...) default: // requirement: none (something bad happened...)
@ -3218,11 +3218,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
} }
} }
else if ( else if (
(head >= EQEmu::Constants::GENERAL_BEGIN && head <= EQEmu::Constants::GENERAL_END) || (head >= EQEmu::constants::GENERAL_BEGIN && head <= EQEmu::constants::GENERAL_END) ||
(head == SlotCursor) || (head == SlotCursor) ||
(head >= EQEmu::Constants::BANK_BEGIN && head <= EQEmu::Constants::BANK_END) || (head >= EQEmu::constants::BANK_BEGIN && head <= EQEmu::constants::BANK_END) ||
(head >= EQEmu::Constants::SHARED_BANK_BEGIN && head <= EQEmu::Constants::SHARED_BANK_END) || (head >= EQEmu::constants::SHARED_BANK_BEGIN && head <= EQEmu::constants::SHARED_BANK_END) ||
(head >= EQEmu::Constants::TRADE_BEGIN && head <= EQEmu::Constants::TRADE_END)) { (head >= EQEmu::constants::TRADE_BEGIN && head <= EQEmu::constants::TRADE_END)) {
switch (depth) switch (depth)
{ {
case 0: // requirement: inst is extant case 0: // requirement: inst is extant
@ -3239,7 +3239,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
if (parent->IsType(ItemClassCommon)) { if (parent->IsType(ItemClassCommon)) {
if (!(inst->GetItem()->AugType > 0)) if (!(inst->GetItem()->AugType > 0))
return true; return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE) if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true; return true;
} }
break; break;
@ -3253,7 +3253,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
if (parent->IsType(ItemClassCommon)) { if (parent->IsType(ItemClassCommon)) {
if (!(inst->GetItem()->AugType > 0)) if (!(inst->GetItem()->AugType > 0))
return true; return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE) if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true; return true;
} }
break; break;

View File

@ -272,7 +272,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
// it is an improvement. // it is an improvement.
if (!item2->NoPet) { if (!item2->NoPet) {
for (int i = 0; !found && i < EQEmu::Constants::EQUIPMENT_SIZE; i++) { for (int i = 0; !found && i < EQEmu::constants::EQUIPMENT_SIZE; i++) {
uint32 slots = (1 << i); uint32 slots = (1 << i);
if (item2->Slots & slots) { if (item2->Slots & slots) {
if(equipment[i]) if(equipment[i])

View File

@ -1794,13 +1794,13 @@ luabind::scope lua_register_slot() {
luabind::value("General7", static_cast<int>(SlotGeneral7)), luabind::value("General7", static_cast<int>(SlotGeneral7)),
luabind::value("General8", static_cast<int>(SlotGeneral8)), luabind::value("General8", static_cast<int>(SlotGeneral8)),
luabind::value("Cursor", static_cast<int>(SlotCursor)), luabind::value("Cursor", static_cast<int>(SlotCursor)),
luabind::value("PersonalBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)), // deprecated luabind::value("PersonalBegin", static_cast<int>(EQEmu::constants::GENERAL_BEGIN)), // deprecated
luabind::value("GeneralBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)), luabind::value("GeneralBegin", static_cast<int>(EQEmu::constants::GENERAL_BEGIN)),
luabind::value("PersonalEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)), // deprecated luabind::value("PersonalEnd", static_cast<int>(EQEmu::constants::GENERAL_END)), // deprecated
luabind::value("GeneralEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)), luabind::value("GeneralEnd", static_cast<int>(EQEmu::constants::GENERAL_END)),
luabind::value("CursorEnd", 0xFFFE), // deprecated luabind::value("CursorEnd", 0xFFFE), // deprecated
luabind::value("Tradeskill", static_cast<int>(EQEmu::Legacy::SLOT_TRADESKILL)), // deprecated luabind::value("Tradeskill", static_cast<int>(EQEmu::legacy::SLOT_TRADESKILL)), // deprecated
luabind::value("Augment", static_cast<int>(EQEmu::Legacy::SLOT_AUGMENT)), // deprecated luabind::value("Augment", static_cast<int>(EQEmu::legacy::SLOT_AUGMENT)), // deprecated
luabind::value("Invalid", INVALID_INDEX) luabind::value("Invalid", INVALID_INDEX)
]; ];
} }

View File

@ -2552,7 +2552,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
int16 focus_max_real = 0; int16 focus_max_real = 0;
//item focus //item focus
for (int x = 0; x < EQEmu::Constants::EQUIPMENT_SIZE; ++x) for (int x = 0; x < EQEmu::constants::EQUIPMENT_SIZE; ++x)
{ {
TempItem = nullptr; TempItem = nullptr;
if (equipment[x] == 0) if (equipment[x] == 0)
@ -5026,7 +5026,7 @@ void Merc::UpdateMercAppearance() {
// Copied from Bot Code: // Copied from Bot Code:
uint32 itemID = NO_ITEM; uint32 itemID = NO_ITEM;
uint8 materialFromSlot = MaterialInvalid; uint8 materialFromSlot = MaterialInvalid;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
itemID = equipment[i]; itemID = equipment[i];
if(itemID != NO_ITEM) { if(itemID != NO_ITEM) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i); materialFromSlot = Inventory::CalcMaterialFromSlot(i);
@ -5044,15 +5044,15 @@ void Merc::UpdateEquipmentLight()
m_Light.Type.Equipment = 0; m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0; m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) { for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; } if (index == SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]); auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; } if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) { if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light; m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
} }
} }
@ -5064,14 +5064,14 @@ void Merc::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; } if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; } if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light)) if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light; general_light_type = item->Light;
} }
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment)) if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type; m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
} }
void Merc::AddItem(uint8 slot, uint32 item_id) { void Merc::AddItem(uint8 slot, uint32 item_id) {

View File

@ -288,7 +288,7 @@ protected:
std::map<uint32,MercTimer> timers; std::map<uint32,MercTimer> timers;
uint16 skills[HIGHEST_SKILL+1]; uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EQEmu::Constants::EQUIPMENT_SIZE]; //this is an array of item IDs uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint16 d_melee_texture1; //this is an item Material value uint16 d_melee_texture1; //this is an item Material value
uint16 d_melee_texture2; //this is an item Material value (offhand) uint16 d_melee_texture2; //this is an item Material value (offhand)
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation

View File

@ -179,7 +179,7 @@ Mob::Mob(const char* in_name,
runspeed = 1.25f; runspeed = 1.25f;
m_Light.Type.Innate = in_light; m_Light.Type.Innate = in_light;
m_Light.Level.Innate = EQEmu::LightSource::TypeToLevel(m_Light.Type.Innate); m_Light.Level.Innate = EQEmu::lightsource::TypeToLevel(m_Light.Type.Innate);
m_Light.Level.Equipment = m_Light.Type.Equipment = 0; m_Light.Level.Equipment = m_Light.Type.Equipment = 0;
m_Light.Level.Spell = m_Light.Type.Spell = 0; m_Light.Level.Spell = m_Light.Type.Spell = 0;
m_Light.Type.Active = m_Light.Type.Innate; m_Light.Type.Active = m_Light.Type.Innate;
@ -2232,11 +2232,11 @@ bool Mob::UpdateActiveLight()
m_Light.Type.Active = 0; m_Light.Type.Active = 0;
m_Light.Level.Active = 0; m_Light.Level.Active = 0;
if (EQEmu::LightSource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; } if (EQEmu::lightsource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
if (m_Light.Level.Equipment > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Equipment; } // limiter in property handler if (m_Light.Level.Equipment > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Equipment; } // limiter in property handler
if (m_Light.Level.Spell > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Spell; } // limiter in property handler if (m_Light.Level.Spell > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Spell; } // limiter in property handler
m_Light.Level.Active = EQEmu::LightSource::TypeToLevel(m_Light.Type.Active); m_Light.Level.Active = EQEmu::lightsource::TypeToLevel(m_Light.Type.Active);
return (m_Light.Level.Active != old_light_level); return (m_Light.Level.Active != old_light_level);
} }

View File

@ -364,7 +364,7 @@ public:
virtual inline uint16 GetBaseRace() const { return base_race; } virtual inline uint16 GetBaseRace() const { return base_race; }
virtual inline uint8 GetBaseGender() const { return base_gender; } virtual inline uint8 GetBaseGender() const { return base_gender; }
virtual inline uint16 GetDeity() const { return deity; } virtual inline uint16 GetDeity() const { return deity; }
virtual inline EQEmu::Deity::TypeBits GetDeityBit() { return EQEmu::Deity::ConvertDeityToDeityBit((EQEmu::Deity::Types)deity); } virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityToDeityBit((EQEmu::deity::DeityType)deity); }
inline uint16 GetRace() const { return race; } inline uint16 GetRace() const { return race; }
inline uint8 GetGender() const { return gender; } inline uint8 GetGender() const { return gender; }
inline uint8 GetTexture() const { return texture; } inline uint8 GetTexture() const { return texture; }
@ -708,12 +708,12 @@ public:
inline uint8 GetSpellLightType() { return m_Light.Type.Spell; } inline uint8 GetSpellLightType() { return m_Light.Type.Spell; }
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; } virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; }
inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::LightSource::TypeToLevel(m_Light.Type.Spell); } inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::lightsource::TypeToLevel(m_Light.Type.Spell); }
inline uint8 GetActiveLightType() { return m_Light.Type.Active; } inline uint8 GetActiveLightType() { return m_Light.Type.Active; }
bool UpdateActiveLight(); // returns true if change, false if no change bool UpdateActiveLight(); // returns true if change, false if no change
EQEmu::LightSource::impl* GetLightProfile() { return &m_Light; } EQEmu::lightsource::LightSourceProfile* GetLightProfile() { return &m_Light; }
Mob* GetPet(); Mob* GetPet();
void SetPet(Mob* newpet); void SetPet(Mob* newpet);
@ -1185,7 +1185,7 @@ protected:
glm::vec4 m_Delta; glm::vec4 m_Delta;
EQEmu::LightSource::impl m_Light; EQEmu::lightsource::LightSourceProfile m_Light;
float fixedZ; float fixedZ;
EmuAppearance _appearance; EmuAppearance _appearance;

View File

@ -529,8 +529,8 @@ void NPC::QueryLoot(Client* to)
continue; continue;
} }
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item); linker.SetItemData(item);
auto item_link = linker.GenerateLink(); auto item_link = linker.GenerateLink();
@ -748,15 +748,15 @@ void NPC::UpdateEquipmentLight()
m_Light.Type.Equipment = 0; m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0; m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) { for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; } if (index == SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]); auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; } if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) { if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light; m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
} }
} }
@ -768,14 +768,14 @@ void NPC::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; } if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; } if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light)) if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light; general_light_type = item->Light;
} }
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment)) if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type; m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
} }
void NPC::Depop(bool StartSpawnTimer) { void NPC::Depop(bool StartSpawnTimer) {

View File

@ -495,7 +495,7 @@ protected:
uint16 skills[HIGHEST_SKILL+1]; uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EQEmu::Constants::EQUIPMENT_SIZE]; //this is an array of item IDs uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint32 herosforgemodel; //this is the Hero Forge Armor Model (i.e 63 or 84 or 203) uint32 herosforgemodel; //this is the Hero Forge Armor Model (i.e 63 or 84 or 203)
uint16 d_melee_texture1; //this is an item Material value uint16 d_melee_texture1; //this is an item Material value

View File

@ -324,7 +324,7 @@ void Object::Delete(bool reset_state)
} }
const ItemInst* Object::GetItem(uint8 index) { const ItemInst* Object::GetItem(uint8 index) {
if (index < EQEmu::Constants::TYPE_WORLD_SIZE) { if (index < EQEmu::constants::TYPE_WORLD_SIZE) {
return m_inst->GetItem(index); return m_inst->GetItem(index);
} }
@ -362,7 +362,7 @@ void Object::Close() {
ItemInst* container = this->m_inst; ItemInst* container = this->m_inst;
if(container != nullptr) if(container != nullptr)
{ {
for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++)
{ {
ItemInst* inst = container->PopItem(i); ItemInst* inst = container->PopItem(i);
if(inst != nullptr) if(inst != nullptr)
@ -583,7 +583,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
EQApplicationPacket* outapp=new EQApplicationPacket(OP_ClientReady,0); EQApplicationPacket* outapp=new EQApplicationPacket(OP_ClientReady,0);
sender->QueuePacket(outapp); sender->QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);
for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) { for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
const ItemInst* inst = m_inst->GetItem(i); const ItemInst* inst = m_inst->GetItem(i);
if (inst) { if (inst) {
//sender->GetInv().PutItem(i+4000,inst); //sender->GetInv().PutItem(i+4000,inst);

View File

@ -417,12 +417,12 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
// the base items for the pet. These are always loaded // the base items for the pet. These are always loaded
// so that a rank 1 suspend minion does not kill things // so that a rank 1 suspend minion does not kill things
// like the special back items some focused pets may receive. // like the special back items some focused pets may receive.
uint32 petinv[EQEmu::Constants::EQUIPMENT_SIZE]; uint32 petinv[EQEmu::constants::EQUIPMENT_SIZE];
memset(petinv, 0, sizeof(petinv)); memset(petinv, 0, sizeof(petinv));
const Item_Struct *item = 0; const Item_Struct *item = 0;
if (database.GetBasePetItems(record.equipmentset, petinv)) { if (database.GetBasePetItems(record.equipmentset, petinv)) {
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++) for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++)
if (petinv[i]) { if (petinv[i]) {
item = database.GetItem(petinv[i]); item = database.GetItem(petinv[i]);
npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true); npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true);
@ -572,7 +572,7 @@ void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) {
strn0cpy(name, GetName(), 64); strn0cpy(name, GetName(), 64);
//save their items, we only care about what they are actually wearing //save their items, we only care about what they are actually wearing
memcpy(items, equipment, sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE); memcpy(items, equipment, sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE);
//save their buffs. //save their buffs.
for (int i=0; i < GetPetMaxTotalSlots(); i++) { for (int i=0; i < GetPetMaxTotalSlots(); i++) {
@ -660,7 +660,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
} }
//restore their equipment... //restore their equipment...
for (i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++) { for (i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++) {
if(items[i] == 0) if(items[i] == 0)
continue; continue;
@ -722,7 +722,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
{ {
slot = atoi(row[0]); slot = atoi(row[0]);
if (slot >= EQEmu::Constants::EQUIPMENT_SIZE) if (slot >= EQEmu::constants::EQUIPMENT_SIZE)
continue; continue;
if (items[slot] == 0) if (items[slot] == 0)

View File

@ -1307,8 +1307,8 @@ void QuestManager::itemlink(int item_id) {
if (item == nullptr) if (item == nullptr)
return; return;
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item); linker.SetItemData(item);
auto item_link = linker.GenerateLink(); auto item_link = linker.GenerateLink();
@ -2441,12 +2441,12 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
int quantity = 0; int quantity = 0;
int slot_id; int slot_id;
for (slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) for (slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id)
{ {
quantity += collectitems_processSlot(slot_id, item_id, remove); quantity += collectitems_processSlot(slot_id, item_id, remove);
} }
for (slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::GENERAL_BAGS_END; ++slot_id) for (slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::GENERAL_BAGS_END; ++slot_id)
{ {
quantity += collectitems_processSlot(slot_id, item_id, remove); quantity += collectitems_processSlot(slot_id, item_id, remove);
} }
@ -2535,8 +2535,8 @@ const char* QuestManager::varlink(char* perltext, int item_id) {
if (!item) if (!item)
return "INVALID ITEM ID IN VARLINK"; return "INVALID ITEM ID IN VARLINK";
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item); linker.SetItemData(item);
auto item_link = linker.GenerateLink(); auto item_link = linker.GenerateLink();
@ -2761,7 +2761,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam
safe_delete_array(escaped_string); safe_delete_array(escaped_string);
//Create the say link as an item link hash //Create the say link as an item link hash
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetProxyItemID(SAYLINK_ITEM_ID); linker.SetProxyItemID(SAYLINK_ITEM_ID);
if (silent) if (silent)
linker.SetProxyAugment2ID(sayid); linker.SetProxyAugment2ID(sayid);

View File

@ -596,7 +596,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
if(wpn) { if(wpn) {
primaryweapondamage = GetWeaponDamage(other, wpn); primaryweapondamage = GetWeaponDamage(other, wpn);
backstab_dmg = wpn->GetItem()->BackstabDmg; backstab_dmg = wpn->GetItem()->BackstabDmg;
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; ++i) for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i)
{ {
ItemInst *aug = wpn->GetAugment(i); ItemInst *aug = wpn->GetAugment(i);
if(aug) if(aug)
@ -729,7 +729,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
//first look for quivers //first look for quivers
int r; int r;
bool found = false; bool found = false;
for(r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::GENERAL_END; r++) { for(r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) {
const ItemInst *pi = m_inv[r]; const ItemInst *pi = m_inv[r];
if(pi == nullptr || !pi->IsType(ItemClassContainer)) if(pi == nullptr || !pi->IsType(ItemClassContainer))
continue; continue;

View File

@ -1429,7 +1429,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
} }
} }
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++) for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++)
SendWearChange(x); SendWearChange(x);
if (caster == this && if (caster == this &&
@ -1455,7 +1455,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
); );
caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize())); caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize()));
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++) for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++)
caster->SendWearChange(x); caster->SendWearChange(x);
} }
} }
@ -3809,7 +3809,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
else{ else{
SendAppearancePacket(AT_Size, 6); SendAppearancePacket(AT_Size, 6);
} }
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++){ for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++){
SendWearChange(x); SendWearChange(x);
} }
break; break;
@ -5126,7 +5126,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
const Item_Struct* TempItem = 0; const Item_Struct* TempItem = 0;
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++)
{ {
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS) if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
continue; continue;
@ -5146,7 +5146,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
} }
} }
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y) for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
{ {
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS) if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
continue; continue;
@ -5261,7 +5261,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
int16 focus_max_real = 0; int16 focus_max_real = 0;
//item focus //item focus
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++)
{ {
TempItem = nullptr; TempItem = nullptr;
ItemInst* ins = GetInv().GetItem(x); ItemInst* ins = GetInv().GetItem(x);
@ -5295,7 +5295,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
} }
} }
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y) for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
{ {
ItemInst *aug = nullptr; ItemInst *aug = nullptr;
aug = ins->GetAugment(y); aug = ins->GetAugment(y);
@ -5333,7 +5333,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
} }
//Tribute Focus //Tribute Focus
for (int x = EQEmu::Constants::TRIBUTE_BEGIN; x <= EQEmu::Constants::TRIBUTE_END; ++x) for (int x = EQEmu::constants::TRIBUTE_BEGIN; x <= EQEmu::constants::TRIBUTE_END; ++x)
{ {
TempItem = nullptr; TempItem = nullptr;
ItemInst* ins = GetInv().GetItem(x); ItemInst* ins = GetInv().GetItem(x);
@ -5533,7 +5533,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
int16 focus_max_real = 0; int16 focus_max_real = 0;
//item focus //item focus
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){ for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]); const Item_Struct *cur = database.GetItem(equipment[i]);
if(!cur) if(!cur)

View File

@ -1206,7 +1206,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (inst == nullptr) if (inst == nullptr)
break; break;
for (int r = AUG_BEGIN; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { for (int r = AUG_INDEX_BEGIN; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r); const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i) if (!aug_i)

View File

@ -2779,8 +2779,8 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN
if(ItemID) { if(ItemID) {
const Item_Struct* reward_item = database.GetItem(ItemID); const Item_Struct* reward_item = database.GetItem(ItemID);
EQEmu::SayLink::impl linker; EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData); linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(reward_item); linker.SetItemData(reward_item);
linker.SetTaskUse(); linker.SetTaskUse();
if (strlen(Tasks[TaskID]->Reward) != 0) if (strlen(Tasks[TaskID]->Reward) != 0)

View File

@ -69,7 +69,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
// Verify that no more than two items are in container to guarantee no inadvertant wipes. // Verify that no more than two items are in container to guarantee no inadvertant wipes.
uint8 itemsFound = 0; uint8 itemsFound = 0;
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++) for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++)
{ {
const ItemInst* inst = container->GetItem(i); const ItemInst* inst = container->GetItem(i);
if (inst) if (inst)
@ -222,7 +222,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else else
{ {
// Delete items in our inventory container... // Delete items in our inventory container...
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++) for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++)
{ {
const ItemInst* inst = container->GetItem(i); const ItemInst* inst = container->GetItem(i);
if (inst) if (inst)
@ -264,7 +264,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
uint32 some_id = 0; uint32 some_id = 0;
bool worldcontainer=false; bool worldcontainer=false;
if (in_combine->container_slot == EQEmu::Legacy::SLOT_TRADESKILL) { if (in_combine->container_slot == EQEmu::legacy::SLOT_TRADESKILL) {
if(!worldo) { if(!worldo) {
user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use"); user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use");
return; return;
@ -401,7 +401,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
safe_delete(outapp); safe_delete(outapp);
database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID()); database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID());
} else{ } else{
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++) { for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++) {
const ItemInst* inst = container->GetItem(i); const ItemInst* inst = container->GetItem(i);
if (inst) { if (inst) {
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true);
@ -1227,7 +1227,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
int ccnt = 0; int ccnt = 0;
for (int x = SLOT_BEGIN; x < EQEmu::Constants::TYPE_WORLD_SIZE; x++) { for (int x = SLOT_BEGIN; x < EQEmu::constants::TYPE_WORLD_SIZE; x++) {
const ItemInst* inst = container->GetItem(x); const ItemInst* inst = container->GetItem(x);
if(!inst) if(!inst)
continue; continue;

View File

@ -171,13 +171,13 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id)
Client* with = mob->CastToClient(); Client* with = mob->CastToClient();
Client* trader = owner->CastToClient(); Client* trader = owner->CastToClient();
if (with && with->IsClient()) { if (with && with->IsClient()) {
with->SendItemPacket(dest_slot_id - EQEmu::Constants::TRADE_BEGIN, inst, ItemPacketTradeView); with->SendItemPacket(dest_slot_id - EQEmu::constants::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) { if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) { for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i); uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id); const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
if (bagitem) { if (bagitem) {
with->SendItemPacket(bagslot_id - EQEmu::Constants::TRADE_BEGIN, bagitem, ItemPacketTradeView); with->SendItemPacket(bagslot_id - EQEmu::constants::TRADE_BEGIN, bagitem, ItemPacketTradeView);
} }
} }
} }
@ -199,7 +199,7 @@ void Trade::LogTrade()
uint8 item_count = 0; uint8 item_count = 0;
if (zone->tradevar != 0) { if (zone->tradevar != 0) {
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) { for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
if (trader->GetInv().GetItem(i)) if (trader->GetInv().GetItem(i))
item_count++; item_count++;
} }
@ -251,7 +251,7 @@ void Trade::LogTrade()
if (item_count > 0) { if (item_count > 0) {
strcat(logtext, "items {"); strcat(logtext, "items {");
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) { for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
const ItemInst* inst = trader->GetInv().GetItem(i); const ItemInst* inst = trader->GetInv().GetItem(i);
if (!comma) if (!comma)
@ -267,7 +267,7 @@ void Trade::LogTrade()
strcat(logtext, item_num); strcat(logtext, item_num);
if (inst->IsType(ItemClassContainer)) { if (inst->IsType(ItemClassContainer)) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) { for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j); inst = trader->GetInv().GetItem(i, j);
if (inst) { if (inst) {
strcat(logtext, ","); strcat(logtext, ",");
@ -303,7 +303,7 @@ void Trade::DumpTrade()
return; return;
Client* trader = owner->CastToClient(); Client* trader = owner->CastToClient();
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) { for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
const ItemInst* inst = trader->GetInv().GetItem(i); const ItemInst* inst = trader->GetInv().GetItem(i);
if (inst) { if (inst) {
@ -312,7 +312,7 @@ void Trade::DumpTrade()
i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); i, ((inst->IsType(ItemClassContainer)) ? "True" : "False"));
if (inst->IsType(ItemClassContainer)) { if (inst->IsType(ItemClassContainer)) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) { for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j); inst = trader->GetInv().GetItem(i, j);
if (inst) { if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)", Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
@ -332,7 +332,7 @@ void Client::ResetTrade() {
AddMoneyToPP(trade->cp, trade->sp, trade->gp, trade->pp, true); AddMoneyToPP(trade->cp, trade->sp, trade->gp, trade->pp, true);
// step 1: process bags // step 1: process bags
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot]; const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) { if (inst && inst->IsType(ItemClassContainer)) {
@ -351,7 +351,7 @@ void Client::ResetTrade() {
} }
// step 2a: process stackables // step 2a: process stackables
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot); ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) { if (inst && inst->IsStackable()) {
@ -398,11 +398,11 @@ void Client::ResetTrade() {
// step 2b: adjust trade stack bias // step 2b: adjust trade stack bias
// (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur) // (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur)
for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot); ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) { if (inst && inst->IsStackable()) {
for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::TRADE_END; ++bias_slot) { for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) {
if (bias_slot >= trade_slot) if (bias_slot >= trade_slot)
break; break;
@ -432,7 +432,7 @@ void Client::ResetTrade() {
} }
// step 3: process everything else // step 3: process everything else
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot]; const ItemInst* inst = m_inv[trade_slot];
if (inst) { if (inst) {
@ -487,7 +487,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
// step 1: process bags // step 1: process bags
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot]; const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) { if (inst && inst->IsType(ItemClassContainer)) {
@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_audit->char1_count += detail->charges; qs_audit->char1_count += detail->charges;
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) { //for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
const ItemInst* bag_inst = inst->GetItem(sub_slot); const ItemInst* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) { if (bag_inst) {
@ -571,7 +571,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
// step 2a: process stackables // step 2a: process stackables
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot); ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) { if (inst && inst->IsStackable()) {
@ -653,11 +653,11 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// step 2b: adjust trade stack bias // step 2b: adjust trade stack bias
// (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur) // (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur)
for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot); ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) { if (inst && inst->IsStackable()) {
for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::TRADE_END; ++bias_slot) { for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) {
if (bias_slot >= trade_slot) if (bias_slot >= trade_slot)
break; break;
@ -706,7 +706,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
// step 3: process everything else // step 3: process everything else
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot]; const ItemInst* inst = m_inv[trade_slot];
if (inst) { if (inst) {
@ -743,7 +743,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// 'step 3' should never really see containers..but, just in case... // 'step 3' should never really see containers..but, just in case...
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) { //for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
const ItemInst* bag_inst = inst->GetItem(sub_slot); const ItemInst* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) { if (bag_inst) {
@ -820,7 +820,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
if(qs_log) { // This can be incorporated below when revisions are made if(qs_log) { // This can be incorporated below when revisions are made
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_NPC_END; ++trade_slot) { for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_NPC_END; ++trade_slot) {
const ItemInst* trade_inst = m_inv[trade_slot]; const ItemInst* trade_inst = m_inv[trade_slot];
if(trade_inst) { if(trade_inst) {
@ -841,7 +841,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_audit->char_count += detail->charges; qs_audit->char_count += detail->charges;
if(trade_inst->IsType(ItemClassContainer)) { if(trade_inst->IsType(ItemClassContainer)) {
for (uint8 sub_slot = SUB_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) { for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
const ItemInst* trade_baginst = trade_inst->GetItem(sub_slot); const ItemInst* trade_baginst = trade_inst->GetItem(sub_slot);
if(trade_baginst) { if(trade_baginst) {
@ -875,7 +875,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
std::vector<EQEmu::Any> item_list; std::vector<EQEmu::Any> item_list;
std::list<ItemInst*> items; std::list<ItemInst*> items;
for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_NPC_END; ++i) { for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) {
ItemInst *inst = m_inv.GetItem(i); ItemInst *inst = m_inv.GetItem(i);
if(inst) { if(inst) {
items.push_back(inst); items.push_back(inst);
@ -891,7 +891,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) { if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
// pets need to look inside bags and try to equip items found there // pets need to look inside bags and try to equip items found there
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) { if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) { for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
const ItemInst* baginst = inst->GetItem(bslot); const ItemInst* baginst = inst->GetItem(bslot);
if (baginst) { if (baginst) {
const Item_Struct* bagitem = baginst->GetItem(); const Item_Struct* bagitem = baginst->GetItem();
@ -948,8 +948,8 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
ItemInst *insts[4] = { 0 }; ItemInst *insts[4] = { 0 };
for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_NPC_END; ++i) { for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) {
insts[i - EQEmu::Constants::TRADE_BEGIN] = m_inv.PopItem(i); insts[i - EQEmu::constants::TRADE_BEGIN] = m_inv.PopItem(i);
database.SaveInventory(CharacterID(), nullptr, i); database.SaveInventory(CharacterID(), nullptr, i);
} }
@ -968,7 +968,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
if (!other) if (!other)
return true; return true;
// Move each trade slot into free inventory slot // Move each trade slot into free inventory slot
for (int16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++){ for (int16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++){
const ItemInst* inst = m_inv[i]; const ItemInst* inst = m_inv[i];
if (inst && inst->GetItem()) { if (inst && inst->GetItem()) {
@ -977,7 +977,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
} }
} }
for (int16 i = EQEmu::Constants::TRADE_BAGS_BEGIN; i <= EQEmu::Constants::TRADE_BAGS_END; i++){ for (int16 i = EQEmu::constants::TRADE_BAGS_BEGIN; i <= EQEmu::constants::TRADE_BAGS_END; i++){
const ItemInst* inst = m_inv[i]; const ItemInst* inst = m_inv[i];
if (inst && inst->GetItem()) { if (inst && inst->GetItem()) {
@ -1232,10 +1232,10 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
ItemInst* item = nullptr; ItemInst* item = nullptr;
uint16 SlotID = 0; uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){ for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++){
item = this->GetInv().GetItem(i); item = this->GetInv().GetItem(i);
if (item && item->GetItem()->ID == 17899){ //Traders Satchel if (item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!?? // we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x); SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID); item = this->GetInv().GetItem(SlotID);
@ -1255,10 +1255,10 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
ItemInst* item = nullptr; ItemInst* item = nullptr;
uint16 SlotID = 0; uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){ for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++){
item = this->GetInv().GetItem(i); item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!?? // we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x); SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID); item = this->GetInv().GetItem(SlotID);
@ -1286,10 +1286,10 @@ GetItems_Struct* Client::GetTraderItems(){
uint8 ndx = 0; uint8 ndx = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
item = this->GetInv().GetItem(i); item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) { for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
SlotID = Inventory::CalcSlotId(i, x); SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID); item = this->GetInv().GetItem(SlotID);
@ -1310,10 +1310,10 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
const ItemInst* item= nullptr; const ItemInst* item= nullptr;
uint16 SlotID = 0; uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
item = this->GetInv().GetItem(i); item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++){ for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++){
SlotID = Inventory::CalcSlotId(i, x); SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID); item = this->GetInv().GetItem(SlotID);

View File

@ -66,7 +66,7 @@ void Client::ToggleTribute(bool enabled) {
int r; int r;
uint32 cost = 0; uint32 cost = 0;
uint32 level = GetLevel(); uint32 level = GetLevel();
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
uint32 tid = m_pp.tributes[r].tribute; uint32 tid = m_pp.tributes[r].tribute;
if(tid == TRIBUTE_NONE) if(tid == TRIBUTE_NONE)
continue; continue;
@ -119,7 +119,7 @@ void Client::DoTributeUpdate() {
tis->tribute_master_id = tribute_master_id; //Dont know what this is for tis->tribute_master_id = tribute_master_id; //Dont know what this is for
int r; int r;
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
if(m_pp.tributes[r].tribute != TRIBUTE_NONE) { if(m_pp.tributes[r].tribute != TRIBUTE_NONE) {
tis->tributes[r] = m_pp.tributes[r].tribute; tis->tributes[r] = m_pp.tributes[r].tribute;
tis->tiers[r] = m_pp.tributes[r].tier; tis->tiers[r] = m_pp.tributes[r].tier;
@ -134,24 +134,24 @@ void Client::DoTributeUpdate() {
if(m_pp.tribute_active) { if(m_pp.tribute_active) {
//send and equip tribute items... //send and equip tribute items...
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
uint32 tid = m_pp.tributes[r].tribute; uint32 tid = m_pp.tributes[r].tribute;
if(tid == TRIBUTE_NONE) { if(tid == TRIBUTE_NONE) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
continue; continue;
} }
if(tribute_list.count(tid) != 1) { if(tribute_list.count(tid) != 1) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
continue; continue;
} }
//sanity check //sanity check
if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) { if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
m_pp.tributes[r].tier = 0; m_pp.tributes[r].tier = 0;
continue; continue;
} }
@ -165,15 +165,15 @@ void Client::DoTributeUpdate() {
if(inst == nullptr) if(inst == nullptr)
continue; continue;
PutItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, *inst, false); PutItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, *inst, false);
SendItemPacket(EQEmu::Constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem); SendItemPacket(EQEmu::constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
safe_delete(inst); safe_delete(inst);
} }
} else { } else {
//unequip tribute items... //unequip tribute items...
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
} }
} }
CalcBonuses(); CalcBonuses();
@ -192,7 +192,7 @@ void Client::SendTributeTimer() {
void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::ChangeTributeSettings(TributeInfo_Struct *t) {
int r; int r;
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
m_pp.tributes[r].tribute = TRIBUTE_NONE; m_pp.tributes[r].tribute = TRIBUTE_NONE;

View File

@ -487,7 +487,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
uint8 index = (uint8)atoi(row[0]); uint8 index = (uint8)atoi(row[0]);
uint32 item_id = (uint32)atoi(row[1]); uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]); int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE]; uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[3]); aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]); aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]); aug[2] = (uint32)atoi(row[5]);
@ -497,7 +497,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
ItemInst* inst = database.CreateItem(item_id, charges); ItemInst* inst = database.CreateItem(item_id, charges);
if (inst && inst->GetItem()->ItemClass == ItemClassCommon) { if (inst && inst->GetItem()->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
if (aug[i]) if (aug[i])
inst->PutAugment(&database, i, aug[i]); inst->PutAugment(&database, i, aug[i]);
// Put item inside world container // Put item inside world container
@ -520,17 +520,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It
DeleteWorldContainer(parent_id,zone_id); DeleteWorldContainer(parent_id,zone_id);
// Save all 10 items, if they exist // Save all 10 items, if they exist
for (uint8 index = SUB_BEGIN; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; index++) { for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::constants::ITEM_CONTAINER_SIZE; index++) {
ItemInst* inst = container->GetItem(index); ItemInst* inst = container->GetItem(index);
if (!inst) if (!inst)
continue; continue;
uint32 item_id = inst->GetItem()->ID; uint32 item_id = inst->GetItem()->ID;
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) { if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst=inst->GetAugment(i); ItemInst *auginst=inst->GetAugment(i);
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0; augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
} }
@ -1181,11 +1181,11 @@ bool ZoneDatabase::LoadCharacterMaterialColor(uint32 character_id, PlayerProfile
bool ZoneDatabase::LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp) bool ZoneDatabase::LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp)
{ {
std::string query = StringFormat("SELECT `bandolier_id`, `bandolier_slot`, `item_id`, `icon`, `bandolier_name` FROM `character_bandolier` WHERE `id` = %u LIMIT %u", std::string query = StringFormat("SELECT `bandolier_id`, `bandolier_slot`, `item_id`, `icon`, `bandolier_name` FROM `character_bandolier` WHERE `id` = %u LIMIT %u",
character_id, EQEmu::Constants::BANDOLIERS_SIZE); character_id, EQEmu::constants::BANDOLIERS_SIZE);
auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0; auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0;
for (i = 0; i < EQEmu::Constants::BANDOLIERS_SIZE; i++) { for (i = 0; i < EQEmu::constants::BANDOLIERS_SIZE; i++) {
pp->bandoliers[i].Name[0] = '\0'; pp->bandoliers[i].Name[0] = '\0';
for (int si = 0; si < EQEmu::Constants::BANDOLIER_ITEM_COUNT; si++) { for (int si = 0; si < EQEmu::constants::BANDOLIER_ITEM_COUNT; si++) {
pp->bandoliers[i].Items[si].ID = 0; pp->bandoliers[i].Items[si].ID = 0;
pp->bandoliers[i].Items[si].Icon = 0; pp->bandoliers[i].Items[si].Icon = 0;
pp->bandoliers[i].Items[si].Name[0] = '\0'; pp->bandoliers[i].Items[si].Name[0] = '\0';
@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterTribute(uint32 character_id, PlayerProfile_Struc
std::string query = StringFormat("SELECT `tier`, `tribute` FROM `character_tribute` WHERE `id` = %u", character_id); std::string query = StringFormat("SELECT `tier`, `tribute` FROM `character_tribute` WHERE `id` = %u", character_id);
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
int i = 0; int i = 0;
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){ for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
pp->tributes[i].tribute = 0xFFFFFFFF; pp->tributes[i].tribute = 0xFFFFFFFF;
pp->tributes[i].tier = 0; pp->tributes[i].tier = 0;
} }
@ -1238,10 +1238,10 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc
{ {
std::string query = std::string query =
StringFormat("SELECT `potion_id`, `item_id`, `icon` FROM `character_potionbelt` WHERE `id` = %u LIMIT %u", StringFormat("SELECT `potion_id`, `item_id`, `icon` FROM `character_potionbelt` WHERE `id` = %u LIMIT %u",
character_id, EQEmu::Constants::POTION_BELT_ITEM_COUNT); character_id, EQEmu::constants::POTION_BELT_ITEM_COUNT);
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
int i = 0; int i = 0;
for (i = 0; i < EQEmu::Constants::POTION_BELT_ITEM_COUNT; i++) { for (i = 0; i < EQEmu::constants::POTION_BELT_ITEM_COUNT; i++) {
pp->potionbelt.Items[i].Icon = 0; pp->potionbelt.Items[i].Icon = 0;
pp->potionbelt.Items[i].ID = 0; pp->potionbelt.Items[i].ID = 0;
pp->potionbelt.Items[i].Name[0] = '\0'; pp->potionbelt.Items[i].Name[0] = '\0';
@ -1339,7 +1339,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc
std::string query = StringFormat("DELETE FROM `character_tribute` WHERE `id` = %u", character_id); std::string query = StringFormat("DELETE FROM `character_tribute` WHERE `id` = %u", character_id);
QueryDatabase(query); QueryDatabase(query);
/* Save Tributes only if we have values... */ /* Save Tributes only if we have values... */
for (int i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){ for (int i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){
std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
QueryDatabase(query); QueryDatabase(query);
@ -2092,7 +2092,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
else { else {
auto armorTint_row = armortint_results.begin(); auto armorTint_row = armortint_results.begin();
for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::MATERIAL_END; index++) { for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) {
temp_npctype_data->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16; temp_npctype_data->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8; temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]); temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
@ -2307,7 +2307,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0; tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0;
if (armor_tint_id == 0) if (armor_tint_id == 0)
for (int index = MaterialChest; index <= EQEmu::Constants::MATERIAL_END; index++) for (int index = MaterialChest; index <= EQEmu::constants::MATERIAL_END; index++)
tmpNPCType->armor_tint[index] = tmpNPCType->armor_tint[0]; tmpNPCType->armor_tint[index] = tmpNPCType->armor_tint[0];
else if (tmpNPCType->armor_tint[0] == 0) { else if (tmpNPCType->armor_tint[0] == 0) {
std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, " std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, "
@ -2327,7 +2327,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
else { else {
auto armorTint_row = results.begin(); auto armorTint_row = results.begin();
for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::MATERIAL_END; index++) { for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) {
tmpNPCType->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16; tmpNPCType->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8; tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]); tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
@ -2684,7 +2684,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) {
int itemCount = 0; int itemCount = 0;
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
if (itemCount == EQEmu::Constants::EQUIPMENT_SIZE) if (itemCount == EQEmu::constants::EQUIPMENT_SIZE)
break; break;
if(atoi(row[0]) == 0) if(atoi(row[0]) == 0)
@ -3199,7 +3199,7 @@ void ZoneDatabase::SavePetInfo(Client *client)
query.clear(); query.clear();
// pet inventory! // pet inventory!
for (int index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::EQUIPMENT_END; index++) { for (int index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; index++) {
if (!petinfo->Items[index]) if (!petinfo->Items[index])
continue; continue;
@ -3331,7 +3331,7 @@ void ZoneDatabase::LoadPetInfo(Client *client)
continue; continue;
int slot = atoi(row[1]); int slot = atoi(row[1]);
if (slot < EQEmu::Constants::EQUIPMENT_BEGIN || slot > EQEmu::Constants::EQUIPMENT_END) if (slot < EQEmu::constants::EQUIPMENT_BEGIN || slot > EQEmu::constants::EQUIPMENT_END)
continue; continue;
pi->Items[slot] = atoul(row[2]); pi->Items[slot] = atoul(row[2]);

View File

@ -126,7 +126,7 @@ struct PetInfo {
uint32 Mana; uint32 Mana;
float size; float size;
SpellBuff_Struct Buffs[BUFF_COUNT]; SpellBuff_Struct Buffs[BUFF_COUNT];
uint32 Items[EQEmu::Constants::EQUIPMENT_SIZE]; uint32 Items[EQEmu::constants::EQUIPMENT_SIZE];
char Name[64]; char Name[64];
}; };