Thread Tools Display Modes
03-16-10, 09:48 AM   #1
bluenjoy
A Deviate Faerie Dragon
 
bluenjoy's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2009
Posts: 13
Exclamation Maelstrom Buff Display

Hi. I'm looking to use the same script Alza used for Sword & Board for my shamans Maelstrom talent. The one thing I'm stumped on is how to display the stack on the spell icon.

Code:
local spellName, _, spellIcon = GetSpellInfo({51528,51529,51530,51531,51532})

local frame = CreateFrame("Frame", nil, UIParent)
frame:SetPoint("CENTER", UIParent, "CENTER", 1, -90)
frame:SetHeight(57)
frame:SetWidth(57)

frame:RegisterEvent"UNIT_AURA"
frame:RegisterEvent"PLAYER_ENTERING_WORLD"
frame:SetScript("OnEvent", function(self, event, unit)
	if(not unit or unit=="player") then
		self:SetAlpha(0)

		for i = 1, 32 do
			local name = UnitAura("player", i, "HELPFUL")
			if(name==spellName) then
				return self:SetAlpha(1)
			end
		end
	end
end)

frame.icon = frame:CreateTexture(nil, "BACKGROUND")
frame.icon:SetAllPoints(frame)
frame.icon:SetTexture(spellIcon)
frame.icon:SetTexCoord(0.1, 0.9, 0.0, 0.9)

frame.overlay = frame:CreateTexture(nil, "OVERLAY")
frame.overlay:SetTexture("Interface\\Textures\\border")
frame.overlay:SetAllPoints(frame)
Any help would be great.

Thank you
__________________
-Biggie
  Reply With Quote
03-16-10, 02:20 PM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
You will need to add a FontString and then the number of stacks from the UnitAura function
__________________
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
03-20-10, 05:40 PM   #3
bluenjoy
A Deviate Faerie Dragon
 
bluenjoy's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2009
Posts: 13
So I came up with:

Code:
local spellName, _, spellIcon = GetSpellInfo(53817)

local frame = CreateFrame("Frame", nil, UIParent)
frame:SetPoint("CENTER", UIParent, "CENTER", 1, -90)
frame:SetHeight(57)
frame:SetWidth(57)

frame:RegisterEvent"UNIT_AURA"
frame:RegisterEvent"PLAYER_ENTERING_WORLD"
frame:SetScript("OnEvent", function(self, event, unit)
	if(not unit or unit=="player") then
		self:SetAlpha(0)

		for i = 1, 32 do
			local name = UnitAura("player", i, "HELPFUL")
			if(name==spellName) then
				return self:SetAlpha(1)
			end
		end
	end
end)

frame.icon = frame:CreateTexture(nil, "BACKGROUND")
frame.icon:SetAllPoints(frame)
frame.icon:SetTexture(spellIcon)
frame.icon:SetTexCoord(0.1, 0.9, 0.0, 0.9)

frame.stacktext = frame:CreateFontString(nil, "OVERLAY")
frame.stacktext:SetFont("Fonts\\ARIALN.ttf",20,"OUTLINE")
frame.stacktext:SetJustifyH("RIGHT")
frame.stacktext:SetVertexColor(1,1,1)
frame.stacktext:SetPoint("RIGHT", frame.icon, "RIGHT",1,-5)

frame.overlay = frame:CreateTexture(nil, "OVERLAY")
frame.overlay:SetTexture("Interface\\Textures\\border")
frame.overlay:SetAllPoints(frame)
still not showing the stack.
Can some1 help this poor novice
__________________
-Biggie
  Reply With Quote
03-20-10, 07:17 PM   #4
Recluse
A Cliff Giant
 
Recluse's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 70
From: http://www.wowwiki.com/API_UnitAura
name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId
= UnitAura("unit", index or "name"[, "rank"[, "filter"]]

count
Number - The number of times the debuff has been applied to the target. Returns 0 for any debuff which doesn't stack. ( Changed in 1.11 ).
Then frame.stacktext:SetText(value) after matching spell.
__________________
We'd be together, but only diamonds last forever...
  Reply With Quote
03-20-10, 08:16 PM   #5
bluenjoy
A Deviate Faerie Dragon
 
bluenjoy's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2009
Posts: 13
I'm still utterly confused. I'll find some Maelstrom announcer I guess. Thanks for your assistance
__________________
-Biggie
  Reply With Quote
03-21-10, 04:05 AM   #6
Diagnostics
Medic!
 
Diagnostics's Avatar
Premium Member
Join Date: Jul 2009
Posts: 71
You could try taking a look at the enhancement setup in http://www.wowinterface.com/download...amanAuras.html
__________________
  Reply With Quote
03-21-10, 10:51 PM   #7
bluenjoy
A Deviate Faerie Dragon
 
bluenjoy's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2009
Posts: 13
Thanks for much for this source. I never tried PowerAuras to it's fullest potential and these presettings are amazing!
__________________
-Biggie
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Maelstrom Buff Display


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