Well, i'm currently implementing a sound extension for my server and i just can't get the right target of a healing rune cast.
That should work right?
But, i just the get the right position of the target when i choose they by battlelist. If i heal my self i also don't get my own pos.
Don't mind about my custom code, he works fine. I just can't understand why i can't get the target properly.
PS: I've made a quickly search on the sources and didn't find nothing.
That should work right?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 6)
function onCastSpell(cid, var)
if doCombat(cid, combat, var) then
local f = variantToNumber(var)
if f ~= 0 then
local obj = SoundData:new(HEAL_CH, nil, nil, 1000, 900, false, nil)
obj:sendToSpectators(getCreaturePosition(f))
end
end
end
But, i just the get the right position of the target when i choose they by battlelist. If i heal my self i also don't get my own pos.
Don't mind about my custom code, he works fine. I just can't understand why i can't get the target properly.
PS: I've made a quickly search on the sources and didn't find nothing.