mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
feat: fire UPDATE_FACTION, QUEST_ACCEPTED, and QUEST_LOG_UPDATE events
Fire UPDATE_FACTION when reputation standings change (SMSG_SET_FACTION_STANDING). Fire QUEST_ACCEPTED with quest ID when a new quest is added to the log. Fire QUEST_LOG_UPDATE on both quest acceptance and quest completion. Enables reputation tracking and quest log addons.
This commit is contained in:
parent
14007c81df
commit
c44e1bde0a
1 changed files with 7 additions and 0 deletions
|
|
@ -4156,6 +4156,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
addSystemChatMessage(buf);
|
addSystemChatMessage(buf);
|
||||||
watchedFactionId_ = factionId;
|
watchedFactionId_ = factionId;
|
||||||
if (repChangeCallback_) repChangeCallback_(name, delta, standing);
|
if (repChangeCallback_) repChangeCallback_(name, delta, standing);
|
||||||
|
if (addonEventCallback_)
|
||||||
|
addonEventCallback_("UPDATE_FACTION", {});
|
||||||
}
|
}
|
||||||
LOG_DEBUG("SMSG_SET_FACTION_STANDING: faction=", factionId, " standing=", standing);
|
LOG_DEBUG("SMSG_SET_FACTION_STANDING: faction=", factionId, " standing=", standing);
|
||||||
}
|
}
|
||||||
|
|
@ -5289,6 +5291,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (addonEventCallback_) addonEventCallback_("QUEST_LOG_UPDATE", {});
|
||||||
// Re-query all nearby quest giver NPCs so markers refresh
|
// Re-query all nearby quest giver NPCs so markers refresh
|
||||||
if (socket) {
|
if (socket) {
|
||||||
for (const auto& [guid, entity] : entityManager.getEntities()) {
|
for (const auto& [guid, entity] : entityManager.getEntities()) {
|
||||||
|
|
@ -21052,6 +21055,10 @@ void GameHandler::addQuestToLocalLogIfMissing(uint32_t questId, const std::strin
|
||||||
entry.title = title.empty() ? ("Quest #" + std::to_string(questId)) : title;
|
entry.title = title.empty() ? ("Quest #" + std::to_string(questId)) : title;
|
||||||
entry.objectives = objectives;
|
entry.objectives = objectives;
|
||||||
questLog_.push_back(std::move(entry));
|
questLog_.push_back(std::move(entry));
|
||||||
|
if (addonEventCallback_) {
|
||||||
|
addonEventCallback_("QUEST_ACCEPTED", {std::to_string(questId)});
|
||||||
|
addonEventCallback_("QUEST_LOG_UPDATE", {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameHandler::resyncQuestLogFromServerSlots(bool forceQueryMetadata) {
|
bool GameHandler::resyncQuestLogFromServerSlots(bool forceQueryMetadata) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue