Rox ..
vou testar aki =P
Por Skulls, 17 de fev. de 2008 em Actions e Talkactions
info
Grupo: Campones
Registrado: 31/10/06
Posts: 77
Reputação: 0
Char no Tibia: Elite Lord Paladin
Rox ..
vou testar aki =P
info
Grupo: Banidos
Registrado: 25/09/06
Posts: 190
Reputação: 0
Char no Tibia: M e N

poderia diminuir este script usando
if item.itemid = id da potion
info
Grupo: Campones
Registrado: 19/08/07
Posts: 59
Reputação: +1
Char no Tibia: Diabeda

Q isso Skulls, pode tiras esses créditos ae bro, HUEHAUAUEHEUE que 50% o que, tá doido? Eu não fiz exatamente nada aí ![]()
Tá perfeito, parabéns ;D
:XTibia_smile:
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

Genoma
se nao fosse por voce eu nao teria criado o script simplesmente pq eu nao tera pensado em faze-lo
e eu nao ligo para os creditos
so quero ajudar
^^
Gostei de mais skull se tá de parabens...
já to ate usando no meu ot =D
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

Ehasuehuase
vlw maximus por testa para mim
que bom que funciono (como eu disse o meu ot é 8.0 entao nao havia testado em 8.1)
abraço
info
Grupo: Banidos
Registrado: 25/09/06
Posts: 190
Reputação: 0
Char no Tibia: M e N

diminui 3 scripts apenas para 1:
-- Health potion By skulls
function onUse(cid, item, frompos, item2, topos)
if item.itemid = 7618
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
doChangeTypeItem(item.uid,0)
if item.type == 2 then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doChangeTypeItem(item.uid,0)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
doChangeTypeItem(item.uid,2)
end
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
else
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
end
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
if item.itemid = 7588
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(200,600)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
doChangeTypeItem(item.uid,0)
if item.type == 2 then
if lvl >= 50 then
if voc == 4 or voc == 3 or voc == 7 or voc == 8 then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doChangeTypeItem(item.uid,0)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
doChangeTypeItem(item.uid,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.')
doChangeTypeItem(item.uid,2)
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.')
doChangeTypeItem(item.uid,2)
end
end
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
end
else
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
if item.itemid = 7591
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(400,800)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
doChangeTypeItem(item.uid,0)
if item.type == 2 then
if lvl >= 80 then
if voc == 4 or voc == 8 then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doChangeTypeItem(item.uid,0)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
doChangeTypeItem(item.uid,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.')
doChangeTypeItem(item.uid,2)
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.')
doChangeTypeItem(item.uid,2)
end
end
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
end
else
if item.type == 0 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doChangeTypeItem(item.uid,0)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
coloque este script em um arquivo chamado: potions health.lua e as tags adicionem:
-- Life potions<action itemid="7618" script="potions health.lua" />
<action itemid="7588" script="potions health.lua" />
<action itemid="7591" script="potions health.lua" />
nao testei
porem provavelmente funcionará
caso encontrem bugs me avisem por MP
Um dos motivos por tirar nota 10
Tutorial organizado
Tutorial bem explicado
Tutorial prático e rápido
Muito bom, testei aqui e ficou perfeito.
See ya! :smile_positivo:
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

@maneirinho
da na mesma usar os 3 ou usar um.. sao 3 tag.. e 3 arquivos pekenos
ai no seu sao 3 tags e 1 arquivo grande =O
qual a diferença?
@all
vlw pelos elogios
flw
Editado Fevereiro 22 por Skulls
Ficou bom, mas acho que poderia ser menor e em apenas 1 script, seria mais eficiente.
info
Grupo: Campones
Registrado: 30/07/07
Posts: 18
Reputação: 0
Gênero: Masculino

aqui qdo eu uso uma potion com ou sem hotkeys fala q tá vazio "it is empty"
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

@_Ferrari_
Eu nao fiz em um unico script porque meu colega pediu scripts diferentes separados, mas realmente da para fazer em um só
@Adriano
Voce fez algo errado.
Testaram em 8.1 e da certo =x.
abraços
info
Grupo: Banidos
Registrado: 25/09/06
Posts: 190
Reputação: 0
Char no Tibia: M e N

acho + prático
afinal, voce nao tera que copiar e colar 6 veses
e apenas 1
e apenas nao precisará variar o nome do script
cada um tem suas opnioes/opçoes
info
Grupo: Campones
Registrado: 18/11/07
Posts: 4
Reputação: 0
Char no Tibia: Lord Annubis

Fiz tudo direitinho aqui também e sempre que uso as potions, com ou sem hotkey aparece "Its empty"...
Parece que pra 8.1, no Aries 0.40 não funciona não.
~
PS: Tenho uma pergunta... Qual o motivo do script pegar o ml do player? ![]()
Editado Fevereiro 26 por NubisPk
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino
Pocoes 8.1.
Bem a pedido de um amigo criei poções 8.1 (health, strong health, great health, mana, strong mana, great mana.)
Então aí vai:
Primeiro Va na pasta actions/script, copie 6 vezes qualquer arquivo de lá e Renomeie-os para:
1ª Copia- Health Potion
2ª Copia- Strong Health Potion
3ª Copia- Great Health Potion
4ª Copia- Mana Potion
5ª Copia- Strong Mana Potion
6ª Copia-Great mana potion
Pronto, os arquivos estao criados agora vamos editá-los.
Abra o arquivo health Potion.lua e dentro dele cole:
-- Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(100,300) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7636) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end else if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endPronto, Sua Health Potion esta criada.
__
Agora Abra strong health potion.lua e cole isso dentro:
-- Strong Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(200,600) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 50 then if voc == 4 or voc == 3 or voc == 7 or voc == 8 then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7634) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end else if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endPronto, Sua Strong Health Potion esta criada.
__
Agora abra o Great Health Potion.lua e cole isso dentro:
-- Great Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(400,800) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 80 then if voc == 4 or voc == 8 then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7635) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end else if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endPronto sua Great Health Potion está criada.
__
Agora abra o Mana Potion.lua e cole isso:
-- Mana potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(50,150) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7636) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end else if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endMana potion criada.
__
Agora Abra Strong Mana potion.lua e cole isso dentro:
function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(100,300) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 50 then if voc == 1 or voc == 2 or voc == 3 or voc == 5 or voc == 6 or voc == 7 then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7634) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end else if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endSua Strong Mana Potion Esta Criada.
__
Agora abra o Great Mana Potion.lua e cole isso:
-- Great Mana potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(150,450) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 80 then if voc == 1 or voc == 2 or voc == 5 or voc == 6 then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7635) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by druids and sorcerers of level 80 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by druids and sorcerers of level 80 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end else if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) endPronto Sua Great Mana Potion está criada.
Com todas as potions criadas só precisamos criar as tags.
Abra seu actions.xml e cole essa tag la:
Pronto Suas Potions estao Prontas e Perfeitas.
Bom eu só tenho um detalhe a acrescentar:
Eu fiz essas Potions em ot 8.0 (so mudei o id dos "vials") então eu não tenho os id's dos "vials" vazios. Eu tive entao que usar o id do liquido (1=wather, 2=blood... 7=mana fluid). Nas manas Potion usei id do mana fluid, Mas na health potion eu usei o id do sangue (blood), entao pode ser que voce tenha que alterar o id do liquido de todas as health potions em: (if item.type == 2 then) e [doChangeTypeItem(item.uid,2] (é só substituir o numero 2 pelo id do life fluid, mas se eu nao me engano o id é sangue mesmo, e meu colega usou no ot 8.1 e funcionou direitinho.
Bom é isso.
Espero que Gostem.
Sem mais.
Ps: Nao Reclamem de pouca explicação afinal não é um tutorial, são só as actions.
Editado Março 3 por Skulls