Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Custom trigger 1
- function(a, e,UnitId,Type,...)
- local aura_env = aura_env
- local f = aura_env
- f.CurrentSpec = select(2,GetSpecializationInfo(GetSpecialization())) or "Undefined"
- if f.CurrentSpec == "Undefined" then
- C_Timer.After(1, function()
- f.CurrentSpec = select(2,GetSpecializationInfo(GetSpecialization())) or "Undefined"
- end)
- end
- for k in pairs(a) do
- a[k].show = false
- a[k].changed = true
- end
- if UnitClass("player") == "Rogue" and C_Covenants.GetActiveCovenantID() == 1 and e == "UNIT_AURA" then
- f.EchoVal = {}
- for j = 1, 40 do
- if tContains(f.EchoList.ID, select(10,UnitBuff("player", j))) then
- for m = 1, table.maxn(f.EchoList.ID) do
- if select(10,UnitBuff("player", j)) == f.EchoList.ID[m] then
- tinsert(f.EchoVal, f.EchoList.Stack[m])
- end
- end
- elseif select(10,UnitBuff("player", j)) == nil then
- break;
- end
- end
- end
- if f.config.Debug == true and Type ~= nil and e ~= "PLAYER_ENTERING_WORLD"then
- print("|cff1eff00Weakauras - "..f.id..":|r Power type used: "..Type.." - Power indexed: "..f.PowerTable[f.PowerType].." - Table id: "..f.PowerType.." - Power amount: "..f.Counter)
- end
- if (UnitId == "player" and Type == f.PowerTable[f.PowerType]) or (e == "PLAYER_ENTERING_COMBAT" and UnitId == "player") or (e == "PLAYER_ENTERING_WORLD") or (e == "PLAYER_REGEN_DISABLED") then
- if f.CurrentSpec ~= "Destruction" then
- f.Counter = UnitPower("player", f.PowerType)
- else
- local Fragments = UnitPower("player", 7, true);
- f.Counter = (Fragments/10);
- end
- end
- if f.PowerType ~= 6 and not tContains(f.BuffSpec.Name, f.CurrentSpec..UnitClass("player")) then
- if f.config.WIP == true and e == "UNIT_SPELLCAST_START" and f.CurrentSpec ~= "Destruction" then
- for i = 1, table.maxn(f.config.Spell) do
- if select(1,...) ~= nil and f.config.Spell[i].ID == select(1,...) then
- if UnitLevel("player") >= f.config.Spell[i].Req then
- f.Build = f.config.Spell[i].Build
- break;
- end
- end
- end
- if f.Build == 0 then
- local Cost = GetSpellPowerCost(select(1,...))
- if Cost then
- for _, costInfo in pairs(Cost) do
- if costInfo.type == f.PowerType then
- f.cost = costInfo.cost;
- break;
- end
- end
- end
- end
- end
- if f.config.WIP == true and e == "UNIT_SPELLCAST_STOP" and f.CurrentSpec ~= "Destruction" then
- f.Build = 0;
- f.cost = 0;
- end
- for i = 1, UnitPowerMax("player", f.PowerType) do
- local Val = f.Counter - (i-1)
- if f.cost > 0 then
- Val = Val - f.cost
- if Val < 0 then Val = 0 end;
- end
- a[i] = {
- show = true,
- changed = true,
- progressType = "static",
- value = Val,
- min = 0,
- total = 1,
- autoHide = false,
- index = i,
- CP = UnitPowerMax("player", f.PowerType),
- Echo = tContains(f.EchoVal, i),
- Build = f.Build > 0 and i > UnitPower("player", f.PowerType) and i <= UnitPower("player", f.PowerType) + f.Build,
- Cost = f.cost > 0 and i <= UnitPower("player", f.PowerType),
- }
- end
- elseif f.PowerType == 6 then --DK
- for i = 1,6 do
- local start, duration, ready = GetRuneCooldown(i)
- if start == nil then
- start = 0
- duration = 1
- ready = 1
- end
- a[i] = {
- show = true,
- changed = true,
- progressType = "timed",
- expirationTime = start + duration,
- duration = duration,
- index = i,
- Full = ready,
- CP = 6,
- Type = f.PowerType,
- }
- end
- table.sort(a, function(b,c)
- if b.expirationTime and c.expirationTime then
- return b.expirationTime < c.expirationTime
- else
- return true
- end
- end)
- elseif tContains(f.BuffSpec.Name, f.CurrentSpec..UnitClass("player")) then --Buff reliant specs
- local ind = 0
- for i = 1, table.maxn(f.BuffSpec.Name) do
- if f.BuffSpec.Name[i] == f.CurrentSpec..UnitClass("player") then
- ind = i
- break;
- end
- end
- for j = 1, f.BuffSpec.Cap[ind] do
- local BuffVal = 0;
- for m = 1, 40 do
- if UnitBuff("player", m) == nil then
- break;
- elseif select(10, UnitBuff("player", m)) == f.BuffSpec.ID[ind] then
- BuffVal = select(3, UnitBuff("player", m))
- break;
- end
- end
- a[j] = {
- show = true,
- changed = true,
- progressType = "static",
- value = BuffVal - (j - 1),
- min = 0,
- total = 1,
- autoHide = false,
- index = j,
- CP = f.BuffSpec.Cap[ind]
- }
- end
- end
- return true
- end
- Custom variable for trigger 1
- {
- CP = "number",
- Echo = "bool",
- Full = "bool",
- Type = "number",
- Build = "bool",
- Cost = "bool",
- }
- Custom trigger 2
- function(e,...)
- if aura_env.config.Debug == true then
- print("DEBUG - "..aura_env.id.." - trigger 2 - Event - "..e)
- end
- local CurrentSpec = select(2,GetSpecializationInfo(GetSpecialization()))
- if CurrentSpec ~= nil and tContains(aura_env.EnabledSpecs, CurrentSpec..UnitClass("player")) then
- if UnitClass("player") == "Druid" and CurrentSpec ~= "Feral" then
- return WA_GetUnitBuff("player", 768)
- else
- return true
- end
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement