mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_DESPAWN and EVENT_DESPAWN_ZONE (#2887)
# Notes - Optionally parse these events instead of always doing so.
This commit is contained in:
parent
0e51131d67
commit
5ac5beb456
18
zone/npc.cpp
18
zone/npc.cpp
@ -1114,11 +1114,21 @@ void NPC::Depop(bool start_spawn_timer) {
|
||||
}
|
||||
|
||||
if (IsNPC()) {
|
||||
parse->EventNPC(EVENT_DESPAWN, this, nullptr, "", 0);
|
||||
DispatchZoneControllerEvent(EVENT_DESPAWN_ZONE, this, "", 0, nullptr);
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_DESPAWN)) {
|
||||
parse->EventNPC(EVENT_DESPAWN, this, nullptr, "", 0);
|
||||
}
|
||||
|
||||
if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_DESPAWN_ZONE)) {
|
||||
DispatchZoneControllerEvent(EVENT_DESPAWN_ZONE, this, "", 0, nullptr);
|
||||
}
|
||||
} else if (IsBot()) {
|
||||
parse->EventBot(EVENT_DESPAWN, CastToBot(), nullptr, "", 0);
|
||||
DispatchZoneControllerEvent(EVENT_DESPAWN_ZONE, this, "", 0, nullptr);
|
||||
if (parse->BotHasQuestSub(EVENT_DESPAWN)) {
|
||||
parse->EventBot(EVENT_DESPAWN, CastToBot(), nullptr, "", 0);
|
||||
}
|
||||
|
||||
if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_DESPAWN_ZONE)) {
|
||||
DispatchZoneControllerEvent(EVENT_DESPAWN_ZONE, this, "", 0, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
p_depop = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user