SHARE
TWEET
Untitled
a guest
Jan 29th, 2018
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- --SETTINGS START
- --If you have questions regarding these settings, hit me up on Discord!
- --can be changed to match the tooltip values instead of the amount actually absorbed by Ignore Pain
- aura_env.matchTooltip = false
- --select what to display in the three available text fields.
- --the tokens between ## get replaced by values.
- --tokens available are:
- ---duration: total time of IP buff
- ---remaining: time left on IP buff
- ---curRage: current rage
- ---maxRage: maximum rage
- ---curIP: value of current IP buff
- ---maxIP: value of IP with maximum rage
- ---newIP: value of IP with current rage
- ---cap: total absorb cap of IP
- ---leftToCap: how much is left between curIP and the cap
- ---castIP: value of IP if cast right now (includes wasted absorb, can even be negative)
- ---curIPMaxHP: the current IP as a percentage of your maximum health
- aura_env.textLeft = "#curIP#"
- aura_env.textCenter = "#castIP#"
- aura_env.textRight = "#cap#"
- --use this setting to select a theme from the presets below.
- --you can customize the presets by changing the values.
- --colors are hexadecimal in the format AARRGGBB.
- --google "color picker" if you want to know hex codes for colors.
- aura_env.preset = "DEFAULT"
- --SETTINGS END
- --theme and presets
- aura_env.presets = {
- ["CUSTOM"] = { -- you can edit your own colors in here, just copy them over when you get a new version.
- ["colorCurIP"] = "ffffffff",
- ["colorCurIPOverCap"] = "ffffffff",
- ["colorCastIP"] = "ffffffff",
- ["colorCastIPWaste"] = "ffffffff",
- ["alwaysShowCastBar"] = false,
- ["showTimeSpark"] = true,
- ["textCenterFontName"] = "Fonts\\FRIZQT__.TTF",
- ["textCenterFontSize"] = 18,
- ["textCenterFontFlags"] = "",
- },
- ["MEGASUS"] = { -- orange theme, blue waste, and no over cap. Suggested by Megasus#0782
- ["colorCurIP"] = "ffea6420",
- ["colorCurIPOverCap"] = "ffea6420",
- ["colorCastIP"] = "fff29b29",
- ["colorCastIPWaste"] = "ff005dff",
- ["alwaysShowCastBar"] = false,
- ["showTimeSpark"] = true,
- ["textCenterFontName"] = "Fonts\\FRIZQT__.TTF",
- ["textCenterFontSize"] = 25,
- ["textCenterFontFlags"] = "",
- },
- ["DEFAULT"] = { -- default orange/yellow theme, greenish waste, and red for over cap.
- ["colorCurIP"] = "ffff9000",
- ["colorCurIPOverCap"] = "ffff0000",
- ["colorCastIP"] = "ffddff00",
- ["colorCastIPWaste"] = "ff00ff99",
- ["alwaysShowCastBar"] = false,
- ["showTimeSpark"] = true,
- ["textCenterFontName"] = "Fonts\\FRIZQT__.TTF",
- ["textCenterFontSize"] = 18,
- ["textCenterFontFlags"] = "",
- },
- }
- aura_env.theme = {}
- if aura_env.preset then
- local preset = aura_env.presets[aura_env.preset]
- if not preset then
- preset = aura_env.presets["DEFAULT"]
- end
- aura_env.theme = preset
- end
- --text replacement tokens
- aura_env.tokens = {
- ["duration"] = function()
- if aura_env.duration > 0 then
- return string.format("%d", aura_env.duration)
- else
- return ""
- end
- end,
- ["remaining"] = function()
- if aura_env.expiration > 0 then
- return string.format("%d", (aura_env.expiration-GetTime()))
- else
- return ""
- end
- end,
- ["curRage"] = function()
- return string.format("%d", aura_env.curRage)
- end,
- ["maxRage"] = function()
- return string.format("%d", aura_env.maxRage)
- end,
- ["curIP"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.curIP))
- end,
- ["maxIP"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.maxIP))
- end,
- ["newIP"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.newIP))
- end,
- ["castIP"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.castIP))
- end,
- ["leftToCap"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.leftToCap))
- end,
- ["cap"] = function()
- return string.format("%s", aura_env.shortenNumber(aura_env.cap))
- end,
- ["curIPMaxHP"] = function()
- return string.format("%d", (aura_env.curIP/UnitHealthMax("player")*100))
- end,
- }
- aura_env.replaceTokens = function(text)
- local repl = function(token)
- local f = aura_env.tokens[token]
- if f and type(f) == "function" then
- return f()
- end
- return token
- end
- local s = text:gsub("#(.-)#", repl)
- return s
- end
- --hex to rgb helper function
- aura_env.HexToRGB = function(hex)
- local a,r,g,b = 1,1,1,1
- if hex and type(hex) == "string" and strlen(hex) == 8 then
- a = tonumber(hex:sub(1,2), 16)/255
- r = tonumber(hex:sub(3,4), 16)/255
- g = tonumber(hex:sub(5,6), 16)/255
- b = tonumber(hex:sub(7,8), 16)/255
- end
- return r,g,b,a
- end
- --init stuff
- aura_env.duration = 0
- aura_env.expiration = 0
- aura_env.curRage = 0
- aura_env.maxRage = 0
- aura_env.curIP = 0
- aura_env.maxIP = 0
- aura_env.newIP = 0
- aura_env.castIP = 0
- aura_env.cap = 0
- aura_env.leftToCap = 0
- aura_env.hasMinRage = false
- --calculate IP values
- aura_env.updateIPValues = function()
- --Rage
- aura_env.curRage = UnitPower("player")
- aura_env.maxRage = UnitPowerMax("player")
- local costs = GetSpellPowerCost(190456)
- local minRage = costs[1].minCost or 20
- local maxRage = costs[1].cost or 60
- local calcRage = math.max(minRage, math.min(maxRage, aura_env.curRage))
- if maxRage == 0 then
- maxRage = 60
- end
- aura_env.hasMinRage = aura_env.curRage > minRage
- --attack power
- local apBase, apPos, apNeg = UnitAttackPower("player")
- --Versatility rating
- local vers = 1 + ((GetCombatRatingBonus(29) + GetVersatilityBonus(30)) / 100)
- --Dragon Skin
- --check artifact traits
- local currentRank = 0
- if IsAddOnLoaded("LibArtifactData-1.0") or LoadAddOn("LibArtifactData-1.0") then
- aura_env.LAD = aura_env.LAD or LibStub("LibArtifactData-1.0")
- if not aura_env.LAD:GetActiveArtifactID() then
- aura_env.LAD:ForceUpdate()
- end
- --pos, traitid, spellid, name, icon, rank, max, bonus, gold, first, last
- for _, _, spellid, name, _, rank in aura_env.LAD:IterateTraits() do
- if spellid == 203225 then
- currentRank = rank
- break
- end
- end
- end
- local trait = 1 + 0.02 * currentRank
- --Dragon Scales
- local scales = UnitBuff("player", GetSpellInfo(203581)) and 1.4 or 1
- --Never Surrender
- local curHP = UnitHealth("player")
- local maxHP = UnitHealthMax("player")
- local misPerc = (maxHP - curHP) / maxHP
- local nevSur = select(4, GetTalentInfo(5, 2, 1))
- local nevSurPerc = nevSur and (1 + misPerc) or 1
- --Indomitable
- local indom = select(4, GetTalentInfo(5, 3, 1)) and 1.2 or 1
- --T18
- local t18 = UnitBuff("player", GetSpellInfo(12975)) and aura_env.GetNumSetPieces("T18") >= 4 and 2 or 1
- local ipvalues = {UnitBuff("player", GetSpellInfo(190456))}
- --ip duration
- aura_env.duration, aura_env.expiration = ipvalues[6] or 0, ipvalues[7] or 0
- --current IP value
- aura_env.curIP = ipvalues[17] or 0
- if aura_env.matchTooltip then
- aura_env.curIP = aura_env.curIP / 0.9 --get the tooltip value instead of the absorb
- end
- --max IP with one cast
- aura_env.maxIP = (apBase + apPos + apNeg) * 22.3 * vers * indom * scales
- if not aura_env.matchTooltip then
- aura_env.maxIP = aura_env.maxIP * 0.9
- end
- --new IP with current rage
- aura_env.newIP = aura_env.maxIP * (calcRage / maxRage) * trait * nevSurPerc * t18
- --cap
- aura_env.cap = aura_env.maxIP * 3
- if nevSur then
- aura_env.cap = aura_env.cap * 2
- end
- --how much left to cap
- aura_env.leftToCap = aura_env.cap - aura_env.curIP
- --how much casting ip would give right now
- aura_env.castIP = math.min(aura_env.leftToCap, aura_env.newIP)
- end
- aura_env.updateIPValues()
- --shorten numbers to 3 digits
- aura_env.shortenNumber = function(number)
- if type(number) ~= "number" then
- number = tonumber(number)
- end
- if not number then
- return
- end
- local affixes = {
- "",
- "k",
- "m",
- "b",
- "t",
- }
- local affix = 1
- local dec = 0
- local num1 = math.abs(number)
- while num1 >= 1000 and affix < #affixes do
- num1 = num1 / 1000
- affix = affix + 1
- end
- if affix > 1 then
- dec = 2
- local num2 = num1
- while num2 >= 10 and dec > 0 do
- num2 = num2 / 10
- dec = dec - 1
- end
- end
- if number < 0 then
- num1 = -num1
- end
- return string.format("%."..dec.."f"..affixes[affix], num1)
- end
- --set bonuses
- aura_env.GetNumSetPieces = function(set, class)
- class = class or select(2, UnitClass("player"))
- local sets = aura_env.sets[class]
- if not sets then
- return -1
- end
- local pieces = sets[set]
- if not pieces then
- return -1
- end
- local counter = 0
- for _, itemID in ipairs(pieces) do
- if IsEquippedItem(itemID) then
- counter = counter + 1
- end
- end
- return counter
- end
- aura_env.sets = {
- ["WARRIOR"] = {
- ["T18"] = {
- 124319,
- 124329,
- 124334,
- 124340,
- 124346,
- },
- },
- }
- --frame stuff--
- aura_env.orientation = WeakAuras.regions[aura_env.id].region.orientation
- if aura_env.orientation == "HORIZONTAL" then
- aura_env.point = "LEFT"
- aura_env.offsetXMulti = 1
- aura_env.offsetYMulti = 0
- aura_env.castPoint = "RIGHT"
- elseif aura_env.orientation == "HORIZONTAL_INVERSE" then
- aura_env.point = "RIGHT"
- aura_env.offsetXMulti = -1
- aura_env.offsetYMulti = 0
- aura_env.castPoint = "LEFT"
- elseif aura_env.orientation == "VERTICAL" then
- aura_env.point = "TOP"
- aura_env.offsetXMulti = 0
- aura_env.offsetYMulti = -1
- aura_env.castPoint = "BOTTOM"
- elseif aura_env.orientation == "VERTICAL_INVERSE" then
- aura_env.point = "BOTTOM"
- aura_env.offsetXMulti = 0
- aura_env.offsetYMulti = 1
- aura_env.castPoint = "TOP"
- end
- local bar = WeakAuras.regions[aura_env.id].region.bar
- --create castIP bar
- if bar.cast then bar.cast:Hide() end
- local cast = bar:CreateTexture(nil, "ARTWORK")
- cast:SetDrawLayer("ARTWORK", 3)
- cast:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\Square_White.tga")
- cast:SetBlendMode("ALPHAKEY")
- cast:SetVertexColor(1,1,1,0.3)
- if aura_env.orientation == "HORIZONTAL" or aura_env.orientation == "HORIZONTAL_INVERSE" then
- cast:SetWidth(50)
- cast:SetHeight(bar:GetHeight())
- elseif aura_env.orientation == "VERTICAL" or aura_env.orientation == "VERTICAL_INVERSE" then
- cast:SetWidth(bar:GetWidth())
- cast:SetHeight(50)
- end
- bar.cast = cast
- --create timer spark
- if bar.sparkTime then bar.sparkTime:Hide() end
- local sparkTime = bar:CreateTexture(nil, "ARTWORK")
- sparkTime:SetDrawLayer("ARTWORK", 4)
- sparkTime:SetTexture(bar.spark:GetTexture())
- sparkTime:SetBlendMode(bar.spark:GetBlendMode())
- if aura_env.orientation == "HORIZONTAL" or aura_env.orientation == "HORIZONTAL_INVERSE" then
- sparkTime:SetWidth(bar.spark:GetWidth())
- sparkTime:SetHeight(bar.spark:GetHeight())
- elseif aura_env.orientation == "VERTICAL" or aura_env.orientation == "VERTICAL_INVERSE" then
- sparkTime:SetWidth(bar.spark:GetHeight())
- sparkTime:SetHeight(bar.spark:GetWidth())
- end
- bar.sparkTime = sparkTime
- aura_env.rotateText = function(text)
- if not text.rotated
- and (aura_env.orientation == "VERTICAL"
- or aura_env.orientation == "VERTICAL_INVERSE") then
- text.animGroup = text.animGroup or text:CreateAnimationGroup()
- text.animGroup.rotate = text.animGroup.rotate or text.animGroup:CreateAnimation("rotation")
- text.animGroup.rotate:SetOrigin("CENTER", 0, 0);
- text.animGroup.rotate:SetDegrees(90);
- text.animGroup.rotate:SetDuration(0);
- text.animGroup.rotate:SetEndDelay(2147483647);
- text.animGroup:Play();
- text.animGroup.rotate:SetSmoothProgress(1);
- text.animGroup:Pause();
- text.offset = -(text:GetStringHeight() / 2) + 2
- text.rotated = true
- end
- end
- --create center text
- if bar.centerText then bar.centerText:Hide() end
- local text = bar:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
- text.offset = 0
- text.rotated = false
- text:SetWordWrap(false)
- bar.centerText = text
RAW Paste Data

