From 2765b16db9252490dec509ca0c01045bdb8785c0 Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Tue, 6 Jan 2015 22:28:52 -0600 Subject: [PATCH] 5.4.159 --- .../libs/LibSuperVillain-1.0/modules/SpecialFX.lua | 2 +- .../Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua | 130 ------- .../Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc | 8 - .../Plugins/oUF_Conqueror/oUF_Conqueror.lua | 67 ++-- .../oUF_DrunkenMaster/oUF_DrunkenMaster.lua | 215 ------------ .../oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua | 287 ++++++++++++++++ .../Plugins/oUF_MageMagic/oUF_MageMagic.lua | 362 ++++++++++++++++++++ .../Plugins/oUF_MageMagic/oUF_MageMagic.toc | 8 + .../Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua | 105 ------ .../AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml | 5 +- .../SVUI/packages/quest/components/active.lua | 1 + .../SVUI/packages/quest/components/button.lua | 16 +- .../AddOns/SVUI/packages/unit/elements/misc.lua | 106 +++++- Interface/AddOns/SVUI/packages/unit/frames.lua | 9 +- .../AddOns/SVUI/packages/unit/resources/mage.lua | 109 ++++-- .../AddOns/SVUI/packages/unit/resources/monk.lua | 97 +++--- .../AddOns/SVUI/packages/unit/resources/priest.lua | 7 +- .../SVUI/packages/unit/resources/warrior.lua | 102 +++++- Interface/AddOns/SVUI/system/utilities.lua | 3 +- 19 files changed, 1046 insertions(+), 593 deletions(-) delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua create mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua create mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua create mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua create mode 100644 Interface/AddOns/SVUI/packages/unit/resources/.subl53c.tmp diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua index ff0ad09..f481c2d 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua @@ -69,7 +69,7 @@ local EFFECTS_LIST = setmetatable({ ["shadow"] = {[[Spells\Shadow_precast_uber_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, ["arcane"] = {[[Spells\Cast_arcane_01.m2]], -12, 12, 12, -12, 0.25, 0, 0}, ["fire"] = {[[Spells\Bloodlust_state_hand.m2]], -8, 4, 24, -24, 0.23, -0.08, 0.08}, - ["frost"] = {[[Spells\Ice_cast_low_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, + ["frost"] = {[[Spells\Ice_cast_low_hand.m2]], -12, 12, 12, -12, 0.25, -0.2, -0.35}, ["chi"] = {[[Spells\Fel_fire_precast_high_hand.m2]], -12, 12, 12, -12, 0.3, 0, 0}, ["lightning"] = {[[Spells\Fill_lightning_cast_01.m2]], -12, 12, 12, -12, 1.25, 0, 0}, ["water"] = {[[Spells\Monk_drunkenhaze_impact.m2]], -12, 12, 12, -12, 0.9, 0, 0}, diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua deleted file mode 100644 index 37c65e5..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua +++ /dev/null @@ -1,130 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; ---BLIZZARD API -local GetTime = _G.GetTime; -local GetSpecialization = _G.GetSpecialization; -local UnitDebuff = _G.UnitDebuff; - -if select(2, UnitClass('player')) ~= "MAGE" then return end - -local _, ns = ... -local oUF = oUF or ns.oUF -if not oUF then return end - -local function UpdateBar(self, elapsed) - if not self.duration then return end - self.elapsed = (self.elapsed or 0) + elapsed - if self.elapsed >= 0.5 then - local timeLeft = (self.duration - GetTime()) - if timeLeft > 0 then - self:SetValue(timeLeft) - else - self.start = nil - self.duration = nil - self:SetValue(0) - self:Hide() - self:SetScript("OnUpdate", nil) - end - end -end - -local Update = function(self, event, unit) - if(self.unit ~= unit) then return end - local bar = self.ArcaneChargeBar - local spec = GetSpecialization() - - if(bar.PreUpdate) then bar:PreUpdate(spec) end - - local arcaneCharges, start, duration = 0; - if bar:IsShown() then - for index=1, 30 do - local count, _, spellID = 0; - _, _, _, count, _, start, duration, _, _, _, spellID = UnitDebuff(unit, index) - if spellID == 36032 then - arcaneCharges = count or 0 - start = start - duration = duration - break - end - end - - for i = 1, 4 do - if start and duration then - bar[i]:SetMinMaxValues(0, start) - bar[i].start = start - bar[i].duration = duration - end - - if i <= arcaneCharges then - bar[i]:Show() - bar[i]:SetValue(start) - bar[i]:SetScript('OnUpdate', UpdateBar) - else - bar[i]:SetValue(0) - bar[i]:Hide() - end - end - end - - if(bar.PostUpdate) then - return bar:PostUpdate(event, arcaneCharges, maxCharges) - end -end - - -local Path = function(self, ...) - return (self.ArcaneChargeBar.Override or Update) (self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, 'ForceUpdate', element.__owner.unit) -end - -local function Enable(self, unit) - local bar = self.ArcaneChargeBar - - if(bar) then - self:RegisterEvent("UNIT_AURA", Path) - self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) - self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) - bar.__owner = self - bar.ForceUpdate = ForceUpdate - - for i = 1, 4 do - if not bar[i]:GetStatusBarTexture() then - bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) - end - - bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) - bar[i]:GetStatusBarTexture():SetHorizTile(false) - - if bar[i].bg then - bar[i]:SetMinMaxValues(0, 1) - bar[i]:SetValue(0) - bar[i].bg:SetAlpha(0.4) - bar[i].bg:SetAllPoints() - bar[i]:Hide() - end - end - - return true; - end -end - -local function Disable(self,unit) - local bar = self.ArcaneChargeBar - - if(bar) then - self:UnregisterEvent("UNIT_AURA", Path) - self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) - bar:Hide() - end -end - -oUF:AddElement("ArcaneChargeBar",Path,Enable,Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc deleted file mode 100644 index 9f98003..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ /dev/null @@ -1,8 +0,0 @@ -## Interface: 50001 -## Title: oUF Arcane Charge -## Notes: Adds support for arcane charge indicators to oUF. -## Author: Munglunch -## Version: 5.4.15 -## Dependencies: oUF - -oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua index 1d6cdaa..c8ad6d0 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua @@ -11,44 +11,53 @@ local UnitDebuff = _G.UnitDebuff; local parent, ns = ... local oUF = ns.oUF -local RAGE_AURAS = {} +local ENRAGE_ID = 13046; local function getRageAmount() for i = 1, 40 do - local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = - UnitDebuff("player", i) - if RAGE_AURAS[spellID] then - return amount + local name, rank, icon, count, dispelType, duration, expires, _, _, _, spellID, _, _, _, amount = + UnitBuff("player", i) + if spellID == ENRAGE_ID then + return duration, expires end end - return 0 + return 0,0 end -local OnUpdate = function(self, elapsed) - local duration = self.duration + elapsed - if(duration >= self.max) then - return self:SetScript("OnUpdate", nil) - else - self.duration = duration - return self:SetValue(duration) - end +local BarOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - GetTime()) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + self.start = nil + self.duration = nil + self:SetValue(0) + self:Hide() + self:SetScript("OnUpdate", nil) + end + end end local Update = function(self, event, unit) - if(unit and unit ~= self.unit) then return end - local bar = self.Conqueror - if(bar.PreUpdate) then bar:PreUpdate(event) end - - local value = getRageAmount() - - if(value) then - bar:SetMinMaxValues(0, 100) - bar:SetValue(value) - bar:Update() + local element = self.Conqueror + local bar = element.Enrage + if(element.PreUpdate) then element:PreUpdate(event) end + + local start, duration = getRageAmount() + + if(duration and start) then + bar:SetMinMaxValues(0, start) + bar:SetValue(start) + bar.start = start + bar.duration = duration + bar:SetScript('OnUpdate', BarOnUpdate) end - if(bar.PostUpdate) then - return bar:PostUpdate(event) + if(element.PostUpdate) then + return element:PostUpdate(event) end end @@ -69,9 +78,11 @@ local Enable = function(self) self:RegisterEvent('UNIT_AURA', Path, true) - if(bar:IsObjectType'Texture' and not bar:GetTexture()) then - bar:SetTexture[[Interface\TargetingFrame\UI-StatusBar]] + if(bar.Enrage:IsObjectType'Texture' and not bar.Enrage:GetTexture()) then + bar.Enrage:SetTexture[[Interface\TargetingFrame\UI-StatusBar]] end + bar.Enrage:SetMinMaxValues(0, 100) + bar.Enrage:SetValue(0) return true end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua deleted file mode 100644 index 9641835..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua +++ /dev/null @@ -1,215 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local error = _G.error; -local print = _G.print; -local pairs = _G.pairs; -local next = _G.next; -local tostring = _G.tostring; -local type = _G.type; ---BLIZZARD API -local GetLocale = _G.GetLocale; -local GetShapeshiftFormID = _G.GetShapeshiftFormID; -local UnitAura = _G.UnitAura; -local UnitHasVehiclePlayerFrameUI = _G.UnitHasVehiclePlayerFrameUI; -local MonkStaggerBar = _G.MonkStaggerBar; - -if select(2, UnitClass('player')) ~= "MONK" then return end - -local parent, ns = ... -local oUF = ns.oUF -local floor = math.floor; -local DM_L = {}; - -if GetLocale() == "enUS" then - DM_L["Stagger"] = "Stagger" - DM_L["Light Stagger"] = "Light Stagger" - DM_L["Moderate Stagger"] = "Moderate Stagger" - DM_L["Heavy Stagger"] = "Heavy Stagger" - -elseif GetLocale() == "frFR" then - DM_L["Stagger"] = "Report" - DM_L["Light Stagger"] = "Report mineur" - DM_L["Moderate Stagger"] = "Report mod??" - DM_L["Heavy Stagger"] = "Report majeur" - -elseif GetLocale() == "itIT" then - DM_L["Stagger"] = "Noncuranza" - DM_L["Light Stagger"] = "Noncuranza Parziale" - DM_L["Moderate Stagger"] = "Noncuranza Moderata" - DM_L["Heavy Stagger"] = "Noncuranza Totale" - -elseif GetLocale() == "deDE" then - DM_L["Stagger"] = "Staffelung" - DM_L["Light Stagger"] = "Leichte Staffelung" - DM_L["Moderate Stagger"] = "Moderate Staffelung" - DM_L["Heavy Stagger"] = "Schwere Staffelung" - -elseif GetLocale() == "zhCN" then - DM_L["Stagger"] = "醉拳" - DM_L["Light Stagger"] = "轻度醉拳" - DM_L["Moderate Stagger"] = "中度醉拳" - DM_L["Heavy Stagger"] = "重度醉拳" - -elseif GetLocale() == "ruRU" then - DM_L["Stagger"] = "Пошатывание" - DM_L["Light Stagger"] = "Легкое пошатывание" - DM_L["Moderate Stagger"] = "Умеренное пошатывание" - DM_L["Heavy Stagger"] = "Сильное пошатывание" - -else - DM_L["Stagger"] = "Stagger" - DM_L["Light Stagger"] = "Light Stagger" - DM_L["Moderate Stagger"] = "Moderate Stagger" - DM_L["Heavy Stagger"] = "Heavy Stagger" -end - -local STANCE_OF_THE_STURY_OX_ID = 23 - -local UnitHealthMax = UnitHealthMax -local UnitStagger = UnitStagger -local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; -local BREW_COLORS = { - [124275] = {0, 1, 0, 1}, -- Light - [124274] = {1, 0.5, 0, 1}, -- Moderate - [124273] = {1, 0, 0, 1}, -- Heavy -}; -local DEFAULT_STAGGER_COLOR = {1, 1, 1, 0.5}; -local STAGGER_COLORS = { - [124275] = {0.2, 0.8, 0.2, 1}, -- Light - [124274] = {1.0, 0.8, 0.2, 1}, -- Moderate - [124273] = {1.0, 0.4, 0.2, 1}, -- Heavy -}; -local STAGGER_DEBUFFS = { - [124275] = true, -- Light - [124274] = true, -- Moderate - [124273] = true, -- Heavy -}; -local staggerColor = {1, 1, 1, 0.5}; -local brewColor = {0.91, 0.75, 0.25, 0.5}; - -local function getStaggerAmount() - for i = 1, 40 do - local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = - UnitDebuff("player", i) - if STAGGER_DEBUFFS[spellID] then - if (spellID) then - staggerColor = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR - brewColor = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR - else - staggerColor = DEFAULT_STAGGER_COLOR - brewColor = DEFAULT_BREW_COLOR - end - return amount - end - end - return 0 -end - -local Update = function(self, event, unit) - if(unit and unit ~= self.unit) then return end - local stagger = self.DrunkenMaster - if(stagger.PreUpdate) then - stagger:PreUpdate() - end - local staggering = getStaggerAmount() - if staggering == 0 then - stagger:SetValue(0) - return - end - - local health = UnitHealth("player") - local maxHealth = UnitHealthMax("player") - local staggerTotal = UnitStagger("player") - if staggerTotal == 0 and staggering > 0 then - staggerTotal = staggering * 10 - end - - local staggerPercent = staggerTotal / maxHealth * 100 - local currentStagger = floor(staggerPercent) - stagger:SetMinMaxValues(0, 100) - if(staggerPercent == 0) then - stagger:SetStatusBarColor(unpack(DEFAULT_BREW_COLOR)) - else - stagger:SetStatusBarColor(unpack(brewColor)) - end - stagger:SetValue(staggerPercent) - - local icon = stagger.icon - if(icon) then - icon:SetVertexColor(unpack(staggerColor)) - end - - if(stagger.PostUpdate) then - stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) - end -end - -local Visibility = function(self, ...) - if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then - if self.DrunkenMaster:IsShown() then - self.DrunkenMaster:Hide() - self:UnregisterEvent('UNIT_AURA', Update) - end - else - self.DrunkenMaster:Show() - self:RegisterEvent('UNIT_AURA', Update) - return Update(self, ...) - end -end - -local Path = function(self, ...) - return (self.DrunkenMaster.Override or Visibility)(self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, "ForceUpdate", element.__owner.unit) -end - -local function Enable(self, unit) - if(unit ~= 'player') then return end - local element = self.DrunkenMaster - if(element) then - element.__owner = self - element.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_DISPLAYPOWER', Path) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', Path) - - if(element:IsObjectType'StatusBar' and not element:GetStatusBarTexture()) then - element:SetStatusBarTexture(0.91, 0.75, 0.25) - end - element:SetStatusBarColor(unpack(brewColor)) - element:SetMinMaxValues(0, 100) - element:SetValue(0) - - MonkStaggerBar.Hide = MonkStaggerBar.Show - MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' - MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' - MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' - MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - return true - end -end - -local function Disable(self) - local element = self.DrunkenMaster - if(element) then - element:Hide() - self:UnregisterEvent('UNIT_AURA', Update) - self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path) - - MonkStaggerBar.Show = nil - MonkStaggerBar:Show() - MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' - MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' - MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' - MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - end -end - -oUF:AddElement("DrunkenMaster", Path, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua new file mode 100644 index 0000000..b9872e7 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua @@ -0,0 +1,287 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local error = _G.error; +local print = _G.print; +local pairs = _G.pairs; +local next = _G.next; +local tostring = _G.tostring; +local type = _G.type; + +if select(2, UnitClass('player')) ~= "MONK" then return end + +--BLIZZARD API +local UnitStagger = _G.UnitStagger; +local UnitPower = _G.UnitPower; +local UnitPowerMax = _G.UnitPowerMax; +local UnitHealthMax = _G.UnitHealthMax; +local UnitHasVehicleUI = _G.UnitHasVehicleUI; +local GetLocale = _G.GetLocale; +local GetShapeshiftFormID = _G.GetShapeshiftFormID; +local UnitAura = _G.UnitAura; +local UnitHasVehiclePlayerFrameUI = _G.UnitHasVehiclePlayerFrameUI; +local MonkStaggerBar = _G.MonkStaggerBar; +local SPELL_POWER_CHI = _G.SPELL_POWER_CHI; + + +local parent, ns = ... +local oUF = ns.oUF +local floor = math.floor; +local DM_L = {}; + +if GetLocale() == "enUS" then + DM_L["Stagger"] = "Stagger" + DM_L["Light Stagger"] = "Light Stagger" + DM_L["Moderate Stagger"] = "Moderate Stagger" + DM_L["Heavy Stagger"] = "Heavy Stagger" + +elseif GetLocale() == "frFR" then + DM_L["Stagger"] = "Report" + DM_L["Light Stagger"] = "Report mineur" + DM_L["Moderate Stagger"] = "Report mod??" + DM_L["Heavy Stagger"] = "Report majeur" + +elseif GetLocale() == "itIT" then + DM_L["Stagger"] = "Noncuranza" + DM_L["Light Stagger"] = "Noncuranza Parziale" + DM_L["Moderate Stagger"] = "Noncuranza Moderata" + DM_L["Heavy Stagger"] = "Noncuranza Totale" + +elseif GetLocale() == "deDE" then + DM_L["Stagger"] = "Staffelung" + DM_L["Light Stagger"] = "Leichte Staffelung" + DM_L["Moderate Stagger"] = "Moderate Staffelung" + DM_L["Heavy Stagger"] = "Schwere Staffelung" + +elseif GetLocale() == "zhCN" then + DM_L["Stagger"] = "醉拳" + DM_L["Light Stagger"] = "轻度醉拳" + DM_L["Moderate Stagger"] = "中度醉拳" + DM_L["Heavy Stagger"] = "重度醉拳" + +elseif GetLocale() == "ruRU" then + DM_L["Stagger"] = "Пошатывание" + DM_L["Light Stagger"] = "Легкое пошатывание" + DM_L["Moderate Stagger"] = "Умеренное пошатывание" + DM_L["Heavy Stagger"] = "Сильное пошатывание" + +else + DM_L["Stagger"] = "Stagger" + DM_L["Light Stagger"] = "Light Stagger" + DM_L["Moderate Stagger"] = "Moderate Stagger" + DM_L["Heavy Stagger"] = "Heavy Stagger" +end + +local STANCE_OF_THE_STURY_OX_ID = 23; +local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; +local BREW_COLORS = { + [124275] = {0, 1, 0, 1}, -- Light + [124274] = {1, 0.5, 0, 1}, -- Moderate + [124273] = {1, 0, 0, 1}, -- Heavy +}; +local DEFAULT_STAGGER_COLOR = {1, 1, 1, 0.5}; +local STAGGER_COLORS = { + [124275] = {0.2, 0.8, 0.2, 1}, -- Light + [124274] = {1.0, 0.8, 0.2, 1}, -- Moderate + [124273] = {1.0, 0.4, 0.2, 1}, -- Heavy +}; +local STAGGER_DEBUFFS = { + [124275] = true, -- Light + [124274] = true, -- Moderate + [124273] = true, -- Heavy +}; +local CURRENT_STAGGER_COLOR = {1, 1, 1, 0.5}; +local CURRENT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; +local CHI_COLORS = { + [1] = {.57, .63, .35, 1}, + [2] = {.47, .63, .35, 1}, + [3] = {.37, .63, .35, 1}, + [4] = {.27, .63, .33, 1}, + [5] = {.17, .63, .33, 1}, + [6] = {0, .63, .33, 1}, +} + +local function getStaggerAmount() + for i = 1, 40 do + local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = + UnitDebuff("player", i) + if STAGGER_DEBUFFS[spellID] then + if (spellID) then + CURRENT_STAGGER_COLOR = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR + CURRENT_BREW_COLOR = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR + else + CURRENT_STAGGER_COLOR = DEFAULT_STAGGER_COLOR + CURRENT_BREW_COLOR = DEFAULT_BREW_COLOR + end + return amount + end + end + return 0 +end + +local Update = function(self, event, unit) + if(unit and unit ~= self.unit) then return end + local bar = self.KungFu + local stagger = bar.DrunkenMaster + + if(bar.PreUpdate) then bar:PreUpdate(event) end + + local light = UnitPower("player", SPELL_POWER_CHI) + local numPoints = UnitPowerMax("player", SPELL_POWER_CHI) + + for i = 1, numPoints do + local orb = bar[i] + if(orb) then + if i <= light then + orb:Show() + else + orb:Hide() + end + end + end + + if UnitHasVehicleUI("player") then + bar:Hide() + else + bar:Show() + end + + if bar.numPoints ~= numPoints then + if numPoints == 6 then + bar[5]:Show() + bar[6]:Show() + elseif numPoints == 5 then + bar[5]:Show() + bar[6]:Hide() + else + bar[5]:Hide() + bar[6]:Hide() + end + end + + bar.numPoints = numPoints + + if(stagger:IsShown()) then + local staggering = getStaggerAmount() + if staggering == 0 then + stagger:SetValue(0) + else + local health = UnitHealth("player") + local maxHealth = UnitHealthMax("player") + local staggerTotal = UnitStagger("player") + if staggerTotal == 0 and staggering > 0 then + staggerTotal = staggering * 10 + end + + local staggerPercent = staggerTotal / maxHealth * 100 + local currentStagger = floor(staggerPercent) + stagger:SetMinMaxValues(0, 100) + + if(staggerPercent == 0) then + stagger:SetStatusBarColor(unpack(DEFAULT_BREW_COLOR)) + else + stagger:SetStatusBarColor(unpack(CURRENT_BREW_COLOR)) + end + + stagger:SetValue(staggerPercent) + + -- local icon = stagger.icon + -- if(icon) then + -- icon:SetVertexColor(unpack(CURRENT_STAGGER_COLOR)) + -- end + if(stagger.PostUpdate) then + stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) + end + end + end + + if(bar.PostUpdate) then bar:PostUpdate(event) end +end + +local Visibility = function(self, ...) + local bar = self.KungFu + local stagger = bar.DrunkenMaster + if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then + if stagger:IsShown() then + stagger:Hide() + self:UnregisterEvent('UNIT_AURA', Update) + end + else + stagger:Show() + self:RegisterEvent('UNIT_AURA', Update) + return Update(self, ...) + end +end + +local Path = function(self, ...) + return (self.KungFu.Override or Visibility)(self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, "ForceUpdate", element.__owner.unit) +end + +local function Enable(self, unit) + if(unit ~= 'player') then return end + local bar = self.KungFu + + if bar then + local stagger = bar.DrunkenMaster + stagger.__owner = self + stagger.ForceUpdate = ForceUpdate + + self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) + self:RegisterEvent("UNIT_POWER", Update) + self:RegisterEvent("PLAYER_LEVEL_UP", Update) + self:RegisterEvent('UNIT_DISPLAYPOWER', Path) + self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', Path) + + for i = 1, 6 do + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + end + + bar[i]:SetStatusBarColor(unpack(oUF.colors.KungFu[i])) + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) + end + bar.numPoints = 6 + + if(stagger:IsObjectType'StatusBar' and not stagger:GetStatusBarTexture()) then + stagger:SetStatusBarTexture(0.91, 0.75, 0.25) + end + stagger:SetStatusBarColor(unpack(brewColor)) + stagger:SetMinMaxValues(0, 100) + stagger:SetValue(0) + + MonkStaggerBar.Hide = MonkStaggerBar.Show + MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' + MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' + MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' + MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' + + return true + end +end + +local function Disable(self) + if self.KungFu then + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) + self:UnregisterEvent("UNIT_POWER", Update) + self:UnregisterEvent("PLAYER_LEVEL_UP", Update) + self:UnregisterEvent("UNIT_DISPLAYPOWER", Path) + self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path) + + MonkStaggerBar.Show = nil + MonkStaggerBar:Show() + MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' + MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' + MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' + MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' + end +end + +oUF:AddElement('KungFu', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua new file mode 100644 index 0000000..2653700 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua @@ -0,0 +1,362 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +--BLIZZARD API +local GetTime = _G.GetTime; +local GetSpecialization = _G.GetSpecialization; +local UnitDebuff = _G.UnitDebuff; + +if select(2, UnitClass('player')) ~= "MAGE" then return end + +local _, ns = ... +local oUF = oUF or ns.oUF +if not oUF then return end + +local playerGUID; + +local ARCANE_CHARGE_ID = 36032; + +local IGNITE_ID = 12654; +local COMBUSTION_ID = 83853; +local PYROBLAST_ID = 11366; +local ICICLE_ID = 148022; +local FROSTBOLT_ID = 116; +local FROSTFIREBOLT_ID = 44614; +local ICELANCE_ID = 30455; +local ICYVEINS_NAME = GetSpellInfo(12472); +local ALTERTIME_ID = 108978; +local ALTERTIMEAURA_ID = 110909; + +local CAST_SUCCESS = 'SPELL_CAST_SUCCESS'; +local AURA_REMOVED = 'SPELL_AURA_REMOVED'; +local SPELL_START = 'SPELL_CAST_START'; + +local DAMAGECOUNT = 0; +local DAMAGETOTAL = 0; +local SPELLCOUNT = 0; +local ALTERCOUNT = 0; +local LASTRECORD = 0; + +local SpecMaximum = { + [1] = 4, + [2] = 4, + [3] = 5, +}; + +local ResetMagic = function(self) + local bar = self.MageMagic; + local ignite = bar.Ignite; + local igniteBar = ignite.Bar; + SPELLCOUNT = 0; + ALTERCOUNT = 0; + LASTRECORD = 0; + DAMAGETOTAL = 0; + for i = 1, 5 do + bar[i].start = nil + bar[i].duration = nil + bar[i]:SetValue(0) + bar[i]:Hide() + bar[i]:SetScript("OnUpdate", nil) + end + + igniteBar.start = 0 + igniteBar.duration = 0 + igniteBar:SetValue(0) + ignite:Hide() + igniteBar:SetScript("OnUpdate", nil) +end + +local GetResources = { + [1] = function(self, event, ...) + if(event == 'UNIT_AURA') then + local unit = ...; + for index = 1, 30 do + local _, _, _, count, _, start, duration, _, _, _, spellID = UnitDebuff(unit, index) + if(spellID == ARCANE_CHARGE_ID) then + SPELLCOUNT = count + return start, duration + end + end + end + return 0,0,true + end, + [2] = function(self, event, ...) + if(event == 'COMBAT_LOG_EVENT_UNFILTERED') then + local _, eventType, _, srcGUID, _, _, _, destGUID, _, _, _, spellID, _, _, amount = ... + if(srcGUID == playerGUID) then + if(eventType:find("_DAMAGE")) then + if(spellID == IGNITE_ID) then + DAMAGETOTAL = amount + elseif(spellID == COMBUSTION_ID) then + DAMAGETOTAL = 0 + end + end + end + elseif(event == 'UNIT_AURA') then + local unit = ...; + if(unit == 'player') then + for index = 1, 30 do + local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID = UnitDebuff('target', index) + if(spellID == IGNITE_ID) then + return floor(expires), duration + end + end + end + end + return 0,0,true + end, + [3] = function(self, event, ...) + if(event == 'COMBAT_LOG_EVENT_UNFILTERED') then + local _, eventType, _, srcGUID, _, _, _, _, _, _, _, spellID, _, _, amount = ... + if not (srcGUID == playerGUID) then + return 0,0,true; + end + + if(eventType == CAST_SUCCESS) and (spellID == ALTERTIME_ID) then + ALTERCOUNT = SPELLCOUNT + elseif(eventType == AURA_REMOVED) and (spellID == ALTERTIMEAURA_ID) then + SPELLCOUNT = ALTERCOUNT + ALTERCOUNT = 0 + return 0,0; + end + + if(not eventType:find("_DAMAGE")) then return end + if(spellID == ICICLE_ID) then + if(SPELLCOUNT > 0) then + SPELLCOUNT = SPELLCOUNT - 1 + return 0,0; + end + elseif((spellID == FROSTBOLT_ID) or (spellID == FROSTFIREBOLT_ID)) then + if(SPELLCOUNT < 5) then + if(ICYVEINS_NAME and UnitBuff("player", ICYVEINS_NAME)) then + SPELLCOUNT = SPELLCOUNT + 3 + if(SPELLCOUNT > 5) then SPELLCOUNT = 5 end + else + SPELLCOUNT = SPELLCOUNT + 1 + end + + return 0,0; + end + end + end + return 0,0,true; + end, +}; + +local BarOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - GetTime()) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + self.start = nil + self.duration = nil + self:SetValue(0) + self:Hide() + self:SetScript("OnUpdate", nil) + end + end +end + +local IgniteOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - self.elapsed) + local remaining = floor(timeLeft * DAMAGETOTAL) + if timeLeft > 0 then + self:SetValue(timeLeft) + self.text:SetText(remaining) + else + self.text:SetText('0') + DAMAGETOTAL = 0; + self.start = 0; + self.duration = 5; + self.elapsed = 0; + self:SetValue(0); + self:SetScript("OnUpdate", nil); + end + end +end + +local IcicleOnUpdate = function(self, elapsed) + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (31 - self.elapsed) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + if(SPELLCOUNT > 0) then + SPELLCOUNT = SPELLCOUNT - 1 + end + self.elapsed = nil; + self:SetValue(0); + self:Hide(); + self:SetScript("OnUpdate", nil); + end + end +end + +local Update = function(self, event, ...) + local bar = self.MageMagic + local spec = bar.CurrentSpec; + + if(bar.PreUpdate) then bar:PreUpdate(spec) end + + local maxCount = SpecMaximum[spec]; + local start, duration, reset = GetResources[spec](self, event, ...); + if(not reset) then + if(spec == 2) then + local ignite = bar.Ignite; + local igniteBar = ignite.Bar; + if(not ignite:IsShown()) then ignite:Show() end + if(duration and start and (start > igniteBar.start)) then + igniteBar.start = start + igniteBar.duration = duration + igniteBar:SetMinMaxValues(0, duration) + igniteBar.elapsed = 0 + igniteBar:SetValue(duration) + igniteBar:SetScript('OnUpdate', IgniteOnUpdate) + end + else + for i = 1, 5 do + if(i > maxCount) then + bar[i]:SetValue(0) + bar[i]:Hide() + else + if(not bar[i]:IsShown()) then bar[i]:Show() end + if(spec == 1) then + if i <= SPELLCOUNT then + if start and duration then + bar[i]:Show() + bar[i]:SetMinMaxValues(0, start) + bar[i].start = start + bar[i].duration = duration + bar[i]:SetValue(start) + bar[i]:SetScript('OnUpdate', BarOnUpdate) + else + bar[i]:SetValue(0) + bar[i]:SetScript('OnUpdate', nil) + bar[i]:Hide() + end + else + bar[i]:SetValue(0) + bar[i]:Hide() + end + else + bar[i]:SetMinMaxValues(0, 31) + if i <= SPELLCOUNT then + bar[i]:FadeIn() + bar[i]:SetValue(31) + bar[i]:SetScript('OnUpdate', IcicleOnUpdate) + else + bar[i]:SetValue(0) + bar[i]:SetScript('OnUpdate', nil) + bar[i]:FadeOut() + end + end + end + end + end + end + + if(bar.PostUpdate) then + return bar:PostUpdate(event, SPELLCOUNT, maxCount) + end +end + +local Proxy = function(self, ...) + local bar = self.MageMagic + local spec = GetSpecialization() + + if(not playerGUID) then + playerGUID = UnitGUID('player') + end + if((not bar.CurrentSpec) or (bar.CurrentSpec ~= spec)) then + ResetMagic(self); + if(spec) then + bar.CurrentSpec = spec; + if(bar.CurrentSpec == 3) then + self:UnregisterEvent('UNIT_AURA', Update) + self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update, true) + --print("Switch To Frost") + elseif(bar.CurrentSpec == 2) then + self:RegisterEvent('UNIT_AURA', Update) + self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update, true) + if(not bar.Ignite:IsShown()) then bar.Ignite:Show() end + bar.Ignite.Bar:SetValue(0) + --print("Switch To Fire") + elseif(bar.CurrentSpec == 1) then + self:RegisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update) + --print("Switch To Arcane") + end + if(bar.PostTalentUpdate) then bar:PostTalentUpdate(spec) end + else + self:UnregisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update) + end + end + return Update(self, ...) +end + +local Path = function(self, ...) + return (self.MageMagic.Override or Proxy) (self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate', element.__owner.unit) +end + +local Enable = function(self, unit) + local bar = self.MageMagic + + if(bar) then + self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) + bar.__owner = self + bar.ForceUpdate = ForceUpdate + + for i = 1, 5 do + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + end + + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) + + if bar[i].bg then + bar[i]:SetMinMaxValues(0, 1) + bar[i]:SetValue(0) + bar[i].bg:SetAlpha(0.4) + bar[i].bg:SetAllPoints() + bar[i]:Hide() + end + end + bar.Ignite.Bar:SetMinMaxValues(0, 5) + bar.Ignite.Bar:SetValue(0) + bar.Ignite:Hide() + + return true; + end +end + +local Disable = function(self, unit) + local bar = self.MageMagic + + if(bar) then + self:UnregisterEvent("UNIT_AURA", Update) + self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update) + self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) + bar:Hide() + end +end + +oUF:AddElement("MageMagic", Path, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc new file mode 100644 index 0000000..cccf22e --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc @@ -0,0 +1,8 @@ +## Interface: 50001 +## Title: oUF Mage Magic +## Notes: Adds support for mage spell indicators to oUF. +## Author: Munglunch +## Version: 5.4.15 +## Dependencies: oUF + +oUF_MageMagic.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua deleted file mode 100644 index 4abe6dd..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua +++ /dev/null @@ -1,105 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; ---BLIZZARD API -local UnitPower = _G.UnitPower; -local UnitPowerMax = _G.UnitPowerMax; -local UnitHasVehicleUI = _G.UnitHasVehicleUI; - -if select(2, UnitClass('player')) ~= "MONK" then return end - -local _, ns = ... -local oUF = ns.oUF or oUF - -local SPELL_POWER_CHI = SPELL_POWER_CHI - -oUF.colors.MonkHarmony = { - [1] = {.57, .63, .35, 1}, - [2] = {.47, .63, .35, 1}, - [3] = {.37, .63, .35, 1}, - [4] = {.27, .63, .33, 1}, - [5] = {.17, .63, .33, 1}, - [6] = {0, .63, .33, 1}, -} - -local function Update(self, event, unit) - local hb = self.MonkHarmony - if(hb.PreUpdate) then hb:PreUpdate(event) end - local light = UnitPower("player", SPELL_POWER_CHI) - - -- if max light changed, show/hide the 5th and update anchors - local numPoints = UnitPowerMax("player", SPELL_POWER_CHI) - - for i = 1, numPoints do - local orb = hb[i] - if(orb) then - if i <= light then - orb:Show() - else - orb:Hide() - end - end - end - - if UnitHasVehicleUI("player") then - hb:Hide() - else - hb:Show() - end - - if hb.numPoints ~= numPoints then - if numPoints == 6 then - hb[5]:Show() - hb[6]:Show() - elseif numPoints == 5 then - hb[5]:Show() - hb[6]:Hide() - else - hb[5]:Hide() - hb[6]:Hide() - end - end - - hb.numPoints = numPoints - - if(hb.PostUpdate) then hb:PostUpdate(event) end -end - -local function Enable(self, unit) - if(unit ~= 'player') then return end - local hb = self.MonkHarmony - if hb then - self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) - self:RegisterEvent("UNIT_POWER", Update) - self:RegisterEvent("UNIT_DISPLAYPOWER", Update) - self:RegisterEvent("PLAYER_LEVEL_UP", Update) - - for i = 1, 6 do - if not hb[i]:GetStatusBarTexture() then - hb[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) - end - - hb[i]:SetStatusBarColor(unpack(oUF.colors.MonkHarmony[i])) - hb[i]:SetFrameLevel(hb:GetFrameLevel() + 1) - hb[i]:GetStatusBarTexture():SetHorizTile(false) - end - - hb.numPoints = 6 - - return true - end -end - -local function Disable(self) - if self.MonkHarmony then - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) - self:UnregisterEvent("UNIT_POWER", Update) - self:UnregisterEvent("UNIT_DISPLAYPOWER", Update) - self:UnregisterEvent("PLAYER_LEVEL_UP", Update) - end -end - -oUF:AddElement('MonkHarmony', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml index 890bb5a..251115a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml @@ -61,15 +61,14 @@