Não precisaria usar break.
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Runa Heal E Mana Por Level
NO
action
Runa Heal E Mana Por Level
Por notle2012, 18 de out. de 2012 em Actions e Talkactions
script
scripts
porlevel
level
runa
2
1.3k
Por notle2012, 18 de out. de 2012 em Actions e Talkactions
info
Grupo: Conde
Registrado: 03/01/12
Posts: 884
Reputação: +233
Char no Tibia: Segredo
Vai em data / script / actions / e crie um arquivo.lua e renomeie para nomedaruna.lua
e add
function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 14725) >= os.time() then return true end if not isCreature(item2.uid) then return true end --- configuration by notle local exhaust = 1100 -- Tempo para player poder se curar novamente! (1000 por segundos) local voc = {4,8,12} -- id das vocations local ww,msg = 10,"kkkk que fraco não tem level 10 ainda" -- aqui edita message e menos que 10 não pode usa local t = { [50] = {vidamin = 100, vidamax = 200,manamin = 300, manamax = 400}, [100] = {vidamin = 400, vidamax = 500,manamin = 600, manamax = 700}, [200] = {vidamin = 700, vidamax = 800,manamin = 900, manamax = 1200}, [400] = {vidamin = 1000, vidamax = 1100,manamin = 1200, manamax = 1500}, [800] = {vidamin = 1300, vidamax = 1400,manamin = 1500, manamax = 1600}} --- configuration by notle if not isInArray(voc, getPlayerVocation(cid)) and doPlayerSendCancel(cid, " Your vocation can not.") then return true end if getPlayerLevel(cid) < ww and doCreatureSay(item2.uid,msg,TALKTYPE_ORANGE_1) then return true end for level, n in pairs (t) do if getPlayerLevel(cid) < level then doPlayerAddMana(item2.uid, math.random(n.manamin, n.manamax)) doCreatureAddHealth(item2.uid, math.random(n.vidamin, n.vidamax)) break end end doSendMagicEffect(topos, CONST_ME_MAGIC_BLUE) doCreatureSay(item2.uid, "Aaaah...", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 14725, os.time() + exhaust / 1000) return true endem actions.xml
como adiciona mais uma dessa "tbl"
[50] = {vidamin = 100, vidamax = 200,manamin = 300, manamax = 400}, [100] = {vidamin = 400, vidamax = 500,manamin = 600, manamax = 700}, [200] = {vidamin = 700, vidamax = 800,manamin = 900, manamax = 1200}, [400] = {vidamin = 1000, vidamax = 1100,manamin = 1200, manamax = 1500}, [800] = {vidamin = 1300, vidamax = 1400,manamin = 1500, manamax = 1600}}exemplo
desse esse colchetes red aqui }
e adiciona e coloca virgula na penultima linha quase todas as linha tem virgula mais a ultima não
[800] = {vidamin = 1300, vidamax = 1400,manamin = 1500, manamax = 1600},
[1600] = {vidamin = 1600, vidamax = 1700,manamin = 1800, manamax = 1900}}
como editar
linha de
exemplo
[50] = {vidamin = 100, vidamax = 200,manamin = 300, manamax = 400},
[50] = -- esse 50 e level
{vidamin = 100, --vidamin e minimo de life que vai ganhar
vidamax = 200,-- vidamax e máximo de life que vai ganhar
manamin = 300,-- manamin e minimo de mana que vai ganhar
manamax = 400-- manamax e máximo de mana que vai ganhar
},
Editado Outubro 21 por notle2012