WEAKAURA

Maelstrom Bar ++

Updated Apr 20th 2017 WoW 7.2 User Satron Views 10,962 Comments 10 Stars 2 Collections 1 Link https://wago.io/MaelstromBar
Elemental Shaman



Description:
Advanced and Customizable version of the Maelstrom Prediction Bar : https://wago.io/VyA9jZtIZ

With the options you'll find in Actions>OnInit you can change/set many things :

  • Show Mana Bar

  • Enable Dynamic Earth Shock (showing optimal Ms to spend) or Static

  • Add Markers (individually hideable) : 20 and 50 Ms,Earth Shock

  • Change Textures, Basic Colors (RGBA from 0 to 1)

  • Dynamically change color, either through steps or linear way

  • Show Maelstrom Prediction and take incount or not Totem Mastery

  • Castbar : Bar or Spark (2 anchors possible)

  • Chance Texture at a certain Maelstrom value

  • Play a sound after a certain Maelstrom value (SFX)

  • Many more to come



After importing or changing options, it's highly recommanded to do a simple /reload !
Text Size and Fonts, Main Bar Size can be changed in display.

How to update : copy your previous options, get the new version, change new options (at the top), paste old options just below to replace defaults, save, rename, delete previous.
If you ever skip a version, the latest options will always be at the top, so check if they were or not in your previous one!

If you have an error under the Action>OnInit textbox, try going to the bottom of the text and pressing enter.
Special thanks to Notes and Keyimin for their testings and recommandations!

20th April Fix : Fixing memory leak and mana bar color
To update directly in your version :
1) In the trigger tab, under "event(s)" (a small codebox), delete "FRAME_UPDATE,". You should have "COMBAT_LOG_EVENT_UNFILTERED,UNIT_POWER" left in there
2) Around line 360 in options (OnInit), replace the whole aura_env.maxHScast() lines with :
aura_env.maxHScast=function() local curr = UnitPower("player",0) local mana_cost = GetSpellPowerCost(8004)[1].cost or 0 local base, casting = GetManaRegen() local _,_,_,_,startTime,endTime,_,_,_= UnitCastingInfo("player") local endTime=endTime or 1000*GetTime() local CastTimeLeft=endTime/1000-GetTime() local ManaRegenerated=CastTimeLeft*casting local ManaAtEnd=ManaRegenerated+curr if curr<mana_cost then return 0 elseif ManaAtEnd<2*mana_cost then return 1 else return 2 end end


14th April Fix : Fixing color step for >100Ms
To update directly in your version :
in aura_env.updateColorBaseBar (around line 307) aura_env.updateColorPredictBar (around line 374)
add
local maxMs = UnitPowerMax('player',aura_env.powerID)
and replace
if aura_env.predictBarCC[86].s and cap>=aura_env.getESvalue() then cap=86
to
if aura_env.predictBarCC[86].s and cap>=aura_env.getESvalue()+maxMs-100 then cap=86


28th March Fix : Updating for 125Ms cap
To update directly in your version :
In trigger, around line 15-20 there's
aura_env.moveMarker(86,aura_env.getESvalue())
delete it and replace it with :
for k,v in pairs(aura_env.showMarkers) do if v then aura_env.moveMarker(k,k) end if k==86 then aura_env.moveMarker(86,(aura_env.getESvalue()+maxMs-100)) end end
Also, if you havent already done it, remember to change the getESvalue function around line 250 in OnInit with
aura_env.getESvalue=function() if aura_env.EStype=="dynamic" then local curr,max,start,dur = select(1,GetSpellCharges(GetSpellInfo(51505)))--LvB local gcd, gcdDUR = GetSpellCooldown(61304) -- GCD local LvBoffCD if max and max>1 then LvBoffCD=curr>0 else local start,dur=GetSpellCooldown(GetSpellInfo(51505)) LvBoffCD = (start==0) or start+dur==gcd+gcdDUR end return ((LvBoffCD and 86) or 92) else return 92 end end

16th February Fix : Fixing castbar progress
To update directly in your version :
Create a new trigger > custom > status > everyframe
Set custom trigger to :
function() if aura_env.showCastBar=="rectangle" or aura_env.showCastBar=="spark" then aura_env.updateCastBar() end return true end

3rd February Fix : Fixing over-prediction problem (due to Totem Mastery)

To update directly in your version :
Around line 275 in Options, in the function TMTickToCastEnd, change from :
if UnitCastingInfo("player") and aura_env.addTM and aura_env.TMtimer>GetTime() then
To :
if UnitCastingInfo("player") and aura_env.addTM and aura_env.TMtimer>GetTime() and UnitBuff("player",GetSpellInfo(202188)) then

This Weak Aura includes custom functions.


Preview

Comments
Posted by Barcode 21 days ago. Reply 2017-05-02 08:07
@Satron Thanks a lot,
this makes my UI so much more satisfying to look at prepull :D
Posted by Satron 23 days ago. Reply 2017-04-30 08:44
@Barcode
Hello, I deleted my previous answer because i found a way to do it :

Go into the 2nd trigger, and add the following code (for example just under the "function()" line) :
aura_env.this = WeakAuras.regions[aura_env.id].region if (UnitExists("target") and UnitReaction("player","target")<=4) or UnitAffectingCombat("player") then aura_env.this:Show() else aura_env.this:Hide() end

This will make the aura display if you can attack your target OR you're in combat, if you dont want the combat part, just delete "or UnitAffectingCombat("player")".
Obviously, you'll also need to uncheck Combat as a load condition.
Posted by Barcode 24 days ago. Reply 2017-04-29 15:49
Hey,
i am wondering if there is an option to make the bar appear when you target an attackable enemy instead of you being infight, i couldn't find the actual trigger to make the bar appear in the code but i am in no means an expert. Would be great if you could tell me where to edit this^^.

P.S.: Thanks a lot for the work you are putting in here. :)
Posted by Satron a month ago. Reply 2017-04-20 03:02
@Lightstylez
The problem has been identified and fixed (look at descriptions for how to fix, its fairly easy, or import new version), with several other minor fixes as well.
Posted by Lightstylez a month ago. Reply 2017-04-19 12:00
This weakaura was causing a memory leak, memory usage for weakauras rocketing higher and higher and was getting huge fps stutter the more intense the situatuon e.g. spamming chain lightning+earthquake on a ton of adds. After i disabled it all was normal. I did a reload ui when i first added the weakaura aswell. :-/
Posted by Satron 4 months ago. Reply 2017-02-05 02:46
@Wondermantee it'd be possible to do that, but you'd lose graphic features like markers or castbar i guess.
It's not planned yet to implement things like that. Maybe rotating with the default display option could work (at least for the bars); if not, there would be a line to add a couple of times in the code to make it work.

Posted by wondermantee 4 months ago. Reply 2017-02-04 16:44
@Satron hi i was wondering if there was someway to have this be vertical? like just rotate it so i can keep all the other things this weakaura can do
Posted by Satron 4 months ago. Reply 2017-02-04 03:23
@Morals This video was made by Notes, so most of things you see here are his WAs, that you can find here : https://wago.io/EyLr69RUZ

The CD bar at the bottom is from fortexorcist
Posted by Morals 4 months ago. Reply 2017-02-04 03:12
thank you for this!

mind i ask what is that conveying cd's on top of your player/target frames?? another wa?
Posted by thedanisme 5 months ago. Reply 2016-12-23 10:43