[Quest API] Implement eq.handin() and quest::handin() (#4718)

* [Quest API] Implement eq.handin() and quest::handin()

* Fix MQ using new API style
This commit is contained in:
Chris Miles
2025-02-28 15:22:39 -06:00
committed by GitHub
parent 875df8e64a
commit 425d24c1f4
6 changed files with 97 additions and 4 deletions
+10 -2
View File
@@ -4351,6 +4351,10 @@ bool NPC::CheckHandin(
h = m_hand_in;
}
if (IsMultiQuestEnabled()) {
LogNpcHandin("{} Multi-Quest hand-in enabled", log_handin_prefix);
}
std::vector<std::pair<const std::map<std::string, uint32>&, Handin&>> datasets = {};
// if we've already started the hand-in process, we don't want to re-process the hand-in data
@@ -4432,7 +4436,7 @@ bool NPC::CheckHandin(
// multi-quest
if (IsMultiQuestEnabled()) {
for (auto &h_item: h.items) {
for (auto &h_item: m_hand_in.items) {
for (const auto &r_item: r.items) {
if (h_item.item_id == r_item.item_id && h_item.count == r_item.count) {
h_item.is_multiquest_item = true;
@@ -4777,7 +4781,11 @@ NPC::Handin NPC::ReturnHandinItems(Client *c)
}
c->PushItemOnCursor(*i.item, true);
LogNpcHandin("Hand-in failed, returning item [{}]", i.item->GetItem()->Name);
LogNpcHandin(
"Hand-in failed, returning item [{}] i.is_multiquest_item [{}]",
i.item->GetItem()->Name,
i.is_multiquest_item
);
returned_handin = true;
return true; // Mark this item for removal