Mana Rune Per Level

Skymagnum
em Actions e Talkactions

Skymagnum

Hamburguer
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 02/08/12Posts: 1025Char no Tibia: Maurolkit

Tipo: Action.

Testado: Não.

 

@Oque Faz?.

Bom ela faz oque não tá feito.

 

@Instalando.

Primeiro vá em / data / actions/ scripts

 

 

nome_do_script.lua:

function onUse(cid, item, itemEx)

local exhausted = 1 -- em segundos

local T = {
[{10, 50}] = {min = 50, max = 200},
[{51, 70}] = {min = 200, max = 400},
[{71, 90}] = {min = 400, max = 500},
[{91, math.huge}] = {min = 500, max = 1000}


if getPlayerStorageValue(cid, 281389) - os.time() > 0 then
  doPlayerSendTextMessage(cid, 26, "You are exhausted.")
  return true
end

 for k, v in pairs(T) do
	if getPlayerLevel(cid) >= k[1] and getPlayerLevel(cid) <= k[2] then
	 if isPlayer(itemEx.uid) then
			doPlayerAddMana(itemEx.uid, math.random(v.min, v.max))
			 doSendMagicEffect(getThingPos(itemEx.uid), 28)
				 doSendMagicEffect(getThingPos(cid), 30)
					 setPlayerStorageValue(cid, 281389, os.time() + exhausted * 1000)
				end
		 end
	end
return true
end

 

 

actions.xml

<action itemid="id" event="script" value="nome_do_script"/>

 

@Editando.

 

local T = {

[{10, 50}] = {min = 50, max = 200}

[{51, 70}] = {min = 200, max = 400}

[{71, 90}] = {min = 400, max = 500}

[{91, math.huge}] = {min = 500, max = 1000}

 

Em [{10, 50} é os leveis de 10 a 50 irá healar

 

{min = 50, max = 200}

 

para mudar os efeitos

 

doSendMagicEffect(getThingPos(itemEx.uid), 28)

doSendMagicEffect(getThingPos(cid), 30)

 

mude os números nessas linhas

 

para dar life você substitui essa linha

 

doPlayerAddMana(itemEx.uid, math.random(v.min, v.max)

 

por essa

 

doCreatureAddHealth(itemEx.uid, math.random(v.min, v.max)

 

 

pronto Runa por level instalada e funcionando. icon_lolsuper.gif

jeoz.png

xundazinho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/10/12Posts: 16Char no Tibia: Não Tenho Mais

Deu erro:

[Warning - Event::loadScript] Cannot load script <data/actions/scripts/manarune.lua

data/actions/scripts/manarune.lua:7: '}' expected (to closa '{' at line 5) near '['

Skymagnum

Hamburguer
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 02/08/12Posts: 1025Char no Tibia: Maurolkit

Copia denovo erro arrumado.

jeoz.png