• 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 Aura System Attack 8.60 Server -=[DexSoft]=- own

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Script .xml

XML:
<instant name="Aura" words="aura" lvl="50" mana="100" prem="0" blockwalls="1" needlearn="0" event="script" value="aura spell.lua"/>

Error on Console:

XML:
[15/09/2021 15:50:26] Reloaded spells.
[15/09/2021 15:52:55] [Warning - BaseEvents::loadFromXml] Cannot open spells.xml file.
[15/09/2021 15:52:55] Line: 2340, Info: Extra content at the end of the document
[15/09/2021 15:52:56] [Error - Game::reloadInfo] Failed to reload spells.

Script aura spells/attack:

Lua:
local AURASYSTEM_STORAGE = 200001 -- STORAGE DE CONTROLE
local AURASYSTEM_AURA_DELAY = 72


local AURASYSTEM_CONFIG = {
DURATION = 72, -- O tempo de duração da aura
DELAY = 72, -- O delay, quanto menor, mais rápida a aura será.
TYPE = "all", -- O tipo de aura. [fire/ice/energy/earth/death/holy/all]
DAMAGE = {-999999, -999999} -- O dano da aura
}

local AURASYSTEM_DIRECTIONS = {
[NORTH] = {
    {0, 0}, {1, 0}, {1, 1}, {1, 2}, {0, 2}, {-1, 2}, {-1, 1}, {-1, 0}
},
[EAST] = {
    {0, 0}, {0, 1}, {-1, 1}, {-2, 1}, {-2, 0}, {-2, -1}, {-1, -1}, {0, -1}
},
[sOUTH] = {
    {0, 0}, {-1, 0}, {-1, -1}, {-1, -2}, {0, -2}, {1, -2}, {1, -1}, {1, 0}
},
[WEST] = {
    {0, 0}, {0, -1}, {1, -1}, {2, -1}, {2, 0}, {2, 1}, {1, 1}, {0, 1}
}
}

local AURASYSTEM_TEMPLATES = {
["fire"] = {COMBAT_FIREDAMAGE, CONST_ME_FIREATTACK},
["ice"] = {COMBAT_ICEDAMAGE, CONST_ME_ICEATTACK},
["earth"] = {COMBAT_EARTHDAMAGE, CONST_ME_SMALLPLANTS},
["energy"] = {COMBAT_ENERGYDAMAGE, CONST_ME_PURPLEENERGY},
["holy"] = {COMBAT_HOLYDAMAGE, CONST_ME_HOLYDAMAGE},
["death"] = {COMBAT_DEATHDAMAGE, CONST_ME_MORTAREA},
["all"] = {
    {COMBAT_FIREDAMAGE, CONST_ME_FIREATTACK},
    {COMBAT_ICEDAMAGE, CONST_ME_ICEATTACK},
    {COMBAT_EARTHDAMAGE, CONST_ME_SMALLPLANTS},
    {COMBAT_ENERGYDAMAGE, CONST_ME_PURPLEENERGY},
    {COMBAT_HOLYDAMAGE, CONST_ME_HOLYDAMAGE},
    {COMBAT_DEATHDAMAGE, CONST_ME_MORTAREA}
}
}

local AURASYSTEM_COUNT = 1

function doPlayerCastAura(cid, position)
if getCreatureStorage(cid, AURASYSTEM_STORAGE) == -1 then

end

local PLAYER_LOOKDIRECTION = getCreatureLookDirection(cid)

local tmp = AURASYSTEM_DIRECTIONS[PLAYER_LOOKDIRECTION][AURASYSTEM_COUNT]
local position = getPositionByDirection(getThingPosition(cid), PLAYER_LOOKDIRECTION, 1)

position.x = position.x + tmp[1]
position.y = position.y + tmp[2]

if AURASYSTEM_CONFIG.TYPE == "all" then
    local x = AURASYSTEM_TEMPLATES[AURASYSTEM_CONFIG.TYPE]
    local r = math.random(1, #x)
    doAreaCombatHealth(cid, x[r][1], position, 0, AURASYSTEM_CONFIG.DAMAGE[1], AURASYSTEM_CONFIG.DAMAGE[2], x[r][2])
else
    doAreaCombatHealth(cid, AURASYSTEM_TEMPLATES[AURASYSTEM_CONFIG.TYPE][1], position, 0, AURASYSTEM_CONFIG.DAMAGE[1], AURASYSTEM_CONFIG.DAMAGE[2], AURASYSTEM_TEMPLATES[AURASYSTEM_CONFIG.TYPE][2])
end

if getCreatureStorage(cid, AURASYSTEM_STORAGE) > os.time() then
    addEvent(doPlayerCastAura, AURASYSTEM_CONFIG.DELAY * 1000, cid)
end

AURASYSTEM_COUNT = AURASYSTEM_COUNT + 1
if AURASYSTEM_COUNT > #AURASYSTEM_DIRECTIONS[PLAYER_LOOKDIRECTION] then
    AURASYSTEM_COUNT = 1
end
end

function onCastSpell(cid, var)
if getCreatureStorage(cid, AURASYSTEM_STORAGE) > os.time() then
    return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

doCreatureSetStorage(cid, AURASYSTEM_STORAGE, os.time() + AURASYSTEM_CONFIG.DURATION)
return doPlayerCastAura(cid)
end
 
Last edited:
XML:
<instant name="Aura" words="aura" lvl="80" mana="200" prem="0" blockwalls="1" needlearn="0" event="script" script="attack/spell aura.lua">
        <vocation id="2"/>
        <vocation id="2"/>
                <vocation id="3"/>
        <vocation id="4"/>
                <vocation id="6"/>
        <vocation id="6"/>
                <vocation id="7"/>
        <vocation id="8"/>
</instant>
<instant name="DASHS" words="dash" lvl="" mana="" prem="" needweapon="0" exhaustion="100" needlearn="0" script="attack/dash.lua">
        <vocation id="2"/>
        <vocation id="2"/>
                <vocation id="3"/>
        <vocation id="4"/>
                <vocation id="6"/>
        <vocation id="6"/>
                <vocation id="7"/>
        <vocation id="8"/>
</instant>
 
The error you posted above says nothing about the Lua script. You've an extra content at the end of the XML document.
If you want me to look further on this, You'll have to upload your spells.xml, otherwise I will not be able to help you.
You don't have to post it on code tags, You can just attach it on your reply.
 
Is this the same one you're using? It seems not, Because I cannot find any extra content on it.
All I can see is repeated spell/rune lines more than 6 times each.
repeat1.PNG
repeat2.PNG
repeat3.PNG
and goes on for every other spell/rune.
Could be the extra showInDescription="0"/> on line 2144, Remove it and then try.
You need to indent this XML document.
 
Last edited:
Back
Top