diff --git a/zone/attack.cpp b/zone/attack.cpp index 667c361a5..2827d3cbb 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1741,8 +1741,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill static_cast(attack_skill) ); - std::vector args = { CastToMob() }; - if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) { + if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) { if (GetHP() < 0) { SetHP(0); } @@ -2389,8 +2388,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy static_cast(attack_skill) ); - std::vector args = { CastToMob() }; - if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) { + if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) { if (GetHP() < 0) { SetHP(0); } @@ -2407,9 +2405,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy spell, static_cast(attack_skill) ); - - std::vector args = { CastToMob() }; - if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) { + if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) { if (GetHP() < 0) { SetHP(0); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index ebcbf6612..b64c8d8f8 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1875,55 +1875,27 @@ void PerlembParser::ExportEventVariables( break; } - case EVENT_DEATH: { - Seperator sep(data); - ExportVar(package_name.c_str(), "killer_id", sep.arg[0]); - ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]); - ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]); - ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]); - - if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) { - ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]); - } - - if (extra_pointers && extra_pointers->size() == 1) { - Mob* killed = std::any_cast(extra_pointers->at(0)); - if (killed) { - ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID()); - ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0); - ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0); - ExportVar(package_name.c_str(), "killed_x", killed->GetX()); - ExportVar(package_name.c_str(), "killed_y", killed->GetY()); - ExportVar(package_name.c_str(), "killed_z", killed->GetZ()); - ExportVar(package_name.c_str(), "killed_h", killed->GetHeading()); - } - } - - break; - } - case EVENT_DEATH_ZONE: + case EVENT_DEATH: case EVENT_DEATH_COMPLETE: { Seperator sep(data); ExportVar(package_name.c_str(), "killer_id", sep.arg[0]); ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]); ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]); ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]); - - if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) { - ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]); - } - - if (extra_pointers && extra_pointers->size() >= 1) { + if (extra_pointers && extra_pointers->size() >= 1) + { Corpse* corpse = std::any_cast(extra_pointers->at(0)); - if (corpse) { + if (corpse) + { ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID()); } } - - if (extra_pointers && extra_pointers->size() >= 2) { + if (extra_pointers && extra_pointers->size() >= 2) + { NPC* killed = std::any_cast(extra_pointers->at(1)); - if (killed) { + if (killed) + { ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID()); ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0); ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0); @@ -1933,7 +1905,6 @@ void PerlembParser::ExportEventVariables( ExportVar(package_name.c_str(), "killed_h", killed->GetHeading()); } } - break; }