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. 689
      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
[198585] = {
true, true, true, true
} }
}, },
[384933] = { -- Ice Shield -- Mystic
[188067] = { [95834] = {
true, true, true -- Holy Radiance
[215433] = {
true, true, true, true
} }
}, },
[372749] = { -- Ice Shield -- Runcarver
[188067] = { [96664] = {
true, true, true -- Etch
[198959] = {
true, true, true, true
} }
}, },
[372743] = { -- Ice Shield -- Marksman
[188067] = { [96640] = {
true, true, true -- Penetrating Shot
[199210] = {
false, true, true, true
} }
}, },
[371984] = { -- Shieldmaiden
[188067] = { [95832] = {
true, true, true -- Mortal Hew
[199050] = {
false, true, true, false
} }
}, },
[373680] = { -- Shieldmaiden 2
[188252] = { [101639] = {
true, false, false -- Mortal Hew
[199050] = {
false, true, false, false
} }
}, },
[373688] = { -- Odyn Add
[188252] = { [102019] = {
true, false, false -- Surge
} [198750] = {
}, true, false, false, false
[385310] = {
[195119] = {
true, false, false
} }
}, },
[384194] = { --
[190207] = { -- Court of Stars
--
-- Duskwatch Guard
[111563] = {
-- Fortification
[209033] = {
true, true, true true, true, true
} }
}, },
[384197] = { -- Duskwatch Guard 2
[190207] = { [104246] = {
true, true, true -- Fortification
[209033] = {
true, true, false, false
} }
}, },
[373017] = { -- Sentry
[189886] = { [104251] = {
true, false, false -- Sound the Alarm
[210261] = {
true, true, true, true
} }
}, },
[392576] = { -- Construct
[198047] = { [104270] = {
-- Suppress
[209413] = {
true, false, false, false
},
-- Charging Station
[225100] = {
true, false, false true, false, false
} }
}, },
[392451] = { -- Bound Energy
[197985] = { [105705] = {
true, true, false, -- Charged Blast
} [212031] = {
}, true, true, false, false
[392452] = {
[197985] = {
true, true, false,
}
},
-- Nokhud
[383823] = {
[192796] = {
false, true, true
} }
}, },
[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] = {
true, false, false
}, },
[194316] = { -- Fireball
true, false, false [211412] = {
} true, true, true, false
},
[386028] = {
[195696] = {
true, false, false
}
},
[386024] = {
[194894] = {
true, true, true
}
},
[386025] = {
[194894] = {
true, true, true
}
},
[387629] = {
[195876] = {
false, true, true
}
},
[387608] = {
[195842] = {
false, true, true
}
},
[387611] = {
[195842] = {
false, true, true
} }
}, },
[387440] = { -- Shadow Mistress
[195878] = { [104300] = {
false, true, true -- Bewitch
[211470] = {
true, true, true, false
} }
}, },
[373395] = { -- Balgarr
[199717] = { [104274] = {
true, false, false -- Disintegration Beam
} [207980] = {
}, true, false, false, false
[376725] = {
[190294] = {
true, true, true
}, },
}, -- Disintigration Beam 2
[370764] = { [207981] = {
[187160] = { true, false, false, false
false, true, true
},
[196116] = {
false, true, true
},
},
[387564] = {
[196102] = {
true, true, true
}
},
[375596] = {
[196115] = {
true, false, false
}, },
[191164] = { -- Impending Doom
true, false, false [397907] = {
true, false, false, false
}, },
-- Impending Doom 2
}, [397908] = {
[386549] = { true, false, false, false
[186741] = {
true, true, true
} }
}, },
[386546] = { -- Talixae Flamewreath
[186741] = { [104217] = {
true, true, true -- Withering Soul
[208165] = {
true, false, false, false
} }
}, },
[389804] = { --
[187154] = { -- RLP
true, false, false --
} -- Earthshaper
}, [187969] = {
[377488] = { -- Tectonic Slam
[187155] = { [372735] = {
true, true, true false, true, true, true
} }
}, },
[377105] = { -- Chillweaver
[190510] = { [188067] = {
false, true, true -- Ice Shield
} [384933] = {
}, true, true, true, true
[373932] = { },
[190187] = { -- Ice Shield 2
true, false, false [372749] = {
} true, true, true, true
}, },
-- AA -- Ice Shield 3
[387910] = { [372743] = {
[196200] = { true, true, true, true
false, true, true
}
},
[387975] = {
[196202] = {
true, true, true
} }
}, },
[388863] = { -- Meledrusa
[196045] = { [188252] = {
true, true, true -- Frost Overload
[373680] = {
true, false, false, false
},
-- Frost Overload 2
[373688] = {
true, false, false, false
} }
}, },
[388392] = { -- Cinderweaver
[196044] = { [190207] = {
true, true, true -- Cinderbolt 1
[384194] = {
true, false, false, false
},
-- Cinderbolt 2
[384197] = {
true, false, false, false
} }
}, },
[396812] = { -- Flame Dancer
[196576] = { [190206] = {
true, true, true -- Flame Dance
[385536] = {
false, true, true, true
} }
}, },
[377389] = { -- Blazebound Firestorm
[192333] = { [189886] = {
true, false, false -- Roaring Blaze
[373017] = {
true, false, false, false
} }
}, },
[397888] = { -- Tempest Channeler
[200126] = { [198047] = {
true, true, true -- Thunder Bolt
[392576] = {
true, false, false, false
} }
}, },
[397801] = { -- Flame Channeler
[56448] = { [197985] = {
true, false, false -- Flashfire
} [392451] = {
}, true, true, false, false
[395859] = { },
[59555] = { -- Flashfire
true, true, true [392452] = {
} true, true, false, false
},
}, },
[395872] = { --
[59546] = { -- NO
true, false, false --
-- Hornsounder
[192796] = {
-- Rally The Clan
[383823] = {
false, true, true, true
} }
}, },
[396018] = { -- Plainstomper
[59552] = { [191847] = {
true, false, false -- Disruptive Shout
[384365] = {
true, false, false, false
} }
}, },
[396073] = { -- Lancemaster
[59544] = { [192800] = {
true, true, false -- Disruptive Shout
[384365] = {
true, false, false, false
} }
}, },
[397899] = { -- Arcblade
[200131] = { [194898] = {
false, true, true -- Arcing Strike
[387135] = {
false, true, true, true
} }
}, },
[397914] = { -- Stormcaller Botoo
[200137] = { [194317] = {
true, true, true -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
-- sbg -- Thunderbeast
[152818] = { [195696] = {
[75713] = { -- Chain Lightning
true, true, false [387127] = {
true, false, false, false
} }
}, },
[398154] = { [194894] = {
[75451] = { -- Tempest
false, true, true [386025] = {
true, true, true, true
},
-- Tempest 2
[386024] = {
true, true, true, true
},
-- Summon Squall
[386015] = {
true, true, true, true
},
-- Stormbolt
[386012] = {
true, true, true, true
} }
}, },
[156776] = { -- Squall
[76446] = { [194895] = {
true, true, true -- Surge
[386026] = {
true, true, false, false
} }
}, },
[156772] = { -- Stormcaller Arynga
[77700] = { [195265] = {
true, false, false -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[153524] = { -- Nokhud Neophyte
[75459] = { [196263] = {
true, true, true -- Stormbolt
[386012] = {
true, true, false, false
} }
}, },
[156718] = { -- Stormcaller Solongo
[76104] = { [194315] = {
true, false, false -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[225100] = { -- Stormcaller Zarii
[104270] = { [194316] = {
true, false, false -- Stormbolt
[386012] = {
true, false, false, false
} }
}, },
[210261] = { -- Soulharvester Galtmaa
[104251] = { [195927] = {
true, true, true -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[209027] = { -- Soulharvester Tumen
[104246] = { [195929] = {
false, true, true -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[212031] = { -- Soulharvester Mandakh
[105705] = { [195930] = {
false, true, false -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[212784] = { -- Soulharvester Duuren
[105715] = { [195928] = {
false, true, false -- Death Bolt Volley
[387411] = {
true, false, false, false
} }
}, },
[198585] = { -- Beastcaller
[95842] = { [195878] = {
true, true, true -- Desecrated Roar
[387440] = {
true, true, true, true
},
-- Heavy Slash
[387826] = {
false, true, true, true
} }
}, },
[198959] = { -- Mystic
[96664] = { [195877] = {
true, true, true -- Swift Wind
[387596] = {
true, true, true, false
} }
}, },
[215433] = { -- Risen Warrior
[95834] = { [195855] = {
true, true, true -- Mortal Strike
[388801] = {
false, true, true, false
} }
}, },
[199210] = { -- Teera
[96640] = { [186339] = {
false, true, true -- Guardian Wind
[384808] = {
true, false, false, false
} }
}, },
[199090] = { -- Batak
[96611] = { [193462] = {
false, true, true -- Bloodcurdling Shout
[373395] = {
true, false, false, false
} }
}, },
[185425] = { -- Balakar Add
[96677] = { [190294] = {
false, true, false -- Storm Bolt
[376725] = {
true, true, true, true
} }
}, }
} }
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