local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1.0, 0, 1.0, 0)
function OmnislashStrike(cid,combat,var,times,opos,Target)
if isCreature(cid) == FALSE then
doCreatureSetNoMove(Target, FALSE)
return TRUE
end
if isCreature(Target) == FALSE then
doCreatureSetNoMove(cid, FALSE)
return TRUE
end
doCreatureSetNoMove(Target, TRUE)
doCreatureSetNoMove(cid, TRUE)
local newPos = getOppositeSidePos(cid, getThingPos(Target))
if times == 15 then
if not doComparePositions(getThingPos(cid), opos) then
doTeleportThing(cid, opos)
doSendDistanceShoot(newPos, opos, CONST_ANI_WEAPONTYPE)
end
doCreatureSetNoMove(Target, FALSE)
doCreatureSetNoMove(cid, FALSE)
return doCombat(cid, combat, var)
else
if isWalkable(cid,newPos) and not doComparePositions(newPos, getThingPos(cid)) then
local fromPos = getThingPos(cid)
doTeleportThing(cid, newPos)
doSendDistanceShoot(fromPos, newPos, CONST_ANI_WEAPONTYPE)
end
doCombat(cid, combat, var)
return addEvent(OmnislashStrike, 333, cid, combat, var, times+1, opos, Target)
end
end
function onCastSpell(cid, var)
return addEvent(OmnislashStrike, 0, cid, combat, var, 0, getThingPos(cid), getCreatureTarget(cid))
end