30#include <unordered_map>
85#define MAX_NR_LOOT_ITEMS 18
199 LootItem() : itemid(0), LootListId(0), randomBonusListId(0), context(
ItemContext::
NONE), count(0), is_looted(false), is_blocked(false),
200 freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false) { }
209 bool AllowedForPlayer(
Player const* player,
Loot const* loot) const;
210 static
bool AllowedForPlayer(
Player const* player,
Loot const* loot,
uint32 itemid,
bool needs_quest,
bool follow_loot_rules,
bool strictUsabilityCheck,
212 void AddAllowedLooter(
Player const* player);
213 GuidSet const& GetAllowedLooters()
const {
return allowedGUIDs; }
214 bool HasAllowedLooter(
ObjectGuid const& looter)
const;
246 using RollVoteMap = std::unordered_map<ObjectGuid, PlayerRollVote>;
268 void Finish(RollVoteMap::const_iterator winnerItr);
307 bool isLooted()
const {
return gold == 0 && unlootedCount == 0; }
310 void NotifyLootList(
Map const* map)
const;
311 void NotifyItemRemoved(
uint8 lootListId,
Map const* map);
312 void NotifyMoneyRemoved(
Map const* map);
317 bool HasAllowedLooter(
ObjectGuid const& looter)
const;
319 void generateMoneyLoot(
uint32 minAmount,
uint32 maxAmount);
321 void FillNotNormalLootFor(
Player const* player);
326 bool AutoStore(
Player* player,
uint8 bag,
uint8 slot,
bool broadcast =
false,
bool createdByPlayer =
false);
331 bool hasItemForAll()
const;
332 bool hasItemFor(
Player const* player)
const;
333 bool hasOverThresholdItem()
const;
349 std::unordered_map<uint32, LootRoll>
_rolls;
372 OrderedStorage::const_iterator begin()
const;
373 OrderedStorage::const_iterator end()
const;
376 std::unordered_map<Item*, OrderedStorage::size_type>
_byItem;
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
std::chrono::minutes Minutes
Minutes shorthand typedef.
uint32 ItemRandomBonusListId
std::unordered_map< ObjectGuid, std::unique_ptr< NotNormalLootItemList > > NotNormalLootItemMap
@ ROLL_FLAG_TYPE_TRANSMOG
@ ROLL_ALL_TYPE_NO_DISENCHANT
@ ROLL_FLAG_TYPE_DISENCHANT
LootRollIneligibilityReason
std::vector< LootItem > LootItemList
constexpr LootType GetLootTypeForClient(LootType lootType)
@ LOOT_SLOT_TYPE_ROLL_ONGOING
@ LOOT_SLOT_TYPE_ALLOW_LOOT
std::vector< NotNormalLootItem > NotNormalLootItemList
@ LOOT_ERROR_MASTER_OTHER
@ LOOT_ERROR_MASTER_INV_FULL
@ LOOT_ERROR_MASTER_UNIQUE_ITEM
@ LOOT_ERROR_PLAY_TIME_EXCEEDED
@ LOOT_ERROR_NOT_WHILE_SHAPESHIFTED
@ LOOT_ERROR_PLAYER_NOT_FOUND
@ LOOT_ERROR_ALREADY_PICKPOCKETED
constexpr Minutes LOOT_ROLL_TIMEOUT
std::unordered_set< ObjectGuid > GuidUnorderedSet
std::set< ObjectGuid > GuidSet
std::optional< T > Optional
Optional helper class to wrap optional values within.
std::unordered_map< Item *, OrderedStorage::size_type > _byItem
std::vector< ResultValue > OrderedStorage
bool PlayerVote(Player *player, RollVote vote)
LootRoll & operator=(LootRoll &&)=delete
void Finish(RollVoteMap::const_iterator winnerItr)
bool AllPlayerVoted(RollVoteMap::const_iterator &winnerItr)
Check if all player have voted and return true in that case. Also return current winner.
bool TryToStart(Map *map, Loot &loot, uint32 lootListId, uint16 enchantingSkill)
ItemDisenchantLootEntry const * GetItemDisenchantLoot() const
bool IsLootItem(ObjectGuid const &lootObject, uint32 lootListId) const
RollVoteMap m_rollVoteMap
LootRoll(LootRoll &&)=delete
void SendLootRollWon(ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType)
std::unordered_map< ObjectGuid, PlayerRollVote > RollVoteMap
LootRoll & operator=(LootRoll const &)=delete
void SendRoll(ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType, Optional< ObjectGuid > const &rollWinner)
void FillPacket(WorldPackets::Loot::LootItemData &lootItem) const
LootRoll(LootRoll const &)=delete
void Update(VignetteData &vignette, WorldObject const *owner)
uint32 dungeonEncounterId
std::vector< int32 > BonusListIDs
ObjectGuid rollWinnerGUID
ItemRandomBonusListId randomBonusListId
ConditionsReference conditions
LootItem(LootItem const &)
LootItem(LootItem &&) noexcept
Loot & operator=(Loot &&)=delete
ItemContext GetItemContext() const
void AddLooter(ObjectGuid GUID)
GuidUnorderedSet _allowedLooters
NotNormalLootItemMap PlayerFFAItems
void SetItemContext(ItemContext context)
uint32 _dungeonEncounterId
ObjectGuid roundRobinPlayer
ObjectGuid const & GetOwnerGUID() const
Loot & operator=(Loot const &)=delete
ObjectGuid const & GetGUID() const
void SetDungeonEncounterId(uint32 dungeonEncounterId)
std::vector< LootItem > items
void RemoveLooter(ObjectGuid GUID)
std::unordered_map< uint32, LootRoll > _rolls
NotNormalLootItemMap const & GetPlayerFFAItems() const
uint32 GetDungeonEncounterId() const
Loot(Loot const &)=delete
ObjectGuid const & GetLootMasterGUID() const
LootMethod GetLootMethod() const
NotNormalLootItem(uint8 _index, bool _islooted=false)