local recipe = {{2674, 1}, {2788, 1}, {2006}}
function onCastSpell(cid, var)
local create = true
for i = 1, #recipe do
local tmp, item = recipe[i]
item = getPlayerItemById(cid, true, tmp[1])
if item.uid > 0 then
if #tmp == 2 and item.type < math.max(1, tmp[2]) then
doPlayerSendCancel(cid, "You need more ".. tmp[2] - item.type .." ".. getItemNameById(tmp[1]) ..".")
create = false
break
elseif #tmp == 1 and item.type ~= 0 then
doPlayerSendCancel(cid, "You don't have a empty vial.")
create = false
break
end
else
doPlayerSendCancel(cid, "You don't have ".. getItemNameById(tmp[1]) ..".")
create = false
break
end
end
if create == true then
for i = 1, #recipe do
local item = getPlayerItemById(cid, true, recipe[i][1])
doRemoveItem(item.uid, math.max((recipe[i][2] or 1), 1))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
end
doPlayerAddItem(cid, 7588, 1)
else
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end
Tá aê, tio.




info
Grupo: Campones
Registrado: 26/01/13
Posts: 2
Reputação: 0
Queria uma magia que fosse fácil editar que unisse 2 ou mais itens para formar um outro (alem do custo de mana), como por exemplo usar uma red apple + heaven blossom + vial = Health Potion (custo 100mp).
realmente necessito desse script, agradeço desde já.