• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell New Spell

Seumion

★ Spell Maker & Mapper ★
Joined
Feb 24, 2015
Messages
172
Reaction score
2
Hello,

today i made that spell for all

Using TFS 0.3.6 Version 8.6

c8EfSeu.png


First go to Data/spells/spells.xml put this
Code:
<instant name="Default" words="default" lvl="1" maglv="1" mana="25" exhaustion="1000" prem="0" needlearn="0" blockwalls="0" aggressive="1" event="script" value="Default.lua">
    <vocation id="1"/>
    <vocation id="2"/>
    <vocation id="3"/>
    <vocation id="4"/>
    <vocation id="5"/>
    <vocation id="6"/>
    <vocation id="7"/>
    <vocation id="8"/>
</instant>





  • Second go to Data/Spells/Scripts and make Default.lua and put this script
Code:
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{0, 0, 1, 0, 1, 0, 0},
{1, 0, 1, 0, 1, 0, 1},
{1, 0, 1, 3, 1, 0, 1},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 1, 0, 1, 1, 0},
{0, 0, 0, 1, 0, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
    return (500)*-1,(200)*-1
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
local dfcombat0_Brush = {CONST_ANI_ICE,-3,1,0,3,2,2,1,2,-1,2,-2,2,-1,1,1,1,1,0,0,0,-1,0,3,-1,3,0,-1,-1,1,-1,-3,-1,1,-2,-1,-2,3,1,-3,0}local combat0_Brush_2 = createCombatObject()
setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush_2,createCombatArea({{0, 0, 1, 0, 1, 0, 0},
{1, 1, 0, 1, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 1, 0, 0, 1},
{0, 0, 1, 0, 1, 0, 0}}))
function getDmg_Brush_2(cid, level, maglevel)
    return (400)*-1,(200)*-1
end
setCombatCallback(combat0_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")
local dfcombat0_Brush_2 = {CONST_ANI_FIRE,-1,3,1,3,0,2,-3,2,3,-2,-2,1,2,1,-3,-2,2,-2,0,-2,-2,-2,3,2,-1,-3,1,-3}local combat0_Brush_3 = createCombatObject()
setCombatParam(combat0_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat0_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush_3,createCombatArea({{0, 0, 1, 0, 0},
{0, 0, 0, 0, 0},
{1, 0, 1, 0, 1},
{1, 0, 2, 0, 1},
{0, 0, 1, 0, 0}}))
function getDmg_Brush_3(cid, level, maglevel)
    return (10)*-1,(20)*-1
end
setCombatCallback(combat0_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3")
local dfcombat0_Brush_3 = {CONST_ANI_SUDDENDEATH,0,1,2,0,-2,0,-2,-1,0,-1,2,-1,0,-3}

-- Areas/Combat for 100ms
local combat1_Brush_4 = createCombatObject()
setCombatParam(combat1_Brush_4, COMBAT_PARAM_EFFECT, CONST_ME_WATERSPLASH)
setCombatParam(combat1_Brush_4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat1_Brush_4,createCombatArea({{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1}}))
function getDmg_Brush_4(cid, level, maglevel)
    return (10)*-1,(20)*-1
end
setCombatCallback(combat1_Brush_4, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_4")
local dfcombat1_Brush_4 = {CONST_ANI_ENERGYBALL,-3,-2,-2,-2,-1,-2,0,-2,1,-2,2,-2,3,-2,3,-1,2,-1,1,-1,0,-1,-1,-1,-2,-1,-3,-1,-3,0,-2,0,-1,0,0,0,1,0,2,0,3,0,3,1,2,1,1,1,0,1,-1,1,-2,1,-3,1,-3,2,-2,2,-1,2,0,2,1,2,2,2,3,2}

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
    if (isCreature(cid)) then
        doCombat(cid, c, var)
        if (dirList ~= nil) then -- Emit distance effects
            local i = 2;
            while (i < #dirList) do
                doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
                i = i + 2
            end     
        end
    end
end

function onCastSpell(cid, var)
    local startPos = getCreaturePosition(cid)
    RunPart(combat0_Brush,cid,var,dfcombat0_Brush,startPos)
    RunPart(combat0_Brush_2,cid,var,dfcombat0_Brush_2,startPos)
    RunPart(combat0_Brush_3,cid,var,dfcombat0_Brush_3,startPos)
    addEvent(RunPart,100,combat1_Brush_4,cid,var,dfcombat1_Brush_4,startPos)
    return true
end




 
Last edited:
Coolio! :)

But using it for tfs 1.x it gives us this error:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/attack/berserk.lua:onCastSpell
luaAddEvent(). Argument #4 is unsafe
stack traceback:
        [C]: in function 'addEvent'
        data/spells/scripts/attack/spellscript.lua:76: in function <data/spells/scripts/attack/spellscript.lua:71>

It can be fixed by replacing

Code:
function onCastSpell(cid, var)

with

Code:
function onCastSpell(creature, var)
local cid = creature:getId()
 
Back
Top