raf
Active Member
Hi, i've already tried to do this with remaking rust remover script, but when i use muck remover on mucus plug (and mucus plug is 2+ in stack), it uses all mucus plugs in stack.
PHP:
local nTable = {
[18396] = {
{"crystal backpack", 16.41},
{"blue gem", 15.52},
{"glowing mushroom", 15.34},
{"violet crystal shard", 14.98},
{"blue crystal splinter", 14.53},
{"blue crystal shard", 14.08},
{"crystal mace", 4.93},
{"crystalline armor", 2.96},
{"crystalline sword", 1.26}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if nTable[itemEx.itemid] then
-- if 50 < math.random(100) then
-- doRemoveItem(cid, itemEx.uid,1)
-- else
local nID = nTable[itemEx.itemid]
local random, chance = math.random() * 100, 0
for i = 1, #nTable do
chance = chance + nTable[i][2]
if random <= chance then
if nID == 18414 then
doRemoveItem(cid, itemEx.uid,1)
nID:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
doPlayerAddItem(cid,nID, 10)
else
doRemoveItem(cid, itemEx.uid,1)
doPlayerAddItem(cid, nID, 1)
end
end
end
-- end
end
end