Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Bag Class Reference

#include <Bag.h>

Inheritance diagram for Bag:
Collaboration diagram for Bag:

Public Member Functions

void AddToWorld () OVERRIDE
 Bag ()
void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const OVERRIDE
bool Create (uint32 guidlow, uint32 itemid, Player const *owner) OVERRIDE
void DeleteFromDB (SQLTransaction &trans) OVERRIDE
uint32 GetBagSize () const
uint32 GetFreeSlots () const
ItemGetItemByPos (uint8 slot) const
uint32 GetItemCount (uint32 item, Item *eItem=NULL) const
uint32 GetItemCountWithLimitCategory (uint32 limitCategory, Item *skipItem=NULL) const
uint8 GetSlotByItemGUID (uint64 guid) const
bool IsEmpty () const
bool LoadFromDB (uint32 guid, uint64 owner_guid, Field *fields, uint32 entry) OVERRIDE
void RemoveFromWorld () OVERRIDE
void RemoveItem (uint8 slot, bool update)
void SaveToDB (SQLTransaction &trans) OVERRIDE
void StoreItem (uint8 slot, Item *pItem, bool update)
 ~Bag ()
Public Member Functions inherited from Item
void AddToUpdateQueueOf (Player *player)
void BuildUpdate (UpdateDataMapType &)
InventoryResult CanBeMergedPartlyWith (ItemTemplate const *proto) const
bool CanBeTraded (bool mail=false, bool trade=false) const
bool CanBeTransmogrified () const
bool CanTransmogrify () const
bool CheckSoulboundTradeExpire ()
void ClearEnchantment (EnchantmentSlot slot)
void ClearSoulboundTradeable (Player *currentOwner)
ItemCloneItem (uint32 count, Player const *player=NULL) const
void DeleteFromInventoryDB (SQLTransaction &trans)
void DeleteRefundDataFromDB (SQLTransaction *trans)
void FSetState (ItemUpdateState state)
bool GemsFitSockets () const
uint8 GetBagSlot () const
BagGetContainer ()
uint32 GetCount () const
uint32 GetEnchantmentCharges (EnchantmentSlot slot) const
uint32 GetEnchantmentDuration (EnchantmentSlot slot) const
uint32 GetEnchantmentId (EnchantmentSlot slot) const
uint8 GetGemCountWithID (uint32 GemID) const
uint8 GetGemCountWithLimitCategory (uint32 limitCategory) const
int32 GetItemRandomPropertyId () const
uint32 GetItemSuffixFactor () const
uint32 GetMaxStackCount () const
PlayerGetOwner () const
uint64 GetOwnerGUID () const
uint32 GetPaidExtendedCost () const
uint32 GetPaidMoney () const
uint32 GetPlayedTime ()
uint16 GetPos () const
uint16 GetQueuePos () const
int32 GetReforgableStat (ItemModType statType) const
uint32 GetRefundRecipient () const
uint32 GetScriptId () const
uint32 GetSkill ()
uint8 GetSlot () const
uint32 GetSpecialPrice (uint32 minimumPrice=10000) const
int32 GetSpellCharges (uint8 index=0) const
ItemUpdateState GetState () const
ItemTemplate const * GetTemplate () const
std::string const & GetText () const
uint32 GetVisibleEntry () const
bool HasEnchantRequiredSkill (const Player *player) const
bool hasInvolvedQuest (uint32) const
bool hasQuest (uint32 quest_id) const
bool HasStats () const
bool IsBag () const
bool IsBindedNotWith (Player const *player) const
bool IsBoundAccountWide () const
bool IsBoundByEnchant () const
bool IsBroken () const
bool IsConjuredConsumable () const
bool IsCurrencyToken () const
bool IsEquipped () const
bool IsFitToSpellRequirements (SpellInfo const *spellInfo) const
bool IsInBag () const
bool IsInTrade () const
bool IsInUpdateQueue () const
bool IsLimitedToAnotherMapOrZone (uint32 cur_mapId, uint32 cur_zoneId) const
bool IsLocked () const
bool IsNotEmptyBag () const
bool IsPotion () const
bool IsRangedWeapon () const
bool IsRefundExpired ()
bool IsSoulBound () const
bool IsVellum () const
 Item ()
void ItemContainerDeleteLootItemFromDB (uint32 itemID)
void ItemContainerDeleteLootItemsFromDB ()
void ItemContainerDeleteLootMoneyAndLootItemsFromDB ()
void ItemContainerDeleteLootMoneyFromDB ()
bool ItemContainerLoadLootFromDB ()
void ItemContainerSaveLootToDB ()
void RemoveFromUpdateQueueOf (Player *player)
void SaveRefundDataToDB ()
void SendTimeUpdate (Player *owner)
void SetBinding (bool val)
void SetContainer (Bag *container)
void SetCount (uint32 value)
void SetEnchantment (EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster=0)
void SetEnchantmentCharges (EnchantmentSlot slot, uint32 charges)
void SetEnchantmentDuration (EnchantmentSlot slot, uint32 duration, Player *owner)
void SetInTrade (bool b=true)
void SetItemRandomProperties (int32 randomPropId)
void SetNotRefundable (Player *owner, bool changestate=true, SQLTransaction *trans=NULL)
void SetOwnerGUID (uint64 guid)
void SetPaidExtendedCost (uint32 iece)
void SetPaidMoney (uint32 money)
void SetRefundRecipient (uint32 pGuidLow)
void SetSlot (uint8 slot)
void SetSoulboundTradeable (AllowedLooterSet const &allowedLooters)
void SetSpellCharges (uint8 index, int32 value)
void SetState (ItemUpdateState state, Player *forplayer=NULL)
void SetText (std::string const &text)
BagToBag ()
const BagToBag () const
void UpdateDuration (Player *owner, uint32 diff)
void UpdateItemSuffixFactor ()
void UpdatePlayedTime (Player *owner)
Public Member Functions inherited from Object
bool AddUInt64Value (uint16 index, uint64 value)
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
void ApplyPercentModFloatValue (uint16 index, float val, bool apply)
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target) const
void ClearUpdateMask (bool remove)
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
void ForceValuesUpdateAtIndex (uint32)
uint8 GetByteValue (uint16 index, uint8 offset) const
uint32 GetDynamicUInt32Value (uint32 tab, uint16 index) const
uint32 GetEntry () const
float GetFloatValue (uint16 index) const
uint64 GetGUID () const
uint32 GetGUIDHigh () const
uint32 GetGUIDLow () const
uint32 GetGUIDMid () const
int32 GetInt32Value (uint16 index) const
ObjectGuid GetObjectGUID () const
float GetObjectScale () const
const ByteBufferGetPackGUID () const
TypeID GetTypeId () const
uint16 GetUInt16Value (uint16 index, uint8 offset) const
uint32 GetUInt32Value (uint16 index) const
uint64 GetUInt64Value (uint16 index) const
uint16 GetValuesCount () const
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
bool HasFlag (uint16 index, uint32 flag) const
bool HasFlag64 (uint16 index, uint64 flag) const
bool IsInWorld () const
bool isType (uint16 mask) const
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
void RemoveFieldNotifyFlag (uint16 flag)
void RemoveFlag (uint16 index, uint32 oldFlag)
void RemoveFlag64 (uint16 index, uint64 oldFlag)
bool RemoveUInt64Value (uint16 index, uint64 value)
void SendDestroyObject (Player *target, ObjectGuid Guid, bool onDeath=false) const
void SendUpdateToPlayer (Player *player)
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
void SetByteValue (uint16 index, uint8 offset, uint8 value)
void SetDynamicUInt32Value (uint32 tab, uint16 index, uint32 value)
void SetEntry (uint32 entry)
void SetFieldNotifyFlag (uint16 flag)
void SetFlag (uint16 index, uint32 newFlag)
void SetFlag64 (uint16 index, uint64 newFlag)
void SetFloatValue (uint16 index, float value)
void SetInt16Value (uint16 index, uint8 offset, int16 value)
void SetInt32Value (uint16 index, int32 value)
virtual void SetObjectScale (float scale)
void SetStatFloatValue (uint16 index, float value)
void SetStatInt32Value (uint16 index, int32 value)
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
void SetUInt32Value (uint16 index, uint32 value)
void SetUInt64Value (uint16 index, uint64 value)
AreaTriggerToAreaTrigger ()
AreaTrigger const * ToAreaTrigger () const
CorpseToCorpse ()
Corpse const * ToCorpse () const
CreatureToCreature ()
Creature const * ToCreature () const
DynamicObjectToDynObject ()
DynamicObject const * ToDynObject () const
GameObjectToGameObject ()
GameObject const * ToGameObject () const
void ToggleByteFlag (uint16 index, uint8 offset, uint8 flag)
void ToggleFlag (uint16 index, uint32 flag)
void ToggleFlag64 (uint16 index, uint64 flag)
PlayerToPlayer ()
Player const * ToPlayer () const
UnitToUnit ()
Unit const * ToUnit () const
void UpdateUInt32Value (uint16 index, uint32 value)
virtual ~Object ()

Protected Attributes

Itemm_bagslot [MAX_BAG_SIZE]
Protected Attributes inherited from Object
union { 
   float *   m_floatValues 
   int32 *   m_int32Values 
   uint32 *   m_uint32Values 
}; 
UpdateMask _changesMask
std::vector< bool * > m_dynamicChange
std::vector< uint32 * > m_dynamicTab
uint16 m_fieldNotifyFlags
uint16 m_objectType
TypeID m_objectTypeId
bool m_objectUpdated
uint16 m_updateFlag
uint16 m_valuesCount

Additional Inherited Members

Static Public Member Functions inherited from Item
static bool CanTransmogrifyItemWithItem (Item const *transmogrified, Item const *transmogrifier)
static ItemCreateItem (uint32 itemEntry, uint32 count, Player const *player=NULL)
static void DeleteFromDB (SQLTransaction &trans, uint32 itemGuid)
static void DeleteFromInventoryDB (SQLTransaction &trans, uint32 itemGuid)
static int32 GenerateItemRandomPropertyId (uint32 item_id)
static uint32 GetSellPrice (ItemTemplate const *proto, bool &success)
static uint32 GetSpecialPrice (ItemTemplate const *proto, uint32 minimumPrice=10000)
Public Attributes inherited from Item
Loot loot
bool m_lootGenerated
Protected Member Functions inherited from Object
std::string _ConcatFields (uint16 startIndex, uint16 size) const
void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh)
void _InitValues ()
void _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
void BuildDynamicValuesUpdate (uint8 updateType, ByteBuffer *data, Player *target) const
void BuildMovementUpdate (ByteBuffer *data, uint16 flags) const
virtual void BuildValuesUpdate (uint8 updatetype, ByteBuffer *data, Player *target) const
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
 Object ()

Detailed Description

Definition at line 15 of file Bag.h.

Constructor & Destructor Documentation

◆ Bag()

◆ ~Bag()

Bag::~Bag ( )

Member Function Documentation

◆ AddToWorld()

void Bag::AddToWorld ( )
virtual

Reimplemented from Object.

Definition at line 41 of file Bag.cpp.

References Object::AddToWorld(), GetBagSize(), and m_bagslot.

◆ BuildCreateUpdateBlockForPlayer()

void Bag::BuildCreateUpdateBlockForPlayer ( UpdateData * data,
Player * target ) const
virtual

Reimplemented from Object.

Definition at line 159 of file Bag.cpp.

References Object::BuildCreateUpdateBlockForPlayer(), GetBagSize(), and m_bagslot.

◆ Create()

◆ DeleteFromDB()

void Bag::DeleteFromDB ( SQLTransaction & trans)
virtual

Reimplemented from Item.

Definition at line 114 of file Bag.cpp.

References Item::DeleteFromDB(), m_bagslot, and MAX_BAG_SIZE.

◆ GetBagSize()

◆ GetFreeSlots()

uint32 Bag::GetFreeSlots ( ) const

Definition at line 123 of file Bag.cpp.

References GetBagSize(), and m_bagslot.

◆ GetItemByPos()

Item * Bag::GetItemByPos ( uint8 slot) const

Definition at line 225 of file Bag.cpp.

References GetBagSize(), Item::Item(), and m_bagslot.

Referenced by Player::SwapItem().

◆ GetItemCount()

◆ GetItemCountWithLimitCategory()

uint32 Bag::GetItemCountWithLimitCategory ( uint32 limitCategory,
Item * skipItem = NULL ) const

Definition at line 202 of file Bag.cpp.

References GetBagSize(), Item::Item(), and m_bagslot.

◆ GetSlotByItemGUID()

uint8 Bag::GetSlotByItemGUID ( uint64 guid) const

Definition at line 215 of file Bag.cpp.

References GetBagSize(), Object::GetGUID(), m_bagslot, and NULL_SLOT.

◆ IsEmpty()

bool Bag::IsEmpty ( ) const

Definition at line 169 of file Bag.cpp.

References GetBagSize(), and m_bagslot.

Referenced by Player::SwapItem().

◆ LoadFromDB()

bool Bag::LoadFromDB ( uint32 guid,
uint64 owner_guid,
Field * fields,
uint32 entry )
virtual

◆ RemoveFromWorld()

void Bag::RemoveFromWorld ( )
virtual

Reimplemented from Object.

Definition at line 50 of file Bag.cpp.

References GetBagSize(), m_bagslot, and Object::RemoveFromWorld().

◆ RemoveItem()

void Bag::RemoveItem ( uint8 slot,
bool update )

Definition at line 133 of file Bag.cpp.

References ASSERT, CONTAINER_FIELD_SLOTS, m_bagslot, MAX_BAG_SIZE, and Object::SetUInt64Value().

Referenced by Player::SwapItem().

◆ SaveToDB()

void Bag::SaveToDB ( SQLTransaction & trans)
virtual

Reimplemented from Item.

Definition at line 91 of file Bag.cpp.

References Item::SaveToDB().

◆ StoreItem()

Member Data Documentation

◆ m_bagslot


The documentation for this class was generated from the following files:
  • src/server/game/Entities/Item/Container/Bag.h
  • src/server/game/Entities/Item/Container/Bag.cpp