* Nome do Sistema ou Script: Piso Heal

  • Nome do Autor: Karyus
  • Servidor Testado e/ou Versão do Tibia: 8.60, tfs 0.4_dev
  • Descrição e/ou Informações Adicionais: Bem, antes de começar fiz esse script para treinar.
    Ele funciona assim, ao pisar no tile ele ira healar o player X vezes (configuraveis) a cada Y (segundos).
  • Scripts e Como Instalar: va ate data/movements/movements.xml e adicione a seguinte tag
    <movevent type="StepIn" actionid="xxxx" event="script" value="piso.lua"/>
Legenda: xxxx = a sua action, que voce colocará no piso atraves do mapa editor.

apos isso va em data/movements/scripts e crie um arquivo chamado piso.lua abra e coloque o codigo abaixo:
Código:
--CONFIGURAÇÕES--
local config = {
healMax = 500, -- Máximo que vai curar, retire um zero para calculos exemplo se for 500 sera 50, se for 2000 sera 200 o valor do max.
healMin = 250, -- Mínimo que vai curar, retire um zero para calculos exemplo se for 250 sera 25, se for 1000 sera 100 o valor do min.
healTime = 10, -- Quantas vezes ira healar o player
healexausted = 1, -- Tempo de cada healada em segundos
storage = 100, -- Storage, não altere
}

--NÃO ALTERE NADA ABAIXO SE NÃO SOUBER O QUE ESTÁ FAZENDO--

function healPlayer(cid, i, hp)
if isPlayer(cid) then
doCreatureAddHealth(cid, math.ceil(hp/config.healTime))
if (i < config.healTime) then
addEvent(healPlayer, config.healexausted*1000, cid, i+1, hp)
end
end
end

function onStepIn(cid, item, pos)
if getPlayerStorageValue(cid, config.storage) <= 0 then
setPlayerStorageValue(cid, config.storage, 1)
local hp = math.random(config.healMin, config.healMax)
addEvent(healPlayer, config.healexausted*1000, cid, 1, hp)
addEvent(setPlayerStorageValue, config.healTime*1000, cid, config.storage, -1)
return true
end
end
Creditos: 95% a mim
5% a IUNIX por me avisar de uns erros