mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-25 10:01:30 +00:00
[Quest API] Export $killed_npc to EVENT_NPC_SLAY to Perl (#2879)
# Notes - Exports `$killed_npc` to `EVENT_NPC_SLAY` to Perl. - Allows operators to use NPC reference in event instead of just NPC ID.
This commit is contained in:
parent
3813162bac
commit
c64591b8f7
@ -2790,7 +2790,10 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oos->IsNPC()) {
|
if (oos->IsNPC()) {
|
||||||
parse->EventNPC(EVENT_NPC_SLAY, oos->CastToNPC(), this, "", 0);
|
if (parse->HasQuestSub(oos->GetNPCTypeID(), EVENT_NPC_SLAY)) {
|
||||||
|
parse->EventNPC(EVENT_NPC_SLAY, oos->CastToNPC(), this, "", 0);
|
||||||
|
}
|
||||||
|
|
||||||
auto emote_id = oos->GetEmoteID();
|
auto emote_id = oos->GetEmoteID();
|
||||||
if (emote_id) {
|
if (emote_id) {
|
||||||
oos->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledNPC, emote_id);
|
oos->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledNPC, emote_id);
|
||||||
@ -2801,7 +2804,10 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (killer_mob && killer_mob->IsBot()) {
|
if (killer_mob && killer_mob->IsBot()) {
|
||||||
parse->EventBot(EVENT_NPC_SLAY, killer_mob->CastToBot(), this, "", 0);
|
if (parse->BotHasQuestSub(EVENT_NPC_SLAY)) {
|
||||||
|
parse->EventBot(EVENT_NPC_SLAY, killer_mob->CastToBot(), this, "", 0);
|
||||||
|
}
|
||||||
|
|
||||||
killer_mob->TrySpellOnKill(killed_level, spell);
|
killer_mob->TrySpellOnKill(killed_level, spell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1591,6 +1591,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
|
|
||||||
case EVENT_NPC_SLAY: {
|
case EVENT_NPC_SLAY: {
|
||||||
ExportVar(package_name.c_str(), "killed", mob->GetNPCTypeID());
|
ExportVar(package_name.c_str(), "killed", mob->GetNPCTypeID());
|
||||||
|
ExportVar(package_name.c_str(), "killed_npc", "NPC", mob->CastToNPC());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user