![]() |
TrinityCore
|
#include <Loot.h>
Public Member Functions | |
| NotNormalLootItemMap const & | GetPlayerFFAItems () const |
| Loot (Map *map, ObjectGuid owner, LootType type, Group const *group) | |
| ~Loot () | |
| Loot (Loot const &)=delete | |
| Loot (Loot &&)=delete | |
| Loot & | operator= (Loot const &)=delete |
| Loot & | operator= (Loot &&)=delete |
| ObjectGuid const & | GetGUID () const |
| ObjectGuid const & | GetOwnerGUID () const |
| ItemContext | GetItemContext () const |
| void | SetItemContext (ItemContext context) |
| LootMethod | GetLootMethod () const |
| ObjectGuid const & | GetLootMasterGUID () const |
| uint32 | GetDungeonEncounterId () const |
| void | SetDungeonEncounterId (uint32 dungeonEncounterId) |
| bool | isLooted () const |
| bool | IsChanged () const |
| void | NotifyLootList (Map const *map) const |
| void | NotifyItemRemoved (uint8 lootListId, Map const *map) |
| void | NotifyMoneyRemoved (Map const *map) |
| void | OnLootOpened (Map *map, Player *looter) |
| void | AddLooter (ObjectGuid GUID) |
| void | RemoveLooter (ObjectGuid GUID) |
| bool | HasAllowedLooter (ObjectGuid const &looter) const |
| void | generateMoneyLoot (uint32 minAmount, uint32 maxAmount) |
| bool | FillLoot (uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT, ItemContext context=ItemContext::NONE) |
| void | FillNotNormalLootFor (Player *player) |
| void | AddItem (LootStoreItem const &item) |
| bool | AutoStore (Player *player, uint8 bag, uint8 slot, bool broadcast=false, bool pushed=false, bool createdByPlayer=false) |
| void | AutoStoreTrackingQuests (Player *player, NotNormalLootItemList &ffaItems) |
| void | LootMoney () |
| LootItem const * | GetItemInSlot (uint32 lootListId) const |
| LootItem * | LootItemInSlot (uint32 lootListId, Player const *player, NotNormalLootItem **ffaItem=nullptr) |
| bool | hasItemForAll () const |
| bool | hasItemFor (Player const *player) const |
| bool | hasOverThresholdItem () const |
| void | BuildLootResponse (WorldPackets::Loot::LootResponse &packet, Player const *viewer) const |
| void | Update () |
Public Attributes | |
| std::vector< LootItem > | items |
| uint32 | gold |
| uint8 | unlootedCount |
| ObjectGuid | roundRobinPlayer |
| LootType | loot_type |
Private Attributes | |
| GuidSet | PlayersLooting |
| NotNormalLootItemMap | PlayerFFAItems |
| ObjectGuid | _guid |
| ObjectGuid | _owner |
| ItemContext | _itemContext |
| LootMethod | _lootMethod |
| std::unordered_map< uint32, LootRoll > | _rolls |
| ObjectGuid | _lootMaster |
| GuidUnorderedSet | _allowedLooters |
| bool | _wasOpened |
| bool | _changed |
| uint32 | _dungeonEncounterId |
|
explicit |
| Loot::~Loot | ( | ) |
Definition at line 728 of file Loot.cpp.
References ObjectAccessor::FindConnectedPlayer(), and PlayersLooting.
|
delete |
|
delete |
| void Loot::AddItem | ( | LootStoreItem const & | item | ) |
Definition at line 929 of file Loot.cpp.
References _itemContext, LootItem::BonusListIDs, LootItem::context, LootItem::count, LootStoreItem::Currency, ItemBonusMgr::GetBonusListsForItem(), ItemTemplate::GetMaxStackSize(), LootStoreItem::Item, LootItem::itemid, LootStoreItem::itemid, items, LootItem::LootListId, MAX_NR_LOOT_ITEMS, LootStoreItem::maxcount, LootStoreItem::mincount, sObjectMgr, LootStoreItem::TrackingQuest, LootStoreItem::type, and urand().
Referenced by LootTemplate::Process(), and LootTemplate::LootGroup::Process().
|
inline |
Definition at line 319 of file Loot.h.
Referenced by OnLootOpened().
| bool Loot::AutoStore | ( | Player * | player, |
| uint8 | bag, | ||
| uint8 | slot, | ||
| bool | broadcast = false, |
||
| bool | pushed = false, |
||
| bool | createdByPlayer = false |
||
| ) |
Definition at line 976 of file Loot.cpp.
References Player::ApplyItemLootedSpell(), LootItem::BonusListIDs, Player::CanStoreNewItem(), LootItem::context, LootItem::count, Currency, EQUIP_ERR_OK, LootItem::freeforall, GetDungeonEncounterId(), BaseEntity::GetGUID(), GetGUID(), LootItem::HasAllowedLooter(), LootItem::is_blocked, LootItem::is_looted, NotNormalLootItem::is_looted, ObjectGuid::IsEmpty(), Item, LootItem::itemid, items, Loot, LootItemInSlot(), Player::ModifyCurrency(), NULL_BAG, NULL_SLOT, LootItem::randomBonusListId, Player::RewardQuest(), LootItem::rollWinnerGUID, Player::SendEquipError(), Player::SendNewItem(), sObjectMgr, Player::StoreNewItem(), TrackingQuest, LootItem::type, and unlootedCount.
Referenced by Player::AutoStoreLoot(), LootRoll::Finish(), and GameObject::Use().
| void Loot::AutoStoreTrackingQuests | ( | Player * | player, |
| NotNormalLootItemList & | ffaItems | ||
| ) |
Definition at line 1046 of file Loot.cpp.
References Item, items, Player::RewardQuest(), sObjectMgr, TrackingQuest, and unlootedCount.
Referenced by OnLootOpened().
| void Loot::BuildLootResponse | ( | WorldPackets::Loot::LootResponse & | packet, |
| Player const * | viewer | ||
| ) | const |
Definition at line 1148 of file Loot.cpp.
References WorldPackets::Loot::LootResponse::Coins, WorldPackets::Loot::LootResponse::Currencies, Currency, WorldPackets::Loot::LootCurrency::CurrencyID, Unit::GetTotalAuraMultiplierByMiscValue(), gold, WorldPackets::Item::ItemInstance::Initialize(), Item, items, WorldPackets::Loot::LootResponse::Items, WorldPackets::Loot::LootItemData::Loot, WorldPackets::Loot::LootItemData::LootListID, WorldPackets::Loot::LootCurrency::LootListID, WorldPackets::Loot::LootItemData::Quantity, WorldPackets::Loot::LootCurrency::Quantity, sCurrencyTypesStore, SPELL_AURA_MOD_CURRENCY_CATEGORY_GAIN_PCT, WorldPackets::Loot::LootItemData::Type, WorldPackets::Loot::LootItemData::UIType, and WorldPackets::Loot::LootCurrency::UIType.
Referenced by Player::SendLoot().
| bool Loot::FillLoot | ( | uint32 | lootId, |
| LootStore const & | store, | ||
| Player * | lootOwner, | ||
| bool | personal, | ||
| bool | noEmptyError = false, |
||
| uint16 | lootMode = LOOT_MODE_DEFAULT, |
||
| ItemContext | context = ItemContext::NONE |
||
| ) |
Definition at line 859 of file Loot.cpp.
References _itemContext, _lootMethod, FillNotNormalLootFor(), Player::GetGroup(), BaseEntity::GetGUID(), LootStore::GetLootFor(), Group::GetLootThreshold(), Group::GetMembers(), LootStore::GetName(), GROUP_LOOT, Player::IsAtGroupRewardDistance(), LootStore::IsRatesAllowed(), Item, items, LOOT_CORPSE, loot_type, MASTER_LOOT, MAX_NR_LOOT_ITEMS, NEED_BEFORE_GREED, LootTemplate::Process(), roundRobinPlayer, sObjectMgr, and TC_LOG_ERROR.
Referenced by Player::AutoStoreLoot(), Spell::EffectSkinning(), LootRoll::Finish(), GameObject::GetFishLoot(), GameObject::GetFishLootJunk(), WorldSession::HandleOpenItemOpcode(), Unit::Kill(), MailDraft::prepareItems(), and GameObject::Use().
| void Loot::FillNotNormalLootFor | ( | Player * | player | ) |
Definition at line 1200 of file Loot.cpp.
References _allowedLooters, BaseEntity::GetGUID(), items, PlayerFFAItems, and unlootedCount.
Referenced by FillLoot().
Definition at line 845 of file Loot.cpp.
References gold, RATE_DROP_MONEY, sWorld, and urand().
Referenced by WorldSession::HandleOpenItemOpcode(), Unit::Kill(), and GameObject::Use().
|
inline |
Definition at line 309 of file Loot.h.
Referenced by AutoStore(), WorldSession::HandleLootMasterGiveOpcode(), LootRoll::SendAllPassed(), LootRoll::SendLootRollWon(), LootRoll::SendRoll(), LootRoll::SendStartRoll(), and Player::StoreLootItem().
|
inline |
Definition at line 303 of file Loot.h.
Referenced by AutoStore(), WorldSession::DoLootRelease(), LootRoll::IsLootItem(), NotifyItemRemoved(), NotifyLootList(), NotifyMoneyRemoved(), OnLootOpened(), LootRoll::SendAllPassed(), Player::SendLoot(), LootRoll::SendLootRollWon(), LootRoll::SendRoll(), LootRoll::SendStartRoll(), and Player::StoreLootItem().
|
inline |
|
inline |
Definition at line 308 of file Loot.h.
Referenced by LootItem::GetUiTypeForPlayer(), LootItem::ItemAllowedForPlayer(), and NotifyLootList().
|
inline |
Definition at line 307 of file Loot.h.
Referenced by LootItem::GetUiTypeForPlayer(), WorldSession::HandleLootMasterGiveOpcode(), Player::isAllowedToLoot(), LootItem::ItemAllowedForPlayer(), NotifyLootList(), Player::SendLoot(), and LootRoll::SendStartRoll().
|
inline |
Definition at line 304 of file Loot.h.
Referenced by WorldSession::DoLootRelease(), LootRoll::Finish(), WorldSession::HandleAutostoreLootItemOpcode(), WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleLootMoneyOpcode(), NotifyItemRemoved(), NotifyLootList(), Player::SendLoot(), and Player::StoreLootItem().
|
inline |
Definition at line 287 of file Loot.h.
Referenced by npc_commandscript::_ShowLootContents(), LootItem::GetUiTypeForPlayer(), and hasItemFor().
| bool Loot::HasAllowedLooter | ( | ObjectGuid const & | looter | ) | const |
Definition at line 840 of file Loot.cpp.
References _allowedLooters.
Referenced by WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleLootMoneyOpcode(), and Player::isAllowedToLoot().
| bool Loot::hasItemFor | ( | Player const * | player | ) | const |
Definition at line 1122 of file Loot.cpp.
References BaseEntity::GetGUID(), GetPlayerFFAItems(), NotNormalLootItem::is_looted, items, and Trinity::Containers::MapGetValuePtr().
Referenced by Player::isAllowedToLoot().
| bool Loot::hasItemForAll | ( | ) | const |
Definition at line 1109 of file Loot.cpp.
Referenced by Player::isAllowedToLoot().
| bool Loot::hasOverThresholdItem | ( | ) | const |
Definition at line 1137 of file Loot.cpp.
References items.
Referenced by Player::isAllowedToLoot(), and NotifyLootList().
|
inline |
Definition at line 312 of file Loot.h.
Referenced by LootItemStorage::AddNewStoredLoot(), Spell::CheckCast(), WorldSession::DoLootRelease(), GameObject::GetFishLoot(), GameObject::GetFishLootJunk(), WorldSession::HandleAutostoreLootItemOpcode(), WorldSession::HandleLootMoneyOpcode(), npc_commandscript::HandleNpcShowLootCommand(), Player::isAllowedToLoot(), and Unit::Kill().
| LootItem * Loot::LootItemInSlot | ( | uint32 | lootListId, |
| Player const * | player, | ||
| NotNormalLootItem ** | ffaItem = nullptr |
||
| ) |
Definition at line 1074 of file Loot.cpp.
References _changed, LootItem::freeforall, BaseEntity::GetGUID(), LootItem::is_looted, items, and PlayerFFAItems.
Referenced by AutoStore(), LootRoll::Finish(), MailDraft::prepareItems(), and Player::StoreLootItem().
| void Loot::LootMoney | ( | ) |
Definition at line 1060 of file Loot.cpp.
References _changed, and gold.
Referenced by WorldSession::HandleLootMoneyOpcode().
Definition at line 756 of file Loot.cpp.
References LootItem::GetAllowedLooters(), GetGUID(), GetOwnerGUID(), ObjectAccessor::GetPlayer(), items, and PlayersLooting.
Referenced by LootRoll::Finish(), WorldSession::HandleLootMasterGiveOpcode(), and Player::StoreLootItem().
| void Loot::NotifyLootList | ( | Map const * | map | ) | const |
Definition at line 736 of file Loot.cpp.
References _allowedLooters, GetGUID(), GetLootMasterGUID(), GetLootMethod(), GetOwnerGUID(), ObjectAccessor::GetPlayer(), WorldPackets::Packet::GetRawPacket(), hasOverThresholdItem(), ObjectGuid::IsEmpty(), WorldPackets::Loot::LootList::LootObj, WorldPackets::Loot::LootList::Master, MASTER_LOOT, WorldPackets::Loot::LootList::Owner, roundRobinPlayer, WorldPackets::Loot::LootList::RoundRobinWinner, and WorldPackets::Loot::LootList::Write().
Referenced by WorldSession::DoLootRelease(), and Unit::Kill().
| void Loot::NotifyMoneyRemoved | ( | Map const * | map | ) |
Definition at line 779 of file Loot.cpp.
References GetGUID(), ObjectAccessor::GetPlayer(), and PlayersLooting.
Referenced by WorldSession::HandleLootMoneyOpcode().
Definition at line 794 of file Loot.cpp.
References _allowedLooters, _changed, _lootMaster, _lootMethod, _rolls, _wasOpened, AddLooter(), AutoStoreTrackingQuests(), BaseEntity::GetGUID(), GetGUID(), ObjectAccessor::GetPlayer(), GROUP_LOOT, LootItem::is_blocked, items, WorldPackets::Loot::MasterLootCandidateList::LootObj, Trinity::Containers::MapGetValuePtr(), MASTER_LOOT, NEED_BEFORE_GREED, PlayerFFAItems, WorldPackets::Loot::MasterLootCandidateList::Players, Player::SendDirectMessage(), SKILL_ENCHANTING, and WorldPackets::Loot::MasterLootCandidateList::Write().
Referenced by Player::SendLoot().
|
inline |
Definition at line 320 of file Loot.h.
Referenced by WorldSession::DoLootRelease().
|
inline |
Definition at line 310 of file Loot.h.
Referenced by Unit::Kill(), and GameObject::Use().
|
inline |
|
private |
Definition at line 357 of file Loot.h.
Referenced by FillNotNormalLootFor(), HasAllowedLooter(), NotifyLootList(), and OnLootOpened().
|
private |
Definition at line 359 of file Loot.h.
Referenced by LootItemInSlot(), LootMoney(), and OnLootOpened().
|
private |
|
private |
Definition at line 353 of file Loot.h.
Referenced by AddItem(), and FillLoot().
|
private |
Definition at line 356 of file Loot.h.
Referenced by OnLootOpened().
|
private |
Definition at line 354 of file Loot.h.
Referenced by FillLoot(), and OnLootOpened().
|
private |
Definition at line 355 of file Loot.h.
Referenced by OnLootOpened(), and Update().
|
private |
Definition at line 358 of file Loot.h.
Referenced by OnLootOpened().
| uint32 Loot::gold |
Definition at line 290 of file Loot.h.
Referenced by npc_commandscript::_ShowLootContents(), LootItemStorage::AddNewStoredLoot(), BuildLootResponse(), generateMoneyLoot(), WorldSession::HandleLootMoneyOpcode(), WorldSession::HandleOpenItemOpcode(), hasItemForAll(), LootItemStorage::LoadStoredLoot(), and LootMoney().
| std::vector<LootItem> Loot::items |
Definition at line 289 of file Loot.h.
Referenced by npc_commandscript::_ShowLootContents(), AddItem(), LootItemStorage::AddNewStoredLoot(), AutoStore(), AutoStoreTrackingQuests(), BuildLootResponse(), FillLoot(), FillNotNormalLootFor(), LootRoll::Finish(), GetItemInSlot(), WorldSession::HandleLootMasterGiveOpcode(), hasItemFor(), hasItemForAll(), hasOverThresholdItem(), LootItemStorage::LoadStoredLoot(), LootItemInSlot(), NotifyItemRemoved(), OnLootOpened(), MailDraft::prepareItems(), and LootRoll::TryToStart().
| LootType Loot::loot_type |
Definition at line 293 of file Loot.h.
Referenced by Spell::CheckCast(), WorldSession::DoLootRelease(), FillLoot(), WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleLootMoneyOpcode(), Creature::IsSkinnedBy(), Player::SendLoot(), and Player::StoreLootItem().
|
private |
Definition at line 348 of file Loot.h.
Referenced by FillNotNormalLootFor(), LootItemInSlot(), and OnLootOpened().
|
private |
Definition at line 347 of file Loot.h.
Referenced by NotifyItemRemoved(), NotifyMoneyRemoved(), and ~Loot().
| ObjectGuid Loot::roundRobinPlayer |
Definition at line 292 of file Loot.h.
Referenced by WorldSession::DoLootRelease(), FillLoot(), LootItem::GetUiTypeForPlayer(), Player::isAllowedToLoot(), and NotifyLootList().
| uint8 Loot::unlootedCount |
Definition at line 291 of file Loot.h.
Referenced by AutoStore(), AutoStoreTrackingQuests(), FillNotNormalLootFor(), WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleOpenItemOpcode(), LootItemStorage::LoadStoredLoot(), and Player::StoreLootItem().