Download
(3Kb)
Download
Updated: 12-24-14 09:11 PM
Pictures
File Info
Compatibility:
Warlords of Draenor (6.0.3)
Warlords of Draenor Pre-Patch (6.0.2)
Updated:12-24-14 09:11 PM
Created:03-20-09 11:37 PM
Downloads:35,289
Favorites:117
MD5:

oUF SpellRange  Popular! (More than 5000 hits)

Version: 6.0.0.1
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.

  • 6.0.0.1: Updated range checking spells of all classes for Warlords of Draenor.
  • 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.
Post A Reply Comment Options
Unread 03-21-09, 02:10 AM  
Caellian
A Frostmaul Preserver
 
Caellian's Avatar

Forum posts: 281
File comments: 252
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'); }
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: 154
File comments: 330
Uploads: 9
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!
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: 112
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.
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: 154
File comments: 330
Uploads: 9
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.
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.
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: 154
File comments: 330
Uploads: 9
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.
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.
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: 154
File comments: 330
Uploads: 9
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.
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.
Report comment to moderator  
Reply With Quote
Unread 08-08-09, 03:42 PM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 154
File comments: 330
Uploads: 9
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.
Report comment to moderator  
Reply With Quote
Unread 08-09-09, 09:00 AM  
Caeth88
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Edit: The new version 3.2.0.2 should fix this. [/b]
It did, Thanks.
Report comment to moderator  
Reply With Quote
Unread 08-26-09, 09:25 AM  
nailertn
An Aku'mai Servant

Forum posts: 33
File comments: 15
Uploads: 0
The oUF Range element does not have a Disable function implemented, it just works on the oUF.objects table. So DisableElement( "Range" ) in your code just fails silently. What prevents the default function from executing is you nilling object.Range. Frankly it should work like all the other elements, will possibly post a feature request for Haste soon.
Last edited by nailertn : 08-26-09 at 09:25 AM.
Report comment to moderator  
Reply With Quote
Unread 08-26-09, 11:35 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 154
File comments: 330
Uploads: 9
Originally posted by nailertn
The oUF Range element does not have a Disable function implemented, it just works on the oUF.objects table. So DisableElement( "Range" ) in your code just fails silently. What prevents the default function from executing is you nilling object.Range. Frankly it should work like all the other elements, will possibly post a feature request for Haste soon.
Yeah, I just added that call in case Haste ever actually implements that.
Report comment to moderator  
Reply With Quote
Unread 01-17-10, 01:25 AM  
Recluse
A Cliff Giant
 
Recluse's Avatar
AddOn Author - Click to view AddOns

Forum posts: 70
File comments: 94
Uploads: 13
Using oUF/oUF_Caellian - After today's upgrade, I get the following error. Would this be an issue with SpellRange, or the layout? The layout is not being reported in any way, though "parent addon" makes it sound like it might be the layout?

Code:
Message: ..\AddOns\oUF_SpellRange\oUF_SpellRange.lua line 16:
   X-oUF metadata missing in parent addon.
Debug:
   (tail call): ?
   [C]: ?
   [C]: assert()
   oUF_SpellRange\oUF_SpellRange.lua:16: in main chunk
__________________
We'd be together, but only diamonds last forever...
Report comment to moderator  
Reply With Quote
Unread 01-17-10, 11:46 AM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 154
File comments: 330
Uploads: 9
Originally posted by recluse
Using oUF/oUF_Caellian - After today's upgrade, I get the following error. Would this be an issue with SpellRange, or the layout? The layout is not being reported in any way, though "parent addon" makes it sound like it might be the layout?

Code:
Message: ..\AddOns\oUF_SpellRange\oUF_SpellRange.lua line 16:
   X-oUF metadata missing in parent addon.
Debug:
   (tail call): ?
   [C]: ?
   [C]: assert()
   oUF_SpellRange\oUF_SpellRange.lua:16: in main chunk
Make sure to restart the game after the update. "Parent addon" means oUF_SpellRange; It should work fine with oUF_Caellian once the game re-reads SpellRange's TOC file.
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.