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=0;
else
valVengeance = valVengeance or 0;
if(valVengeance > 999) then valVengeance = math.floor(valVengeance/1000) .. "k" end;
end;


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

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

return strReturn

end

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();
WA_STATS_LAST_UP = WA_STATS_LAST_UP or now - 1;
if now >= WA_STATS_LAST_UP + 0.1 then
-- Shedule next update
WA_STATS_LAST_UP = now;

-- Current values

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

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

return WA_STATS_RETURN or "";
end

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!



/bow

3 comments:

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

    http://www.sacredduty.net/2013/05/31/patch-5-3-weakauras-configuration/

    ReplyDelete
    Replies
    1. Thanks! I'll check it out!

      Delete
    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. :)

      Delete