mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-23 19:02:25 +00:00
[Bug Fix] Fix Killed XYZH support in EVENT_DEATH in Perl. (#3591)
* [Bug Fix] Fix Killer XYZH support in EVENT_DEATH in Perl. # Notes - Fixes XYZH exports in Perl. * Update embparser.cpp
This commit is contained in:
parent
65d4533568
commit
9b992167f0
@ -1741,7 +1741,8 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) {
|
std::vector<std::any> args = { CastToMob() };
|
||||||
|
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) {
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@ -2388,7 +2389,8 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
std::vector<std::any> args = { CastToMob() };
|
||||||
|
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) {
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@ -2405,7 +2407,9 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
|
||||||
|
std::vector<std::any> args = { CastToMob() };
|
||||||
|
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) {
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1836,27 +1836,16 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_DEATH_ZONE:
|
case EVENT_DEATH: {
|
||||||
case EVENT_DEATH:
|
|
||||||
case EVENT_DEATH_COMPLETE: {
|
|
||||||
Seperator sep(data);
|
Seperator sep(data);
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
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_damage", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
||||||
if (extra_pointers && extra_pointers->size() >= 1)
|
|
||||||
{
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
Mob* killed = std::any_cast<Mob*>(extra_pointers->at(0));
|
||||||
if (corpse)
|
if (killed) {
|
||||||
{
|
|
||||||
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (extra_pointers && extra_pointers->size() >= 2)
|
|
||||||
{
|
|
||||||
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
|
||||||
if (killed)
|
|
||||||
{
|
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
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_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_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
||||||
@ -1866,6 +1855,38 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case EVENT_DEATH_ZONE:
|
||||||
|
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 (extra_pointers && extra_pointers->size() >= 1) {
|
||||||
|
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
||||||
|
if (corpse) {
|
||||||
|
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 2) {
|
||||||
|
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
||||||
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user