115820
Member
HI guys, i have this script to OTX 2.x, but i update my exe to OTX 3.x and i need update this script.
-- CONFIGURAÇÕES
aurastr = 25950 -- storage da aura
estr = 25951 -- storage para o exhaust
porcentagem = 30 -- chance de curar em cada volta da aura, em porcentagem
quantheal = 5 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 5% do hp máximo cada cura)
tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar)
tipoaura = 18 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo)
efeitocura = 3 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo)
local table = {
itemNeed = 25990, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ . ,", ". ´ ,", "
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}
function doPlayerLoopEff(cid)
if isPlayer(cid) and getPlayerStorageValue(cid, 25950) == 1 then
doSendAnimatedText(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
end
end
-- Função que chama a aura
function efeitosAura1(i,tm,cid)
if(isCreature(cid)) then
local atual = getCreaturePosition(cid)
local posaura = {
{x=(atual.x)-1, y=(atual.y)-1, z=atual.z},
{x=atual.x, y=(atual.y)-1, z=atual.z},
{x=(atual.x)+1, y=(atual.y)-1, z=atual.z},
{x=(atual.x)+1, y=atual.y, z=atual.z},
{x=(atual.x)+1, y=(atual.y)+1, z=atual.z},
{x=atual.x, y=(atual.y)+1, z=atual.z},
{x=(atual.x)-1, y=(atual.y)+1, z=atual.z},
{x=(atual.x)-1, y=atual.y, z=atual.z},
}
local chances = math.random(100)
if(chances<=porcentagem/8) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal)
doCreatureAddMana(cid, getCreatureMaxMana(cid)/quantheal)
if(i<=8 and i>1) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura)
else
doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura)
end
doSendMagicEffect(atual, efeitocura)
end
if(i==8) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
elseif(i<8) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura)
end
if i<=8 then
i = i+1
tm = tempo/8
return addEvent(efeitosAura1,tm,i,tm,cid)
elseif i>8 then
return efeitosAura1(1,0,cid)
else
return TRUE
end
else
return TRUE
end
end
-- Função principal
function onLogin(cid)
if (getPlayerStorageValue(cid, aurastr) == 1) then
efeitosAura1(1, tempo/8, cid)
doPlayerLoopEff(cid)
end
return true
end
aurastr = 25950 -- storage da aura
estr = 25951 -- storage para o exhaust
porcentagem = 30 -- chance de curar em cada volta da aura, em porcentagem
quantheal = 5 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 5% do hp máximo cada cura)
tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar)
tipoaura = 18 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo)
efeitocura = 3 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo)
local table = {
itemNeed = 25990, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ . ,", ". ´ ,", "
. ,", ",
."}, -- Texto que vai sair.delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}
function doPlayerLoopEff(cid)
if isPlayer(cid) and getPlayerStorageValue(cid, 25950) == 1 then
doSendAnimatedText(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
end
end
-- Função que chama a aura
function efeitosAura1(i,tm,cid)
if(isCreature(cid)) then
local atual = getCreaturePosition(cid)
local posaura = {
{x=(atual.x)-1, y=(atual.y)-1, z=atual.z},
{x=atual.x, y=(atual.y)-1, z=atual.z},
{x=(atual.x)+1, y=(atual.y)-1, z=atual.z},
{x=(atual.x)+1, y=atual.y, z=atual.z},
{x=(atual.x)+1, y=(atual.y)+1, z=atual.z},
{x=atual.x, y=(atual.y)+1, z=atual.z},
{x=(atual.x)-1, y=(atual.y)+1, z=atual.z},
{x=(atual.x)-1, y=atual.y, z=atual.z},
}
local chances = math.random(100)
if(chances<=porcentagem/8) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal)
doCreatureAddMana(cid, getCreatureMaxMana(cid)/quantheal)
if(i<=8 and i>1) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura)
else
doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura)
end
doSendMagicEffect(atual, efeitocura)
end
if(i==8) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
elseif(i<8) then
doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura)
end
if i<=8 then
i = i+1
tm = tempo/8
return addEvent(efeitosAura1,tm,i,tm,cid)
elseif i>8 then
return efeitosAura1(1,0,cid)
else
return TRUE
end
else
return TRUE
end
end
-- Função principal
function onLogin(cid)
if (getPlayerStorageValue(cid, aurastr) == 1) then
efeitosAura1(1, tempo/8, cid)
doPlayerLoopEff(cid)
end
return true
end