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,285
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 08-01-16, 09:48 PM  
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view AddOns

Forum posts: 51
File comments: 203
Uploads: 2
please update
Report comment to moderator  
Reply With Quote
Unread 12-26-14, 04:06 PM  
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view AddOns

Forum posts: 51
File comments: 203
Uploads: 2
awesome, thanks for update
Report comment to moderator  
Reply With Quote
Unread 12-24-14, 09:14 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 devilArt
Hi Saiket
I'm using oUF layout for a while, recently I add oUF SpellRange to it, I found it can't work with frost DK.
My main is warlock, oUF SpellRange works perfect, my alt is DK, it's ok with blood DK, but when I change to frost DK, oUF SpellRange looks had some issue, player unitframe keep fade out, but else unitframe works correctly.
I test it over and over, it only has issue with frost DK, my lua skill is really poor, so I hope you can help me out.
This is my oUF layout, sorry for my crude english.
Version 6.0.0.1 should work properly for you and a bunch of other classes whose spells had changed since Cataclysm.
Report comment to moderator  
Reply With Quote
Unread 12-23-14, 05:59 PM  
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view AddOns

Forum posts: 51
File comments: 203
Uploads: 2
Hi Saiket
I'm using oUF layout for a while, recently I add oUF SpellRange to it, I found it can't work with frost DK.
My main is warlock, oUF SpellRange works perfect, my alt is DK, it's ok with blood DK, but when I change to frost DK, oUF SpellRange looks had some issue, player unitframe keep fade out, but else unitframe works correctly.
I test it over and over, it only has issue with frost DK, my lua skill is really poor, so I hope you can help me out.
This is my oUF layout, sorry for my crude english.
Report comment to moderator  
Reply With Quote
Unread 10-20-11, 03:01 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 lastgamer
Hi,How make the castbar like 'quartz' ,that: if IsSpellInRange,castbar is the normal color, then target won't be outside,the castbar will be another color.
It make me know the spelling can't be successful.
thanks.
You can use the Update callback to change your castbar's color instead of fading the unitframe out, like this:
Code:
self.SpellRange = {};
function self.SpellRange:Update( InRange )
	if ( InRange ) then
		self.Castbar:SetStatusBarColor( 0, 1, 0 ); -- Green
	else
		self.Castbar:SetStatusBarColor( 1, 0, 0 ); -- Red
	end
end
Report comment to moderator  
Reply With Quote
Unread 10-20-11, 09:32 AM  
lastgamer
A Deviate Faerie Dragon

Forum posts: 11
File comments: 30
Uploads: 0
Hi,How make the castbar like 'quartz' ,that: if IsSpellInRange,castbar is the normal color, then target won't be outside,the castbar will be another color.
It make me know the spelling can't be successful.
thanks.
Report comment to moderator  
Reply With Quote
Unread 05-28-11, 08:20 AM  
Forage
A Murloc Raider

Forum posts: 6
File comments: 26
Uploads: 0
Originally posted by Saiket
Did you add Rebuke and Pummel to both HelpIDs and HarmIDs at the bottom of oUF_SpellRange.lua? Make sure you only add those interrupts to the HarmIDs list, since WoW always considers attacks on a friendly to be "out of range". The HelpIDs list is only for spells you can cast on allies, but if the class doesn't have any (like warriors), the mod defaults to a standard 28 yard check.
I was using Intervene for help and pummel for hard and then salv for help and rebuke for harm so I thought I got those right but apparently something else is going on somewhere.

I'll double check the code in the harm/help and make sure I didn't create the issue.
Report comment to moderator  
Reply With Quote
Unread 05-27-11, 08:34 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 Forage
I've added spell range to my unit frames and it's perfect for making sure I'm in range to focus pummel/rebuke which was quite important but now I've noticed another issue and I'm not sure what it is.



Picture of me next to player



Picture of me next to target dummy in range



Picture of me next to target dummy out of range


So The target dummy in and out of range works exactly like I intended but the player frame it just shows out of range no matter how close I am. Is this likely to be a code issue of something I have done or is there a way to resolve this?
Did you add Rebuke and Pummel to both HelpIDs and HarmIDs at the bottom of oUF_SpellRange.lua? Make sure you only add those interrupts to the HarmIDs list, since WoW always considers attacks on a friendly to be "out of range". The HelpIDs list is only for spells you can cast on allies, but if the class doesn't have any (like warriors), the mod defaults to a standard 28 yard check.
Report comment to moderator  
Reply With Quote
Unread 05-27-11, 07:31 PM  
Forage
A Murloc Raider

Forum posts: 6
File comments: 26
Uploads: 0
I've added spell range to my unit frames and it's perfect for making sure I'm in range to focus pummel/rebuke which was quite important but now I've noticed another issue and I'm not sure what it is.



Picture of me next to player



Picture of me next to target dummy in range



Picture of me next to target dummy out of range


So The target dummy in and out of range works exactly like I intended but the player frame it just shows out of range no matter how close I am. Is this likely to be a code issue of something I have done or is there a way to resolve this?
Report comment to moderator  
Reply With Quote
Unread 07-10-10, 11:37 PM  
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view AddOns

Forum posts: 154
File comments: 330
Uploads: 9
3.3.5.1 Change

Just a note for users, the following error from version 3.3.5.1+ must be handled by the author of your oUF layout:
Code:
oUF layout addon using invalid SpellRange element.
Please point them to this download page, which has instructions on how they can update their layout.
Report comment to moderator  
Reply With Quote
Unread 06-17-10, 12:20 PM  
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view AddOns

Forum posts: 268
File comments: 498
Uploads: 2
Originally posted by Saiket
I just downloaded version 0.3 from your WowInterface page and it looks like that block of code is in an if unit == "player" then block. What you have there should work once it's taken out of that test.
Ah damn, might be it! Forgot to check that! ;P

Will report if it works! ^^

Thanks for the quick response mate.

EDIT - Ye, it was it. What a nub error... :S
Last edited by neverg : 06-17-10 at 12:50 PM.
Report comment to moderator  
Reply With Quote
Unread 06-17-10, 12:18 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 neverg
I'm trying to add support of SpellRange to my UnitFrames (oUF_Lumen) and somehow I'm not getting it. It should work fairly simple but it just doesn't.

I've added this:

Code:
	-- oUF_SpellRange
	if IsAddOnLoaded("oUF_SpellRange") then	
		if(unit) then 
		self.SpellRange = true
		self.inRangeAlpha = 1
		self.outsideRangeAlpha = 0.3
		end	
	end
The result is, nothing happens. If I change the inRangeAlpha to less than 1 I will see my frame (player) change because I'm in range (duoh), but the target never changes. Any clues to the why of this behavior?
I just downloaded version 0.3 from your WowInterface page and it looks like that block of code is in an if unit == "player" then block. What you have there should work once it's taken out of that test.
Report comment to moderator  
Reply With Quote
Unread 06-17-10, 10:37 AM  
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view AddOns

Forum posts: 268
File comments: 498
Uploads: 2
I'm trying to add support of SpellRange to my UnitFrames (oUF_Lumen) and somehow I'm not getting it. It should work fairly simple but it just doesn't.

I've added this:

Code:
	-- oUF_SpellRange
	if IsAddOnLoaded("oUF_SpellRange") then	
		if(unit) then 
		self.SpellRange = true
		self.inRangeAlpha = 1
		self.outsideRangeAlpha = 0.3
		end	
	end
The result is, nothing happens. If I change the inRangeAlpha to less than 1 I will see my frame (player) change because I'm in range (duoh), but the target never changes. Any clues to the why of this behavior?
Report comment to moderator  
Reply With Quote
Unread 03-19-10, 01:54 PM  
Noggog
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
MMMMMMWAH! 8*

I love you
__________________


www.PeachyKeenGuild.com
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.