Updates, fixes, changes

4n0n-patch-1
4n0n 2 years ago
parent cd00075dfd
commit e854f4fc64
  1. 139
      scripts/subtlety.lua
  2. 51
      src/MythicPlusUtils/MythicPlusUtils.lua
  3. 12
      src/Unit/Unit.lua
  4. 7
      src/_bastion.lua

@ -853,7 +853,6 @@ local DarkMoonRime = Bastion.ItemBook:GetItem(198477)
local AlgetharsPuzzleBox = Bastion.ItemBook:GetItem(193701) local AlgetharsPuzzleBox = Bastion.ItemBook:GetItem(193701)
local RimeCards = { local RimeCards = {
One = Bastion.SpellBook:GetSpell(382844),
Two = Bastion.SpellBook:GetSpell(382845), Two = Bastion.SpellBook:GetSpell(382845),
Three = Bastion.SpellBook:GetSpell(382846), Three = Bastion.SpellBook:GetSpell(382846),
Four = Bastion.SpellBook:GetSpell(382847), Four = Bastion.SpellBook:GetSpell(382847),
@ -861,6 +860,7 @@ local RimeCards = {
Six = Bastion.SpellBook:GetSpell(382849), Six = Bastion.SpellBook:GetSpell(382849),
Seven = Bastion.SpellBook:GetSpell(382850), Seven = Bastion.SpellBook:GetSpell(382850),
Eight = Bastion.SpellBook:GetSpell(382851), Eight = Bastion.SpellBook:GetSpell(382851),
Ace = Bastion.SpellBook:GetSpell(382844),
} }
local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit) local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit)
@ -879,7 +879,7 @@ local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit)
return false return false
end end
if unit:GetAuras():HasAnyStealableAura() then if unit:GetAuras():HasAnyStealableAura() and Shiv:IsInRange(unit) then
purge = unit purge = unit
return true return true
end end
@ -991,6 +991,96 @@ local RuptureTarget = Bastion.UnitManager:CreateCustomUnit('rupture', function()
return target return target
end) end)
local function GetRimeDuration(topCard)
-- // card order is [ 2 3 4 5 6 7 8 A ]
if topCard == RimeCards.Two then
return 0
elseif topCard == RimeCards.Three then
return 1
elseif topCard == RimeCards.Four then
return 2
elseif topCard == RimeCards.Five then
return 3
elseif topCard == RimeCards.Six then
return 4
elseif topCard == RimeCards.Seven then
return 5
elseif topCard == RimeCards.Eight then
return 6
elseif topCard == RimeCards.Ace then
return 7
end
return 0
end
local function GetRimeTopCard()
local topCard = nil
if Player:GetAuras():FindMy(RimeCards.Ace):IsUp() then
topCard = RimeCards.Ace
elseif Player:GetAuras():FindMy(RimeCards.Two):IsUp() then
topCard = RimeCards.Two
elseif Player:GetAuras():FindMy(RimeCards.Three):IsUp() then
topCard = RimeCards.Three
elseif Player:GetAuras():FindMy(RimeCards.Four):IsUp() then
topCard = RimeCards.Four
elseif Player:GetAuras():FindMy(RimeCards.Five):IsUp() then
topCard = RimeCards.Five
elseif Player:GetAuras():FindMy(RimeCards.Six):IsUp() then
topCard = RimeCards.Six
elseif Player:GetAuras():FindMy(RimeCards.Seven):IsUp() then
topCard = RimeCards.Seven
elseif Player:GetAuras():FindMy(RimeCards.Eight):IsUp() then
topCard = RimeCards.Eight
end
return topCard
end
local function HasRimeCard()
return GetRimeTopCard() ~= nil
end
local RimeTarget = Bastion.UnitManager:CreateCustomUnit('rime', function()
local target = nil
Bastion.UnitManager:EnumEnemies(function(unit)
if unit:IsDead() then
return false
end
if not Player:CanSee(unit) then
return false
end
if not Player:InMelee(unit) then
return false
end
if not Player:IsFacing(unit) then
return false
end
if not unit:IsBoss() and Player:GetEnemies(10) < 3 then
return false
end
if HasRimeCard() and DarkMoonRime:IsEquippedAndUsable() and
(unit:TimeToDie() < GetRimeDuration(GetRimeTopCard()) - 0.5 or unit:IsBoss()) then
target = unit
return true
end
end)
if target == nil then
target = None
end
return target
end)
local DefaultAPL = Bastion.APL:New('default') local DefaultAPL = Bastion.APL:New('default')
local CDsAPL = Bastion.APL:New('cds') local CDsAPL = Bastion.APL:New('cds')
local StealthedAPL = Bastion.APL:New('stealthed') local StealthedAPL = Bastion.APL:New('stealthed')
@ -1017,7 +1107,7 @@ ItemsAPL:AddItem(
ItemsAPL:AddSpell( ItemsAPL:AddSpell(
TricksOfTheTrade:CastableIf(function(self) TricksOfTheTrade:CastableIf(function(self)
return Tank:Exists() and self:IsKnownAndUsable() and return Tank:Exists() and Target:Exists() and self:IsKnownAndUsable() and
not Player:IsCastingOrChanneling() and not Player:IsCastingOrChanneling() and
Player:IsTanking(Target) Player:IsTanking(Target)
end):SetTarget(Tank) end):SetTarget(Tank)
@ -1059,20 +1149,13 @@ ItemsAPL:AddItem(
end):SetTarget(Player) end):SetTarget(Player)
) )
ItemsAPL:AddItem( -- Since we are sniping soon to die targets with rime we can put it in the default APL since we want burst damage
DefaultAPL:AddItem(
DarkMoonRime:UsableIf(function(self) DarkMoonRime:UsableIf(function(self)
return Target:Exists() and Player:InMelee(Target) and self:IsEquippedAndUsable() and return RimeTarget:Exists() and Player:InMelee(RimeTarget) and self:IsEquippedAndUsable() and
not Player:IsCastingOrChanneling() and (Player:GetMeleeAttackers() > 2 or Target:IsBoss()) and not Player:IsCastingOrChanneling() and (Player:GetMeleeAttackers() > 2 or Target:IsBoss()) and
(Player:GetAuras():FindMy(RimeCards.One):IsUp() or HasRimeCard()
Player:GetAuras():FindMy(RimeCards.Two):IsUp() or end):SetTarget(RimeTarget)
Player:GetAuras():FindMy(RimeCards.Three):IsUp() or
Player:GetAuras():FindMy(RimeCards.Four):IsUp() or
Player:GetAuras():FindMy(RimeCards.Five):IsUp() or
Player:GetAuras():FindMy(RimeCards.Six):IsUp() or
Player:GetAuras():FindMy(RimeCards.Seven):IsUp() or
Player:GetAuras():FindMy(RimeCards.Eight):IsUp()
)
end):SetTarget(Target)
) )
-- # Executed every time the actor is available. -- # Executed every time the actor is available.
@ -1097,6 +1180,23 @@ DefaultAPL:AddSpell(
end):SetTarget(KickTarget) end):SetTarget(KickTarget)
) )
DefaultAPL:AddSpell(
KidneyShot:CastableIf(function(self)
return KickTarget:Exists() and self:IsInRange(KickTarget) and
self:IsKnownAndUsable() and
not Player:IsCastingOrChanneling() and Player:IsFacing(Target)
end):SetTarget(KickTarget)
)
-- Purge
DefaultAPL:AddSpell(
Shiv:CastableIf(function(self)
return PurgeTarget:Exists() and
self:IsKnownAndUsable() and
not Player:IsCastingOrChanneling() and Player:IsFacing(Target)
end):SetTarget(PurgeTarget)
)
-- double consume_cp_max() const -- double consume_cp_max() const
-- { -- {
-- return COMBO_POINT_MAX + as<double>( talent.rogue.deeper_stratagem->effectN( 2 ).base_value() + -- return COMBO_POINT_MAX + as<double>( talent.rogue.deeper_stratagem->effectN( 2 ).base_value() +
@ -1330,13 +1430,14 @@ DefaultAPL:AddSpell(
) )
-- # Builders -- # Builders
-- actions.build=shuriken_storm,if=spell_targets>=2+(buff.lingering_shadow.remains>=6|buff.perforated_veins.up) -- actions.build=shuriken_storm,if=spell_targets>=2+(talent.gloomblade&buff.lingering_shadow.remains>=6|buff.perforated_veins.up)
BuildAPL:AddSpell( BuildAPL:AddSpell(
ShurikenStorm:CastableIf( ShurikenStorm:CastableIf(
function(self) function(self)
return self:IsKnownAndUsable() and return self:IsKnownAndUsable() and self:IsInRange(Target) and
Player:GetEnemies(10) >= 2 + ((Player:GetAuras():FindMy(LingeringShadow):GetRemainingTime() >= 6 or Player:GetEnemies(10) >= 2 + ((Gloomblade:IsKnown() and
Player:GetAuras():FindMy(PerforatedVeins):IsUp()) and 1 or 0) (Player:GetAuras():FindMy(LingeringShadow):GetRemainingTime() >= 6 or
Player:GetAuras():FindMy(PerforatedVeins):IsUp())) and 1 or 0)
end end
):SetTarget(Target) ):SetTarget(Target)
) )

@ -3,7 +3,11 @@ local Tinkr, Bastion = ...
---@class MythicPlusUtils ---@class MythicPlusUtils
local MythicPlusUtils = { local MythicPlusUtils = {
debuffLogging = false, debuffLogging = false,
random = '' castLogging = false,
random = '',
loggedCasts = {},
loggedDebuffs = {},
kickList = {},
} }
MythicPlusUtils.__index = MythicPlusUtils MythicPlusUtils.__index = MythicPlusUtils
@ -91,7 +95,8 @@ function MythicPlusUtils:New()
if #addedAuras > 0 then if #addedAuras > 0 then
for i = 1, #addedAuras do for i = 1, #addedAuras do
local aura = Bastion.Aura:CreateFromUnitAuraInfo(addedAuras[i]) local aura = Bastion.Aura:CreateFromUnitAuraInfo(addedAuras[i])
if not aura:IsBuff() then
if not self.loggedDebuffs[aura:GetSpell():GetID()] and not aura:IsBuff() then
WriteFile('bastion-MPlusDebuffs-' .. self.random .. '.lua', [[ WriteFile('bastion-MPlusDebuffs-' .. self.random .. '.lua', [[
AuraName: ]] .. aura:GetName() .. [[ AuraName: ]] .. aura:GetName() .. [[
AuraID: ]] .. aura:GetSpell():GetID() .. "\n" .. [[ AuraID: ]] .. aura:GetSpell():GetID() .. "\n" .. [[
@ -102,6 +107,44 @@ function MythicPlusUtils:New()
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
@ -109,6 +152,10 @@ function MythicPlusUtils:ToggleDebuffLogging()
self.debuffLogging = not self.debuffLogging self.debuffLogging = not self.debuffLogging
end end
function MythicPlusUtils:ToggleCastLogging()
self.castLogging = not self.castLogging
end
function MythicPlusUtils:CastingCriticalKick(unit, percent) function MythicPlusUtils:CastingCriticalKick(unit, percent)
local castingSpell = unit:GetCastingOrChannelingSpell() local castingSpell = unit:GetCastingOrChannelingSpell()

@ -286,12 +286,20 @@ function Unit:CanSee(unit)
local ah = ObjectHeight(self:GetOMToken()) local ah = ObjectHeight(self:GetOMToken())
local attx, atty, attz = GetUnitAttachmentPosition(unit.unit, 34) local attx, atty, attz = GetUnitAttachmentPosition(unit.unit, 34)
if not attx or not ax then
return false
end
if not ah then
return false
end
if (ax == 0 and ay == 0 and az == 0) or (attx == 0 and atty == 0 and attz == 0) then if (ax == 0 and ay == 0 and az == 0) or (attx == 0 and atty == 0 and attz == 0) then
return true return true
end end
if not attx or not ax then if not attx or not ax then
return true return false
end end
local x, y, z = TraceLine(ax, ay, az + ah, attx, atty, attz, losFlag) local x, y, z = TraceLine(ax, ay, az + ah, attx, atty, attz, losFlag)
@ -483,7 +491,7 @@ function Unit:IsFacing(unit)
local x, y, z = ObjectPosition(self:GetOMToken()) local x, y, z = ObjectPosition(self:GetOMToken())
local x2, y2, z2 = ObjectPosition(unit.unit) local x2, y2, z2 = ObjectPosition(unit.unit)
if not x or not x2 then if not x or not x2 or not rot then
return false return false
end end

@ -216,9 +216,16 @@ Command:Register('mplus', 'Toggle m+ module on/off', function(args)
return return
end end
if cmd == 'casts' then
Bastion.MythicPlusUtils:ToggleCastLogging()
Bastion:Print("Cast logging", Bastion.MythicPlusUtils.castLogging and "enabled" or "disabled")
return
end
Bastion:Print("[MythicPlusUtils] Unknown command") Bastion:Print("[MythicPlusUtils] Unknown command")
Bastion:Print("Available commands:") Bastion:Print("Available commands:")
Bastion:Print("debuffs") Bastion:Print("debuffs")
Bastion:Print("casts")
end) end)
local files = ListFiles("scripts/bastion/scripts") local files = ListFiles("scripts/bastion/scripts")

Loading…
Cancel
Save