Added class EQEmu::InventorySlot

This commit is contained in:
Uleat 2016-10-16 21:36:39 -04:00
parent 8b5dd58e96
commit bfd07b1010
69 changed files with 1852 additions and 1391 deletions

View File

@ -1,7 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 10/16/2016 ==
Uleat: Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance.
Uleat: Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance
Uleat: Added class EQEmu::InventorySlot. Re-attached pertinent inventory token references to EQDictionary
== 10/15/2016 ==
Uleat: Changed filenames to facilitate future inventory naming conventions

View File

@ -35,7 +35,7 @@ SET(common_sources
faction.cpp
guild_base.cpp
guilds.cpp
# inventory_slot.cpp
inventory_slot.cpp
ipc_mutex.cpp
item_data.cpp
item_instance.cpp
@ -156,7 +156,7 @@ SET(common_headers
global_define.h
guild_base.h
guilds.h
# inventory_slot.h
inventory_slot.h
ipc_mutex.h
item_data.h
item_fieldlist.h

View File

@ -709,7 +709,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
auto results = QueryDatabase(invquery);
}
if (i == EQEmu::legacy::SlotCursor) {
if (i == EQEmu::inventory::slotCursor) {
i = EQEmu::legacy::GENERAL_BAGS_BEGIN;
continue;
}

View File

@ -186,7 +186,7 @@ namespace Convert {
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[EQEmu::textures::TextureCount];
/*510*/ uint32 Items[EQEmu::textures::materialCount];
/*546*/ char Name[64];
/*610*/
};
@ -227,9 +227,9 @@ namespace Convert {
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[EQEmu::textures::TextureCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQEmu::textures::materialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::TextureCount];
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::materialCount];
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@ -1403,7 +1403,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Material Color Convert */
first_entry = 0; rquery = "";
for (i = 0; i < EQEmu::textures::TextureCount; i++){
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++){
if (pp->item_tint[i].color > 0){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);

View File

@ -35,6 +35,79 @@ namespace EQEmu
//using namespace RoF2::invbag;
//using namespace RoF2::invaug;
enum : int16 { typeInvalid = -1, slotInvalid = -1, containerInvalid = -1, socketInvalid = -1 }; // temporary
enum : int16 { typeBegin = 0, slotBegin = 0, containerBegin = 0, socketBegin = 0 }; // temporary
enum PossessionsSlots : int16 { // temporary
slotCharm = 0,
slotEar1,
slotHead,
slotFace,
slotEar2,
slotNeck, // 5
slotShoulders,
slotArms,
slotBack,
slotWrist1,
slotWrist2, // 10
slotRange,
slotHands,
slotPrimary,
slotSecondary,
slotFinger1, // 15
slotFinger2,
slotChest,
slotLegs,
slotFeet,
slotWaist, // 20
slotPowerSource = 9999,
slotAmmo = 21,
slotGeneral1,
slotGeneral2,
slotGeneral3,
slotGeneral4, // 25
slotGeneral5,
slotGeneral6,
slotGeneral7,
slotGeneral8,
slotCursor, // 30
slotCount
};
enum InventoryTypes : int16 { // temporary
typePossessions = 0,
typeBank,
typeSharedBank,
typeTrade,
typeWorld,
typeLimbo, // 5
typeTribute,
typeTrophyTribute,
typeGuildTribute,
typeMerchant,
typeDeleted, // 10
typeCorpse,
typeBazaar,
typeInspect,
typeRealEstate,
typeViewMODPC, // 15
typeViewMODBank,
typeViewMODSharedBank,
typeViewMODLimbo,
typeAltStorage,
typeArchived, // 20
typeMail,
typeGuildTrophyTribute,
typeKrono,
typeOther,
typeCount
};
static int16 SlotCount(int16 type_index) { return 0; } // temporary
const int16 ContainerCount = 10; // temporary
const int16 SocketCount = 6; // temporary
} /*inventory*/
namespace constants {
@ -44,6 +117,7 @@ namespace EQEmu
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
} /*constants*/
enum class CastingSlot : uint32 {
Gem1 = 0,
Gem2 = 1,
@ -68,3 +142,9 @@ namespace EQEmu
} /*EQEmu*/
#endif /*COMMON_EMU_CONSTANTS_H*/
/* hack list to prevent circular references
eq_limits.h:EQEmu::inventory::LookupEntry::InventoryTypeSize[n];
*/

View File

@ -61,8 +61,6 @@ namespace EQEmu
SLOT_GENERAL_6 = 27,
SLOT_GENERAL_7 = 28,
SLOT_GENERAL_8 = 29,
//SLOT_GENERAL_9 = not supported
//SLOT_GENERAL_10 = not supported
SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
@ -96,75 +94,8 @@ namespace EQEmu
SLOT_WORLD_END = 4009
};
enum InventoryTypes : int16 {
TypePossessions = 0,
TypeBank,
TypeSharedBank,
TypeTrade,
TypeWorld,
TypeLimbo, // 5
TypeTribute,
TypeTrophyTribute,
TypeGuildTribute,
TypeMerchant,
TypeDeleted, // 10
TypeCorpse,
TypeBazaar,
TypeInspect,
TypeRealEstate,
TypeViewMODPC, // 15
TypeViewMODBank,
TypeViewMODSharedBank,
TypeViewMODLimbo,
TypeAltStorage,
TypeArchived, // 20
TypeMail,
TypeGuildTrophyTribute,
TypeKrono,
TypeOther,
TypeCount
};
enum PossessionsSlots : int16 {
SlotCharm = 0,
SlotEar1,
SlotHead,
SlotFace,
SlotEar2,
SlotNeck, // 5
SlotShoulders,
SlotArms,
SlotBack,
SlotWrist1,
SlotWrist2, // 10
SlotRange,
SlotHands,
SlotPrimary,
SlotSecondary,
SlotFinger1, // 15
SlotFinger2,
SlotChest,
SlotLegs,
SlotFeet,
SlotWaist, // 20
SlotPowerSource = 9999, // temp
SlotAmmo = 21, // temp
SlotGeneral1,
SlotGeneral2,
SlotGeneral3,
SlotGeneral4, // 25
SlotGeneral5,
SlotGeneral6,
SlotGeneral7,
SlotGeneral8,
//SlotGeneral9,
//SlotGeneral10,
SlotCursor, // 30
SlotCount
};
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount;
static const uint16 TYPE_POSSESSIONS_SIZE = 31;
static const uint16 TYPE_BANK_SIZE = 24;
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
static const uint16 TYPE_TRADE_SIZE = 8;
@ -175,14 +106,14 @@ namespace EQEmu
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
static const uint16 TYPE_MERCHANT_SIZE = 0;
static const uint16 TYPE_DELETED_SIZE = 0;
static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 TYPE_CORPSE_SIZE = 31; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 TYPE_BAZAAR_SIZE = 80;
static const uint16 TYPE_INSPECT_SIZE = 22;
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_PC_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_PC_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = 0;
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
static const uint16 TYPE_ARCHIVED_SIZE = 0;
static const uint16 TYPE_MAIL_SIZE = 0;
@ -192,12 +123,12 @@ namespace EQEmu
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
static const int16 EQUIPMENT_BEGIN = SlotCharm;
static const int16 EQUIPMENT_END = SlotAmmo;
static const int16 EQUIPMENT_BEGIN = 0;
static const int16 EQUIPMENT_END = 21;
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
static const int16 GENERAL_BEGIN = SlotGeneral1;
static const int16 GENERAL_END = SlotGeneral8;
static const int16 GENERAL_BEGIN = 22;
static const int16 GENERAL_END = 29;
static const uint16 GENERAL_SIZE = 8;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 79;
@ -235,21 +166,15 @@ namespace EQEmu
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
static const int16 CORPSE_BEGIN = 22;
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
// items
// common and container sizes will not increase until the new 'location' struct is implemented
static const uint16 ITEM_COMMON_SIZE = 6;//RoF::consts::ITEM_COMMON_SIZE;
static const uint16 ITEM_CONTAINER_SIZE = 10;//Titanium::consts::ITEM_CONTAINER_SIZE;
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t BANDOLIERS_SIZE = 20;//RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4;//RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t POTION_BELT_ITEM_COUNT = 5;//RoF2::consts::POTION_BELT_ITEM_COUNT;
static const size_t POTION_BELT_ITEM_COUNT = 5;
static const size_t TEXT_LINK_BODY_LENGTH = 56;//RoF2::consts::TEXT_LINK_BODY_LENGTH;
static const size_t TEXT_LINK_BODY_LENGTH = 56;
}
}

View File

@ -516,14 +516,6 @@ static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // chang
*/
#define INVALID_INDEX -1
#define NO_ITEM 0
// yes..these are redundant... but, they help to identify and define what is actually being performed
// plus, since they're pre-op's, they don't affect the actual binary size
#define TYPE_BEGIN 0
#define SLOT_BEGIN 0
#define SUB_INDEX_BEGIN 0
#define AUG_INDEX_BEGIN 0
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;

View File

@ -85,7 +85,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
Titanium::invtype::InvTypeViewMODPCSize, Titanium::invtype::InvTypeViewMODBankSize, Titanium::invtype::InvTypeViewMODSharedBankSize, Titanium::invtype::InvTypeViewMODLimboSize, Titanium::invtype::InvTypeAltStorageSize,
Titanium::invtype::InvTypeArchivedSize, Titanium::Null, Titanium::Null, Titanium::Null, Titanium::invtype::InvTypeOtherSize,
Titanium::Null, /*0x000000027FDFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*Titanium::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*Titanium::invaug::ItemAugSize,*/
Titanium::Null, /*0x000000027FDFFFFF,*/ EQEmu::inventory::ContainerCount, /*Titanium::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*Titanium::invaug::ItemAugSize,*/
Titanium::inventory::AllowEmptyBagInBag, Titanium::inventory::AllowClickCastFromBag, Titanium::inventory::ConcatenateInvTypeLimbo, Titanium::inventory::AllowOverLevelEquipment
},
@ -96,7 +96,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
SoF::invtype::InvTypeViewMODPCSize, SoF::invtype::InvTypeViewMODBankSize, SoF::invtype::InvTypeViewMODSharedBankSize, SoF::invtype::InvTypeViewMODLimboSize, SoF::invtype::InvTypeAltStorageSize,
SoF::invtype::InvTypeArchivedSize, SoF::Null, SoF::Null, SoF::Null, SoF::invtype::InvTypeOtherSize,
SoF::Null, /*0x000000027FFFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*SoF::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*SoF::invaug::ItemAugSize,*/
SoF::Null, /*0x000000027FFFFFFF,*/ EQEmu::inventory::ContainerCount, /*SoF::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*SoF::invaug::ItemAugSize,*/
SoF::inventory::AllowEmptyBagInBag, SoF::inventory::AllowClickCastFromBag, SoF::inventory::ConcatenateInvTypeLimbo, SoF::inventory::AllowOverLevelEquipment
},
@ -107,7 +107,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
SoD::invtype::InvTypeViewMODPCSize, SoD::invtype::InvTypeViewMODBankSize, SoD::invtype::InvTypeViewMODSharedBankSize, SoD::invtype::InvTypeViewMODLimboSize, SoD::invtype::InvTypeAltStorageSize,
SoD::invtype::InvTypeArchivedSize, SoD::Null, SoD::Null, SoD::Null, SoD::invtype::InvTypeOtherSize,
SoD::Null, /*0x000000027FFFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*SoD::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*SoD::invaug::ItemAugSize,*/
SoD::Null, /*0x000000027FFFFFFF,*/ EQEmu::inventory::ContainerCount, /*SoD::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*SoD::invaug::ItemAugSize,*/
SoD::inventory::AllowEmptyBagInBag, SoD::inventory::AllowClickCastFromBag, SoD::inventory::ConcatenateInvTypeLimbo, SoD::inventory::AllowOverLevelEquipment
},
@ -118,7 +118,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
UF::invtype::InvTypeViewMODPCSize, UF::invtype::InvTypeViewMODBankSize, UF::invtype::InvTypeViewMODSharedBankSize, UF::invtype::InvTypeViewMODLimboSize, UF::invtype::InvTypeAltStorageSize,
UF::invtype::InvTypeArchivedSize, UF::Null, UF::Null, UF::Null, UF::invtype::InvTypeOtherSize,
UF::Null, /*0x000000027FFFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*UF::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*UF::invaug::ItemAugSize,*/
UF::Null, /*0x000000027FFFFFFF,*/ EQEmu::inventory::ContainerCount, /*UF::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*UF::invaug::ItemAugSize,*/
UF::inventory::AllowEmptyBagInBag, UF::inventory::AllowClickCastFromBag, UF::inventory::ConcatenateInvTypeLimbo, UF::inventory::AllowOverLevelEquipment
},
@ -129,7 +129,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
RoF::invtype::InvTypeViewMODPCSize, RoF::invtype::InvTypeViewMODBankSize, RoF::invtype::InvTypeViewMODSharedBankSize, RoF::invtype::InvTypeViewMODLimboSize, RoF::invtype::InvTypeAltStorageSize,
RoF::invtype::InvTypeArchivedSize, RoF::invtype::InvTypeMailSize, RoF::invtype::InvTypeGuildTrophyTributeSize, RoF::Null, RoF::invtype::InvTypeOtherSize,
RoF::Null, /*0x00000003FFFFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*RoF::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*RoF::invaug::ItemAugSize,*/
RoF::Null, /*0x00000003FFFFFFFF,*/ EQEmu::inventory::ContainerCount, /*RoF::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*RoF::invaug::ItemAugSize,*/
RoF::False, /*RoF::inventory::AllowEmptyBagInBag,*/ RoF::inventory::AllowClickCastFromBag, RoF::inventory::ConcatenateInvTypeLimbo, RoF::inventory::AllowOverLevelEquipment
},
@ -140,7 +140,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
RoF2::invtype::InvTypeViewMODPCSize, RoF2::invtype::InvTypeViewMODBankSize, RoF2::invtype::InvTypeViewMODSharedBankSize, RoF2::invtype::InvTypeViewMODLimboSize, RoF2::invtype::InvTypeAltStorageSize,
RoF2::invtype::InvTypeArchivedSize, RoF2::invtype::InvTypeMailSize, RoF2::invtype::InvTypeGuildTrophyTributeSize, RoF2::invtype::InvTypeKronoSize, RoF2::invtype::InvTypeOtherSize,
RoF2::Null, /*0x00000003FFFFFFFF,*/ EQEmu::legacy::ITEM_CONTAINER_SIZE, /*RoF2::invbag::ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*RoF2::invaug::ItemAugSize,*/
RoF2::Null, /*0x00000003FFFFFFFF,*/ EQEmu::inventory::ContainerCount, /*RoF2::invbag::ItemBagSize,*/ EQEmu::inventory::SocketCount, /*RoF2::invaug::ItemAugSize,*/
RoF2::False, /*RoF2::inventory::AllowEmptyBagInBag,*/ RoF2::inventory::AllowClickCastFromBag, RoF2::inventory::ConcatenateInvTypeLimbo, RoF2::inventory::AllowOverLevelEquipment
},
@ -151,7 +151,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null,
EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null, EntityLimits::NPC::Null,
EntityLimits::NPC::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::NPC::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::NPC::False, EntityLimits::NPC::False, EntityLimits::NPC::False, EntityLimits::NPC::False
},
@ -162,7 +162,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null,
EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null, EntityLimits::NPCMerchant::Null,
EntityLimits::NPCMerchant::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::NPCMerchant::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::NPCMerchant::False, EntityLimits::NPCMerchant::False, EntityLimits::NPCMerchant::False, EntityLimits::NPCMerchant::False
},
@ -173,7 +173,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null,
EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null, EntityLimits::Merc::Null,
EntityLimits::Merc::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::Merc::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::Merc::False, EntityLimits::Merc::False, EntityLimits::Merc::False, EntityLimits::Merc::False
},
@ -184,7 +184,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null,
EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null, EntityLimits::Bot::Null,
EntityLimits::Bot::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::Bot::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::Bot::False, EntityLimits::Bot::False, EntityLimits::Bot::False, EntityLimits::Bot::False
},
@ -195,7 +195,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null,
EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null, EntityLimits::ClientPet::Null,
EntityLimits::ClientPet::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::ClientPet::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::ClientPet::False, EntityLimits::ClientPet::False, EntityLimits::ClientPet::False, EntityLimits::ClientPet::False
},
@ -206,7 +206,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null,
EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null, EntityLimits::NPCPet::Null,
EntityLimits::NPCPet::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::NPCPet::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::NPCPet::False, EntityLimits::NPCPet::False, EntityLimits::NPCPet::False, EntityLimits::NPCPet::False
},
@ -217,7 +217,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null,
EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null, EntityLimits::MercPet::Null,
EntityLimits::MercPet::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::MercPet::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::MercPet::False, EntityLimits::MercPet::False, EntityLimits::MercPet::False, EntityLimits::MercPet::False
},
@ -228,7 +228,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null,
EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null, EntityLimits::BotPet::Null,
EntityLimits::BotPet::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*ItemBagSize,*/ EQEmu::legacy::ITEM_COMMON_SIZE, /*ItemAugSize,*/
EntityLimits::BotPet::Null, EQEmu::inventory::ContainerCount, /*ItemBagSize,*/ EQEmu::inventory::SocketCount, /*ItemAugSize,*/
EntityLimits::BotPet::False, EntityLimits::BotPet::False, EntityLimits::BotPet::False, EntityLimits::BotPet::False
},
@ -239,7 +239,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
Titanium::invtype::InvTypeViewMODPCSize, Titanium::invtype::InvTypeViewMODBankSize, Titanium::invtype::InvTypeViewMODSharedBankSize, Titanium::invtype::InvTypeViewMODLimboSize, Titanium::Null,
Titanium::Null, Titanium::Null, Titanium::Null, Titanium::Null, Titanium::Null,
Titanium::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*Titanium::Null,*/ Titanium::Null,
Titanium::Null, EQEmu::inventory::ContainerCount, /*Titanium::Null,*/ Titanium::Null,
Titanium::False, Titanium::False, Titanium::False, Titanium::False
},
@ -250,7 +250,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
SoF::invtype::InvTypeViewMODPCSize, SoF::invtype::InvTypeViewMODBankSize, SoF::invtype::InvTypeViewMODSharedBankSize, SoF::invtype::InvTypeViewMODLimboSize, SoF::Null,
SoF::Null, SoF::Null, SoF::Null, SoF::Null, SoF::Null,
SoF::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*SoF::Null,*/ SoF::Null,
SoF::Null, EQEmu::inventory::ContainerCount, /*SoF::Null,*/ SoF::Null,
SoF::False, SoF::False, SoF::False, SoF::False
},
@ -261,7 +261,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
SoD::invtype::InvTypeViewMODPCSize, SoD::invtype::InvTypeViewMODBankSize, SoD::invtype::InvTypeViewMODSharedBankSize, SoD::invtype::InvTypeViewMODLimboSize, SoD::Null,
SoD::Null, SoD::Null, SoD::Null, SoD::Null, SoD::Null,
SoD::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*SoD::Null,*/ SoD::Null,
SoD::Null, EQEmu::inventory::ContainerCount, /*SoD::Null,*/ SoD::Null,
SoD::False, SoD::False, SoD::False, SoD::False
},
@ -272,7 +272,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
UF::invtype::InvTypeViewMODPCSize, UF::invtype::InvTypeViewMODBankSize, UF::invtype::InvTypeViewMODSharedBankSize, UF::invtype::InvTypeViewMODLimboSize, UF::Null,
UF::Null, UF::Null, UF::Null, UF::Null, UF::Null,
UF::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*UF::Null,*/ UF::Null,
UF::Null, EQEmu::inventory::ContainerCount, /*UF::Null,*/ UF::Null,
UF::False, UF::False, UF::False, UF::False
},
@ -283,7 +283,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
RoF::invtype::InvTypeViewMODPCSize, RoF::invtype::InvTypeViewMODBankSize, RoF::invtype::InvTypeViewMODSharedBankSize, RoF::invtype::InvTypeViewMODLimboSize, RoF::Null,
RoF::Null, RoF::Null, RoF::Null, RoF::Null, RoF::Null,
RoF::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*RoF::Null,*/ RoF::Null,
RoF::Null, EQEmu::inventory::ContainerCount, /*RoF::Null,*/ RoF::Null,
RoF::False, RoF::False, RoF::False, RoF::False
},
@ -294,7 +294,7 @@ static const EQEmu::inventory::LookupEntry inventory_lookup_entries[EQEmu::versi
RoF2::invtype::InvTypeViewMODPCSize, RoF2::invtype::InvTypeViewMODBankSize, RoF2::invtype::InvTypeViewMODSharedBankSize, RoF2::invtype::InvTypeViewMODLimboSize, RoF2::Null,
RoF2::Null, RoF2::Null, RoF2::Null, RoF2::Null, RoF2::Null,
RoF2::Null, EQEmu::legacy::ITEM_CONTAINER_SIZE, /*RoF2::Null,*/ RoF2::Null,
RoF2::Null, EQEmu::inventory::ContainerCount, /*RoF2::Null,*/ RoF2::Null,
RoF2::False, RoF2::False, RoF2::False, RoF2::False
}

View File

@ -47,7 +47,7 @@ namespace EQEmu
namespace inventory {
class LookupEntry {
public:
size_t InventoryTypeSize[legacy::TypeCount];
size_t InventoryTypeSize[25]; // should reflect EQEmu::inventory::typeCount referenced in emu_constants.h
uint64 PossessionsBitmask;
size_t ItemBagSize;

View File

@ -127,7 +127,7 @@ struct LDoNTrapTemplate
// All clients translate the character select information to some degree
struct CharSelectEquip : EQEmu::Texture_Struct, EQEmu::Tint_Struct {};
struct CharSelectEquip : EQEmu::textures::Texture_Struct, EQEmu::textures::Tint_Struct {};
// RoF2-based hybrid struct
struct CharacterSelectEntry_Struct
@ -142,7 +142,7 @@ struct CharacterSelectEntry_Struct
uint16 Instance;
uint8 Gender;
uint8 Face;
CharSelectEquip Equip[EQEmu::textures::TextureCount];
CharSelectEquip Equip[EQEmu::textures::materialCount];
uint8 Unknown15; // Seen FF
uint8 Unknown19; // Seen FF
uint32 DrakkinTattoo;
@ -834,7 +834,7 @@ struct SuspendedMinion_Struct
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ EQEmu::TextureShortProfile Items;
/*510*/ EQEmu::TextureMaterialProfile Items;
/*546*/ char Name[64];
/*610*/
};
@ -942,7 +942,7 @@ struct PlayerProfile_Struct
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ EQEmu::TextureShortProfile item_material; // Item texture/material of worn/held items
/*0312*/ EQEmu::TextureMaterialProfile item_material; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ EQEmu::TintProfile item_tint;
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
@ -1179,7 +1179,7 @@ struct WearChange_Struct{
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
/*014*/ uint32 hero_forge_model; // New to VoA
/*018*/ uint32 unknown18; // New to RoF
/*022*/ EQEmu::Tint_Struct color;
/*022*/ EQEmu::textures::Tint_Struct color;
/*026*/ uint8 wear_slot_id;
/*027*/
};

View File

@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
uint16 old_pet_hp; /* Not Used */
uint16 old_pet_mana; /* Not Used */
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
EQEmu::TextureShortProfile pet_items; /* Not Used */
EQEmu::TextureMaterialProfile pet_items; /* Not Used */
char merc_name[64]; /* Used */
uint32 aa_effects; /* Used */

397
common/inventory_slot.cpp Normal file
View File

@ -0,0 +1,397 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "inventory_slot.h"
#include "textures.h"
#include "string_util.h"
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
{
switch (slot_index) {
case slotHead:
return textures::armorHead;
case slotChest:
return textures::armorChest;
case slotArms:
return textures::armorArms;
case slotWrist1:
return textures::armorWrist;
case slotHands:
return textures::armorHands;
case slotLegs:
return textures::armorLegs;
case slotFeet:
return textures::armorFeet;
case slotPrimary:
return textures::weaponPrimary;
case slotSecondary:
return textures::weaponSecondary;
default:
return textures::textureInvalid;
}
}
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
{
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(typePossessions)) || !inventory_slot.IsContainerIndex(containerInvalid) || !inventory_slot.IsSocketIndex(socketInvalid))
return textures::textureInvalid;
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
}
int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
{
switch (texture_index) {
case textures::armorHead:
return slotHead;
case textures::armorChest:
return slotChest;
case textures::armorArms:
return slotArms;
case textures::armorWrist:
return slotWrist1;
case textures::armorHands:
return slotHands;
case textures::armorLegs:
return slotLegs;
case textures::armorFeet:
return slotFeet;
case textures::weaponPrimary:
return slotPrimary;
case textures::weaponSecondary:
return slotSecondary;
default:
return slotInvalid;
}
}
bool EQEmu::InventorySlot::IsValidSlot() const
{
if (_typeless)
return false;
int16 slot_count = inventory::SlotCount(_type_index);
if (!slot_count || _slot_index < inventory::slotBegin || _slot_index >= slot_count)
return false;
if (_container_index < inventory::containerInvalid || _container_index >= inventory::ContainerCount)
return false;
if (_socket_index < inventory::socketInvalid || _socket_index >= inventory::SocketCount)
return false;
return true;
}
bool EQEmu::InventorySlot::IsDeleteSlot() const
{
if (_typeless)
return (_slot_index == inventory::slotInvalid && _container_index == inventory::containerInvalid && _socket_index == inventory::socketInvalid);
else
return (_type_index == inventory::typeInvalid && _slot_index == inventory::slotInvalid && _container_index == inventory::containerInvalid && _socket_index == inventory::socketInvalid);
}
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
{
/*if (slot_index < inventory::EquipmentBegin || slot_index > inventory::EquipmentEnd)
return false;*/
if ((slot_index < legacy::EQUIPMENT_BEGIN || slot_index > legacy::EQUIPMENT_END) && slot_index != legacy::SLOT_POWER_SOURCE)
return false;
return true;
}
bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
{
/*if (slot_index < inventory::GeneralBegin || slot_index > inventory::GeneralEnd)
return false;*/
if (slot_index < legacy::GENERAL_BEGIN || slot_index > legacy::GENERAL_END)
return false;
return true;
}
bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
{
/*if (slot_index != inventory::slotCursor)
return false;*/
if (slot_index != legacy::SLOT_CURSOR)
return false;
return true;
}
bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
{
/*if ((slot_index != inventory::slotRange) && (slot_index != inventory::slotPrimary) && (slot_index != inventory::slotSecondary))
return false;*/
if ((slot_index != legacy::SLOT_RANGE) && (slot_index != legacy::SLOT_PRIMARY) && (slot_index != legacy::SLOT_SECONDARY))
return false;
return true;
}
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
{
switch (slot_index) {
case inventory::slotHead:
case inventory::slotChest:
case inventory::slotArms:
case inventory::slotWrist1:
case inventory::slotHands:
case inventory::slotLegs:
case inventory::slotFeet:
case inventory::slotPrimary:
case inventory::slotSecondary:
return true;
default:
return false;
}
}
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
{
switch (slot_index) {
case inventory::slotHead:
case inventory::slotChest:
case inventory::slotArms:
case inventory::slotWrist1:
case inventory::slotHands:
case inventory::slotLegs:
case inventory::slotFeet:
return true;
default:
return false;
}
}
bool EQEmu::InventorySlot::IsEquipmentSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsEquipmentIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsGeneralSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsGeneralIndex(_socket_index);
}
bool EQEmu::InventorySlot::IsCursorSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsCursorIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsWeaponSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsWeaponIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsTextureSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsTextureIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsTintableSlot() const
{
if (!_typeless && (_type_index != inventory::typePossessions))
return false;
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
return false;
return IsTintableIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsSlot() const
{
if (!_typeless && (_type_index == inventory::typeInvalid))
return false;
if (_slot_index == inventory::slotInvalid)
return false;
if (_container_index != inventory::containerInvalid)
return false;
if (_socket_index != inventory::socketInvalid)
return false;
return true;
}
bool EQEmu::InventorySlot::IsSlotSocket() const
{
if (!_typeless && (_type_index == inventory::typeInvalid))
return false;
if (_slot_index == inventory::slotInvalid)
return false;
if (_container_index != inventory::containerInvalid)
return false;
if (_socket_index == inventory::socketInvalid)
return false;
return true;
}
bool EQEmu::InventorySlot::IsContainer() const
{
if (!_typeless && (_type_index == inventory::typeInvalid))
return false;
if (_slot_index == inventory::slotInvalid)
return false;
if (_container_index == inventory::containerInvalid)
return false;
if (_socket_index != inventory::socketInvalid)
return false;
return true;
}
bool EQEmu::InventorySlot::IsContainerSocket() const
{
if (!_typeless && (_type_index == inventory::typeInvalid))
return false;
if (_slot_index == inventory::slotInvalid)
return false;
if (_container_index == inventory::containerInvalid)
return false;
if (_socket_index == inventory::socketInvalid)
return false;
return true;
}
EQEmu::InventorySlot EQEmu::InventorySlot::ToTopOwner() const
{
return InventorySlot(_type_index, _slot_index);
}
EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
{
if (IsSlot() || IsSlotSocket() || IsContainer())
return InventorySlot(_type_index, _slot_index);
if (IsContainerSocket())
return InventorySlot(_type_index, _slot_index, _container_index);
return InventorySlot();
}
const std::string EQEmu::InventorySlot::ToString() const
{
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
const std::string EQEmu::InventorySlot::ToName() const
{
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
void EQEmu::InventorySlot::SetInvalidSlot()
{
_type_index = inventory::typeInvalid;
_slot_index = inventory::slotInvalid;
_container_index = inventory::containerInvalid;
_socket_index = inventory::socketInvalid;
}
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
//{
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
// return true;
//
// return false;
//}
//bool EQEmu::InventorySlot::IsBonusSlot() const
//{
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
// return false;
//
// return IsBonusIndex(_slot_index);
//}
bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQEmu::InventorySlot& rhs)
{
if (lhs.SlotIndex() < rhs.SlotIndex())
return true;
if ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() < rhs.ContainerIndex()))
return true;
if ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() < rhs.SocketIndex()))
return true;
return false;
}
bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
{
if (Typeless() || rhs.Typeless())
return inventory_slot_typeless_lessthan(*this, rhs);
if (TypeIndex() < rhs.TypeIndex())
return true;
if ((TypeIndex() == rhs.TypeIndex()) && (SlotIndex() < rhs.SlotIndex()))
return true;
if ((TypeIndex() == rhs.TypeIndex()) && (SlotIndex() == rhs.SlotIndex()) && (ContainerIndex() < rhs.ContainerIndex()))
return true;
if ((TypeIndex() == rhs.TypeIndex()) && (SlotIndex() == rhs.SlotIndex()) && (ContainerIndex() == rhs.ContainerIndex()) && (SocketIndex() < rhs.SocketIndex()))
return true;
return false;
}
bool EQEmu::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
{
if (lhs.Typeless() || rhs.Typeless())
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
return ((lhs.TypeIndex() == rhs.TypeIndex()) && (lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
}

133
common/inventory_slot.h Normal file
View File

@ -0,0 +1,133 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_INVENTORY_SLOT
#define COMMON_INVENTORY_SLOT
#include "emu_constants.h"
namespace EQEmu
{
class InventorySlot;
namespace inventory {
int8 ConvertEquipmentIndexToTextureIndex(int16 slot_index);
int8 ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot);
int16 ConvertTextureIndexToEquipmentIndex(int8 texture_index);
}
class InventorySlot {
public:
InventorySlot() : _type_index(inventory::typeInvalid), _slot_index(inventory::slotInvalid), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
InventorySlot(int16 type_index) : _type_index(type_index), _slot_index(inventory::slotInvalid), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
InventorySlot(int16 type_index, int16 parent_index) : _type_index(type_index), _slot_index(parent_index), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
InventorySlot(int16 type_index, int16 parent_index, int16 bag_index) : _type_index(type_index), _slot_index(parent_index), _container_index(bag_index), _socket_index(inventory::socketInvalid), _typeless(false) { }
InventorySlot(int16 type_index, int16 parent_index, int16 bag_index, int16 aug_index) : _type_index(type_index), _slot_index(parent_index), _container_index(bag_index), _socket_index(aug_index), _typeless(false) { }
InventorySlot(const InventorySlot& r) : _type_index(r._type_index), _slot_index(r._slot_index), _container_index(r._container_index), _socket_index(r._socket_index), _typeless(r._typeless) { }
InventorySlot(int16 type_index, const InventorySlot& r) : _type_index(type_index), _slot_index(r._slot_index), _container_index(r._container_index), _socket_index(r._socket_index), _typeless(false) { }
inline int16 TypeIndex() const { return _type_index; }
inline int16 SlotIndex() const { return _slot_index; }
inline int16 ContainerIndex() const { return _container_index; }
inline int16 SocketIndex() const { return _socket_index; }
bool Typeless() const { return _typeless; }
bool IsValidSlot() const;
bool IsDeleteSlot() const;
static bool IsEquipmentIndex(int16 slot_index);
static bool IsGeneralIndex(int16 slot_index);
static bool IsCursorIndex(int16 slot_index);
static bool IsWeaponIndex(int16 slot_index);
static bool IsTextureIndex(int16 slot_index);
static bool IsTintableIndex(int16 slot_index);
bool IsEquipmentSlot() const;
bool IsGeneralSlot() const;
bool IsCursorSlot() const;
bool IsWeaponSlot() const;
bool IsTextureSlot() const;
bool IsTintableSlot() const;
bool IsSlot() const;
bool IsSlotSocket() const;
bool IsContainer() const;
bool IsContainerSocket() const;
InventorySlot ToTopOwner() const;
InventorySlot ToOwner() const;
const std::string ToString() const;
const std::string ToName() const;
bool IsTypeIndex(int16 type_index) const { return (_type_index == type_index); }
bool IsSlotIndex(int16 slot_index) const { return (_slot_index == slot_index); }
bool IsContainerIndex(int16 container_index) const { return (_container_index == container_index); }
bool IsSocketIndex(int16 socket_index) const { return (_socket_index == socket_index); }
void SetType(int16 type_index) { _type_index = type_index; }
void SetSlot(int16 slot_index) { _slot_index = slot_index; }
void SetContainer(int16 container_index) { _container_index = container_index; }
void SetSocket(int16 socket_index) { _socket_index = socket_index; }
void SetInvalidSlot();
void SetTypeInvalid() { _type_index = inventory::typeInvalid; }
void SetSlotInvalid() { _slot_index = inventory::slotInvalid; }
void SetContainerInvalid() { _container_index = inventory::containerInvalid; }
void SetSocketInvalid() { _socket_index = inventory::socketInvalid; }
void SetTypeBegin() { _type_index = inventory::typeBegin; }
void SetSlotBegin() { _slot_index = inventory::slotBegin; }
void SetContainerBegin() { _container_index = inventory::containerBegin; }
void SetSocketBegin() { _socket_index = inventory::socketBegin; }
void IncrementType() { ++_type_index; }
void IncrementSlot() { ++_slot_index; }
void IncrementContainer() { ++_container_index; }
void IncrementSocket() { ++_socket_index; }
void SetTypeless() { _typeless = true; }
void ClearTypeless() { _typeless = false; }
// these two methods should really check for all bonus-valid slots..currently checks for equipment only (rework needed)
//static bool IsBonusIndex(int16 slot_index);
//bool IsBonusSlot() const;
bool operator<(const InventorySlot& rhs) const;
private:
int16 _type_index;
//int16 _unknown2; // not implemented
int16 _slot_index;
int16 _container_index;
int16 _socket_index;
//int16 _unknown1; // not implemented
bool _typeless;
};
bool operator==(const InventorySlot& lhs, const InventorySlot& rhs);
bool operator!=(const InventorySlot& lhs, const InventorySlot& rhs) { return (!(lhs == rhs)); }
} /*EQEmu*/
#endif /*COMMON_INVENTORY_SLOT*/

View File

@ -464,9 +464,9 @@ namespace EQEmu
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint8 AugSlotType[inventory::SocketCount]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[inventory::SocketCount]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[inventory::SocketCount]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;

View File

@ -158,7 +158,7 @@ EQEmu::ItemInstance* Inventory::GetItem(int16 slot_id) const
EQEmu::ItemInstance* result = nullptr;
// Cursor
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
// Cursor slot
result = m_cursor.peek_front();
}
@ -180,7 +180,7 @@ EQEmu::ItemInstance* Inventory::GetItem(int16 slot_id) const
result = _GetItem(m_inv, slot_id);
}
else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) ||
(slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) {
(slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) || (slot_id == EQEmu::inventory::slotPowerSource)) {
// Equippable slots (on body)
result = _GetItem(m_worn, slot_id);
}
@ -250,7 +250,7 @@ int16 Inventory::PutItem(int16 slot_id, const EQEmu::ItemInstance& inst)
int16 Inventory::PushCursor(const EQEmu::ItemInstance& inst)
{
m_cursor.push(inst.Clone());
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
EQEmu::ItemInstance* Inventory::GetCursorItem()
@ -316,7 +316,7 @@ bool Inventory::CheckNoDrop(int16 slot_id) {
if (!inst) return false;
if (!inst->GetItem()->NoDrop) return true;
if (inst->GetItem()->ItemClass == 1) {
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
EQEmu::ItemInstance* bagitem = GetItem(Inventory::CalcSlotId(slot_id, i));
if (bagitem && !bagitem->GetItem()->NoDrop)
return true;
@ -331,10 +331,10 @@ EQEmu::ItemInstance* Inventory::PopItem(int16 slot_id)
{
EQEmu::ItemInstance* p = nullptr;
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
p = m_cursor.pop();
}
else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) {
else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::inventory::slotPowerSource)) {
p = m_worn[slot_id];
m_worn.erase(slot_id);
}
@ -390,9 +390,9 @@ bool Inventory::HasSpaceForItem(const EQEmu::ItemData *ItemToTry, int16 Quantity
}
if (InvItem && InvItem->IsClassBag()) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize = InvItem->GetItem()->BagSlots;
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
for (uint8 BagSlot = EQEmu::inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
InvItem = GetItem(BaseSlotID + BagSlot);
@ -434,11 +434,11 @@ bool Inventory::HasSpaceForItem(const EQEmu::ItemData *ItemToTry, int16 Quantity
}
else if (InvItem->IsClassBag() && CanItemFitInContainer(ItemToTry, InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize = InvItem->GetItem()->BagSlots;
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot<BagSize; BagSlot++) {
for (uint8 BagSlot = EQEmu::inventory::containerBegin; BagSlot<BagSize; BagSlot++) {
InvItem = GetItem(BaseSlotID + BagSlot);
@ -633,11 +633,11 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
continue;
}
int16 base_slot_id = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
int16 base_slot_id = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 slots = inst->GetItem()->BagSlots;
uint8 j;
for (j = SUB_INDEX_BEGIN; j<slots; j++) {
for (j = EQEmu::inventory::containerBegin; j<slots; j++) {
if (!GetItem(base_slot_id + j)) {
// Found available slot within bag
return (base_slot_id + j);
@ -650,7 +650,7 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
if (try_cursor) {
// Always room on cursor (it's a queue)
// (we may wish to cap this in the future)
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
// No available slots
@ -674,7 +674,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
return free_slot;
}
return EQEmu::legacy::SlotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...)
return EQEmu::inventory::slotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...)
}
// step 2: find partial room for stackables
@ -696,7 +696,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
continue;
if (main_inst->IsClassBag()) { // if item-specific containers already have bad items, we won't fix it here...
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
for (uint8 free_bag_slot = EQEmu::inventory::containerBegin; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::inventory::ContainerCount); ++free_bag_slot) {
const EQEmu::ItemInstance* sub_inst = main_inst->GetItem(free_bag_slot);
if (!sub_inst)
@ -717,7 +717,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
if (!main_inst || (main_inst->GetItem()->BagType != EQEmu::item::BagTypeQuiver) || !main_inst->IsClassBag())
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
for (uint8 free_bag_slot = EQEmu::inventory::containerBegin; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::inventory::ContainerCount); ++free_bag_slot) {
if (!main_inst->GetItem(free_bag_slot))
return Inventory::CalcSlotId(free_slot, free_bag_slot);
}
@ -732,7 +732,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
if (!main_inst || (main_inst->GetItem()->BagType != EQEmu::item::BagTypeBandolier) || !main_inst->IsClassBag())
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
for (uint8 free_bag_slot = EQEmu::inventory::containerBegin; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::inventory::ContainerCount); ++free_bag_slot) {
if (!main_inst->GetItem(free_bag_slot))
return Inventory::CalcSlotId(free_slot, free_bag_slot);
}
@ -754,7 +754,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
if ((main_inst->GetItem()->BagSize < inst->GetItem()->Size) || (main_inst->GetItem()->BagType == EQEmu::item::BagTypeBandolier) || (main_inst->GetItem()->BagType == EQEmu::item::BagTypeQuiver))
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
for (uint8 free_bag_slot = EQEmu::inventory::containerBegin; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::inventory::ContainerCount); ++free_bag_slot) {
if (!main_inst->GetItem(free_bag_slot))
return Inventory::CalcSlotId(free_slot, free_bag_slot);
}
@ -762,7 +762,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst) {
}
//return INVALID_INDEX; // everything else pushes to the cursor
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
// Opposite of below: Get parent bag slot_id from a slot inside of bag
@ -775,19 +775,19 @@ int16 Inventory::CalcSlotId(int16 slot_id) {
//else if (slot_id >= 3100 && slot_id <= 3179) should be {3031..3110}..where did this range come from!!? (verified db save range)
if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) {
parent_slot_id = EQEmu::legacy::GENERAL_BEGIN + (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE;
parent_slot_id = EQEmu::legacy::GENERAL_BEGIN + (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) / EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) {
parent_slot_id = EQEmu::legacy::SlotCursor;
parent_slot_id = EQEmu::inventory::slotCursor;
}
else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) {
parent_slot_id = EQEmu::legacy::BANK_BEGIN + (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE;
parent_slot_id = EQEmu::legacy::BANK_BEGIN + (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) / EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
parent_slot_id = EQEmu::legacy::SHARED_BANK_BEGIN + (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE;
parent_slot_id = EQEmu::legacy::SHARED_BANK_BEGIN + (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) / EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) {
parent_slot_id = EQEmu::legacy::TRADE_BEGIN + (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE;
parent_slot_id = EQEmu::legacy::TRADE_BEGIN + (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) / EQEmu::inventory::ContainerCount;
}
return parent_slot_id;
@ -800,20 +800,20 @@ int16 Inventory::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
int16 slot_id = INVALID_INDEX;
if (bagslot_id == EQEmu::legacy::SlotCursor || bagslot_id == 8000) {
if (bagslot_id == EQEmu::inventory::slotCursor || bagslot_id == 8000) {
slot_id = EQEmu::legacy::CURSOR_BAG_BEGIN + bagidx;
}
else if (bagslot_id >= EQEmu::legacy::GENERAL_BEGIN && bagslot_id <= EQEmu::legacy::GENERAL_END) {
slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::GENERAL_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx;
slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::GENERAL_BEGIN) * EQEmu::inventory::ContainerCount + bagidx;
}
else if (bagslot_id >= EQEmu::legacy::BANK_BEGIN && bagslot_id <= EQEmu::legacy::BANK_END) {
slot_id = EQEmu::legacy::BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx;
slot_id = EQEmu::legacy::BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount + bagidx;
}
else if (bagslot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && bagslot_id <= EQEmu::legacy::SHARED_BANK_END) {
slot_id = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx;
slot_id = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount + bagidx;
}
else if (bagslot_id >= EQEmu::legacy::TRADE_BEGIN && bagslot_id <= EQEmu::legacy::TRADE_END) {
slot_id = EQEmu::legacy::TRADE_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::TRADE_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx;
slot_id = EQEmu::legacy::TRADE_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::TRADE_BEGIN) * EQEmu::inventory::ContainerCount + bagidx;
}
return slot_id;
@ -827,19 +827,19 @@ uint8 Inventory::CalcBagIdx(int16 slot_id) {
// index = (slot_id - EmuConstants::BANK_BEGIN) % EmuConstants::ITEM_CONTAINER_SIZE;
if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) {
index = (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE;
index = (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) % EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) {
index = (slot_id - EQEmu::legacy::CURSOR_BAG_BEGIN); // % EQEmu::legacy::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots
}
else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) {
index = (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE;
index = (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) % EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
index = (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE;
index = (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) % EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) {
index = (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE;
index = (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) % EQEmu::inventory::ContainerCount;
}
else if (slot_id >= EQEmu::legacy::WORLD_BEGIN && slot_id <= EQEmu::legacy::WORLD_END) {
index = (slot_id - EQEmu::legacy::WORLD_BEGIN); // % EQEmu::legacy::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots
@ -852,24 +852,24 @@ int16 Inventory::CalcSlotFromMaterial(uint8 material)
{
switch (material)
{
case EQEmu::textures::TextureHead:
return EQEmu::legacy::SlotHead;
case EQEmu::textures::TextureChest:
return EQEmu::legacy::SlotChest;
case EQEmu::textures::TextureArms:
return EQEmu::legacy::SlotArms;
case EQEmu::textures::TextureWrist:
return EQEmu::legacy::SlotWrist1; // there's 2 bracers, only one bracer material
case EQEmu::textures::TextureHands:
return EQEmu::legacy::SlotHands;
case EQEmu::textures::TextureLegs:
return EQEmu::legacy::SlotLegs;
case EQEmu::textures::TextureFeet:
return EQEmu::legacy::SlotFeet;
case EQEmu::textures::TexturePrimary:
return EQEmu::legacy::SlotPrimary;
case EQEmu::textures::TextureSecondary:
return EQEmu::legacy::SlotSecondary;
case EQEmu::textures::armorHead:
return EQEmu::inventory::slotHead;
case EQEmu::textures::armorChest:
return EQEmu::inventory::slotChest;
case EQEmu::textures::armorArms:
return EQEmu::inventory::slotArms;
case EQEmu::textures::armorWrist:
return EQEmu::inventory::slotWrist1; // there's 2 bracers, only one bracer material
case EQEmu::textures::armorHands:
return EQEmu::inventory::slotHands;
case EQEmu::textures::armorLegs:
return EQEmu::inventory::slotLegs;
case EQEmu::textures::armorFeet:
return EQEmu::inventory::slotFeet;
case EQEmu::textures::weaponPrimary:
return EQEmu::inventory::slotPrimary;
case EQEmu::textures::weaponSecondary:
return EQEmu::inventory::slotSecondary;
default:
return INVALID_INDEX;
}
@ -879,27 +879,27 @@ uint8 Inventory::CalcMaterialFromSlot(int16 equipslot)
{
switch (equipslot)
{
case EQEmu::legacy::SlotHead:
return EQEmu::textures::TextureHead;
case EQEmu::legacy::SlotChest:
return EQEmu::textures::TextureChest;
case EQEmu::legacy::SlotArms:
return EQEmu::textures::TextureArms;
case EQEmu::legacy::SlotWrist1:
case EQEmu::inventory::slotHead:
return EQEmu::textures::armorHead;
case EQEmu::inventory::slotChest:
return EQEmu::textures::armorChest;
case EQEmu::inventory::slotArms:
return EQEmu::textures::armorArms;
case EQEmu::inventory::slotWrist1:
//case SLOT_BRACER02: // non-live behavior
return EQEmu::textures::TextureWrist;
case EQEmu::legacy::SlotHands:
return EQEmu::textures::TextureHands;
case EQEmu::legacy::SlotLegs:
return EQEmu::textures::TextureLegs;
case EQEmu::legacy::SlotFeet:
return EQEmu::textures::TextureFeet;
case EQEmu::legacy::SlotPrimary:
return EQEmu::textures::TexturePrimary;
case EQEmu::legacy::SlotSecondary:
return EQEmu::textures::TextureSecondary;
return EQEmu::textures::armorWrist;
case EQEmu::inventory::slotHands:
return EQEmu::textures::armorHands;
case EQEmu::inventory::slotLegs:
return EQEmu::textures::armorLegs;
case EQEmu::inventory::slotFeet:
return EQEmu::textures::armorFeet;
case EQEmu::inventory::slotPrimary:
return EQEmu::textures::weaponPrimary;
case EQEmu::inventory::slotSecondary:
return EQEmu::textures::weaponSecondary;
default:
return EQEmu::textures::TextureInvalid;
return EQEmu::textures::materialInvalid;
}
}
@ -923,7 +923,7 @@ bool Inventory::CanItemFitInContainer(const EQEmu::ItemData *ItemToTry, const EQ
bool Inventory::SupportsClickCasting(int16 slot_id)
{
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::legacy::SlotPowerSource)
if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::inventory::slotPowerSource)
{
return true;
}
@ -938,7 +938,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id)
bool Inventory::SupportsPotionBeltCasting(int16 slot_id)
{
if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::legacy::SlotPowerSource || (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END))
if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::inventory::slotPowerSource || (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END))
return true;
return false;
@ -947,7 +947,7 @@ bool Inventory::SupportsPotionBeltCasting(int16 slot_id)
// Test whether a given slot can support a container item
bool Inventory::SupportsContainers(int16 slot_id)
{
if ((slot_id == EQEmu::legacy::SlotCursor) ||
if ((slot_id == EQEmu::inventory::slotCursor) ||
(slot_id >= EQEmu::legacy::GENERAL_BEGIN && slot_id <= EQEmu::legacy::GENERAL_END) ||
(slot_id >= EQEmu::legacy::BANK_BEGIN && slot_id <= EQEmu::legacy::BANK_END) ||
(slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_END) ||
@ -989,7 +989,7 @@ int Inventory::GetSlotByItemInst(EQEmu::ItemInstance *inst) {
}
if (m_cursor.peek_front() == inst) {
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
return INVALID_INDEX;
@ -1000,8 +1000,8 @@ uint8 Inventory::FindBrightestLightType()
uint8 brightest_light_type = 0;
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
if ((iter->first < EQEmu::legacy::EQUIPMENT_BEGIN || iter->first > EQEmu::legacy::EQUIPMENT_END) && iter->first != EQEmu::legacy::SlotPowerSource) { continue; }
if (iter->first == EQEmu::legacy::SlotAmmo) { continue; }
if ((iter->first < EQEmu::legacy::EQUIPMENT_BEGIN || iter->first > EQEmu::legacy::EQUIPMENT_END) && iter->first != EQEmu::inventory::slotPowerSource) { continue; }
if (iter->first == EQEmu::inventory::slotAmmo) { continue; }
auto inst = iter->second;
if (inst == nullptr) { continue; }
@ -1145,13 +1145,13 @@ int16 Inventory::_PutItem(int16 slot_id, EQEmu::ItemInstance* inst)
int16 result = INVALID_INDEX;
int16 parentSlot = INVALID_INDEX;
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
// Replace current item on cursor, if exists
m_cursor.pop(); // no memory delete, clients of this function know what they are doing
m_cursor.push_front(inst);
result = slot_id;
}
else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) {
else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::inventory::slotPowerSource)) {
m_worn[slot_id] = inst;
result = slot_id;
}
@ -1209,7 +1209,7 @@ int16 Inventory::_HasItem(std::map<int16, EQEmu::ItemInstance*>& bucket, uint32
return iter->first;
}
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return EQEmu::legacy::SLOT_AUGMENT;
}
@ -1226,7 +1226,7 @@ int16 Inventory::_HasItem(std::map<int16, EQEmu::ItemInstance*>& bucket, uint32
return Inventory::CalcSlotId(iter->first, bag_iter->first);
}
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return EQEmu::legacy::SLOT_AUGMENT;
}
@ -1254,10 +1254,10 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
if (inst->GetID() == item_id) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return EQEmu::legacy::SLOT_AUGMENT;
}
@ -1271,10 +1271,10 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
if (bag_inst->GetID() == item_id) {
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first);
return Inventory::CalcSlotId(EQEmu::inventory::slotCursor, bag_iter->first);
}
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return EQEmu::legacy::SLOT_AUGMENT;
}
@ -1331,7 +1331,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
if (inst->IsClassCommon() && inst->GetItem()->ItemType == use) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
}
if (!inst->IsClassBag()) { continue; }
@ -1343,7 +1343,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->ItemType == use) {
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first);
return Inventory::CalcSlotId(EQEmu::inventory::slotCursor, bag_iter->first);
}
}
@ -1363,7 +1363,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, EQEmu::ItemInstance*>& buck
if (inst->GetItem()->LoreGroup == loregroup)
return iter->first;
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
auto aug_inst = inst->GetAugment(index);
if (aug_inst == nullptr) { continue; }
@ -1380,7 +1380,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, EQEmu::ItemInstance*>& buck
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
return Inventory::CalcSlotId(iter->first, bag_iter->first);
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
auto aug_inst = bag_inst->GetAugment(index);
if (aug_inst == nullptr) { continue; }
@ -1401,9 +1401,9 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
if (inst == nullptr) { continue; }
if (inst->GetItem()->LoreGroup == loregroup)
return EQEmu::legacy::SlotCursor;
return EQEmu::inventory::slotCursor;
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
auto aug_inst = inst->GetAugment(index);
if (aug_inst == nullptr) { continue; }
@ -1418,9 +1418,9 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
if (bag_inst == nullptr) { continue; }
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first);
return Inventory::CalcSlotId(EQEmu::inventory::slotCursor, bag_iter->first);
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
auto aug_inst = bag_inst->GetAugment(index);
if (aug_inst == nullptr) { continue; }
@ -1657,7 +1657,7 @@ bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
// another "shouldn't do" fix..will be fixed in future updates (requires code and database work)
int16 use_slot = INVALID_INDEX;
if (slot_id == EQEmu::legacy::SlotPowerSource) { use_slot = EQEmu::legacy::SlotGeneral1; }
if (slot_id == EQEmu::inventory::slotPowerSource) { use_slot = EQEmu::inventory::slotGeneral1; }
if ((uint16)slot_id <= EQEmu::legacy::EQUIPMENT_END) { use_slot = slot_id; }
if (use_slot != INVALID_INDEX) {
@ -1673,8 +1673,8 @@ bool EQEmu::ItemInstance::IsAugmentable() const
if (!m_item)
return false;
for (int index = 0; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
if (m_item->AugSlotType[index] != NO_ITEM)
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (m_item->AugSlotType[index] != 0)
return true;
}
@ -1688,7 +1688,7 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
return false;
int index = EQEmu::legacy::EQUIPMENT_BEGIN;
for (; index <= EQEmu::legacy::SlotGeneral1; ++index) { // MainGeneral1 should be EQEmu::legacy::EQUIPMENT_END
for (; index <= EQEmu::inventory::slotGeneral1; ++index) { // MainGeneral1 should be EQEmu::legacy::EQUIPMENT_END
if (m_item->Slots & (1 << index)) {
if (aug_wear_slots & (1 << index))
break;
@ -1703,14 +1703,14 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
if (!m_item || !m_item->IsClassCommon())
return INVALID_INDEX;
int index = AUG_INDEX_BEGIN;
for (; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
int index = EQEmu::inventory::socketBegin;
for (; index < EQEmu::inventory::SocketCount; ++index) {
if (GetItem(index)) { continue; }
if (augtype == -1 || (m_item->AugSlotType[index] && ((1 << (m_item->AugSlotType[index] - 1)) & augtype)))
break;
}
return (index < EQEmu::legacy::ITEM_COMMON_SIZE) ? index : INVALID_INDEX;
return (index < EQEmu::inventory::SocketCount) ? index : INVALID_INDEX;
}
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
@ -1741,7 +1741,7 @@ uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
if (item)
return item->GetID();
return NO_ITEM;
return 0;
}
void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
@ -1853,7 +1853,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
return INVALID_INDEX;
uint8 slots = m_item->BagSlots, i;
for (i = SUB_INDEX_BEGIN; i < slots; i++) {
for (i = EQEmu::inventory::containerBegin; i < slots; i++) {
if (!GetItem(i))
break;
}
@ -1870,7 +1870,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
if (m_item && !m_item->IsClassBag()) { return item_count; }
for (int index = SUB_INDEX_BEGIN; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
for (int index = EQEmu::inventory::containerBegin; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
return item_count;
}
@ -1880,7 +1880,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
if (!m_item || !m_item->IsClassBag())
return false;
for (int index = SUB_INDEX_BEGIN; index < m_item->BagSlots; ++index) {
for (int index = EQEmu::inventory::containerBegin; index < m_item->BagSlots; ++index) {
if (GetItem(index))
return true;
}
@ -1902,7 +1902,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
if (ornamentationAugtype == 0) { return nullptr; }
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
{
if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype)
{
@ -2020,7 +2020,7 @@ bool EQEmu::ItemInstance::CanTransform(const EQEmu::ItemData *ItemToTry, const E
uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
{
if (!m_item || !m_item->IsClassCommon())
return NO_ITEM;
return 0;
return GetItemID(slot);
}
@ -2036,7 +2036,7 @@ void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
{
if (item_id == NO_ITEM) { return; }
if (item_id == 0) { return; }
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
const ItemInstance* aug = db->CreateItem(item_id);
@ -2069,7 +2069,7 @@ bool EQEmu::ItemInstance::IsAugmented()
if (!m_item || !m_item->IsClassCommon())
return false;
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
if (GetAugmentItemID(index))
return true;
}
@ -2197,8 +2197,8 @@ bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
if (!m_item) { return false; }
else if (Inventory::SupportsContainers(slot_id)) { return true; }
else if (m_item->Slots & (1 << slot_id)) { return true; }
else if (slot_id == EQEmu::legacy::SlotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... <watch>
else if (slot_id != EQEmu::legacy::SlotPowerSource && slot_id > EQEmu::legacy::EQUIPMENT_END) { return true; }
else if (slot_id == EQEmu::inventory::slotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... <watch>
else if (slot_id != EQEmu::inventory::slotPowerSource && slot_id > EQEmu::legacy::EQUIPMENT_END) { return true; }
else { return false; }
}
@ -2350,7 +2350,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
if (item) {
ac = item->AC;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
ac += GetAugment(i)->GetItemArmorClass();
}
@ -2392,7 +2392,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
}
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
GetAugment(i)->GetItemElementalDamage(magic, fire, cold, poison, disease, chromatic, prismatic, physical, corruption);
}
@ -2409,7 +2409,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
return flag;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
if (GetAugment(i))
flag = GetAugment(i)->GetItemElementalFlag();
if (flag)
@ -2430,7 +2430,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
return damage;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
if (GetAugment(i))
damage = GetAugment(i)->GetItemElementalDamage();
if (damage)
@ -2449,7 +2449,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
level = item->RecLevel;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
int temp = 0;
if (GetAugment(i)) {
temp = GetAugment(i)->GetItemRecommendedLevel();
@ -2471,7 +2471,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
level = item->ReqLevel;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
int temp = 0;
if (GetAugment(i)) {
temp = GetAugment(i)->GetItemRequiredLevel();
@ -2493,7 +2493,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
damage = item->Damage;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemWeaponDamage();
}
@ -2509,7 +2509,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
damage = item->BackstabDmg;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBackstabDamage();
}
@ -2527,7 +2527,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
return body;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i)) {
body = GetAugment(i)->GetItemBaneDamageBody();
if (body)
@ -2548,7 +2548,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
return race;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i)) {
race = GetAugment(i)->GetItemBaneDamageRace();
if (race)
@ -2568,7 +2568,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
damage += item->BaneDmgAmt;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBaneDamageBody(against);
}
@ -2585,7 +2585,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
damage += item->BaneDmgRaceAmt;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBaneDamageRace(against);
}
@ -2601,7 +2601,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
return 1;
if (augments) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i) && GetAugment(i)->GetItemMagical())
return 1;
}
@ -2616,7 +2616,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
if (item) {
hp = item->HP;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
hp += GetAugment(i)->GetItemHP();
}
@ -2630,7 +2630,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
if (item) {
mana = item->Mana;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
mana += GetAugment(i)->GetItemMana();
}
@ -2644,7 +2644,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
if (item) {
endur = item->Endur;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
endur += GetAugment(i)->GetItemEndur();
}
@ -2658,7 +2658,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
if (item) {
atk = item->Attack;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
atk += GetAugment(i)->GetItemAttack();
}
@ -2672,7 +2672,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
if (item) {
str = item->AStr;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
str += GetAugment(i)->GetItemStr();
}
@ -2686,7 +2686,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
if (item) {
sta = item->ASta;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
sta += GetAugment(i)->GetItemSta();
}
@ -2700,7 +2700,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
if (item) {
total = item->ADex;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemDex();
}
@ -2714,7 +2714,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
if (item) {
total = item->AAgi;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemAgi();
}
@ -2728,7 +2728,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
if (item) {
total = item->AInt;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemInt();
}
@ -2742,7 +2742,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
if (item) {
total = item->AWis;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemWis();
}
@ -2756,7 +2756,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
if (item) {
total = item->ACha;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCha();
}
@ -2770,7 +2770,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
if (item) {
total = item->MR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemMR();
}
@ -2784,7 +2784,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
if (item) {
total = item->FR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemFR();
}
@ -2798,7 +2798,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
if (item) {
total = item->CR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCR();
}
@ -2812,7 +2812,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
if (item) {
total = item->PR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemPR();
}
@ -2826,7 +2826,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
if (item) {
total = item->DR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemDR();
}
@ -2840,7 +2840,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
if (item) {
total = item->SVCorruption;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCorrup();
}
@ -2854,7 +2854,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
if (item) {
total = item->HeroicStr;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicStr();
}
@ -2868,7 +2868,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
if (item) {
total = item->HeroicSta;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicSta();
}
@ -2882,7 +2882,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
if (item) {
total = item->HeroicDex;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicDex();
}
@ -2896,7 +2896,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
if (item) {
total = item->HeroicAgi;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicAgi();
}
@ -2910,7 +2910,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
if (item) {
total = item->HeroicInt;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicInt();
}
@ -2924,7 +2924,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
if (item) {
total = item->HeroicWis;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicWis();
}
@ -2938,7 +2938,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
if (item) {
total = item->HeroicCha;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCha();
}
@ -2952,7 +2952,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
if (item) {
total = item->HeroicMR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicMR();
}
@ -2966,7 +2966,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
if (item) {
total = item->HeroicFR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicFR();
}
@ -2980,7 +2980,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
if (item) {
total = item->HeroicCR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCR();
}
@ -2994,7 +2994,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
if (item) {
total = item->HeroicPR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicPR();
}
@ -3008,7 +3008,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
if (item) {
total = item->HeroicDR;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicDR();
}
@ -3022,7 +3022,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
if (item) {
total = item->HeroicSVCorrup;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCorrup();
}
@ -3036,7 +3036,7 @@ int EQEmu::ItemInstance::GetItemHaste(bool augments) const
if (item) {
total = item->Haste;
if (augments)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
if (GetAugment(i)) {
int temp = GetAugment(i)->GetItemHaste();
if (temp > total)

View File

@ -313,7 +313,7 @@ namespace EQEmu
bool AvailableWearSlot(uint32 aug_wear_slots) const;
int8 AvailableAugmentSlot(int32 augtype) const;
bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const;
inline int32 GetAugmentType() const { return ((m_item) ? m_item->AugType : NO_ITEM); }
inline int32 GetAugmentType() const { return ((m_item) ? m_item->AugType : 0); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == EQEmu::item::ItemEffectExpendable) || (m_item->ItemType == EQEmu::item::ItemTypePotion)) : false); }
@ -353,8 +353,8 @@ namespace EQEmu
bool IsAmmo() const;
// Accessors
const uint32 GetID() const { return ((m_item) ? m_item->ID : NO_ITEM); }
const uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : NO_ITEM); }
const uint32 GetID() const { return ((m_item) ? m_item->ID : 0); }
const uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : 0); }
const ItemData* GetItem() const;
const ItemData* GetUnscaledItem() const;

View File

@ -2079,7 +2079,7 @@ namespace RoF
outapp->WriteUInt32(22); // Equipment count
for (int r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
outapp->WriteUInt32(0);
@ -2099,9 +2099,9 @@ namespace RoF
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Equipment2 count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
for (int r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
@ -2110,7 +2110,7 @@ namespace RoF
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Tint Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
for (int r = 0; r < 7; r++)
{
@ -2120,7 +2120,7 @@ namespace RoF
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Tint2 Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
for (int r = 0; r < 7; r++)
{
@ -3059,12 +3059,12 @@ namespace RoF
eq_cse->Gender = emu_cse->Gender;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQEmu::textures::TextureCount; equip_index++) {
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroForgeModel;
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Material2;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroicModel;
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Unknown2;
eq_cse->Equip[equip_index].Color = emu_cse->Equip[equip_index].Color;
}
@ -4096,7 +4096,7 @@ namespace RoF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@ -4105,15 +4105,15 @@ namespace RoF
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteMaterial;
Equipment[k].HeroForgeModel = emu->equipment.Slot[k].HeroForgeModel;
Equipment[k].Material2 = emu->equipment.Slot[k].Material2;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
Equipment[k].HeroForgeModel = emu->equipment.Slot[k].HeroicModel;
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
else
{
@ -4829,10 +4829,9 @@ namespace RoF
IN(item_id);
int r;
for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
IN(augments[r]);
}
// Max Augs is now 6, but no code to support that many yet
IN(link_hash);
IN(icon);
@ -5622,18 +5621,18 @@ namespace RoF
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + index + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@ -5659,17 +5658,17 @@ namespace RoF
uint32 TempSlot = 0;
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // Main Inventory and Cursor
RoFSlot.Type = invtype::InvTypePossessions;
RoFSlot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
if (serverSlot == EQEmu::inventory::slotPowerSource)
RoFSlot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
RoFSlot.Slot += 3;
else if (serverSlot >= EQEmu::legacy::SlotAmmo) // (> 20)
else if (serverSlot >= EQEmu::inventory::slotAmmo) // (> 20)
RoFSlot.Slot += 1;
}
@ -5681,8 +5680,8 @@ namespace RoF
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
RoFSlot.Type = invtype::InvTypePossessions;
TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::inventory::ContainerCount);
if (RoFSlot.Slot >= invslot::PossessionsGeneral9) // (> 30)
RoFSlot.Slot = invslot::PossessionsCursor;
@ -5699,8 +5698,8 @@ namespace RoF
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
}
@ -5710,8 +5709,8 @@ namespace RoF
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
}
@ -5721,8 +5720,8 @@ namespace RoF
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) {
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
/*
@ -5760,16 +5759,16 @@ namespace RoF
uint32 TempSlot = 0;
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // (< 52)
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // (< 52)
RoFSlot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
if (serverSlot == EQEmu::inventory::slotPowerSource)
RoFSlot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
RoFSlot.Slot += 3;
else if (serverSlot >= EQEmu::legacy::SlotAmmo) // Ammo and Personl Inventory
else if (serverSlot >= EQEmu::inventory::slotAmmo) // Ammo and Personl Inventory
RoFSlot.Slot += 1;
/*else if (ServerSlot >= MainCursor) { // Cursor
@ -5782,8 +5781,8 @@ namespace RoF
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) {
TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::inventory::ContainerCount);
}
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);
@ -5803,7 +5802,7 @@ namespace RoF
if (rofSlot.Type == invtype::InvTypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rofSlot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
TempSlot = EQEmu::inventory::slotPowerSource;
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
TempSlot = rofSlot.Slot - 3;
@ -5825,8 +5824,8 @@ namespace RoF
else // Worn Slots
TempSlot = rofSlot.Slot;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot;
}
@ -5834,8 +5833,8 @@ namespace RoF
else if (rofSlot.Type == invtype::InvTypeBank) {
TempSlot = EQEmu::legacy::BANK_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
else
TempSlot += rofSlot.Slot;
@ -5846,8 +5845,8 @@ namespace RoF
else if (rofSlot.Type == invtype::InvTypeSharedBank) {
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
else
TempSlot += rofSlot.Slot;
@ -5858,10 +5857,10 @@ namespace RoF
else if (rofSlot.Type == invtype::InvTypeTrade) {
TempSlot = EQEmu::legacy::TRADE_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
// OLD CODE:
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::legacy::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::inventory::ContainerCount) + RoFSlot.SubSlot;
else
TempSlot += rofSlot.Slot;
@ -5872,7 +5871,7 @@ namespace RoF
else if (rofSlot.Type == invtype::InvTypeWorld) {
TempSlot = EQEmu::legacy::WORLD_BEGIN;
if (rofSlot.Slot >= SUB_INDEX_BEGIN)
if (rofSlot.Slot >= EQEmu::inventory::containerBegin)
TempSlot += rofSlot.Slot;
ServerSlot = TempSlot;
@ -5903,7 +5902,7 @@ namespace RoF
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
if (rofSlot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
TempSlot = EQEmu::inventory::slotPowerSource;
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
TempSlot = rofSlot.Slot - 3;
@ -5920,8 +5919,8 @@ namespace RoF
else
TempSlot = rofSlot.Slot;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot;
}

View File

@ -2164,7 +2164,7 @@ namespace RoF2
outapp->WriteUInt32(22); // Equipment count
for (int r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
outapp->WriteUInt32(0);
@ -2184,9 +2184,9 @@ namespace RoF2
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Equipment2 count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
for (int r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
@ -2195,7 +2195,7 @@ namespace RoF2
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Tint Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
for (int r = 0; r < 7; r++)
{
@ -2205,7 +2205,7 @@ namespace RoF2
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
outapp->WriteUInt32(EQEmu::textures::TextureCount); // Tint2 Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
for (int r = 0; r < 7; r++)
{
@ -3154,12 +3154,12 @@ namespace RoF2
eq_cse->Gender = emu_cse->Gender;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQEmu::textures::TextureCount; equip_index++) {
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroForgeModel;
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Material2;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroicModel;
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Unknown2;
eq_cse->Equip[equip_index].Color = emu_cse->Equip[equip_index].Color;
}
@ -4321,7 +4321,7 @@ namespace RoF2
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@ -4330,15 +4330,15 @@ namespace RoF2
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteMaterial;
Equipment[k].HeroForgeModel = emu->equipment.Slot[k].HeroForgeModel;
Equipment[k].Material2 = emu->equipment.Slot[k].Material2;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
Equipment[k].HeroForgeModel = emu->equipment.Slot[k].HeroicModel;
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
else
{
@ -5066,7 +5066,7 @@ namespace RoF2
IN(item_id);
int r;
for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
IN(augments[r]);
}
IN(link_hash);
@ -5922,18 +5922,18 @@ namespace RoF2
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + index + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@ -5959,7 +5959,7 @@ namespace RoF2
uint32 TempSlot = 0;
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // Main Inventory and Cursor
if (PacketType == ItemPacketLoot)
{
RoF2Slot.Type = invtype::InvTypeCorpse;
@ -5971,13 +5971,13 @@ namespace RoF2
RoF2Slot.Slot = serverSlot;
}
if (serverSlot == EQEmu::legacy::SlotPowerSource)
if (serverSlot == EQEmu::inventory::slotPowerSource)
RoF2Slot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
else if (serverSlot >= EQEmu::inventory::slotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
RoF2Slot.Slot += 3;
else if (serverSlot >= EQEmu::legacy::SlotAmmo) // (> 20)
else if (serverSlot >= EQEmu::inventory::slotAmmo) // (> 20)
RoF2Slot.Slot += 1;
}
@ -5989,8 +5989,8 @@ namespace RoF2
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
RoF2Slot.Type = invtype::InvTypePossessions;
TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::inventory::ContainerCount);
if (RoF2Slot.Slot >= invslot::PossessionsGeneral9) // (> 30)
RoF2Slot.Slot = invslot::PossessionsCursor;
@ -6007,8 +6007,8 @@ namespace RoF2
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
}
@ -6018,8 +6018,8 @@ namespace RoF2
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
}
@ -6029,8 +6029,8 @@ namespace RoF2
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) {
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
}
/*
@ -6068,16 +6068,16 @@ namespace RoF2
uint32 TempSlot = 0;
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // (< 52)
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // (< 52)
RoF2Slot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
if (serverSlot == EQEmu::inventory::slotPowerSource)
RoF2Slot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
RoF2Slot.Slot += 3;
else if (serverSlot >= EQEmu::legacy::SlotAmmo) // Ammo and Personl Inventory
else if (serverSlot >= EQEmu::inventory::slotAmmo) // Ammo and Personl Inventory
RoF2Slot.Slot += 1;
/*else if (ServerSlot >= MainCursor) { // Cursor
@ -6090,8 +6090,8 @@ namespace RoF2
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) {
TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::inventory::ContainerCount);
}
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);
@ -6111,7 +6111,7 @@ namespace RoF2
if (rof2Slot.Type == invtype::InvTypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
TempSlot = EQEmu::inventory::slotPowerSource;
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
TempSlot = rof2Slot.Slot - 3;
@ -6133,8 +6133,8 @@ namespace RoF2
else // Worn Slots
TempSlot = rof2Slot.Slot;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot;
}
@ -6142,8 +6142,8 @@ namespace RoF2
else if (rof2Slot.Type == invtype::InvTypeBank) {
TempSlot = EQEmu::legacy::BANK_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
else
TempSlot += rof2Slot.Slot;
@ -6154,8 +6154,8 @@ namespace RoF2
else if (rof2Slot.Type == invtype::InvTypeSharedBank) {
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
else
TempSlot += rof2Slot.Slot;
@ -6166,8 +6166,8 @@ namespace RoF2
else if (rof2Slot.Type == invtype::InvTypeTrade) {
TempSlot = EQEmu::legacy::TRADE_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
// OLD CODE:
//TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot;
@ -6180,7 +6180,7 @@ namespace RoF2
else if (rof2Slot.Type == invtype::InvTypeWorld) {
TempSlot = EQEmu::legacy::WORLD_BEGIN;
if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
if (rof2Slot.Slot >= EQEmu::inventory::containerBegin)
TempSlot += rof2Slot.Slot;
ServerSlot = TempSlot;
@ -6215,7 +6215,7 @@ namespace RoF2
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
TempSlot = EQEmu::inventory::slotPowerSource;
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
TempSlot = rof2Slot.Slot - 3;
@ -6232,8 +6232,8 @@ namespace RoF2
else
TempSlot = rof2Slot.Slot;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot;
}

View File

@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@ -1082,7 +1082,7 @@ union
/*00184*/ Texture_Struct equipment[22]; // Total Slots
};
/*00624*/ uint32 equip2_count; // Seen 9
/*00628*/ Texture_Struct equipment2[EQEmu::textures::TextureCount]; // Appears to be Visible slots, but all 0s
/*00628*/ Texture_Struct equipment2[EQEmu::textures::materialCount]; // Appears to be Visible slots, but all 0s
/*00808*/ uint32 tint_count; // Seen 9
/*00812*/ TintProfile item_tint; // RR GG BB 00
/*00848*/ uint32 tint_count2; // Seen 9

View File

@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};

View File

@ -1558,7 +1558,7 @@ namespace SoD
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@ -1998,10 +1998,10 @@ namespace SoD
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQEmu::textures::TextureCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
eq_cse->Equip[equip_index].Color = emu_cse->Equip[equip_index].Color;
}
@ -2568,7 +2568,7 @@ namespace SoD
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
if (emu->size == 0)
{
@ -2765,7 +2765,7 @@ namespace SoD
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@ -2792,13 +2792,13 @@ namespace SoD
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteMaterial;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
if (strlen(emu->title))
{
@ -3869,18 +3869,18 @@ namespace SoD
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + index + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@ -3898,7 +3898,7 @@ namespace SoD
{
uint32 SoDSlot = 0;
if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
SoDSlot = serverSlot + 11;
@ -3906,7 +3906,7 @@ namespace SoD
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
else if (serverSlot == EQEmu::inventory::slotPowerSource)
SoDSlot = invslot::PossessionsPowerSource;
else
SoDSlot = serverSlot;
@ -3932,7 +3932,7 @@ namespace SoD
else if (sodSlot >= invbag::SharedBankBagsBegin && sodSlot <= invbag::SharedBankBagsEnd)
ServerSlot = sodSlot - 1;
else if (sodSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
ServerSlot = EQEmu::inventory::slotPowerSource;
else
ServerSlot = sodSlot;
return ServerSlot;

View File

@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::TextureCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::TextureCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff

View File

@ -1230,7 +1230,7 @@ namespace SoF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@ -1670,10 +1670,10 @@ namespace SoF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQEmu::textures::TextureCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
eq_cse->Equip[equip_index].Color = emu_cse->Equip[equip_index].Color;
}
@ -2101,10 +2101,10 @@ namespace SoF
eq->deity = emu->deity;
eq->drakkin_heritage = emu->drakkin_heritage;
eq->gender = emu->gender;
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment.Slot[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteMaterial;
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
eq->StandState = emu->StandState;
@ -2167,7 +2167,7 @@ namespace SoF
strcpy(eq->name, emu->name);
eq->petOwnerId = emu->petOwnerId;
eq->pvp = 0; // 0 = non-pvp colored name, 1 = red pvp name
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
eq->anon = emu->anon;
@ -3237,18 +3237,18 @@ namespace SoF
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + index + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@ -3266,7 +3266,7 @@ namespace SoF
{
uint32 SoFSlot = 0;
if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
SoFSlot = serverSlot + 11;
@ -3274,7 +3274,7 @@ namespace SoF
SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
SoFSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
else if (serverSlot == EQEmu::inventory::slotPowerSource)
SoFSlot = invslot::PossessionsPowerSource;
else
SoFSlot = serverSlot;
@ -3301,7 +3301,7 @@ namespace SoF
else if (sofSlot >= invbag::SharedBankBagsBegin && sofSlot <= invbag::SharedBankBagsEnd)
ServerSlot = sofSlot - 1;
else if (sofSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
ServerSlot = EQEmu::inventory::slotPowerSource;
else
ServerSlot = sofSlot;

View File

@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::TextureCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::TextureCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff

View File

@ -981,7 +981,7 @@ namespace Titanium
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
OUT(item_material.Slot[r].Material);
OUT(item_tint.Slot[r].Color);
}
@ -1301,14 +1301,14 @@ namespace Titanium
if (eq->Race[char_index] > 473)
eq->Race[char_index] = 1;
for (int index = 0; index < EQEmu::textures::TextureCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = emu_cse->Equip[index].Color;
}
eq->BeardColor[char_index] = emu_cse->BeardColor;
eq->HairStyle[char_index] = emu_cse->HairStyle;
for (int index = 0; index < EQEmu::textures::TextureCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = emu_cse->Equip[index].Material;
}
@ -1338,14 +1338,14 @@ namespace Titanium
for (; char_index < 10; ++char_index) {
eq->Race[char_index] = 0;
for (int index = 0; index < EQEmu::textures::TextureCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = 0;
}
eq->BeardColor[char_index] = 0;
eq->HairStyle[char_index] = 0;
for (int index = 0; index < EQEmu::textures::TextureCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = 0;
}
@ -1677,7 +1677,7 @@ namespace Titanium
eq->petOwnerId = emu->petOwnerId;
eq->guildrank = emu->guildrank;
// eq->unknown0194[3] = emu->unknown0194[3];
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
@ -2437,7 +2437,7 @@ namespace Titanium
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
// Sub data
for (int index = SUB_INDEX_BEGIN; index < invbag::ItemBagSize; ++index) {
for (int index = EQEmu::inventory::containerBegin; index < invbag::ItemBagSize; ++index) {
ob << '|';
EQEmu::ItemInstance* sub = inst->GetItem(index);

View File

@ -144,7 +144,7 @@ struct TintProfile {
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@ -167,7 +167,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::TextureCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();

View File

@ -1817,7 +1817,7 @@ namespace UF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::TextureBegin; r < EQEmu::textures::TextureCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@ -2301,10 +2301,10 @@ namespace UF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQEmu::textures::TextureCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
eq_cse->Equip[equip_index].Color = emu_cse->Equip[equip_index].Color;
}
@ -2869,7 +2869,7 @@ namespace UF
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
if (emu->size == 0)
{
@ -3068,7 +3068,7 @@ namespace UF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@ -3104,17 +3104,17 @@ namespace UF
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::TextureBegin; k < EQEmu::textures::TextureCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
if (emu->equipment.Slot[k].Material > 99999) {
Equipment[k].Material = 63;
} else {
Equipment[k].Material = emu->equipment.Slot[k].Material;
}
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteMaterial;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::TextureCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
if (strlen(emu->title))
{
@ -4224,18 +4224,18 @@ namespace UF
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + index + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@ -4253,7 +4253,7 @@ namespace UF
{
uint32 UnderfootSlot = 0;
if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
UnderfootSlot = serverSlot + 11;
@ -4261,7 +4261,7 @@ namespace UF
UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
UnderfootSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
else if (serverSlot == EQEmu::inventory::slotPowerSource)
UnderfootSlot = invslot::PossessionsPowerSource;
else
UnderfootSlot = serverSlot;
@ -4288,7 +4288,7 @@ namespace UF
else if (ufSlot >= invbag::SharedBankBagsBegin && ufSlot <= invbag::SharedBankBagsEnd)
ServerSlot = ufSlot - 1;
else if (ufSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
ServerSlot = EQEmu::inventory::slotPowerSource;
else
ServerSlot = ufSlot;

View File

@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::TextureCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::TextureCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::TextureCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff

View File

@ -105,7 +105,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i "
"AND ((slotid >= 8000 AND slotid <= 8999) "
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
char_id, EQEmu::legacy::SlotCursor,
char_id, EQEmu::inventory::slotCursor,
EQEmu::legacy::CURSOR_BAG_BEGIN, EQEmu::legacy::CURSOR_BAG_END);
auto results = QueryDatabase(query);
if (!results.Success()) {
@ -117,7 +117,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
for(auto it = start; it != end; ++it, i++) {
if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high
EQEmu::ItemInstance *inst = *it;
int16 use_slot = (i == 8000) ? EQEmu::legacy::SlotCursor : i;
int16 use_slot = (i == 8000) ? EQEmu::inventory::slotCursor : i;
if (!SaveInventory(char_id, inst, use_slot)) {
return false;
}
@ -192,9 +192,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { 0, 0, 0, 0, 0, 0 };
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
if (inst->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
EQEmu::ItemInstance *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
@ -224,7 +224,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id))
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = EQEmu::inventory::containerBegin; idx < inst->GetItem()->BagSlots && idx < EQEmu::inventory::ContainerCount; idx++) {
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
}
@ -239,9 +239,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { 0, 0, 0, 0, 0, 0 };
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
if (inst->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
EQEmu::ItemInstance *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
@ -270,7 +270,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInsta
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id)) {
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = EQEmu::inventory::containerBegin; idx < inst->GetItem()->BagSlots && idx < EQEmu::inventory::ContainerCount; idx++) {
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
}
@ -296,7 +296,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
int16 base_slot_id = Inventory::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
char_id, base_slot_id, (base_slot_id+10));
results = QueryDatabase(query);
@ -322,7 +322,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
int16 base_slot_id = Inventory::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
"AND slotid >= %i AND slotid < %i",
account_id, base_slot_id, (base_slot_id+10));
@ -428,7 +428,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::inventory::SocketCount];
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
@ -449,7 +449,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
EQEmu::ItemInstance *inst = CreateBaseItem(item, charges);
if (inst && item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}
@ -524,7 +524,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
uint16 charges = atoi(row[2]);
uint32 color = atoul(row[3]);
uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::inventory::SocketCount];
aug[0] = (uint32)atoul(row[4]);
aug[1] = (uint32)atoul(row[5]);
@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
if (instnodrop ||
(((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) ||
slot_id == EQEmu::legacy::SlotPowerSource) &&
slot_id == EQEmu::inventory::slotPowerSource) &&
inst->GetItem()->Attuneable))
inst->SetAttuned(true);
@ -609,7 +609,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
}
if (item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}
@ -666,7 +666,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
int8 charges = atoi(row[2]);
uint32 color = atoul(row[3]);
uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::inventory::SocketCount];
aug[0] = (uint32)atoi(row[4]);
aug[1] = (uint32)atoi(row[5]);
aug[2] = (uint32)atoi(row[6]);
@ -727,7 +727,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
inst->SetCharges(charges);
if (item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}

View File

@ -18,82 +18,3 @@
*/
#include "textures.h"
//#include "inventory_slot.h"
#include <string.h> // temp
//int EQEmu::textures::ConvertEquipmentSlotToTextureSlot(int equipment_slot)
//{
// switch (equipment_slot) {
// case inventory::PossessionsHead:
// return textures::TextureHead;
// case inventory::PossessionsChest:
// return textures::TextureChest;
// case inventory::PossessionsArms:
// return textures::TextureArms;
// case inventory::PossessionsWrist1:
// return textures::TextureWrist;
// case inventory::PossessionsHands:
// return textures::TextureHands;
// case inventory::PossessionsLegs:
// return textures::TextureLegs;
// case inventory::PossessionsFeet:
// return textures::TextureFeet;
// case inventory::PossessionsPrimary:
// return textures::TexturePrimary;
// case inventory::PossessionsSecondary:
// return textures::TextureSecondary;
// default:
// return textures::TextureInvalid;
// }
//}
//int EQEmu::textures::ConvertEquipmentSlotToTextureSlot(const InventorySlot &equipment_slot)
//{
// if (equipment_slot.Type() != inventory::InvTypePossessions || equipment_slot.Bag() != inventory::InvBagInvalid || equipment_slot.Aug() != inventory::InvAugInvalid)
// return textures::TextureInvalid;
//
// return ConvertEquipmentSlotToTextureSlot(equipment_slot.Slot());
//}
//EQEmu::InventorySlot EQEmu::textures::ConvertTextureSlotToEquipmentSlot(int texture_slot)
//{
// switch (texture_slot) {
// case textures::TextureHead:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsHead);
// case textures::TextureChest:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsChest);
// case textures::TextureArms:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsArms);
// case textures::TextureWrist:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsWrist1);
// case textures::TextureHands:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsHands);
// case textures::TextureLegs:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsLegs);
// case textures::TextureFeet:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsFeet);
// case textures::TexturePrimary:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsPrimary);
// case textures::TextureSecondary:
// return EQEmu::InventorySlot(inventory::InvTypePossessions, inventory::PossessionsSecondary);
// default:
// return EQEmu::InventorySlot();
// }
//}
EQEmu::TextureProfile::TextureProfile()
{
memset(&Slot, 0, (sizeof(Texture_Struct) * textures::TextureCount));
}
EQEmu::TextureShortProfile::TextureShortProfile()
{
memset(&Slot, 0, (sizeof(uint32) * textures::TextureCount));
}
EQEmu::TintProfile::TintProfile()
{
memset(&Slot, 0, (sizeof(uint32) * textures::TextureCount));
}

View File

@ -25,116 +25,129 @@
namespace EQEmu
{
//class InventorySlot;
namespace textures {
//enum : int { TextureInvalid = -1, TextureBegin };
enum : uint8 { TextureInvalid = 255, TextureBegin = 0 };
enum : int8 { textureInvalid = -1, textureBegin };
//enum TextureSlot : int {
enum TextureSlot : uint8 {
TextureHead = TextureBegin,
TextureChest,
TextureArms,
TextureWrist,
TextureHands,
TextureLegs,
TextureFeet,
TexturePrimary,
TextureSecondary,
TextureCount
enum TextureSlot : int8 {
armorHead = textureBegin,
armorChest,
armorArms,
armorWrist,
armorHands,
armorLegs,
armorFeet,
weaponPrimary,
weaponSecondary,
materialCount,
materialInvalid = textureInvalid
};
const int LastTexture = TextureSecondary;
const int LastTintableTexture = TextureFeet;
enum TintSlot : int8 {
tintHead = textureBegin,
tintChest,
tintArms,
tintWrist,
tintHands,
tintLegs,
tintFeet,
tintCount,
tintInvalid = textureInvalid
};
//extern int ConvertEquipmentSlotToTextureSlot(int equipment_slot);
//extern int ConvertEquipmentSlotToTextureSlot(const InventorySlot &equipment_slot);
//extern InventorySlot ConvertTextureSlotToEquipmentSlot(int texture_slot);
const int8 LastTexture = weaponSecondary;
const int8 LastTintableTexture = tintFeet;
struct Texture_Struct {
union {
struct {
struct {
struct {
uint32 _material;
} _1_field;
uint32 _unknown1;
uint32 _elite_model;
} _3_fields;
uint32 _heroic_model;
uint32 _unknown2;
} _5_fields;
uint32 Material;
uint32 Unknown1;
uint32 EliteModel;
uint32 HeroicModel;
uint32 Unknown2; // same as material?
};
};
struct TextureMaterial_Struct {
uint32 Material;
};
struct Tint_Struct {
union {
struct {
uint8 Blue;
uint8 Green;
uint8 Red;
uint8 UseTint; // if there's a tint, this is FF
};
uint32 Color;
};
};
} /*textures*/
struct Texture_Struct {
uint32 Material;
uint32 Unknown1;
uint32 EliteMaterial;
uint32 HeroForgeModel;
uint32 Material2; // Same as material?
};
struct TextureProfile {
union {
struct {
Texture_Struct Head;
Texture_Struct Chest;
Texture_Struct Arms;
Texture_Struct Wrist;
Texture_Struct Hands;
Texture_Struct Legs;
Texture_Struct Feet;
Texture_Struct Primary;
Texture_Struct Secondary;
textures::Texture_Struct Head;
textures::Texture_Struct Chest;
textures::Texture_Struct Arms;
textures::Texture_Struct Wrist;
textures::Texture_Struct Hands;
textures::Texture_Struct Legs;
textures::Texture_Struct Feet;
textures::Texture_Struct Primary;
textures::Texture_Struct Secondary;
};
Texture_Struct Slot[textures::TextureCount];
textures::Texture_Struct Slot[textures::materialCount];
};
TextureProfile();
};
struct TextureShort_Struct {
uint32 Material;
};
struct TextureShortProfile {
struct TextureMaterialProfile {
union {
struct {
TextureShort_Struct Head;
TextureShort_Struct Chest;
TextureShort_Struct Arms;
TextureShort_Struct Wrist;
TextureShort_Struct Hands;
TextureShort_Struct Legs;
TextureShort_Struct Feet;
TextureShort_Struct Primary;
TextureShort_Struct Secondary;
textures::TextureMaterial_Struct Head;
textures::TextureMaterial_Struct Chest;
textures::TextureMaterial_Struct Arms;
textures::TextureMaterial_Struct Wrist;
textures::TextureMaterial_Struct Hands;
textures::TextureMaterial_Struct Legs;
textures::TextureMaterial_Struct Feet;
textures::TextureMaterial_Struct Primary;
textures::TextureMaterial_Struct Secondary;
};
TextureShort_Struct Slot[textures::TextureCount];
textures::TextureMaterial_Struct Slot[textures::materialCount];
};
TextureShortProfile();
};
struct Tint_Struct {
union {
struct {
uint8 Blue;
uint8 Green;
uint8 Red;
uint8 UseTint; // if there's a tint this is FF
};
uint32 Color;
};
//Tint_Struct();
};
struct TintProfile {
union {
struct {
Tint_Struct Head;
Tint_Struct Chest;
Tint_Struct Arms;
Tint_Struct Wrist;
Tint_Struct Hands;
Tint_Struct Legs;
Tint_Struct Feet;
Tint_Struct Primary;
Tint_Struct Secondary;
textures::Tint_Struct Head;
textures::Tint_Struct Chest;
textures::Tint_Struct Arms;
textures::Tint_Struct Wrist;
textures::Tint_Struct Hands;
textures::Tint_Struct Legs;
textures::Tint_Struct Feet;
textures::Tint_Struct Primary;
textures::Tint_Struct Secondary;
};
Tint_Struct Slot[textures::TextureCount];
textures::Tint_Struct Slot[textures::materialCount]; // materialCount is correct..but, {[weaponPrimary],[weaponSecondary]} are not tintable...
};
TintProfile();
};
} /*EQEmu*/

View File

@ -117,12 +117,12 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
cse->Gender = (uint8)atoi(row[2]);
cse->Face = (uint8)atoi(row[15]);
for (uint32 matslot = 0; matslot < EQEmu::textures::TextureCount; matslot++) { // Processed below
for (uint32 matslot = 0; matslot < EQEmu::textures::materialCount; matslot++) { // Processed below
cse->Equip[matslot].Material = 0;
cse->Equip[matslot].Unknown1 = 0;
cse->Equip[matslot].EliteMaterial = 0;
cse->Equip[matslot].HeroForgeModel = 0;
cse->Equip[matslot].Material2 = 0;
cse->Equip[matslot].EliteModel = 0;
cse->Equip[matslot].HeroicModel = 0;
cse->Equip[matslot].Unknown2 = 0;
cse->Equip[matslot].Color = 0;
}
@ -249,7 +249,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
const EQEmu::ItemInstance* inst = nullptr;
int16 invslot = 0;
for (uint32 matslot = 0; matslot < EQEmu::textures::TextureCount; matslot++) {
for (uint32 matslot = EQEmu::textures::textureBegin; matslot < EQEmu::textures::materialCount; matslot++) {
invslot = Inventory::CalcSlotFromMaterial(matslot);
if (invslot == INVALID_INDEX) { continue; }
inst = inv.GetItem(invslot);
@ -270,7 +270,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
cse->Equip[matslot].Material = idfile;
}
}
if (matslot == EQEmu::textures::TexturePrimary) {
if (matslot == EQEmu::textures::weaponPrimary) {
cse->PrimaryIDFile = idfile;
}
else {
@ -288,8 +288,8 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
// Armor Materials/Models
cse->Equip[matslot].Material = item->Material;
cse->Equip[matslot].EliteMaterial = item->EliteMaterial;
cse->Equip[matslot].HeroForgeModel = inst->GetOrnamentHeroModel(matslot);
cse->Equip[matslot].EliteModel = item->EliteMaterial;
cse->Equip[matslot].HeroicModel = inst->GetOrnamentHeroModel(matslot);
cse->Equip[matslot].Color = color;
}
}

View File

@ -132,7 +132,7 @@ bool Mob::AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const
}
// If we're attacking with the secondary hand, play the dual wield anim
if (Hand == EQEmu::legacy::SlotSecondary) // DW anim
if (Hand == EQEmu::inventory::slotSecondary) // DW anim
type = animDualWield;
DoAnim(type);
@ -373,7 +373,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
// riposte -- it may seem crazy, but if the attacker has SPA 173 on them, they are immune to Ripo
bool ImmuneRipo = attacker->aabonuses.RiposteChance || attacker->spellbonuses.RiposteChance || attacker->itembonuses.RiposteChance;
// Need to check if we have something in MainHand to actually attack with (or fists)
if (hand != EQEmu::legacy::SlotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
if (hand != EQEmu::inventory::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
if (IsEnraged()) {
damage = -3;
Log.Out(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
@ -395,7 +395,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
chance -= chance * counter;
}
// AA Slippery Attacks
if (hand == EQEmu::legacy::SlotSecondary) {
if (hand == EQEmu::inventory::slotSecondary) {
int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail;
chance += chance * slip / 100;
}
@ -440,7 +440,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
}
// parry
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
if (CanThisClassParry() && InFront && hand != EQEmu::inventory::slotRange) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
// check auto discs ... I guess aa/items too :P
@ -927,7 +927,7 @@ int Mob::GetWeaponDamage(Mob *against, const EQEmu::ItemInstance *weapon_item, u
} else {
bool MagicGloves = false;
if (IsClient()) {
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotHands);
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotHands);
if (gloves)
MagicGloves = gloves->GetItemMagical(true);
}
@ -1036,12 +1036,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code.
EQEmu::ItemInstance* weapon;
if (Hand == EQEmu::legacy::SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
weapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if (Hand == EQEmu::inventory::slotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
weapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
OffHandAtk(true);
}
else{
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
OffHandAtk(false);
}
@ -1109,7 +1109,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
int ucDamageBonus = 0;
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
{
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
@ -1122,7 +1122,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
}
#endif
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
if (Hand == EQEmu::legacy::SlotSecondary) {
if (Hand == EQEmu::inventory::slotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr, true);
@ -1583,28 +1583,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
FaceTarget(GetTarget());
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
if (Hand == EQEmu::legacy::SlotPrimary) {
if (Hand == EQEmu::inventory::slotPrimary) {
skillinuse = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
OffHandAtk(false);
}
if (Hand == EQEmu::legacy::SlotSecondary) {
if (Hand == EQEmu::inventory::slotSecondary) {
skillinuse = static_cast<EQEmu::skills::SkillType>(GetSecSkill());
OffHandAtk(true);
}
//figure out what weapon they are using, if any
const EQEmu::ItemData* weapon = nullptr;
if (Hand == EQEmu::legacy::SlotPrimary && equipment[EQEmu::legacy::SlotPrimary] > 0)
weapon = database.GetItem(equipment[EQEmu::legacy::SlotPrimary]);
else if (equipment[EQEmu::legacy::SlotSecondary])
weapon = database.GetItem(equipment[EQEmu::legacy::SlotSecondary]);
if (Hand == EQEmu::inventory::slotPrimary && equipment[EQEmu::inventory::slotPrimary] > 0)
weapon = database.GetItem(equipment[EQEmu::inventory::slotPrimary]);
else if (equipment[EQEmu::inventory::slotSecondary])
weapon = database.GetItem(equipment[EQEmu::inventory::slotSecondary]);
//We dont factor much from the weapon into the attack.
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
if(weapon) {
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
if (Hand == EQEmu::legacy::SlotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
if (Hand == EQEmu::inventory::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
return false;
}
@ -3501,7 +3501,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
float ProcChance, ProcBonus;
on->GetDefensiveProcChances(ProcBonus, ProcChance, hand , this);
if (hand != EQEmu::legacy::SlotPrimary)
if (hand != EQEmu::inventory::slotPrimary)
ProcChance /= 2;
int level_penalty = 0;
@ -3574,7 +3574,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
ProcBonus += static_cast<float>(itembonuses.ProcChance) / 10.0f; // Combat Effects
float ProcChance = GetProcChances(ProcBonus, hand);
if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
ProcChance /= 2;
// Try innate proc on weapon
@ -3611,7 +3611,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
proced = false;
if (!proced && inst) {
for (int r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
const EQEmu::ItemInstance *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot!
continue;
@ -3652,11 +3652,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
float ProcChance = 0.0f;
ProcChance = GetProcChances(ProcBonus, hand);
if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
ProcChance /= 2;
bool rangedattk = false;
if (weapon && hand == EQEmu::legacy::SlotRange) {
if (weapon && hand == EQEmu::inventory::slotRange) {
if (weapon->ItemType == EQEmu::item::ItemTypeArrow ||
weapon->ItemType == EQEmu::item::ItemTypeLargeThrowing ||
weapon->ItemType == EQEmu::item::ItemTypeSmallThrowing ||
@ -3665,11 +3665,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
}
}
if (!weapon && hand == EQEmu::legacy::SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
if (!weapon && hand == EQEmu::inventory::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
rangedattk = true;
for (uint32 i = 0; i < MAX_PROCS; i++) {
if (IsPet() && hand != EQEmu::legacy::SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
if (IsPet() && hand != EQEmu::inventory::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
continue; // If pets ever can proc from off hand, this will need to change
// Not ranged
@ -3732,7 +3732,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
}
}
if (HasSkillProcs() && hand != EQEmu::legacy::SlotRange){ //We check ranged skill procs within the attack functions.
if (HasSkillProcs() && hand != EQEmu::inventory::slotRange){ //We check ranged skill procs within the attack functions.
uint16 skillinuse = 28;
if (weapon)
skillinuse = GetSkillByItemType(weapon->ItemType);
@ -3980,7 +3980,7 @@ void Mob::DoRiposte(Mob *defender)
if (!defender)
return;
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
if (HasDied())
return;
@ -3991,7 +3991,7 @@ void Mob::DoRiposte(Mob *defender)
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
Log.Out(Logs::Detail, Logs::Combat,
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
if (HasDied())
return;
}
@ -4004,7 +4004,7 @@ void Mob::DoRiposte(Mob *defender)
Log.Out(Logs::Detail, Logs::Combat,
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
DoubleRipChance);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
if (HasDied())
return;
}
@ -4288,7 +4288,7 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) {
if (!ReuseTime && hand) {
weapon_speed = GetWeaponSpeedbyHand(hand);
ProcChance = static_cast<float>(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f);
if (hand != EQEmu::legacy::SlotPrimary)
if (hand != EQEmu::inventory::slotPrimary)
ProcChance /= 2;
}
@ -4478,13 +4478,13 @@ void Client::SetAttackTimer()
Timer *TimerToUse = nullptr;
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
//pick a timer
if (i == EQEmu::legacy::SlotPrimary)
if (i == EQEmu::inventory::slotPrimary)
TimerToUse = &attack_timer;
else if (i == EQEmu::legacy::SlotRange)
else if (i == EQEmu::inventory::slotRange)
TimerToUse = &ranged_timer;
else if (i == EQEmu::legacy::SlotSecondary)
else if (i == EQEmu::inventory::slotSecondary)
TimerToUse = &attack_dw_timer;
else //invalid slot (hands will always hit this)
continue;
@ -4497,7 +4497,7 @@ void Client::SetAttackTimer()
ItemToUse = ci->GetItem();
//special offhand stuff
if (i == EQEmu::legacy::SlotSecondary) {
if (i == EQEmu::inventory::slotSecondary) {
//if we cant dual wield, skip it
if (!CanThisClassDualWield() || HasTwoHanderEquipped()) {
attack_dw_timer.Disable();
@ -4571,19 +4571,19 @@ void NPC::SetAttackTimer()
else
speed = static_cast<int>(((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay)) * 100);
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
//pick a timer
if (i == EQEmu::legacy::SlotPrimary)
if (i == EQEmu::inventory::slotPrimary)
TimerToUse = &attack_timer;
else if (i == EQEmu::legacy::SlotRange)
else if (i == EQEmu::inventory::slotRange)
TimerToUse = &ranged_timer;
else if (i == EQEmu::legacy::SlotSecondary)
else if (i == EQEmu::inventory::slotSecondary)
TimerToUse = &attack_dw_timer;
else //invalid slot (hands will always hit this)
continue;
//special offhand stuff
if (i == EQEmu::legacy::SlotSecondary) {
if (i == EQEmu::inventory::slotSecondary) {
// SPECATK_QUAD is uncheesable
if(!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) {
attack_dw_timer.Disable();
@ -4605,7 +4605,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
bool candouble = CanThisClassDoubleAttack();
// extra off hand non-sense, can only double with skill of 150 or above
// or you have any amount of GiveDoubleAttack
if (candouble && hand == EQEmu::legacy::SlotSecondary)
if (candouble && hand == EQEmu::inventory::slotSecondary)
candouble = GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
if (candouble) {
@ -4613,7 +4613,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
if (CheckDoubleAttack()) {
Attack(target, hand, false, false, IsFromSpell);
// you can only triple from the main hand
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
if (hand == EQEmu::inventory::slotPrimary && CanThisClassTripleAttack()) {
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
if (CheckTripleAttack())
Attack(target, hand, false, false, IsFromSpell);
@ -4621,7 +4621,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
}
}
if (hand == EQEmu::legacy::SlotPrimary) {
if (hand == EQEmu::inventory::slotPrimary) {
// According to http://www.monkly-business.net/forums/showpost.php?p=312095&postcount=168 a dev told them flurry isn't dependant on triple attack
// the parses kind of back that up and all of my parses seemed to be 4 or 5 attacks in the round which would work out to be
// doubles or triples with 2 from flurries or triple with 1 or 2 flurries ... Going with the "dev quote" I guess like we've always had it
@ -4674,9 +4674,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
if (RuleB(Combat, UseLiveCombatRounds)) {
// A "quad" on live really is just a successful dual wield where both double attack
// The mobs that could triple lost the ability to when the triple attack skill was added in
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && CheckDoubleAttack()){
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
@ -4690,14 +4690,14 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
if (IsNPC()) {
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
if (n_atk <= 1) {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
} else {
for (int i = 0; i < n_atk; ++i) {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
}
}
} else {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
}
// we use this random value in three comparisons with different
@ -4708,15 +4708,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
// check double attack, this is NOT the same rules that clients use...
&&
RandRoll < (GetLevel() + NPCDualAttackModifier)) {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
// lets see if we can do a triple attack with the main hand
// pets are excluded from triple and quads...
if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD)) && !IsPet() &&
RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
// now lets check the quad attack
if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
}
}
}
@ -4730,11 +4730,11 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci
// For now, SPECATK_QUAD means innate DW when Combat:UseLiveCombatRounds is true
if ((GetSpecialAbility(SPECATK_INNATE_DW) ||
(RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) ||
GetEquipment(EQEmu::textures::TextureSecondary) != 0) {
GetEquipment(EQEmu::textures::weaponSecondary) != 0) {
if (CheckDualWield()) {
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;

View File

@ -36,7 +36,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }

View File

@ -145,28 +145,28 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
unsigned int i;
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
for (i = EQEmu::legacy::SlotCharm; i <= EQEmu::legacy::SlotAmmo; i++) {
for (i = EQEmu::inventory::slotCharm; i <= EQEmu::inventory::slotAmmo; i++) {
const EQEmu::ItemInstance* inst = m_inv[i];
if(inst == 0)
continue;
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::legacy::SlotAmmo));
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::inventory::slotAmmo));
//These are given special flags due to how often they are checked for various spell effects.
const EQEmu::ItemData *item = inst->GetItem();
if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
if (i == EQEmu::inventory::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
SetShieldEquiped(true);
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
else if (i == EQEmu::inventory::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
SetTwoHandBluntEquiped(true);
SetTwoHanderEquipped(true);
}
else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
else if (i == EQEmu::inventory::slotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
SetTwoHanderEquipped(true);
}
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotPowerSource];
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
if(inst)
AddItemBonuses(inst, newbon);
}
@ -181,7 +181,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != EQEmu::item::ItemEffectWorn){
for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) {
for (i = EQEmu::inventory::slotCharm; i < EQEmu::inventory::slotAmmo; i++) {
const EQEmu::ItemInstance* inst = m_inv[i];
if(inst == 0)
continue;
@ -527,7 +527,7 @@ void Client::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses *newbon
}
if (!isAug) {
for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
}
}
@ -565,7 +565,7 @@ void Client::AdditiveWornBonuses(const EQEmu::ItemInstance *inst, StatBonuses* n
if (!isAug)
{
int i;
for (i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
}
}
@ -3299,7 +3299,7 @@ void Client::CalcItemScale() {
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if (CalcItemScale(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
if (CalcItemScale(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
changed = true;
}
@ -3314,7 +3314,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
bool changed = false;
uint32 i;
for (i = slot_x; i <= slot_y; i++) {
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
if (i == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
continue;
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
@ -3344,7 +3344,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
{
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
if(!a_inst)
@ -3393,7 +3393,7 @@ void Client::DoItemEnterZone() {
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if (DoItemEnterZone(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
if (DoItemEnterZone(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
changed = true;
}
@ -3407,7 +3407,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
bool changed = false;
for(uint32 i = slot_x; i <= slot_y; i++) {
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
if (i == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
continue;
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
@ -3429,7 +3429,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
uint16 oldexp = inst->GetExp();
parse->EventItem(EVENT_ITEM_ENTER_ZONE, this, inst, nullptr, "", 0);
if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
}
@ -3439,7 +3439,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
update_slot = true;
}
} else {
if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
}
@ -3447,7 +3447,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
{
EQEmu::ItemInstance *a_inst = inst->GetAugment(x);
if(!a_inst)

View File

@ -229,8 +229,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) {
}
uint32 Bot::GetBotArcheryRange() {
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::legacy::SlotRange);
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::legacy::SlotAmmo);
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::inventory::slotRange);
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::inventory::slotAmmo);
if (!range_inst || !ammo_inst)
return 0;
@ -246,15 +246,15 @@ uint32 Bot::GetBotArcheryRange() {
void Bot::ChangeBotArcherWeapons(bool isArcher) {
if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) {
if(!isArcher) {
BotAddEquipItem(EQEmu::legacy::SlotPrimary, GetBotItemBySlot(EQEmu::legacy::SlotPrimary));
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotSecondary));
BotAddEquipItem(EQEmu::inventory::slotPrimary, GetBotItemBySlot(EQEmu::inventory::slotPrimary));
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotSecondary));
SetAttackTimer();
BotGroupSay(this, "My blade is ready");
} else {
BotRemoveEquipItem(EQEmu::legacy::SlotPrimary);
BotRemoveEquipItem(EQEmu::legacy::SlotSecondary);
BotAddEquipItem(EQEmu::legacy::SlotAmmo, GetBotItemBySlot(EQEmu::legacy::SlotAmmo));
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotRange));
BotRemoveEquipItem(EQEmu::inventory::slotPrimary);
BotRemoveEquipItem(EQEmu::inventory::slotSecondary);
BotAddEquipItem(EQEmu::inventory::slotAmmo, GetBotItemBySlot(EQEmu::inventory::slotAmmo));
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotRange));
SetAttackTimer();
BotGroupSay(this, "My bow is true and ready");
}
@ -1175,11 +1175,11 @@ void Bot::GenerateArmorClass() {
uint16 Bot::GetPrimarySkillValue() {
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
if(!equiped)
skill = EQEmu::skills::SkillHandtoHand;
else {
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch(type) {
case EQEmu::item::ItemType1HSlash:
skill = EQEmu::skills::Skill1HSlashing;
@ -1900,12 +1900,12 @@ void Bot::BotRangedAttack(Mob* other) {
return;
}
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::legacy::SlotRange);
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::inventory::slotRange);
const EQEmu::ItemData* RangeWeapon = 0;
if(rangedItem)
RangeWeapon = rangedItem->GetItem();
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::legacy::SlotAmmo);
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::inventory::slotAmmo);
const EQEmu::ItemData* Ammo = 0;
if(ammoItem)
Ammo = ammoItem->GetItem();
@ -2002,7 +2002,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
int damage = 0;
uint32 hate = 0;
int Hand = EQEmu::legacy::SlotPrimary;
int Hand = EQEmu::inventory::slotPrimary;
if (hate == 0 && weapon_damage > 1)
hate = weapon_damage;
@ -2031,7 +2031,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
else
damage = zone->random.Int(min_hit, max_hit);
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::inventory::slotRange : EQEmu::inventory::slotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
if (damage == -3) {
DoRiposte(other);
if (HasDied())
@ -2056,7 +2056,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
damage = -5;
if (skillinuse == EQEmu::skills::SkillBash){
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
const EQEmu::ItemData* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
@ -2103,15 +2103,15 @@ void Bot::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3
case EQEmu::skills::SkillFlyingKick:
case EQEmu::skills::SkillRoundKick:
case EQEmu::skills::SkillKick:
item_slot = EQEmu::legacy::SlotFeet;
item_slot = EQEmu::inventory::slotFeet;
break;
case EQEmu::skills::SkillBash:
item_slot = EQEmu::legacy::SlotSecondary;
item_slot = EQEmu::inventory::slotSecondary;
break;
case EQEmu::skills::SkillDragonPunch:
case EQEmu::skills::SkillEagleStrike:
case EQEmu::skills::SkillTigerClaw:
item_slot = EQEmu::legacy::SlotHands;
item_slot = EQEmu::inventory::slotHands;
break;
}
@ -2449,23 +2449,23 @@ void Bot::AI_Process() {
// First, special attack per class (kick, backstab etc..)
DoClassAttacks(GetTarget());
if(attack_timer.Check()) {
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
TriggerDefensiveProcs(GetTarget(), EQEmu::legacy::SlotPrimary, false);
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotPrimary);
Attack(GetTarget(), EQEmu::inventory::slotPrimary);
TriggerDefensiveProcs(GetTarget(), EQEmu::inventory::slotPrimary, false);
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotPrimary);
TryWeaponProc(wpn, GetTarget(), EQEmu::inventory::slotPrimary);
bool tripleSuccess = false;
if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) {
if(BotOwner && CheckBotDoubleAttack())
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) {
tripleSuccess = true;
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
}
//quad attack, does this belong here??
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true))
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
}
//Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack).
@ -2473,18 +2473,18 @@ void Bot::AI_Process() {
if (GetTarget() && flurrychance) {
if(zone->random.Int(0, 100) < flurrychance) {
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
}
}
int32 ExtraAttackChanceBonus = (spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance);
if (GetTarget() && ExtraAttackChanceBonus) {
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotPrimary);
if(wpn) {
if (wpn->GetItem()->IsType2HWeapon()) {
if(zone->random.Int(0, 100) < ExtraAttackChanceBonus)
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
}
}
}
@ -2504,7 +2504,7 @@ void Bot::AI_Process() {
//now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
const EQEmu::ItemInstance* instweapon = GetBotItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance* instweapon = GetBotItem(EQEmu::inventory::slotSecondary);
const EQEmu::ItemData* weapon = 0;
//can only dual wield without a weapon if you're a monk
if(instweapon || (botClass == MONK)) {
@ -2526,12 +2526,12 @@ void Bot::AI_Process() {
DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f);
float random = zone->random.Real(0, 1);
if (random < DualWieldProbability){ // Max 78% of DW
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotSecondary);
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotSecondary);
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotSecondary);
TryWeaponProc(wpn, GetTarget(), EQEmu::inventory::slotSecondary);
if( CanThisClassDoubleAttack() && CheckBotDoubleAttack()) {
if(GetTarget() && GetTarget()->GetHP() > -10)
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
}
}
}
@ -2702,12 +2702,12 @@ void Bot::PetAIProcess() {
if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
return;
if (botPet->Attack(GetTarget(), EQEmu::legacy::SlotPrimary)) // try the main hand
if (botPet->Attack(GetTarget(), EQEmu::inventory::slotPrimary)) // try the main hand
if (botPet->GetTarget()) {
// We're a pet so we re able to dual attack
int32 RandRoll = zone->random.Int(0, 99);
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier))) {
if (botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotPrimary)) {}
if (botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotPrimary)) {}
}
}
@ -2745,11 +2745,11 @@ void Bot::PetAIProcess() {
float DualWieldProbability = ((botPet->GetSkill(EQEmu::skills::SkillDualWield) + botPet->GetLevel()) / 400.0f);
DualWieldProbability -= zone->random.Real(0, 1);
if(DualWieldProbability < 0) {
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
if (botPet->CanThisClassDoubleAttack()) {
int32 RandRoll = zone->random.Int(0, 99);
if (RandRoll < (botPet->GetLevel() + 20))
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
}
}
}
@ -2956,14 +2956,14 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
const EQEmu::ItemInstance* inst = 0;
uint32 spawnedbotid = 0;
spawnedbotid = this->GetBotID();
for (int i = 0; i < EQEmu::textures::TexturePrimary; i++) {
for (int i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; i++) {
inst = GetBotItem(i);
if (inst) {
item = inst->GetItem();
if (item != 0) {
ns->spawn.equipment.Slot[i].Material = item->Material;
ns->spawn.equipment.Slot[i].EliteMaterial = item->EliteMaterial;
ns->spawn.equipment.Slot[i].HeroForgeModel = item->HerosForgeModel;
ns->spawn.equipment.Slot[i].EliteModel = item->EliteMaterial;
ns->spawn.equipment.Slot[i].HeroicModel = item->HerosForgeModel;
if (armor_tint.Slot[i].Color)
ns->spawn.equipment_tint.Slot[i].Color = armor_tint.Slot[i].Color;
else
@ -2975,25 +2975,25 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
}
}
inst = GetBotItem(EQEmu::legacy::SlotPrimary);
inst = GetBotItem(EQEmu::inventory::slotPrimary);
if(inst) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment.Primary.Material = atoi(&item->IDFile[2]);
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQEmu::textures::TexturePrimary);
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQEmu::textures::weaponPrimary);
}
}
inst = GetBotItem(EQEmu::legacy::SlotSecondary);
inst = GetBotItem(EQEmu::inventory::slotSecondary);
if(inst) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment.Secondary.Material = atoi(&item->IDFile[2]);
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQEmu::textures::TextureSecondary);
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQEmu::textures::weaponSecondary);
}
}
}
@ -3237,7 +3237,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) {
if(slot > 0 && id > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
if (materialFromSlot != EQEmu::textures::TextureInvalid) {
if (materialFromSlot != EQEmu::textures::materialInvalid) {
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
SendWearChange(materialFromSlot);
}
@ -3253,11 +3253,11 @@ void Bot::BotRemoveEquipItem(int slot) {
if(slot > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
if (materialFromSlot != EQEmu::textures::TextureInvalid) {
if (materialFromSlot != EQEmu::textures::materialInvalid) {
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
SendWearChange(materialFromSlot);
if (materialFromSlot == EQEmu::textures::TextureChest)
SendWearChange(EQEmu::textures::TextureArms);
if (materialFromSlot == EQEmu::textures::armorChest)
SendWearChange(EQEmu::textures::armorArms);
}
UpdateEquipmentLight();
@ -3360,7 +3360,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
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.
// If it is a bag, then we have to search for items in slots 331 thru 340
PerformTradeWithClient(EQEmu::legacy::SlotCursor, EQEmu::legacy::SlotCursor, client);
PerformTradeWithClient(EQEmu::inventory::slotCursor, EQEmu::inventory::slotCursor, client);
// TODO: Add logic here to test if the item in SLOT_CURSOR is a container type, if it is then we need to call the following:
// PerformTradeWithClient(331, 340, client);
@ -3389,7 +3389,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
charges[i] = inst->GetCharges();
}
if (i == EQEmu::legacy::SlotCursor)
if (i == EQEmu::inventory::slotCursor)
UpdateClient = true;
//EQoffline: will give the items to the bots and change the bot stats
@ -3397,7 +3397,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
std::string TempErrorMessage;
const EQEmu::ItemData* mWeaponItem = inst->GetItem();
bool failedLoreCheck = false;
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
EQEmu::ItemInstance *itm = inst->GetAugment(m);
if(itm)
{
@ -3429,17 +3429,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
how_many_slots++;
if(!GetBotItem(j)) {
if (j == EQEmu::legacy::SlotPrimary) {
if (j == EQEmu::inventory::slotPrimary) {
if (mWeaponItem->IsType2HWeapon()) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if (GetBotItem(EQEmu::inventory::slotSecondary)) {
if (mWeaponItem && mWeaponItem->IsType2HWeapon()) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::inventory::slotSecondary)->GetItem())) {
failedLoreCheck = true;
}
}
else {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotSecondary);
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
}
@ -3449,7 +3449,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
break;
}
else if (j == EQEmu::legacy::SlotSecondary) {
else if (j == EQEmu::inventory::slotSecondary) {
if(inst->IsWeapon()) {
if(CanThisClassDualWield()) {
BotTradeAddItem(mWeaponItem->ID, inst, inst->GetCharges(), mWeaponItem->Slots, j, &TempErrorMessage);
@ -3465,10 +3465,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
success = true;
}
if(success) {
if (GetBotItem(EQEmu::legacy::SlotPrimary)) {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if (GetBotItem(EQEmu::inventory::slotPrimary)) {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotPrimary);
if (remove_item->GetItem()->IsType2HWeapon()) {
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
break;
@ -3490,7 +3490,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
swap_item = GetBotItem(j);
failedLoreCheck = false;
for (int k = AUG_INDEX_BEGIN; k < EQEmu::legacy::ITEM_COMMON_SIZE; ++k) {
for (int k = EQEmu::inventory::socketBegin; k < EQEmu::inventory::SocketCount; ++k) {
EQEmu::ItemInstance *itm = swap_item->GetAugment(k);
if(itm)
{
@ -3503,28 +3503,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
failedLoreCheck = true;
}
if(!failedLoreCheck) {
if (j == EQEmu::legacy::SlotPrimary) {
if (j == EQEmu::inventory::slotPrimary) {
if (mWeaponItem->IsType2HWeapon()) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
if (GetBotItem(EQEmu::inventory::slotSecondary)) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::inventory::slotSecondary)->GetItem())) {
failedLoreCheck = true;
}
else {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotSecondary);
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
}
if(!failedLoreCheck) {
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
break;
}
else if (j == EQEmu::legacy::SlotSecondary) {
else if (j == EQEmu::inventory::slotSecondary) {
if(inst->IsWeapon()) {
if(CanThisClassDualWield()) {
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
else {
@ -3533,13 +3533,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
}
else {
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
if (success && GetBotItem(EQEmu::legacy::SlotPrimary)) {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if (success && GetBotItem(EQEmu::inventory::slotPrimary)) {
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotPrimary);
if (remove_item->GetItem()->IsType2HWeapon()) {
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
break;
@ -3739,13 +3739,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
FaceTarget(GetTarget());
EQEmu::ItemInstance* weapon = nullptr;
if (Hand == EQEmu::legacy::SlotPrimary) {
weapon = GetBotItem(EQEmu::legacy::SlotPrimary);
if (Hand == EQEmu::inventory::slotPrimary) {
weapon = GetBotItem(EQEmu::inventory::slotPrimary);
OffHandAtk(false);
}
if (Hand == EQEmu::legacy::SlotSecondary) {
weapon = GetBotItem(EQEmu::legacy::SlotSecondary);
if (Hand == EQEmu::inventory::slotSecondary) {
weapon = GetBotItem(EQEmu::inventory::slotSecondary);
OffHandAtk(true);
}
@ -3810,7 +3810,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
// This is not recommended for normal usage, as the damage bonus represents a non-trivial component of the DPS output
// of weapons wielded by higher-level melee characters (especially for two-handed weapons).
int ucDamageBonus = 0;
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
@ -3820,7 +3820,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
}
#endif
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
if (Hand == EQEmu::legacy::SlotSecondary) {
if (Hand == EQEmu::inventory::slotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
min_hit += (int) ucDamageBonus;
@ -4313,7 +4313,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
}
}
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) {
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y) {
EQEmu::ItemInstance *aug = nullptr;
aug = ins->GetAugment(y);
if(aug) {
@ -4749,13 +4749,13 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
float ProcChance = 0.0f;
uint32 weapon_speed = 0;
switch (hand) {
case EQEmu::legacy::SlotPrimary:
case EQEmu::inventory::slotPrimary:
weapon_speed = attack_timer.GetDuration();
break;
case EQEmu::legacy::SlotSecondary:
case EQEmu::inventory::slotSecondary:
weapon_speed = attack_dw_timer.GetDuration();
break;
case EQEmu::legacy::SlotRange:
case EQEmu::inventory::slotRange:
weapon_speed = ranged_timer.GetDuration();
break;
}
@ -4781,7 +4781,7 @@ int Bot::GetHandToHandDamage(void) {
// everyone uses this in the revamp!
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
int epic = 0;
if (CastToNPC()->GetEquipment(EQEmu::textures::TextureHands) == 10652 && GetLevel() > 46)
if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 46)
epic = 280;
if (epic > skill)
skill = epic;
@ -4803,7 +4803,7 @@ int Bot::GetHandToHandDamage(void) {
9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40
10, 11, 11, 11, 11, 11, 11, 12, 12}; // 41-49
if (GetClass() == MONK) {
if (CastToNPC()->GetEquipment(EQEmu::textures::TextureHands) == 10652 && GetLevel() > 50)
if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 50)
return 9;
if (level > 62)
return 15;
@ -4842,11 +4842,11 @@ void Bot::DoRiposte(Mob* defender) {
if (!defender)
return;
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
}
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
@ -4864,7 +4864,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
hate = hate_override;
if (skill == EQEmu::skills::SkillBash) {
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
const EQEmu::ItemData* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
@ -4878,14 +4878,14 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
}
min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100);
int hand = EQEmu::legacy::SlotPrimary;
int hand = EQEmu::inventory::slotPrimary;
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
hand = EQEmu::legacy::SlotRange;
hand = EQEmu::inventory::slotRange;
if (who->AvoidDamage(this, max_damage, hand)) {
if (max_damage == -3)
DoRiposte(who);
} else {
if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) {
if (HitChance || who->CheckHitChance(this, skill, EQEmu::inventory::slotPrimary)) {
who->MeleeMitigation(this, max_damage, min_damage);
ApplyMeleeDamageBonus(skill, max_damage);
max_damage += who->GetFcDamageAmtIncoming(this, 0, true, skill);
@ -4929,7 +4929,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
bool bIsBehind = false;
bool bCanFrontalBS = false;
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotPrimary);
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotPrimary);
const EQEmu::ItemData* botpiercer = nullptr;
if(inst)
botpiercer = inst->GetItem();
@ -4979,7 +4979,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
}
}
else
Attack(other, EQEmu::legacy::SlotPrimary);
Attack(other, EQEmu::inventory::slotPrimary);
}
void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
@ -4989,11 +4989,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
int32 hate = 0;
int32 primaryweapondamage = 0;
int32 backstab_dmg = 0;
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
if(botweaponInst) {
primaryweapondamage = GetWeaponDamage(other, botweaponInst);
backstab_dmg = botweaponInst->GetItem()->BackstabDmg;
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
EQEmu::ItemInstance *aug = botweaponInst->GetAugment(i);
if(aug)
backstab_dmg += aug->GetItem()->BackstabDmg;
@ -5037,7 +5037,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
}
void Bot::RogueAssassinate(Mob* other) {
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
if(botweaponInst) {
if(GetWeaponDamage(other, botweaponInst))
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
@ -5103,7 +5103,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case WARRIOR:
if(level >= RuleI(Combat, NPCBashKickLevel)){
bool canBash = false;
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
canBash = true;
if(!canBash || zone->random.Int(0, 100) > 25)
@ -5122,7 +5122,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case SHADOWKNIGHT:
case PALADIN:
if(level >= RuleI(Combat, NPCBashKickLevel)){
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
skill_to_use = EQEmu::skills::SkillBash;
}
break;
@ -5151,7 +5151,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if (skill_to_use == EQEmu::skills::SkillBash) {
if (target != this) {
DoAnim(animTailRake);
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0)
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotShoulders)) <= 0)
dmg = -5;
else {
if (!target->CheckHitChance(this, EQEmu::skills::SkillBash, 0))
@ -5201,7 +5201,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if (skill_to_use == EQEmu::skills::SkillKick) {
if(target != this) {
DoAnim(animKick);
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotFeet)) <= 0)
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotFeet)) <= 0)
dmg = -5;
else {
if (!target->CheckHitChance(this, EQEmu::skills::SkillKick, 0))
@ -5495,12 +5495,12 @@ void Bot::SetAttackTimer() {
attack_timer.SetAtTrigger(4000, true);
Timer* TimerToUse = nullptr;
const EQEmu::ItemData* PrimaryWeapon = nullptr;
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
if (i == EQEmu::legacy::SlotPrimary)
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
if (i == EQEmu::inventory::slotPrimary)
TimerToUse = &attack_timer;
else if (i == EQEmu::legacy::SlotRange)
else if (i == EQEmu::inventory::slotRange)
TimerToUse = &ranged_timer;
else if (i == EQEmu::legacy::SlotSecondary)
else if (i == EQEmu::inventory::slotSecondary)
TimerToUse = &attack_dw_timer;
else
continue;
@ -5510,7 +5510,7 @@ void Bot::SetAttackTimer() {
if (ci)
ItemToUse = ci->GetItem();
if (i == EQEmu::legacy::SlotSecondary) {
if (i == EQEmu::inventory::slotSecondary) {
if (PrimaryWeapon != nullptr) {
if (PrimaryWeapon->IsClassCommon() && PrimaryWeapon->IsType2HWeapon()) {
attack_dw_timer.Disable();
@ -5541,7 +5541,7 @@ void Bot::SetAttackTimer() {
speed = (RuleB(Spells, Jun182014HundredHandsRevamp) ? static_cast<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast<int>(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100));
TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true);
if (i == EQEmu::legacy::SlotPrimary)
if (i == EQEmu::inventory::slotPrimary)
PrimaryWeapon = ItemToUse;
}
}
@ -7186,7 +7186,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
// 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'
// to see them on a Titanium client when/if they are activated.
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) {
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
inst = inspectedBot->GetBotItem(L);
if(inst) {
@ -7200,7 +7200,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
}
}
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotPowerSource);
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotPowerSource);
if(inst) {
item = inst->GetItem();
@ -7212,7 +7212,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
}
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo);
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotAmmo);
if(inst) {
item = inst->GetItem();
@ -7547,7 +7547,7 @@ void Bot::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses* newbon, b
if (!isAug)
{
for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
}
@ -8036,12 +8036,12 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
int Bot::GetRawACNoShield(int &shield_ac) {
int ac = itembonuses.AC + spellbonuses.AC;
shield_ac = 0;
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
if(inst) {
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if(inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;
@ -8433,7 +8433,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
if (slot_id != INVALID_INDEX)
return false;
for (uint8 i = 0; i < EQEmu::textures::TexturePrimary; ++i) {
for (uint8 i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; ++i) {
uint8 inv_slot = Inventory::CalcSlotFromMaterial(i);
EQEmu::ItemInstance* inst = m_inv.GetItem(inv_slot);
if (!inst)
@ -8445,7 +8445,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
}
else {
uint8 mat_slot = Inventory::CalcMaterialFromSlot(slot_id);
if (mat_slot == EQEmu::textures::TextureInvalid || mat_slot >= EQEmu::textures::TexturePrimary)
if (mat_slot == EQEmu::textures::materialInvalid || mat_slot >= EQEmu::textures::weaponPrimary)
return false;
EQEmu::ItemInstance* inst = m_inv.GetItem(slot_id);

View File

@ -77,7 +77,7 @@ 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(); }
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::legacy::SlotPowerSource) ? (22) : (23)))
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::inventory::slotPowerSource) ? (22) : (23)))
static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] =
{
@ -207,7 +207,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
virtual bool HasGroup() { return (GetGroup() ? true : false); }

View File

@ -4358,7 +4358,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
// TODO: Trouble-shoot model update issue
const std::string msg_matslot = StringFormat("mat_slot: %c(All), %i(Head), %i(Chest), %i(Arms), %i(Wrists), %i(Hands), %i(Legs), %i(Feet)",
'*', EQEmu::textures::TextureHead, EQEmu::textures::TextureChest, EQEmu::textures::TextureArms, EQEmu::textures::TextureWrist, EQEmu::textures::TextureHands, EQEmu::textures::TextureLegs, EQEmu::textures::TextureFeet);
'*', EQEmu::textures::armorHead, EQEmu::textures::armorChest, EQEmu::textures::armorArms, EQEmu::textures::armorWrist, EQEmu::textures::armorHands, EQEmu::textures::armorLegs, EQEmu::textures::armorFeet);
if (helper_command_alias_fail(c, "bot_subcommand_bot_dye_armor", sep->arg[0], "botdyearmor"))
return;
@ -4369,7 +4369,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
}
const int ab_mask = ActionableBots::ABM_NoFilter;
uint8 material_slot = EQEmu::textures::TextureInvalid;
uint8 material_slot = EQEmu::textures::materialInvalid;
int16 slot_id = INVALID_INDEX;
bool dye_all = (sep->arg[1][0] == '*');
@ -4377,7 +4377,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
material_slot = atoi(sep->arg[1]);
slot_id = Inventory::CalcSlotFromMaterial(material_slot);
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::textures::TextureFeet) {
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::textures::LastTintableTexture) {
c->Message(m_fail, "Valid [mat_slot]s for this command are:");
c->Message(m_fail, msg_matslot.c_str());
return;
@ -7072,23 +7072,23 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
uint32 inventory_count = 0;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
if ((i == EQEmu::legacy::SlotSecondary) && is2Hweapon)
if ((i == EQEmu::inventory::slotSecondary) && is2Hweapon)
continue;
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
if (!inst || !inst->GetItem()) {
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
continue;
}
item = inst->GetItem();
if ((i == EQEmu::legacy::SlotPrimary) && item->IsType2HWeapon()) {
if ((i == EQEmu::inventory::slotPrimary) && item->IsType2HWeapon()) {
is2Hweapon = true;
}
linker.SetItemInst(inst);
item_link = linker.GenerateLink();
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
++inventory_count;
}
@ -7127,7 +7127,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
}
int slotId = atoi(sep->arg[1]);
if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::legacy::SlotPowerSource)) {
if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::inventory::slotPowerSource)) {
c->Message(m_fail, "Valid slots are 0-21 or 9999");
return;
}
@ -7142,7 +7142,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
return;
}
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
if (!itminst)
break;
@ -7159,7 +7159,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
std::string error_message;
if (itm) {
c->PushItemOnCursor(*itminst, true);
if ((slotId == EQEmu::legacy::SlotRange) || (slotId == EQEmu::legacy::SlotAmmo) || (slotId == EQEmu::legacy::SlotPrimary) || (slotId == EQEmu::legacy::SlotSecondary))
if ((slotId == EQEmu::inventory::slotRange) || (slotId == EQEmu::inventory::slotAmmo) || (slotId == EQEmu::inventory::slotPrimary) || (slotId == EQEmu::inventory::slotSecondary))
my_bot->SetBotArcher(false);
my_bot->RemoveBotItemBySlot(slotId, &error_message);
@ -7173,31 +7173,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
}
switch (slotId) {
case EQEmu::legacy::SlotCharm:
case EQEmu::legacy::SlotEar1:
case EQEmu::legacy::SlotHead:
case EQEmu::legacy::SlotFace:
case EQEmu::legacy::SlotEar2:
case EQEmu::legacy::SlotNeck:
case EQEmu::legacy::SlotBack:
case EQEmu::legacy::SlotWrist1:
case EQEmu::legacy::SlotWrist2:
case EQEmu::legacy::SlotRange:
case EQEmu::legacy::SlotPrimary:
case EQEmu::legacy::SlotSecondary:
case EQEmu::legacy::SlotFinger1:
case EQEmu::legacy::SlotFinger2:
case EQEmu::legacy::SlotChest:
case EQEmu::legacy::SlotWaist:
case EQEmu::legacy::SlotPowerSource:
case EQEmu::legacy::SlotAmmo:
case EQEmu::inventory::slotCharm:
case EQEmu::inventory::slotEar1:
case EQEmu::inventory::slotHead:
case EQEmu::inventory::slotFace:
case EQEmu::inventory::slotEar2:
case EQEmu::inventory::slotNeck:
case EQEmu::inventory::slotBack:
case EQEmu::inventory::slotWrist1:
case EQEmu::inventory::slotWrist2:
case EQEmu::inventory::slotRange:
case EQEmu::inventory::slotPrimary:
case EQEmu::inventory::slotSecondary:
case EQEmu::inventory::slotFinger1:
case EQEmu::inventory::slotFinger2:
case EQEmu::inventory::slotChest:
case EQEmu::inventory::slotWaist:
case EQEmu::inventory::slotPowerSource:
case EQEmu::inventory::slotAmmo:
c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
break;
case EQEmu::legacy::SlotShoulders:
case EQEmu::legacy::SlotArms:
case EQEmu::legacy::SlotHands:
case EQEmu::legacy::SlotLegs:
case EQEmu::legacy::SlotFeet:
case EQEmu::inventory::slotShoulders:
case EQEmu::inventory::slotArms:
case EQEmu::inventory::slotHands:
case EQEmu::inventory::slotLegs:
case EQEmu::inventory::slotFeet:
c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
break;
default:
@ -7236,12 +7236,12 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
const EQEmu::ItemData* item = nullptr;
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
if (inst)
item = inst->GetItem();
window_text.append("<c \"#FFFFFF\">");
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::legacy::SlotPowerSource : i));
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::inventory::slotPowerSource : i));
window_text.append(": ");
if (item) {
//window_text.append("</c>");

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) {
int16 slot_id = atoi(row[0]);
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource)
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource)
continue;
uint32 item_id = atoi(row[1]);
@ -1093,7 +1093,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
if (item_inst->GetItem()->Attuneable) {
if (atoi(row[4]))
item_inst->SetAttuned(true);
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::legacy::SlotPowerSource))
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::inventory::slotPowerSource))
item_inst->SetAttuned(true);
}
@ -1161,7 +1161,7 @@ bool BotDatabase::LoadItemBySlot(Bot* bot_inst)
bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id)
{
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource))
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
return false;
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
@ -1179,7 +1179,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint
bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEmu::ItemInstance* item_inst)
{
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource))
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
return false;
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
@ -1188,8 +1188,8 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
if (!item_inst || !item_inst->GetID())
return true;
uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 };
for (int augment_iter = 0; augment_iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++augment_iter)
uint32 augment_id[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
for (int augment_iter = EQEmu::inventory::socketBegin; augment_iter < EQEmu::inventory::SocketCount; ++augment_iter)
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
uint16 item_charges = 0;
@ -1263,7 +1263,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id)
{
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource))
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
return false;
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
@ -1302,12 +1302,12 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c
return false;
bool all_flag = (slot_id == -2);
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource && !all_flag)
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource && !all_flag)
return false;
std::string where_clause;
if (all_flag)
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::legacy::SlotHead, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet);
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::inventory::slotHead, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotHands, EQEmu::inventory::slotChest, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet);
else
where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id);
@ -1752,7 +1752,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo
" AND bi.`slot_id` = '%i'",
owner_id,
rgb_value,
EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet,
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet,
slot_id
);
auto results = QueryDatabase(query);
@ -1776,7 +1776,7 @@ bool BotDatabase::SaveAllArmorColors(const uint32 owner_id, const uint32 rgb_val
" AND bi.`slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
owner_id,
rgb_value,
EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet
);
auto results = QueryDatabase(query);
if (!results.Success())

View File

@ -2800,7 +2800,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
if (item && item->IsClassCommon())
{
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::textures::TextureInvalid)
if (matslot != EQEmu::textures::materialInvalid)
{
m_pp.item_material.Slot[matslot].Material = GetEquipmentMaterial(matslot);
}
@ -3132,17 +3132,17 @@ void Client::Tell_StringID(uint32 string_id, const char *who, const char *messag
}
void Client::SetTint(int16 in_slot, uint32 color) {
EQEmu::Tint_Struct new_color;
EQEmu::textures::Tint_Struct new_color;
new_color.Color = color;
SetTint(in_slot, new_color);
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color);
}
// Still need to reconcile bracer01 versus bracer02
void Client::SetTint(int16 in_slot, EQEmu::Tint_Struct& color) {
void Client::SetTint(int16 in_slot, EQEmu::textures::Tint_Struct& color) {
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::textures::TextureInvalid)
if (matslot != EQEmu::textures::materialInvalid)
{
m_pp.item_tint.Slot[matslot].Color = color.Color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
@ -3219,28 +3219,28 @@ void Client::LinkDead()
uint8 Client::SlotConvert(uint8 slot,bool bracer){
uint8 slot2 = 0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...)
if(bracer)
return EQEmu::legacy::SlotWrist2;
return EQEmu::inventory::slotWrist2;
switch(slot) {
case EQEmu::textures::TextureHead:
slot2 = EQEmu::legacy::SlotHead;
case EQEmu::textures::armorHead:
slot2 = EQEmu::inventory::slotHead;
break;
case EQEmu::textures::TextureChest:
slot2 = EQEmu::legacy::SlotChest;
case EQEmu::textures::armorChest:
slot2 = EQEmu::inventory::slotChest;
break;
case EQEmu::textures::TextureArms:
slot2 = EQEmu::legacy::SlotArms;
case EQEmu::textures::armorArms:
slot2 = EQEmu::inventory::slotArms;
break;
case EQEmu::textures::TextureWrist:
slot2 = EQEmu::legacy::SlotWrist1;
case EQEmu::textures::armorWrist:
slot2 = EQEmu::inventory::slotWrist1;
break;
case EQEmu::textures::TextureHands:
slot2 = EQEmu::legacy::SlotHands;
case EQEmu::textures::armorHands:
slot2 = EQEmu::inventory::slotHands;
break;
case EQEmu::textures::TextureLegs:
slot2 = EQEmu::legacy::SlotLegs;
case EQEmu::textures::armorLegs:
slot2 = EQEmu::inventory::slotLegs;
break;
case EQEmu::textures::TextureFeet:
slot2 = EQEmu::legacy::SlotFeet;
case EQEmu::textures::armorFeet:
slot2 = EQEmu::inventory::slotFeet;
break;
}
return slot2;
@ -3249,26 +3249,26 @@ uint8 Client::SlotConvert(uint8 slot,bool bracer){
uint8 Client::SlotConvert2(uint8 slot){
uint8 slot2 = 0; // same as above...
switch(slot){
case EQEmu::legacy::SlotHead:
slot2 = EQEmu::textures::TextureHead;
case EQEmu::inventory::slotHead:
slot2 = EQEmu::textures::armorHead;
break;
case EQEmu::legacy::SlotChest:
slot2 = EQEmu::textures::TextureChest;
case EQEmu::inventory::slotChest:
slot2 = EQEmu::textures::armorChest;
break;
case EQEmu::legacy::SlotArms:
slot2 = EQEmu::textures::TextureArms;
case EQEmu::inventory::slotArms:
slot2 = EQEmu::textures::armorArms;
break;
case EQEmu::legacy::SlotWrist1:
slot2 = EQEmu::textures::TextureWrist;
case EQEmu::inventory::slotWrist1:
slot2 = EQEmu::textures::armorWrist;
break;
case EQEmu::legacy::SlotHands:
slot2 = EQEmu::textures::TextureHands;
case EQEmu::inventory::slotHands:
slot2 = EQEmu::textures::armorHands;
break;
case EQEmu::legacy::SlotLegs:
slot2 = EQEmu::textures::TextureLegs;
case EQEmu::inventory::slotLegs:
slot2 = EQEmu::textures::armorLegs;
break;
case EQEmu::legacy::SlotFeet:
slot2 = EQEmu::textures::TextureFeet;
case EQEmu::inventory::slotFeet:
slot2 = EQEmu::textures::armorFeet;
break;
}
return slot2;
@ -4268,14 +4268,14 @@ bool Client::GroupFollow(Client* inviter) {
uint16 Client::GetPrimarySkillValue()
{
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
if (!equiped)
skill = EQEmu::skills::SkillHandtoHand;
else {
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch (type) {
case EQEmu::item::ItemType1HSlash: // 1H Slashing
@ -5785,7 +5785,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
}
}
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
if(inst) {
item = inst->GetItem();
@ -5799,7 +5799,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
}
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotAmmo);
if(inst) {
item = inst->GetItem();
@ -6341,8 +6341,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->Corrup = GetCorrup();
made_npc->PhR = GetPhR();
// looks
made_npc->texture = GetEquipmentMaterial(EQEmu::textures::TextureChest);
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::textures::TextureHead);
made_npc->texture = GetEquipmentMaterial(EQEmu::textures::armorChest);
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::textures::armorHead);
made_npc->haircolor = GetHairColor();
made_npc->beardcolor = GetBeardColor();
made_npc->eyecolor1 = GetEyeColor1();
@ -6353,9 +6353,9 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_heritage = GetDrakkinHeritage();
made_npc->drakkin_tattoo = GetDrakkinTattoo();
made_npc->drakkin_details = GetDrakkinDetails();
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::textures::TexturePrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::textures::TextureSecondary);
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTexture; i++) {
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::textures::weaponPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::textures::weaponSecondary);
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTexture; i++) {
made_npc->armor_tint.Slot[i].Color = GetEquipmentColor(i);
}
made_npc->loottable_id = 0;
@ -8061,7 +8061,7 @@ void Client::TickItemCheck()
TryItemTick(i);
}
//Scan main inventory + cursor
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
{
TryItemTick(i);
}
@ -8092,7 +8092,7 @@ void Client::TryItemTick(int slot)
//Only look at augs in main inventory
if (slot > EQEmu::legacy::EQUIPMENT_END) { return; }
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
{
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
if(!a_inst) { continue; }
@ -8118,7 +8118,7 @@ void Client::ItemTimerCheck()
TryItemTimer(i);
}
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
{
TryItemTimer(i);
}
@ -8149,7 +8149,7 @@ void Client::TryItemTimer(int slot)
return;
}
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
{
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
if(!a_inst) {
@ -8482,7 +8482,7 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
AddMoneyToPP(copper, silver, gold, platinum, false);
if (itemid > 0)
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotPowerSource);
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotPowerSource);
if (faction)
{

View File

@ -222,7 +222,7 @@ public:
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
virtual bool HasGroup() { return (GetGroup() ? true : false); }
@ -808,7 +808,7 @@ public:
uint32 NukeItem(uint32 itemnum, uint8 where_to_check =
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
void SetTint(int16 slot_id, uint32 color);
void SetTint(int16 slot_id, EQEmu::Tint_Struct& color);
void SetTint(int16 slot_id, EQEmu::textures::Tint_Struct& color);
void SetMaterial(int16 slot_id, uint32 item_id);
void Undye();
int32 GetItemIDAt(int16 slot_id);
@ -822,7 +822,7 @@ public:
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
void PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst, ServerLootItem_Struct** bag_item_data = 0);
bool AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::legacy::SlotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::inventory::slotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
void SetStats(uint8 type,int16 set_val);
void IncStats(uint8 type,int16 increase_val);
void DropItem(int16 slot_id);

View File

@ -1074,9 +1074,9 @@ int32 Client::CalcAC()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType;
if (shield == EQEmu::item::ItemTypeShield) {
displayed += itembonuses.HeroicSTR / 2;
}
@ -1103,9 +1103,9 @@ int32 Client::GetACMit()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType;
if (shield == EQEmu::item::ItemTypeShield) {
mitigation += itembonuses.HeroicSTR / 2;
}
@ -1320,7 +1320,7 @@ uint32 Client::CalcCurrentWeight()
EQEmu::ItemInstance* ins;
uint32 Total = 0;
int x;
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::SlotCursor; x++) { // include cursor or not?
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::inventory::slotCursor; x++) { // include cursor or not?
TempItem = 0;
ins = GetInv().GetItem(x);
if (ins) {
@ -1343,7 +1343,7 @@ uint32 Client::CalcCurrentWeight()
if (TmpWeight > 0) {
// this code indicates that weight redux bags can only be in the first general inventory slot to be effective...
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
int bagslot = EQEmu::legacy::SlotGeneral1;
int bagslot = EQEmu::inventory::slotGeneral1;
int reduction = 0;
for (int m = EQEmu::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
if (x >= m) {
@ -2219,12 +2219,12 @@ int Client::GetRawACNoShield(int &shield_ac) const
{
int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC;
shield_ac = 0;
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotSecondary);
if (inst) {
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if (inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;

View File

@ -1334,7 +1334,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
}
/* Set item material tint */
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTexture; i++)
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTexture; i++)
{
if (m_pp.item_tint.Slot[i].UseTint == 1 || m_pp.item_tint.Slot[i].UseTint == 255)
{
@ -1691,7 +1691,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (iter == m_inv.cursor_cbegin())
continue;
const EQEmu::ItemInstance *inst = *iter;
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
}
}
@ -2029,7 +2029,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
}
Save(1);
}
@ -2554,7 +2554,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
}
Save(1);
@ -2604,7 +2604,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
SetAlternateCurrencyValue(reclaim->currency_id, 0);
}
else {
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotCursor);
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotCursor);
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
}
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
@ -2816,8 +2816,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
}
uint32 ApplyPoisonSuccessResult = 0;
ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer;
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
const EQEmu::ItemInstance* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == EQEmu::item::ItemTypePoison);
@ -2999,7 +2999,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
case 0: // Adding an augment
case 2: // Swapping augment
new_aug = user_inv.GetItem(EQEmu::legacy::SlotCursor);
new_aug = user_inv.GetItem(EQEmu::inventory::slotCursor);
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
{
@ -3057,7 +3057,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemOneToPush)
{
DeleteItemInInventory(item_slot, 0, true);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, new_aug->IsStackable() ? 1 : 0, true);
DeleteItemInInventory(EQEmu::inventory::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
if (solvent)
{
@ -3068,7 +3068,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemTwoToPush)
{
// This is a swap. Return the old aug to the player's cursor.
if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true))
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap.");
Message(15, "Error: Failed to retrieve old augment after augmentation swap!");
@ -3081,7 +3081,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != EQEmu::textures::TextureInvalid)
if (mat != EQEmu::textures::materialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
@ -3146,13 +3146,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != EQEmu::textures::TextureInvalid)
if (mat != EQEmu::textures::materialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
// Drop the removed augment on the player's cursor
if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true))
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal.");
Message(15, "Error: Failed to return augment after removal from item!");
@ -3201,7 +3201,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != EQEmu::textures::TextureInvalid)
if (mat != EQEmu::textures::materialInvalid)
{
SendWearChange(mat);
}
@ -4070,7 +4070,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
}
else
{
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::legacy::SlotCursor, castspell->inventoryslot);
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::inventory::slotCursor, castspell->inventoryslot);
InterruptSpell(castspell->spell_id);
}
}
@ -4993,7 +4993,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app)
void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
{
DropItem(EQEmu::legacy::SlotCursor);
DropItem(EQEmu::inventory::slotCursor);
return;
}
@ -6919,7 +6919,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
return;
}
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::legacy::SlotCursor);
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::inventory::slotCursor);
bool Allowed = true;
@ -6967,7 +6967,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
GuildBankDepositAck(false, sentAction);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, false);
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, false);
}
break;
@ -6988,7 +6988,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
case GuildBankWithdraw:
{
if (GetInv()[EQEmu::legacy::SlotCursor])
if (GetInv()[EQEmu::inventory::slotCursor])
{
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
@ -7034,7 +7034,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
PushItemOnCursor(*inst);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
}
@ -8016,7 +8016,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
const EQEmu::ItemData* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) {
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
const EQEmu::ItemInstance* inst = GetInv().GetItem(L);
item = inst ? inst->GetItem() : nullptr;
@ -8036,7 +8036,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
else { insr->itemicons[L] = 0xFFFFFFFF; }
}
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::legacy::SlotAmmo);
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotAmmo);
item = inst ? inst->GetItem() : nullptr;
if (item) {
@ -8498,7 +8498,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
EQEmu::ItemInstance* clickaug = 0;
EQEmu::ItemData* augitem = 0;
for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
if (!aug_i)
continue;
@ -12031,7 +12031,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
shield_target = entity_list.GetMob(shield->target_id);
bool ack = false;
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotSecondary);
if (!shield_target)
return;
if (inst)
@ -12243,8 +12243,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
// shouldn't we be reimbursing if these two fail?
//make sure we are not completely full...
if (freeslotid == EQEmu::legacy::SlotCursor) {
if (m_inv.GetItem(EQEmu::legacy::SlotCursor) != nullptr) {
if (freeslotid == EQEmu::inventory::slotCursor) {
if (m_inv.GetItem(EQEmu::inventory::slotCursor) != nullptr) {
Message(13, "You do not have room for any more items.");
safe_delete(outapp);
safe_delete(inst);

View File

@ -296,7 +296,7 @@ bool Client::Process() {
}
if(AutoFireEnabled()){
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::legacy::SlotRange);
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::inventory::slotRange);
if(ranged)
{
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQEmu::item::ItemTypeBow){
@ -391,10 +391,10 @@ bool Client::Process() {
}
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
{
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotPrimary);
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotPrimary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotPrimary);
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotPrimary);
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotPrimary);
if (CheckAATimer(aaTimerRampage))
entity_list.AEAttack(this, 30);
}
@ -430,10 +430,10 @@ bool Client::Process() {
else if(auto_attack_target->GetHP() > -10) {
CheckIncreaseSkill(EQEmu::skills::SkillDualWield, auto_attack_target, -10);
if (CheckDualWield()) {
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary);
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotSecondary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotSecondary);
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotSecondary);
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotSecondary);
}
}
}
@ -763,7 +763,7 @@ void Client::BulkSendInventoryItems()
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
// Possessions items
for (int16 slot_id = SLOT_BEGIN; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
for (int16 slot_id = EQEmu::inventory::slotBegin; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
const EQEmu::ItemInstance* inst = m_inv[slot_id];
if (!inst)
continue;
@ -778,12 +778,12 @@ void Client::BulkSendInventoryItems()
// PowerSource item
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotPowerSource];
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
if (inst) {
inst->Serialize(ob, EQEmu::legacy::SlotPowerSource);
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
if (ob.tellp() == last_pos)
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::legacy::SlotPowerSource);
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
last_pos = ob.tellp();
}
@ -1095,7 +1095,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
switch(memspell->scribing)
{
case memSpellScribing: { // scribing spell to book
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotCursor];
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotCursor];
if (inst && inst->IsClassCommon())
{
@ -1109,7 +1109,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
{
ScribeSpell(memspell->spell_id, memspell->slot);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 1, true);
DeleteItemInInventory(EQEmu::inventory::slotCursor, 1, true);
}
else
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");

View File

@ -2417,14 +2417,14 @@ void command_texture(Client *c, const Seperator *sep)
// Player Races Wear Armor, so Wearchange is sent instead
int i;
if (!c->GetTarget())
for (i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
{
c->SendTextureWC(i, texture);
}
else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) ||
c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 ||
c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) {
for (i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
{
c->GetTarget()->SendTextureWC(i, texture);
}
@ -2567,14 +2567,14 @@ void command_peekinv(Client *c, const Seperator *sep)
}
if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
inst_main = targetClient->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
inst_main = targetClient->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), "WornSlot: %i, Item: %i (%s), Charges: %i",
EQEmu::legacy::SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
EQEmu::inventory::slotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
}
// inv
@ -2588,7 +2588,7 @@ void command_peekinv(Client *c, const Seperator *sep)
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()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -2608,7 +2608,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message(1, "CursorSlot: %i, Item: %i (%s), Charges: %i",
EQEmu::legacy::SlotCursor, 0, item_link.c_str(), 0);
EQEmu::inventory::slotCursor, 0, item_link.c_str(), 0);
}
else {
int cursorDepth = 0;
@ -2620,9 +2620,9 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i",
EQEmu::legacy::SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
EQEmu::inventory::slotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; (cursorDepth == 0) && inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -2630,7 +2630,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, indexSub), EQEmu::legacy::SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
Inventory::CalcSlotId(EQEmu::inventory::slotCursor, indexSub), EQEmu::inventory::slotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
}
@ -2659,7 +2659,7 @@ void command_peekinv(Client *c, const Seperator *sep)
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()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -2681,7 +2681,7 @@ void command_peekinv(Client *c, const Seperator *sep)
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()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -2704,7 +2704,7 @@ void command_peekinv(Client *c, const Seperator *sep)
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()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -2726,7 +2726,7 @@ void command_peekinv(Client *c, const Seperator *sep)
else {
c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID());
for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::legacy::TYPE_WORLD_SIZE; ++indexMain) {
for (int16 indexMain = EQEmu::inventory::slotBegin; indexMain < EQEmu::legacy::TYPE_WORLD_SIZE; ++indexMain) {
inst_main = objectTradeskill->GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@ -2736,7 +2736,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i",
(EQEmu::legacy::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_INDEX_BEGIN; inst_main && inst_main->IsType(EQEmu::item::ItemClassBag) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsType(EQEmu::item::ItemClassBag) && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@ -3145,8 +3145,8 @@ void command_listpetition(Client *c, const Seperator *sep)
void command_equipitem(Client *c, const Seperator *sep)
{
uint32 slot_id = atoi(sep->arg[1]);
if (sep->IsNumber(1) && ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource))) {
const EQEmu::ItemInstance* from_inst = c->GetInv().GetItem(EQEmu::legacy::SlotCursor);
if (sep->IsNumber(1) && ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::inventory::slotPowerSource))) {
const EQEmu::ItemInstance* from_inst = c->GetInv().GetItem(EQEmu::inventory::slotCursor);
const EQEmu::ItemInstance* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
bool partialmove = false;
int16 movecount;
@ -3154,7 +3154,7 @@ void command_equipitem(Client *c, const Seperator *sep)
if (from_inst && from_inst->IsClassCommon()) {
auto outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct));
MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer;
mi->from_slot = EQEmu::legacy::SlotCursor;
mi->from_slot = EQEmu::inventory::slotCursor;
mi->to_slot = slot_id;
// mi->number_in_stack = from_inst->GetCharges(); // replaced with con check for stacking
@ -4339,7 +4339,7 @@ void command_goto(Client *c, const Seperator *sep)
void command_iteminfo(Client *c, const Seperator *sep)
{
auto inst = c->GetInv()[EQEmu::legacy::SlotCursor];
auto inst = c->GetInv()[EQEmu::inventory::slotCursor];
if (!inst) {
c->Message(13, "Error: You need an item on your cursor for this command");
return;
@ -7124,7 +7124,7 @@ void command_path(Client *c, const Seperator *sep)
}
void Client::Undye() {
for (int cur_slot = EQEmu::textures::TextureBegin; cur_slot <= EQEmu::textures::LastTexture; cur_slot++) {
for (int cur_slot = EQEmu::textures::textureBegin; cur_slot <= EQEmu::textures::LastTexture; cur_slot++) {
uint8 slot2=SlotConvert(cur_slot);
EQEmu::ItemInstance* inst = m_inv.GetItem(slot2);

View File

@ -323,12 +323,12 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
// to go into the regular slots on the player, out of bags
std::list<uint32> removed_list;
for (i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) {
if (i == EQEmu::legacy::SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
for (i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) {
if (i == EQEmu::inventory::slotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
if (item != nullptr) {
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
MoveItemToCorpse(client, item, EQEmu::legacy::SlotPowerSource, removed_list);
MoveItemToCorpse(client, item, EQEmu::inventory::slotPowerSource, removed_list);
}
}
@ -405,9 +405,9 @@ void Corpse::MoveItemToCorpse(Client *client, EQEmu::ItemInstance *inst, int16 e
while (true) {
if (!inst->IsClassBag()) { break; }
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::legacy::SlotCursor) { break; }
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::inventory::slotCursor) { break; }
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++sub_index) {
for (int16 sub_index = EQEmu::inventory::containerBegin; sub_index < EQEmu::inventory::ContainerCount; ++sub_index) {
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
if (bag_inst == nullptr) { continue; }
@ -685,7 +685,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
}
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_INDEX_BEGIN);
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, EQEmu::inventory::containerBegin);
cur = itemlist.begin();
end = itemlist.end();
@ -740,7 +740,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
itemlist.erase(iter);
uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
if (material != EQEmu::textures::TextureInvalid)
if (material != EQEmu::textures::materialInvalid)
SendWearChange(material);
UpdateEquipmentLight();
@ -999,7 +999,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur;
@ -1008,7 +1008,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
// Dont display the item if it's in a bag
// Added cursor queue slots to corpse item visibility list. Nothing else should be making it to corpse.
if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::legacy::SlotCursor || item_data->equip_slot == EQEmu::legacy::SlotPowerSource || Loot_Request_Type >= 3 ||
if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::inventory::slotCursor || item_data->equip_slot == EQEmu::inventory::slotPowerSource || Loot_Request_Type >= 3 ||
(item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) {
if(i < corpselootlimit) {
item = database.GetItem(item_data->item_id);
@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
}
if (inst->IsAugmented()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
EQEmu::ItemInstance *itm = inst->GetAugment(i);
if (itm) {
if (client->CheckLoreConflict(itm->GetItem())) {
@ -1190,10 +1190,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
/* First add it to the looter - this will do the bag contents too */
if (lootitem->auto_loot) {
if (!client->AutoPutLootInInventory(*inst, true, true, bag_item_data))
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
}
else {
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
}
/* Update any tasks that have an activity to loot this item */
@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
/* Remove Bag Contents */
if (item->IsClassBag() && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
for (int i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
for (int i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
if (bag_item_data[i]) {
/* 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);
@ -1294,7 +1294,7 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
for(; cur != end; ++cur) {
ServerLootItem_Struct* sitem = *cur;
@ -1403,12 +1403,12 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
int16 invslot;
if (material_slot > EQEmu::textures::LastTexture) {
return NO_ITEM;
return 0;
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a NO_ITEM for any invalid index...
return NO_ITEM;
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a 0 for any invalid index...
return 0;
return GetWornItem(invslot);
}
@ -1421,7 +1421,7 @@ uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
}
item = database.GetItem(GetEquipment(material_slot));
if(item != NO_ITEM) {
if(item != 0) {
return (item_tint.Slot[material_slot].UseTint ? item_tint.Slot[material_slot].Color : item->Color);
}
@ -1434,8 +1434,8 @@ void Corpse::UpdateEquipmentLight()
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::legacy::SlotPowerSource) { continue; }
if ((*iter)->equip_slot == EQEmu::legacy::SlotAmmo) { continue; }
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::inventory::slotPowerSource) { continue; }
if ((*iter)->equip_slot == EQEmu::inventory::slotAmmo) { continue; }
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }

View File

@ -53,7 +53,7 @@ class Corpse : public Mob {
/* Corpse: General */
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
virtual Raid* GetRaid() { return 0; }

View File

@ -188,7 +188,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
uint8 keepoffkeyring = GetNoKeyring();
uint32 haskey = 0;
uint32 playerkey = 0;
const EQEmu::ItemInstance *lockpicks = sender->GetInv().GetItem(EQEmu::legacy::SlotCursor);
const EQEmu::ItemInstance *lockpicks = sender->GetInv().GetItem(EQEmu::inventory::slotCursor);
haskey = sender->GetInv().HasItem(keyneeded, 1);

View File

@ -36,7 +36,7 @@ public:
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0) {
return false;
}

View File

@ -352,7 +352,7 @@ public:
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::legacy::SlotPrimary, int count = 0, bool IsFromSpell = false);
void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::inventory::slotPrimary, int count = 0, bool IsFromSpell = false);
void AETaunt(Client *caster, float range=0, int32 bonus_hate=0);
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);

View File

@ -153,7 +153,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
//we need this function to immediately determine, after we receive OP_Fishing, if we can even try to fish, otherwise we have to wait a while to get the failure
bool Client::CanFish() {
//make sure we still have a fishing pole on:
const EQEmu::ItemInstance* Pole = m_inv[EQEmu::legacy::SlotPrimary];
const EQEmu::ItemInstance* Pole = m_inv[EQEmu::inventory::slotPrimary];
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
const EQEmu::ItemInstance* Bait = nullptr;
if (bslot != INVALID_INDEX)
@ -317,12 +317,12 @@ void Client::GoFish()
else
{
PushItemOnCursor(*inst);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
if(RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(ActivityFish, food_id);
safe_delete(inst);
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
}
if(inst) {
@ -354,7 +354,7 @@ void Client::GoFish()
//and then swap out items in primary slot... too lazy to fix right now
if (zone->random.Int(0, 49) == 1) {
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true);
DeleteItemInInventory(EQEmu::inventory::slotPrimary, 0, true);
}
if (CheckIncreaseSkill(EQEmu::skills::SkillFishing, nullptr, 5))
@ -431,12 +431,12 @@ void Client::ForageItem(bool guarantee) {
}
else {
PushItemOnCursor(*inst);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
if(RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(ActivityForage, foragedfood);
safe_delete(inst);
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
}
if(inst) {

View File

@ -48,8 +48,8 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
}
if (GetItemIDAt(EQEmu::legacy::SlotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotPowerSource) != INVALID_ID)) {
cur = m_inv.GetItem(EQEmu::legacy::SlotPowerSource);
if (GetItemIDAt(EQEmu::inventory::slotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::inventory::slotPowerSource) != INVALID_ID)) {
cur = m_inv.GetItem(EQEmu::inventory::slotPowerSource);
if(cur && cur->GetItem()->Stackable) {
x += cur->GetCharges();
} else {
@ -57,22 +57,22 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, true);
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, true);
else
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, false); // Prevents Titanium crash
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, false); // Prevents Titanium crash
}
}
if(where_to_check & invWhereCursor) {
if (GetItemIDAt(EQEmu::legacy::SlotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotCursor) != INVALID_ID)) {
cur = m_inv.GetItem(EQEmu::legacy::SlotCursor);
if (GetItemIDAt(EQEmu::inventory::slotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::inventory::slotCursor) != INVALID_ID)) {
cur = m_inv.GetItem(EQEmu::inventory::slotCursor);
if(cur && cur->GetItem()->Stackable) {
x += cur->GetCharges();
} else {
x++;
}
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true);
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, true);
}
for (i = EQEmu::legacy::CURSOR_BAG_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++) {
@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
}
*/
uint32 augments[EQEmu::legacy::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 augments[EQEmu::inventory::SocketCount] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 classes = item->Classes;
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 enforceusable = RuleB(Inventory, EnforceAugmentUsability);
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) {
for (int iter = EQEmu::inventory::socketBegin; iter < EQEmu::inventory::SocketCount; ++iter) {
const EQEmu::ItemData* augtest = database.GetItem(augments[iter]);
if(augtest == nullptr) {
@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
}
// add any validated augments
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) {
for (int iter = EQEmu::inventory::socketBegin; iter < EQEmu::inventory::SocketCount; ++iter) {
if(augments[iter])
inst->PutAugment(&database, iter, augments[iter]);
}
@ -554,22 +554,22 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
inst->SetOrnamentHeroModel(ornament_hero_model);
// check to see if item is usable in requested slot
if (enforceusable && (((to_slot >= EQEmu::legacy::SlotCharm) && (to_slot <= EQEmu::legacy::SlotAmmo)) || (to_slot == EQEmu::legacy::SlotPowerSource))) {
uint32 slottest = (to_slot == EQEmu::legacy::SlotPowerSource) ? 22 : to_slot; // can't change '22' just yet...
if (enforceusable && (((to_slot >= EQEmu::inventory::slotCharm) && (to_slot <= EQEmu::inventory::slotAmmo)) || (to_slot == EQEmu::inventory::slotPowerSource))) {
uint32 slottest = (to_slot == EQEmu::inventory::slotPowerSource) ? 22 : to_slot; // can't change '22' just yet...
if(!(slots & ((uint32)1 << slottest))) {
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
to_slot = EQEmu::legacy::SlotCursor;
to_slot = EQEmu::inventory::slotCursor;
}
}
// put item into inventory
if (to_slot == EQEmu::legacy::SlotCursor) {
if (to_slot == EQEmu::inventory::slotCursor) {
PushItemOnCursor(*inst);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
}
else {
PutItemInInventory(to_slot, *inst, true);
@ -617,7 +617,7 @@ void Client::DropItem(int16 slot_id)
}
// Save client inventory change to database
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
SendCursorBuffer();
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(CharacterID(), s, e);
@ -706,11 +706,11 @@ void Client::SendCursorBuffer()
GetName(), test_item->Name, test_item->ID);
Message_StringID(MT_LootMessages, 290);
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
DeleteItemInInventory(EQEmu::legacy::SlotCursor);
DeleteItemInInventory(EQEmu::inventory::slotCursor);
SendCursorBuffer();
}
else {
SendItemPacket(EQEmu::legacy::SlotCursor, test_inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, test_inst, ItemPacketLimbo);
}
}
@ -763,7 +763,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
if (m_inv[slot_id]->IsClassBag()) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
EQEmu::ItemInstance* bagitem = m_inv[slot_id]->GetItem(bag_idx);
if(bagitem) {
@ -790,7 +790,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
bool isDeleted = m_inv.DeleteItem(slot_id, quantity);
const EQEmu::ItemInstance* inst = nullptr;
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
if(update_db)
database.SaveCursor(character_id, s, e);
@ -842,7 +842,7 @@ bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_updat
m_inv.PushCursor(inst);
if (client_update) {
SendItemPacket(EQEmu::legacy::SlotCursor, &inst, ItemPacketLimbo);
SendItemPacket(EQEmu::inventory::slotCursor, &inst, ItemPacketLimbo);
}
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
@ -856,7 +856,7 @@ bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_updat
bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst, bool client_update) {
Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
if (slot_id == EQEmu::legacy::SlotCursor) { // don't trust macros before conditional statements...
if (slot_id == EQEmu::inventory::slotCursor) { // don't trust macros before conditional statements...
return PushItemOnCursor(inst, client_update);
}
else {
@ -865,11 +865,11 @@ bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst,
if (client_update)
{
SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::legacy::SlotCursor) ? ItemPacketLimbo : ItemPacketTrade));
SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::inventory::slotCursor) ? ItemPacketLimbo : ItemPacketTrade));
//SendWearChange(Inventory::CalcMaterialFromSlot(slot_id));
}
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
return database.SaveCursor(this->CharacterID(), s, e);
}
@ -887,7 +887,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
bool cursor_empty = m_inv.CursorEmpty();
if (slot_id == EQEmu::legacy::SlotCursor) {
if (slot_id == EQEmu::inventory::slotCursor) {
m_inv.PushCursor(inst);
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
@ -898,7 +898,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
}
// Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client
if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) {
if (slot_id == EQEmu::inventory::slotCursor && !cursor_empty) {
// RoF+ currently has a specialized cursor handler
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendItemPacket(slot_id, &inst, ItemPacketLimbo);
@ -908,7 +908,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
}
if (bag_item_data) {
for (int index = 0; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
for (int index = 0; index < EQEmu::inventory::ContainerCount; ++index) {
if (bag_item_data[index] == nullptr)
continue;
@ -926,12 +926,12 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
// Dump bag contents to cursor in the event that owning bag is not the first cursor item
// (This assumes that the data passed is correctly associated..no safety checks are implemented)
if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) {
if (slot_id == EQEmu::inventory::slotCursor && !cursor_empty) {
Log.Out(Logs::Detail, Logs::Inventory,
"Putting bag loot item %s (%d) into slot %d (non-empty cursor override)",
inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::legacy::SlotCursor);
inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::inventory::slotCursor);
PutLootInInventory(EQEmu::legacy::SlotCursor, *bagitem);
PutLootInInventory(EQEmu::inventory::slotCursor, *bagitem);
}
else {
auto bag_slot = Inventory::CalcSlotId(slot_id, index);
@ -965,7 +965,7 @@ bool Client::TryStacking(EQEmu::ItemInstance* item, uint8 type, bool try_worn, b
}
}
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
uint16 slotid = Inventory::CalcSlotId(i, j);
EQEmu::ItemInstance* tmp_inst = m_inv.GetItem(slotid);
@ -990,28 +990,28 @@ bool Client::AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn, bo
// #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel <= level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != EQEmu::item::ItemTypeAugmentation) {
// too messy as-is... <watch>
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i < EQEmu::legacy::SlotPowerSource; i++) { // originally (i < 22)
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i < EQEmu::inventory::slotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::legacy::GENERAL_BEGIN) {
// added power source check for SoF+ clients
if (this->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
i = EQEmu::legacy::SlotPowerSource;
i = EQEmu::inventory::slotPowerSource;
else
break;
}
if (!m_inv[i]) {
if (i == EQEmu::legacy::SlotPrimary && inst.IsWeapon()) { // If item is primary slot weapon
if (i == EQEmu::inventory::slotPrimary && inst.IsWeapon()) { // If item is primary slot weapon
if (inst.GetItem()->IsType2HWeapon()) { // and uses 2hs \ 2hb \ 2hp
if (m_inv[EQEmu::legacy::SlotSecondary]) { // and if secondary slot is not empty
if (m_inv[EQEmu::inventory::slotSecondary]) { // and if secondary slot is not empty
continue; // Can't auto-equip
}
}
}
if (i == EQEmu::legacy::SlotSecondary && m_inv[EQEmu::legacy::SlotPrimary]) { // check to see if primary slot is a two hander
if (m_inv[EQEmu::legacy::SlotPrimary]->GetItem()->IsType2HWeapon())
if (i == EQEmu::inventory::slotSecondary && m_inv[EQEmu::inventory::slotPrimary]) { // check to see if primary slot is a two hander
if (m_inv[EQEmu::inventory::slotPrimary]->GetItem()->IsType2HWeapon())
continue;
}
if (i == EQEmu::legacy::SlotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) {
if (i == EQEmu::inventory::slotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) {
continue;
}
@ -1019,7 +1019,7 @@ bool Client::AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn, bo
//send worn to everyone...
PutLootInInventory(i, inst);
uint8 worn_slot_material = Inventory::CalcMaterialFromSlot(i);
if (worn_slot_material != EQEmu::textures::TextureInvalid) {
if (worn_slot_material != EQEmu::textures::materialInvalid) {
SendWearChange(worn_slot_material);
}
@ -1062,7 +1062,7 @@ void Client::MoveItemCharges(EQEmu::ItemInstance &from, int16 to_slot, uint8 typ
tmp_inst->SetCharges(tmp_inst->GetCharges() + charges_to_move);
from.SetCharges(from.GetCharges() - charges_to_move);
SendLootItemInPacket(tmp_inst, to_slot);
if (to_slot == EQEmu::legacy::SlotCursor) {
if (to_slot == EQEmu::inventory::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
}
@ -1319,7 +1319,7 @@ void Client::SendLootItemInPacket(const EQEmu::ItemInstance* inst, int16 slot_id
bool Client::IsValidSlot(uint32 slot) {
if ((slot == (uint32)INVALID_INDEX) ||
(slot >= SLOT_BEGIN && slot < EQEmu::legacy::TYPE_POSSESSIONS_SIZE) ||
(slot >= EQEmu::inventory::slotBegin && slot < EQEmu::legacy::TYPE_POSSESSIONS_SIZE) ||
(slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot <= EQEmu::legacy::CURSOR_BAG_END) ||
(slot >= EQEmu::legacy::TRIBUTE_BEGIN && slot <= EQEmu::legacy::TRIBUTE_END) ||
(slot >= EQEmu::legacy::BANK_BEGIN && slot <= EQEmu::legacy::BANK_END) ||
@ -1328,7 +1328,7 @@ bool Client::IsValidSlot(uint32 slot) {
(slot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_BAGS_END) ||
(slot >= EQEmu::legacy::TRADE_BEGIN && slot <= EQEmu::legacy::TRADE_END) ||
(slot >= EQEmu::legacy::WORLD_BEGIN && slot <= EQEmu::legacy::WORLD_END) ||
(slot == EQEmu::legacy::SlotPowerSource)
(slot == EQEmu::inventory::slotPowerSource)
) {
return true;
}
@ -1378,8 +1378,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { return true; } // Can't do RoF+
if (move_in->to_slot == EQEmu::legacy::SlotCursor) {
auto test_inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
if (move_in->to_slot == EQEmu::inventory::slotCursor) {
auto test_inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
if (test_inst == nullptr) { return true; }
auto test_item = test_inst->GetItem();
if (test_item == nullptr) { return true; }
@ -1398,18 +1398,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
GetName(), test_item->Name, test_item->ID);
Message_StringID(MT_LootMessages, 290);
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true);
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, true);
}
}
return true;
}
if (move_in->to_slot == (uint32)INVALID_INDEX) {
if (move_in->from_slot == (uint32)EQEmu::legacy::SlotCursor) {
if (move_in->from_slot == (uint32)EQEmu::inventory::slotCursor) {
Log.Out(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
if(inst) {
parse->EventItem(EVENT_DESTROY_ITEM, this, inst, nullptr, "", 0);
}
@ -1426,9 +1426,9 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return true; // Item deletion
}
}
if (auto_attack && (move_in->from_slot == EQEmu::legacy::SlotPrimary || move_in->from_slot == EQEmu::legacy::SlotSecondary || move_in->from_slot == EQEmu::legacy::SlotRange))
if (auto_attack && (move_in->from_slot == EQEmu::inventory::slotPrimary || move_in->from_slot == EQEmu::inventory::slotSecondary || move_in->from_slot == EQEmu::inventory::slotRange))
SetAttackTimer();
else if (auto_attack && (move_in->to_slot == EQEmu::legacy::SlotPrimary || move_in->to_slot == EQEmu::legacy::SlotSecondary || move_in->to_slot == EQEmu::legacy::SlotRange))
else if (auto_attack && (move_in->to_slot == EQEmu::inventory::slotPrimary || move_in->to_slot == EQEmu::inventory::slotSecondary || move_in->to_slot == EQEmu::inventory::slotRange))
SetAttackTimer();
// Step 1: Variables
int16 src_slot_id = (int16)move_in->from_slot;
@ -1516,7 +1516,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return(false);
}
if (src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_END && src_inst->IsClassBag()){
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = EQEmu::inventory::containerBegin; idx < EQEmu::inventory::ContainerCount; idx++) {
const EQEmu::ItemInstance* baginst = src_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
@ -1531,7 +1531,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return(false);
}
if (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_END && dst_inst->IsClassBag()){
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = EQEmu::inventory::containerBegin; idx < EQEmu::inventory::ContainerCount; idx++) {
const EQEmu::ItemInstance* baginst = dst_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
@ -1638,7 +1638,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
safe_delete(world_inst);
if (src_slot_id == EQEmu::legacy::SlotCursor)
if (src_slot_id == EQEmu::inventory::slotCursor)
{
if (dstitemid == 0)
{
@ -1660,14 +1660,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 4: Check for entity trade
if (dst_slot_id >= EQEmu::legacy::TRADE_BEGIN && dst_slot_id <= EQEmu::legacy::TRADE_END) {
if (src_slot_id != EQEmu::legacy::SlotCursor) {
if (src_slot_id != EQEmu::inventory::slotCursor) {
Kick();
return false;
}
if (with) {
Log.Out(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName());
// Fill Trade list with items from cursor
if (!m_inv[EQEmu::legacy::SlotCursor]) {
if (!m_inv[EQEmu::inventory::slotCursor]) {
Message(13, "Error: Cursor item not located on server!");
return false;
}
@ -1687,7 +1687,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
SummonItem(src_inst->GetID(), src_inst->GetCharges());
DeleteItemInInventory(EQEmu::legacy::SlotCursor);
DeleteItemInInventory(EQEmu::inventory::slotCursor);
return true;
}
@ -1752,12 +1752,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
else {
// Not dealing with charges - just do direct swap
if (src_inst && (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) && dst_slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) {
if (src_inst && (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::inventory::slotPowerSource) && dst_slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) {
if (src_inst->GetItem()->Attuneable) {
src_inst->SetAttuned(true);
}
if (src_inst->IsAugmented()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
if (src_inst->GetAugment(i)) {
if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
src_inst->GetAugment(i)->SetAttuned(true);
@ -1770,7 +1770,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
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);
if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::legacy::SlotPowerSource) {
if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::inventory::slotPowerSource) {
if(src_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
}
@ -1780,7 +1780,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
}
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) {
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::inventory::slotPowerSource) {
if(dst_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
}
@ -1792,12 +1792,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
int matslot = SlotConvert2(dst_slot_id);
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END && matslot != EQEmu::textures::TextureHead) { // think this is to allow the client to update with /showhelm
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END && matslot != EQEmu::textures::armorHead) { // think this is to allow the client to update with /showhelm
SendWearChange(matslot);
}
// Step 7: Save change to the database
if (src_slot_id == EQEmu::legacy::SlotCursor) {
if (src_slot_id == EQEmu::inventory::slotCursor) {
// If not swapping another item to cursor and stacking items were depleted
if (dstitemid == 0 || all_to_stack == true)
{
@ -1810,7 +1810,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
database.SaveInventory(character_id, m_inv.GetItem(src_slot_id), src_slot_id);
}
if (dst_slot_id == EQEmu::legacy::SlotCursor) {
if (dst_slot_id == EQEmu::inventory::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(character_id, s, e);
}
@ -1834,7 +1834,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);
Message(15, "Inventory Desyncronization detected: Resending slot data...");
if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::legacy::SlotPowerSource) {
if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::inventory::slotPowerSource) {
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) {
// This prevents the client from crashing when closing any 'phantom' bags
@ -1877,7 +1877,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
}
if ((move_slots->to_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->to_slot == EQEmu::legacy::SlotPowerSource) {
if ((move_slots->to_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->to_slot == EQEmu::inventory::slotPowerSource) {
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) {
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
@ -1959,7 +1959,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
if (from_inst->IsType(EQEmu::item::ItemClassBag)) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
const EQEmu::ItemInstance* from_baginst = from_inst->GetItem(bag_idx);
if(from_baginst) {
@ -1992,7 +1992,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
if (to_inst->IsType(EQEmu::item::ItemClassBag)) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
const EQEmu::ItemInstance* to_baginst = to_inst->GetItem(bag_idx);
if(to_baginst) {
@ -2021,7 +2021,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
void Client::DyeArmor(EQEmu::TintProfile* dye){
int16 slot=0;
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++) {
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++) {
if ((m_pp.item_tint.Slot[i].Color & 0x00FFFFFF) != (dye->Slot[i].Color & 0x00FFFFFF)) {
slot = m_inv.HasItem(32557, 1, invWherePersonal);
if (slot != INVALID_INDEX){
@ -2115,7 +2115,7 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
int num = 0;
for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++)
{
if (x == EQEmu::legacy::SlotCursor + 1)
if (x == EQEmu::inventory::slotCursor + 1)
x = EQEmu::legacy::GENERAL_BAGS_BEGIN;
TempItem = nullptr;
ins = GetInv().GetItem(x);
@ -2132,7 +2132,7 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
return false;
for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
{
if (x == EQEmu::legacy::SlotCursor + 1)
if (x == EQEmu::inventory::slotCursor + 1)
x = EQEmu::legacy::GENERAL_BAGS_BEGIN;
TempItem = nullptr;
ins = GetInv().GetItem(x);
@ -2293,7 +2293,7 @@ void Client::DisenchantSummonedBags(bool client_update)
}
while (!m_inv.CursorEmpty()) {
auto inst = m_inv[EQEmu::legacy::SlotCursor];
auto inst = m_inv[EQEmu::inventory::slotCursor];
if (!inst) { break; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
if (!inst->GetItem()->IsClassBag()) { break; }
@ -2307,14 +2307,14 @@ void Client::DisenchantSummonedBags(bool client_update)
if (!new_inst) { break; }
if (CopyBagContents(new_inst, inst)) {
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::legacy::SlotCursor);
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::inventory::slotCursor);
std::list<EQEmu::ItemInstance*> local;
local.push_front(new_inst);
m_inv.PopItem(EQEmu::legacy::SlotCursor);
m_inv.PopItem(EQEmu::inventory::slotCursor);
safe_delete(inst);
while (!m_inv.CursorEmpty()) {
auto limbo_inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
auto limbo_inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
if (limbo_inst == nullptr) { continue; }
local.push_back(limbo_inst);
}
@ -2356,11 +2356,11 @@ void Client::RemoveNoRent(bool client_update)
}
}
if (m_inv[EQEmu::legacy::SlotPowerSource]) {
auto inst = m_inv[EQEmu::legacy::SlotPowerSource];
if (m_inv[EQEmu::inventory::slotPowerSource]) {
auto inst = m_inv[EQEmu::inventory::slotPowerSource];
if (inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource);
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
}
}
@ -2408,7 +2408,7 @@ void Client::RemoveNoRent(bool client_update)
std::list<EQEmu::ItemInstance*> local;
while (!m_inv.CursorEmpty()) {
auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
auto inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
if (inst == nullptr) { continue; }
local.push_back(inst);
}
@ -2460,15 +2460,15 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst);
}
if (m_inv[EQEmu::legacy::SlotPowerSource]) {
auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource);
if (m_inv[EQEmu::inventory::slotPowerSource]) {
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
if (inst) {
if (CheckLoreConflict(inst->GetItem())) {
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource);
database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource);
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
}
else {
m_inv.PutItem(EQEmu::legacy::SlotPowerSource, *inst);
m_inv.PutItem(EQEmu::inventory::slotPowerSource, *inst);
}
safe_delete(inst);
}
@ -2520,7 +2520,7 @@ void Client::RemoveDuplicateLore(bool client_update)
std::list<EQEmu::ItemInstance*> local_2;
while (!m_inv.CursorEmpty()) {
auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
auto inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
if (inst == nullptr) { continue; }
local_1.push_back(inst);
}
@ -2573,13 +2573,13 @@ void Client::MoveSlotNotAllowed(bool client_update)
}
}
if (m_inv[EQEmu::legacy::SlotPowerSource] && !m_inv[EQEmu::legacy::SlotPowerSource]->IsSlotAllowed(EQEmu::legacy::SlotPowerSource)) {
auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource);
if (m_inv[EQEmu::inventory::slotPowerSource] && !m_inv[EQEmu::inventory::slotPowerSource]->IsSlotAllowed(EQEmu::inventory::slotPowerSource)) {
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource, free_slot_id);
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource, free_slot_id);
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource);
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
safe_delete(inst);
}
@ -2697,13 +2697,13 @@ static int16 BandolierSlotToWeaponSlot(int BandolierSlot)
switch (BandolierSlot)
{
case bandolierPrimary:
return EQEmu::legacy::SlotPrimary;
return EQEmu::inventory::slotPrimary;
case bandolierSecondary:
return EQEmu::legacy::SlotSecondary;
return EQEmu::inventory::slotSecondary;
case bandolierRange:
return EQEmu::legacy::SlotRange;
return EQEmu::inventory::slotRange;
default:
return EQEmu::legacy::SlotAmmo;
return EQEmu::inventory::slotAmmo;
}
}
@ -2778,12 +2778,12 @@ void Client::SetBandolier(const EQApplicationPacket *app)
// removed 'invWhereCursor' argument from above and implemented slots 30, 331-340 checks here
if (slot == INVALID_INDEX) {
if (m_inv.GetItem(EQEmu::legacy::SlotCursor)) {
if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check
slot = EQEmu::legacy::SlotCursor;
if (m_inv.GetItem(EQEmu::inventory::slotCursor)) {
if (m_inv.GetItem(EQEmu::inventory::slotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
m_inv.GetItem(EQEmu::inventory::slotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check
slot = EQEmu::inventory::slotCursor;
}
else if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ItemClass == 1) {
else if (m_inv.GetItem(EQEmu::inventory::slotCursor)->GetItem()->ItemClass == 1) {
for(int16 CursorBagSlot = EQEmu::legacy::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::legacy::CURSOR_BAG_END; CursorBagSlot++) {
if (m_inv.GetItem(CursorBagSlot)) {
if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
@ -2930,7 +2930,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
//
if(ItemToReturn->IsStackable()) {
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
EQEmu::ItemInstance* InvItem = m_inv.GetItem(i);
@ -2956,12 +2956,12 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
//
if (InvItem && InvItem->IsClassBag()) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize=InvItem->GetItem()->BagSlots;
uint8 BagSlot;
for (BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
for (BagSlot = EQEmu::inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
if (InvItem && (InvItem->GetItem()->ID == ItemID) &&
(InvItem->GetCharges() < InvItem->GetItem()->StackSize)) {
@ -2989,7 +2989,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
// We have tried stacking items, now just try and find an empty slot.
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::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::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
EQEmu::ItemInstance* InvItem = m_inv.GetItem(i);
@ -3008,11 +3008,11 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
}
if (InvItem->IsClassBag() && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize=InvItem->GetItem()->BagSlots;
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
for (uint8 BagSlot = EQEmu::inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
@ -3050,7 +3050,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
std::map<int16, const EQEmu::ItemInstance*> instmap;
// build reference map
for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++index) {
for (int16 index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
@ -3078,7 +3078,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
auto tsobject = GetTradeskillObject();
if (tsobject != nullptr) {
for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_WORLD_SIZE; ++index) {
for (int16 index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::TYPE_WORLD_SIZE; ++index) {
auto inst = tsobject->GetItem(index);
if (inst == nullptr) { continue; }
instmap[EQEmu::legacy::WORLD_BEGIN + index] = inst;
@ -3094,8 +3094,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
instmap[8000 + limbo] = *cursor_itr;
}
if (m_inv[EQEmu::legacy::SlotPowerSource])
instmap[EQEmu::legacy::SlotPowerSource] = m_inv[EQEmu::legacy::SlotPowerSource];
if (m_inv[EQEmu::inventory::slotPowerSource])
instmap[EQEmu::inventory::slotPowerSource] = m_inv[EQEmu::inventory::slotPowerSource];
// call InterrogateInventory_ for error check
for (auto instmap_itr = instmap.begin(); (instmap_itr != instmap.end()) && (!error); ++instmap_itr) {
@ -3153,7 +3153,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
}
else {
if (inst) {
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any EQEmu::ItemInstance as having the max internal slots available
for (int16 sub = EQEmu::inventory::containerBegin; (sub < EQEmu::inventory::ContainerCount) && (!error); ++sub) { // treat any EQEmu::ItemInstance as having the max internal slots available
if (inst->GetItem(sub))
InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
}
@ -3183,7 +3183,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
}
if (inst) {
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub) {
for (int16 sub = EQEmu::inventory::containerBegin; (sub < EQEmu::inventory::ContainerCount); ++sub) {
if (inst->GetItem(sub))
InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
}
@ -3202,7 +3202,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
(head >= EQEmu::legacy::TRIBUTE_BEGIN && head <= EQEmu::legacy::TRIBUTE_END) ||
(head >= EQEmu::legacy::WORLD_BEGIN && head <= EQEmu::legacy::WORLD_END) ||
(head >= 8000 && head <= 8101) ||
(head == EQEmu::legacy::SlotPowerSource)) {
(head == EQEmu::inventory::slotPowerSource)) {
switch (depth)
{
case 0: // requirement: inst is extant
@ -3214,7 +3214,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
return true;
if (!parent->IsType(EQEmu::item::ItemClassCommon))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
if (index >= EQEmu::inventory::SocketCount)
return true;
break;
default: // requirement: none (something bad happened...)
@ -3223,7 +3223,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
}
else if (
(head >= EQEmu::legacy::GENERAL_BEGIN && head <= EQEmu::legacy::GENERAL_END) ||
(head == EQEmu::legacy::SlotCursor) ||
(head == EQEmu::inventory::slotCursor) ||
(head >= EQEmu::legacy::BANK_BEGIN && head <= EQEmu::legacy::BANK_END) ||
(head >= EQEmu::legacy::SHARED_BANK_BEGIN && head <= EQEmu::legacy::SHARED_BANK_END) ||
(head >= EQEmu::legacy::TRADE_BEGIN && head <= EQEmu::legacy::TRADE_END)) {
@ -3243,7 +3243,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
if (parent->IsClassCommon()) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
if (index >= EQEmu::inventory::SocketCount)
return true;
}
break;
@ -3257,7 +3257,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
if (parent->IsClassCommon()) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
if (index >= EQEmu::inventory::SocketCount)
return true;
}
break;

View File

@ -313,7 +313,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
// @merth: IDFile size has been increased, this needs to change
uint16 emat;
if(item2->Material <= 0
|| item2->Slots & (1 << EQEmu::legacy::SlotPrimary | 1 << EQEmu::legacy::SlotSecondary)) {
|| item2->Slots & (1 << EQEmu::inventory::slotPrimary | 1 << EQEmu::inventory::slotSecondary)) {
memset(newid, 0, sizeof(newid));
for(int i=0;i<7;i++){
if (!isalpha(item2->IDFile[i])){
@ -327,47 +327,47 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
emat = item2->Material;
}
if (foundslot == EQEmu::legacy::SlotPrimary) {
if (foundslot == EQEmu::inventory::slotPrimary) {
if (item2->Proc.Effect != 0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = EQEmu::textures::TexturePrimary;
eslot = EQEmu::textures::weaponPrimary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
if (item2->IsType2HWeapon())
SetTwoHanderEquipped(true);
}
else if (foundslot == EQEmu::legacy::SlotSecondary
else if (foundslot == EQEmu::inventory::slotSecondary
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
(item2->IsType1HWeapon() || item2->ItemType == EQEmu::item::ItemTypeShield))
{
if (item2->Proc.Effect!=0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = EQEmu::textures::TextureSecondary;
eslot = EQEmu::textures::weaponSecondary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
}
else if (foundslot == EQEmu::legacy::SlotHead) {
eslot = EQEmu::textures::TextureHead;
else if (foundslot == EQEmu::inventory::slotHead) {
eslot = EQEmu::textures::armorHead;
}
else if (foundslot == EQEmu::legacy::SlotChest) {
eslot = EQEmu::textures::TextureChest;
else if (foundslot == EQEmu::inventory::slotChest) {
eslot = EQEmu::textures::armorChest;
}
else if (foundslot == EQEmu::legacy::SlotArms) {
eslot = EQEmu::textures::TextureArms;
else if (foundslot == EQEmu::inventory::slotArms) {
eslot = EQEmu::textures::armorArms;
}
else if (foundslot == EQEmu::legacy::SlotWrist1 || foundslot == EQEmu::legacy::SlotWrist2) {
eslot = EQEmu::textures::TextureWrist;
else if (foundslot == EQEmu::inventory::slotWrist1 || foundslot == EQEmu::inventory::slotWrist2) {
eslot = EQEmu::textures::armorWrist;
}
else if (foundslot == EQEmu::legacy::SlotHands) {
eslot = EQEmu::textures::TextureHands;
else if (foundslot == EQEmu::inventory::slotHands) {
eslot = EQEmu::textures::armorHands;
}
else if (foundslot == EQEmu::legacy::SlotLegs) {
eslot = EQEmu::textures::TextureLegs;
else if (foundslot == EQEmu::inventory::slotLegs) {
eslot = EQEmu::textures::armorLegs;
}
else if (foundslot == EQEmu::legacy::SlotFeet) {
eslot = EQEmu::textures::TextureFeet;
else if (foundslot == EQEmu::inventory::slotFeet) {
eslot = EQEmu::textures::armorFeet;
}
/*

View File

@ -1762,43 +1762,43 @@ luabind::scope lua_register_slot() {
return luabind::class_<Slots>("Slot")
.enum_("constants")
[
luabind::value("Charm", static_cast<int>(EQEmu::legacy::SlotCharm)),
luabind::value("Ear1", static_cast<int>(EQEmu::legacy::SlotEar1)),
luabind::value("Head", static_cast<int>(EQEmu::legacy::SlotHead)),
luabind::value("Face", static_cast<int>(EQEmu::legacy::SlotFace)),
luabind::value("Ear2", static_cast<int>(EQEmu::legacy::SlotEar2)),
luabind::value("Neck", static_cast<int>(EQEmu::legacy::SlotNeck)),
luabind::value("Shoulder", static_cast<int>(EQEmu::legacy::SlotShoulders)), // deprecated
luabind::value("Shoulders", static_cast<int>(EQEmu::legacy::SlotShoulders)),
luabind::value("Arms", static_cast<int>(EQEmu::legacy::SlotArms)),
luabind::value("Back", static_cast<int>(EQEmu::legacy::SlotBack)),
luabind::value("Bracer1", static_cast<int>(EQEmu::legacy::SlotWrist1)), // deprecated
luabind::value("Wrist1", static_cast<int>(EQEmu::legacy::SlotWrist1)),
luabind::value("Bracer2", static_cast<int>(EQEmu::legacy::SlotWrist2)), // deprecated
luabind::value("Wrist2", static_cast<int>(EQEmu::legacy::SlotWrist2)),
luabind::value("Range", static_cast<int>(EQEmu::legacy::SlotRange)),
luabind::value("Hands", static_cast<int>(EQEmu::legacy::SlotHands)),
luabind::value("Primary", static_cast<int>(EQEmu::legacy::SlotPrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::legacy::SlotSecondary)),
luabind::value("Ring1", static_cast<int>(EQEmu::legacy::SlotFinger1)), // deprecated
luabind::value("Finger1", static_cast<int>(EQEmu::legacy::SlotFinger1)),
luabind::value("Ring2", static_cast<int>(EQEmu::legacy::SlotFinger2)), // deprecated
luabind::value("Finger2", static_cast<int>(EQEmu::legacy::SlotFinger2)),
luabind::value("Chest", static_cast<int>(EQEmu::legacy::SlotChest)),
luabind::value("Legs", static_cast<int>(EQEmu::legacy::SlotLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::legacy::SlotFeet)),
luabind::value("Waist", static_cast<int>(EQEmu::legacy::SlotWaist)),
luabind::value("PowerSource", static_cast<int>(EQEmu::legacy::SlotPowerSource)),
luabind::value("Ammo", static_cast<int>(EQEmu::legacy::SlotAmmo)),
luabind::value("General1", static_cast<int>(EQEmu::legacy::SlotGeneral1)),
luabind::value("General2", static_cast<int>(EQEmu::legacy::SlotGeneral2)),
luabind::value("General3", static_cast<int>(EQEmu::legacy::SlotGeneral3)),
luabind::value("General4", static_cast<int>(EQEmu::legacy::SlotGeneral4)),
luabind::value("General5", static_cast<int>(EQEmu::legacy::SlotGeneral5)),
luabind::value("General6", static_cast<int>(EQEmu::legacy::SlotGeneral6)),
luabind::value("General7", static_cast<int>(EQEmu::legacy::SlotGeneral7)),
luabind::value("General8", static_cast<int>(EQEmu::legacy::SlotGeneral8)),
luabind::value("Cursor", static_cast<int>(EQEmu::legacy::SlotCursor)),
luabind::value("Charm", static_cast<int>(EQEmu::inventory::slotCharm)),
luabind::value("Ear1", static_cast<int>(EQEmu::inventory::slotEar1)),
luabind::value("Head", static_cast<int>(EQEmu::inventory::slotHead)),
luabind::value("Face", static_cast<int>(EQEmu::inventory::slotFace)),
luabind::value("Ear2", static_cast<int>(EQEmu::inventory::slotEar2)),
luabind::value("Neck", static_cast<int>(EQEmu::inventory::slotNeck)),
luabind::value("Shoulder", static_cast<int>(EQEmu::inventory::slotShoulders)), // deprecated
luabind::value("Shoulders", static_cast<int>(EQEmu::inventory::slotShoulders)),
luabind::value("Arms", static_cast<int>(EQEmu::inventory::slotArms)),
luabind::value("Back", static_cast<int>(EQEmu::inventory::slotBack)),
luabind::value("Bracer1", static_cast<int>(EQEmu::inventory::slotWrist1)), // deprecated
luabind::value("Wrist1", static_cast<int>(EQEmu::inventory::slotWrist1)),
luabind::value("Bracer2", static_cast<int>(EQEmu::inventory::slotWrist2)), // deprecated
luabind::value("Wrist2", static_cast<int>(EQEmu::inventory::slotWrist2)),
luabind::value("Range", static_cast<int>(EQEmu::inventory::slotRange)),
luabind::value("Hands", static_cast<int>(EQEmu::inventory::slotHands)),
luabind::value("Primary", static_cast<int>(EQEmu::inventory::slotPrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::inventory::slotSecondary)),
luabind::value("Ring1", static_cast<int>(EQEmu::inventory::slotFinger1)), // deprecated
luabind::value("Finger1", static_cast<int>(EQEmu::inventory::slotFinger1)),
luabind::value("Ring2", static_cast<int>(EQEmu::inventory::slotFinger2)), // deprecated
luabind::value("Finger2", static_cast<int>(EQEmu::inventory::slotFinger2)),
luabind::value("Chest", static_cast<int>(EQEmu::inventory::slotChest)),
luabind::value("Legs", static_cast<int>(EQEmu::inventory::slotLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::inventory::slotFeet)),
luabind::value("Waist", static_cast<int>(EQEmu::inventory::slotWaist)),
luabind::value("PowerSource", static_cast<int>(EQEmu::inventory::slotPowerSource)),
luabind::value("Ammo", static_cast<int>(EQEmu::inventory::slotAmmo)),
luabind::value("General1", static_cast<int>(EQEmu::inventory::slotGeneral1)),
luabind::value("General2", static_cast<int>(EQEmu::inventory::slotGeneral2)),
luabind::value("General3", static_cast<int>(EQEmu::inventory::slotGeneral3)),
luabind::value("General4", static_cast<int>(EQEmu::inventory::slotGeneral4)),
luabind::value("General5", static_cast<int>(EQEmu::inventory::slotGeneral5)),
luabind::value("General6", static_cast<int>(EQEmu::inventory::slotGeneral6)),
luabind::value("General7", static_cast<int>(EQEmu::inventory::slotGeneral7)),
luabind::value("General8", static_cast<int>(EQEmu::inventory::slotGeneral8)),
luabind::value("Cursor", static_cast<int>(EQEmu::inventory::slotCursor)),
luabind::value("PersonalBegin", static_cast<int>(EQEmu::legacy::GENERAL_BEGIN)), // deprecated
luabind::value("GeneralBegin", static_cast<int>(EQEmu::legacy::GENERAL_BEGIN)),
luabind::value("PersonalEnd", static_cast<int>(EQEmu::legacy::GENERAL_END)), // deprecated
@ -1814,19 +1814,19 @@ luabind::scope lua_register_material() {
return luabind::class_<Materials>("Material")
.enum_("constants")
[
luabind::value("Head", static_cast<int>(EQEmu::textures::TextureHead)),
luabind::value("Chest", static_cast<int>(EQEmu::textures::TextureChest)),
luabind::value("Arms", static_cast<int>(EQEmu::textures::TextureArms)),
luabind::value("Bracer", static_cast<int>(EQEmu::textures::TextureWrist)), // deprecated
luabind::value("Wrist", static_cast<int>(EQEmu::textures::TextureWrist)),
luabind::value("Hands", static_cast<int>(EQEmu::textures::TextureHands)),
luabind::value("Legs", static_cast<int>(EQEmu::textures::TextureLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::textures::TextureFeet)),
luabind::value("Primary", static_cast<int>(EQEmu::textures::TexturePrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::textures::TextureSecondary)),
luabind::value("Max", static_cast<int>(EQEmu::textures::TextureCount)), // deprecated
luabind::value("Count", static_cast<int>(EQEmu::textures::TextureCount)),
luabind::value("Invalid", static_cast<int>(EQEmu::textures::TextureInvalid))
luabind::value("Head", static_cast<int>(EQEmu::textures::armorHead)),
luabind::value("Chest", static_cast<int>(EQEmu::textures::armorChest)),
luabind::value("Arms", static_cast<int>(EQEmu::textures::armorArms)),
luabind::value("Bracer", static_cast<int>(EQEmu::textures::armorWrist)), // deprecated
luabind::value("Wrist", static_cast<int>(EQEmu::textures::armorWrist)),
luabind::value("Hands", static_cast<int>(EQEmu::textures::armorHands)),
luabind::value("Legs", static_cast<int>(EQEmu::textures::armorLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::textures::armorFeet)),
luabind::value("Primary", static_cast<int>(EQEmu::textures::weaponPrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::textures::weaponSecondary)),
luabind::value("Max", static_cast<int>(EQEmu::textures::materialCount)), // deprecated
luabind::value("Count", static_cast<int>(EQEmu::textures::materialCount)),
luabind::value("Invalid", static_cast<int>(EQEmu::textures::materialInvalid))
];
}

View File

@ -214,7 +214,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
unsigned int i;
//should not include 21 (SLOT_AMMO)
for (i = 0; i < EQEmu::legacy::SlotAmmo; i++) {
for (i = 0; i < EQEmu::inventory::slotAmmo; i++) {
if(equipment[i] == 0)
continue;
const EQEmu::ItemData * itm = database.GetItem(equipment[i]);
@ -1559,24 +1559,24 @@ void Merc::AI_Process() {
//try main hand first
if(attack_timer.Check())
{
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
Attack(GetTarget(), EQEmu::inventory::slotPrimary);
bool tripleSuccess = false;
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
{
if(GetOwner()) {
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
}
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
tripleSuccess = true;
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
}
//quad attack, does this belong here??
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
}
}
@ -1588,8 +1588,8 @@ void Merc::AI_Process() {
if(zone->random.Roll(flurrychance))
{
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
}
}
@ -1598,7 +1598,7 @@ void Merc::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) {
if(zone->random.Roll(ExtraAttackChanceBonus))
{
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
}
}
}
@ -1634,11 +1634,11 @@ void Merc::AI_Process() {
// Max 78% of DW
if (zone->random.Roll(DualWieldProbability))
{
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
if(CanThisClassDoubleAttack()) {
if(GetTarget() && GetTarget()->GetHP() > -10)
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
}
}
}
@ -5045,13 +5045,13 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
void Merc::UpdateMercAppearance() {
// Copied from Bot Code:
uint32 itemID = NO_ITEM;
uint8 materialFromSlot = EQEmu::textures::TextureInvalid;
uint32 itemID = 0;
uint8 materialFromSlot = EQEmu::textures::materialInvalid;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != NO_ITEM) {
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
if (materialFromSlot != EQEmu::textures::TextureInvalid)
if (materialFromSlot != EQEmu::textures::materialInvalid)
this->SendWearChange(materialFromSlot);
}
}
@ -5065,8 +5065,8 @@ void Merc::UpdateEquipmentLight()
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::legacy::SlotAmmo) { continue; }
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::inventory::slotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }

View File

@ -66,7 +66,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return (GetGroup() ? true : false); }

View File

@ -278,7 +278,7 @@ Mob::Mob(const char* in_name,
RangedProcs[j].level_override = -1;
}
for (i = 0; i < EQEmu::textures::TextureCount; i++)
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++)
{
armor_tint.Slot[i].Color = in_armor_tint.Slot[i].Color;
}
@ -1158,8 +1158,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
if (Mob::IsPlayerRace(race) || i > 6)
{
ns->spawn.equipment.Slot[i].Material = GetEquipmentMaterial(i);
ns->spawn.equipment.Slot[i].EliteMaterial = IsEliteMaterialItem(i);
ns->spawn.equipment.Slot[i].HeroForgeModel = GetHerosForgeModel(i);
ns->spawn.equipment.Slot[i].EliteModel = IsEliteMaterialItem(i);
ns->spawn.equipment.Slot[i].HeroicModel = GetHerosForgeModel(i);
ns->spawn.equipment_tint.Slot[i].Color = GetEquipmentColor(i);
}
}
@ -2374,8 +2374,8 @@ bool Mob::CanThisClassDualWield(void) const {
return(GetSkill(EQEmu::skills::SkillDualWield) > 0);
}
else if (CastToClient()->HasSkill(EQEmu::skills::SkillDualWield)) {
const EQEmu::ItemInstance* pinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
const EQEmu::ItemInstance* pinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
// 2HS, 2HB, or 2HP
if(pinst && pinst->IsWeapon()) {
@ -2858,7 +2858,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
if (item != 0)
{
// For primary and secondary we need the model, not the material
if (material_slot == EQEmu::textures::TexturePrimary || material_slot == EQEmu::textures::TextureSecondary)
if (material_slot == EQEmu::textures::weaponPrimary || material_slot == EQEmu::textures::weaponSecondary)
{
if (this->IsClient())
{
@ -2902,7 +2902,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
int32 Mob::GetHerosForgeModel(uint8 material_slot) const
{
uint32 HeroModel = 0;
if (material_slot >= 0 && material_slot < EQEmu::textures::TexturePrimary)
if (material_slot >= 0 && material_slot < EQEmu::textures::weaponPrimary)
{
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const EQEmu::ItemData *item;

View File

@ -154,7 +154,7 @@ public:
virtual void ThrowingAttack(Mob* other) { }
uint16 GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg);
// 13 = Primary (default), 14 = secondary
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) = 0;
int MonkSpecialAttack(Mob* other, uint8 skill_used);
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
@ -390,7 +390,7 @@ public:
inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; }
inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; }
inline uint8 GetDrakkinDetails() const { return drakkin_details; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint.Slot[(i < EQEmu::textures::TextureCount) ? i : 0].Color; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint.Slot[(i < EQEmu::textures::materialCount) ? i : 0].Color; }
inline uint8 GetClass() const { return class_; }
inline uint8 GetLevel() const { return level; }
inline uint8 GetOrigLevel() const { return orig_level; }
@ -577,7 +577,7 @@ public:
bool lookForAftArc = true);
//Procs
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary, bool FromSkillProc = false, int damage = 0);
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::inventory::slotPrimary, bool FromSkillProc = false, int damage = 0);
bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN);
bool RemoveRangedProc(uint16 spell_id, bool bAll = false);
bool HasRangedProcs() const;
@ -1158,13 +1158,13 @@ protected:
void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = SlotCharm?
bool PassLimitToSkill(uint16 spell_id, uint16 skill);
bool PassLimitClass(uint32 Classes_, uint16 Class_);
void TryDefensiveProc(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TrySpellProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const EQEmu::ItemInstance* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryDefensiveProc(Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
void TryWeaponProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
void TrySpellProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
void TryWeaponProc(const EQEmu::ItemInstance* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
void ExecWeaponProc(const EQEmu::ItemInstance* weapon, uint16 spell_id, Mob *on, int level_override = -1);
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::legacy::SlotPrimary);
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::legacy::SlotPrimary, Mob *on = nullptr);
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::inventory::slotPrimary);
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::inventory::slotPrimary, Mob *on = nullptr);
virtual float GetSpecialProcChances(uint16 hand);
virtual float GetAssassinateProcChances(uint16 ReuseTime);
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?

View File

@ -847,7 +847,7 @@ void Client::AI_Process()
if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) {
if (attack_timer.Check()) {
// Should charmed clients not be procing?
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotPrimary);
DoAttackRounds(GetTarget(), EQEmu::inventory::slotPrimary);
}
}
@ -855,7 +855,7 @@ void Client::AI_Process()
if (attack_dw_timer.Check()) {
if (CheckDualWield()) {
// Should charmed clients not be procing?
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotSecondary);
DoAttackRounds(GetTarget(), EQEmu::inventory::slotSecondary);
}
}
}
@ -1106,7 +1106,7 @@ void Mob::AI_Process() {
//try main hand first
if(attack_timer.Check()) {
DoMainHandAttackRounds(target);
TriggerDefensiveProcs(target, EQEmu::legacy::SlotPrimary, false);
TriggerDefensiveProcs(target, EQEmu::inventory::slotPrimary, false);
bool specialed = false; // NPCs can only do one of these a round
if (GetSpecialAbility(SPECATK_FLURRY)) {
@ -1952,7 +1952,7 @@ bool Mob::Flurry(ExtraAttackOptions *opts)
int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1);
num_attacks = num_attacks > 0 ? num_attacks : RuleI(Combat, MaxFlurryHits);
for (int i = 0; i < num_attacks; i++)
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts);
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
}
return true;
}

View File

@ -490,7 +490,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
{
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
if (material != EQEmu::textures::TextureInvalid)
if (material != EQEmu::textures::materialInvalid)
SendWearChange(material);
cur = itemlist.erase(cur);
@ -750,8 +750,8 @@ void NPC::UpdateEquipmentLight()
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::legacy::SlotAmmo) { continue; }
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::inventory::slotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
@ -1378,7 +1378,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver
int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
{
if (material_slot >= EQEmu::textures::TextureCount)
if (material_slot >= EQEmu::textures::materialCount)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
@ -1389,23 +1389,23 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
{
switch(material_slot)
{
case EQEmu::textures::TextureHead:
case EQEmu::textures::armorHead:
return helmtexture;
case EQEmu::textures::TextureChest:
case EQEmu::textures::armorChest:
return texture;
case EQEmu::textures::TextureArms:
case EQEmu::textures::armorArms:
return armtexture;
case EQEmu::textures::TextureWrist:
case EQEmu::textures::armorWrist:
return bracertexture;
case EQEmu::textures::TextureHands:
case EQEmu::textures::armorHands:
return handtexture;
case EQEmu::textures::TextureLegs:
case EQEmu::textures::armorLegs:
return legtexture;
case EQEmu::textures::TextureFeet:
case EQEmu::textures::armorFeet:
return feettexture;
case EQEmu::textures::TexturePrimary:
case EQEmu::textures::weaponPrimary:
return d_melee_texture1;
case EQEmu::textures::TextureSecondary:
case EQEmu::textures::weaponSecondary:
return d_melee_texture2;
default:
//they have nothing in the slot, and its not a special slot... they get nothing.

View File

@ -110,7 +110,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }

View File

@ -365,7 +365,7 @@ void Object::Close() {
EQEmu::ItemInstance* container = this->m_inst;
if(container != nullptr)
{
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++)
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++)
{
EQEmu::ItemInstance* inst = container->PopItem(i);
if(inst != nullptr)
@ -521,11 +521,11 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
// Transfer item to client
sender->PutItemInInventory(EQEmu::legacy::SlotCursor, *m_inst, false);
sender->SendItemPacket(EQEmu::legacy::SlotCursor, m_inst, ItemPacketTrade);
sender->PutItemInInventory(EQEmu::inventory::slotCursor, *m_inst, false);
sender->SendItemPacket(EQEmu::inventory::slotCursor, m_inst, ItemPacketTrade);
if(cursordelete) // delete the item if it's a duplicate lore. We have to do this because the client expects the item packet
sender->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
sender->DeleteItemInInventory(EQEmu::inventory::slotCursor);
if(!m_ground_spawn)
safe_delete(m_inst);
@ -602,7 +602,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
auto outapp = new EQApplicationPacket(OP_ClientReady, 0);
sender->QueuePacket(outapp);
safe_delete(outapp);
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
const EQEmu::ItemInstance* inst = m_inst->GetItem(i);
if (inst) {
//sender->GetInv().PutItem(i+4000,inst);

View File

@ -68,15 +68,15 @@ void Mob::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3
case EQEmu::skills::SkillFlyingKick:
case EQEmu::skills::SkillRoundKick:
case EQEmu::skills::SkillKick:
item_slot = EQEmu::legacy::SlotFeet;
item_slot = EQEmu::inventory::slotFeet;
break;
case EQEmu::skills::SkillBash:
item_slot = EQEmu::legacy::SlotSecondary;
item_slot = EQEmu::inventory::slotSecondary;
break;
case EQEmu::skills::SkillDragonPunch:
case EQEmu::skills::SkillEagleStrike:
case EQEmu::skills::SkillTigerClaw:
item_slot = EQEmu::legacy::SlotHands;
item_slot = EQEmu::inventory::slotHands;
break;
default:
break;
@ -111,7 +111,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
if (skill == EQEmu::skills::SkillBash){
if(IsClient()){
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
if(item)
{
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield)
@ -129,14 +129,14 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
min_damage += min_damage * GetMeleeMinDamageMod_SE(skill) / 100;
int hand = EQEmu::legacy::SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
int hand = EQEmu::inventory::slotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
hand = EQEmu::legacy::SlotRange;
hand = EQEmu::inventory::slotRange;
if (who->AvoidDamage(this, max_damage, hand)) {
if (max_damage == -3)
DoRiposte(who);
} else {
if (!CheckHitChance || (CheckHitChance && who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary))) {
if (!CheckHitChance || (CheckHitChance && who->CheckHitChance(this, skill, EQEmu::inventory::slotPrimary))) {
who->MeleeMitigation(this, max_damage, min_damage);
CommonOutgoingHitSuccess(who, max_damage, skill);
} else {
@ -194,7 +194,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
//These two are not subject to the combat ability timer, as they
//allready do their checking in conjunction with the attack timer
//throwing weapons
if (ca_atk->m_atk == EQEmu::legacy::SlotRange) {
if (ca_atk->m_atk == EQEmu::inventory::slotRange) {
if (ca_atk->m_skill == EQEmu::skills::SkillThrowing) {
SetAttackTimer();
ThrowingAttack(GetTarget());
@ -244,8 +244,8 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
DoAnim(animTailRake);
int32 ht = 0;
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 &&
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 &&
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0){
dmg = -5;
}
else{
@ -321,7 +321,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
DoAnim(animKick);
int32 ht = 0;
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0){
dmg = -5;
}
else{
@ -404,7 +404,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
int32 min_dmg = 1;
int reuse = 0;
EQEmu::skills::SkillType skill_type; //to avoid casting... even though it "would work"
uint8 itemslot = EQEmu::legacy::SlotFeet;
uint8 itemslot = EQEmu::inventory::slotFeet;
switch(unchecked_type) {
case EQEmu::skills::SkillFlyingKick:
@ -418,7 +418,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case EQEmu::skills::SkillDragonPunch:
skill_type = EQEmu::skills::SkillDragonPunch;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, DragonPunchBonus) / 100) + 26;
itemslot = EQEmu::legacy::SlotHands;
itemslot = EQEmu::inventory::slotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animTailRake);
reuse = TailRakeReuseTime;
@ -426,7 +426,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case EQEmu::skills::SkillEagleStrike:
skill_type = EQEmu::skills::SkillEagleStrike;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, EagleStrikeBonus) / 100) + 19;
itemslot = EQEmu::legacy::SlotHands;
itemslot = EQEmu::inventory::slotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animEagleStrike);
reuse = EagleStrikeReuseTime;
@ -434,7 +434,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case EQEmu::skills::SkillTigerClaw:
skill_type = EQEmu::skills::SkillTigerClaw;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, TigerClawBonus) / 100) + 12;
itemslot = EQEmu::legacy::SlotHands;
itemslot = EQEmu::inventory::slotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animTigerClaw);
reuse = TigerClawReuseTime;
@ -498,7 +498,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
//make sure we have a proper weapon if we are a client.
if(IsClient()) {
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON);
return;
@ -559,7 +559,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillBackstab, other, 10);
}
else { //We do a single regular attack if we attack from the front without chaotic stab
Attack(other, EQEmu::legacy::SlotPrimary);
Attack(other, EQEmu::inventory::slotPrimary);
}
}
@ -577,7 +577,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
int32 backstab_dmg = 0;
if (IsClient()) {
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
if (wpn) {
primaryweapondamage = GetWeaponDamage(other, wpn);
if (primaryweapondamage) {
@ -650,7 +650,7 @@ void Mob::RogueAssassinate(Mob* other)
{
//can you dodge, parry, etc.. an assassinate??
//if so, use DoSpecialAttackDamage(other, BACKSTAB, 32000); instead
if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary) : (const EQEmu::ItemInstance*)nullptr) > 0){
if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary) : (const EQEmu::ItemInstance*)nullptr) > 0){
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
}else{
other->Damage(this, -5, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
@ -670,20 +670,20 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
//Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
return;
}
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
//locate ammo
int ammo_slot = EQEmu::legacy::SlotAmmo;
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::legacy::SlotAmmo];
int ammo_slot = EQEmu::inventory::slotAmmo;
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::inventory::slotAmmo];
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::legacy::SlotRange));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotRange), EQEmu::inventory::slotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::inventory::slotRange));
return;
}
if (!Ammo || !Ammo->IsClassCommon()) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotAmmo), EQEmu::legacy::SlotAmmo);
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::legacy::SlotAmmo));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotAmmo), EQEmu::inventory::slotAmmo);
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::inventory::slotAmmo));
return;
}
@ -838,7 +838,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
if (IsClient()){
_RangeWeapon = CastToClient()->m_inv[EQEmu::legacy::SlotRange];
_RangeWeapon = CastToClient()->m_inv[EQEmu::inventory::slotRange];
if (_RangeWeapon && _RangeWeapon->GetItem() && _RangeWeapon->GetItem()->ID == range_id)
RangeWeapon = _RangeWeapon;
@ -854,7 +854,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillArchery);
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillArchery, EQEmu::legacy::SlotPrimary, chance_mod))) {
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillArchery, EQEmu::inventory::slotPrimary, chance_mod))) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
@ -952,7 +952,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
}
if (!HeadShot)
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
other->MeleeMitigation(this, TotalDmg, minDmg);
if(TotalDmg > 0){
@ -976,7 +976,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
if (ReuseTime)
TrySkillProc(other, EQEmu::skills::SkillArchery, ReuseTime);
else
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, true, EQEmu::legacy::SlotRange);
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, true, EQEmu::inventory::slotRange);
}
}
@ -985,20 +985,20 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
//Weapon Proc
if(RangeWeapon && other && !other->HasDied())
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
//Ammo Proc
if (ammo_lost)
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
else if(Ammo && other && !other->HasDied())
TryWeaponProc(Ammo, other, EQEmu::legacy::SlotRange);
TryWeaponProc(Ammo, other, EQEmu::inventory::slotRange);
//Skill Proc
if (HasSkillProcs() && other && !other->HasDied()){
if (ReuseTime)
TrySkillProc(other, EQEmu::skills::SkillArchery, ReuseTime);
else
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, false, EQEmu::legacy::SlotRange);
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, false, EQEmu::inventory::slotRange);
}
}
@ -1264,7 +1264,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
if (!chance_mod)
chance_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2);
if (!other->CheckHitChance(this, skillInUse, EQEmu::legacy::SlotRange, chance_mod))
if (!other->CheckHitChance(this, skillInUse, EQEmu::inventory::slotRange, chance_mod))
{
other->Damage(this, 0, SPELL_UNKNOWN, skillInUse);
}
@ -1285,7 +1285,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
TotalDmg += TotalDmg * damage_mod / 100;
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
other->MeleeMitigation(this, TotalDmg, MinDmg);
if (TotalDmg > 0)
@ -1301,15 +1301,15 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse);
if (TotalDmg > 0 && HasSkillProcSuccess() && !other->HasDied())
TrySkillProc(other, skillInUse, 0, true, EQEmu::legacy::SlotRange);
TrySkillProc(other, skillInUse, 0, true, EQEmu::inventory::slotRange);
}
//try proc on hits and misses
if(other && !other->HasDied())
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::legacy::SlotRange);
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::inventory::slotRange);
if (HasSkillProcs() && other && !other->HasDied())
TrySkillProc(other, skillInUse, 0, false, EQEmu::legacy::SlotRange);
TrySkillProc(other, skillInUse, 0, false, EQEmu::inventory::slotRange);
}
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) {
@ -1351,19 +1351,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
return;
}
int ammo_slot = EQEmu::legacy::SlotRange;
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
int ammo_slot = EQEmu::inventory::slotRange;
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotRange), EQEmu::inventory::slotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::inventory::slotRange));
return;
}
const EQEmu::ItemData* item = RangeWeapon->GetItem();
if (item->ItemType != EQEmu::item::ItemTypeLargeThrowing && item->ItemType != EQEmu::item::ItemTypeSmallThrowing) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::inventory::slotRange));
return;
}
@ -1371,11 +1371,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
if(RangeWeapon->GetCharges() == 1) {
//first check ammo
const EQEmu::ItemInstance* AmmoItem = m_inv[EQEmu::legacy::SlotAmmo];
const EQEmu::ItemInstance* AmmoItem = m_inv[EQEmu::inventory::slotAmmo];
if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) {
//more in the ammo slot, use it
RangeWeapon = AmmoItem;
ammo_slot = EQEmu::legacy::SlotAmmo;
ammo_slot = EQEmu::inventory::slotAmmo;
Log.Out(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges());
} else {
//look through our inventory for more
@ -1472,7 +1472,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillThrowing);
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillThrowing, EQEmu::legacy::SlotPrimary, chance_mod))){
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillThrowing, EQEmu::inventory::slotPrimary, chance_mod))){
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
TryProjectileAttack(other, AmmoItem, EQEmu::skills::SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
@ -1519,7 +1519,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
Log.Out(Logs::Detail, Logs::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg);
if (!Assassinate_Dmg)
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
other->MeleeMitigation(this, TotalDmg, minDmg);
if(TotalDmg > 0)
@ -1538,7 +1538,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
if (ReuseTime)
TrySkillProc(other, EQEmu::skills::SkillThrowing, ReuseTime);
else
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, true, EQEmu::legacy::SlotRange);
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, true, EQEmu::inventory::slotRange);
}
}
@ -1547,15 +1547,15 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
//Throwing item Proc
if (ammo_lost)
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
else if(RangeWeapon && other && !other->HasDied())
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
if (HasSkillProcs() && other && !other->HasDied()){
if (ReuseTime)
TrySkillProc(other, EQEmu::skills::SkillThrowing, ReuseTime);
else
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::legacy::SlotRange);
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::inventory::slotRange);
}
}
@ -1955,7 +1955,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
if (ca_target!=this) {
DoAnim(animTailRake);
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0){
dmg = -5;
}
else{
@ -2019,7 +2019,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
if(ca_target!=this){
DoAnim(animKick);
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0){
dmg = -5;
}
else{
@ -2231,7 +2231,7 @@ uint32 Mob::TryHeadShot(Mob* defender, EQEmu::skills::SkillType skillInUse) {
HeadShot_Level = itembonuses.HSLevel;
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
float ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
float ProcChance = GetSpecialProcChances(EQEmu::inventory::slotRange);
if(zone->random.Roll(ProcChance))
return HeadShot_Dmg;
}
@ -2294,7 +2294,7 @@ uint32 Mob::TryAssassinate(Mob* defender, EQEmu::skills::SkillType skillInUse, u
float ProcChance = 0.0f;
if (skillInUse == EQEmu::skills::SkillThrowing)
ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
ProcChance = GetSpecialProcChances(EQEmu::inventory::slotRange);
else
ProcChance = GetAssassinateProcChances(ReuseTime);
@ -2345,7 +2345,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
int damage = 0;
uint32 hate = 0;
int Hand = EQEmu::legacy::SlotPrimary;
int Hand = EQEmu::inventory::slotPrimary;
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
if(weapon_damage > 0){
@ -2369,7 +2369,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
if (skillinuse == EQEmu::skills::SkillBash){
if(IsClient()){
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
if(item){
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
hate += item->GetItem()->AC;
@ -2391,7 +2391,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
else
damage = zone->random.Int(min_hit, max_hit);
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::inventory::slotRange : EQEmu::inventory::slotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
if (damage == -3) {
DoRiposte(other);
if (HasDied())

View File

@ -622,7 +622,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Flesh To Bone");
#endif
if(IsClient()){
EQEmu::ItemInstance* transI = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotCursor);
EQEmu::ItemInstance* transI = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotCursor);
if (transI && transI->IsClassCommon() && transI->IsStackable()){
uint32 fcharges = transI->GetCharges();
//Does it sound like meat... maybe should check if it looks like meat too...
@ -632,7 +632,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
strstr(transI->GetItem()->Name, "Flesh") ||
strstr(transI->GetItem()->Name, "parts") ||
strstr(transI->GetItem()->Name, "Parts")){
CastToClient()->DeleteItemInInventory(EQEmu::legacy::SlotCursor, fcharges, true);
CastToClient()->DeleteItemInInventory(EQEmu::inventory::slotCursor, fcharges, true);
CastToClient()->SummonItem(13073, fcharges);
}
else{
@ -1173,7 +1173,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (SummonedItem) {
c->PushItemOnCursor(*SummonedItem);
c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketLimbo);
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
safe_delete(SummonedItem);
}
SummonedItem = database.CreateItem(spell.base[i], charges);
@ -1445,7 +1445,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
}
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
SendWearChange(x);
if (caster == this && spell.id != 287 && spell.id != 601 &&
@ -1471,7 +1471,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
);
caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize()));
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
caster->SendWearChange(x);
}
}
@ -2239,7 +2239,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Rampage");
#endif
if(caster)
entity_list.AEAttack(caster, 30, EQEmu::legacy::SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
entity_list.AEAttack(caster, 30, EQEmu::inventory::slotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
break;
}
@ -3037,7 +3037,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (SummonedItem) {
Client *c=CastToClient();
c->PushItemOnCursor(*SummonedItem);
c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketLimbo);
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
safe_delete(SummonedItem);
}
@ -3855,7 +3855,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
else{
SendAppearancePacket(AT_Size, 6);
}
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++){
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++){
SendWearChange(x);
}
break;
@ -5194,7 +5194,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
}
}
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y)
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
{
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
continue;
@ -5343,7 +5343,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
}
}
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y)
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
{
EQEmu::ItemInstance *aug = nullptr;
aug = ins->GetAugment(y);

View File

@ -293,7 +293,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
return(false);
}
}
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::inventory::slotAmmo || item_slot == EQEmu::inventory::slotPowerSource)){
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are attempting to cast a must equip clicky without having it equipped
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
@ -1244,7 +1244,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
if (inst == nullptr)
break;
for (int r = AUG_INDEX_BEGIN; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
if (!aug_i)

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.
uint8 itemsFound = 0;
for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
{
const EQEmu::ItemInstance* inst = container->GetItem(i);
if (inst)
@ -222,7 +222,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else
{
// Delete items in our inventory container...
for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
{
const EQEmu::ItemInstance* inst = container->GetItem(i);
if (inst)
@ -297,7 +297,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const EQEmu::ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::inventory::slotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
if (RuleB(Inventory, DeleteTransformationMold))
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
@ -317,7 +317,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const EQEmu::ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, 0, 0);
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::inventory::slotCursor, 0, 0);
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
}
else if (inst) {
@ -401,7 +401,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
safe_delete(outapp);
database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID());
} else{
for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) {
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) {
const EQEmu::ItemInstance* inst = container->GetItem(i);
if (inst) {
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true);
@ -1237,7 +1237,7 @@ bool ZoneDatabase::GetTradeRecipe(const EQEmu::ItemInstance* container, uint8 c_
for (auto row = results.begin(); row != results.end(); ++row) {
int ccnt = 0;
for (int x = SLOT_BEGIN; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) {
for (int x = EQEmu::inventory::slotBegin; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) {
const EQEmu::ItemInstance* inst = container->GetItem(x);
if(!inst)
continue;

View File

@ -98,7 +98,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
// Item always goes into trade bucket from cursor
Client* client = owner->CastToClient();
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::legacy::SlotCursor);
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::inventory::slotCursor);
if (!inst) {
client->Message(13, "Error: Could not find item on your cursor!");
@ -131,7 +131,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
if (_stack_size > 0)
inst->SetCharges(_stack_size);
else
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
client->DeleteItemInInventory(EQEmu::inventory::slotCursor);
SendItemData(inst2, trade_slot_id);
}
@ -146,7 +146,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
Log.Out(Logs::Detail, Logs::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id);
client->PutItemInInventory(trade_slot_id, *inst);
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
client->DeleteItemInInventory(EQEmu::inventory::slotCursor);
}
}
@ -173,7 +173,7 @@ void Trade::SendItemData(const EQEmu::ItemInstance* inst, int16 dest_slot_id)
if (with && with->IsClient()) {
with->SendItemPacket(dest_slot_id - EQEmu::legacy::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
for (uint16 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
const EQEmu::ItemInstance* bagitem = trader->GetInv().GetItem(bagslot_id);
if (bagitem) {
@ -267,7 +267,7 @@ void Trade::LogTrade()
strcat(logtext, item_num);
if (inst->IsClassBag()) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
strcat(logtext, ",");
@ -312,7 +312,7 @@ void Trade::DumpTrade()
i, ((inst->IsClassBag()) ? "True" : "False"));
if (inst->IsClassBag()) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
@ -359,7 +359,7 @@ void Client::ResetTrade() {
// there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks
int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst);
if ((free_slot == EQEmu::legacy::SlotCursor) || (free_slot == INVALID_INDEX))
if ((free_slot == EQEmu::inventory::slotCursor) || (free_slot == INVALID_INDEX))
break;
EQEmu::ItemInstance* partial_inst = GetInv().GetItem(free_slot);
@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
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_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
const EQEmu::ItemInstance* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) {
@ -579,7 +579,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks
int16 partial_slot = other->GetInv().FindFreeSlotForTradeItem(inst);
if ((partial_slot == EQEmu::legacy::SlotCursor) || (partial_slot == INVALID_INDEX))
if ((partial_slot == EQEmu::inventory::slotCursor) || (partial_slot == INVALID_INDEX))
break;
EQEmu::ItemInstance* partial_inst = other->GetInv().GetItem(partial_slot);
@ -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...
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
const EQEmu::ItemInstance* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) {
@ -841,7 +841,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_audit->char_count += detail->charges;
if (trade_inst->IsClassBag()) {
for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
for (uint8 sub_slot = EQEmu::inventory::containerBegin; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
const EQEmu::ItemInstance* trade_baginst = trade_inst->GetItem(sub_slot);
if(trade_baginst) {
@ -891,7 +891,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
// pets need to look inside bags and try to equip items found there
if (item->IsClassBag() && item->BagSlots > 0) {
for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
for (int16 bslot = EQEmu::inventory::containerBegin; bslot < item->BagSlots; bslot++) {
const EQEmu::ItemInstance* baginst = inst->GetItem(bslot);
if (baginst) {
const EQEmu::ItemData* bagitem = baginst->GetItem();
@ -1235,7 +1235,7 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@ -1258,7 +1258,7 @@ EQEmu::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@ -1289,7 +1289,7 @@ GetItems_Struct* Client::GetTraderItems(){
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@ -1313,7 +1313,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++){
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++){
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);

View File

@ -582,13 +582,13 @@ int32 Client::Tune_GetMeleeMitDmg(Mob* GM, Mob *attacker, int32 damage, int32 mi
int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
{
int Hand = EQEmu::legacy::SlotPrimary;
int Hand = EQEmu::inventory::slotPrimary;
if (!other)
return 0;
EQEmu::ItemInstance* weapon;
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
if(weapon != nullptr) {
if (!weapon->IsWeapon()) {
@ -628,7 +628,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
int ucDamageBonus = 0;
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
{
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
@ -662,24 +662,24 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
if (attacker->IsClient())
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
EQEmu::ItemInstance* weapon;
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
if(weapon && weapon->IsWeapon()){
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotPrimary, weapon);
}
else {
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotSecondary, weapon);
else {
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotRange, weapon);
}
}
}
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, 0, avoid_override);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, 0, avoid_override);
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
@ -691,7 +691,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
for (int j=0; j < max_loop; j++)
{
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, false, 0, avoid_override, add_acc);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, false, 0, avoid_override, add_acc);
if (Msg >= 3)
Message(15, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance);
@ -706,7 +706,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
if (end){
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
Message(0, " ");
@ -742,24 +742,24 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
if (attacker->IsClient())
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
EQEmu::ItemInstance* weapon;
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
if(weapon && weapon->IsWeapon()){
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotPrimary, weapon);
}
else {
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotSecondary, weapon);
else {
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotRange, weapon);
}
}
}
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0);
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
Message(0, "#Tune - Processing... Find Avoidance for hit chance on defender of (%.0f) pct from attacker. [Current Hit Chance %.2f]", hit_chance, tmp_hit_chance);
@ -769,7 +769,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
for (int j=0; j < max_loop; j++)
{
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
if (Msg >= 3)
Message(0, "#Tune - Processing... [%i] [AVOIDANCE %i] Hit Chance %.2f ",j,add_avoid,tmp_hit_chance);
@ -784,7 +784,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
if (end){
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
Message(0, " ");

View File

@ -487,7 +487,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
uint8 index = (uint8)atoi(row[0]);
uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::inventory::SocketCount];
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
@ -497,7 +497,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
EQEmu::ItemInstance* inst = database.CreateItem(item_id, charges);
if (inst && inst->GetItem()->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
if (aug[i])
inst->PutAugment(&database, i, aug[i]);
// Put item inside world container
@ -520,17 +520,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const EQ
DeleteWorldContainer(parent_id,zone_id);
// Save all 10 items, if they exist
for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; index++) {
for (uint8 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; index++) {
EQEmu::ItemInstance* inst = container->GetItem(index);
if (!inst)
continue;
uint32 item_id = inst->GetItem()->ID;
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
if (inst->IsType(EQEmu::item::ItemClassCommon)) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
EQEmu::ItemInstance *auginst=inst->GetAugment(i);
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
@ -2092,7 +2092,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
else {
auto armorTint_row = armortint_results.begin();
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
for (int index = EQEmu::textures::textureBegin; index <= EQEmu::textures::LastTexture; index++) {
temp_npctype_data->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);
@ -2102,7 +2102,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
}
// Try loading npc_types tint fields if armor tint is 0 or query failed to get results
if (armor_tint_id == 0) {
for (int index = EQEmu::textures::TextureChest; index < EQEmu::textures::TextureCount; index++) {
for (int index = EQEmu::textures::armorChest; index < EQEmu::textures::materialCount; index++) {
temp_npctype_data->armor_tint.Slot[index].Color = temp_npctype_data->armor_tint.Slot[0].Color; // odd way to 'zero-out' the array...
}
}
@ -2307,7 +2307,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
tmpNPCType->armor_tint.Slot[0].Color |= (tmpNPCType->armor_tint.Slot[0].Color) ? (0xFF << 24) : 0;
if (armor_tint_id == 0)
for (int index = EQEmu::textures::TextureChest; index <= EQEmu::textures::LastTexture; index++)
for (int index = EQEmu::textures::armorChest; index <= EQEmu::textures::LastTexture; index++)
tmpNPCType->armor_tint.Slot[index].Color = tmpNPCType->armor_tint.Slot[0].Color;
else if (tmpNPCType->armor_tint.Slot[0].Color == 0) {
std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, "
@ -2327,7 +2327,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
else {
auto armorTint_row = results.begin();
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
for (int index = EQEmu::textures::textureBegin; index <= EQEmu::textures::LastTexture; index++) {
tmpNPCType->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);