[NPCs] Convert Load of NPC Emotes to Repositories (#3954)

* [NPCs] Convert Load of NPC Emotes to Repositories

- Convert `LoadNPCEmotes()` to repositories.

* Cleanup
This commit is contained in:
Alex King
2024-01-13 00:33:11 -05:00
committed by GitHub
parent 4c028b85f0
commit fc627ed52d
11 changed files with 112 additions and 90 deletions
+5 -6
View File
@@ -1800,9 +1800,9 @@ void Mob::AI_Event_Engaged(Mob *attacker, bool yell_for_help)
parse->EventNPC(EVENT_COMBAT, CastToNPC(), attacker, "1", 0);
}
auto emote_id = GetEmoteID();
const uint32 emote_id = GetEmoteID();
if (emote_id) {
CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::EnterCombat, emoteid, attacker);
CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::EnterCombat, emote_id, attacker);
}
std::string mob_name = GetCleanName();
@@ -1843,14 +1843,13 @@ void Mob::AI_Event_NoLongerEngaged() {
SetAssistAggro(false);
if (CastToNPC()->GetCombatEvent() && GetHP() > 0) {
if (entity_list.GetNPCByID(GetID())) {
auto emote_id = CastToNPC()->GetEmoteID();
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, emoteid);
CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::LeaveCombat, emote_id);
}
m_combat_record.Stop();
@@ -2120,7 +2119,7 @@ bool Mob::Rampage(ExtraAttackOptions *opts)
if (m_target == GetTarget()) {
continue;
}
if (m_target->IsCorpse()) {
LogAggroDetail("[{}] is on [{}]'s rampage list", m_target->GetCleanName(), GetCleanName());
RemoveFromRampageList(m_target, true);