mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Dynamic Zones] Implement dz templates (#2345)
This allows shared tasks to create dz instances automatically through the `dz_template_id` field instead of using quest scripts. Quest apis were also added to create expeditions from template ids.
This commit is contained in:
@@ -1192,6 +1192,8 @@ bool Zone::Init(bool is_static) {
|
||||
petition_list.ClearPetitions();
|
||||
petition_list.ReadDatabase();
|
||||
|
||||
LoadDynamicZoneTemplates();
|
||||
|
||||
LogInfo("Loading dynamic zones");
|
||||
DynamicZone::CacheAllFromDatabase();
|
||||
|
||||
@@ -2812,3 +2814,13 @@ void Zone::SendDiscordMessage(const std::string& webhook_name, const std::string
|
||||
LogDiscord("[SendDiscordMessage] Did not find valid webhook by webhook name [{}]", webhook_name);
|
||||
}
|
||||
}
|
||||
|
||||
void Zone::LoadDynamicZoneTemplates()
|
||||
{
|
||||
dz_template_cache.clear();
|
||||
auto dz_templates = DynamicZoneTemplatesRepository::All(content_db);
|
||||
for (const auto& dz_template : dz_templates)
|
||||
{
|
||||
dz_template_cache[dz_template.id] = dz_template;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user