[Commands] Cleanup #emotesearch and #emoteview Command. (#2494)

* [Commands] Cleanup #emoteview Command.

Cleanup command messages and logic.

Add constants for Emote Events and Emote Types and replace all the old constants with the new constants.

* Update emoteview.cpp

* Cleanup #emotesearch Command.
This commit is contained in:
Kinglykrab
2022-10-29 21:22:17 -04:00
committed by GitHub
parent dcbc9a358f
commit 53dcd14534
11 changed files with 266 additions and 109 deletions
+4 -4
View File
@@ -1802,7 +1802,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
uint32 emoteid = killerMob->GetEmoteID();
if (emoteid != 0)
killerMob->CastToNPC()->DoNPCEmote(KILLEDPC, emoteid);
killerMob->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledPC, emoteid);
killerMob->TrySpellOnKill(killed_level, spell);
}
@@ -2650,7 +2650,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
ApplyIllusionToCorpse(illusion_spell_id, corpse);
if (killer != 0 && emoteid != 0)
corpse->CastToNPC()->DoNPCEmote(AFTERDEATH, emoteid);
corpse->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::AfterDeath, emoteid);
if (killer != 0 && killer->IsClient()) {
corpse->AllowPlayerLoot(killer, 0);
if (killer->IsGrouped()) {
@@ -2734,12 +2734,12 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
uint32 emoteid = GetEmoteID();
if (emoteid != 0)
DoNPCEmote(ONDEATH, emoteid);
DoNPCEmote(EQ::constants::EmoteEventTypes::OnDeath, emoteid);
if (oos->IsNPC()) {
parse->EventNPC(EVENT_NPC_SLAY, oos->CastToNPC(), this, "", 0);
uint32 emoteid = oos->GetEmoteID();
if (emoteid != 0)
oos->CastToNPC()->DoNPCEmote(KILLEDNPC, emoteid);
oos->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledNPC, emoteid);
killer_mob->TrySpellOnKill(killed_level, spell);
}
}