mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Quest API] Add Lua handlers for zone controller events (#2514)
This cleans up some of the NPC::Death event dispatch code. Adds handlers for EVENT_SPAWN_ZONE and EVENT_DEATH_ZONE used by zone controller and fixes the death handler exports which were incorrect.
This commit is contained in:
+1
-11
@@ -729,17 +729,7 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
||||
entity_list.ScanCloseMobs(npc->close_mobs, npc, true);
|
||||
|
||||
/* Zone controller process EVENT_SPAWN_ZONE */
|
||||
if (RuleB(Zone, UseZoneController)) {
|
||||
auto controller = entity_list.GetNPCByNPCTypeID(ZONE_CONTROLLER_NPC_ID);
|
||||
if (controller && npc->GetNPCTypeID() != ZONE_CONTROLLER_NPC_ID){
|
||||
std::string export_string = fmt::format(
|
||||
"{} {}",
|
||||
npc->GetID(),
|
||||
npc->GetNPCTypeID()
|
||||
);
|
||||
parse->EventNPC(EVENT_SPAWN_ZONE, controller, nullptr, export_string, 0);
|
||||
}
|
||||
}
|
||||
npc->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, npc, "", 0, nullptr);
|
||||
|
||||
/**
|
||||
* Set whether NPC was spawned in or out of water
|
||||
|
||||
Reference in New Issue
Block a user