não entendi , doTransformItem ?, o item vai se transformar em quer ?
Ao usar em alguem ele copia mana ao usar em min a funçao dotransform...
Por Wiihtop, 31 de mar. de 2014 em Scripts
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

exemplo se eu usar essa aaction em alguem ela copia a mana, agora se eu usa-la ela em min ela se transforma num item 2106
info
Grupo: Artesão
Registrado: 22/02/14
Posts: 101
Reputação: +21

function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {13,14}
if isPlayer(itemEx.uid) then
if isInArray(voc, getPlayerVocation(cid)) then
if getCreatureName(itemEx.uid) ~= getCreatureName(cid) then
doCreatureAddMana(cid, getCreatureMana(itemEx.uid))
else
doTransformItem(item.uid, 2106)
doPlayerSendCancel(cid, "Voce nao pode usar esse item em voce mesmo.")
end
else
doPlayerSendCancel(cid, "Voce nao pode usar esse item.")
end
else
return doPlayerSendCancel(cid, "Voce so pode usar esse item em Players.")
end
return true
end
Editado Abril 1 por lucasromero
deu errado esse se eu ussar na pessoa o item tbm transforma
eu queria que ele so mudasse se eu usa-se o item em min
exemplo
se eu usa-se na pessoa ele apenas copiaria mana
agora se eu usa-se em min ele tranfsformaria para outro item ......
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

function onUse(cid, item, fromPosition, itemEx, toPosition)
local ids = {13,14} --Coloque o ID das vocations nesta tabela.
local storage = 1234 -- storage
local time = 60 -- tempo em minutos
if itemEx.uid == cid then
return doTransformItem(item.uid, 2106)
end
local mana = getCreatureMana(itemEx.uid)
if getTilePzInfo(getCreaturePosition(cid)) or getTilePzInfo(getCreaturePosition(itemEx.uid)) then
return false
end
if isInArray(ids, getPlayerVocation(cid)) then
if getPlayerStorageValue(cid, storage) - os.time() <= 0 then
if isPlayer(itemEx.uid) then
doCreatureAddMana(itemEx.uid, -mana)
doCreatureAddMana(cid, mana)
doSendMagicEffect(getCreaturePosition(cid), 11)
doSendMagicEffect(getCreaturePosition(itemEx.uid), 12)
setPlayerStorageValue(cid, storage, os.time()+1*60)
else
doPlayerSendCancel(cid, "Você só pode usar o item em players.")
end
else
doPlayerSendCancel(cid, "Você só pode usar o item a cada "..time.." segundos.")
end
end
return true
end
te amo como sempre du <3
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

Tópico movido para Pedidos e dúvidas resolvidos.



info
Grupo: Artesão
Registrado: 31/12/10
Posts: 136
Reputação: +1
GALERA PRECISSO DE AJUDA
QUERO DEIXAR ESSE ITEM O SEGUINTE SE EU USAR EM ALGUEM ELE COPIA MANA,
AGORA SE EU USAR ELE EM MIN ELE ACONTECE A FUNÇAO DOTRANSFORM ITEM ... !
POREM NAO ESTOU CONSEGUINDO ME AJUDEM, ! rep++
function onUse(cid, item, fromPosition, itemEx, toPosition)
local ids = {13,14} --Coloque o ID das vocations nesta tabela.
local storage = 1234 -- storage
local time = 60 -- tempo em minutos
local mana = getCreatureMana(itemEx.uid)
if getTilePzInfo(getCreaturePosition(cid)) or getTilePzInfo(getCreaturePosition(itemEx.uid)) then
return false
end
if isInArray(ids, getPlayerVocation(cid)) then
if getPlayerStorageValue(cid, storage) - os.time() <= 0 then
if isPlayer(itemEx.uid) then
doCreatureAddMana(itemEx.uid, -mana)
doCreatureAddMana(cid, mana)
doSendMagicEffect(getCreaturePosition(cid), 11)
doSendMagicEffect(getCreaturePosition(itemEx.uid), 12)
setPlayerStorageValue(cid, storage, os.time()+1*60)
else
doPlayerSendCancel(cid, "Você só pode usar o item em players.")
end
else
doPlayerSendCancel(cid, "Você só pode usar o item a cada "..time.." segundos.")
end
return true
end
end
function onUse(cid, item, frompos, item2, topos)
local item1 = 2553
local health = 50 -- %
local mana = 50 -- %
local h = (getCreatureHealth(cid))*(health)/(100)
local m = (getCreatureMana(cid))*(mana)/(100)
doCreatureAddHealth(cid, -h)
doCreatureAddMana(cid, -m)
doTransformItem(item.uid, item1)
doCreatureSay(cid, 'Mangekyou Sharingan!', TALKTYPE_ORANGE_1)
end
return true
end
upa