diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index fa2a48aa5..69255073b 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1815,12 +1815,18 @@ void Mob::AI_Event_NoLongerEngaged() { StopNavigation(); ClearRampage(); - parse->EventBotMercNPC(EVENT_COMBAT, this, nullptr, [&]() { return "0"; }); - if (IsNPC()) { SetPrimaryAggro(false); SetAssistAggro(false); - if (CastToNPC()->GetCombatEvent() && GetHP() > 0) { + if ( + CastToNPC()->GetCombatEvent() && + GetHP() > 0 && + entity_list.GetNPCByID(GetID()) + ) { + if (parse->HasQuestSub(GetNPCTypeID(), EVENT_COMBAT)) { + parse->EventNPC(EVENT_COMBAT, CastToNPC(), nullptr, "0", 0); + } + const uint32 emote_id = CastToNPC()->GetEmoteID(); if (emote_id) { CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::LeaveCombat, emote_id); @@ -1829,6 +1835,8 @@ void Mob::AI_Event_NoLongerEngaged() { m_combat_record.Stop(); CastToNPC()->SetCombatEvent(false); } + } else { + parse->EventBotMerc(EVENT_COMBAT, this, nullptr, [&]() { return "0"; }); } }