52 itr = std::max_element(itr, end, [](GossipMenuItemsContainer::value_type
const& a, GossipMenuItemsContainer::value_type
const& b)
54 return a.second.OptionID < b.second.OptionID;
57 menuItemId = itr->second.OptionID + 1;
62 for (GossipMenuItemContainer::const_iterator itr =
_menuItems.begin(); itr !=
_menuItems.end(); ++itr)
64 if (
int32(itr->first) > menuItemId)
67 menuItemId = itr->first + 1;
96 auto itr = std::find_if(bounds.first, bounds.second, [menuItemId](std::pair<uint32 const, GossipMenuItems>
const& itemPair)
98 return itemPair.second.OptionID == menuItemId;
101 if (itr == bounds.second)
105 std::string strOptionText, strBoxText;
110 if (optionBroadcastText)
113 strOptionText = itr->second.OptionText;
116 if (boxBroadcastText)
119 strBoxText = itr->second.BoxText;
124 if (!optionBroadcastText)
131 if (!boxBroadcastText)
140 AddMenuItem(itr->second.OptionID, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
154 GossipMenuItemContainer::const_iterator itr =
_menuItems.find(menuItemId);
158 return itr->second.Sender;
163 GossipMenuItemContainer::const_iterator itr =
_menuItems.find(menuItemId);
167 return itr->second.OptionType;
172 GossipMenuItemContainer::const_iterator itr =
_menuItems.find(menuItemId);
176 return itr->second.IsCoded;
219 opt.
Text = item.Message;
236 text.
Repeatable = quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly();
265 if (!pointOfInterest)
267 TC_LOG_ERROR(
"sql.sql",
"Request to send non-existing POI (Id: {}), ignored.",
id);
272 packet.
Name = pointOfInterest->
Name;
281 packet.
Icon = pointOfInterest->
Icon;
310 questMenuItem.
QuestId = QuestId;
319 if (i->QuestId == questId)
337 std::string strGreeting = questGreeting->greeting;
345 data <<
uint32(questGreeting->greetEmoteDelay);
346 data <<
uint32(questGreeting->greetEmoteType);
355 size_t count_pos = data.
wpos();
367 std::string title = quest->GetLogTitle();
376 data <<
int32(quest->GetQuestLevel());
377 data <<
uint32(quest->GetFlags());
378 data <<
uint8(quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly());
386 TC_LOG_DEBUG(
"network",
"WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST (QuestGiver: {})", guid.
ToString());
526 packet.
Explored = canComplete ? 0x03 : 0x00;
542 collect.
DisplayID = itemTemplate->GetDisplayId();
#define GOSSIP_MAX_MENU_ITEMS
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
uint32 MAKE_PAIR32(uint16 l, uint16 h)
std::pair< GossipMenuItemsContainer::const_iterator, GossipMenuItemsContainer::const_iterator > GossipMenuItemsMapBounds
#define QUEST_ITEM_OBJECTIVES_COUNT
#define QUEST_EMOTE_COUNT
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
void put(std::size_t pos, T value)
static ObjectGuid const Empty
std::string ToString() const
static TypeID GetTypeId(HighGuid high)
static std::string_view GetLocaleString(std::vector< std::string > const &data, LocaleConstant locale)
ObjectGuid GetPlayerSharingQuest() const
WorldPacket BuildQueryData(LocaleConstant loc) const
uint32 GetReqItemsCount() const
std::string const & GetRequestItemsText() const
std::array< uint32, QUEST_EMOTE_COUNT > DetailsEmoteDelay
WorldPacket QueryData[TOTAL_LOCALES]
void BuildQuestRewards(WorldPackets::Quest::QuestRewards &rewards, Player *player, bool sendHiddenRewards=false) const
std::array< uint32, QUEST_ITEM_OBJECTIVES_COUNT > RequiredItemId
std::string const & GetLogTitle() const
uint32 GetQuestId() const
uint32 GetIncompleteEmoteDelay() const
uint32 GetCompleteEmoteDelay() const
std::string const & GetOfferRewardText() const
int32 GetRewOrReqMoney(Player const *player=nullptr) const
std::string const & GetLogDescription() const
std::array< uint32, QUEST_EMOTE_COUNT > DetailsEmote
uint32 GetIncompleteEmote() const
uint32 GetCompleteEmote() const
std::string const & GetQuestDescription() const
std::array< uint32, QUEST_ITEM_OBJECTIVES_COUNT > RequiredItemCount
std::array< uint32, QUEST_EMOTE_COUNT > OfferRewardEmoteDelay
uint32 GetSuggestedPlayers() const
std::array< uint32, QUEST_EMOTE_COUNT > OfferRewardEmote
WorldPacket const * Write() override
std::vector< ClientGossipOptions > GossipOptions
std::vector< ClientGossipText > GossipText
TaggedPosition< Position::XY > Pos
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< QuestDescEmote > Emotes
ObjectGuid QuestGiverGUID
std::string DescriptionText
ObjectGuid QuestGiverGUID
std::vector< QuestDescEmote > DescEmotes
std::string LogDescription
WorldPacket const * Write() override
std::string_view QuestTitle
std::string_view CompletionText
WorldPacket const * Write() override
int32 SuggestPartyMembers
std::vector< QuestObjectiveCollect > Collect
ObjectGuid QuestGiverGUID
QuestGiverInfo QuestGiver
WorldPacket const * Write() override
Player session in the World.
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
LocaleConstant GetSessionDbLocaleIndex() const
Player * GetPlayer() const
@ SMSG_QUESTGIVER_QUEST_LIST
@ CONFIG_QUEST_IGNORE_AUTO_ACCEPT
@ CONFIG_CACHE_DATA_QUERIES
std::string const & GetText(LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false) const
void Relocate(float x, float y)
GossipOptionIcon OptionNPC
std::string_view QuestTitle
::QuestGiverStatus Status