forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: move wheel scrolls to kv (opentibiabr#2637)
- Loading branch information
Showing
5 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...obal/scripts/game_migrations/20241715984279_move_wheel_scrolls_from_storagename_to_kv.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local promotionScrolls = { | ||
{ oldScroll = "wheel.scroll.abridged", newScroll = "abridged" }, | ||
{ oldScroll = "wheel.scroll.basic", newScroll = "basic" }, | ||
{ oldScroll = "wheel.scroll.revised", newScroll = "revised" }, | ||
{ oldScroll = "wheel.scroll.extended", newScroll = "extended" }, | ||
{ oldScroll = "wheel.scroll.advanced", newScroll = "advanced" }, | ||
} | ||
|
||
local function migrate(player) | ||
for _, scrollTable in ipairs(promotionScrolls) do | ||
local oldStorage = player:getStorageValueByName(scrollTable.oldScroll) | ||
if oldStorage > 0 then | ||
player:kv():scoped("wheel-of-destiny"):scoped("scrolls"):set(scrollTable.newScroll, true) | ||
end | ||
end | ||
end | ||
|
||
local migration = Migration("20241715984279_move_wheel_scrolls_from_storagename_to_kv") | ||
|
||
function migration:onExecute() | ||
self:forEachPlayer(migrate) | ||
end | ||
|
||
migration:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters