• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Special Upgrade system

LUA:
local config = {
	[{7898, 9776}] = 25,
	[{7901, 9778}] = 30
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local position = toPosition.x == 0xFFFF and getThingPosition(cid) or toPosition
	
	for i, chance in pairs(config) do
		if(itemEx.itemid == i[1]) then
			local percent = math.random(1, 100)
			if(percent <= chance) then
				doTransformItem(itemEx.uid, i[2])
				doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
				doCreatureSay(cid, "Success!", TALKTYPE_MONSTER, nil, nil, position)
			else
				doSendMagicEffect(position, CONST_ME_POFF)
				doCreatureSay(cid, "Oops, try again!", TALKTYPE_MONSTER, nil, nil, position)
			end
			
			doRemoveItem(item.uid, 1)
		end
	end

	return true
end
 
Last edited:
Back
Top