Bastion aims to serve as a highly performant, simplisitic, and expandable World of Warcraft data visualization framework.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB

local Tinkr, _Bastion = ...
---@type Bastion
local Bastion = _Bastion
local Player = Bastion.UnitManager:Get('player')
local None = Bastion.UnitManager:Get('none')
2 years ago
local _Rebuke = Bastion.SpellBook:GetSpell(96231)
local RebukeTarget = Bastion.UnitManager:CreateCustomUnit('rebuke', function()
local kick = nil
Bastion.UnitManager:EnumEnemies(function(unit)
if unit:IsDead() then
return false
end
if not Player:CanSee(unit) then
return false
end
if Player:GetDistance(unit) > 40 then
return false
end
2 years ago
if unit:IsInterruptibleAt(10) and _Rebuke:IsInRange(unit) and Player:IsFacing(unit) then
kick = unit
return true
end
-- TODO: Only consider this if the player is in an M+ dungeon
-- if Player:InMelee(unit) and Player:IsFacing(unit) and Bastion.MythicPlusUtils:CastingCriticalKick(unit, 5) then
-- kick = unit
-- return true
-- end
return false
end)
if kick == nil then
kick = None
end
return kick
end)
2 years ago
---@alias Rebuke fun():boolean
---@type Rebuke
function Rebuke()
if RebukeTarget:Exists() and not Player:IsCastingOrChanneling() and _Rebuke:IsKnownAndUsable() then
print('HAS KICK TARGET, KICKING')
2 years ago
return _Rebuke:Cast(RebukeTarget)
end
return false
end
2 years ago
return Rebuke