• 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!

{Request} Shiny Stone(11221)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
You can get Gold Coin, Platinum Coin, Small Diamond, Crystal Coin, and more items by refining it (using with a Pick).

Can some1 help me to make it works 100% ?
I tried but only fail :D
 
Edit your pick.lua:
Code:
[B][COLOR="red"]local items = {
-- 	[chance] = {item, min, max}
	[{1,  40}] = {2148, 25, 90},
	[{41, 45}] = {2160, 1, 3},
	[{46, 55}] = {2152, 1, 20},
	[{56, 65}] = {2145, 1, 10},
	[{66,100}] = {},
}
[/COLOR][/B]
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local itemGround = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
	if(isInArray(SPOTS, itemGround.itemid) and isInArray({354, 355}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)

		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return true
	end

	if(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		return true
	end

[B][COLOR="red"]	if(itemEx.itemid == 11221) then
		local random = math.random(100)
		for k, v in pairs(items) do
			if(random >= k[1] and random <= k[2]) then
				doRemoveItem(itemEx.uid, 1)
				if #v > 0 then
					doPlayerAddItem(cid, v[1], v[2] and (v[3] and math.random(v[2], v[3]) or v[2]) or 1)
					doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
				else
					doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
				end
				return true
			end
		end
	end[/COLOR][/B]
	
	return false
end
 
Edit your pick.lua:
Code:
[B][COLOR="red"]local items = {
-- 	[chance] = {item, min, max}
	[{1,  40}] = {2148, 25, 90},
	[{41, 45}] = {2160, 1, 3},
	[{46, 55}] = {2152, 1, 20},
	[{56, 65}] = {2145, 1, 10},
	[{66,100}] = {},
}
[/COLOR][/B]
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local itemGround = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
	if(isInArray(SPOTS, itemGround.itemid) and isInArray({354, 355}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)

		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return true
	end

	if(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		return true
	end

[B][COLOR="red"]	if(itemEx.itemid == 11221) then
		local random = math.random(100)
		for k, v in pairs(items) do
			if(random >= k[1] and random <= k[2]) then
				doRemoveItem(itemEx.uid, 1)
				if #v > 0 then
					doPlayerAddItem(cid, v[1], v[2] and (v[3] and math.random(v[2], v[3]) or v[2]) or 1)
					doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
				else
					doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
				end
				return true
			end
		end
	end[/COLOR][/B]
	
	return false
end

Thank you, working fine rep++
 
Last edited:
Lua:
local items = {
-- 	[chance] = {item, min, max}
	[{1,  40}] = {2148, 25, 90},
	[{41, 45}] = {2160, 1, 3},
	[{46, 55}] = {2152, 1, 20},
	[{56, 65}] = {2145, 1, 10},
	[{66,100}] = {},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.itemid == 11221) then
		local random = math.random(100)
		for k, v in pairs(items) do
			if(random >= k[1] and random <= k[2]) then
				doRemoveItem(itemEx.uid, 1)
				if #v > 0 then
					doPlayerAddItem(cid, v[1], v[2] and (v[3] and math.random(v[2], v[3]) or v[2]) or 1)
					doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
				else
					doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
				end
				break
			end
		end
	elseif(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
	elseif not isInArray({0,65535}, toPosition.x) then
		local itemGround = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
		if(isInArray(SPOTS, itemGround.itemid) and isInArray({354, 355}, itemEx.itemid)) then
			doTransformItem(itemEx.uid, 392)
			doDecayItem(itemEx.uid)

			doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
	else
		return false
	end
	return true
end
 
Back
Top Bottom