From 0d1741ac3148ccf9b7aa40fafd3bffd122105b12 Mon Sep 17 00:00:00 2001 From: 4n0n <4n0n@tinkr.site> Date: Tue, 17 Jan 2023 00:50:31 -0600 Subject: [PATCH] Remove spam --- scripts/outlaw.lua | 72 +++++++++++++++++++++++++++++++++---- src/AuraTable/AuraTable.lua | 2 +- src/Unit/Unit.lua | 6 ++++ src/_bastion.lua | 2 +- 4 files changed, 73 insertions(+), 9 deletions(-) diff --git a/scripts/outlaw.lua b/scripts/outlaw.lua index 97aa783..18b59e8 100644 --- a/scripts/outlaw.lua +++ b/scripts/outlaw.lua @@ -37,6 +37,9 @@ local Shiv = Bastion.SpellBook:GetSpell(5938) local KidneyShot = Bastion.SpellBook:GetSpell(408) local InstantPoison = Bastion.SpellBook:GetSpell(315584) local AtrophicPosion = Bastion.SpellBook:GetSpell(381637) +local Evasion = Bastion.SpellBook:GetSpell(5277) +local TricksOfTheTrade = Bastion.SpellBook:GetSpell(57934) +local CheapShot = Bastion.SpellBook:GetSpell(1833) local IrideusFragment = Bastion.ItemBook:GetItem(193743) local Healthstone = Bastion.ItemBook:GetItem(5512) @@ -99,6 +102,37 @@ local KickTarget = Bastion.UnitManager:CreateCustomUnit('kick', function(unit) return purge end) +local Tank = Bastion.UnitManager:CreateCustomUnit('tank', function(unit) + local tank = nil + + Bastion.UnitManager:EnumFriends(function(unit) + if Player:GetDistance(unit) > 40 then + return false + end + + if not Player:CanSee(unit) then + return false + end + + if unit:IsDead() then + return false + end + + if unit:IsTank() then + tank = unit + return true + end + + return false + end) + + if tank == nil then + tank = None + end + + return tank +end) + local DefaultAPL = Bastion.APL:New('default') local AOEAPL = Bastion.APL:New('aoe') local SpecialAPL = Bastion.APL:New('special') @@ -119,6 +153,14 @@ SpecialAPL:AddSpell( end):SetTarget(KickTarget) ) +SpecialAPL:AddSpell( + CheapShot:CastableIf(function(self) + return KickTarget:Exists() and Player:InMelee(KickTarget) and + self:IsKnownAndUsable() and + not Player:IsCastingOrChanneling() and Player:GetAuras():FindMy(Stealth):IsUp() + end):SetTarget(KickTarget) +) + SpecialAPL:AddSpell( Stealth:CastableIf(function(self) return self:IsKnownAndUsable() and @@ -159,13 +201,29 @@ SpecialAPL:AddSpell( end):SetTarget(Player) ) --- SpecialAPL:AddSpell( --- Healthstone:UsableIf(function(self) --- return self:IsKnownAndUsable() and --- not Player:IsCastingOrChanneling() and --- Player:GetHealthPercent() < 40 --- end):SetTarget(Player) --- ) +SpecialAPL:AddItem( + Healthstone:UsableIf(function(self) + return self:IsEquippedAndUsable() and + not Player:IsCastingOrChanneling() and + Player:GetHealthPercent() < 40 + end):SetTarget(Player) +) + +SpecialAPL:AddSpell( + TricksOfTheTrade:CastableIf(function(self) + return Tank:Exists() and self:IsKnownAndUsable() and + not Player:IsCastingOrChanneling() and + Player:IsTanking(Target) + end):SetTarget(Tank) +) + +SpecialAPL:AddSpell( + Evasion:CastableIf(function(self) + return self:IsKnownAndUsable() and + not Player:IsCastingOrChanneling() and + Player:GetHealthPercent() < 40 + end):SetTarget(Player) +) SpecialAPL:AddItem( IrideusFragment:UsableIf(function(self) diff --git a/src/AuraTable/AuraTable.lua b/src/AuraTable/AuraTable.lua index ea82d2b..81dead3 100644 --- a/src/AuraTable/AuraTable.lua +++ b/src/AuraTable/AuraTable.lua @@ -131,7 +131,7 @@ end -- Update auras function AuraTable:Update() - print("Updating auras for " .. tostring(self.unit)) + -- print("Updating auras for " .. tostring(self.unit)) self:Clear() -- self.lastUpdate = GetTime() diff --git a/src/Unit/Unit.lua b/src/Unit/Unit.lua index 8ecf1aa..fdbf6cb 100644 --- a/src/Unit/Unit.lua +++ b/src/Unit/Unit.lua @@ -379,4 +379,10 @@ function Unit:IsUnit(unit) return UnitIsUnit(self.unit, unit.unit) end +-- IsTanking +function Unit:IsTanking(unit) + local isTanking, status, threatpct, rawthreatpct, threatvalue = UnitDetailedThreatSituation(self.unit, unit.unit) + return isTanking +end + return Unit diff --git a/src/_bastion.lua b/src/_bastion.lua index e289ab1..4c42318 100644 --- a/src/_bastion.lua +++ b/src/_bastion.lua @@ -1,7 +1,7 @@ local Tinkr = ... local Bastion = { - DebugMode = true + DebugMode = false } Bastion.__index = Bastion