FilipeJF
New Member
- Joined
- Jan 9, 2012
- Messages
- 124
- Reaction score
- 4
Has few days I've been trying to get this spell causes more hits
to push the target 3 or 5 times someone help me?
Here's the script:
to push the target 3 or 5 times someone help me?
Here's the script:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, 0, -1, 0)
local area = createCombatArea({
{1, 0, 1},
{1, 0, 1},
{1, 0, 1},
{1, 2, 1},
})
setCombatArea(combat, area)
local function push(cid, target)
local direction = getCreatureLookDirection(cid)
local x = (direction == 1 and 1 or (direction == 3 and -1 or 0))
local y = (direction == 0 and -1 or (direction == 2 and 1 or 0))
local position = getCreaturePosition(target)
position.x = position.x + x
position.y = position.y + y
if doTileQueryAdd(target, position) == RETURNVALUE_NOERROR then
doTeleportThing(target, position, true)
end
end
function onTargetCreature(cid, target)
if not isNpc(target) then
addEvent(push, 100, cid, target)
end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end