Greets!
Spells is something that I never really got myself into at a higher Point, now is the time.
The idea is the make the character swing its blade around himself in a circle.
I guess it could be done much shorter, however, I can't get it to work at this stage.
I would like it to be the weapontype as well:
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
Thanks in advance.
Kind Regards,
Eldin.
Spells is something that I never really got myself into at a higher Point, now is the time.
The idea is the make the character swing its blade around himself in a circle.
I guess it could be done much shorter, however, I can't get it to work at this stage.
Code:
local cleaveCircleArea = {
createCombatArea({
{0, 0, 1, 2},
}),
createCombatArea({
{0, 0, 1, 0},
{0, 0, 0, 2},
}),
createCombatArea({
{0, 0, 0, 0},
{0, 0, 0, 1},
{0, 0, 0, 2},
}),
createCombatArea({
{0},
{0},
{1},
{2},
}),
createCombatArea({
{0, 0},
{0, 0},
{0, 1},
{2, 0},
{0, 0},
{0, 0},
{0, 0}
}),
createCombatArea({
{0, 0, 0},
{0, 0, 0},
{2, 1, 0},
}),
createCombatArea({
{2, 1, 0, 0},
}),
createCombatArea({
{2, 0, 0, 0},
{0, 1, 0, 0},
}),
createCombatArea({
{2, 0, 0},
{1, 0, 0},
{0, 0, 0},
}),
createCombatArea({
{0, 2},
{1, 0},
{0, 0},
{0, 0}
}),
createCombatArea({
{0, 0, 1, 2},
{0, 0, 0, 0},
})
}
function onTargetTile1(cid, pos)
doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_WHIRLWINDAXE)
end
local cleaveCircle = {}
for k, area in ipairs(cleaveCircleArea) do
cleaveCircle[k] = createCombatObject()
setCombatParam(cleaveCircle[k], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(cleaveCircle[k], COMBAT_PARAM_EFFECT, CONST_ME_NONE)
setCombatFormula(cleaveCircle[k], COMBAT_FORMULA_SKILL, 2.55, -100, 2.60, -200)
setCombatArea(cleaveCircle[k], area)
_G["callback2" .. k] = onTargetTile2
setCombatCallback(cleaveCircle[k], CALLBACK_PARAM_TARGETTILE, "callback2" .. k)
end
local function castSpellDelay(p)
doCombat(unpack(p))
end
local i = 0
for k, combat in ipairs(cleaveCircle) do
addEvent(castSpellDelay, #cleaveCircle * 100 * i + 100 * k, {cid, combat, var})
end
return LUA_NO_ERROR
end
I would like it to be the weapontype as well:
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
Thanks in advance.
Kind Regards,
Eldin.