Some prot tweaks, modify kick & stop utils

main
Ryan Crockett 2 years ago
parent dd045cda94
commit 7dddf66cb0
  1. 6
      scripts/paladin/paladin_protection.lua
  2. 667
      src/MythicPlusUtils/MythicPlusUtils.lua

@ -16,7 +16,7 @@ local Judgement = Bastion.SpellBook:GetSpell(275779)
local AvengersShield = Bastion.SpellBook:GetSpell(31935) local AvengersShield = Bastion.SpellBook:GetSpell(31935)
local OfDuskAndDawn = Bastion.SpellBook:GetSpell(385125) local OfDuskAndDawn = Bastion.SpellBook:GetSpell(385125)
local BlessingOfTheDusk = Bastion.SpellBook:GetSpell(385126) local BlessingOfTheDusk = Bastion.SpellBook:GetSpell(385126)
local BlessingOfTheDawn = Bastion.SpellBook:GetSpell(337747) local BlessingOfTheDawn = Bastion.SpellBook:GetSpell(385127)
local ShieldOfTheRighteous = Bastion.SpellBook:GetSpell(53600) local ShieldOfTheRighteous = Bastion.SpellBook:GetSpell(53600)
local BlessedHammer = Bastion.SpellBook:GetSpell(204019) local BlessedHammer = Bastion.SpellBook:GetSpell(204019)
local AutoAttack = Bastion.SpellBook:GetSpell(6603) local AutoAttack = Bastion.SpellBook:GetSpell(6603)
@ -51,7 +51,7 @@ local AvengersShieldTarget = Bastion.UnitManager:CreateCustomUnit('avengersshiel
return false return false
end end
if unit:IsCastingOrChanneling() then if unit:IsCastingOrChanneling() and unit:IsInterruptibleAt(5) then
target = unit target = unit
return true return true
end end
@ -124,7 +124,7 @@ local function CombatRotation()
return Consecrate:Cast(Player) return Consecrate:Cast(Player)
end end
if WoG:IsKnownAndUsable() and Player:GetAuras():FindMy(ShinningLight):IsUp() and Player:GetHealthPercent() <= 51 and not Player:IsCastingOrChanneling() then if WoG:IsKnownAndUsable() and Player:GetAuras():FindMy(ShinningLight):IsUp() and Player:GetHealthPercent() <= 50 and not Player:IsCastingOrChanneling() then
return WoG:Cast(Player) return WoG:Cast(Player)
end end

@ -2,12 +2,7 @@ local Tinkr, Bastion = ...
---@class MythicPlusUtils ---@class MythicPlusUtils
local MythicPlusUtils = { local MythicPlusUtils = {
debuffLogging = false, interruptList = {},
castLogging = false,
random = '',
loggedCasts = {},
loggedDebuffs = {},
kickList = {},
} }
MythicPlusUtils.__index = MythicPlusUtils MythicPlusUtils.__index = MythicPlusUtils
@ -16,463 +11,442 @@ MythicPlusUtils.__index = MythicPlusUtils
function MythicPlusUtils:New() function MythicPlusUtils:New()
local self = setmetatable({}, MythicPlusUtils) local self = setmetatable({}, MythicPlusUtils)
self.random = math.random(1000000, 9999999) self.interruptList = {
self.kickList = { -- kick, stun, disorient, incap
-- Ruby life pools --
[372735] = { -- Techtonic Slam -- Hals of Valor
[187969] = { --
false, true, true -- Kick, Stun, Disorient -- Thunder Caller
} [95842] = {
}, -- Thunderous Blast
[384933] = { -- Ice Shield [198585] = {
[188067] = { true, true, true, true
true, true, true
}
},
[372749] = { -- Ice Shield
[188067] = {
true, true, true
} }
}, },
[372743] = { -- Ice Shield -- Mystic
[188067] = { [95834] = {
true, true, true -- Holy Radiance
[215433] = {
true, true, true, true
} }
}, },
[371984] = { -- Runcarver
[188067] = { [96664] = {
true, true, true -- Etch
[198959] = {
true, true, true, true
} }
}, },
[373680] = { -- Marksman
[188252] = { [96640] = {
true, false, false -- Penetrating Shot
[199210] = {
false, true, true, true
} }
}, },
[373688] = { -- Shieldmaiden
[188252] = { [95832] = {
true, false, false -- Mortal Hew
[199050] = {
false, true, true, false
} }
}, },
[385310] = { -- Shieldmaiden 2
[195119] = { [101639] = {
true, false, false -- Mortal Hew
[199050] = {
false, true, false, false
} }
}, },
[384194] = { -- Odyn Add
[190207] = { [102019] = {
true, true, true -- Surge
[198750] = {
true, false, false, false
} }
}, },
[384197] = { --
[190207] = { -- Court of Stars
--
-- Duskwatch Guard
[111563] = {
-- Fortification
[209033] = {
true, true, true true, true, true
} }
}, },
[373017] = { -- Duskwatch Guard 2
[189886] = { [104246] = {
true, false, false -- Fortification
[209033] = {
true, true, false, false
} }
}, },
[392576] = { -- Sentry
[198047] = { [104251] = {
true, false, false -- Sound the Alarm
[210261] = {
true, true, true, true
} }
}, },
[392451] = { -- Construct
[197985] = { [104270] = {
true, true, false, -- Suppress
} [209413] = {
true, false, false, false
}, },
[392452] = { -- Charging Station
[197985] = { [225100] = {
true, true, false, true, false, false
} }
}, },
-- Nokhud -- Bound Energy
[383823] = { [105705] = {
[192796] = { -- Charged Blast
false, true, true [212031] = {
true, true, false, false
} }
}, },
[384492] = { -- Arcane Manifestation
[192794] = { [105704] = {
false, true, true -- Drain Magic
[209485] = {
true, false, false, false
} }
}, },
[384365] = { -- Watchful Inquisitor
[192800] = { [105715] = {
true, false, false -- Searing Glare
[211299] = {
true, false, false, false
}, },
[191847] = { -- Eye Storm
true, false, false [212784] = {
false, true, false, false
} }
}, },
[386012] = { -- Blazing Imp
[194317] = { [104295] = {
true, false, false -- Drifting Embers
[211401] = {
true, true, true, false
}, },
[195265] = { -- Drifting Embers 2
true, false, false [211406] = {
true, true, true, false
}, },
[194315] = { -- Fireball
true, false, false [211412] = {
}, true, true, true, false
[194316] = {
true, false, false
} }
}, },
[386028] = { -- Shadow Mistress
[195696] = { [104300] = {
true, false, false -- Bewitch
[211470] = {
true, true, true, false
} }
}, },
[386024] = { -- Balgarr
[194894] = { [104274] = {
true, true, true -- Disintegration Beam
} [207980] = {
}, true, false, false, false
[386025] = {
[194894] = {
true, true, true
}
}, },
[387629] = { -- Disintigration Beam 2
[195876] = { [207981] = {
false, true, true true, false, false, false
}
}, },
[387608] = { -- Impending Doom
[195842] = { [397907] = {
false, true, true true, false, false, false
}
}, },
[387611] = { -- Impending Doom 2
[195842] = { [397908] = {
false, true, true true, false, false, false
} }
}, },
[387440] = { -- Talixae Flamewreath
[195878] = { [104217] = {
false, true, true -- Withering Soul
[208165] = {
true, false, false, false
} }
}, },
[373395] = { --
[199717] = { -- RLP
true, false, false --
-- Earthshaper
[187969] = {
-- Tectonic Slam
[372735] = {
false, true, true, true
} }
}, },
[376725] = { -- Chillweaver
[190294] = { [188067] = {
true, true, true -- Ice Shield
}, [384933] = {
}, true, true, true, true
[370764] = {
[187160] = {
false, true, true
},
[196116] = {
false, true, true
}, },
-- Ice Shield 2
[372749] = {
true, true, true, true
}, },
[387564] = { -- Ice Shield 3
[196102] = { [372743] = {
true, true, true true, true, true, true
} }
}, },
[375596] = { -- Meledrusa
[196115] = { [188252] = {
true, false, false -- Frost Overload
}, [373680] = {
[191164] = { true, false, false, false
true, false, false
},
},
[386549] = {
[186741] = {
true, true, true
}
}, },
[386546] = { -- Frost Overload 2
[186741] = { [373688] = {
true, true, true true, false, false, false
} }
}, },
[389804] = { -- Cinderweaver
[187154] = { [190207] = {
true, false, false -- Cinderbolt 1
} [384194] = {
true, false, false, false
}, },
[377488] = { -- Cinderbolt 2
[187155] = { [384197] = {
true, true, true true, false, false, false
} }
}, },
[377105] = { -- Flame Dancer
[190510] = { [190206] = {
false, true, true -- Flame Dance
[385536] = {
false, true, true, true
} }
}, },
[373932] = { -- Blazebound Firestorm
[190187] = { [189886] = {
true, false, false -- Roaring Blaze
[373017] = {
true, false, false, false
} }
}, },
-- AA -- Tempest Channeler
[387910] = { [198047] = {
[196200] = { -- Thunder Bolt
false, true, true [392576] = {
true, false, false, false
} }
}, },
[387975] = { -- Flame Channeler
[196202] = { [197985] = {
true, true, true -- Flashfire
} [392451] = {
true, true, false, false
}, },
[388863] = { -- Flashfire
[196045] = { [392452] = {
true, true, true true, true, false, false
}
}, },
[388392] = {
[196044] = {
true, true, true
}
}, },
[396812] = { --
[196576] = { -- NO
true, true, true --
-- Hornsounder
[192796] = {
-- Rally The Clan
[383823] = {
false, true, true, true
} }
}, },
[377389] = { -- Plainstomper
[192333] = { [191847] = {
true, false, false -- Disruptive Shout
[384365] = {
true, false, false, false
} }
}, },
[397888] = { -- Lancemaster
[200126] = { [192800] = {
true, true, true -- Disruptive Shout
[384365] = {
true, false, false, false
} }
}, },
[397801] = { -- Arcblade
[56448] = { [194898] = {
true, false, false -- Arcing Strike
[387135] = {
false, true, true, true
} }
}, },
[395859] = { -- Stormcaller Botoo
[59555] = { [194317] = {
true, true, true -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[395872] = { -- Thunderbeast
[59546] = { [195696] = {
true, false, false -- Chain Lightning
[387127] = {
true, false, false, false
} }
}, },
[396018] = { [194894] = {
[59552] = { -- Tempest
true, false, false [386025] = {
} true, true, true, true
}, },
[396073] = { -- Tempest 2
[59544] = { [386024] = {
true, true, false true, true, true, true
}
}, },
[397899] = { -- Summon Squall
[200131] = { [386015] = {
false, true, true true, true, true, true
}
}, },
[397914] = { -- Stormbolt
[200137] = { [386012] = {
true, true, true true, true, true, true
} }
}, },
-- sbg -- Squall
[152818] = { [194895] = {
[75713] = { -- Surge
true, true, false [386026] = {
true, true, false, false
} }
}, },
[398154] = { -- Stormcaller Arynga
[75451] = { [195265] = {
false, true, true -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[156776] = { -- Nokhud Neophyte
[76446] = { [196263] = {
true, true, true -- Stormbolt
[386012] = {
true, true, false, false
} }
}, },
[156772] = { -- Stormcaller Solongo
[77700] = { [194315] = {
true, false, false -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[153524] = { -- Stormcaller Zarii
[75459] = { [194316] = {
true, true, true -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[156718] = { -- Soulharvester Galtmaa
[76104] = { [195927] = {
true, false, false -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[225100] = { -- Soulharvester Tumen
[104270] = { [195929] = {
true, false, false -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[210261] = { -- Soulharvester Mandakh
[104251] = { [195930] = {
true, true, true -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[209027] = { -- Soulharvester Duuren
[104246] = { [195928] = {
false, true, true -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[212031] = { -- Beastcaller
[105705] = { [195878] = {
false, true, false -- Desecrated Roar
} [387440] = {
true, true, true, true
}, },
[212784] = { -- Heavy Slash
[105715] = { [387826] = {
false, true, false false, true, true, true
} }
}, },
[198585] = { -- Mystic
[95842] = { [195877] = {
true, true, true -- Swift Wind
[387596] = {
true, true, true, false
} }
}, },
[198959] = { -- Risen Warrior
[96664] = { [195855] = {
true, true, true -- Mortal Strike
[388801] = {
false, true, true, false
} }
}, },
[215433] = { -- Teera
[95834] = { [186339] = {
true, true, true -- Guardian Wind
[384808] = {
true, false, false, false
} }
}, },
[199210] = { -- Batak
[96640] = { [193462] = {
false, true, true -- Bloodcurdling Shout
[373395] = {
true, false, false, false
} }
}, },
[199090] = { -- Balakar Add
[96611] = { [190294] = {
false, true, true -- Storm Bolt
[376725] = {
true, true, true, true
} }
},
[185425] = {
[96677] = {
false, true, false
} }
},
} }
Bastion.EventManager:RegisterWoWEvent('UNIT_AURA', function(unit, auras)
if not self.debuffLogging then
return
end
if auras.addedAuras then
local addedAuras = auras.addedAuras
if #addedAuras > 0 then
for i = 1, #addedAuras do
local aura = Bastion.Aura:CreateFromUnitAuraInfo(addedAuras[i])
if not self.loggedDebuffs[aura:GetSpell():GetID()] and not aura:IsBuff() then
WriteFile('bastion-MPlusDebuffs-' .. self.random .. '.lua', [[
AuraName: ]] .. aura:GetName() .. [[
AuraID: ]] .. aura:GetSpell():GetID() .. "\n" .. [[
]], true)
end
end
end
end
end)
Bastion.EventManager:RegisterWoWEvent('UNIT_SPELLCAST_START', function(unitTarget, castGUID, spellID)
if not self.castLogging then
return
end
if self.loggedCasts[spellID] then
return
end
local name = GetSpellInfo(spellID)
self.loggedCasts[spellID] = true
WriteFile('bastion-MPlusCasts-' .. self.random .. '.lua', [[
CastName: ]] .. name .. [[
CastID: ]] .. spellID .. "\n" .. [[
]], true)
end)
Bastion.EventManager:RegisterWoWEvent('UNIT_SPELLCAST_CHANNEL_START', function(unitTarget, castGUID, spellID)
if not self.castLogging then
return
end
if self.loggedCasts[spellID] then
return
end
local name = GetSpellInfo(spellID)
self.loggedCasts[spellID] = true
WriteFile('bastion-MPlusCasts-' .. self.random .. '.lua', [[
CastName: ]] .. name .. [[
CastID: ]] .. spellID .. "\n" .. [[
]], true)
end)
return self return self
end end
---@return nil
function MythicPlusUtils:ToggleDebuffLogging()
self.debuffLogging = not self.debuffLogging
end
---@return nil
function MythicPlusUtils:ToggleCastLogging()
self.castLogging = not self.castLogging
end
---@param unit Unit ---@param unit Unit
---@param percent number ---@param percent number
---@return boolean ---@return boolean
function MythicPlusUtils:CastingCriticalKick(unit, percent) function MythicPlusUtils:CastingCriticalKick(unit, percent)
local castingSpell = unit:GetCastingOrChannelingSpell() local castingSpell = unit:GetCastingOrChannelingSpell()
if castingSpell then local npcSpells = self.interruptList[unit:GetID()]
if npcSpells and castingSpell then
local spellID = castingSpell:GetID() local spellID = castingSpell:GetID()
local kickEntry = self.kickList[spellID]
if not kickEntry then
return false
end
local npcTraits = kickEntry[unit:GetID()] local spellTraits = npcSpells[spellID]
if not npcTraits then if not spellTraits then
return false return false
end end
local isKick, isStun, isDisorient = unpack(npcTraits) local isKick, isStun, isDisorient, isIncap = table.unpack(spellTraits)
if isKick and unit:IsInterruptibleAt(percent) then if isKick and unit:IsInterruptibleAt(percent) then
return true return true
@ -484,31 +458,30 @@ end
---@param unit Unit ---@param unit Unit
---@param percent number ---@param percent number
---@return boolean ---@return boolean, boolean, boolean
function MythicPlusUtils:CastingCriticalStun(unit, percent) function MythicPlusUtils:CastingCriticalStop(unit, percent)
local castingSpell = unit:GetCastingOrChannelingSpell() local castingSpell = unit:GetCastingOrChannelingSpell()
if castingSpell then local npcSpells = self.interruptList[unit:GetID()]
if npcSpells and castingSpell then
local spellID = castingSpell:GetID() local spellID = castingSpell:GetID()
local kickEntry = self.kickList[spellID]
if not kickEntry then
return false
end
local npcTraits = kickEntry[unit:GetID()] local spellTraits = npcSpells[spellID]
if not npcTraits then if not spellTraits then
return false return false, false, false
end end
local isKick, isStun, isDisorient = unpack(npcTraits) local isKick, isStun, isDisorient, isIncap = table.unpack(spellTraits)
if (isStun or isDisorient) and not isKick and unit:IsInterruptibleAt(percent, true) then local castPercent = unit:GetChannelOrCastPercentComplete()
return true if (isStun or isDisorient or isIncap) and not isKick and castPercent >= percent then
return isStun, isDisorient, isIncap
end end
end end
return false return false, false, false
end end
return MythicPlusUtils return MythicPlusUtils

Loading…
Cancel
Save