Apollos
Dude who does stuff
Can't get effect to go in the area 1x1, it only is displaying on top of character. Feel like it's "getPosition():sendMagicEffect" but tried doSendMagicEffect instead and that didn't work either. What am I doing wrong?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
local level = getPlayerLevel(cid)
local min = -((weaponSkill+weaponAttack)*0.5+(level/5))
local max = -((weaponSkill+weaponAttack)*1.5+(level/5))
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
local config = {
[0] = {combat_effect = 7},
[1] = {combat_effect = 7},
[2] = {combat_effect = 7},
[3] = {combat_effect = 7},
[4] = {combat_effect = 7},
[5] = {combat_effect = 10},
[6] = {combat_effect = 10},
[7] = {combat_effect = 10},
[8] = {combat_effect = 10},
[9] = {combat_effect = 54},
[10] = {combat_effect = 54},
[11] = {combat_effect = 54},
[12] = {combat_effect = 54},
[13] = {combat_effect = 46},
[14] = {combat_effect = 46},
[15] = {combat_effect = 46},
[16] = {combat_effect = 46},
[17] = {combat_effect = 7},
[18] = {combat_effect = 7},
[19] = {combat_effect = 7},
[20] = {combat_effect = 7},
[21] = {combat_effect = 10},
[22] = {combat_effect = 10},
[23] = {combat_effect = 10},
[24] = {combat_effect = 10},
[25] = {combat_effect = 54},
[26] = {combat_effect = 54},
[27] = {combat_effect = 54},
[28] = {combat_effect = 54},
[29] = {combat_effect = 46},
[30] = {combat_effect = 46},
[31] = {combat_effect = 46},
[32] = {combat_effect = 46}
}
function onCastSpell(cid, var)
local vocation_id = cid:getVocation():getId()
cid:getPosition():sendMagicEffect(config[vocation_id].combat_effect)
return doCombat(cid, combat, var)
end