local migrationStoragetokv = {
	{ storageOld = 10061, questName = "behemothquest1" }, -- Storage.Quest.U7_2.Behemoth.Bag
	{ storageOld = 10062, questName = "behemothquest2" }, -- Storage.Quest.U7_2.Behemoth.GuardianHalberd
	{ storageOld = 10063, questName = "behemothquest3" }, -- Storage.Quest.U7_2.Behemoth.DemonShield
	{ storageOld = 10064, questName = "behemothquest4" }, -- Storage.Quest.U7_2.Behemoth.GoldenArmor
	{ storageOld = 51763, questName = "doublet" }, -- Storage.QuestChests.DoubletQuest
	{ storageOld = 51764, questName = "honeyflower" }, -- Storage.QuestChests.HoneyFlower
	{ storageOld = 40125, questName = "ringquest1" }, -- Storage.Quest.U7_1.Ring.Rewards.TimeRing
	{ storageOld = 40126, questName = "ringquest2" }, -- Storage.Quest.U7_1.Ring.Rewards.SwordRing
	{ storageOld = 40111, questName = "AlawarsVault1" }, -- Storage.Quest.U6_5.AlawarsVault.Rewards.WhitePearl
	{ storageOld = 40112, questName = "AlawarsVault2" }, -- Storage.Quest.U6_5.AlawarsVault.Rewards.Broadsword
	{ storageOld = 40121, questName = "Blackknight1" }, -- Storage.Quest.U7_1.BlackKnight.Rewards.CrownArmor
	{ storageOld = 40122, questName = "Blackknight2" }, -- Storage.Quest.U7_1.BlackKnight.Rewards.CrownShield
	{ storageOld = 40127, questName = "timering1" }, -- Storage.Quest.U7_1.TimeRing.Rewards.CrystallBall
	{ storageOld = 40128, questName = "timering2" }, -- Storage.Quest.U7_1.TimeRing.Rewards.TimeRing
	{ storageOld = 40129, questName = "timering3" }, -- Storage.Quest.U7_1.TimeRing.Rewards.ElvenAmulet
	{ storageOld = 30005, questName = "platearmor" }, -- Storage.GhostShipQuest
	{ storageOld = 51744, questName = "silverbrooch" }, -- Storage.QuestChests.SilverBrooch
	{ storageOld = 51749, questName = "sixrubies" }, -- Storage.QuestChests.SixRubiesQuest
	{ storageOld = 20021, questName = "legiondawnport" }, -- Storage.Quest.U10_55.SanctuaryOfTheLizardGod.LegionHelmet
	{ storageOld = 30059, questName = "battleaxe" }, -- Storage.BattleAxeQuest
	{ storageOld = 30010, questName = "deeperfibula1" }, -- Storage.BloodHerbQuest
	{ storageOld = 40001, questName = "deeperfibula2" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.TowerShield
	{ storageOld = 40002, questName = "deeperfibula3" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.WarriorHelmet
	{ storageOld = 40003, questName = "deeperfibula4" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.DwarvenRing
	{ storageOld = 40004, questName = "deeperfibula5" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.ElvenAmulet
	{ storageOld = 40005, questName = "deeperfibula6" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.KnightAxe
	{ storageOld = 40008, questName = "shortswordbook" }, -- Storage.Quest.PreU6_0.ShortSword.Rewards.Book
	{ storageOld = 40009, questName = "lighthouse1" }, -- Storage.Quest.PreU6_0.ThaisLighthouse.Rewards.BattleHammer
	{ storageOld = 40010, questName = "lighthouse2" }, -- Storage.Quest.PreU6_0.ThaisLighthouse.Rewards.DarkShield
	{ storageOld = 40021, questName = "bananafree" }, -- Storage.Quest.U6_0.StuddedShield.Rewards.BananaFre
	{ storageOld = 40022, questName = "bananapremium" }, -- Storage.Quest.U6_0.StuddedShield.Rewards.BananaPremium
	{ storageOld = 40032, questName = "explorerbrooch" }, -- Storage.Quest.U6_1.ExplorerBrooch.Brooch
	{ storageOld = 40033, questName = "orcfortress1" }, -- Storage.Quest.U6_1.OrcFortress.Rewards.KnightAxe
	{ storageOld = 40034, questName = "orcfortress2" }, -- Storage.Quest.U6_1.ExplorerBrooch.KnightArmor
	{ storageOld = 40035, questName = "orcfortress3" }, -- Storage.Quest.U6_1.ExplorerBrooch.FireSword
	{ storageOld = 40051, questName = "draconia1" }, -- Storage.Quest.U6_2.Draconia.Rewards.BagWithWeapons
	{ storageOld = 40052, questName = "draconia2" }, -- Storage.Quest.U6_2.Draconia.Rewards.BagWithAmulets
	{ storageOld = 40071, questName = "adoreduh" }, -- Storage.Quest.U6_4.AdornedUHRune.Rewards.SilverRuneEmblem
	{ storageOld = 40072, questName = "barbarianaxe1" }, -- Storage.Quest.U6_4.BarbarianAxe.Rewards.BarbarianAxe
	{ storageOld = 40073, questName = "barbarianaxe2" }, -- Storage.Quest.U6_4.BarbarianAxe.Rewards.Scimitar
	{ storageOld = 40075, questName = "darkarmor" }, -- Storage.Quest.U6_4.DarkArmor.Rewards.Armor
	{ storageOld = 40079, questName = "doublehero1" }, -- Storage.Quest.U6_4.DoubleHero.Rewards.RedGem
	{ storageOld = 40080, questName = "doublehero2" }, -- Storage.Quest.U6_4.DoubleHero.Rewards.ClubRing
	{ storageOld = 40081, questName = "edrongoblin1" }, -- Storage.Quest.U6_4.EdronGoblin.Rewards.SilverAmulet
	{ storageOld = 40082, questName = "edrongoblin2" }, -- Storage.Quest.U6_4.EdronGoblin.Rewards.SteelShield
	{ storageOld = 40083, questName = "fireaxe1" }, -- Storage.Quest.U6_4.FireAxe.Rewards.Bag
	{ storageOld = 40084, questName = "fireaxe2" }, -- Storage.Quest.U6_4.FireAxe.Rewards.FireAxe
	{ storageOld = 40085, questName = "poisondaggers" }, -- Storage.Quest.U6_4.PoisonDaggers.Rewards.BackpackReward
	{ storageOld = 40086, questName = "shamantreasure" }, -- Storage.Quest.U6_4.ShamanTreasure.Rewards.BlankRunes
	{ storageOld = 40089, questName = "vampireshield1" }, -- Storage.Quest.U6_4.VampireShield.Rewards.StrangeSymbol
	{ storageOld = 40090, questName = "vampireshield2" }, -- Storage.Quest.U6_4.VampireShield.Rewards.DragonLance
	{ storageOld = 40091, questName = "vampireshield3" }, -- Storage.Quest.U6_4.VampireShield.Rewards.VampireShield
	{ storageOld = 40087, questName = "trollcave1" }, -- Storage.Quest.U6_4.TrollCave.Rewards.GarlicNecklace
	{ storageOld = 40088, questName = "trollcave2" }, -- Storage.Quest.U6_4.TrollCave.Rewards.BrassLegs
	{ storageOld = 40092, questName = "weddingring1" }, -- Storage.Quest.U6_4.WeddingRing.Rewards.DragonNecklace
	{ storageOld = 40093, questName = "weddingring2" }, -- Storage.Quest.U6_4.WeddingRing.Rewards.WeedingRing
	{ storageOld = 10097, questName = "madmageroom1" }, -- Storage.Quest.U7_24.MadMageRoom.StarAmulet
	{ storageOld = 10098, questName = "madmageroom2" }, -- Storage.Quest.U7_24.MadMageRoom.Hat
	{ storageOld = 10099, questName = "madmageroom3" }, -- Storage.Quest.U7_24.MadMageRoom.StoneSkinAmulet
	{ storageOld = 40007, questName = "ornamentedshield" }, -- Storage.Quest.PreU6_0.OrnamentedShield.Rewards.TimeRing
	{ storageOld = 40036, questName = "panpipe" }, -- Storage.Quest.U6_1.Panpipe.Rewards.Panpipe
}

local function migrate(player)
	for _, scrollTable in ipairs(migrationStoragetokv) do
		local oldStorage = player:getStorageValue(scrollTable.storageOld)
		if oldStorage > 0 then
			player:questKV(scrollTable.questName):set("completed", true)
			player:setStorageValue(scrollTable.storageOld, -1)
		end
	end
end

local migration = Migration("20241715984294_quests_storages_to_kv")

function migration:onExecute()
	self:forEachPlayer(migrate)
end

migration:register()
