diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index c9d65f7068..9c1977723f 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6304,7 +6304,9 @@ void Client::Handle_OP_Fishing(const EQApplicationPacket *app) } if (CanFish()) { - parse->EventPlayer(EVENT_FISH_START, this, "", 0); + if (parse->PlayerHasQuestSub(EVENT_FISH_START)) { + parse->EventPlayer(EVENT_FISH_START, this, "", 0); + } //these will trigger GoFish() after a delay if we're able to actually fish, and if not, we won't stop the client from trying again immediately (although we may need to tell it to repop the button) p_timers.Start(pTimerFishing, FishingReuseTime - 1); diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 1a21ea23f9..1dfa7e778c 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1783,11 +1783,17 @@ void PerlembParser::ExportEventVariables( case EVENT_FORAGE_SUCCESS: { ExportVar(package_name.c_str(), "foraged_item", extradata); + if (extra_pointers && extra_pointers->size() == 1) { + ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast(extra_pointers->at(0))); + } break; } case EVENT_FISH_SUCCESS: { ExportVar(package_name.c_str(), "fished_item", extradata); + if (extra_pointers && extra_pointers->size() == 1) { + ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast(extra_pointers->at(0))); + } break; } diff --git a/zone/entity.cpp b/zone/entity.cpp index 37d828e8a5..a632c3942e 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -683,7 +683,7 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue) npc_list.insert(std::pair(npc->GetID(), npc)); mob_list.insert(std::pair(npc->GetID(), npc)); - if (parse->HasQuestSub(npc->GetNPCTypeID())) { + if (parse->HasQuestSub(npc->GetNPCTypeID(), EVENT_SPAWN)) { parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0); } diff --git a/zone/forage.cpp b/zone/forage.cpp index ce5e05fedd..8eaa003a1a 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -378,10 +378,6 @@ void Client::GoFish() } if (inst) { - std::vector args; - args.push_back(inst); - parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args); - if (player_event_logs.IsEventEnabled(PlayerEvent::FISH_SUCCESS)) { auto e = PlayerEvent::FishSuccessEvent{ .item_id = inst->GetItem()->ID, @@ -390,6 +386,11 @@ void Client::GoFish() RecordPlayerEventLog(PlayerEvent::FISH_SUCCESS, e); } + + if (parse->PlayerHasQuestSub(EVENT_FISH_SUCCESS)) { + std::vector args = { inst }; + parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args); + } } } } @@ -408,8 +409,10 @@ void Client::GoFish() MessageString(Chat::Skills, FISHING_FAILED); //You didn't catch anything. } - parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0); RecordPlayerEventLog(PlayerEvent::FISH_FAILURE, PlayerEvent::EmptyEvent{}); + if (parse->PlayerHasQuestSub(EVENT_FISH_FAILURE)) { + parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0); + } } //chance to break fishing pole... @@ -508,10 +511,6 @@ void Client::ForageItem(bool guarantee) { } if (inst) { - std::vector args; - args.push_back(inst); - parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst->GetID(), &args); - if (player_event_logs.IsEventEnabled(PlayerEvent::FORAGE_SUCCESS)) { auto e = PlayerEvent::ForageSuccessEvent{ .item_id = inst->GetItem()->ID, @@ -519,6 +518,11 @@ void Client::ForageItem(bool guarantee) { }; RecordPlayerEventLog(PlayerEvent::FORAGE_SUCCESS, e); } + + if (parse->PlayerHasQuestSub(EVENT_FORAGE_SUCCESS)) { + std::vector args = { inst }; + parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst->GetID(), &args); + } } } @@ -529,8 +533,11 @@ void Client::ForageItem(bool guarantee) { } } else { MessageString(Chat::Skills, FORAGE_FAILED); - parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); RecordPlayerEventLog(PlayerEvent::FORAGE_FAILURE, PlayerEvent::EmptyEvent{}); + + if (parse->PlayerHasQuestSub(EVENT_FORAGE_FAILURE)) { + parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); + } } CheckIncreaseSkill(EQ::skills::SkillForage, nullptr, 5);