Core/ObjectMgr: Refactor sItemStorage
This commit is contained in:
@@ -1171,7 +1171,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
void SetVirtualItemSlot(uint8 i, Item* item);
|
||||
void SetSheath(SheathState sheathed); // overwrite Unit version
|
||||
uint8 FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) const;
|
||||
uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const;
|
||||
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
|
||||
Item* GetItemByGuid(uint64 guid) const;
|
||||
@@ -1224,13 +1224,13 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint8 CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading = true) const;
|
||||
|
||||
uint8 CanEquipUniqueItem(Item * pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const;
|
||||
uint8 CanEquipUniqueItem(ItemPrototype const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const;
|
||||
uint8 CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const;
|
||||
uint8 CanUnequipItems(uint32 item, uint32 count) const;
|
||||
uint8 CanUnequipItem(uint16 src, bool swap) const;
|
||||
uint8 CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item *pItem, bool swap, bool not_loading = true) const;
|
||||
uint8 CanUseItem(Item *pItem, bool not_loading = true) const;
|
||||
bool HasItemTotemCategory(uint32 TotemCategory) const;
|
||||
uint8 CanUseItem(ItemPrototype const *pItem) const;
|
||||
uint8 CanUseItem(ItemTemplate const *pItem) const;
|
||||
uint8 CanUseAmmo(uint32 item) const;
|
||||
Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0, AllowedLooterSet* allowedLooters = NULL);
|
||||
Item* StoreItem(ItemPosCountVec const& pos, Item *pItem, bool update);
|
||||
@@ -1252,7 +1252,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetAmmo(uint32 item);
|
||||
void RemoveAmmo();
|
||||
float GetAmmoDPS() const { return m_ammoDPS; }
|
||||
bool CheckAmmoCompatibility(const ItemPrototype *ammo_proto) const;
|
||||
bool CheckAmmoCompatibility(const ItemTemplate *ammo_proto) const;
|
||||
void QuickEquipItem(uint16 pos, Item *pItem);
|
||||
void VisualizeItem(uint8 slot, Item *pItem);
|
||||
void SetVisibleItemSlot(uint8 slot, Item *pItem);
|
||||
@@ -1293,11 +1293,11 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool IsTwoHandUsed() const
|
||||
{
|
||||
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||
return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
|
||||
return mainItem && mainItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
|
||||
}
|
||||
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast = false);
|
||||
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
||||
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemPrototype const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore);
|
||||
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore);
|
||||
|
||||
float GetReputationPriceDiscount(Creature const* pCreature) const;
|
||||
|
||||
@@ -1813,7 +1813,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint32 GetBaseDefenseSkillValue() const { return GetBaseSkillValue(SKILL_DEFENSE); }
|
||||
uint32 GetBaseWeaponSkillValue(WeaponAttackType attType) const;
|
||||
|
||||
uint32 GetSpellByProto(ItemPrototype *proto);
|
||||
uint32 GetSpellByProto(ItemTemplate *proto);
|
||||
|
||||
float GetHealthBonusFromStamina();
|
||||
float GetManaBonusFromIntellect();
|
||||
@@ -2047,8 +2047,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void _RemoveAllItemMods();
|
||||
void _ApplyAllItemMods();
|
||||
void _ApplyAllLevelScaleItemMods(bool apply);
|
||||
void _ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply, bool only_level_scale = false);
|
||||
void _ApplyWeaponDamage(uint8 slot, ItemPrototype const *proto, ScalingStatValuesEntry const *ssv, bool apply);
|
||||
void _ApplyItemBonuses(ItemTemplate const *proto,uint8 slot,bool apply, bool only_level_scale = false);
|
||||
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply);
|
||||
void _ApplyAmmoBonuses();
|
||||
bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot);
|
||||
void ToggleMetaGemsActive(uint8 exceptslot, bool apply);
|
||||
@@ -2060,7 +2060,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateEquipSpellsAtFormChange();
|
||||
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx);
|
||||
void CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex);
|
||||
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemPrototype const * proto);
|
||||
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemTemplate const * proto);
|
||||
|
||||
void SendEquipmentSetList();
|
||||
void SetEquipmentSet(uint32 index, EquipmentSet eqset);
|
||||
@@ -2687,9 +2687,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool isAlwaysDetectableFor(WorldObject const* seer) const;
|
||||
private:
|
||||
// internal common parts for CanStore/StoreItem functions
|
||||
uint8 _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool swap, Item *pSrcItem) const;
|
||||
uint8 _CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
|
||||
uint8 _CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
|
||||
uint8 _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool swap, Item *pSrcItem) const;
|
||||
uint8 _CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
|
||||
uint8 _CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
|
||||
Item* _StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool update);
|
||||
Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields);
|
||||
|
||||
@@ -2759,7 +2759,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
};
|
||||
|
||||
void AddItemsSetItem(Player*player,Item *item);
|
||||
void RemoveItemsSetItem(Player*player,ItemPrototype const *proto);
|
||||
void RemoveItemsSetItem(Player*player,ItemTemplate const *proto);
|
||||
|
||||
// "the bodies of template functions must be made available in a header file"
|
||||
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
|
||||
|
||||
Reference in New Issue
Block a user