Compare commits

..

No commits in common. '25e7d3973ea1460a368b0a0781df720b45055cb6' and 'e9a99ee7de535ed222edb9348db06ce50c95d01a' have entirely different histories.

  1. 1908
      scripts/outlaw.lua
  2. 559
      scripts/restodruid.lua
  3. 3203
      scripts/subtlety.lua
  4. 40
      src/APL/APL.lua
  5. 461
      src/MythicPlusUtils/MythicPlusUtils.lua
  6. 87
      src/Sequencer/Sequencer.lua
  7. 53
      src/Spell/Spell.lua
  8. 61
      src/Unit/Unit.lua
  9. 64
      src/_bastion.lua

File diff suppressed because it is too large Load Diff

@ -111,371 +111,380 @@ local RakeDebuff = Bastion.SpellBook:GetSpell(155722)
local Lowest = Bastion.UnitManager:CreateCustomUnit('lowest', function(unit) local Lowest = Bastion.UnitManager:CreateCustomUnit('lowest', function(unit)
local lowest = nil local lowest = nil
local lowestHP = math.huge local lowestHP = math.huge
Bastion.UnitManager:EnumFriends(function(unit) Bastion.UnitManager:EnumFriends(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if Player:GetDistance(unit) > 40 then
return false
end
if not Player:CanSee(unit) then
return false
end
local hp = unit:GetHP() if Player:GetDistance(unit) > 40 then
if hp < lowestHP then return false
lowest = unit end
lowestHP = hp
end
end)
if not lowest then if not Player:CanSee(unit) then
lowest = Player return false
end end
return lowest local hp = unit:GetHP()
if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end) end)
local DispelTarget = Bastion.UnitManager:CreateCustomUnit('dispel', function(unit) if not lowest then
local lowest = nil lowest = Player
local lowestHP = math.huge end
Bastion.UnitManager:EnumFriends(function(unit) return lowest
if unit:IsDead() then end)
return false
end
if not Player:CanSee(unit) then local DispelTarget = Bastion.UnitManager:CreateCustomUnit('dispel', function(unit)
return false local lowest = nil
end local lowestHP = math.huge
if Player:GetDistance(unit) > 40 then Bastion.UnitManager:EnumFriends(function(unit)
return false if unit:IsDead() then
end return false
end
if not unit:IsDead() and Player:CanSee(unit) and if not Player:CanSee(unit) then
unit:GetAuras():HasAnyDispelableAura(NaturesCure) then return false
local hp = unit:GetHP() end
if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end
end)
if lowest == nil then if Player:GetDistance(unit) > 40 then
lowest = None return false
end end
return lowest if not unit:IsDead() and Player:CanSee(unit) and
unit:GetAuras():HasAnyDispelableAura(NaturesCure) then
local hp = unit:GetHP()
if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end
end) end)
local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit) if lowest == nil then
local purge = nil lowest = None
end
Bastion.UnitManager:EnumEnemies(function(unit) return lowest
if unit:IsDead() then end)
return false
end
if not Player:CanSee(unit) then local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit)
return false local purge = nil
end
if Player:GetDistance(unit) > 40 then Bastion.UnitManager:EnumEnemies(function(unit)
return false if unit:IsDead() then
end return false
end
if not unit:IsDead() and Player:CanSee(unit) and if not Player:CanSee(unit) then
unit:GetAuras():HasAnyStealableAura() then return false
purge = unit end
return true
end
end)
if purge == nil then if Player:GetDistance(unit) > 40 then
purge = None return false
end end
return purge if not unit:IsDead() and Player:CanSee(unit) and
unit:GetAuras():HasAnyStealableAura() then
purge = unit
return true
end
end) end)
local Tank = Bastion.UnitManager:CreateCustomUnit('tank', function(unit) if purge == nil then
local tank = nil purge = None
end
Bastion.UnitManager:EnumFriends(function(unit) return purge
if Player:GetDistance(unit) > 40 then end)
return false
end
if not Player:CanSee(unit) then local Tank = Bastion.UnitManager:CreateCustomUnit('tank', function(unit)
return false local tank = nil
end
if unit:IsDead() then Bastion.UnitManager:EnumFriends(function(unit)
return false if Player:GetDistance(unit) > 40 then
end return false
end
if unit:IsTank() then if not Player:CanSee(unit) then
tank = unit return false
return true end
end
if unit:IsDead() then
return false return false
end) end
if tank == nil then if unit:IsTank() then
tank = Player tank = unit
return true
end end
return tank return false
end) end)
if tank == nil then
tank = Player
end
return tank
end)
local RejuvUnit = Bastion.UnitManager:CreateCustomUnit('rejuv', function(unit) local RejuvUnit = Bastion.UnitManager:CreateCustomUnit('rejuv', function(unit)
local lowest = nil local lowest = nil
local lowestHP = math.huge local lowestHP = math.huge
Bastion.UnitManager:EnumFriends(function(unit) Bastion.UnitManager:EnumFriends(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if not Player:CanSee(unit) then if not Player:CanSee(unit) then
return false return false
end end
if Player:GetDistance(unit) > 40 then if Player:GetDistance(unit) > 40 then
return false return false
end end
if not unit:IsDead() and Player:CanSee(unit) and if not unit:IsDead() and Player:CanSee(unit) and
( (
not unit:GetAuras():FindMy(Rejuvenation):IsUp() or not unit:GetAuras():FindMy(Rejuvenation):IsUp() or
unit:GetAuras():FindMy(Rejuvenation):GetRemainingTime() <= 3.6) then unit:GetAuras():FindMy(Rejuvenation):GetRemainingTime() <= 3.6) then
local hp = unit:GetHP()
if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end
end)
local hp = unit:GetHP()
if lowest == nil then if hp < lowestHP then
lowest = Player lowest = unit
lowestHP = hp
end
end end
return lowest
end) end)
if lowest == nil then
lowest = Player
end
return lowest
end)
local SwiftmendUnit = Bastion.UnitManager:CreateCustomUnit('swiftmend', function(unit) local SwiftmendUnit = Bastion.UnitManager:CreateCustomUnit('swiftmend', function(unit)
local lowest = nil local lowest = nil
local lowestHP = math.huge local lowestHP = math.huge
Bastion.UnitManager:EnumFriends(function(unit) Bastion.UnitManager:EnumFriends(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if not Player:CanSee(unit) then if not Player:CanSee(unit) then
return false return false
end end
if Player:GetDistance(unit) > 40 then if Player:GetDistance(unit) > 40 then
return false return false
end end
if ( if (
Player:CanSee(unit) and ( Player:CanSee(unit) and (
(unit:GetAuras():FindMy(Regrowth):IsUp()) (unit:GetAuras():FindMy(Regrowth):IsUp())
or or
( (
unit:GetAuras():FindMy(Rejuvenation):IsUp() and unit:GetAuras():FindMy(Rejuvenation):IsUp() and
not unit:GetAuras():FindMy(WildGrowth):IsUp()) not unit:GetAuras():FindMy(WildGrowth):IsUp())
) )
) then ) then
local hp = unit:GetHP()
if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end
end)
if lowest == nil then local hp = unit:GetHP()
lowest = None if hp < lowestHP then
lowest = unit
lowestHP = hp
end
end end
return lowest
end) end)
if lowest == nil then
lowest = None
end
return lowest
end)
local WildGrowthUnit = Bastion.UnitManager:CreateCustomUnit('wildgrowth', function(unit) local WildGrowthUnit = Bastion.UnitManager:CreateCustomUnit('wildgrowth', function(unit)
local lowest = nil local lowest = nil
local lowestHP = math.huge local lowestHP = math.huge
Bastion.UnitManager:EnumFriends(function(unit) Bastion.UnitManager:EnumFriends(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if not Player:CanSee(unit) then if not Player:CanSee(unit) then
return false return false
end end
if Player:GetDistance(unit) > 40 then if Player:GetDistance(unit) > 40 then
return false return false
end end
if Player:CanSee(unit) and ( if Player:CanSee(unit) and (
( (
Player:GetAuras():FindMy(SoulOfTheForest):IsUp() and Player:GetAuras():FindMy(SoulOfTheForest):IsUp() and
( (
Player:GetAuras():FindMy(SoulOfTheForest):GetRemainingTime() <= 5 or Player:GetAuras():FindMy(SoulOfTheForest):GetRemainingTime() <= 5 or
unit:GetPartyHPAround(30, 90) >= 2)) or unit:GetPartyHPAround(30, 90) >= 2)) or
(unit:GetPartyHPAround(30, 90) >= 3 or unit:GetPartyHPAround(30, 85) >= 2)) (unit:GetPartyHPAround(30, 90) >= 3 or unit:GetPartyHPAround(30, 85) >= 2))
then then
local hp = unit:GetHP() local hp = unit:GetHP()
if hp < lowestHP then if hp < lowestHP then
lowest = unit lowest = unit
lowestHP = hp lowestHP = hp
end
end end
end)
if lowest == nil then
lowest = None
end end
return lowest
end) end)
local Explosive = Bastion.UnitManager:CreateCustomUnit('explosive', function(unit)
local explosive = nil
Bastion.ObjectManager.explosives:each(function(unit) if lowest == nil then
if unit:IsDead() then lowest = None
return false end
end
if not Player:CanSee(unit) then return lowest
return false end)
end
if Player:GetDistance(unit) <= 40 then local Explosive = Bastion.UnitManager:CreateCustomUnit('explosive', function(unit)
explosive = unit local explosive = nil
return true
end
end)
if explosive == nil then Bastion.ObjectManager.explosives:each(function(unit)
explosive = None if unit:IsDead() then
return false
end end
return explosive if not Player:CanSee(unit) then
return false
end
if Player:GetDistance(unit) <= 40 then
explosive = unit
return true
end
end) end)
local RakeTarget = Bastion.UnitManager:CreateCustomUnit('rake', function(unit) if explosive == nil then
local rakeTarget = nil explosive = None
end
Bastion.UnitManager:EnumEnemies(function(unit) return explosive
if unit:IsDead() then end)
return false
end
if not Player:CanSee(unit) then local RakeTarget = Bastion.UnitManager:CreateCustomUnit('rake', function(unit)
return false local rakeTarget = nil
end
if Player:GetDistance(unit) > 40 then Bastion.UnitManager:EnumEnemies(function(unit)
return false if unit:IsDead() then
end return false
end
if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and unit:InMelee(Player) and if not Player:CanSee(unit) then
Player:IsFacing(unit) and return false
( end
not unit:GetAuras():FindMy(RakeDebuff):IsUp() or
unit:GetAuras():FindMy(RakeDebuff):GetRemainingTime() <= 3.6) then
rakeTarget = unit
end
end)
if Player:GetDistance(unit) > 40 then
return false
end
if rakeTarget == nil then if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and unit:InMelee(Player) and
rakeTarget = None Player:IsFacing(unit) and
(
not unit:GetAuras():FindMy(RakeDebuff):IsUp() or
unit:GetAuras():FindMy(RakeDebuff):GetRemainingTime() <= 3.6) then
rakeTarget = unit
end end
return rakeTarget
end) end)
if rakeTarget == nil then
rakeTarget = None
end
return rakeTarget
end)
local MoonfireTarget = Bastion.UnitManager:CreateCustomUnit('moonfire', function(unit) local MoonfireTarget = Bastion.UnitManager:CreateCustomUnit('moonfire', function(unit)
local moonfireTarget = nil local moonfireTarget = nil
Bastion.UnitManager:EnumEnemies(function(unit) Bastion.UnitManager:EnumEnemies(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if not Player:CanSee(unit) then if not Player:CanSee(unit) then
return false return false
end end
if Player:GetDistance(unit) > 40 then if Player:GetDistance(unit) > 40 then
return false return false
end end
if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and
( (
not unit:GetAuras():FindMy(MoonfireAura):IsUp() or not unit:GetAuras():FindMy(MoonfireAura):IsUp() or
unit:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 3.6) then unit:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 3.6) then
moonfireTarget = unit moonfireTarget = unit
end
end)
if moonfireTarget == nil then
moonfireTarget = None
end end
return moonfireTarget
end) end)
if moonfireTarget == nil then
moonfireTarget = None
end
return moonfireTarget
end)
local SunfireTarget = Bastion.UnitManager:CreateCustomUnit('sunfire', function(unit) local SunfireTarget = Bastion.UnitManager:CreateCustomUnit('sunfire', function(unit)
local sunfireTarget = nil local sunfireTarget = nil
Bastion.UnitManager:EnumEnemies(function(unit) Bastion.UnitManager:EnumEnemies(function(unit)
if unit:IsDead() then if unit:IsDead() then
return false return false
end end
if not Player:CanSee(unit) then if not Player:CanSee(unit) then
return false return false
end end
if Player:GetDistance(unit) > 40 then if Player:GetDistance(unit) > 40 then
return false return false
end end
if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and if not unit:IsDead() and Player:CanSee(unit) and unit:InCombatOdds() > 80 and
( (
not unit:GetAuras():FindMy(SunfireAura):IsUp() or not unit:GetAuras():FindMy(SunfireAura):IsUp() or
unit:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 3.6) then unit:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 3.6) then
sunfireTarget = unit sunfireTarget = unit
end
end)
if sunfireTarget == nil then
sunfireTarget = None
end end
return sunfireTarget
end) end)
if sunfireTarget == nil then
sunfireTarget = None
end
return sunfireTarget
end)
local RestoCommands = Bastion.Command:New('resto') local RestoCommands = Bastion.Command:New('resto')
local PLACE_EFFLO = false local PLACE_EFFLO = false
@ -493,7 +502,7 @@ DamageAPL:AddSpell(
return RakeTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() and return RakeTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() and
( (
not RakeTarget:GetAuras():FindMy(RakeDebuff):IsUp() or not RakeTarget:GetAuras():FindMy(RakeDebuff):IsUp() or
RakeTarget:GetAuras():FindMy(RakeDebuff):GetRemainingTime() <= 3.6) RakeTarget:GetAuras():FindMy(RakeDebuff):GetRemainingTime() <= 3.6)
end):SetTarget(RakeTarget) end):SetTarget(RakeTarget)
) )
@ -511,6 +520,11 @@ DamageAPL:AddSpell(
end):SetTarget(Target) end):SetTarget(Target)
) )
DefaultAPL:AddSpell(
Moonfire:CastableIf(function(self)
return Explosive:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling()
end):SetTarget(Explosive)
)
DefaultAPL:AddSpell( DefaultAPL:AddSpell(
Efflorescence:CastableIf(function(self) Efflorescence:CastableIf(function(self)
@ -531,7 +545,7 @@ end)
DefaultAPL:AddAction( DefaultAPL:AddAction(
'cat_form_shift', 'cat_form_shift',
function() function()
if (IsShiftKeyDown()) and not Player:IsMounted() and if (IsShiftKeyDown() or not Player:IsAffectingCombat()) and not Player:IsMounted() and
not Player:GetAuras():FindMy(CatForm):IsUp() and not Player:GetAuras():FindMy(CatForm):IsUp() and
not Player:IsCastingOrChanneling() then not Player:IsCastingOrChanneling() then
CatForm:Cast(Player) CatForm:Cast(Player)
@ -599,9 +613,9 @@ DefaultAPL:AddSpell(
and Player:CanSee(SwiftmendUnit) and and Player:CanSee(SwiftmendUnit) and
( (
SwiftmendUnit:GetHP() <= 60 or SwiftmendUnit:GetHP() <= 60 or
( (
Lowest:GetPartyHPAround(30, 90) >= 3 or Lowest:GetPartyHPAround(30, 85) >= 2 Lowest:GetPartyHPAround(30, 90) >= 3 or Lowest:GetPartyHPAround(30, 85) >= 2
) )
) )
end):SetTarget(SwiftmendUnit) end):SetTarget(SwiftmendUnit)
) )
@ -612,8 +626,8 @@ DefaultAPL:AddSpell(
and Player:CanSee(WildGrowthUnit) and and Player:CanSee(WildGrowthUnit) and
( (
Player:GetAuras():FindMy(SoulOfTheForest):IsUp() Player:GetAuras():FindMy(SoulOfTheForest):IsUp()
or or
(WildGrowthUnit:GetPartyHPAround(30, 90) >= 3 or WildGrowthUnit:GetPartyHPAround(30, 85) >= 2) (WildGrowthUnit:GetPartyHPAround(30, 90) >= 3 or WildGrowthUnit:GetPartyHPAround(30, 85) >= 2)
) and ) and
not Player:IsMoving() not Player:IsMoving()
end):SetTarget(WildGrowthUnit) end):SetTarget(WildGrowthUnit)
@ -633,7 +647,7 @@ DefaultAPL:AddSpell(
and Player:CanSee(Lowest) and Lowest:GetHP() < 70 and and Player:CanSee(Lowest) and Lowest:GetHP() < 70 and
( (
NaturesSwiftness:GetTimeSinceLastCast() < 2 or Player:GetAuras():FindMy(NaturesSwiftness):IsUp() or NaturesSwiftness:GetTimeSinceLastCast() < 2 or Player:GetAuras():FindMy(NaturesSwiftness):IsUp() or
NaturesSwiftness:IsKnownAndUsable()) and not Player:IsMoving() and NaturesSwiftness:IsKnownAndUsable()) and not Player:IsMoving() and
not Player:GetAuras():FindMy(SoulOfTheForest):IsUp() not Player:GetAuras():FindMy(SoulOfTheForest):IsUp()
end):SetTarget(Lowest) end):SetTarget(Lowest)
) )
@ -666,7 +680,7 @@ DefaultAPL:AddSpell(
and and
( (
not Player:GetAuras():FindMy(LifebloomAura):IsUp() or not Player:GetAuras():FindMy(LifebloomAura):IsUp() or
Player:GetAuras():FindMy(LifebloomAura):GetRemainingTime() <= 4.5) and Player:IsAffectingCombat() Player:GetAuras():FindMy(LifebloomAura):GetRemainingTime() <= 4.5) and Player:IsAffectingCombat()
end):SetTarget(Player) end):SetTarget(Player)
) )
@ -676,7 +690,7 @@ DefaultAPL:AddSpell(
and and
( (
not Tank:GetAuras():FindMy(LifebloomAura):IsUp() or not Tank:GetAuras():FindMy(LifebloomAura):IsUp() or
Tank:GetAuras():FindMy(LifebloomAura):GetRemainingTime() <= 4.5) and Tank:IsAffectingCombat() Tank:GetAuras():FindMy(LifebloomAura):GetRemainingTime() <= 4.5) and Tank:IsAffectingCombat()
end):SetTarget(Tank) end):SetTarget(Tank)
) )
@ -686,7 +700,7 @@ DefaultAPL:AddSpell(
and Player:CanSee(Lowest) and and Player:CanSee(Lowest) and
( (
not Player:GetAuras():FindMy(Regrowth):IsUp() and Lowest:GetHP() < 70 or not Player:GetAuras():FindMy(Regrowth):IsUp() and Lowest:GetHP() < 70 or
(Lowest:GetHP() <= 85 and Player:GetAuras():FindMy(ClearCasting):IsUp())) and (Lowest:GetHP() <= 85 and Player:GetAuras():FindMy(ClearCasting):IsUp())) and
not Player:GetAuras():FindMy(SoulOfTheForest):IsUp() and not Player:GetAuras():FindMy(SoulOfTheForest):IsUp() and
not Player:IsMoving() not Player:IsMoving()
end):SetTarget(Lowest) end):SetTarget(Lowest)
@ -700,20 +714,13 @@ DefaultAPL:AddSpell(
end):SetTarget(RejuvUnit) end):SetTarget(RejuvUnit)
) )
DefaultAPL:AddSpell(
Moonfire:CastableIf(function(self)
return Explosive:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling()
end):SetTarget(Explosive)
)
DefaultAPL:AddSpell( DefaultAPL:AddSpell(
Sunfire:CastableIf(function(self) Sunfire:CastableIf(function(self)
return SunfireTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() return SunfireTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling()
and Player:CanSee(SunfireTarget) and and Player:CanSee(SunfireTarget) and
( (
not SunfireTarget:GetAuras():FindMy(SunfireAura):IsUp() or not SunfireTarget:GetAuras():FindMy(SunfireAura):IsUp() or
SunfireTarget:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 5.4) and SunfireTarget:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 5.4) and
SunfireTarget:IsHostile() and SunfireTarget:IsHostile() and
SunfireTarget:IsAffectingCombat() and Player:GetPP() >= 25 SunfireTarget:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(SunfireTarget) end):SetTarget(SunfireTarget)
@ -725,7 +732,7 @@ DefaultAPL:AddSpell(
and Player:CanSee(MoonfireTarget) and and Player:CanSee(MoonfireTarget) and
( (
not MoonfireTarget:GetAuras():FindMy(MoonfireAura):IsUp() or not MoonfireTarget:GetAuras():FindMy(MoonfireAura):IsUp() or
MoonfireTarget:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 5.4) and MoonfireTarget:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 5.4) and
MoonfireTarget:IsHostile() and MoonfireTarget:IsHostile() and
MoonfireTarget:IsAffectingCombat() and Player:GetPP() >= 25 MoonfireTarget:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(MoonfireTarget) end):SetTarget(MoonfireTarget)

File diff suppressed because it is too large Load Diff

@ -82,25 +82,6 @@ end
-- Execute -- Execute
function APLActor:Execute() function APLActor:Execute()
-- If the actor is a sequencer we don't want to continue executing the APL if the sequencer is not finished
if self:GetActor().sequencer then
if self:GetActor().condition and self:GetActor().condition() and not self:GetActor().sequencer:Finished() then
print("Execute?")
self:GetActor().sequencer:Execute()
return true
end
if not self:GetActor().condition and not self:GetActor().sequencer:Finished() then
print("Execute?")
self:GetActor().sequencer:Execute()
return true
end
-- Check if the sequencer can be reset and reset it if it can
if self:GetActor().sequencer:ShouldReset() then
self:GetActor().sequencer:Reset()
end
end
if self:GetActor().apl then if self:GetActor().apl then
if self:GetActor().condition and self:GetActor().condition() then if self:GetActor().condition and self:GetActor().condition() then
-- print("Bastion: APL:Execute: Executing sub APL " .. self:GetActor().apl.name) -- print("Bastion: APL:Execute: Executing sub APL " .. self:GetActor().apl.name)
@ -135,7 +116,6 @@ function APLActor:Execute()
-- print("Bastion: APL:Execute: Setting variable " .. self:GetActor().variable) -- print("Bastion: APL:Execute: Setting variable " .. self:GetActor().variable)
self:GetActor()._apl.variables[self:GetActor().variable] = self:GetActor().cb(self:GetActor()._apl) self:GetActor()._apl.variables[self:GetActor().variable] = self:GetActor().cb(self:GetActor()._apl)
end end
return false
end end
-- has traits -- has traits
@ -249,29 +229,13 @@ end
function APL:Execute() function APL:Execute()
for _, actor in ipairs(self.apl) do for _, actor in ipairs(self.apl) do
if actor:HasTraits() and actor:Evaluate() then if actor:HasTraits() and actor:Evaluate() then
if actor:Execute() then actor:Execute()
print("BREAQK", actor)
break
end
else else
if actor:Execute() then actor:Execute()
print("BREAQK", actor)
break
end
end end
end end
end end
-- Add a Sequencer to the APL
---@param sequencer Sequencer
---@param condition fun(...):boolean
---@return APLActor
function APL:AddSequence(sequencer, condition)
local actor = APLActor:New({ sequencer = sequencer, condition = condition })
table.insert(self.apl, actor)
return actor
end
-- tostring -- tostring
---@return string ---@return string
function APL:__tostring() function APL:__tostring()

@ -18,365 +18,79 @@ function MythicPlusUtils:New()
self.random = math.random(1000000, 9999999) self.random = math.random(1000000, 9999999)
self.kickList = { self.kickList = {
-- Ruby life pools -- Algeth'ar Academy
[372735] = { -- Techtonic Slam [396812] = { true, true }, -- https://www.wowhead.com/spell=396812/mystic-blast
[187969] = { [388392] = { true, true }, -- https://www.wowhead.com/spell=388392/monotonous-lecture
false, true, true -- Kick, Stun, Disorient [388863] = { true, true }, -- https://www.wowhead.com/spell=388863/mana-void
} [388862] = { true, true }, -- https://www.wowhead.com/spell=388862/surge
}, [377389] = { true, true }, -- https://www.wowhead.com/spell=377389/call-of-the-flock
[384933] = { -- Ice Shield [388623] = { true, true }, -- https://www.wowhead.com/spell=388623/branch-out
[188067] = { [396640] = { true, true }, -- https://www.wowhead.com/spell=396640/healing-touch
true, true, true [387975] = { true, true }, -- https://www.wowhead.com/spell=387975/arcane-missiles
} [387843] = { true, true }, -- https://www.wowhead.com/spell=387843/astral-bomb
}, -- Court of Stars
[372749] = { -- Ice Shield [211401] = { true, true }, -- https://www.wowhead.com/spell=211401/drifting-embers
[188067] = { [207980] = { true, true }, -- https://www.wowhead.com/spell=207980/disintegration-beam
true, true, true [208165] = { true, true }, -- https://www.wowhead.com/spell=208165/withering-soul
} [207881] = { true, true }, -- https://www.wowhead.com/spell=207881/infernal-eruption
}, [209413] = { true, false }, -- https://www.wowhead.com/spell=209413/suppress
[372743] = { -- Ice Shield [209485] = { true, true }, -- https://www.wowhead.com/spell=209485/drain-magic
[188067] = { [209410] = { true, true }, -- https://www.wowhead.com/spell=209410/nightfall-orb
true, true, true [211470] = { true, true }, -- https://www.wowhead.com/spell=211470/bewitch
} [225100] = { true, false }, -- https://www.wowhead.com/spell=225100/charging-station
}, [211299] = { true, false }, -- https://www.wowhead.com/spell=211299/searing-glare
[371984] = { -- Halls of Valor
[188067] = { [198595] = { true, true }, -- https://www.wowhead.com/spell=198595/thunderous-bolt
true, true, true [198959] = { true, true }, -- https://www.wowhead.com/spell=198959/etch
} [215433] = { true, true }, -- https://www.wowhead.com/spell=215433/holy-radiance
}, [192288] = { true, true }, -- https://www.wowhead.com/spell=192288/searing-light
[373680] = { [199726] = { true, true }, -- https://www.wowhead.com/spell=199726/unruly-yell
[188252] = { [198750] = { true, true }, -- https://www.wowhead.com/spell=198750/surge
true, false, false [198934] = { true, true }, -- https://www.wowhead.com/spell=198934/rune-of-healing
} [192563] = { true, true }, -- https://www.wowhead.com/spell=192563/cleansing-flames
}, -- Ruby Life Pools
[373688] = { [372749] = { true, true }, -- https://www.wowhead.com/spell=372749/ice-shield
[188252] = { -- [373803] = { true, true }, -- https://www.wowhead.com/spell=373803/cold-claws
true, false, false [373017] = { true, true }, -- https://www.wowhead.com/spell=373017/roaring-blaze
} [392398] = { true, true }, -- https://www.wowhead.com/spell=392398/crackling-detonation
}, [392451] = { true, true }, -- https://www.wowhead.com/spell=392451/flashfire
[385310] = { [385310] = { true, true }, -- https://www.wowhead.com/spell=385310/lightning-bolt
[195119] = { [384194] = { true, true }, -- https://www.wowhead.com/spell=384194/cinderbolt
true, false, false [373680] = { true, false }, -- https://www.wowhead.com/spell=373680/frost-overload
} -- Shadowmoon Burial Grounds
}, [152818] = { true, true }, -- https://www.wowhead.com/spell=152818/shadow-mend
[384194] = { [156776] = { true, true }, -- https://www.wowhead.com/spell=156776/rending-voidlash
[190207] = { [156722] = { true, true }, -- https://www.wowhead.com/spell=156722/void-bolt
true, true, true [398206] = { true, true }, -- https://www.wowhead.com/spell=398206/death-blast
} [153524] = { true, true }, -- https://www.wowhead.com/spell=153524/plague-spit
}, [156718] = { true, true }, -- https://www.wowhead.com/spell=156718/necrotic-burst
[384197] = { -- Temple of the Jade Serpent
[190207] = { [397888] = { true, false }, -- https://www.wowhead.com/spell=397888/hydrolance
true, true, true [395859] = { true, true }, -- https://www.wowhead.com/spell=395859/haunting-scream
} [396073] = { true, true }, -- https://www.wowhead.com/spell=396073/cat-nap
}, [397914] = { true, true }, -- https://www.wowhead.com/spell=397914/defiling-mist
[373017] = { [397899] = { false, true }, -- https://www.wowhead.com/spell=397899/leg-sweep
[189886] = { [397801] = { true, false }, -- https://www.wowhead.com/spell=397801/hydrolance
true, false, false [395872] = { true, true }, -- https://www.wowhead.com/spell=395872/sleepy-soliloquy
} -- The Azure Vault
}, [375602] = { true, true }, -- https://www.wowhead.com/spell=375602/erratic-growth
[392576] = { [387564] = { true, true }, -- https://www.wowhead.com/spell=387564/mystic-vapors
[198047] = { [373932] = { true, true }, -- https://www.wowhead.com/spell=373932/illusionary-bolt
true, false, false [386546] = { true, true }, -- https://www.wowhead.com/spell=386546/waking-bane
} [389804] = { true, true }, -- https://www.wowhead.com/spell=389804/heavy-tome
}, [377488] = { true, true }, -- https://www.wowhead.com/spell=377488/icy-bindings
[392451] = { [377503] = { true, true }, -- https://www.wowhead.com/spell=377503/condensed-frost
[197985] = { [375596] = { true, true }, -- https://www.wowhead.com/spell=375596/erratic-growth
true, true, false, -- NO
} [384365] = { true, true }, -- https://www.wowhead.com/spell=384365/disruptive-shout
}, [386012] = { true, false }, -- https://www.wowhead.com/spell=386012/stormbolt
[392452] = { [386024] = { true, true }, -- https://www.wowhead.com/spell=386024/tempest
[197985] = { [387411] = { true, true }, -- https://www.wowhead.com/spell=387411/death-bolt-volley
true, true, false, [387606] = { true, true }, -- https://www.wowhead.com/spell=387606/dominate
} [373395] = { true, true }, -- https://www.wowhead.com/spell=373395/bloodcurdling-shout
}, [376725] = { true, true }, -- https://www.wowhead.com/spell=376725/storm-bolt
-- Nokhud [384808] = { true, true }, -- https://www.wowhead.com/spell=384808/guardian-wind
[383823] = { -- [363607] = {true, true}, -- https://www.wowhead.com/spell=363607/domination-bolt
[192796] = {
false, true, true
}
},
[384492] = {
[192794] = {
false, true, true
}
},
[384365] = {
[192800] = {
true, false, false
},
[191847] = {
true, false, false
}
},
[386012] = {
[194317] = {
true, false, false
},
[195265] = {
true, false, false
},
[194315] = {
true, false, false
},
[194316] = {
true, false, 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] = {
[195878] = {
false, true, true
}
},
[373395] = {
[199717] = {
true, false, false
}
},
[376725] = {
[190294] = {
true, true, true
},
},
[370764] = {
[187160] = {
false, true, true
},
[196116] = {
false, true, true
},
},
[387564] = {
[196102] = {
true, true, true
}
},
[375596] = {
[196115] = {
true, false, false
},
[191164] = {
true, false, false
},
},
[386549] = {
[186741] = {
true, true, true
}
},
[386546] = {
[186741] = {
true, true, true
}
},
[389804] = {
[187154] = {
true, false, false
}
},
[377488] = {
[187155] = {
true, true, true
}
},
[377105] = {
[190510] = {
false, true, true
}
},
[373932] = {
[190187] = {
true, false, false
}
},
-- AA
[387910] = {
[196200] = {
false, true, true
}
},
[387975] = {
[196202] = {
true, true, true
}
},
[388863] = {
[196045] = {
true, true, true
}
},
[388392] = {
[196044] = {
true, true, true
}
},
[396812] = {
[196576] = {
true, true, true
}
},
[377389] = {
[192333] = {
true, false, false
}
},
[397888] = {
[200126] = {
true, true, true
}
},
[397801] = {
[56448] = {
true, false, false
}
},
[395859] = {
[59555] = {
true, true, true
}
},
[395872] = {
[59546] = {
true, false, false
}
},
[396018] = {
[59552] = {
true, false, false
}
},
[396073] = {
[59544] = {
true, true, false
}
},
[397899] = {
[200131] = {
false, true, true
}
},
[397914] = {
[200137] = {
true, true, true
}
},
-- sbg
[152818] = {
[75713] = {
true, true, false
}
},
[398154] = {
[75451] = {
false, true, true
}
},
[156776] = {
[76446] = {
true, true, true
}
},
[156772] = {
[77700] = {
true, false, false
}
},
[153524] = {
[75459] = {
true, true, true
}
},
[156718] = {
[76104] = {
true, false, false
}
},
[225100] = {
[104270] = {
true, false, false
}
},
[210261] = {
[104251] = {
true, true, true
}
},
[209027] = {
[104246] = {
false, true, true
}
},
[212031] = {
[105705] = {
false, true, false
}
},
[212784] = {
[105715] = {
false, true, false
}
},
[198585] = {
[95842] = {
true, true, true
}
},
[198959] = {
[96664] = {
true, true, true
}
},
[215433] = {
[95834] = {
true, true, true
}
},
[199210] = {
[96640] = {
false, true, true
}
},
[199090] = {
[96611] = {
false, true, true
}
},
[185425] = {
[96677] = {
false, true, false
}
},
} }
Bastion.EventManager:RegisterWoWEvent('UNIT_AURA', function(unit, auras) Bastion.EventManager:RegisterWoWEvent('UNIT_AURA', function(unit, auras)
@ -461,18 +175,7 @@ function MythicPlusUtils:CastingCriticalKick(unit, percent)
if castingSpell then if castingSpell then
local spellID = castingSpell:GetID() local spellID = castingSpell:GetID()
local kickEntry = self.kickList[spellID] local isKick = unpack(self.kickList[spellID] or { false, false })
if not kickEntry then
return false
end
local npcTraits = kickEntry[unit:GetID()]
if not npcTraits then
return false
end
local isKick, isStun, isDisorient = unpack(npcTraits)
if isKick and unit:IsInterruptibleAt(percent) then if isKick and unit:IsInterruptibleAt(percent) then
return true return true
@ -490,20 +193,8 @@ function MythicPlusUtils:CastingCriticalStun(unit, percent)
if castingSpell then if castingSpell then
local spellID = castingSpell:GetID() local spellID = castingSpell:GetID()
local kickEntry = self.kickList[spellID] local _, isStun = unpack(self.kickList[spellID] or { false, false })
if not kickEntry then if isStun and unit:IsInterruptibleAt(percent, true) then
return false
end
local npcTraits = kickEntry[unit:GetID()]
if not npcTraits then
return false
end
local isKick, isStun, isDisorient = unpack(npcTraits)
if (isStun or isDisorient) and not isKick and unit:IsInterruptibleAt(percent, true) then
return true return true
end end
end end

@ -1,87 +0,0 @@
-- Create a sequencer class that takes a table of actions and executes them in order
---@class Sequencer
local Sequencer = {}
Sequencer.__index = Sequencer
-- Constructor
---@param actions table
---@return Sequencer
function Sequencer:New(actions, resetCondition)
local self = setmetatable({}, Sequencer)
self.actions = actions
self.index = 1
self.resetCondition = resetCondition
return self
end
-- Should we reset the sequencer
---@return boolean
function Sequencer:ShouldReset()
if self.resetCondition then
return self.resetCondition()
end
return false
end
-- Should we abort the sequencer
---@return boolean
function Sequencer:ShouldAbort()
if self.abortCondition then
return self.abortCondition()
end
return false
end
-- Execute the next action in the sequence if it doesn't return true we need to try it again
---@return boolean
function Sequencer:Next()
if self:Finished() then
print("Its finished?")
return false
end
local action = self.actions[self.index]
print("Attempting action: " .. self.index .. "")
if action(self) then
self.index = self.index + 1
return true
end
return false
end
-- Reset the sequencer
---@return nil
function Sequencer:Reset()
self.index = 1
end
function Sequencer:Execute()
if self:Next() then
return true
end
return false
end
function Sequencer:Finished()
return self.index > #self.actions
end
function Sequencer:Abort()
self.index = #self.actions + 1
end
-- tostring
---@return string
function Sequencer:__tostring()
return "Bastion.__Sequencer"
end
return Sequencer

@ -7,9 +7,9 @@ local Spell = {
PreCastFunc = false, PreCastFunc = false,
OnCastFunc = false, OnCastFunc = false,
PostCastFunc = false, PostCastFunc = false,
lastCastAttempt = false, lastCastAttempt = 0,
wasLooking = false, wasLooking = false,
lastCastAt = false, lastCastAt = 0,
conditions = {}, conditions = {},
target = false, target = false,
} }
@ -119,13 +119,6 @@ function Spell:OnCooldown()
return self:GetCooldownRemaining() > 0 return self:GetCooldownRemaining() > 0
end end
-- Clear castable function
---@return Spell
function Spell:ClearCastableFunction()
self.CastableIfFunc = false
return self
end
-- Cast the spell -- Cast the spell
---@param unit Unit ---@param unit Unit
---@param condition string ---@param condition string
@ -170,42 +163,6 @@ function Spell:Cast(unit, condition)
return true return true
end end
-- ForceCast the spell
---@param unit Unit
---@param condition string
---@return boolean
function Spell:ForceCast(unit)
-- Call pre cast function
-- if self:GetPreCastFunction() then
-- self:GetPreCastFunction()(self)
-- end
-- Check if the mouse was looking
self.wasLooking = IsMouselooking()
-- if unit:GetOMToken() contains 'nameplate' then we need to use Object wrapper to cast
local u = unit:GetOMToken()
if type(u) == "string" and string.find(u, 'nameplate') then
u = Object(u)
end
-- Cast the spell
CastSpellByName(self:GetName(), u)
SpellCancelQueuedSpell()
Bastion:Debug("Casting", self)
-- Set the last cast time
self.lastCastAttempt = GetTime()
-- -- Call post cast function
-- if self:GetOnCastFunction() then
-- self:GetOnCastFunction()(self)
-- end
return true
end
-- Get post cast func -- Get post cast func
---@return fun(self:Spell) ---@return fun(self:Spell)
function Spell:GetPostCastFunction() function Spell:GetPostCastFunction()
@ -230,7 +187,7 @@ end
---@return boolean ---@return boolean
function Spell:IsUsable() function Spell:IsUsable()
local usable, noMana = IsUsableSpell(self:GetID()) local usable, noMana = IsUsableSpell(self:GetID())
return usable or usableExcludes[self:GetID()] and not noMana return usable or usableExcludes[self:GetID()]
end end
-- Check if the spell is castable -- Check if the spell is castable
@ -364,10 +321,6 @@ function Spell:GetCharges()
return GetSpellCharges(self:GetID()) return GetSpellCharges(self:GetID())
end end
function Spell:GetMaxCharges()
return select(2, GetSpellCharges(self:GetID()))
end
-- Get the spells charges -- Get the spells charges
---@return number ---@return number
function Spell:GetChargesFractional() function Spell:GetChargesFractional()

@ -13,9 +13,6 @@ local Unit = {
last_off_attack = 0, last_off_attack = 0,
last_main_attack = 0, last_main_attack = 0,
last_combat_time = 0, last_combat_time = 0,
ttd_ticker = 0,
ttd = 0,
id = false,
} }
function Unit:__index(k) function Unit:__index(k)
@ -452,7 +449,6 @@ end
-- Check if unit is interruptible -- Check if unit is interruptible
---@param percent number ---@param percent number
---@param ignoreInterruptible boolean
---@return boolean ---@return boolean
function Unit:IsInterruptibleAt(percent, ignoreInterruptible) function Unit:IsInterruptibleAt(percent, ignoreInterruptible)
if not ignoreInterruptible and not self:IsInterruptible() then if not ignoreInterruptible and not self:IsInterruptible() then
@ -630,13 +626,6 @@ function Unit:IsBehind(unit)
return math.abs(angle) > 90 return math.abs(angle) > 90
end end
-- IsInfront
---@param unit Unit
---@return boolean
function Unit:IsInfront(unit)
return not self:IsBehind(unit)
end
---@return number ---@return number
function Unit:GetMeleeBoost() function Unit:GetMeleeBoost()
if IsPlayerSpell(196924) then if IsPlayerSpell(196924) then
@ -680,9 +669,7 @@ end
-- Get object id -- Get object id
---@return number ---@return number
function Unit:GetID() function Unit:GetID()
if self.id then return self.id end return ObjectID(self:GetOMToken())
self.id = ObjectID(self:GetOMToken())
return self.id
end end
-- In party -- In party
@ -727,7 +714,7 @@ function Unit:PredictHealth(time)
local x = {} local x = {}
local y = {} local y = {}
if #self.regression_history > 60 then if #self.regression_history > 20 then
table.remove(self.regression_history, 1) table.remove(self.regression_history, 1)
end end
@ -750,7 +737,7 @@ function Unit:PredictTime(percent)
local x = {} local x = {}
local y = {} local y = {}
if #self.regression_history > 60 then if #self.regression_history > 20 then
table.remove(self.regression_history, 1) table.remove(self.regression_history, 1)
end end
@ -766,50 +753,21 @@ function Unit:PredictTime(percent)
return (percent - intercept) / slope return (percent - intercept) / slope
end end
-- Start time to die ticker
function Unit:StartTTDTicker()
if self.ttd_ticker then
return
end
self.ttd_ticker = C_Timer.NewTicker(0.5, function()
local timeto = self:PredictTime(0) - GetTime()
self.ttd = timeto
end)
end
-- Time until death -- Time until death
---@return number ---@return number
function Unit:TimeToDie() function Unit:TimeToDie()
if self:IsDead() then if self:IsDead() then
self.regression_history = {} self.regression_history = {}
if self.ttd_ticker then
self.ttd_ticker:Cancel()
self.ttd_ticker = nil
end
return 0
end
if not self.ttd_ticker then
self:StartTTDTicker()
end
-- If there's not enough data to make a prediction return 0 unless the unit has more than 5 million health
if #self.regression_history < 5 and self:GetMaxHealth() < 5000000 then
return 0 return 0
end end
-- if the unit has more than 5 million health but there's not enough data to make a prediction we can assume there's roughly 250000 damage per second and estimate the time to die local timeto = self:PredictTime(0) - GetTime()
if #self.regression_history < 5 and self:GetMaxHealth() > 5000000 then
return self:GetMaxHealth() /
250000 -- 250000 is an estimate of the average damage per second a well geared group will average
end
if self.ttd ~= self.ttd or self.ttd < 0 or self.ttd == math.huge then if timeto ~= timeto or timeto < 0 or timeto == math.huge then
return 0 return 0
end end
return self.ttd return timeto
end end
-- Set combat time if affecting combat and return the difference between now and the last time -- Set combat time if affecting combat and return the difference between now and the last time
@ -862,12 +820,7 @@ function Unit:GetMaxGCD()
haste = 50 haste = 50
end end
-- if the unit uses focus their gcd is 1.0 seconds not 1.5 return 1.5 / (1 + haste / 100)
local base = 1.5
if self:GetPowerType() == 3 then
base = 1.0
end
return base / (1 + haste / 100)
end end
-- IsStealthed -- IsStealthed

@ -18,8 +18,6 @@ Bastion.List = Bastion.require("List")
Bastion.NotificationsList, Bastion.Notification = Bastion.require("NotificationsList") Bastion.NotificationsList, Bastion.Notification = Bastion.require("NotificationsList")
---@type Vector3 ---@type Vector3
Bastion.Vector3 = Bastion.require("Vector3") Bastion.Vector3 = Bastion.require("Vector3")
---@type Sequencer
Bastion.Sequencer = Bastion.require("Sequencer")
---@type Command ---@type Command
Bastion.Command = Bastion.require("Command") Bastion.Command = Bastion.require("Command")
---@type Cache ---@type Cache
@ -87,24 +85,8 @@ Bastion.EventManager:RegisterWoWEvent("UNIT_SPELLCAST_SUCCEEDED", function(...)
end end
end) end)
local pguid = UnitGUID("player")
local missed = {}
Bastion.EventManager:RegisterWoWEvent("COMBAT_LOG_EVENT_UNFILTERED", function() Bastion.EventManager:RegisterWoWEvent("COMBAT_LOG_EVENT_UNFILTERED", function()
local args = { CombatLogGetCurrentEventInfo() } local _, subtype, _, sourceGUID, sourceName, _, _, destGUID, destName, destFlags, _, spellID, spellName, _, amount, interrupt, a, b, c, d, offhand, multistrike = CombatLogGetCurrentEventInfo()
local subEvent = args[2]
local sourceGUID = args[4]
local destGUID = args[8]
local spellID = args[12]
-- if sourceGUID == pguid then
-- local args = { CombatLogGetCurrentEventInfo() }
-- for i = 1, #args do
-- Log(tostring(args[i]))
-- end
-- end
local u = Bastion.UnitManager[sourceGUID] local u = Bastion.UnitManager[sourceGUID]
local u2 = Bastion.UnitManager[destGUID] local u2 = Bastion.UnitManager[destGUID]
@ -117,37 +99,23 @@ Bastion.EventManager:RegisterWoWEvent("COMBAT_LOG_EVENT_UNFILTERED", function()
if u2 then if u2 then
u2:SetLastCombatTime(t) u2:SetLastCombatTime(t)
if subEvent == "SPELL_MISSED" and sourceGUID == pguid and spellID == 408 then
local missType = args[15]
if missType == "IMMUNE" then
local castingSpell = u:GetCastingOrChannelingSpell()
if castingSpell then
if not missed[castingSpell:GetID()] then
missed[castingSpell:GetID()] = true
end
end
end
end
end end
end) end)
Bastion.Ticker = C_Timer.NewTicker(0.1, function() Bastion.Ticker = C_Timer.NewTicker(0.1, function()
if not Bastion.CombatTimer:IsRunning() and UnitAffectingCombat("player") then if not Bastion.CombatTimer:IsRunning() and UnitAffectingCombat("player") then
Bastion.CombatTimer:Start() Bastion.CombatTimer:Start()
elseif Bastion.CombatTimer:IsRunning() and not UnitAffectingCombat("player") then elseif Bastion.CombatTimer:IsRunning() and not UnitAffectingCombat("player") then
Bastion.CombatTimer:Reset() Bastion.CombatTimer:Reset()
end end
if Bastion.Enabled then if Bastion.Enabled then
Bastion.ObjectManager:Refresh() Bastion.ObjectManager:Refresh()
for i = 1, #Bastion.modules do for i = 1, #Bastion.modules do
Bastion.modules[i]:Tick() Bastion.modules[i]:Tick()
end
end end
end) end
end)
function Bastion:Register(module) function Bastion:Register(module)
table.insert(Bastion.modules, module) table.insert(Bastion.modules, module)
@ -260,17 +228,11 @@ Command:Register('mplus', 'Toggle m+ module on/off', function(args)
Bastion:Print("casts") Bastion:Print("casts")
end) end)
Command:Register('missed', 'Dump the list of immune kidney shot spells', function()
for k, v in pairs(missed) do
Bastion:Print(k)
end
end)
local files = ListFiles("scripts/bastion/scripts") local files = ListFiles("scripts/bastion/scripts")
for i = 1, #files do for i = 1, #files do
local file = files[i] local file = files[i]
if file:sub( -4) == ".lua" or file:sub( -5) == '.luac' then if file:sub(-4) == ".lua" or file:sub(-5) == '.luac' then
Tinkr:require("scripts/bastion/scripts/" .. file:sub(1, -5), Bastion) Tinkr:require("scripts/bastion/scripts/" .. file:sub(1, -5), Bastion)
end end
end end

Loading…
Cancel
Save