My spell is just below, and if someone can modify the spell so it does not attack to the specified area every time that would be great.
I should probably give some examples because even I am slightly confused O:
Currently the following effect;
- Player casts spell
- Player shots 4 times, which is fine however every time the spell is executed, it is going to use the following 'myArray', in this case it will be; 9 hits for 1 spell execution (9 is a random number and can vary, dont worry about that)
I was hoping to create something like this instead:
- Player casts spell
- Players shots 4 times, but this time; only 1 hit for 1 spell execution (the spell is being executed 4 times)
TFS 1.0 guys, I would appreciate help!
I should probably give some examples because even I am slightly confused O:
Currently the following effect;
- Player casts spell
- Player shots 4 times, which is fine however every time the spell is executed, it is going to use the following 'myArray', in this case it will be; 9 hits for 1 spell execution (9 is a random number and can vary, dont worry about that)
I was hoping to create something like this instead:
- Player casts spell
- Players shots 4 times, but this time; only 1 hit for 1 spell execution (the spell is being executed 4 times)
LUA:
local areaCombat, combat = createCombatObject(), createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 7)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 5)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, 1, -0.3, 1)
local myArray = {
{1, 1, 1},
{1, 3, 1},
{1, 1, 1}
}
local area = createCombatArea(myArray)
setCombatArea(areaCombat, area)
function onTargetTile(cid, pos)
return math.random(2) == 1 and doCombat(cid, combat, positionToVariant(pos))
end
setCombatCallback(areaCombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
addEvent(doCombat, 100, cid, areaCombat, var)
addEvent(doCombat, 200, cid, areaCombat, var)
addEvent(doCombat, 300, cid, areaCombat, var)
return doCombat(cid, areaCombat, var)
end
TFS 1.0 guys, I would appreciate help!