Friday, May 31, 2013

LUA-spirits aid me!

My raid team is now 8/12 normal in Throne of Thunder, and I've been a Brewmaster for a little over a month. I've learned a lot this time; my rotation and cooldown usage has improved a lot, I change talents and glyphs depending on which fight we're doing, and I understand the different stats and gearing strategies better (thanks to Sunnier and Elitist Jerks!). I got my tier 15 2-set bonus the other day, and I suddenly find myself interested in knowing how much of the incoming damage at any given time I actually stagger.

I opened WeakAuras, selected New, selected Text, and then... I realized that although I know what I want to say, I don't speak this LUA-language!

In common tongue what I want to math out is

Incoming damage that will be staggered =
20 % from Stance of the Sturdy Ox +
x % from Mastery +
20 % from Shuffle (if active) +
20 % from Fortifying Brew (if active) +
12 % from Staggering (if active)

I have a text-aura already that gives me Avoidance and Vengeance. I would like to add the Stagger Percentage info to the same frame:

function ()
local valAvoid=5+GetParryChance("Player")+GetDodgeChance("Player");
local name,_,icon,_,_,_,_,_,_,_,_,_,_,_, valVengeance=UnitBuff("player", "Vengeance");
if name == nil then
valVengeance = valVengeance or 0;
if(valVengeance > 999) then valVengeance = math.floor(valVengeance/1000) .. "k" end;

-- strReturn=format("Avoidance: %.1f".."%%".."\nVengeance: %s",valAvoid, valVengeance);

strReturn=format("Avoidance: %.1f", valAvoid).."%%"..format("\nVengeance: %s",valVengeance);

return strReturn


I found a script for showing Mastery, but it says I have 14,77 Mastery, not the 9,86 % I really have:

-- Custom text function
function ()
-- Don't change this (update every second only)
local now = GetTime();
if now >= WA_STATS_LAST_UP + 0.1 then
-- Shedule next update

-- Current values

local has = UnitMastery("player"); -- Mastery

-- Return text
WA_STATS_RETURN = string.format([[
Mastery: %.1f]],
has or 0

return WA_STATS_RETURN or "";

If anyone knows how to set a script like this up, or can point me in the direction of something already made, I would be most grateful!



  1. Ever read Theck? He just posted his 5.3 updated strings.

    1. Thanks! I'll check it out!

    2. Hi Kalven. I've looked at Theck's auras, and indeed he has a stagger aura. Unfortunately it wasn't an stagger-aura that shows how much stagger damage I'm taking that I'm looking for (I already have one), it's one that shows how much incoming damage I will be staggering. Thanks a lot for the tip though. :)