demon088
#088 in the Horde
Hello Otland!
I need help with animation spriting. It ocurrs that we added some large animation for custom spells. The problem is that the area of effect is lower than the animation, as result it looks pretty wierd. Example:
The blue square represents the area where the spell is acting, and as you can see, the animation seems to be higher than the real area. We have tried modyfing features on the ObjectBuilder, but we couldn't solve it yet. Do you guys have any idea what could be wrong?
Also the Offset function doesnt do anything... well, nothing I can see when reloading spells.
Thanks for your help!
EDIT: SOLUTION
I'm using this script to center correctly an animation greater than 32x32. Thanks @BulawOw!
This is how it is working with this script
I need help with animation spriting. It ocurrs that we added some large animation for custom spells. The problem is that the area of effect is lower than the animation, as result it looks pretty wierd. Example:
The blue square represents the area where the spell is acting, and as you can see, the animation seems to be higher than the real area. We have tried modyfing features on the ObjectBuilder, but we couldn't solve it yet. Do you guys have any idea what could be wrong?
Also the Offset function doesnt do anything... well, nothing I can see when reloading spells.
Thanks for your help!
EDIT: SOLUTION
I'm using this script to center correctly an animation greater than 32x32. Thanks @BulawOw!
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 3) + (maglevel * 1.9)
local max = (level + 7) + (maglevel * 2.1)
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
local pos = cid:getTarget():getPosition()
pos.x = pos.x + 1
pos.y = pos.y + 1
pos:sendMagicEffect(178) -- THIS IS MY CUSTOM ANIMATION ID
return doCombat(cid, combat, var)
end
Last edited: