Commit f060f6a6 authored by Simpy's avatar Simpy 🐹

Merge branch 'development'

parents a2b4e0c4 6075cbbe
......@@ -4,301 +4,288 @@
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
--Lua functions
local random = random
local tremove = tremove
local random, next, unpack, strsub = random, next, unpack, strsub
--WoW API / Variables
function E:SetUpAnimGroup(object, type, ...)
if not type then type = 'Flash' end
if type == 'Flash' then
object.anim = object:CreateAnimationGroup("Flash")
object.anim.fadein = object.anim:CreateAnimation("ALPHA", "FadeIn")
object.anim.fadein:SetFromAlpha(0)
object.anim.fadein:SetToAlpha(1)
object.anim.fadein:SetOrder(2)
object.anim.fadeout = object.anim:CreateAnimation("ALPHA", "FadeOut")
object.anim.fadeout:SetFromAlpha(1)
object.anim.fadeout:SetToAlpha(0)
object.anim.fadeout:SetOrder(1)
elseif type == 'FlashLoop' then
object.anim = object:CreateAnimationGroup("Flash")
object.anim.fadein = object.anim:CreateAnimation("ALPHA", "FadeIn")
object.anim.fadein:SetFromAlpha(0)
object.anim.fadein:SetToAlpha(1)
object.anim.fadein:SetOrder(2)
object.anim.fadeout = object.anim:CreateAnimation("ALPHA", "FadeOut")
object.anim.fadeout:SetFromAlpha(1)
object.anim.fadeout:SetToAlpha(0)
object.anim.fadeout:SetOrder(1)
object.anim:SetScript("OnFinished", function(_, requested)
if(not requested) then
object.anim:Play()
E.AnimShake = {{-9,7,-7,12}, {-5,9,-9,5}, {-5,7,-7,5}, {-9,9,-9,9}, {-5,7,-7,5}, {-9,7,-9,5}}
E.AnimShakeH = {-5,5,-2,5,-2,5}
function E:FlashLoopFinished(requested)
if not requested then self:Play() end
end
function E:RandomAnimShake(index)
local s = E.AnimShake[index]
return random(s[1], s[2]), random(s[3], s[4])
end
function E:SetUpAnimGroup(obj, Type, ...)
if not Type then Type = 'Flash' end
if strsub(Type, 1, 5) == 'Flash' then
obj.anim = obj:CreateAnimationGroup('Flash')
obj.anim.fadein = obj.anim:CreateAnimation('ALPHA', 'FadeIn')
obj.anim.fadein:SetFromAlpha(0)
obj.anim.fadein:SetToAlpha(1)
obj.anim.fadein:SetOrder(2)
obj.anim.fadeout = obj.anim:CreateAnimation('ALPHA', 'FadeOut')
obj.anim.fadeout:SetFromAlpha(1)
obj.anim.fadeout:SetToAlpha(0)
obj.anim.fadeout:SetOrder(1)
if Type == 'FlashLoop' then
obj.anim:SetScript('OnFinished', E.FlashLoopFinished)
end
elseif strsub(Type, 1, 5) == 'Shake' then
local shake = obj:CreateAnimationGroup(Type)
shake:SetLooping('REPEAT')
shake.path = shake:CreateAnimation('Path')
if Type == 'Shake' then
shake.path:SetDuration(0.7)
obj.shake = shake
elseif Type == 'ShakeH' then
shake.path:SetDuration(2)
obj.shakeh = shake
end
for i = 1, 6 do
shake.path[i] = shake.path:CreateControlPoint()
shake.path[i]:SetOrder(i)
if Type == 'Shake' then
shake.path[i]:SetOffset(E:RandomAnimShake(i))
else
shake.path[i]:SetOffset(E.AnimShakeH[i], 0)
end
end)
elseif type == 'Shake' then
object.shake = object:CreateAnimationGroup("Shake")
object.shake:SetLooping("REPEAT")
object.shake.path = object.shake:CreateAnimation("Path")
object.shake.path[1] = object.shake.path:CreateControlPoint()
object.shake.path[2] = object.shake.path:CreateControlPoint()
object.shake.path[3] = object.shake.path:CreateControlPoint()
object.shake.path[4] = object.shake.path:CreateControlPoint()
object.shake.path[5] = object.shake.path:CreateControlPoint()
object.shake.path[6] = object.shake.path:CreateControlPoint()
object.shake.path:SetDuration(0.7)
object.shake.path[1]:SetOffset(random(-9, 7), random(-7, 12))
object.shake.path[1]:SetOrder(1)
object.shake.path[2]:SetOffset(random(-5, 9), random(-9, 5))
object.shake.path[2]:SetOrder(2)
object.shake.path[3]:SetOffset(random(-5, 7), random(-7, 5))
object.shake.path[3]:SetOrder(3)
object.shake.path[4]:SetOffset(random(-9, 9), random(-9, 9))
object.shake.path[4]:SetOrder(4)
object.shake.path[5]:SetOffset(random(-5, 7), random(-7, 5))
object.shake.path[5]:SetOrder(5)
object.shake.path[6]:SetOffset(random(-9, 7), random(-9, 5))
object.shake.path[6]:SetOrder(6)
elseif type == 'Shake_Horizontal' then
object.shakeh = object:CreateAnimationGroup("ShakeH")
object.shakeh:SetLooping("REPEAT")
object.shakeh.path = object.shakeh:CreateAnimation("Path")
object.shakeh.path[1] = object.shakeh.path:CreateControlPoint()
object.shakeh.path[2] = object.shakeh.path:CreateControlPoint()
object.shakeh.path[3] = object.shakeh.path:CreateControlPoint()
object.shakeh.path[4] = object.shakeh.path:CreateControlPoint()
object.shakeh.path[5] = object.shakeh.path:CreateControlPoint()
object.shakeh.path[6] = object.shakeh.path:CreateControlPoint()
object.shakeh.path:SetDuration(2)
object.shakeh.path[1]:SetOffset(-5, 0)
object.shakeh.path[1]:SetOrder(1)
object.shakeh.path[2]:SetOffset(5, 0)
object.shakeh.path[2]:SetOrder(2)
object.shakeh.path[3]:SetOffset(-2, 0)
object.shakeh.path[3]:SetOrder(3)
object.shakeh.path[4]:SetOffset(5, 0)
object.shakeh.path[4]:SetOrder(4)
object.shakeh.path[5]:SetOffset(-2, 0)
object.shakeh.path[5]:SetOrder(5)
object.shakeh.path[6]:SetOffset(5, 0)
object.shakeh.path[6]:SetOrder(6)
end
else
local x, y, duration, customName = ...
if not customName then
customName = 'anim'
end
object[customName] = object:CreateAnimationGroup("Move_In")
object[customName].in1 = object[customName]:CreateAnimation("Translation")
object[customName].in1:SetDuration(0)
object[customName].in1:SetOrder(1)
object[customName].in2 = object[customName]:CreateAnimation("Translation")
object[customName].in2:SetDuration(duration)
object[customName].in2:SetOrder(2)
object[customName].in2:SetSmoothing("OUT")
object[customName].out1 = object:CreateAnimationGroup("Move_Out")
object[customName].out2 = object[customName].out1:CreateAnimation("Translation")
object[customName].out2:SetDuration(duration)
object[customName].out2:SetOrder(1)
object[customName].out2:SetSmoothing("IN")
object[customName].in1:SetOffset(E:Scale(x), E:Scale(y))
object[customName].in2:SetOffset(E:Scale(-x), E:Scale(-y))
object[customName].out2:SetOffset(E:Scale(x), E:Scale(y))
object[customName].out1:SetScript("OnFinished", function() object:Hide() end)
if not customName then customName = 'anim' end
local anim = obj:CreateAnimationGroup('Move_In')
obj[customName] = anim
anim.in1 = anim:CreateAnimation('Translation')
anim.in1:SetDuration(0)
anim.in1:SetOrder(1)
anim.in1:SetOffset(E:Scale(x), E:Scale(y))
anim.in2 = anim:CreateAnimation('Translation')
anim.in2:SetDuration(duration)
anim.in2:SetOrder(2)
anim.in2:SetSmoothing('OUT')
anim.in2:SetOffset(E:Scale(-x), E:Scale(-y))
anim.out1 = obj:CreateAnimationGroup('Move_Out')
anim.out1:SetScript('OnFinished', function() obj:Hide() end)
anim.out2 = anim.out1:CreateAnimation('Translation')
anim.out2:SetDuration(duration)
anim.out2:SetOrder(1)
anim.out2:SetSmoothing('IN')
anim.out2:SetOffset(E:Scale(x), E:Scale(y))
end
end
function E:Shake(object)
if not object.shake then
E:SetUpAnimGroup(object, 'Shake')
function E:Shake(obj)
if not obj.shake then
E:SetUpAnimGroup(obj, 'Shake')
end
object.shake:Play()
obj.shake:Play()
end
function E:StopShake(object)
if object.shake then
object.shake:Finish()
function E:StopShake(obj)
if obj.shake then
obj.shake:Finish()
end
end
function E:ShakeHorizontal(object)
if not object.shakeh then
E:SetUpAnimGroup(object, 'Shake_Horizontal')
function E:ShakeHorizontal(obj)
if not obj.shakeh then
E:SetUpAnimGroup(obj, 'ShakeH')
end
object.shakeh:Play()
obj.shakeh:Play()
end
function E:StopShakeHorizontal(object)
if object.shakeh then
object.shakeh:Finish()
function E:StopShakeHorizontal(obj)
if obj.shakeh then
obj.shakeh:Finish()
end
end
function E:Flash(object, duration, loop)
if not object.anim then
E:SetUpAnimGroup(object, loop and "FlashLoop" or 'Flash')
function E:Flash(obj, duration, loop)
if not obj.anim then
E:SetUpAnimGroup(obj, loop and 'FlashLoop' or 'Flash')
end
if not object.anim.playing then
object.anim.fadein:SetDuration(duration)
object.anim.fadeout:SetDuration(duration)
object.anim:Play()
object.anim.playing = true
if not obj.anim:IsPlaying() then
obj.anim.fadein:SetDuration(duration)
obj.anim.fadeout:SetDuration(duration)
obj.anim:Play()
end
end
function E:StopFlash(object)
if object.anim and object.anim.playing then
object.anim:Stop()
object.anim.playing = nil;
function E:StopFlash(obj)
if obj.anim and obj.anim:IsPlaying() then
obj.anim:Stop()
end
end
function E:SlideIn(object, customName)
if not customName then
customName = 'anim'
end
if not object[customName] then return end
function E:SlideIn(obj, customName)
if not customName then customName = 'anim' end
if not obj[customName] then return end
object[customName].out1:Stop()
object:Show()
object[customName]:Play()
obj[customName].out1:Stop()
obj[customName]:Play()
obj:Show()
end
function E:SlideOut(object, customName)
if not customName then
customName = 'anim'
end
if not object[customName] then return end
function E:SlideOut(obj, customName)
if not customName then customName = 'anim' end
if not obj[customName] then return end
object[customName]:Finish()
object[customName]:Stop()
object[customName].out1:Play()
obj[customName]:Finish()
obj[customName]:Stop()
obj[customName].out1:Play()
end
local frameFadeManager = CreateFrame("FRAME");
local FADEFRAMES = {};
local FADEFRAMES, FADEMANAGER = {}, CreateFrame('FRAME')
FADEMANAGER.delay = 0.05
function E:UIFrameFade_OnUpdate(elapsed)
local index = 1;
local frame, fadeInfo;
while FADEFRAMES[index] do
frame = FADEFRAMES[index];
fadeInfo = FADEFRAMES[index].fadeInfo;
-- Reset the timer if there isn't one, this is just an internal counter
fadeInfo.fadeTimer = (fadeInfo.fadeTimer or 0) + elapsed;
fadeInfo.fadeTimer = fadeInfo.fadeTimer + elapsed;
-- If the fadeTimer is less then the desired fade time then set the alpha otherwise hold the fade state, call the finished function, or just finish the fade
if ( fadeInfo.fadeTimer < fadeInfo.timeToFade ) then
if ( fadeInfo.mode == "IN" ) then
frame:SetAlpha((fadeInfo.fadeTimer / fadeInfo.timeToFade) * (fadeInfo.endAlpha - fadeInfo.startAlpha) + fadeInfo.startAlpha);
elseif ( fadeInfo.mode == "OUT" ) then
frame:SetAlpha(((fadeInfo.timeToFade - fadeInfo.fadeTimer) / fadeInfo.timeToFade) * (fadeInfo.startAlpha - fadeInfo.endAlpha) + fadeInfo.endAlpha);
FADEMANAGER.timer = (FADEMANAGER.timer or 0) + elapsed
if FADEMANAGER.timer > FADEMANAGER.delay then
FADEMANAGER.timer = 0
for frame, info in next, FADEFRAMES do
-- Reset the timer if there isn't one, this is just an internal counter
if frame:IsVisible() then
info.fadeTimer = (info.fadeTimer or 0) + (elapsed + FADEMANAGER.delay)
else
info.fadeTimer = info.timeToFade + 1
end
else
frame:SetAlpha(fadeInfo.endAlpha);
-- If there is a fadeHoldTime then wait until its passed to continue on
if ( fadeInfo.fadeHoldTime and fadeInfo.fadeHoldTime > 0 ) then
fadeInfo.fadeHoldTime = fadeInfo.fadeHoldTime - elapsed;
-- If the fadeTimer is less then the desired fade time then set the alpha otherwise hold the fade state, call the finished function, or just finish the fade
if info.fadeTimer < info.timeToFade then
if info.mode == 'IN' then
frame:SetAlpha((info.fadeTimer / info.timeToFade) * info.diffAlpha + info.startAlpha)
else
frame:SetAlpha(((info.timeToFade - info.fadeTimer) / info.timeToFade) * info.diffAlpha + info.endAlpha)
end
else
-- Complete the fade and call the finished function if there is one
E:UIFrameFadeRemoveFrame(frame);
if ( fadeInfo.finishedFunc ) then
fadeInfo.finishedFunc(fadeInfo.finishedArg1, fadeInfo.finishedArg2, fadeInfo.finishedArg3, fadeInfo.finishedArg4);
fadeInfo.finishedFunc = nil;
frame:SetAlpha(info.endAlpha)
-- If there is a fadeHoldTime then wait until its passed to continue on
if info.fadeHoldTime and info.fadeHoldTime > 0 then
info.fadeHoldTime = info.fadeHoldTime - elapsed
else
-- Complete the fade and call the finished function if there is one
E:UIFrameFadeRemoveFrame(frame)
if info.finishedFunc then
if info.finishedArgs then
info.finishedFunc(unpack(info.finishedArgs))
else -- optional method
info.finishedFunc(info.finishedArg1, info.finishedArg2, info.finishedArg3, info.finishedArg4, info.finishedArg5)
end
if not info.finishedFuncKeep then
info.finishedFunc = nil
end
end
end
end
end
index = index + 1;
end
if ( #FADEFRAMES == 0 ) then
frameFadeManager:SetScript("OnUpdate", nil);
if not next(FADEFRAMES) then
FADEMANAGER:SetScript('OnUpdate', nil)
end
end
end
-- Generic fade function
function E:UIFrameFade(frame, fadeInfo)
if (not frame) then
return;
end
if ( not fadeInfo.mode ) then
fadeInfo.mode = "IN";
function E:UIFrameFade(frame, info)
if not frame or frame:IsForbidden() then return end
frame.fadeInfo = info
if not info.mode then
info.mode = 'IN'
end
if ( fadeInfo.mode == "IN" ) then
if ( not fadeInfo.startAlpha ) then
fadeInfo.startAlpha = 0;
end
if ( not fadeInfo.endAlpha ) then
fadeInfo.endAlpha = 1.0;
end
elseif ( fadeInfo.mode == "OUT" ) then
if ( not fadeInfo.startAlpha ) then
fadeInfo.startAlpha = 1.0;
end
if ( not fadeInfo.endAlpha ) then
fadeInfo.endAlpha = 0;
end
if info.mode == 'IN' then
if not info.startAlpha then info.startAlpha = 0 end
if not info.endAlpha then info.endAlpha = 1 end
if not info.diffAlpha then info.diffAlpha = info.endAlpha - info.startAlpha end
else
if not info.startAlpha then info.startAlpha = 1 end
if not info.endAlpha then info.endAlpha = 0 end
if not info.diffAlpha then info.diffAlpha = info.startAlpha - info.endAlpha end
end
frame:SetAlpha(fadeInfo.startAlpha);
frame.fadeInfo = fadeInfo;
frame:SetAlpha(info.startAlpha)
if not frame:IsProtected() then
frame:Show();
frame:Show()
end
local index = 1;
while FADEFRAMES[index] do
-- If frame is already set to fade then return
if ( FADEFRAMES[index] == frame ) then
return;
end
index = index + 1;
if not FADEFRAMES[frame] then
FADEFRAMES[frame] = info -- read below comment
FADEMANAGER:SetScript('OnUpdate', E.UIFrameFade_OnUpdate)
else
FADEFRAMES[frame] = info -- keep these both, we need this updated in the event its changed to another ref from a plugin or sth, don't move it up!
end
FADEFRAMES[#FADEFRAMES + 1] = frame
frameFadeManager:SetScript("OnUpdate", E.UIFrameFade_OnUpdate);
end
-- Convenience function to do a simple fade in
function E:UIFrameFadeIn(frame, timeToFade, startAlpha, endAlpha)
local fadeInfo = {};
fadeInfo.mode = "IN";
fadeInfo.timeToFade = timeToFade;
fadeInfo.startAlpha = startAlpha;
fadeInfo.endAlpha = endAlpha;
E:UIFrameFade(frame, fadeInfo);
if not frame or frame:IsForbidden() then return end
if frame.FadeObject then
frame.FadeObject.fadeTimer = nil
else
frame.FadeObject = {}
end
frame.FadeObject.mode = 'IN'
frame.FadeObject.timeToFade = timeToFade
frame.FadeObject.startAlpha = startAlpha
frame.FadeObject.endAlpha = endAlpha
frame.FadeObject.diffAlpha = endAlpha - startAlpha
E:UIFrameFade(frame, frame.FadeObject)
end
-- Convenience function to do a simple fade out
function E:UIFrameFadeOut(frame, timeToFade, startAlpha, endAlpha)
local fadeInfo = {};
fadeInfo.mode = "OUT";
fadeInfo.timeToFade = timeToFade;
fadeInfo.startAlpha = startAlpha;
fadeInfo.endAlpha = endAlpha;
E:UIFrameFade(frame, fadeInfo);
end
if not frame or frame:IsForbidden() then return end
function E:tDeleteItem(table, item)
local index = 1;
while table[index] do
if ( item == table[index] ) then
tremove(table, index);
break
else
index = index + 1;
end
if frame.FadeObject then
frame.FadeObject.fadeTimer = nil
else
frame.FadeObject = {}
end
frame.FadeObject.mode = 'OUT'
frame.FadeObject.timeToFade = timeToFade
frame.FadeObject.startAlpha = startAlpha
frame.FadeObject.endAlpha = endAlpha
frame.FadeObject.diffAlpha = startAlpha - endAlpha
E:UIFrameFade(frame, frame.FadeObject)
end
function E:UIFrameFadeRemoveFrame(frame)
E:tDeleteItem(FADEFRAMES, frame);
if frame and FADEFRAMES[frame] then
if frame.FadeObject then
frame.FadeObject.fadeTimer = nil
end
FADEFRAMES[frame] = nil
end
end
......@@ -200,7 +200,7 @@ end
function E:ToggleBlizzardCooldownText(cd, timer, request)
-- we should hide the blizzard cooldown text when ours are enabled
if timer and cd and cd.SetHideCountdownNumbers then
local forceHide = (timer.timerOptions and timer.timerOptions.hideBlizzard) or (E.db and E.db.cooldown and E.db.cooldown.hideBlizzard)
local forceHide = cd.hideText or (timer.timerOptions and timer.timerOptions.hideBlizzard) or (E.db and E.db.cooldown and E.db.cooldown.hideBlizzard)
if request then
return forceHide or E:Cooldown_IsEnabled(timer)
else
......
local ElvUI = select(2, ...)
ElvUI[2] = ElvUI[1].Libs.ACL:GetLocale('ElvUI', false) -- Locale doesn't exist yet, make it exist.
local gameLocale
do -- Locale doesn't exist yet, make it exist.
local convert = {['enGB'] = 'enUS', ['esES'] = 'esMX', ['itIT'] = 'enUS'}
local lang = GetLocale()
gameLocale = convert[lang] or lang or 'enUS'
ElvUI[2] = ElvUI[1].Libs.ACL:GetLocale('ElvUI', gameLocale)
end
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local ActionBars = E:GetModule('ActionBars')
......@@ -26,17 +35,15 @@ local _G = _G
local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring
local assert, type, pcall, date, print = assert, type, pcall, date, print
local twipe, tinsert, tremove, next = wipe, tinsert, tremove, next
local gsub, strmatch, strjoin = gsub, match, strjoin
local gsub, strmatch, strjoin = gsub, strmatch, strjoin
local format, find, strrep, len, sub = format, strfind, strrep, strlen, strsub
--WoW API / Variables
local CreateFrame = CreateFrame
local GetCVar, SetCVar, GetCVarBool = GetCVar, SetCVar, GetCVarBool
local GetChannelName = GetChannelName
local GetCombatRatingBonus = GetCombatRatingBonus
local GetDodgeChance, GetParryChance = GetDodgeChance, GetParryChance
local GetFunctionCPUUsage = GetFunctionCPUUsage
local GetNumGroupMembers = GetNumGroupMembers
local GetSpecialization, GetActiveSpecGroup = GetSpecialization, GetActiveSpecGroup
local GetSpecialization = GetSpecialization
local GetSpecializationRole = GetSpecializationRole
local InCombatLockdown = InCombatLockdown
local IsAddOnLoaded = IsAddOnLoaded
......@@ -51,12 +58,10 @@ local UIParentLoadAddOn = UIParentLoadAddOn
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
local UnitHasVehicleUI = UnitHasVehicleUI
local WrapTextInColorCode = WrapTextInColorCode
local UnitLevel, UnitStat, UnitAttackPower = UnitLevel, UnitStat, UnitAttackPower
local UnitStat, UnitAttackPower = UnitStat, UnitAttackPower
local hooksecurefunc = hooksecurefunc
local COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN = COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN
local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE
local MAX_PLAYER_LEVEL = MAX_PLAYER_LEVEL
local MAX_WOW_CHAT_CHANNELS = MAX_WOW_CHAT_CHANNELS
local ERR_NOT_IN_COMBAT = ERR_NOT_IN_COMBAT
local C_ChatInfo_GetNumActiveChannels = C_ChatInfo.GetNumActiveChannels
......@@ -141,14 +146,6 @@ E.DispelClasses = {
}
}
E.HealingClasses = {
PALADIN = 1,
SHAMAN = 3,
DRUID = 4,
MONK = 2,
PRIEST = {1, 2}
}
E.ClassRole = {
PALADIN = {
[1] = 'Caster',
......@@ -607,23 +604,6 @@ E.snapBars[#E.snapBars + 1] = E.UIParent
E.HiddenFrame = CreateFrame('Frame')
E.HiddenFrame:Hide()
function E:CheckTalentTree(tree)
local activeSpec = GetActiveSpecGroup()
local currentSpec = activeSpec and GetSpecialization(false, false, activeSpec)
if currentSpec and type(tree) == 'number' then
return tree == currentSpec
elseif currentSpec and type(tree) == 'table' then
for _, index in pairs(tree) do
if index == currentSpec then
return true
end
end
end
return false
end
function E:IsDispellableByMe(debuffType)
if not self.DispelClasses[self.myclass] then return end
......@@ -633,25 +613,17 @@ function E:IsDispellableByMe(debuffType)
end
function E:CheckRole()
local talentTree = GetSpecialization()
self.myspec = talentTree
self.myspec = GetSpecialization()
self.myrole = E:GetPlayerRole()
local IsInPvPGear, role = false
local resilperc = GetCombatRatingBonus(COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN)
if resilperc > GetDodgeChance() and resilperc > GetParryChance() and UnitLevel('player') == MAX_PLAYER_LEVEL then
IsInPvPGear = true
end
-- myrole = group role; TANK, HEALER, DAMAGER
-- role = class role; Tank, Melee, Caster
local role
if type(self.ClassRole[self.myclass]) == 'string' then
role = self.ClassRole[self.myclass]
elseif talentTree then
role = self.ClassRole[self.myclass][talentTree]
end
--Check for PvP gear
if role == 'Tank' and IsInPvPGear then
role = 'Melee'
elseif self.myspec then
role = self.ClassRole[self.myclass][self.myspec]
end
if not role then
......@@ -672,12 +644,8 @@ function E:CheckRole()
self.callbacks:Fire('RoleChanged')
end
if self.HealingClasses[self.myclass] ~= nil and self.myclass ~= 'PRIEST' then
if self:CheckTalentTree(self.HealingClasses[self.myclass]) then
self.DispelClasses[self.myclass].Magic = true
else
self.DispelClasses[self.myclass].Magic = false