Renamed class Inventory to EQEmu::InventoryProfile

This commit is contained in:
Uleat 2016-10-17 04:59:00 -04:00
parent 1cb79c8c1f
commit 04f4fd652b
33 changed files with 586 additions and 573 deletions

View File

@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
== 10/17/2016 ==
Uleat: Moved namespace ItemField from item_instance.h to shareddb.cpp - the only place it is used
Uleat: Separated class Inventory from item_instance files into inventory_profile files
Uleat: Renamed class Inventory to EQEmu::InventoryProfile
== 10/16/2016 ==
Uleat: Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance

View File

@ -672,7 +672,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
}
/* This only for new Character creation storing */
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv) {
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv) {
uint32 charid = 0;
char zone[50];
float x, y, z;

View File

@ -37,10 +37,14 @@
//atoi is not uint32 or uint32 safe!!!!
#define atoul(str) strtoul(str, nullptr, 10)
class Inventory;
class MySQLRequestResult;
class Client;
namespace EQEmu
{
class InventoryProfile;
}
struct EventLogDetails_Struct {
uint32 id;
char accountname[64];
@ -109,7 +113,7 @@ public:
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv);
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv);
bool UpdateName(const char* oldname, const char* newname);
/* General Information Queries */

File diff suppressed because it is too large Load Diff

View File

@ -73,156 +73,159 @@ protected:
};
// ########################################
// Class: Inventory
// Class: EQEmu::InventoryProfile
// Character inventory
class Inventory
namespace EQEmu
{
friend class EQEmu::ItemInstance;
public:
///////////////////////////////
// Public Methods
///////////////////////////////
Inventory() { m_inventory_version = EQEmu::versions::InventoryVersion::Unknown; m_inventory_version_set = false; }
~Inventory();
class InventoryProfile
{
friend class ItemInstance;
public:
///////////////////////////////
// Public Methods
///////////////////////////////
// inv2 creep
bool SetInventoryVersion(EQEmu::versions::InventoryVersion inventory_version) {
if (!m_inventory_version_set) {
m_inventory_version = EQEmu::versions::ValidateInventoryVersion(inventory_version);
return (m_inventory_version_set = true);
InventoryProfile() { m_inventory_version = versions::InventoryVersion::Unknown; m_inventory_version_set = false; }
~InventoryProfile();
// inv2 creep
bool SetInventoryVersion(versions::InventoryVersion inventory_version) {
if (!m_inventory_version_set) {
m_inventory_version = versions::ValidateInventoryVersion(inventory_version);
return (m_inventory_version_set = true);
}
else {
return false;
}
}
else {
return false;
}
}
bool SetInventoryVersion(EQEmu::versions::ClientVersion client_version) { return SetInventoryVersion(EQEmu::versions::ConvertClientVersionToInventoryVersion(client_version)); }
bool SetInventoryVersion(versions::ClientVersion client_version) { return SetInventoryVersion(versions::ConvertClientVersionToInventoryVersion(client_version)); }
EQEmu::versions::InventoryVersion InventoryVersion() { return m_inventory_version; }
versions::InventoryVersion InventoryVersion() { return m_inventory_version; }
static void CleanDirty();
static void MarkDirty(EQEmu::ItemInstance *inst);
static void CleanDirty();
static void MarkDirty(ItemInstance *inst);
// Retrieve a writeable item at specified slot
EQEmu::ItemInstance* GetItem(int16 slot_id) const;
EQEmu::ItemInstance* GetItem(int16 slot_id, uint8 bagidx) const;
// Retrieve a writeable item at specified slot
ItemInstance* GetItem(int16 slot_id) const;
ItemInstance* GetItem(int16 slot_id, uint8 bagidx) const;
inline std::list<EQEmu::ItemInstance*>::const_iterator cursor_cbegin() { return m_cursor.cbegin(); }
inline std::list<EQEmu::ItemInstance*>::const_iterator cursor_cend() { return m_cursor.cend(); }
inline std::list<ItemInstance*>::const_iterator cursor_cbegin() { return m_cursor.cbegin(); }
inline std::list<ItemInstance*>::const_iterator cursor_cend() { return m_cursor.cend(); }
inline int CursorSize() { return m_cursor.size(); }
inline bool CursorEmpty() { return m_cursor.empty(); }
inline int CursorSize() { return m_cursor.size(); }
inline bool CursorEmpty() { return m_cursor.empty(); }
// Retrieve a read-only item from inventory
inline const EQEmu::ItemInstance* operator[](int16 slot_id) const { return GetItem(slot_id); }
// Retrieve a read-only item from inventory
inline const ItemInstance* operator[](int16 slot_id) const { return GetItem(slot_id); }
// Add item to inventory
int16 PutItem(int16 slot_id, const EQEmu::ItemInstance& inst);
// Add item to inventory
int16 PutItem(int16 slot_id, const ItemInstance& inst);
// Add item to cursor queue
int16 PushCursor(const EQEmu::ItemInstance& inst);
// Add item to cursor queue
int16 PushCursor(const ItemInstance& inst);
// Get cursor item in front of queue
EQEmu::ItemInstance* GetCursorItem();
// Get cursor item in front of queue
ItemInstance* GetCursorItem();
// Swap items in inventory
bool SwapItem(int16 slot_a, int16 slot_b);
// Swap items in inventory
bool SwapItem(int16 slot_a, int16 slot_b);
// Remove item from inventory
bool DeleteItem(int16 slot_id, uint8 quantity=0);
// Remove item from inventory
bool DeleteItem(int16 slot_id, uint8 quantity = 0);
// Checks All items in a bag for No Drop
bool CheckNoDrop(int16 slot_id);
// Checks All items in a bag for No Drop
bool CheckNoDrop(int16 slot_id);
// Remove item from inventory (and take control of memory)
EQEmu::ItemInstance* PopItem(int16 slot_id);
// Remove item from inventory (and take control of memory)
ItemInstance* PopItem(int16 slot_id);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const EQEmu::ItemData *ItemToTry, int16 Quantity);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItem(uint32 item_id, uint8 quantity = 0, uint8 where = 0xFF);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItem(uint32 item_id, uint8 quantity = 0, uint8 where = 0xFF);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItemByUse(uint8 use, uint8 quantity=0, uint8 where=0xFF);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItemByUse(uint8 use, uint8 quantity = 0, uint8 where = 0xFF);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItemByLoreGroup(uint32 loregroup, uint8 where=0xFF);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
int16 HasItemByLoreGroup(uint32 loregroup, uint8 where = 0xFF);
// Locate an available inventory slot
int16 FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size = 0, bool is_arrow = false);
int16 FindFreeSlotForTradeItem(const EQEmu::ItemInstance* inst);
// Locate an available inventory slot
int16 FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size = 0, bool is_arrow = false);
int16 FindFreeSlotForTradeItem(const ItemInstance* inst);
// Calculate slot_id for an item within a bag
static int16 CalcSlotId(int16 slot_id); // Calc parent bag's slot_id
static int16 CalcSlotId(int16 bagslot_id, uint8 bagidx); // Calc slot_id for item inside bag
static uint8 CalcBagIdx(int16 slot_id); // Calc bagidx for slot_id
static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot);
// Calculate slot_id for an item within a bag
static int16 CalcSlotId(int16 slot_id); // Calc parent bag's slot_id
static int16 CalcSlotId(int16 bagslot_id, uint8 bagidx); // Calc slot_id for item inside bag
static uint8 CalcBagIdx(int16 slot_id); // Calc bagidx for slot_id
static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot);
static bool CanItemFitInContainer(const EQEmu::ItemData *ItemToTry, const EQEmu::ItemData *Container);
static bool CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container);
// Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id);
bool SupportsPotionBeltCasting(int16 slot_id);
// Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id);
bool SupportsPotionBeltCasting(int16 slot_id);
// Test whether a given slot can support a container item
static bool SupportsContainers(int16 slot_id);
// Test whether a given slot can support a container item
static bool SupportsContainers(int16 slot_id);
int GetSlotByItemInst(EQEmu::ItemInstance *inst);
int GetSlotByItemInst(ItemInstance *inst);
uint8 FindBrightestLightType();
uint8 FindBrightestLightType();
void dumpEntireInventory();
void dumpWornItems();
void dumpInventory();
void dumpBankItems();
void dumpSharedBankItems();
void dumpEntireInventory();
void dumpWornItems();
void dumpInventory();
void dumpBankItems();
void dumpSharedBankItems();
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value);
std::string GetCustomItemData(int16 slot_id, std::string identifier);
protected:
///////////////////////////////
// Protected Methods
///////////////////////////////
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value);
std::string GetCustomItemData(int16 slot_id, std::string identifier);
protected:
///////////////////////////////
// Protected Methods
///////////////////////////////
int GetSlotByItemInstCollection(const std::map<int16, EQEmu::ItemInstance*> &collection, EQEmu::ItemInstance *inst);
void dumpItemCollection(const std::map<int16, EQEmu::ItemInstance*> &collection);
void dumpBagContents(EQEmu::ItemInstance *inst, std::map<int16, EQEmu::ItemInstance*>::const_iterator *it);
int GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst);
void dumpItemCollection(const std::map<int16, ItemInstance*> &collection);
void dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it);
// Retrieves item within an inventory bucket
EQEmu::ItemInstance* _GetItem(const std::map<int16, EQEmu::ItemInstance*>& bucket, int16 slot_id) const;
// Retrieves item within an inventory bucket
ItemInstance* _GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const;
// Private "put" item into bucket, without regard for what is currently in bucket
int16 _PutItem(int16 slot_id, EQEmu::ItemInstance* inst);
// Private "put" item into bucket, without regard for what is currently in bucket
int16 _PutItem(int16 slot_id, ItemInstance* inst);
// Checks an inventory bucket for a particular item
int16 _HasItem(std::map<int16, EQEmu::ItemInstance*>& bucket, uint32 item_id, uint8 quantity);
int16 _HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity);
int16 _HasItemByUse(std::map<int16, EQEmu::ItemInstance*>& bucket, uint8 use, uint8 quantity);
int16 _HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity);
int16 _HasItemByLoreGroup(std::map<int16, EQEmu::ItemInstance*>& bucket, uint32 loregroup);
int16 _HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup);
// Checks an inventory bucket for a particular item
int16 _HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity);
int16 _HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity);
int16 _HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity);
int16 _HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity);
int16 _HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup);
int16 _HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup);
// Player inventory
std::map<int16, EQEmu::ItemInstance*> m_worn; // Items worn by character
std::map<int16, EQEmu::ItemInstance*> m_inv; // Items in character personal inventory
std::map<int16, EQEmu::ItemInstance*> m_bank; // Items in character bank
std::map<int16, EQEmu::ItemInstance*> m_shbank; // Items in character shared bank
std::map<int16, EQEmu::ItemInstance*> m_trade; // Items in a trade session
ItemInstQueue m_cursor; // Items on cursor: FIFO
// Player inventory
std::map<int16, ItemInstance*> m_worn; // Items worn by character
std::map<int16, ItemInstance*> m_inv; // Items in character personal inventory
std::map<int16, ItemInstance*> m_bank; // Items in character bank
std::map<int16, ItemInstance*> m_shbank; // Items in character shared bank
std::map<int16, ItemInstance*> m_trade; // Items in a trade session
::ItemInstQueue m_cursor; // Items on cursor: FIFO
private:
// Active inventory version
EQEmu::versions::InventoryVersion m_inventory_version;
bool m_inventory_version_set;
};
private:
// Active inventory version
versions::InventoryVersion m_inventory_version;
bool m_inventory_version_set;
};
}
#endif /*COMMON_INVENTORY_PROFILE_H*/

View File

@ -207,12 +207,12 @@ EQEmu::ItemInstance::~ItemInstance()
}
// Query item type
bool EQEmu::ItemInstance::IsType(EQEmu::item::ItemClass item_class) const
bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
{
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
// Check usage type
if ((m_use_type == ItemInstWorldContainer) && (item_class == EQEmu::item::ItemClassBag))
if ((m_use_type == ItemInstWorldContainer) && (item_class == item::ItemClassBag))
return true;
if (!m_item)
@ -273,8 +273,8 @@ 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::inventory::slotPowerSource) { use_slot = EQEmu::inventory::slotGeneral1; }
if ((uint16)slot_id <= EQEmu::legacy::EQUIPMENT_END) { use_slot = slot_id; }
if (slot_id == inventory::slotPowerSource) { use_slot = inventory::slotGeneral1; }
if ((uint16)slot_id <= legacy::EQUIPMENT_END) { use_slot = slot_id; }
if (use_slot != INVALID_INDEX) {
if (m_item->Slots & (1 << use_slot))
@ -289,7 +289,7 @@ bool EQEmu::ItemInstance::IsAugmentable() const
if (!m_item)
return false;
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
if (m_item->AugSlotType[index] != 0)
return true;
}
@ -303,8 +303,8 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
if (!m_item || !m_item->IsClassCommon())
return false;
int index = EQEmu::legacy::EQUIPMENT_BEGIN;
for (; index <= EQEmu::inventory::slotGeneral1; ++index) { // MainGeneral1 should be EQEmu::legacy::EQUIPMENT_END
int index = legacy::EQUIPMENT_BEGIN;
for (; index <= inventory::slotGeneral1; ++index) { // MainGeneral1 should be legacy::EQUIPMENT_END
if (m_item->Slots & (1 << index)) {
if (aug_wear_slots & (1 << index))
break;
@ -319,14 +319,14 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
if (!m_item || !m_item->IsClassCommon())
return INVALID_INDEX;
int index = EQEmu::inventory::socketBegin;
for (; index < EQEmu::inventory::SocketCount; ++index) {
int index = inventory::socketBegin;
for (; index < 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::inventory::SocketCount) ? index : INVALID_INDEX;
return (index < inventory::SocketCount) ? index : INVALID_INDEX;
}
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
@ -416,7 +416,7 @@ void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is
continue;
}
const EQEmu::ItemData* item = inst->GetItem();
const ItemData* item = inst->GetItem();
if (item == nullptr) {
cur = m_contents.erase(cur);
continue;
@ -469,7 +469,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
return INVALID_INDEX;
uint8 slots = m_item->BagSlots, i;
for (i = EQEmu::inventory::containerBegin; i < slots; i++) {
for (i = inventory::containerBegin; i < slots; i++) {
if (!GetItem(i))
break;
}
@ -486,7 +486,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
if (m_item && !m_item->IsClassBag()) { return item_count; }
for (int index = EQEmu::inventory::containerBegin; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
for (int index = inventory::containerBegin; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
return item_count;
}
@ -496,7 +496,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
if (!m_item || !m_item->IsClassBag())
return false;
for (int index = EQEmu::inventory::containerBegin; index < m_item->BagSlots; ++index) {
for (int index = inventory::containerBegin; index < m_item->BagSlots; ++index) {
if (GetItem(index))
return true;
}
@ -518,7 +518,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
if (ornamentationAugtype == 0) { return nullptr; }
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
for (int i = inventory::socketBegin; i < inventory::SocketCount; i++)
{
if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype)
{
@ -587,10 +587,10 @@ bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
return ornamentSet;
}
bool EQEmu::ItemInstance::CanTransform(const EQEmu::ItemData *ItemToTry, const EQEmu::ItemData *Container, bool AllowAll) {
bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == EQEmu::item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
return false;
if (AllowAll && strncasecmp(Container->CharmFile, "ITEMTRANSFIGSHIELD", 18) && strncasecmp(Container->CharmFile, "ITEMTransfigBow", 15)) {
@ -685,7 +685,7 @@ bool EQEmu::ItemInstance::IsAugmented()
if (!m_item || !m_item->IsClassCommon())
return false;
for (int index = EQEmu::inventory::socketBegin; index < EQEmu::inventory::SocketCount; ++index) {
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
if (GetAugmentItemID(index))
return true;
}
@ -699,7 +699,7 @@ bool EQEmu::ItemInstance::IsWeapon() const
if (!m_item || !m_item->IsClassCommon())
return false;
if (m_item->ItemType == EQEmu::item::ItemTypeArrow && m_item->Damage != 0)
if (m_item->ItemType == item::ItemTypeArrow && m_item->Damage != 0)
return true;
else
return ((m_item->Damage != 0) && (m_item->Delay != 0));
@ -710,9 +710,9 @@ bool EQEmu::ItemInstance::IsAmmo() const
if (!m_item)
return false;
if ((m_item->ItemType == EQEmu::item::ItemTypeArrow) ||
(m_item->ItemType == EQEmu::item::ItemTypeLargeThrowing) ||
(m_item->ItemType == EQEmu::item::ItemTypeSmallThrowing)
if ((m_item->ItemType == item::ItemTypeArrow) ||
(m_item->ItemType == item::ItemTypeLargeThrowing) ||
(m_item->ItemType == item::ItemTypeSmallThrowing)
) {
return true;
}
@ -811,10 +811,10 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::Clone() const
bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
// 'SupportsContainers' and 'slot_id > 21' previously saw the reassigned PowerSource slot (9999 to 22) as valid
if (!m_item) { return false; }
else if (Inventory::SupportsContainers(slot_id)) { return true; }
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
else if (m_item->Slots & (1 << slot_id)) { 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 if (slot_id == inventory::slotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... <watch>
else if (slot_id != inventory::slotPowerSource && slot_id > legacy::EQUIPMENT_END) { return true; }
else { return false; }
}
@ -966,7 +966,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
if (item) {
ac = item->AC;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
ac += GetAugment(i)->GetItemArmorClass();
}
@ -1008,7 +1008,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
}
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
GetAugment(i)->GetItemElementalDamage(magic, fire, cold, poison, disease, chromatic, prismatic, physical, corruption);
}
@ -1025,7 +1025,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
return flag;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
if (GetAugment(i))
flag = GetAugment(i)->GetItemElementalFlag();
if (flag)
@ -1046,7 +1046,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
return damage;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
if (GetAugment(i))
damage = GetAugment(i)->GetItemElementalDamage();
if (damage)
@ -1065,7 +1065,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
level = item->RecLevel;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
int temp = 0;
if (GetAugment(i)) {
temp = GetAugment(i)->GetItemRecommendedLevel();
@ -1087,7 +1087,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
level = item->ReqLevel;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
int temp = 0;
if (GetAugment(i)) {
temp = GetAugment(i)->GetItemRequiredLevel();
@ -1109,7 +1109,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
damage = item->Damage;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemWeaponDamage();
}
@ -1125,7 +1125,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
damage = item->BackstabDmg;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBackstabDamage();
}
@ -1143,7 +1143,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
return body;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i)) {
body = GetAugment(i)->GetItemBaneDamageBody();
if (body)
@ -1164,7 +1164,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
return race;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i)) {
race = GetAugment(i)->GetItemBaneDamageRace();
if (race)
@ -1184,7 +1184,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
damage += item->BaneDmgAmt;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBaneDamageBody(against);
}
@ -1201,7 +1201,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
damage += item->BaneDmgRaceAmt;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
damage += GetAugment(i)->GetItemBaneDamageRace(against);
}
@ -1217,7 +1217,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
return 1;
if (augments) {
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i) && GetAugment(i)->GetItemMagical())
return 1;
}
@ -1232,7 +1232,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
if (item) {
hp = item->HP;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
hp += GetAugment(i)->GetItemHP();
}
@ -1246,7 +1246,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
if (item) {
mana = item->Mana;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
mana += GetAugment(i)->GetItemMana();
}
@ -1260,7 +1260,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
if (item) {
endur = item->Endur;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
endur += GetAugment(i)->GetItemEndur();
}
@ -1274,7 +1274,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
if (item) {
atk = item->Attack;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
atk += GetAugment(i)->GetItemAttack();
}
@ -1288,7 +1288,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
if (item) {
str = item->AStr;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
str += GetAugment(i)->GetItemStr();
}
@ -1302,7 +1302,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
if (item) {
sta = item->ASta;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
sta += GetAugment(i)->GetItemSta();
}
@ -1316,7 +1316,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
if (item) {
total = item->ADex;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemDex();
}
@ -1330,7 +1330,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
if (item) {
total = item->AAgi;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemAgi();
}
@ -1344,7 +1344,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
if (item) {
total = item->AInt;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemInt();
}
@ -1358,7 +1358,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
if (item) {
total = item->AWis;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemWis();
}
@ -1372,7 +1372,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
if (item) {
total = item->ACha;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCha();
}
@ -1386,7 +1386,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
if (item) {
total = item->MR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemMR();
}
@ -1400,7 +1400,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
if (item) {
total = item->FR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemFR();
}
@ -1414,7 +1414,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
if (item) {
total = item->CR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCR();
}
@ -1428,7 +1428,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
if (item) {
total = item->PR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemPR();
}
@ -1442,7 +1442,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
if (item) {
total = item->DR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemDR();
}
@ -1456,7 +1456,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
if (item) {
total = item->SVCorruption;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemCorrup();
}
@ -1470,7 +1470,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
if (item) {
total = item->HeroicStr;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicStr();
}
@ -1484,7 +1484,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
if (item) {
total = item->HeroicSta;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicSta();
}
@ -1498,7 +1498,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
if (item) {
total = item->HeroicDex;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicDex();
}
@ -1512,7 +1512,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
if (item) {
total = item->HeroicAgi;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicAgi();
}
@ -1526,7 +1526,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
if (item) {
total = item->HeroicInt;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicInt();
}
@ -1540,7 +1540,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
if (item) {
total = item->HeroicWis;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicWis();
}
@ -1554,7 +1554,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
if (item) {
total = item->HeroicCha;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCha();
}
@ -1568,7 +1568,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
if (item) {
total = item->HeroicMR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicMR();
}
@ -1582,7 +1582,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
if (item) {
total = item->HeroicFR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicFR();
}
@ -1596,7 +1596,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
if (item) {
total = item->HeroicCR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCR();
}
@ -1610,7 +1610,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
if (item) {
total = item->HeroicPR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicPR();
}
@ -1624,7 +1624,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
if (item) {
total = item->HeroicDR;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicDR();
}
@ -1638,7 +1638,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
if (item) {
total = item->HeroicSVCorrup;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i))
total += GetAugment(i)->GetItemHeroicCorrup();
}
@ -1652,7 +1652,7 @@ int EQEmu::ItemInstance::GetItemHaste(bool augments) const
if (item) {
total = item->Haste;
if (augments)
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i)
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
if (GetAugment(i)) {
int temp = GetAugment(i)->GetItemHaste();
if (temp > total)

View File

@ -52,7 +52,6 @@ typedef enum {
} byFlagSetting;
class SharedDatabase;
class Inventory;
// ########################################
// Class: EQEmu::ItemInstance
@ -61,6 +60,8 @@ class Inventory;
// to an item instance (includes dye, augments, charges, etc)
namespace EQEmu
{
class InventoryProfile;
class ItemInstance {
public:
/////////////////////////
@ -79,7 +80,7 @@ namespace EQEmu
~ItemInstance();
// Query item type
bool IsType(EQEmu::item::ItemClass item_class) const;
bool IsType(item::ItemClass item_class) const;
bool IsClassCommon() const;
bool IsClassBag() const;
@ -102,7 +103,7 @@ namespace EQEmu
bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const;
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); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == item::ItemEffectExpendable) || (m_item->ItemType == item::ItemTypePotion)) : false); }
//
// Contents
@ -133,7 +134,7 @@ namespace EQEmu
bool IsAugmented();
ItemInstance* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo();
static bool CanTransform(const EQEmu::ItemData *ItemToTry, const EQEmu::ItemData *Container, bool AllowAll = false);
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
// Has attack/delay?
bool IsWeapon() const;
@ -211,8 +212,8 @@ namespace EQEmu
int8 GetMaxEvolveLvl() const;
uint32 GetKillsNeeded(uint8 currentlevel);
std::string Serialize(int16 slot_id) const { EQEmu::InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(EQEmu::InternalSerializedItem_Struct)); return ser; }
void Serialize(EQEmu::OutBuffer& ob, int16 slot_id) const { EQEmu::InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
void Serialize(OutBuffer& ob, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
@ -278,7 +279,7 @@ namespace EQEmu
//////////////////////////
// Protected Members
//////////////////////////
friend class ::Inventory;
friend class InventoryProfile;
std::map<uint8, ItemInstance*>::const_iterator _cbegin() { return m_contents.cbegin(); }
std::map<uint8, ItemInstance*>::const_iterator _cend() { return m_contents.cend(); }
@ -299,7 +300,7 @@ namespace EQEmu
int8 m_evolveLvl;
bool m_activated;
ItemData* m_scaledItem;
EvolveInfo* m_evolveInfo;
::EvolveInfo* m_evolveInfo;
bool m_scaling;
uint32 m_ornamenticon;
uint32 m_ornamentidfile;

View File

@ -5264,7 +5264,7 @@ namespace RoF
if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) {
ornaIcon = inst->GetOrnamentationIcon();
heroModel = inst->GetOrnamentHeroModel(Inventory::CalcMaterialFromSlot(slot_id_in));
heroModel = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
char tmp[30]; memset(tmp, 0x0, 30); sprintf(tmp, "IT%d", inst->GetOrnamentationIDFile());

View File

@ -5555,7 +5555,7 @@ namespace RoF2
if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) {
ornaIcon = inst->GetOrnamentationIcon();
heroModel = inst->GetOrnamentHeroModel(Inventory::CalcMaterialFromSlot(slot_id_in));
heroModel = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
char tmp[30]; memset(tmp, 0x0, 30); sprintf(tmp, "IT%d", inst->GetOrnamentationIDFile());

View File

@ -184,7 +184,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
else {
// Needed to clear out bag slots that 'REPLACE' in UpdateSharedBankSlot does not overwrite..otherwise, duplication occurs
// (This requires that parent then child items be sent..which should be how they are currently passed)
if (Inventory::SupportsContainers(slot_id))
if (EQEmu::InventoryProfile::SupportsContainers(slot_id))
DeleteSharedBankSlot(char_id, slot_id);
return UpdateSharedBankSlot(char_id, inst, slot_id);
}
@ -195,7 +195,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
// Needed to clear out bag slots that 'REPLACE' in UpdateInventorySlot does not overwrite..otherwise, duplication occurs
// (This requires that parent then child items be sent..which should be how they are currently passed)
if (Inventory::SupportsContainers(slot_id))
if (EQEmu::InventoryProfile::SupportsContainers(slot_id))
DeleteInventorySlot(char_id, slot_id);
return UpdateInventorySlot(char_id, inst, slot_id);
}
@ -232,12 +232,12 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
auto results = QueryDatabase(query);
// Save bag contents, if slot supports bag contents
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id))
if (inst->IsClassBag() && EQEmu::InventoryProfile::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 = 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));
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
}
if (!results.Success()) {
@ -278,12 +278,12 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInsta
auto results = QueryDatabase(query);
// Save bag contents, if slot supports bag contents
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id)) {
if (inst->IsClassBag() && EQEmu::InventoryProfile::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 = 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));
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
}
}
@ -304,10 +304,10 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
}
// Delete bag slots, if need be
if (!Inventory::SupportsContainers(slot_id))
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
int16 base_slot_id = EQEmu::InventoryProfile::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);
@ -330,10 +330,10 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
}
// Delete bag slots, if need be
if (!Inventory::SupportsContainers(slot_id))
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
int16 base_slot_id = EQEmu::InventoryProfile::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));
@ -373,7 +373,7 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
return true;
}
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
const EQEmu::ItemData* myitem;
@ -410,7 +410,7 @@ bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv,
// Retrieve shared bank inventory based on either account or character
bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool is_charid)
{
std::string query;
@ -511,7 +511,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
}
// Overloaded: Retrieve character inventory based on character id
bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
{
// Retrieve character inventory
std::string query =
@ -653,7 +653,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
}
// Overloaded: Retrieve character inventory based on account_id and character name
bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::InventoryProfile *inv)
{
// Retrieve character inventory
std::string query =

View File

@ -33,7 +33,6 @@
#include <memory>
class EvolveInfo;
class Inventory;
struct BaseDataStruct;
struct InspectMessage_Struct;
struct PlayerProfile_Struct;
@ -46,6 +45,7 @@ namespace EQEmu
{
struct ItemData;
class ItemInstance;
class InventoryProfile;
class MemoryMappedFile;
}
@ -74,7 +74,7 @@ class SharedDatabase : public Database
uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID);
/*
Character Inventory
Character InventoryProfile
*/
bool SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end);
bool SaveInventory(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
@ -83,15 +83,15 @@ class SharedDatabase : public Database
bool UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
bool UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
bool VerifyInventory(uint32 account_id, int16 slot_id, const EQEmu::ItemInstance* inst);
bool GetSharedBank(uint32 id, Inventory* inv, bool is_charid);
bool GetSharedBank(uint32 id, EQEmu::InventoryProfile* inv, bool is_charid);
int32 GetSharedPlatinum(uint32 account_id);
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
bool GetInventory(uint32 char_id, Inventory* inv);
bool GetInventory(uint32 account_id, char* name, Inventory* inv);
bool GetInventory(uint32 char_id, EQEmu::InventoryProfile* inv);
bool GetInventory(uint32 account_id, char* name, EQEmu::InventoryProfile* inv);
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
void ClearOldRecastTimestamps(uint32 char_id);
bool SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
bool SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
std::string GetBook(const char *txtfile);

View File

@ -1399,7 +1399,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
{
PlayerProfile_Struct pp;
ExtendedProfile_Struct ext;
Inventory inv;
EQEmu::InventoryProfile inv;
time_t bday = time(nullptr);
char startzone[50]={0};
uint32 i;

View File

@ -96,7 +96,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterSelectEntry_Struct *cse = (CharacterSelectEntry_Struct *)buff_ptr;
PlayerProfile_Struct pp;
Inventory inv;
EQEmu::InventoryProfile inv;
uint32 character_id = (uint32)atoi(row[0]);
uint8 has_home = 0;
uint8 has_bind = 0;
@ -249,7 +249,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
int16 invslot = 0;
for (uint32 matslot = EQEmu::textures::textureBegin; matslot < EQEmu::textures::materialCount; matslot++) {
invslot = Inventory::CalcSlotFromMaterial(matslot);
invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(matslot);
if (invslot == INVALID_INDEX) { continue; }
inst = inv.GetItem(invslot);
if (inst == nullptr) { continue; }

View File

@ -3325,7 +3325,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
EQEmu::ItemInstance* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
}
@ -3418,7 +3418,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
EQEmu::ItemInstance* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
}

View File

@ -2875,7 +2875,7 @@ void Bot::Spawn(Client* botCharacterOwner) {
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = GetBotItemBySlot(i);
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
if(materialFromSlot != 0xFF)
this->SendWearChange(materialFromSlot);
}
@ -2897,7 +2897,7 @@ void Bot::RemoveBotItemBySlot(uint32 slotID, std::string *errorMessage)
}
// Retrieves all the inventory records from the database for this bot.
void Bot::GetBotItems(Inventory &inv, std::string* errorMessage)
void Bot::GetBotItems(EQEmu::InventoryProfile &inv, std::string* errorMessage)
{
if(!GetBotID())
return;
@ -3235,7 +3235,7 @@ EQEmu::ItemInstance* Bot::GetBotItem(uint32 slotID) {
// Adds the specified item it bot to the NPC equipment array and to the bot inventory collection.
void Bot::BotAddEquipItem(int slot, uint32 id) {
if(slot > 0 && id > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
uint8 materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(slot);
if (materialFromSlot != EQEmu::textures::materialInvalid) {
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
@ -3251,7 +3251,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) {
// Erases the specified item from bot the NPC equipment array and from the bot inventory collection.
void Bot::BotRemoveEquipItem(int slot) {
if(slot > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
uint8 materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(slot);
if (materialFromSlot != EQEmu::textures::materialInvalid) {
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
@ -3382,7 +3382,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
bool UpdateClient = false;
bool already_returned = false;
Inventory& clientInventory = client->GetInv();
EQEmu::InventoryProfile& clientInventory = client->GetInv();
const EQEmu::ItemInstance* inst = clientInventory[i];
if(inst) {
items[i] = inst->GetItem()->ID;
@ -8434,7 +8434,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
return false;
for (uint8 i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; ++i) {
uint8 inv_slot = Inventory::CalcSlotFromMaterial(i);
uint8 inv_slot = EQEmu::InventoryProfile::CalcSlotFromMaterial(i);
EQEmu::ItemInstance* inst = m_inv.GetItem(inv_slot);
if (!inst)
continue;
@ -8444,7 +8444,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
}
}
else {
uint8 mat_slot = Inventory::CalcMaterialFromSlot(slot_id);
uint8 mat_slot = EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id);
if (mat_slot == EQEmu::textures::materialInvalid || mat_slot >= EQEmu::textures::weaponPrimary)
return false;

View File

@ -647,7 +647,7 @@ private:
bool _petChooser;
uint8 _petChooserID;
bool berserk;
Inventory m_inv;
EQEmu::InventoryProfile m_inv;
double _lastTotalPlayTime;
time_t _startTotalPlayTime;
Mob* _previousTarget;
@ -711,7 +711,7 @@ private:
void SetBotID(uint32 botID);
// Private "Inventory" Methods
void GetBotItems(Inventory &inv, std::string* errorMessage);
void GetBotItems(EQEmu::InventoryProfile &inv, std::string* errorMessage);
void BotAddEquipItem(int slot, uint32 id);
uint32 GetBotItemBySlot(uint32 slotID);

View File

@ -4375,7 +4375,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
bool dye_all = (sep->arg[1][0] == '*');
if (!dye_all) {
material_slot = atoi(sep->arg[1]);
slot_id = Inventory::CalcSlotFromMaterial(material_slot);
slot_id = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
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:");

View File

@ -1023,7 +1023,7 @@ bool BotDatabase::QueryInventoryCount(const uint32 bot_id, uint32& item_count)
return true;
}
bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& inventory_inst)
{
if (!bot_id)
return false;
@ -1279,7 +1279,7 @@ bool BotDatabase::LoadEquipmentColor(const uint32 bot_id, const uint8 material_s
if (!bot_id)
return false;
int16 slot_id = Inventory::CalcSlotFromMaterial(material_slot_id);
int16 slot_id = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot_id);
if (slot_id == INVALID_INDEX)
return false;

View File

@ -31,12 +31,12 @@
class Bot;
class Inventory;
struct BotsAvailableList;
namespace EQEmu
{
class ItemInstance;
class InventoryProfile;
}
@ -89,7 +89,7 @@ public:
/* Bot inventory functions */
bool QueryInventoryCount(const uint32 bot_id, uint32& item_count);
bool LoadItems(const uint32 bot_id, Inventory &inventory_inst);
bool LoadItems(const uint32 bot_id, EQEmu::InventoryProfile &inventory_inst);
bool SaveItems(Bot* bot_inst);
bool DeleteItems(const uint32 bot_id);

View File

@ -2799,7 +2799,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const EQEmu::ItemData* item = database.GetItem(item_id);
if (item && item->IsClassCommon())
{
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
uint8 matslot = EQEmu::InventoryProfile::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::textures::materialInvalid)
{
m_pp.item_material.Slot[matslot].Material = GetEquipmentMaterial(matslot);
@ -3141,7 +3141,7 @@ void Client::SetTint(int16 in_slot, uint32 color) {
// Still need to reconcile bracer01 versus bracer02
void Client::SetTint(int16 in_slot, EQEmu::textures::Tint_Struct& color) {
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
uint8 matslot = EQEmu::InventoryProfile::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::textures::materialInvalid)
{
m_pp.item_tint.Slot[matslot].Color = color.Color;

View File

@ -340,8 +340,8 @@ public:
inline uint8 GetAnon() const { return m_pp.anon; }
inline PlayerProfile_Struct& GetPP() { return m_pp; }
inline ExtendedProfile_Struct& GetEPP() { return m_epp; }
inline Inventory& GetInv() { return m_inv; }
inline const Inventory& GetInv() const { return m_inv; }
inline EQEmu::InventoryProfile& GetInv() { return m_inv; }
inline const EQEmu::InventoryProfile& GetInv() const { return m_inv; }
inline PetInfo* GetPetInfo(uint16 pet) { return (pet==1)?&m_suspendedminion:&m_petinfo; }
inline InspectMessage_Struct& GetInspectMessage() { return m_inspect_message; }
inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; }
@ -1395,7 +1395,7 @@ private:
PlayerProfile_Struct m_pp;
ExtendedProfile_Struct m_epp;
Inventory m_inv;
EQEmu::InventoryProfile m_inv;
Object* m_tradeskill_object;
PetInfo m_petinfo; // current pet data, used while loading from and saving to DB
PetInfo m_suspendedminion; // pet data for our suspended minion.

View File

@ -2939,11 +2939,11 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
// in_augment->container_slot, in_augment->augment_slot, in_augment->container_index, in_augment->augment_index, in_augment->augment_action, in_augment->dest_inst_id);
EQEmu::ItemInstance *tobe_auged = nullptr, *old_aug = nullptr, *new_aug = nullptr, *aug = nullptr, *solvent = nullptr;
Inventory& user_inv = GetInv();
EQEmu::InventoryProfile& user_inv = GetInv();
uint16 item_slot = in_augment->container_slot;
uint16 solvent_slot = in_augment->augment_slot;
uint8 mat = Inventory::CalcMaterialFromSlot(item_slot); // for when player is augging a piece of equipment while they're wearing it
uint8 mat = EQEmu::InventoryProfile::CalcMaterialFromSlot(item_slot); // for when player is augging a piece of equipment while they're wearing it
if (item_slot == INVALID_INDEX || solvent_slot == INVALID_INDEX)
{

View File

@ -2596,7 +2596,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " InvBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
EQEmu::InventoryProfile::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@ -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::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()));
EQEmu::InventoryProfile::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()));
}
}
}
@ -2667,7 +2667,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " BankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
EQEmu::InventoryProfile::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@ -2689,7 +2689,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " SharedBankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
EQEmu::InventoryProfile::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@ -2712,7 +2712,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " TradeBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
EQEmu::InventoryProfile::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}

View File

@ -408,7 +408,7 @@ void Corpse::MoveItemToCorpse(Client *client, EQEmu::ItemInstance *inst, int16 e
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::inventory::slotCursor) { break; }
for (int16 sub_index = EQEmu::inventory::containerBegin; sub_index < EQEmu::inventory::ContainerCount; ++sub_index) {
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
int16 real_bag_slot = EQEmu::InventoryProfile::CalcSlotId(equipSlot, sub_index);
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
if (bag_inst == nullptr) { continue; }
@ -684,8 +684,8 @@ 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, EQEmu::inventory::containerBegin);
if (sitem && bag_item_data && EQEmu::InventoryProfile::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = EQEmu::InventoryProfile::CalcSlotId(sitem->equip_slot, EQEmu::inventory::containerBegin);
cur = itemlist.begin();
end = itemlist.end();
@ -739,7 +739,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
is_corpse_changed = true;
itemlist.erase(iter);
uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
uint8 material = EQEmu::InventoryProfile::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
if (material != EQEmu::textures::materialInvalid)
SendWearChange(material);
@ -1406,7 +1406,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
return 0;
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a 0 for any invalid index...
return 0;

View File

@ -767,7 +767,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
EQEmu::ItemInstance* bagitem = m_inv[slot_id]->GetItem(bag_idx);
if(bagitem) {
int16 bagslot_id = Inventory::CalcSlotId(slot_id, bag_idx);
int16 bagslot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, bag_idx);
qsaudit->items[++parent_offset].char_slot = bagslot_id;
qsaudit->items[parent_offset].item_id = bagitem->GetID();
@ -866,7 +866,7 @@ bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst,
if (client_update)
{
SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::inventory::slotCursor) ? ItemPacketLimbo : ItemPacketTrade));
//SendWearChange(Inventory::CalcMaterialFromSlot(slot_id));
//SendWearChange(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id));
}
if (slot_id == EQEmu::inventory::slotCursor) {
@ -934,7 +934,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
PutLootInInventory(EQEmu::inventory::slotCursor, *bagitem);
}
else {
auto bag_slot = Inventory::CalcSlotId(slot_id, index);
auto bag_slot = EQEmu::InventoryProfile::CalcSlotId(slot_id, index);
Log.Out(Logs::Detail, Logs::Inventory,
"Putting bag loot item %s (%d) into slot %d (bag slot %d)",
@ -966,7 +966,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 = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
uint16 slotid = Inventory::CalcSlotId(i, j);
uint16 slotid = EQEmu::InventoryProfile::CalcSlotId(i, j);
EQEmu::ItemInstance* tmp_inst = m_inv.GetItem(slotid);
if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize) {
@ -1018,7 +1018,7 @@ bool Client::AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn, bo
if (inst.IsEquipable(i)) { // Equippable at this slot?
//send worn to everyone...
PutLootInInventory(i, inst);
uint8 worn_slot_material = Inventory::CalcMaterialFromSlot(i);
uint8 worn_slot_material = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
if (worn_slot_material != EQEmu::textures::materialInvalid) {
SendWearChange(worn_slot_material);
}
@ -1518,8 +1518,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_END && src_inst->IsClassBag()){
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);
if (baginst && !database.VerifyInventory(account_id, EQEmu::InventoryProfile::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(src_slot_id, idx), 0, false);
}
}
}
@ -1533,8 +1533,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_END && dst_inst->IsClassBag()){
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);
if (baginst && !database.VerifyInventory(account_id, EQEmu::InventoryProfile::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(dst_slot_id, idx), 0, false);
}
}
}
@ -1576,7 +1576,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(m_tradeskill_object != nullptr) {
if (src_slot_id >= EQEmu::legacy::WORLD_BEGIN && src_slot_id <= EQEmu::legacy::WORLD_END) {
// Picking up item from world container
EQEmu::ItemInstance* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id));
EQEmu::ItemInstance* inst = m_tradeskill_object->PopItem(EQEmu::InventoryProfile::CalcBagIdx(src_slot_id));
if (inst) {
PutItemInInventory(dst_slot_id, *inst, false);
safe_delete(inst);
@ -1588,7 +1588,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
else if (dst_slot_id >= EQEmu::legacy::WORLD_BEGIN && dst_slot_id <= EQEmu::legacy::WORLD_END) {
// Putting item into world container, which may swap (or pile onto) with existing item
uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id);
uint8 world_idx = EQEmu::InventoryProfile::CalcBagIdx(dst_slot_id);
EQEmu::ItemInstance* world_inst = m_tradeskill_object->PopItem(world_idx);
// Case 1: No item in container, unidirectional "Put"
@ -1835,7 +1835,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
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::inventory::slotPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
// This prevents the client from crashing when closing any 'phantom' bags
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
@ -1860,7 +1860,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
}
else {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) {
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
@ -1878,7 +1878,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
}
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);
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
EQEmu::ItemInstance* token_inst = database.CreateItem(token_struct, 1);
@ -1902,7 +1902,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize destination slot %i.", move_slots->to_slot); }
}
else {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
int16 resync_slot = (EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : EQEmu::InventoryProfile::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) {
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
@ -1963,8 +1963,8 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
const EQEmu::ItemInstance* from_baginst = from_inst->GetItem(bag_idx);
if(from_baginst) {
qsaudit->items[move_count].from_slot = Inventory::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = Inventory::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].from_slot = EQEmu::InventoryProfile::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = EQEmu::InventoryProfile::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].item_id = from_baginst->GetID();
qsaudit->items[move_count].charges = from_baginst->GetCharges();
qsaudit->items[move_count].aug_1 = from_baginst->GetAugmentItemID(1);
@ -1996,8 +1996,8 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
const EQEmu::ItemInstance* to_baginst = to_inst->GetItem(bag_idx);
if(to_baginst) {
qsaudit->items[move_count].from_slot = Inventory::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = Inventory::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].from_slot = EQEmu::InventoryProfile::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = EQEmu::InventoryProfile::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].item_id = to_baginst->GetID();
qsaudit->items[move_count].charges = to_baginst->GetCharges();
qsaudit->items[move_count].aug_1 = to_baginst->GetAugmentItemID(1);
@ -2598,7 +2598,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
return 0;
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
{
return 0;
@ -2956,7 +2956,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
//
if (InvItem && InvItem->IsClassBag()) {
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
int16 BaseSlotID = EQEmu::InventoryProfile::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize=InvItem->GetItem()->BagSlots;
@ -3006,9 +3006,9 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
return true;
}
if (InvItem->IsClassBag() && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
if (InvItem->IsClassBag() && EQEmu::InventoryProfile::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
int16 BaseSlotID = EQEmu::InventoryProfile::CalcSlotId(i, EQEmu::inventory::containerBegin);
uint8 BagSize=InvItem->GetItem()->BagSlots;
@ -3272,7 +3272,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
return false;
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value) {
void EQEmu::InventoryProfile::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value) {
EQEmu::ItemInstance *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@ -3280,7 +3280,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value) {
void EQEmu::InventoryProfile::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value) {
EQEmu::ItemInstance *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@ -3288,7 +3288,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value) {
void EQEmu::InventoryProfile::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value) {
EQEmu::ItemInstance *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@ -3296,7 +3296,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value) {
void EQEmu::InventoryProfile::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value) {
EQEmu::ItemInstance *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@ -3304,7 +3304,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
std::string Inventory::GetCustomItemData(int16 slot_id, std::string identifier) {
std::string EQEmu::InventoryProfile::GetCustomItemData(int16 slot_id, std::string identifier) {
EQEmu::ItemInstance *inst = GetItem(slot_id);
if(inst) {
return inst->GetCustomData(identifier);

View File

@ -4,26 +4,30 @@
#include "lua_ptr.h"
class Inventory;
class Lua_ItemInst;
class Lua_Item;
namespace EQEmu
{
class InventoryProfile;
}
namespace luabind {
struct scope;
}
luabind::scope lua_register_inventory();
class Lua_Inventory : public Lua_Ptr<Inventory>
class Lua_Inventory : public Lua_Ptr<EQEmu::InventoryProfile>
{
typedef Inventory NativeType;
typedef EQEmu::InventoryProfile NativeType;
public:
Lua_Inventory() : Lua_Ptr(nullptr) { }
Lua_Inventory(Inventory *d) : Lua_Ptr(d) { }
Lua_Inventory(EQEmu::InventoryProfile *d) : Lua_Ptr(d) { }
virtual ~Lua_Inventory() { }
operator Inventory*() {
return reinterpret_cast<Inventory*>(GetLuaPtrData());
operator EQEmu::InventoryProfile*() {
return reinterpret_cast<EQEmu::InventoryProfile*>(GetLuaPtrData());
}
Lua_ItemInst GetItem(int slot_id);

View File

@ -5050,7 +5050,7 @@ void Merc::UpdateMercAppearance() {
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
if (materialFromSlot != EQEmu::textures::materialInvalid)
this->SendWearChange(materialFromSlot);
}

View File

@ -386,7 +386,7 @@ private:
uint8 _OwnerClientVersion;
uint32 _currentStance;
Inventory m_inv;
EQEmu::InventoryProfile m_inv;
int32 max_end;
int32 cur_end;
bool _medding;

View File

@ -2728,7 +2728,7 @@ uint32 NPC::GetEquipment(uint8 material_slot) const
{
if(material_slot > 8)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;
return equipment[invslot];
@ -2862,7 +2862,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
{
if (this->IsClient())
{
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
{
return 0;
@ -2907,7 +2907,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const EQEmu::ItemData *item;
item = database.GetItem(GetEquipment(material_slot));
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (item != 0 && invslot != INVALID_INDEX)
{

View File

@ -489,7 +489,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
{
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
material = EQEmu::InventoryProfile::CalcMaterialFromSlot((*cur)->equip_slot);
if (material != EQEmu::textures::materialInvalid)
SendWearChange(material);
@ -1381,7 +1381,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
if (material_slot >= EQEmu::textures::materialCount)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;

View File

@ -55,7 +55,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else
{
// Check to see if they have an inventory container type 53 that is used for this.
Inventory& user_inv = user->GetInv();
EQEmu::InventoryProfile& user_inv = user->GetInv();
EQEmu::ItemInstance* inst = nullptr;
inst = user_inv.GetItem(in_augment->container_slot);
@ -227,7 +227,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
const EQEmu::ItemInstance* inst = container->GetItem(i);
if (inst)
{
user->DeleteItemInInventory(Inventory::CalcSlotId(in_augment->container_slot,i),0,true);
user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_augment->container_slot, i), 0, true);
}
}
// Explicitly mark container as cleared.
@ -256,7 +256,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
return;
}
Inventory& user_inv = user->GetInv();
EQEmu::InventoryProfile& user_inv = user->GetInv();
PlayerProfile_Struct& user_pp = user->GetPP();
EQEmu::ItemInstance* container = nullptr;
EQEmu::ItemInstance* inst = nullptr;
@ -295,7 +295,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
if (inst && EQEmu::ItemInstance::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
const EQEmu::ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
user->DeleteItemInInventory(EQEmu::InventoryProfile::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::inventory::slotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
@ -315,7 +315,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const EQEmu::ItemInstance* inst = container->GetItem(0);
if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) {
const EQEmu::ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
user->DeleteItemInInventory(EQEmu::InventoryProfile::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::inventory::slotCursor, 0, 0);
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
@ -404,7 +404,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
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);
user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, i), 0, true);
}
}
container->Clear();
@ -501,7 +501,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
memset(counts, 0, sizeof(counts));
//search for all the items in their inventory
Inventory& user_inv = user->GetInv();
EQEmu::InventoryProfile& user_inv = user->GetInv();
uint8 count = 0;
uint8 needcount = 0;

View File

@ -174,7 +174,7 @@ void Trade::SendItemData(const EQEmu::ItemInstance* inst, int16 dest_slot_id)
with->SendItemPacket(dest_slot_id - EQEmu::legacy::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
uint16 bagslot_id = EQEmu::InventoryProfile::CalcSlotId(dest_slot_id, i);
const EQEmu::ItemInstance* bagitem = trader->GetInv().GetItem(bagslot_id);
if (bagitem) {
with->SendItemPacket(bagslot_id - EQEmu::legacy::TRADE_BEGIN, bagitem, ItemPacketTradeView);
@ -317,7 +317,7 @@ void Trade::DumpTrade()
if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
inst->GetItem()->ID, inst->GetCharges(),
Inventory::CalcSlotId(i, j));
EQEmu::InventoryProfile::CalcSlotId(i, j));
}
}
}
@ -530,9 +530,9 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_slot = Inventory::CalcSlotId(trade_slot, sub_slot);
detail->from_slot = EQEmu::InventoryProfile::CalcSlotId(trade_slot, sub_slot);
detail->to_id = other->CharacterID();
detail->to_slot = Inventory::CalcSlotId(free_slot, sub_slot);
detail->to_slot = EQEmu::InventoryProfile::CalcSlotId(free_slot, sub_slot);
detail->item_id = bag_inst->GetID();
detail->charges = (!bag_inst->IsStackable() ? 1 : bag_inst->GetCharges());
detail->aug_1 = bag_inst->GetAugmentItemID(1);
@ -849,7 +849,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
strcpy(detail->action_type, "HANDIN");
detail->char_slot = Inventory::CalcSlotId(trade_slot, sub_slot);
detail->char_slot = EQEmu::InventoryProfile::CalcSlotId(trade_slot, sub_slot);
detail->item_id = trade_baginst->GetID();
detail->charges = (!trade_inst->IsStackable() ? 1 : trade_inst->GetCharges());
detail->aug_1 = trade_baginst->GetAugmentItemID(1);
@ -1237,7 +1237,7 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
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);
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
if (item) {
if (item->GetID() == ItemID)
@ -1260,7 +1260,7 @@ EQEmu::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
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);
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
if(item) {
if(item->GetSerialNumber() == SerialNumber)
@ -1290,7 +1290,7 @@ GetItems_Struct* Client::GetTraderItems(){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
SlotID = Inventory::CalcSlotId(i, x);
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@ -1314,7 +1314,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++){
SlotID = Inventory::CalcSlotId(i, x);
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);

View File

@ -1167,7 +1167,7 @@ bool Zone::Process() {
if(spawn2_timer.Check()) {
LinkedListIterator<Spawn2*> iterator(spawn2_list);
Inventory::CleanDirty();
EQEmu::InventoryProfile::CleanDirty();
iterator.Reset();
while (iterator.MoreElements()) {