|
| BankMoveItemData (Guild *guild, Player *player, uint8 container, uint8 slotId) |
|
bool | IsBank () const override |
|
bool | InitItem () override |
|
bool | HasStoreRights (MoveItemData *pOther) const override |
|
bool | HasWithdrawRights (MoveItemData *pOther) const override |
|
void | RemoveItem (CharacterDatabaseTransaction trans, MoveItemData *pOther, uint32 splitedAmount) override |
|
Item * | StoreItem (CharacterDatabaseTransaction trans, Item *pItem) override |
|
void | LogBankEvent (CharacterDatabaseTransaction trans, MoveItemData *pFrom, uint32 count) const override |
|
void | LogAction (MoveItemData *pFrom) const override |
|
| MoveItemData (Guild *guild, Player *player, uint8 container, uint8 slotId) |
|
virtual | ~MoveItemData () |
|
virtual bool | CheckItem (uint32 &splitedAmount) |
|
bool | CanStore (Item *pItem, bool swap, bool sendError) |
|
bool | CloneItem (uint32 count) |
|
void | CopySlots (SlotIds &ids) const |
|
Item * | GetItem (bool isCloned=false) const |
|
uint8 | GetContainer () const |
|
uint8 | GetSlotId () const |
|
|
Item * | _StoreItem (CharacterDatabaseTransaction trans, BankTab *pTab, Item *pItem, ItemPosCount &pos, bool clone) const |
|
bool | _ReserveSpace (uint8 slotId, Item *pItem, Item *pItemDest, uint32 &count) |
|
void | CanStoreItemInTab (Item *pItem, uint8 skipSlotId, bool merge, uint32 &count) |
|
◆ BankMoveItemData()
Guild::BankMoveItemData::BankMoveItemData |
( |
Guild * |
guild, |
|
|
Player * |
player, |
|
|
uint8 |
container, |
|
|
uint8 |
slotId |
|
) |
| |
|
inline |
654 :
MoveItemData(Guild *guild, Player *player, uint8 container, uint8 slotId)
Definition Guild.h:592
◆ _ReserveSpace()
bool Guild::BankMoveItemData::_ReserveSpace |
( |
uint8 |
slotId, |
|
|
Item * |
pItem, |
|
|
Item * |
pItemDest, |
|
|
uint32 & |
count |
|
) |
| |
|
private |
942{
944 if (pItemDest)
945 {
946
948 return false;
949 requiredSpace -= pItemDest->
GetCount();
950 }
951
952 requiredSpace = std::min(requiredSpace, count);
953
954
956 if (!pos.isContainedIn(
m_vec))
957 {
958 m_vec.push_back(pos);
959 count -= requiredSpace;
960 }
961 return true;
962}
std::uint32_t uint32
Definition Define.h:107
ItemPosCountVec m_vec
Definition Guild.h:633
uint32 GetCount() const
Definition Item.h:272
uint32 GetMaxStackCount() const
Definition Item.h:274
uint32 GetEntry() const
Definition Object.h:115
References Item::GetCount(), Object::GetEntry(), Item::GetMaxStackCount(), and ItemPosCount::isContainedIn().
◆ _StoreItem()
909{
912 if (
Item* pItemDest = pTab->GetItem(slotId))
913 {
914 pItemDest->SetCount(pItemDest->GetCount() + count);
916 pItemDest->SaveToDB(trans);
917 if (!clone)
918 {
921 delete pItem;
922 }
923 return pItemDest;
924 }
925
926 if (clone)
928 else
930
931 if (pItem && pTab->SetItem(trans, slotId, pItem))
932 return pItem;
933
934 return nullptr;
935}
std::uint8_t uint8
Definition Define.h:109
@ ITEM_CHANGED
Definition Item.h:210
Item * CloneItem(uint32 count, Player const *player=nullptr) const
Definition Item.cpp:1118
void SetCount(uint32 value)
Definition Item.h:273
static void DeleteFromDB(CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
Definition Item.cpp:518
virtual void RemoveFromWorld()
Definition Object.cpp:166
uint32 count
Definition Player.h:774
uint16 pos
Definition Player.h:773
References Item::CloneItem(), ItemPosCount::count, Item::DeleteFromDB(), Guild::BankTab::GetItem(), ITEM_CHANGED, ItemPosCount::pos, Object::RemoveFromWorld(), Item::SetCount(), and Guild::BankTab::SetItem().
◆ CanStore()
Implements Guild::MoveItemData.
985{
986 LOG_DEBUG(
"guild",
"GUILD STORAGE: CanStore() tab = {}, slot = {}, item = {}, count = {}",
989
992
993
996
997
1000
1001
1003 {
1005
1006 if ((pItemDest == pItem) || swap)
1007 pItemDest = nullptr;
1008
1011
1012 if (count == 0)
1014 }
1015
1016
1017
1019 {
1021 if (count == 0)
1023 }
1024
1025
1027 if (count == 0)
1029
1031}
@ EQUIP_ERR_BANK_FULL
Definition Item.h:98
@ EQUIP_ERR_CANT_DROP_SOULBOUND
Definition Item.h:71
@ EQUIP_ERR_OK
Definition Item.h:47
@ EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG
Definition Item.h:62
@ EQUIP_ERR_ITEM_CANT_STACK
Definition Item.h:66
@ EQUIP_ERR_ITEMS_CANT_BE_SWAPPED
Definition Item.h:68
@ NULL_SLOT
Definition Item.h:41
#define LOG_DEBUG(filterType__,...)
Definition Log.h:169
bool _ReserveSpace(uint8 slotId, Item *pItem, Item *pItemDest, uint32 &count)
Definition Guild.cpp:941
void CanStoreItemInTab(Item *pItem, uint8 skipSlotId, bool merge, uint32 &count)
Definition Guild.cpp:964
uint8 m_slotId
Definition Guild.h:630
Guild * m_pGuild
Definition Guild.h:627
uint8 m_container
Definition Guild.h:629
uint8 _GetPurchasedTabsSize() const
Definition Guild.h:816
Item * _GetItem(uint8 tabId, uint8 slotId) const
Definition Guild.cpp:2641
ItemTemplate const * GetTemplate() const
Definition Item.cpp:544
bool IsSoulBound() const
Definition Item.h:236
uint32 Duration
Definition ItemTemplate.h:686
References ItemTemplate::Duration, EQUIP_ERR_BANK_FULL, EQUIP_ERR_CANT_DROP_SOULBOUND, EQUIP_ERR_ITEM_CANT_STACK, EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG, EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, EQUIP_ERR_OK, Item::GetCount(), Object::GetEntry(), Item::GetMaxStackCount(), Item::GetTemplate(), Item::IsSoulBound(), LOG_DEBUG, and NULL_SLOT.
◆ CanStoreItemInTab()
void Guild::BankMoveItemData::CanStoreItemInTab |
( |
Item * |
pItem, |
|
|
uint8 |
skipSlotId, |
|
|
bool |
merge, |
|
|
uint32 & |
count |
|
) |
| |
|
private |
965{
967 {
968
969 if (slotId == skipSlotId)
970 continue;
971
973 if (pItemDest == pItem)
974 pItemDest = nullptr;
975
976
977 if ((pItemDest != nullptr) != merge)
978 continue;
979
981 }
982}
@ GUILD_BANK_MAX_SLOTS
Definition Guild.h:43
References GUILD_BANK_MAX_SLOTS.
◆ HasStoreRights()
bool Guild::BankMoveItemData::HasStoreRights |
( |
MoveItemData * |
pOther | ) |
const |
|
overridevirtual |
◆ HasWithdrawRights()
bool Guild::BankMoveItemData::HasWithdrawRights |
( |
MoveItemData * |
pOther | ) |
const |
|
overridevirtual |
◆ InitItem()
bool Guild::BankMoveItemData::InitItem |
( |
| ) |
|
|
overridevirtual |
◆ IsBank()
bool Guild::BankMoveItemData::IsBank |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ LogAction()
void Guild::BankMoveItemData::LogAction |
( |
MoveItemData * |
pFrom | ) |
const |
|
overridevirtual |
◆ LogBankEvent()
Implements Guild::MoveItemData.
891{
893 if (pFrom->IsBank())
894
897 else
898
900 pFrom->GetItem()->
GetEntry(), count);
901}
@ GUILD_BANK_LOG_MOVE_ITEM
Definition Guild.h:199
@ GUILD_BANK_LOG_DEPOSIT_ITEM
Definition Guild.h:197
void _LogBankEvent(CharacterDatabaseTransaction trans, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid playerGuid, uint32 itemOrMoney, uint16 itemStackCount=0, uint8 destTabId=0)
Definition Guild.cpp:2620
uint32 GetEntry() const
Definition ObjectGuid.h:144
References ASSERT, Guild::MoveItemData::GetContainer(), Object::GetEntry(), Guild::MoveItemData::GetItem(), GUILD_BANK_LOG_DEPOSIT_ITEM, GUILD_BANK_LOG_MOVE_ITEM, and Guild::MoveItemData::IsBank().
◆ RemoveItem()
Implements Guild::MoveItemData.
850{
852 if (splitedAmount)
853 {
857 }
858 else
859 {
862 }
863
864 if (!pOther->IsBank() || pOther->GetContainer() !=
m_container)
866}
void _RemoveItem(CharacterDatabaseTransaction trans, uint8 tabId, uint8 slotId)
Definition Guild.cpp:2648
void _UpdateMemberWithdrawSlots(CharacterDatabaseTransaction trans, ObjectGuid guid, uint8 tabId)
Definition Guild.cpp:2586
virtual void SaveToDB(CharacterDatabaseTransaction trans)
Definition Item.cpp:336
void FSetState(ItemUpdateState state)
Definition Item.h:330
References ASSERT, Guild::MoveItemData::GetContainer(), Guild::MoveItemData::IsBank(), and ITEM_CHANGED.
◆ StoreItem()
Implements Guild::MoveItemData.
869{
870 if (!pItem)
871 return nullptr;
872
874 if (!pTab)
875 return nullptr;
876
877 Item* pLastItem = pItem;
878 for (ItemPosCountVec::const_iterator itr =
m_vec.begin(); itr !=
m_vec.end(); )
879 {
881 ++itr;
882
883 LOG_DEBUG(
"guild",
"GUILD STORAGE: StoreItem tab = {}, slot = {}, item = {}, count = {}",
886 }
887 return pLastItem;
888}
Item * _StoreItem(CharacterDatabaseTransaction trans, BankTab *pTab, Item *pItem, ItemPosCount &pos, bool clone) const
Definition Guild.cpp:908
BankTab * GetBankTab(uint8 tabId)
Definition Guild.h:817
References Item::GetCount(), Object::GetEntry(), and LOG_DEBUG.
The documentation for this class was generated from the following files:
- azerothcore-wotlk/src/server/game/Guilds/Guild.h
- azerothcore-wotlk/src/server/game/Guilds/Guild.cpp