PitBull Unit Frames 4.0

619 - RangeFinder for CanAttack

Hi, while leveling an alt I encountered the following problem:

The current check methods are not sufficient for neutral, i. e. "yellow", mobs.

If I use 'class' I almost have to stand next to the mob for its unit frame to fade in.
If I use 'custom_spell' with a harmful spell, e.g. "Fireball", the target unit frame will be faded in correctly, but the player frame will always be faded.

@ Solution @

Add

can_attack = L['Can attack']

to

PitBull4_RangeFader:SetLayoutOptionsFunction

Add

elseif check_method == "can_attack" then
  		if UnitCanAttack("player", unit) then
  			if enemy_is_in_range(unit) then
  				return 1
  			elseif enemy_is_in_long_range(unit) then
  				return (db.out_of_range_opacity + frame.layout_db.opacity_max) / 2
  			else
  				return db.out_of_range_opacity
  			end
  		else
  			return db.out_of_range_opacity
  		end

before the

else -- class

statement in

PitBull4_RangeFader:GetOpacity
User When Change
deleted_2593853 Oct 10, 2009 at 14:57 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of Kitjan Kitjan Oct 13, 2009 at 15:45 UTC - 0 likes
    The custom spell option would be much more useful if different spells could be listed for helpful, attackable, and other. bossmansmith is having trouble with that on the main Pitbull page comments, and I've wanted to be able to fade my target frame differently by hostility too.
  • 1 comment

Facts

Reported
Oct 10, 2009
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0
Component
Core

Reported by

Possible assignees