Skip to content

Commit

Permalink
feature: streak level and checks improvements (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Feb 23, 2024
1 parent 42e46b9 commit 2d707ee
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 2 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
3 changes: 3 additions & 0 deletions data-otservbr-global/scripts/creaturescripts/others/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function playerLogin.onLogin(player)
else
player:openChannel(3) -- World chat
player:openChannel(5) -- Advertsing main
if player:getGuild() then
player:openChannel(0x00) -- guild
end
end
return true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ function removeEmptyParcelsEvent.onLogin(player)
end

if #emptyParcelsToRemove > 0 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, #emptyParcelsToRemove .. " empty parcels were removed from your store inbox!")
for _, parcel in pairs(emptyParcelsToRemove) do
parcel:remove()
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, #emptyParcelsToRemove .. " empty parcels were removed from your store inbox!")
end
return true
end
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
2 changes: 1 addition & 1 deletion data/scripts/lib/register_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function onUseRope(player, item, fromPosition, target, toPosition, isHotkey)
end

local tile = Tile(toPosition)
if tile:isRopeSpot() then
if tile and tile:isRopeSpot() then
player:teleportTo(toPosition:moveUpstairs())
if target.itemid == 7762 then
if player:getStorageValue(Storage.RookgaardTutorialIsland.TutorialHintsStorage) < 22 then
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 2d707ee

Please sign in to comment.