From 841a38ae7799485e31c72bbeb2e2162ea83b1d1c Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 21 Feb 2024 10:50:39 -0300 Subject: [PATCH] Created new config 'startStreakLevel', will set reward streak level for new players. --- config.lua.dist | 2 ++ data/scripts/creaturescripts/player/login.lua | 4 ++++ src/config/config_enums.hpp | 1 + src/config/configmanager.cpp | 1 + 4 files changed, 8 insertions(+) diff --git a/config.lua.dist b/config.lua.dist index 3ba98113b19..2fd271a5457 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -237,6 +237,7 @@ onlyPremiumAccount = false -- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward -- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt -- NOTE: enablePlayerPutItemInAmmoSlot = true, will enable players to put any items on ammo slot, more used in custom shopping system +-- NOTE: startStreakLevel will make a reward streak level for new players who never logged in stashMoving = false depotChest = 4 autoLoot = false @@ -253,6 +254,7 @@ randomMonsterSpawn = false lootPouchMaxLimit = 2000 storeInboxMaxLimit = 2000 enablePlayerPutItemInAmmoSlot = false +startStreakLevel = 0 -- Teleport summon -- Set to true will never remove the summon diff --git a/data/scripts/creaturescripts/player/login.lua b/data/scripts/creaturescripts/player/login.lua index 1c008af20d1..2c1eb26f14b 100644 --- a/data/scripts/creaturescripts/player/login.lua +++ b/data/scripts/creaturescripts/player/login.lua @@ -25,6 +25,10 @@ function playerLoginGlobal.onLogin(player) if player:getLastLoginSaved() == 0 then loginStr = "Please choose your outfit." player:sendOutfitWindow() + local startStreakLevel = configManager.getNumber(configKeys.START_STREAK_LEVEL) + if startStreakLevel > 0 then + player:setStreakLevel(startStreakLevel) + end db.query("UPDATE `players` SET `istutorial` = 0 WHERE `id` = " .. player:getGuid()) else diff --git a/src/config/config_enums.hpp b/src/config/config_enums.hpp index 8c21bdfe1ac..0991534dfcd 100644 --- a/src/config/config_enums.hpp +++ b/src/config/config_enums.hpp @@ -251,6 +251,7 @@ enum ConfigKey_t : uint16_t { STAMINA_TRAINER_DELAY, STAMINA_TRAINER_GAIN, STAMINA_TRAINER, + START_STREAK_LEVEL, STASH_ITEMS, STASH_MOVING, STATUS_PORT, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 96c48ae2f69..c1aa13f9f37 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -310,6 +310,7 @@ bool ConfigManager::load() { loadIntConfig(L, STAMINA_PZ_GAIN, "staminaPzGain", 1); loadIntConfig(L, STAMINA_TRAINER_DELAY, "staminaTrainerDelay", 5); loadIntConfig(L, STAMINA_TRAINER_GAIN, "staminaTrainerGain", 1); + loadIntConfig(L, START_STREAK_LEVEL, "startStreakLevel", 0); loadIntConfig(L, STATUSQUERY_TIMEOUT, "statusTimeout", 5000); loadIntConfig(L, STORE_COIN_PACKET, "coinPacketSize", 25); loadIntConfig(L, STOREINBOX_MAXLIMIT, "storeInboxMaxLimit", 2000);