• 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 Spell requiring target with AoE & one big effect

Areto Hakori

New Member
Joined
Apr 5, 2009
Messages
12
Reaction score
0
Hi, i m trying to make spell which needs target, has area of effect (3x3) but only one graphic (3x3 too). I don't have any idea how to make it. Everytime when i try it works only in one direction - when i'm below the monster.

Imageshack - spelly.jpg


I'm using TFS 0.3.5pl1

And the "script" ;p
Lua:
    local combat1 = createCombatObject()
    setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat1, COMBAT_PARAM_EFFECT, 255)
    setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5.0, 0)

    local combat2 = createCombatObject()
    setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat2, COMBAT_PARAM_EFFECT, 73)
    setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5.0, 0)
   


    
   arr1 = {
    {0, 0, 0, 0, 0}, 
    {0, 1, 1, 1, 0}, 
    {0, 1, 3, 1, 0}, 
    {0, 1, 1, 0, 0}, 
    {0, 0, 0, 0, 0}, 
   }

   arr2 = {
    {0, 0, 0, 0, 0}, 
    {0, 0, 0, 0, 0}, 
    {0, 0, 2, 0, 0}, 
    {0, 0, 0, 1, 0}, 
    {0, 0, 0, 0, 0}, 
   }
 

 
    local area1 = createCombatArea(arr1)
    local area2 = createCombatArea(arr2)

    setCombatArea(combat1, area1)
    setCombatArea(combat2, area2)


  local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
    end
    local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
    end

function onCastSpell(cid, var)
    local parameters = { cid = cid, var = var}
		addEvent(onCastSpell1, 0, parameters)
		addEvent(onCastSpell2, 0 , parameters)
                return TRUE
end

XML:
<instant name="Amaterasu!" words="amaterasu" lvl="200" mana="1000" range="5" needtarget="1" direction="0" blockwalls="1" needlearn="0" event="script" value="amaterasu.lua"></instant>
 
Back
Top