• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Spell] Area effect.

Midxas

New Member
Joined
Apr 21, 2014
Messages
43
Reaction score
0
Hello ppl i've tried to change area effect in tfs 0.4 but it doesn't work :/ I had no idea what is wrong. The code is here
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_CRAPS)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 60, 90, 160, 90)

setCombatArea(combat9_Brush,createCombatArea({{0, 1, 0, 1, 0, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 0, 1, 0, 1, 0}}))

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_CRAPS)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 60, 90, 160, 90)

setCombatArea(combat, createCombatArea({
{0, 1, 0, 1, 0, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 0, 1, 0, 1, 0}
}))

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
or
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_CRAPS)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 60, 90, 160, 90)

spellarea = {
{0, 1, 0, 1, 0, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 0, 1, 0, 1, 0}
}

local area = createCombatArea(spellarea)
setCombatArea(combat, area)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Both should work.
 
Back
Top