• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua how to modify level to reach it

Madara_

Banned User
Joined
Sep 4, 2019
Messages
20
Reaction score
1
Location
brazol
Hi, it's possible to adjusted this script to appear only on the player who out temple i mean if you get out from the pz zone it going to appear only at level 1000 and if you come back to pz zone it disappear
Any help would be appreciated, thank you.
Lua:
-- CONFIGURAÇÕES
    porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem
    quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% 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 = 3 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo)
    efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo)

-- Função que chama a aura
function efeitosAura(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 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal)
            if(i<=8 and i>1) then
                doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
        elseif(i<8) then
            doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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(efeitosAura,tm,i,tm,cid)
        else
            return efeitosAura(1,0,cid)
        end
    else
        return TRUE
    end
end

--Função principal
function onLogin(cid)
    return efeitosAura(1,tempo/8,cid)
end
XML:
<event type="login" name="Aura_login" event="script" value="aura.lua"/>
 
I canmt understand the script because its not english and i have no idea what is this language but it can be by running this file woth function onThink if player is in pz then cast the script else send the look message without the line you are taking about
 
Try this one but then you'll have to login outside PZ.
Lua:
-- CONFIGURAÇÕES
    porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem
    quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% 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 = 3 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo)
    efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo)

-- Função que chama a aura
function efeitosAura(i,tm,cid)
    if(isCreature(cid)) and getPlayerLevel(cid) >= 1000 and not getTilePzInfo(getThingPos(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 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal)
            if(i<=8 and i>1) then
                doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
        elseif(i<8) then
            doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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(efeitosAura,tm,i,tm,cid)
        else
            return efeitosAura(1,0,cid)
        end
    else
        return TRUE
    end
end
--Função principal
function onLogin(cid)
    return efeitosAura(1,tempo/8,cid)
end
As the reply above suggested, Its better if you change it to function onThink
and add an interval for your effect.
 
Last edited:
Try this one but then you'll have to login outside PZ.
Lua:
-- CONFIGURAÇÕES
    porcentagem = 40 -- chance de curar em cada volta da aura, em porcentagem
    quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% 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 = 3 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo)
    efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo)

-- Função que chama a aura
function efeitosAura(i,tm,cid)
    if(isCreature(cid)) and getPlayerLevel(cid) >= 1000 and not getTilePzInfo(getThingPos(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 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal)
            if(i<=8 and i>1) then
                doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
        elseif(i<8) then
            doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].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(efeitosAura,tm,i,tm,cid)
        else
            return efeitosAura(1,0,cid)
        end
    else
        return TRUE
    end
end
--Função principal
function onThink(interval)
    return efeitosAura(1,tempo/8,cid)
end
As the reply above suggested, Its better if you change it to function onThink
and add an interval for your effect.
after addin this in globalevent xml file with interval value number didn't work
XML:
<globalevent name="auraeffect" interval="1000" script="auraeffect.lua"/>
 
I edited my script, Try it onLogin and tell me if it works.
 
Last edited:
Edit:- sorry i didn't saw your message i didn't get the notification

I edited my script, Try it onLogin and tell me if it works.
Hi, i must relog to appear out pz zone is there's someway to make it AUTO ? i changed the function event replaced it with onThink didn't work
i meant if you go out and some player got you attack you won't logout to get the aura
 
Back
Top