local voices = {
	[26364] = "Au au!",
	[26099] = "Grooaarr!"
}

local transformItems = {
	[1479] = 1480, [1480] = 1479,
	[1634] = 1635, [1635] = 1634,
	[1636] = 1637, [1637] = 1636,
	[1638] = 1639, [1639] = 1638,
	[1640] = 1641, [1641] = 1640,
	[1786] = 1787, [1787] = 1786,
	[1788] = 1789, [1789] = 1788,
	[1790] = 1791, [1791] = 1790,
	[1792] = 1793, [1793] = 1792,
	[1873] = 1874, [1874] = 1873,
	[1875] = 1876, [1876] = 1875,
	[1945] = 1946, [1946] = 1945,
	[2037] = 2038, [2038] = 2037,
	[2039] = 2040, [2040] = 2039,
	[2041] = 2042, [2042] = 2041,
	[2044] = 2045, [2045] = 2044,
	[2047] = 2048, [2048] = 2047,
	[2050] = 2051, [2051] = 2050,
	[2052] = 2053, [2053] = 2052,
	[2054] = 2055, [2055] = 2054,
	[2058] = 2059, [2059] = 2058,
	[2060] = 2061, [2061] = 2060,
	[2064] = 2065, [2065] = 2064,
	[2066] = 2067, [2067] = 2066,
	[2068] = 2069, [2069] = 2068,
	[2096] = 2097, [2097] = 2096,
	[2162] = 2163, [2163] = 2162,
	[2578] = 2579,
	[3697] = 3698, [3698] = 3697,
	[3699] = 3700, [3700] = 3699,
	[3947] = 3948, [3948] = 3947,
	[5812] = 5813, [5813] = 5812,
	[6489] = 6490, [6490] = 6489,
	[7058] = 7059, [7059] = 7058,
	[8684] = 8685, [8685] = 8684,
	[8686] = 8687, [8687] = 8686,
	[8688] = 8689, [8689] = 8688,
	[8690] = 8691, [8691] = 8690,
	[9575] = 9576, [9576] = 9575,
	[9577] = 9578, [9578] = 9577,
	[9579] = 9580, [9580] = 9579,
	[9581] = 9582, [9582] = 9581,
	[9747] = 9748, [9748] = 9747,
	[9749] = 9750, [9750] = 9749,
	[19691] = 19692, [19692] = 19691,
	[22869] = 22868, [22868] = 22869,
	[22871] = 22870, [22870] = 22871,
	[22872] = 22873, [22873] = 22872,
	[22874] = 22875, [22875] = 22874,
	[26094] = 26096, [26096] = 26094, [26095] = 26097, [26097] = 26095, --protectress lamp
	[26090] = 26092, [26092] = 26090, [26091] = 26093, [26093] = 26091, --predador lamp
	[26100] = 26101, [26101] = 26100, --hamster wheel
	[26107] = 26108, [26108] = 26107, --cat in a basket
	[26141] = 26142, [26142] = 26141, --barrel
	[26364] = 26365, [26365] = 26364, --dog house
	[26365] = 26353, [26353] = 26364, --dog house
	[22614] = 22615, [22615] = 22614, --beacon
	[25420] = 25421, [25421] = 25420, --ferumbras staff
	[24809] = 24810, [24810] = 24809, --skull
	[27100] = 27101, [27101] = 27100, --parrot
	[27102] = 27104, [27103] = 27102, --skull lamp
	[27888] = 27886, [27887] = 27888, --vengothic lamp
	[29314] = 29315, --spider terrarium
	[29317] = 29319, [29319] = 29317, --hrodmiran weapons rack
	[29320] = 29318, [29318] = 29320, --hrodmiran weapons rack side
	[29407] = 29405, [29408] = 29406, --snake terrarium
	[29409] = 29411, [29410] = 29412, --demon pet
	[32023] = 32070, --light of change empty to red
	[32070] = 33174, --light of change red to green
	[32036] = 32037, [32037] = 32036, --pile of alchemistic books
	[32258] = 32259, [32259] = 32258, --anglerfish lamp
	[32394] = 32395, [32395] = 32394, --fennec
	[32759] = 32761, [32761] = 32759, --bonelord statue
	[32760] = 32762, [32762] = 32760, --bonelord statue
	[32769] = 32771, [32771] = 32769, --scholar bust
	[32770] = 32772, [32772] = 32770, --scholar bust
	[32773] = 32775, [32775] = 32773, --scholar bust
	[32774] = 32776, [32776] = 32774, --scholar bust
	[33174] = 32026, --light of change green to blue
	[32026] = 32023, --light of change blue to empty
	[33491] = 33492, [33492] = 33491, --fluorescent fungi
	[33493] = 33494, [33494] = 33493, --luminescent fungi
	[33495] = 33496, [33496] = 33495, --glowing sulphur fungi
	[33497] = 33498, [33498] = 33497, --gloomy poisonous fungi
	[35031] = 35032, [35032] = 35031, --festive tree
	[35042] = 35043, [35043] = 35042, --festive pyramid
	[36031] = 36032, [36032] = 36031, --crystal lamp
	[36048] = 36050, [36050] = 36048, --idol lamp
	[36049] = 36051, [36051] = 36049, --idol lamp side
	[36516] = 36517, [36517] = 36516, --hedgehog
	[36518] = 36519, [36519] = 36518, --exalted sarcophagus
	[36530] = 36531, [36531] = 36530, --curly hortensis lamp
	[36532] = 36533, [36533] = 36532, --little big flower lamp
	[36509] = 36510, --omniscient owl
}

local transformTo = Action()

function transformTo.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if (voices[item:getId()]) then
		local spectators = Game.getSpectators(fromPosition, false, true, 3, 3)
		for i = 1, #spectators do
			player:say(voices[item:getId()], TALKTYPE_MONSTER_SAY, false, spectators[i], fromPosition)
		end
	end

	item:transform(transformItems[item.itemid])
	item:decay()
	return true
end

for index, value in pairs(transformItems) do
	transformTo:id(index)
end

transformTo:register()
