[Quest API] Export $spawned to EVENT_SPAWN_ZONE in Perl (#2877)

* [Quest API] Export $spawned to EVENT_SPAWN_ZONE in Perl

# Notes
- Exports `$spawned` to `EVENT_SPAWN_ZONE` in Perl.
- Allows operators to use the mob reference instead of having to grab it from entity list.

* Optional parsing.
This commit is contained in:
Alex King
2023-02-13 00:46:01 -05:00
committed by GitHub
parent 5ef8f8c3a8
commit 4a1d026215
3 changed files with 15 additions and 4 deletions
+8 -2
View File
@@ -8370,7 +8370,11 @@ void EntityList::AddBot(Bot *new_bot, bool send_spawn_packet, bool dont_queue) {
new_bot->SetID(GetFreeID());
bot_list.push_back(new_bot);
mob_list.insert(std::pair<uint16, Mob*>(new_bot->GetID(), new_bot));
parse->EventBot(EVENT_SPAWN, new_bot, nullptr, "", 0);
if (parse->BotHasQuestSub(EVENT_SPAWN)) {
parse->EventBot(EVENT_SPAWN, new_bot, nullptr, "", 0);
}
new_bot->SetSpawned();
if (send_spawn_packet) {
if (dont_queue) {
@@ -8388,7 +8392,9 @@ void EntityList::AddBot(Bot *new_bot, bool send_spawn_packet, bool dont_queue) {
}
}
new_bot->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, new_bot, "", 0, nullptr);
if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_SPAWN_ZONE)) {
new_bot->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, new_bot, "", 0, nullptr);
}
}
}