From d210b1e5ff2b36df04bca8a4c09bd01c41f553d8 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 12 Feb 2023 23:24:38 -0500 Subject: [PATCH] [Quest API] (Performance) Check event EVENT_SLAY exists before export and execute (#2910) * [Quest API] Optionally parse EVENT_SLAY # Notes - Optionally parse this event instead of always doing so. * Update attack.cpp --- zone/attack.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index f089c16ad..ff9ec7c8d 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1815,7 +1815,9 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill if (killerMob) { if (killerMob->IsNPC()) { - parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0); + if (parse->HasQuestSub(killerMob->GetNPCTypeID(), EVENT_SLAY)) { + parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0); + } mod_client_death_npc(killerMob); @@ -1826,7 +1828,10 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill killerMob->TrySpellOnKill(killed_level, spell); } else if (killerMob->IsBot()) { - parse->EventBot(EVENT_SLAY, killerMob->CastToBot(), this, "", 0); + if (parse->BotHasQuestSub(EVENT_SLAY)) { + parse->EventBot(EVENT_SLAY, killerMob->CastToBot(), this, "", 0); + } + killerMob->TrySpellOnKill(killed_level, spell); }