Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(3 Kb)
Download
Updated: 09-10-12 11:41 PM
Pictures
File Info
Compatibility:
Mists of Pandaria (5.0.4)
Updated:09-10-12 11:41 PM
Created:03-20-09 11:37 PM
Downloads:25,812
Favorites:117
MD5:
oUF SpellRange  Popular! (More than 5000 hits)
Version: 5.0.0.2
by: Saiket [More]
oUF SpellRange is an element plug-in for Haste's oUF unit frame framework that fades unit frames when out of casting range. Unlike the default oUF range fading, SpellRange works for any hostile or friendly targets, rather than group members only. You must have oUF and a compatible layout for oUF SpellRange to do anything.

Usage

The settings for implementing SpellRange are intentionally the same as the default Range element, because the two elements cannot work together. SpellRange will disable the Range element for frames where both are enabled.

To enable the SpellRange element:
Code:
self.SpellRange = {
	 -- At least one set of required properties, listed below
};
Either of the following sets of properties is required:
  • Code:
    --- Takes priority over .insideRange/.outsideRange, and fires when changing between them.
    function self.SpellRange.Update( self, InRange )
    	
    end
    OR
  • Code:
    self.SpellRange.insideAlpha = 1.0; -- Frame alpha when in range
    self.SpellRange.outsideAlpha = 0.4; -- Frame alpha when out of range
Don't forget to add oUF_SpellRange as an optional dependency of your layout.


Note: SpellRange is necessarily slower than the default Range element, so use it with caution for large groups like raids or parties. The default Range element will always work for "player", "pet", and any unit that passes UnitPlayerOrPetInParty/UnitPlayerOrPetInRaid, however it is limited to 38 yard range.
  • 5.0.0.2: Classes without helpful spells now display range to themselves and their pets properly while not in a raid.
  • 5.0.0.1: Bumped TOC for Mists of Pandaria.
  • 4.3.0.1: Bumped TOC for 4.3.
  • 4.2.0.1: Bumped TOC for 4.2.
  • 4.1.0.1: Bumped TOC for 4.1.
  • 4.0.0.1:
    • Now adds a :ForceUpdate method and .__owner property to .SpellRange elements to conform with the oUF 5 API. If you intend to use these, you can no longer recycle a generic .SpellRange element table.
    • Spells updated for Cataclysm pre-release patch 4.0.1.
  • 3.3.5.1:
    • Now checks for a .SpellRange table containing properties similar to oUF 1.4's updated Range element. Not backwards compatible!
    • Added support for multiple spells per class, choosing the first known spell from a list.
  • 3.3.0.2: Added support for embedded installs.
  • 3.3.0.1: Bumped TOC for 3.3.
  • 3.2.0.2: Removed "Raise Ally" as a range check spell for allies, since it only works for raid/party members.
  • 3.2.0.1: Uses the new IsSpellKnown API instead of constantly querying GetSpellInfo, as it is dramatically faster.
  • 3.0.9.6: Fixed error for classes that had no help or harm spell.
  • 3.0.9.5: Low level players that haven't trained their spells yet will now properly see 28 yard ranges.
  • 3.0.9.4:
    • No longer enables itself for frames that don't request SpellRange.
    • Now supports a :SpellRangeOverride( InRange ) method in place of the in and outside alpha properties.
  • 3.0.9.3: Correctly sorted priest spells into the HelpID and HarmID tables.
  • 3.0.9.2: Shows proper range of player and group members while on a flightpath for players with no ranged buff spells.
Archived Files (16)
File Name
Version
Size
Author
Date
5.0.0.1
3kB
Saiket
08-28-12 09:41 AM
4.3.0.1
3kB
Saiket
11-29-11 06:10 PM
4.2.0.1
3kB
Saiket
06-28-11 02:01 PM
4.1.0.1
3kB
Saiket
04-26-11 11:01 AM
4.0.0.1
3kB
Saiket
10-12-10 03:59 PM
3.3.5.1
3kB
Saiket
07-10-10 11:32 PM
3.3.0.2
3kB
Saiket
01-16-10 05:54 PM
3.3.0.1
3kB
Saiket
12-08-09 02:48 PM
3.2.0.2
3kB
Saiket
08-08-09 03:57 PM
3.2.0.1
3kB
Saiket
08-04-09 04:37 PM
3.0.9.6
3kB
Saiket
04-05-09 02:08 AM
3.0.9.5
3kB
Saiket
04-04-09 01:49 PM
3.0.9.4
2kB
Saiket
03-22-09 04:54 AM
3.0.9.3
2kB
Saiket
03-22-09 02:14 AM
3.0.9.2
2kB
Saiket
03-21-09 03:04 AM
3.0.9.1
2kB
Saiket
03-20-09 11:37 PM


Post A Reply Comment Options
Unread 08-08-09, 03:42 PM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 152
File comments: 329
Uploads: 21
Originally posted by Caeth88
I'm using this plugin with Caellians layout on my Death Knight at the moment and it tends to show units out of range (translucent frame) even though I'm standing right on top of it. This is happening to NPC's and Players alike.

EDIT: a bit more info i just noticed. it shows fellow horde not in my raid/party out of range, regardless of range. it shows alliance characters range properly.

Don't know what the deal with the NPC's is. some show up properly, others don't.

from what I've read so far you use Raise Ally for the friendly rangecheck. however, i cannot use this spell unless my target is dead and in my raid/party. I'm not a coder so i don't know if this info is any good but i thought i might aswell just post my findings.
Has it always done this, or just since a recent patch? I don't think deathknights have any other targeted buff spell, so I'll have to limit the range check to 28 yards for them.
____
Edit: The new version 3.2.0.2 should fix this.
Last edited by Saiket : 08-08-09 at 04:00 PM.
Saiket is offline Report comment to moderator  
Reply With Quote
Unread 08-08-09, 08:21 AM  
Caeth88
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
I'm using this plugin with Caellians layout on my Death Knight at the moment and it tends to show units out of range (translucent frame) even though I'm standing right on top of it. This is happening to NPC's and Players alike.

EDIT: a bit more info i just noticed. it shows fellow horde not in my raid/party out of range, regardless of range. it shows alliance characters range properly.

Don't know what the deal with the NPC's is. some show up properly, others don't.

from what I've read so far you use Raise Ally for the friendly rangecheck. however, i cannot use this spell unless my target is dead and in my raid/party. I'm not a coder so i don't know if this info is any good but i thought i might aswell just post my findings.
Last edited by Caeth88 : 08-08-09 at 08:28 AM.
Caeth88 is offline Report comment to moderator  
Reply With Quote
Unread 03-23-09, 11:44 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 152
File comments: 329
Uploads: 21
Originally posted by Thizzelle
if i wanted a numeric value of the range to be displayed would the best way to do this is making a function for SpellRangeOverride()? thanks.
SpellRangeOverride wouldn't be very effective, since it only updates when the target crosses maximum range. Unfortunately, I think a feature like this is beyond the scope of oUF_SpellRange. It would require tracking the range of multiple spells with varying ranges, while SpellRange only really keeps track of one spell's range per class.
Saiket is offline Report comment to moderator  
Reply With Quote
Unread 03-23-09, 07:44 AM  
Thizzelle
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 29
Uploads: 1
if i wanted a numeric value of the range to be displayed would the best way to do this is making a function for SpellRangeOverride()? thanks.
Thizzelle is offline Report comment to moderator  
Reply With Quote
Unread 03-22-09, 05:03 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 152
File comments: 329
Uploads: 21
Originally posted by Cala
I'm getting a bug with the newest version:
I just uploaded a pretty significant bug fix which will probably get rid of that error.

The update also includes a new feature: Unit frames can define a :SpellRangeOverride( InRange ) member function instead of the two alpha value properties to handle range display in other ways. It will only fire on full unit updates and when the InRange status changes.
Saiket is offline Report comment to moderator  
Reply With Quote
Unread 03-22-09, 03:11 AM  
Cala
A Fallenroot Satyr
 
Cala's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 22
File comments: 48
Uploads: 1
I'm getting a bug with the newest version:

Interface\AddOns\oUF_SpellRange\oUF_SpellRange.lua: (line)64
Usage oUF_Player:SetAlpha(alpha 0 to 1)
Last edited by Cala : 03-22-09 at 03:11 AM.
Cala is offline Report comment to moderator  
Reply With Quote
Unread 03-22-09, 02:18 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 152
File comments: 329
Uploads: 21
Originally posted by jadakren
You have the priest spells mixed up. smite is not a helpful spell and lesser heal is most certainly not a harmful spell.
Fixed - thanks for the tip. I might have to turn in my healing license for that mistake, heheh.
Saiket is offline Report comment to moderator  
Reply With Quote
Unread 03-22-09, 01:15 AM  
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view AddOns

Forum posts: 103
File comments: 113
Uploads: 2
Code:
do
	local Class = select( 2, UnitClass( "player" ) );
	-- Optional low level baseline skills with greater than 28 yard range
	HelpID = ( {
		DEATHKNIGHT = 61999; -- Raise Ally
		DRUID = 5185; -- Healing Touch
		MAGE = 1459; -- Arcane Intellect
		PALADIN = 635; -- Holy Light
		PRIEST = 585; -- Smite
		SHAMAN = 331; -- Healing Wave
		WARLOCK = 5697; -- Unending Breath
	} )[ Class ];
	HarmID = ( {
		DEATHKNIGHT = 52375; -- Death Coil
		DRUID = 5176; -- Wrath
		HUNTER = 75; -- Auto Shot
		MAGE = 133; -- Fireball
		PALADIN = 62124; -- Hand of Reckoning
		PRIEST = 2050; -- Lesser Heal
		SHAMAN = 403; -- Lightning Bolt
		WARLOCK = 686; -- Shadow Bolt
		WARRIOR = 355; -- Taunt
	} )[ Class ];

	oUF:AddElement( "SpellRange", Update, Enable, Disable );
end
You have the priest spells mixed up. smite is not a helpful spell and lesser heal is most certainly not a harmful spell.


i would also source the player class like thus :

Code:
local _,Class = UnitClass( "player" )
Last edited by jadakren : 03-22-09 at 01:16 AM.
jadakren is offline Report comment to moderator  
Reply With Quote
Unread 03-21-09, 03:06 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 152
File comments: 329
Uploads: 21
Originally posted by Caellian
Noticed something, dunno if it's intended but while being on a flight path, the player frame shows as being out of range
Looks like an unintended side effect of being a class with no ranged buffs. The new version should fix that; Thanks for the quick report!
Saiket is offline Report comment to moderator  
Reply With Quote
Unread 03-21-09, 02:10 AM  
Caellian
A Frostmaul Preserver
 
Caellian's Avatar

Forum posts: 268
File comments: 250
Uploads: 5
Interesting

Noticed something, dunno if it's intended but while being on a flight path, the player frame shows as being out of range
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.