• 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!

Changing Spell Effects TFS 1.0 HELP

Koncu

New Member
Joined
May 25, 2010
Messages
28
Reaction score
0
Anyone out there can help me out with the spell below would be great. I would like to know exactly how I can change each own COMBAT_PARAM_EFFECT to individual tiles (1's in area). For now it's only using effect -> 4 and that's why I would like to change that so each tile has its own effect.

I was thinking of adding a for loop if there is one in lua but I am not sure how

code:

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 4)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

my_area = {
{0, 1, 0},
{1, 1, 1},
{1, 3, 1},
{1, 1, 1},
{0, 1, 0}
}

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

function onGetFormulaValues(cid, level, maglevel)
    min = -((level / 5) + (maglevel * 1.2) + 7)
    max = -((level / 5) + (maglevel * 2.85) + 16)
    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Code:
function onTargetTile(cid, pos)
    doSendMagicEffect(pos, math.random(20))
    return true
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

If you want specific effects at specific positions you can do some math based on cid pos and pos.
 
Back
Top