From 85cbaffcc75492d016886d15d6e65ce372dd424b Mon Sep 17 00:00:00 2001 From: 4n0n <4n0n@tinkr.site> Date: Sat, 31 Dec 2022 14:07:58 -0500 Subject: [PATCH] Updates to resto druid rotation, add start of MythicPlusUtils --- scripts/restodruid.lua | 6 ++-- src/MythicPlusUtils/MythicPlusUtils.lua | 46 +++++++++++++++++++++++++ src/_bastion.lua | 14 ++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 src/MythicPlusUtils/MythicPlusUtils.lua diff --git a/scripts/restodruid.lua b/scripts/restodruid.lua index 5006f5a..9ef07a9 100644 --- a/scripts/restodruid.lua +++ b/scripts/restodruid.lua @@ -338,7 +338,8 @@ DefaultAPL:AddSpell( ( Player:GetAuras():FindMy(SoulOfTheForest):GetRemainingTime() <= 5 or Lowest:GetPartyHPAround(30, 90) >= 2)) or - (Lowest:GetPartyHPAround(30, 90) >= 3 or Lowest:GetPartyHPAround(30, 85) >= 2)) and not Player:IsMoving() + (Lowest:GetPartyHPAround(30, 90) >= 3 or Lowest:GetPartyHPAround(30, 85) >= 2) or + Lowest:GetHP() <= 55) and not Player:IsMoving() end):SetTarget(Lowest) ) @@ -348,7 +349,8 @@ DefaultAPL:AddSpell( and Player:CanSee(Lowest) and Lowest:GetHP() < 75 and ( NaturesSwiftness:GetTimeSinceLastCast() < 2 or Player:GetAuras():FindMy(NaturesSwiftness):IsUp() or - NaturesSwiftness:IsKnownAndUsable()) and not Player:IsMoving() + NaturesSwiftness:IsKnownAndUsable()) and not Player:IsMoving() and + not Player:GetAuras():FindMy(SoulOfTheForest):IsUp() end):SetTarget(Lowest) ) diff --git a/src/MythicPlusUtils/MythicPlusUtils.lua b/src/MythicPlusUtils/MythicPlusUtils.lua new file mode 100644 index 0000000..b3c8667 --- /dev/null +++ b/src/MythicPlusUtils/MythicPlusUtils.lua @@ -0,0 +1,46 @@ +local Tinkr, Bastion = ... + +local MythicPlusUtils = { + debuffLogging = false, + random = '' +} + +MythicPlusUtils.__index = MythicPlusUtils + +function MythicPlusUtils:New() + local self = setmetatable({}, MythicPlusUtils) + + self.random = math.random(1000000, 9999999) + + Bastion.EventManager:RegisterWoWEvent('UNIT_AURA', function(unit, auras) + local u = Bastion.UnitManager[unit] + + if not self.unit:IsUnit(unit) then + return + end + + local addedAuras = auras.addedAuras + + if #addedAuras > 0 then + for i = 1, #addedAuras do + local aura = Bastion.Aura:CreateFromUnitAuraInfo(addedAuras[i]) + if not aura:IsBuff() then + WriteFile('bastion-MPlusDebuffs-' .. self.random .. '.lua', [[ + AuraName: ]] .. aura:GetName() .. [[ + AuraID: ]] .. aura:GetID() .. [[ + ]], true) + end + end + end + end) + + return self +end + +function MythicPlusUtils:ToggleDebuffLogging() + self.debuffLogging = not self.debuffLogging +end + +function MythicPlusUtils:HasCriticalDispel(unit) + +end diff --git a/src/_bastion.lua b/src/_bastion.lua index e7d8d5f..e2c98e2 100644 --- a/src/_bastion.lua +++ b/src/_bastion.lua @@ -33,6 +33,7 @@ Bastion.AuraTable = Bastion.require("AuraTable") Bastion.Class = Bastion.require("Class") Bastion.Timer = Bastion.require("Timer") Bastion.CombatTimer = Bastion.Timer:New('combat') +Bastion.MythicPlusUtils = Bastion.require("MythicPlusUtils"):New() Bastion.modules = {} Bastion.Enabled = false @@ -142,6 +143,19 @@ Command:Register('module', 'Toggle a module on/off', function(args) end end) +Command:Register('mplus', 'Toggle m+ module on/off', function(args) + local cmd = args[2] + if cmd == 'debuffs' then + Bastion.MythicPlusUtils:ToggleDebuffLogging() + Bastion:Print("Debuff logging", Bastion.MythicPlusUtils.debuffLogging and "enabled" or "disabled") + return + end + + Bastion:Print("[MythicPlusUtils] Unknown command") + Bastion:Print("Available commands:") + Bastion:Print("debuffs") +end) + local files = ListFiles("scripts/bastion/scripts") for i = 1, #files do