Skip to content

Commit

Permalink
Update Resto
Browse files Browse the repository at this point in the history
  • Loading branch information
doadin committed Oct 28, 2024
1 parent 0ea2d84 commit 23dbd93
Showing 1 changed file with 46 additions and 37 deletions.
83 changes: 46 additions & 37 deletions Specialization/Restoration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local _, addonTable = ...
local Shaman = addonTable.Shaman
local MaxDps = _G.MaxDps
if not MaxDps then return end
local setSpell

local UnitPower = UnitPower
local UnitHealth = UnitHealth
Expand Down Expand Up @@ -68,21 +69,21 @@ local ManaDeficit
local Restoration = {}

function Restoration:precombat()
--if (MaxDps:CheckSpellUsable(classtable.EarthlivingWeapon, 'EarthlivingWeapon')) and cooldown[classtable.EarthlivingWeapon].ready then
-- return classtable.EarthlivingWeapon
--end
--if (MaxDps:CheckSpellUsable(classtable.WaterShield, 'WaterShield')) and (buff[classtable.WaterShieldBuff].up + buff[classtable.EarthShieldBuff].duration + buff[classtable.LightningShieldBuff].duration <1 + talents[classtable.ElementalOrbit]) and cooldown[classtable.WaterShield].ready then
-- return classtable.WaterShield
--end
--if (MaxDps:CheckSpellUsable(classtable.LightningShield, 'LightningShield')) and (buff[classtable.WaterShieldBuff].up + buff[classtable.EarthShieldBuff].duration + buff[classtable.LightningShieldBuff].duration <1 + talents[classtable.ElementalOrbit]) and cooldown[classtable.LightningShield].ready then
-- return classtable.LightningShield
--end
--if (MaxDps:CheckSpellUsable(classtable.EarthShield, 'EarthShield')) and (buff[classtable.WaterShieldBuff].up + buff[classtable.EarthShieldBuff].duration + buff[classtable.LightningShieldBuff].duration <1 + talents[classtable.ElementalOrbit]) and cooldown[classtable.EarthShield].ready then
-- return classtable.EarthShield
--end
--if (MaxDps:CheckSpellUsable(classtable.EarthElemental, 'EarthElemental')) and cooldown[classtable.EarthElemental].ready then
-- MaxDps:GlowCooldown(classtable.EarthElemental, cooldown[classtable.EarthElemental].ready)
--end
if (MaxDps:CheckSpellUsable(classtable.EarthlivingWeapon, 'EarthlivingWeapon')) and talents[classtable.EarthlivingWeapon] and select(4,GetWeaponEnchantInfo()) ~= 6498 and cooldown[classtable.EarthlivingWeapon].ready and not UnitAffectingCombat('player') then
if not setSpell then setSpell = classtable.EarthlivingWeapon end
end
if (MaxDps:CheckSpellUsable(classtable.TidecallersGuard, 'TidecallersGuard')) and select(8,GetWeaponEnchantInfo()) ~= 7528 and cooldown[classtable.TidecallersGuard].ready and not UnitAffectingCombat('player') then
if not setSpell then setSpell = classtable.TidecallersGuard end
end
if (MaxDps:CheckSpellUsable(classtable.EarthElemental, 'EarthElemental')) and cooldown[classtable.EarthElemental].ready and not UnitAffectingCombat('player') then
MaxDps:GlowCooldown(classtable.EarthElemental, cooldown[classtable.EarthElemental].ready)
end
end

local function ClearCDs()
MaxDps:GlowCooldown(classtable.EarthElemental, false)
MaxDps:GlowCooldown(classtable.SpiritwalkersGrace, false)
MaxDps:GlowCooldown(classtable.WindShear, false)
end

function Restoration:callaction()
Expand All @@ -92,29 +93,33 @@ function Restoration:callaction()
if (MaxDps:CheckSpellUsable(classtable.WindShear, 'WindShear')) and cooldown[classtable.WindShear].ready then
MaxDps:GlowCooldown(classtable.WindShear, ( select(8,UnitCastingInfo('target')) ~= nil and not select(8,UnitCastingInfo('target')) or select(7,UnitChannelInfo('target')) ~= nil and not select(7,UnitChannelInfo('target'))) )
end
if (MaxDps:CheckSpellUsable(classtable.HealingRain, 'HealingRain')) and (talents[classtable.AcidRain]) and cooldown[classtable.HealingRain].ready then
return classtable.HealingRain
if (MaxDps:CheckSpellUsable(classtable.SurgingTotem, 'SurgingTotem')) and (talents[classtable.SurgingTotem] and talents[classtable.AcidRain]) and cooldown[classtable.SurgingTotem].ready then
if not setSpell then setSpell = classtable.SurgingTotem end
end
if (MaxDps:CheckSpellUsable(classtable.HealingRain, 'HealingRain')) and (not talents[classtable.SurgingTotem] and GetUnitSpeed("player") == 0 and talents[classtable.AcidRain]) and cooldown[classtable.HealingRain].ready then
if not setSpell then setSpell = classtable.HealingRain end
end
--print(MaxDps:CheckSpellUsable(classtable.FlameShock, 'FlameShock'))
if (MaxDps:CheckSpellUsable(classtable.FlameShock, 'FlameShock')) and (targets <3 and debuff[classtable.FlameShockDeBuff].refreshable) and cooldown[classtable.FlameShock].ready then
return classtable.FlameShock
if not setSpell then setSpell = classtable.FlameShock end
end
if (MaxDps:CheckSpellUsable(classtable.LavaBurst, 'LavaBurst')) and (( targets == 1 or targets == 2 and buff[classtable.LavaSurgeBuff].up ) and debuff[classtable.FlameShockDeBuff].remains >( classtable and classtable.LavaBurst and GetSpellInfo(classtable.LavaBurst).castTime /1000 ) and cooldown[classtable.LavaBurst].ready) and cooldown[classtable.LavaBurst].ready then
return classtable.LavaBurst
if (MaxDps:CheckSpellUsable(classtable.LavaBurst, 'LavaBurst')) and (( targets == 1 or targets == 2 and buff[classtable.LavaSurgeBuff].up ) and debuff[classtable.FlameShockDeBuff].remains >( classtable and classtable.LavaBurst and GetSpellInfo(classtable.LavaBurst).castTime /1000 or 0 ) and cooldown[classtable.LavaBurst].ready) and cooldown[classtable.LavaBurst].ready then
if not setSpell then setSpell = classtable.LavaBurst end
end
if (MaxDps:CheckSpellUsable(classtable.EarthElemental, 'EarthElemental')) and cooldown[classtable.EarthElemental].ready then
MaxDps:GlowCooldown(classtable.EarthElemental, cooldown[classtable.EarthElemental].ready)
end
if (MaxDps:CheckSpellUsable(classtable.LightningBolt, 'LightningBolt')) and (targets <2 or not talents[classtable.ChainLightning]) and cooldown[classtable.LightningBolt].ready then
return classtable.LightningBolt
if not setSpell then setSpell = classtable.LightningBolt end
end
if (MaxDps:CheckSpellUsable(classtable.ChainLightning, 'ChainLightning')) and (targets >1) and cooldown[classtable.ChainLightning].ready then
return classtable.ChainLightning
if not setSpell then setSpell = classtable.ChainLightning end
end
if (MaxDps:CheckSpellUsable(classtable.FlameShock, 'FlameShock')) and cooldown[classtable.FlameShock].ready then
return classtable.FlameShock
if not setSpell then setSpell = classtable.FlameShock end
end
if (MaxDps:CheckSpellUsable(classtable.FrostShock, 'FrostShock')) and cooldown[classtable.FrostShock].ready then
return classtable.FrostShock
if not setSpell then setSpell = classtable.FrostShock end
end
end
function Shaman:Restoration()
Expand All @@ -132,7 +137,7 @@ function Shaman:Restoration()
ManaDeficit = ManaMax - Mana
targetHP = UnitHealth('target')
targetmaxHP = UnitHealthMax('target')
targethealthPerc = (targetHP / targetmaxHP) * 100
targethealthPerc = (targetHP >0 and targetmaxHP >0 and (targetHP / targetmaxHP) * 100) or 100
curentHP = UnitHealth('player')
maxHP = UnitHealthMax('player')
healthPerc = (curentHP / maxHP) * 100
Expand All @@ -143,23 +148,27 @@ function Shaman:Restoration()
Maelstrom = UnitPower('player', MaelstromPT)
MaelstromMax = UnitPowerMax('player', MaelstromPT)
MaelstromDeficit = MaelstromMax - Maelstrom
for spellId in pairs(MaxDps.Flags) do
self.Flags[spellId] = false
self:ClearGlowIndependent(spellId, spellId)
end
classtable.FlameShock = MaxDps:FindSpell(118389) and 118389 or MaxDps:FindSpell(470411) and 470411
--for spellId in pairs(MaxDps.Flags) do
-- self.Flags[spellId] = false
-- self:ClearGlowIndependent(spellId, spellId)
--end
classtable.WaterShieldBuff = 52127
classtable.EarthShieldBuff = 383648
classtable.LightningShieldBuff = 192106
classtable.UnleashLifeBuff = 0
classtable.DownpourBuff = 462488
classtable.HighTideBuff = 288675
classtable.EarthShieldDeBuff = 0
classtable.FlameShockDeBuff = 188389
classtable.LavaSurgeBuff = 77762
classtable.EarthlivingWeaponBuff = 6498
classtable.TidecallersGuard = 457481
setSpell = nil
ClearCDs()

local precombatCheck = Restoration:precombat()
if precombatCheck then
return Restoration:precombat()
end
Restoration:precombat()

local callactionCheck = Restoration:callaction()
if callactionCheck then
return Restoration:callaction()
end
Restoration:callaction()
if setSpell then return setSpell end
end

0 comments on commit 23dbd93

Please sign in to comment.