DO

Alguem Poderia Editar Esse Script?

Por dotatibia, 27 de ago. de 2010 em Archived

script
2
691
dotatibiaD
27 de agosto de 2010 às 19:31

Ola galera ! preciso mais uma vez a ajuda de voces !

 

Eu gostaria que alguem editasse esse script que eu peguei em um ot !

 

-- Sistema de Forja by Flatronez

function onUse(cid, item, fromPosition, itemEx, toPosition)

local player = getCreatureName(cid)

if getItemName(itemEx.uid) == "piece of iron" then

if toPosition.stackpos == 2 then

setItemName(itemEx.uid, "Prepared Metal")

doSetItemSpecialDescription(itemEx.uid, "Can be enchanted by a jewel.")

doPlayerSendCancel(cid, "The metal is prepared to receive the jewel.")

end

-- Se a pedra já estiver encantada ele continua

elseif getItemName(itemEx.uid) == "Enchanted Metal" then

if toPosition.stackpos == 2 then

doCreateItem(2392, 1, toPosition)

doPlayerSendCancel(cid, "Forge done successfully!")

doRemoveItem(itemEx.uid)

else

doPlayerSendCancel(cid, "This is not the correct metal.")

end

end

end

 

No caso o item que eu receberia após usar um FORGE HAMMER em um METAL seria uma fire sword.

 

Porem eu gostaria que ao invés de receber a fire sword eu ganha-se um item randomico entre uma lista pré-determinada...

 

Exemplo : Tivesse 5 itens, MPA, DSM, PLATE ARMOR, CROWN ARMOR, GOLDEN ARMOR. Randomicamente eu ganhava 1 desses itens !

 

Entenderam ? se tiver meio confuso eu tento explicar melhor

Editado Agosto 27 por dotatibia

VodkartV
27 de agosto de 2010 às 19:50

não testei...

 

-- Sistema de Forja by Flatronez
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = getCreatureName(cid)
if getItemName(itemEx.uid) == "piece of iron" then
if toPosition.stackpos == 2 then
setItemName(itemEx.uid, "Prepared Metal")
doSetItemSpecialDescription(itemEx.uid, "Can be enchanted by a jewel.")
doPlayerSendCancel(cid, "The metal is prepared to receive the jewel.")
end
-- Se a pedra já estiver encantada ele continua 
elseif getItemName(itemEx.uid) == "Enchanted Metal" then
if toPosition.stackpos == 2 then
local items = {2472, 2506, 2463, 2487, 2466} -- items que serão sorteados
doCreateItem(items[math.random(#items)], 1, toPosition)
doPlayerSendCancel(cid, "Forge done successfully!")
doRemoveItem(itemEx.uid)
else
doPlayerSendCancel(cid, "This is not the correct metal.")
end
end
end

Editado Agosto 27 por Vodkart