![]() |
TrinityCore
|
#include <Loot.h>
Public Types | |
| using | RollVoteMap = std::unordered_map< ObjectGuid, PlayerRollVote > |
Public Member Functions | |
| LootRoll () | |
| ~LootRoll () | |
| LootRoll (LootRoll const &)=delete | |
| LootRoll (LootRoll &&)=delete | |
| LootRoll & | operator= (LootRoll const &)=delete |
| LootRoll & | operator= (LootRoll &&)=delete |
| bool | TryToStart (Map *map, Loot &loot, uint32 lootListId, uint16 enchantingSkill) |
| bool | PlayerVote (Player *player, RollVote vote) |
| bool | UpdateRoll () |
| bool | IsLootItem (ObjectGuid const &lootObject, uint32 lootListId) const |
Private Member Functions | |
| void | SendStartRoll () |
| void | SendAllPassed () |
| void | SendRoll (ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType, Optional< ObjectGuid > const &rollWinner) |
| void | SendLootRollWon (ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType) |
| void | FillPacket (WorldPackets::Loot::LootItemData &lootItem) const |
| 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. | |
| Optional< uint32 > | GetItemDisenchantLootId () const |
| Optional< uint16 > | GetItemDisenchantSkillRequired () const |
Private Attributes | |
| Map * | m_map |
| RollVoteMap | m_rollVoteMap |
| bool | m_isStarted |
| LootItem * | m_lootItem |
| Loot * | m_loot |
| RollMask | m_voteMask |
| TimePoint | m_endTime |
| using LootRoll::RollVoteMap = std::unordered_map<ObjectGuid, PlayerRollVote> |
| LootRoll::~LootRoll | ( | ) |
Definition at line 445 of file Loot.cpp.
References ObjectAccessor::GetPlayer(), m_isStarted, m_map, m_rollVoteMap, NotEmitedYet, Player::RemoveLootRoll(), and SendAllPassed().
|
delete |
|
delete |
|
private |
Check if all player have voted and return true in that case. Also return current winner.
| winnerItr | > will be different than m_rollCoteMap.end() if winner exist. (Someone voted greed or need) |
Definition at line 587 of file Loot.cpp.
References Disenchant, Greed, m_rollVoteMap, Need, NotEmitedYet, and Pass.
Referenced by UpdateRoll().
|
private |
Definition at line 437 of file Loot.cpp.
References LootItem::allowedGUIDs, WorldPackets::Loot::LootItemData::CanTradeToTapList, LootItem::count, WorldPackets::Item::ItemInstance::Initialize(), WorldPackets::Loot::LootItemData::Loot, LootItem::LootListId, WorldPackets::Loot::LootItemData::LootListID, m_lootItem, and WorldPackets::Loot::LootItemData::Quantity.
Referenced by SendAllPassed(), SendLootRollWon(), SendRoll(), and SendStartRoll().
|
private |
Definition at line 674 of file Loot.cpp.
References Loot::AutoStore(), CastSpell, Disenchant, Loot::FillLoot(), ObjectAccessor::FindConnectedPlayer(), GetItemDisenchantLootId(), Loot::GetOwnerGUID(), LootItem::is_blocked, Item, LootItem::itemid, Loot::items, LOOT_DISENCHANTING, LOOT_MODE_DEFAULT, Loot::LootItemInSlot(), LootItem::LootListId, LootTemplates_Disenchant, m_isStarted, m_loot, m_lootItem, m_map, m_rollVoteMap, Need, NONE, Loot::NotifyItemRemoved(), NULL_BAG, NULL_SLOT, RollGreed, RollNeed, LootItem::rollWinnerGUID, SendAllPassed(), and SendLootRollWon().
Referenced by UpdateRoll().
Definition at line 626 of file Loot.cpp.
References BonusData::CanDisenchant, BonusData::DisenchantLootId, Item::GetBaseDisenchantLoot(), Item::GetItemLevel(), ItemDisenchantLootEntry::ID, WorldPackets::Item::ItemInstance::Initialize(), BonusData::Initialize(), LootItem::itemid, m_lootItem, BonusData::Quality, BonusData::RequiredLevel, and sObjectMgr.
Referenced by Finish().
Definition at line 651 of file Loot.cpp.
References BonusData::CanDisenchant, Item::GetBaseDisenchantLoot(), Item::GetItemLevel(), WorldPackets::Item::ItemInstance::Initialize(), BonusData::Initialize(), LootItem::itemid, m_lootItem, BonusData::Quality, BonusData::RequiredLevel, ItemDisenchantLootEntry::SkillRequired, and sObjectMgr.
Referenced by TryToStart().
| bool LootRoll::IsLootItem | ( | ObjectGuid const & | lootObject, |
| uint32 | lootListId | ||
| ) | const |
Definition at line 577 of file Loot.cpp.
References Loot::GetGUID(), LootItem::LootListId, m_loot, and m_lootItem.
Definition at line 521 of file Loot.cpp.
References Disenchant, BaseEntity::GetGUID(), Greed, m_rollVoteMap, Need, NotEmitedYet, NotValid, Pass, RollAnyGreed, RollAnyNeed, SendRoll(), Player::UpdateCriteria(), and urand().
Referenced by WorldSession::HandleLootRoll().
|
private |
Definition at line 321 of file Loot.cpp.
References WorldPackets::Loot::LootAllPassed::DungeonEncounterID, FillPacket(), Loot::GetDungeonEncounterId(), Loot::GetGUID(), ObjectAccessor::GetPlayer(), WorldPackets::Packet::GetRawPacket(), WorldPackets::Loot::LootAllPassed::Item, LOOT_SLOT_TYPE_ALLOW_LOOT, WorldPackets::Loot::LootAllPassed::LootObj, m_loot, m_map, m_rollVoteMap, NotValid, Player::SendDirectMessage(), WorldPackets::Loot::LootItemData::UIType, and WorldPackets::Loot::LootAllPassed::Write().
Referenced by Finish(), and ~LootRoll().
|
private |
Definition at line 384 of file Loot.cpp.
References AsUnderlyingType(), WorldPackets::ServerPacket::Clear(), WorldPackets::Loot::LootRollWon::DungeonEncounterID, FillPacket(), Loot::GetDungeonEncounterId(), Loot::GetGUID(), ObjectAccessor::GetPlayer(), WorldPackets::Packet::GetRawPacket(), WorldPackets::Loot::LootRollWon::Item, LOOT_SLOT_TYPE_ALLOW_LOOT, LOOT_SLOT_TYPE_LOCKED, WorldPackets::Loot::LootRollWon::LootObj, m_loot, m_map, m_rollVoteMap, WorldPackets::Loot::LootRollWon::MainSpec, NotEmitedYet, NotValid, Pass, WorldPackets::Loot::LootRollWon::Roll, WorldPackets::Loot::LootRollWon::RollType, Player::SendDirectMessage(), SendRoll(), WorldPackets::Loot::LootItemData::UIType, WorldPackets::Loot::LootRollWon::Winner, and WorldPackets::Loot::LootRollWon::Write().
Referenced by Finish().
|
private |
Definition at line 344 of file Loot.cpp.
References AsUnderlyingType(), WorldPackets::Loot::LootRollBroadcast::Autopassed, WorldPackets::ServerPacket::Clear(), WorldPackets::Loot::LootRollBroadcast::DungeonEncounterID, FillPacket(), Loot::GetDungeonEncounterId(), Loot::GetGUID(), ObjectAccessor::GetPlayer(), WorldPackets::Packet::GetRawPacket(), WorldPackets::Loot::LootRollBroadcast::Item, LOOT_SLOT_TYPE_ALLOW_LOOT, LOOT_SLOT_TYPE_ROLL_ONGOING, WorldPackets::Loot::LootRollBroadcast::LootObj, m_loot, m_map, m_rollVoteMap, NotValid, WorldPackets::Loot::LootRollBroadcast::Player, WorldPackets::Loot::LootRollBroadcast::Roll, WorldPackets::Loot::LootRollBroadcast::RollType, Player::SendDirectMessage(), WorldPackets::Loot::LootItemData::UIType, and WorldPackets::Loot::LootRollBroadcast::Write().
Referenced by PlayerVote(), SendLootRollWon(), and SendStartRoll().
|
private |
Definition at line 281 of file Loot.cpp.
References ASSERT_NOTNULL, Player::CanRollNeedForItem(), WorldPackets::Loot::StartLootRoll::DungeonEncounterID, EQUIP_ERR_OK, FillPacket(), Loot::GetDungeonEncounterId(), Loot::GetGUID(), Map::GetId(), Loot::GetLootMethod(), ObjectAccessor::GetPlayer(), WorldPackets::Loot::StartLootRoll::Item, LootItem::itemid, LOOT_ROLL_TIMEOUT, LOOT_SLOT_TYPE_ROLL_ONGOING, WorldPackets::Loot::StartLootRoll::LootObj, m_loot, m_lootItem, m_map, m_rollVoteMap, m_voteMask, WorldPackets::Loot::StartLootRoll::MapID, WorldPackets::Loot::StartLootRoll::Method, NEED_BEFORE_GREED, NotEmitedYet, Pass, WorldPackets::Loot::StartLootRoll::RollTime, Player::SendDirectMessage(), SendRoll(), sObjectMgr, WorldPackets::Loot::LootItemData::UIType, WorldPackets::Loot::StartLootRoll::ValidRolls, and WorldPackets::Loot::StartLootRoll::Write().
Referenced by TryToStart().
Definition at line 465 of file Loot.cpp.
References Player::AddLootRoll(), ASSERT_NOTNULL, LootItem::GetAllowedLooters(), BaseEntity::GetGUID(), GetItemDisenchantSkillRequired(), Player::GetPassOnGroupLoot(), ObjectAccessor::GetPlayer(), LootItem::HasAllowedLooter(), ItemTemplate::HasFlag(), LootItem::is_blocked, LootItem::is_underthreshold, ITEM_FLAG2_CAN_ONLY_ROLL_GREED, LootItem::itemid, Loot::items, LOOT_ROLL_TIMEOUT, m_endTime, m_isStarted, m_loot, m_lootItem, m_map, m_rollVoteMap, m_voteMask, NotEmitedYet, NotValid, GameTime::Now(), Pass, ROLL_ALL_TYPE_MASK, ROLL_FLAG_TYPE_DISENCHANT, ROLL_FLAG_TYPE_NEED, SendStartRoll(), and sObjectMgr.
| bool LootRoll::UpdateRoll | ( | ) |
Definition at line 565 of file Loot.cpp.
References AllPlayerVoted(), Finish(), m_endTime, m_rollVoteMap, and GameTime::Now().
|
private |
Definition at line 282 of file Loot.h.
Referenced by TryToStart(), and UpdateRoll().
|
private |
Definition at line 278 of file Loot.h.
Referenced by Finish(), TryToStart(), and ~LootRoll().
|
private |
Definition at line 280 of file Loot.h.
Referenced by Finish(), IsLootItem(), SendAllPassed(), SendLootRollWon(), SendRoll(), SendStartRoll(), and TryToStart().
|
private |
Definition at line 279 of file Loot.h.
Referenced by FillPacket(), Finish(), GetItemDisenchantLootId(), GetItemDisenchantSkillRequired(), IsLootItem(), SendStartRoll(), and TryToStart().
|
private |
Definition at line 276 of file Loot.h.
Referenced by Finish(), SendAllPassed(), SendLootRollWon(), SendRoll(), SendStartRoll(), TryToStart(), and ~LootRoll().
|
private |
Definition at line 277 of file Loot.h.
Referenced by AllPlayerVoted(), Finish(), PlayerVote(), SendAllPassed(), SendLootRollWon(), SendRoll(), SendStartRoll(), TryToStart(), UpdateRoll(), and ~LootRoll().
|
private |
Definition at line 281 of file Loot.h.
Referenced by SendStartRoll(), and TryToStart().