okay I have 2 different spells .. but when the effect comes up.. they both look identical.. i don't really understand why.. since spell A is programmed to have an Ice random tile thing. and spell b is programmed for energy... although either spell is casted it uses Ice random tile.. when spell B is suppose to use Energy random tile.. here is the codes for both spells
(suppose to be ice )
This one suppose to be energy ( the initial hit is energy but the random tile effect is ice... )
(suppose to be ice )
Code:
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 28)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1, -20, -1, -0)
local area1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
setCombatArea(combat2, createCombatArea(area1))
function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doAreaCombatHealth(param.cid, COMBAT_ICEDAMAGE, param.pos, 0, -10, -25, CONST_ME_ICEATTACK)
end
if(param.count < 1) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 1500), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end
setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat (cid, combat2, var)
end
This one suppose to be energy ( the initial hit is energy but the random tile effect is ice... )
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, 2)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 11)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 4)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -20, -1, -0)
local area1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
setCombatArea(combat1, createCombatArea(area1))
function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doAreaCombatHealth(param.cid, COMBAT_ENERGYDAMAGE, param.pos, 0, -10, -25, CONST_ME_ENERGYHIT)
end
if(param.count < 1) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 2000), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end
setCombatCallback(combat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat1, var)
end