From c2e7443f5b698c5d50d5b71a59493625bff61752 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 13 Nov 2024 13:54:40 -0300 Subject: [PATCH] fix: some changes --- src/game/scheduling/events_scheduler.cpp | 9 ++++++++- src/server/network/protocol/protocolgame.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/game/scheduling/events_scheduler.cpp b/src/game/scheduling/events_scheduler.cpp index e106f455712..01eca7cda8f 100644 --- a/src/game/scheduling/events_scheduler.cpp +++ b/src/game/scheduling/events_scheduler.cpp @@ -19,6 +19,7 @@ bool EventsScheduler::loadScheduleEventFromJson() { g_kv().scoped("eventscheduler")->remove("double-bestiary"); g_kv().scoped("eventscheduler")->remove("double-bosstiary"); g_kv().scoped("eventscheduler")->remove("fast-exercise"); + g_kv().scoped("eventscheduler")->remove("boss-cooldown"); using json = nlohmann::json; auto coreFolder = g_configManager().getString(CORE_DIRECTORY); @@ -106,20 +107,26 @@ bool EventsScheduler::loadScheduleEventFromJson() { if (rates.exprate != 100 && currentEventRates.exprate != 100 && rates.exprate == currentEventRates.exprate) { modifiedRates.emplace_back("exprate"); + g_eventsScheduler().setExpSchedule(rates.exprate); } if (rates.lootrate != 100 && currentEventRates.lootrate != 100 && rates.lootrate == currentEventRates.lootrate) { modifiedRates.emplace_back("lootrate"); + g_eventsScheduler().setLootSchedule(rates.lootrate); } if (rates.bosslootrate != 100 && currentEventRates.bosslootrate != 100 && rates.bosslootrate == currentEventRates.bosslootrate) { modifiedRates.emplace_back("bosslootrate"); + g_eventsScheduler().setBossLootSchedule(rates.bosslootrate); } if (rates.spawnrate != 100 && currentEventRates.spawnrate != 100 && rates.spawnrate == currentEventRates.spawnrate) { modifiedRates.emplace_back("spawnrate"); + g_eventsScheduler().setSpawnMonsterSchedule(rates.spawnrate); } if (rates.skillrate != 100 && currentEventRates.skillrate != 100 && rates.skillrate == currentEventRates.skillrate) { modifiedRates.emplace_back("skillrate"); + g_eventsScheduler().setSkillSchedule(rates.skillrate); } + // KV changes if (rates.forgeChance != 100 && currentEventRates.forgeChance != 100 && rates.forgeChance == currentEventRates.forgeChance) { modifiedRates.emplace_back("forge-chance"); g_kv().scoped("eventscheduler")->set("forge-chance", rates.forgeChance - 100); @@ -142,7 +149,7 @@ bool EventsScheduler::loadScheduleEventFromJson() { if (rates.bosscooldown != 100 && currentEventRates.bosscooldown != 100 && rates.bosscooldown == currentEventRates.bosscooldown) { modifiedRates.emplace_back("bosscooldown"); - g_kv().scoped("eventscheduler")->set("bosscooldown", rates.bosscooldown - 100); + g_kv().scoped("eventscheduler")->set("boss-cooldown", rates.bosscooldown - 100); } if (!modifiedRates.empty()) { diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 7c6badfe9be..11938b554fb 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -9132,7 +9132,7 @@ void ProtocolGame::sendBosstiaryCooldownTimer() { continue; } - auto scheduleTimerOpt = g_kv().scoped("eventscheduler")->get("bosscooldown"); + auto scheduleTimerOpt = g_kv().scoped("eventscheduler")->get("boss-cooldown"); uint8_t schedulePercentage = 0; if (scheduleTimerOpt) { schedulePercentage = static_cast(scheduleTimerOpt->getNumber());