arcon do you have a pice of code that will do the calculations for spell ranges??
i.e. target.model_size + spell.range * range_mult[spell.range] in reverse to get range_mult
i ask because i noticed that some spells and ability's actually have a larger range then what this code actually gives
local range_mult = {
[0] = 0,
[2] = 1.70,
[3] = 1.490909,
[4] = 1.44,
[5] = 1.377778,
[6] = 1.30,
[7] = 1.20,
[8] = 1.30,
[9] = 1.377778,
[10] = 1.45,
[11] = 1.490909,
[12] = 1.70,
}
if (spell.target.model_size + spell.range * range_mult[spell.range]) < spell.target.distance then
if player.target.type == "MONSTER" then
add_to_chat(7,"Monster out of range of spell")
elseif player.target.type == "NPC" then
add_to_chat(7,"NPC out of range of spell")
else
add_to_chat(7,"Player out of range of spell")
end
cancel_spell()
return
end
im hopeing this is correct
(spell.target.distance / (spell.target.model_size + spell.range))