Thread Tools Display Modes
07-12-10, 07:45 PM   #1
Shäken
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 5
Getplayerbuff issue

I know the function "getplayerbuff" has been removed since patch 3.0.2, but is there anything replacing it ?

Thanx for help
  Reply With Quote
07-12-10, 09:14 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
UnitAura()
http://wowprogramming.com/docs/api/UnitAura
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-13-10, 02:56 AM   #3
Shäken
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 5
In this code (used to track is a shout is active on a warrior and warn if not), if I replace the "getplayerbuff" part by a "unitaura" or "unitbuff" code, will the rest of the code work or do I have to replace it ?

Code:
function battleshoutreminder_reminder()	

	local playerclass = UnitClass("player");
	
	if (playerclass ~= "Warrior") then
		DisableAddOn("BattleShoutReminder");
	else		
	
	local i;
	local buffs = {};
	local j = 0;
	local Aura_On;
	local k = 0;
	local name, rank;
	
-- Get all Buffs of the Player

	for i=1, 16, 1 do
 		name, rank = GetPlayerBuffName(i); 
 		
 		if (name == nil) then 

 		else	
 			buffs[i] = name;
			j = j + 1;
 		end 		
	end

-- Check if the Buffs on the Player contain any Shout	
	for i=1, j, 1 do
		Aura_On = strfind(buffs[i], "Shout");
  	   	if (Aura_On == nil) then
  		else
    		k = Aura_On;
    	end
    	
	end 

-- If there is no Shout, put an annoying message on the screen	
	
	if (k == 0) and InCombatLockdown() then
    	UIErrorsFrame:AddMessage("Shout Missing!", 0.0, 1.0, 0.0, 1.0, 1);
	end

end			

end
  Reply With Quote
07-13-10, 03:16 AM   #4
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
GetPlayerBuffName(i) will need to be changed to UnitAura("player", i, "HELPFUL") or UnitBuff("player", i)

It should work if you just change this.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
07-13-10, 04:26 AM   #5
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The player can have more than 16 buffs now, so there is potential for your routine to not find a buff you currently have.
  Reply With Quote
07-13-10, 06:30 AM   #6
Shäken
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 5
Thanks all of you !
That works now.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Getplayerbuff issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off