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;
209 data <<
uint32(titleTextId);
215 data <<
uint32(itr->first);
223 size_t count_pos = data.
wpos();
235 data <<
int32(quest->GetQuestLevel());
236 data <<
uint32(quest->GetFlags());
237 data <<
uint8(quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly());
238 std::string title = quest->GetTitle();
264 if (!pointOfInterest)
266 TC_LOG_ERROR(
"sql.sql",
"Request to send non-existing POI (Id: {}), ignored.",
id);
271 packet.
Name = pointOfInterest->
Name;
280 packet.
Icon = pointOfInterest->
Icon;
309 questMenuItem.
QuestId = QuestId;
318 if (i->QuestId == questId)
336 std::string strGreeting = questGreeting->greeting;
344 data <<
uint32(questGreeting->greetEmoteDelay);
345 data <<
uint32(questGreeting->greetEmoteType);
354 size_t count_pos = data.
wpos();
366 std::string title = quest->GetTitle();
375 data <<
int32(quest->GetQuestLevel());
376 data <<
uint32(quest->GetFlags());
377 data <<
uint8(quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly());
385 TC_LOG_DEBUG(
"network",
"WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST (QuestGiver: {})", guid.
ToString());
392 data <<
uint8(questStatus);
395 TC_LOG_DEBUG(
"network",
"WORLD: Sent SMSG_QUESTGIVER_STATUS NPC={}, status={}", npcGUID.
ToString(), questStatus);
486 std::string questTitle = quest->
GetTitle();
509 data << requestItemsText;
519 data <<
uint32(closeOnCancel);
537 data <<
uint32(itemTemplate->DisplayInfoID);
#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
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, size_t locale)
ObjectGuid GetPlayerSharingQuest() const
uint32 DetailsEmote[QUEST_EMOTE_COUNT]
uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]
WorldPacket BuildQueryData(LocaleConstant loc) const
uint32 GetReqItemsCount() const
std::string const & GetRequestItemsText() const
WorldPacket QueryData[TOTAL_LOCALES]
std::string const & GetObjectives() const
uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT]
std::string const & GetDetails() const
void BuildQuestRewards(WorldPackets::Quest::QuestRewards &rewards, Player *player, bool sendHiddenRewards=false) const
uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]
uint32 GetQuestId() const
uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]
std::string const & GetOfferRewardText() const
int32 GetRewOrReqMoney(Player const *player=nullptr) const
uint32 GetIncompleteEmote() const
std::string const & GetTitle() const
uint32 GetCompleteEmote() const
uint32 GetSuggestedPlayers() const
TaggedPosition< Position::XY > Pos
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< QuestDescEmote > Emotes
ObjectGuid QuestGiverGUID
ObjectGuid QuestGiverGUID
std::vector< QuestDescEmote > DescEmotes
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
@ SMSG_QUESTGIVER_REQUEST_ITEMS
@ 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)