Paulix
Active Member
- Joined
- Sep 13, 2012
- Messages
- 151
- Solutions
- 8
- Reaction score
- 36
hello, recently im working on this old spell of my server
as you can see its working pretty well, the only problem is that the effect hits instantly, while the bolts take a couple frames to reach its destination... i would like to know how exactly this function on target tile works, and if there is any way to make it only show the HITAREA effect once bolt reaches his destination...
Code:
local acombat = createCombatObject()
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POWERBOLT)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -3.8, -220, -3.8, 220)
local arr = {
{1, 1, 1},
{1, 1, 1},
{1, 1, 1},
{0, 1, 0},
{0, 3, 0}
}
local area = createCombatArea(arr)
setCombatArea(acombat, area)
function onTargetTile(cid, pos)
doCombat(cid,combat,positionToVariant(pos))
end
setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, acombat, var)
end
as you can see its working pretty well, the only problem is that the effect hits instantly, while the bolts take a couple frames to reach its destination... i would like to know how exactly this function on target tile works, and if there is any way to make it only show the HITAREA effect once bolt reaches his destination...