Basically, for a healer class (I play a paladin) the code
distanceCheckFunction = function(unit) return IsSpellInRange(BS["Holy Light"], unit) == 1 or not UnitIsFriend("player", unit) end
checks unit range against the spell Holy Light and ignores enemy units. The problem with this is that Is SpellInRange isn't a good check for friendly NPC units that you cannot heal (such as friendly mobs in Hyjal, or the many mobs running around Shattrath), and the rangecheck module shows them a permanently out of range. A simple solution to this is to add a check into the line for UnitIsPlayer. The limitation of that is that the few NPCs you CAN heal will not have the frame alpha changed. Additionally, the default pitbull rangecheck is unable to do anything with unfriendly mobs for healers with offensive spells.
I think I have a potential solution, as the IsSpellInRange can return nil according to wowwiki. If so, all you would need to do is add a check for that return and take another action (make the distance check based on CheckInteractDistance). Additionally two more range check functions should be added, for hostile mobs (as healers need to check range on both in most cases).
What I need to do in the code is basically run a check that does something like this (obviously the code isn't right, and some of the range check functions will be level and race dependent):
class == "PALADIN" then if IsSpellInRange = nil then range check based on CheckInteractDistance(unit,2) -- nonhealable friendly npc range check at 7 yards (about the range for basic interaction with bankers and vendors) elseif UnitIsFriend(player,unit) then -- friendly unit range check if UnitLevel(player)>=8 then distanceCheckFunction based on IsSpellInRange(Holy Light) and distanceCheckFunctionLow based on IsSpellInRange(Cleanse) else distanceCheckFunction based on IsSpellInRange(Holy Light) else -- enemy unit range check if UnitPowerType(unit)=0 (mana) and UnitRace(player)=Blood Elf then distanceCheckFunction based on IsSpellInRange(Mana Tap) and distanceCheckFunctionLow based on IsSpellInRange(Jugement) else distanceCheckFunction based on IsSpellInRange(Jugement) end
Problem is I'm just not clear on where to even begin to implement something like this in the rangecheck.lua pitbull module.