Skip to content

Commit

Permalink
Created new config 'startStreakLevel', will set reward streak level f…
Browse files Browse the repository at this point in the history
…or new players.
  • Loading branch information
elsongabriel committed Feb 22, 2024
1 parent de179ee commit 16a02ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -253,6 +254,7 @@ randomMonsterSpawn = false
lootPouchMaxLimit = 2000
storeInboxMaxLimit = 2000
enablePlayerPutItemInAmmoSlot = false
startStreakLevel = 0

-- Teleport summon
-- Set to true will never remove the summon
Expand Down
4 changes: 4 additions & 0 deletions data/scripts/creaturescripts/player/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/config/config_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/config/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,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);
Expand Down

0 comments on commit 16a02ed

Please sign in to comment.