diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 04c6086e7f4..ce4c22100e5 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -86,7 +86,6 @@ Storage = { WagonTicket = 30009, FirstMageWeapon = 30011, KawillBlessing = 30014, - RentedHorseTimer = 30015, FountainOfLife = 30016, -- Promotion Storage cannot be changed, it is set in source code Promotion = 30018, @@ -2340,7 +2339,9 @@ Storage = { Addon1 = 43353, Addon2 = 43354, }, - HorseStationWorldChange = {}, + HorseStationWorldChange = { + Timer = 43355, + }, InsectoidInvasionWorldChange = {}, LooseEnds = {}, OverhuntingWorldChange = {}, diff --git a/data-otservbr-global/npc/appaloosa.lua b/data-otservbr-global/npc/appaloosa.lua index 7031d711207..6d48969d8c4 100644 --- a/data-otservbr-global/npc/appaloosa.lua +++ b/data-otservbr-global/npc/appaloosa.lua @@ -82,7 +82,7 @@ local function creatureSayCallback(npc, creature, type, message) destination:sendMagicEffect(CONST_ME_TELEPORT) npcHandler:say("Have a nice trip!", npc, creature) elseif npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.RentedHorseTimer) >= os.time() then + if player:getStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer) >= os.time() then npcHandler:say("You already have a horse.", npc, creature) return true end @@ -94,7 +94,7 @@ local function creatureSayCallback(npc, creature, type, message) local mountId = { 22, 25, 26 } player:addMount(mountId[math.random(#mountId)]) - player:setStorageValue(Storage.RentedHorseTimer, os.time() + 86400) + player:setStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer, os.time() + 86400) player:addAchievement("Natural Born Cowboy") npcHandler:say("I'll give you one of our experienced ones. Take care! Look out for low hanging branches.", npc, creature) end diff --git a/data-otservbr-global/npc/palomino.lua b/data-otservbr-global/npc/palomino.lua index 6be58366c8b..66ab3857716 100644 --- a/data-otservbr-global/npc/palomino.lua +++ b/data-otservbr-global/npc/palomino.lua @@ -83,7 +83,7 @@ local function creatureSayCallback(npc, creature, type, message) destination:sendMagicEffect(CONST_ME_TELEPORT) npcHandler:say("Have a nice trip!", npc, creature) elseif npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.RentedHorseTimer) >= os.time() then + if player:getStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer) >= os.time() then npcHandler:say("You already have a horse.", npc, creature) return true end @@ -95,7 +95,7 @@ local function creatureSayCallback(npc, creature, type, message) local mountId = { 22, 25, 26 } player:addMount(mountId[math.random(#mountId)]) - player:setStorageValue(Storage.RentedHorseTimer, os.time() + 86400) + player:setStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer, os.time() + 86400) player:addAchievement("Natural Born Cowboy") npcHandler:say("I'll give you one of our experienced ones. Take care! Look out for low hanging branches.", npc, creature) end diff --git a/data-otservbr-global/scripts/globalevents/others/check_mount.lua b/data-otservbr-global/scripts/globalevents/others/check_mount.lua index 85c4ece1c82..497ec1a0415 100644 --- a/data-otservbr-global/scripts/globalevents/others/check_mount.lua +++ b/data-otservbr-global/scripts/globalevents/others/check_mount.lua @@ -10,7 +10,7 @@ function rentedMounts.onThink(interval) local player, outfit for i = 1, #players do player = players[i] - if player:getStorageValue(Storage.RentedHorseTimer) < 1 or player:getStorageValue(Storage.RentedHorseTimer) >= os.time() then + if player:getStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer) < 1 or player:getStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer) >= os.time() then break end @@ -24,7 +24,7 @@ function rentedMounts.onThink(interval) player:removeMount(mountIds[m]) end - player:setStorageValue(Storage.RentedHorseTimer, -1) + player:setStorageValue(Storage.Quest.U9_1.HorseStationWorldChange.Timer, -1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your contract with your horse expired and it returned back to the horse station.") end return true