Skip to content

Commit

Permalink
fix: migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Mar 22, 2024
1 parent d0d02c6 commit a364162
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
4 changes: 0 additions & 4 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,6 @@ Storage = {
DeeplingAnchor = 51023,
FirstOrientalAddon = 51024,
SecondOrientalAddon = 51025,
RoyalCostumeOutfit = 51026,
},
TheAncientTombs = {
-- Reserved storage from 50940 - 51059
Expand Down Expand Up @@ -2775,9 +2774,6 @@ Storage = {
CitizenOfIssaviOutfits = {},
RoyalBounaceanAdvisorOutfits = {},
},
U12_80 = { -- update 12.80 - Reserved Storages 47801 - 47850
RoyalCostumeOutfits = {},
},
U12_90 = { -- update 12.90 - Reserved Storages 47851 - 47900
PrimalOrdeal = {
QuestLine = 47851,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local function migrateGoldenOutfit(player)
local goldeOutfitStorageValue = 51015
local value = player:getStorageValue(goldeOutfitStorageValue)

if value > 0 then
player:kv():set("golden-outfit-quest", value)
player:setStorageValue(goldeOutfitStorageValue, -1)
end
end

local function migrateRoyalCostumeOutfit(player)
local royalCostumeStorageValue = 51026
local value = player:getStorageValue(royalCostumeStorageValue)

if value > 0 then
player:kv():set("royal-costume-outfit-quest", value)
player:setStorageValue(royalCostumeStorageValue, -1)
end
end

local migration = Migration("20241711122214_golden_and_royal_outfit_to_kv_storage")

function migration:onExecute()
self:forEachPlayer(migrateGoldenOutfit)
self:forEachPlayer(migrateRoyalCostumeOutfit)
end

migration:register()

This file was deleted.

This file was deleted.

0 comments on commit a364162

Please sign in to comment.