TrinityCore
Loading...
Searching...
No Matches
Loot Struct Reference

#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
 

Detailed Description

Definition at line 285 of file Loot.h.

Constructor & Destructor Documentation

◆ Loot() [1/3]

Loot::Loot ( Map *  map,
ObjectGuid  owner,
LootType  type,
Group const *  group 
)
explicit

Definition at line 721 of file Loot.cpp.

◆ ~Loot()

Loot::~Loot ( )

Definition at line 728 of file Loot.cpp.

References ObjectAccessor::FindConnectedPlayer(), and PlayersLooting.

◆ Loot() [2/3]

Loot::Loot ( Loot const &  )
delete

◆ Loot() [3/3]

Loot::Loot ( Loot &&  )
delete

Member Function Documentation

◆ AddItem()

◆ AddLooter()

void Loot::AddLooter ( ObjectGuid  GUID)
inline

Definition at line 319 of file Loot.h.

Referenced by OnLootOpened().

◆ AutoStore()

◆ AutoStoreTrackingQuests()

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().

◆ BuildLootResponse()

◆ FillLoot()

◆ FillNotNormalLootFor()

void Loot::FillNotNormalLootFor ( Player *  player)

Definition at line 1200 of file Loot.cpp.

References _allowedLooters, BaseEntity::GetGUID(), items, PlayerFFAItems, and unlootedCount.

Referenced by FillLoot().

◆ generateMoneyLoot()

void Loot::generateMoneyLoot ( uint32  minAmount,
uint32  maxAmount 
)

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().

◆ GetDungeonEncounterId()

◆ GetGUID()

◆ GetItemContext()

ItemContext Loot::GetItemContext ( ) const
inline

Definition at line 305 of file Loot.h.

◆ GetItemInSlot()

LootItem const * Loot::GetItemInSlot ( uint32  lootListId) const

Definition at line 1066 of file Loot.cpp.

References items.

◆ GetLootMasterGUID()

ObjectGuid const & Loot::GetLootMasterGUID ( ) const
inline

◆ GetLootMethod()

◆ GetOwnerGUID()

◆ GetPlayerFFAItems()

NotNormalLootItemMap const & Loot::GetPlayerFFAItems ( ) const
inline

◆ HasAllowedLooter()

bool Loot::HasAllowedLooter ( ObjectGuid const &  looter) const

◆ hasItemFor()

bool Loot::hasItemFor ( Player const *  player) const

◆ hasItemForAll()

bool Loot::hasItemForAll ( ) const

Definition at line 1109 of file Loot.cpp.

References gold, and items.

Referenced by Player::isAllowedToLoot().

◆ hasOverThresholdItem()

bool Loot::hasOverThresholdItem ( ) const

Definition at line 1137 of file Loot.cpp.

References items.

Referenced by Player::isAllowedToLoot(), and NotifyLootList().

◆ IsChanged()

bool Loot::IsChanged ( ) const
inline

Definition at line 313 of file Loot.h.

◆ isLooted()

◆ LootItemInSlot()

LootItem * Loot::LootItemInSlot ( uint32  lootListId,
Player const *  player,
NotNormalLootItem **  ffaItem = nullptr 
)

◆ LootMoney()

void Loot::LootMoney ( )

Definition at line 1060 of file Loot.cpp.

References _changed, and gold.

Referenced by WorldSession::HandleLootMoneyOpcode().

◆ NotifyItemRemoved()

void Loot::NotifyItemRemoved ( uint8  lootListId,
Map const *  map 
)

◆ NotifyLootList()

◆ NotifyMoneyRemoved()

void Loot::NotifyMoneyRemoved ( Map const *  map)

Definition at line 779 of file Loot.cpp.

References GetGUID(), ObjectAccessor::GetPlayer(), and PlayersLooting.

Referenced by WorldSession::HandleLootMoneyOpcode().

◆ OnLootOpened()

◆ operator=() [1/2]

Loot & Loot::operator= ( Loot &&  )
delete

◆ operator=() [2/2]

Loot & Loot::operator= ( Loot const &  )
delete

◆ RemoveLooter()

void Loot::RemoveLooter ( ObjectGuid  GUID)
inline

Definition at line 320 of file Loot.h.

Referenced by WorldSession::DoLootRelease().

◆ SetDungeonEncounterId()

void Loot::SetDungeonEncounterId ( uint32  dungeonEncounterId)
inline

Definition at line 310 of file Loot.h.

Referenced by Unit::Kill(), and GameObject::Use().

◆ SetItemContext()

void Loot::SetItemContext ( ItemContext  context)
inline

Definition at line 306 of file Loot.h.

◆ Update()

void Loot::Update ( )

Definition at line 1189 of file Loot.cpp.

References _rolls.

Member Data Documentation

◆ _allowedLooters

GuidUnorderedSet Loot::_allowedLooters
private

Definition at line 357 of file Loot.h.

Referenced by FillNotNormalLootFor(), HasAllowedLooter(), NotifyLootList(), and OnLootOpened().

◆ _changed

bool Loot::_changed
private

Definition at line 359 of file Loot.h.

Referenced by LootItemInSlot(), LootMoney(), and OnLootOpened().

◆ _dungeonEncounterId

uint32 Loot::_dungeonEncounterId
private

Definition at line 360 of file Loot.h.

◆ _guid

ObjectGuid Loot::_guid
private

Definition at line 351 of file Loot.h.

◆ _itemContext

ItemContext Loot::_itemContext
private

Definition at line 353 of file Loot.h.

Referenced by AddItem(), and FillLoot().

◆ _lootMaster

ObjectGuid Loot::_lootMaster
private

Definition at line 356 of file Loot.h.

Referenced by OnLootOpened().

◆ _lootMethod

LootMethod Loot::_lootMethod
private

Definition at line 354 of file Loot.h.

Referenced by FillLoot(), and OnLootOpened().

◆ _owner

ObjectGuid Loot::_owner
private

Definition at line 352 of file Loot.h.

◆ _rolls

std::unordered_map<uint32, LootRoll> Loot::_rolls
private

Definition at line 355 of file Loot.h.

Referenced by OnLootOpened(), and Update().

◆ _wasOpened

bool Loot::_wasOpened
private

Definition at line 358 of file Loot.h.

Referenced by OnLootOpened().

◆ gold

◆ items

◆ loot_type

◆ PlayerFFAItems

NotNormalLootItemMap Loot::PlayerFFAItems
private

Definition at line 348 of file Loot.h.

Referenced by FillNotNormalLootFor(), LootItemInSlot(), and OnLootOpened().

◆ PlayersLooting

GuidSet Loot::PlayersLooting
private

Definition at line 347 of file Loot.h.

Referenced by NotifyItemRemoved(), NotifyMoneyRemoved(), and ~Loot().

◆ roundRobinPlayer

◆ unlootedCount


The documentation for this struct was generated from the following files: