forked from Bastion/Bastion
Compare commits
2 Commits
9406772384
...
e0c2e15a47
Author | SHA1 | Date |
---|---|---|
Ryan Crockett | e0c2e15a47 | 2 years ago |
Ryan Crockett | df988ab750 | 2 years ago |
@ -0,0 +1,69 @@ |
||||
local Tinkr, _Bastion = ... |
||||
|
||||
---@type Bastion |
||||
local Bastion = _Bastion |
||||
|
||||
local Player = Bastion.UnitManager:Get('player') |
||||
local Target = Bastion.UnitManager:Get('target') |
||||
local None = Bastion.UnitManager:Get('none') |
||||
|
||||
local _HammerOfWrath = Bastion.SpellBook:GetSpell(24275) |
||||
local AvengingWrath = Bastion.SpellBook:GetSpell(389539) |
||||
|
||||
local HammerOfWrathTarget = Bastion.UnitManager:CreateCustomUnit('hammerofwrath', function() |
||||
if not _HammerOfWrath:IsKnownAndUsable() then return None end |
||||
|
||||
if Player:GetAuras():FindMy(AvengingWrath):IsUp() and _HammerOfWrath:IsKnownAndUsable() and Target:Exists() and Target:IsEnemy() and Target:IsAffectingCombat() and _HammerOfWrath:IsInRange(Target) then |
||||
return Target |
||||
end |
||||
|
||||
local how = 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:IsFacing(unit) then |
||||
return false |
||||
end |
||||
|
||||
if not _HammerOfWrath:IsInRange(unit) then |
||||
return false |
||||
end |
||||
|
||||
if Player:GetAuras():FindMy(AvengingWrath):IsUp() then |
||||
how = unit |
||||
return true |
||||
end |
||||
|
||||
if unit:GetHealthPercent() <= 20 then |
||||
how = unit |
||||
return true |
||||
end |
||||
|
||||
return false |
||||
end) |
||||
|
||||
if how == nil then |
||||
how = None |
||||
end |
||||
|
||||
return how |
||||
end) |
||||
|
||||
---@alias HammerOfWrath fun():boolean |
||||
|
||||
---@type HammerOfWrath |
||||
function HammerOfWrath() |
||||
if HammerOfWrathTarget:Exists() and not Player:IsCastingOrChanneling() then |
||||
return _HammerOfWrath:Cast(HammerOfWrathTarget) |
||||
end |
||||
return false |
||||
end |
||||
|
||||
return HammerOfWrath |
@ -0,0 +1,59 @@ |
||||
local Tinkr, _Bastion = ... |
||||
|
||||
---@type Bastion |
||||
local Bastion = _Bastion |
||||
|
||||
local Player = Bastion.UnitManager:Get('player') |
||||
local None = Bastion.UnitManager:Get('none') |
||||
|
||||
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 |
||||
|
||||
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) |
||||
|
||||
---@alias Rebuke fun():boolean |
||||
|
||||
---@type Rebuke |
||||
function Rebuke() |
||||
if RebukeTarget:Exists() and not Player:IsCastingOrChanneling() and _Rebuke:IsKnownAndUsable() then |
||||
print('HAS KICK TARGET, KICKING') |
||||
return _Rebuke:Cast(RebukeTarget) |
||||
end |
||||
return false |
||||
end |
||||
|
||||
return Rebuke |
Loading…
Reference in new issue