i know how to calculate the max distance for spells
local range_mult = { [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(123,"Monster out of range of spell") elseif player.target.type == "NPC" then add_to_chat(123,"NPC out of range of spell") else add_to_chat(123,"Player out of range of spell") end cancel_spell() return end
but how can we calculate the max melee distance for a given mob