Add Arms warrior

main
abunai10 1 year ago
parent a3eb80f5fe
commit ecea9a2676
  1. 119
      dist/Warrior/arms.lua

@ -0,0 +1,119 @@
local Unlocker, Caffeine = ...
local OpenArms = Caffeine.Module:New('OpenArms')
-- Units
local player = Caffeine.UnitManager:Get('player')
local target = Caffeine.UnitManager:Get('target')
local none = Caffeine.UnitManager:Get('none')
-- Spells
local rend = Caffeine.Globals.SpellBook:GetSpell(772)
local thunder_clap = Caffeine.Globals.SpellBook:GetSpell(396719)
local avatar = Caffeine.Globals.SpellBook:GetSpell(107574)
local sweeping_strikes = Caffeine.Globals.SpellBook:GetSpell(260708)
local colossus_smash = Caffeine.Globals.SpellBook:GetSpell(167105)
local thunderous_roar = Caffeine.Globals.SpellBook:GetSpell(384318)
local execute = Caffeine.Globals.SpellBook:GetSpell(5308)
local mortal_strike = Caffeine.Globals.SpellBook:GetSpell(12294)
local overpower = Caffeine.Globals.SpellBook:GetSpell(7384)
local slam = Caffeine.Globals.SpellBook:GetSpell(1464)
-- Auras
local colossus_smash_aura = Caffeine.Globals.SpellBook:GetSpell(208086)
local sudden_death = Caffeine.Globals.SpellBook:GetSpell(52437)
-- APLs
local default_apl = Caffeine.APL:New('default')
-- Cast Rend when less than 4 seconds remaining, if multiple targets, use thunder clap
default_apl:AddSpell(
rend:CastableIf(function(self)
return self:IsKnownAndUsable() and target:GetAuras():FindMy(rend):GetRemainingTime() < 4 and player:GetEnemies(8) == 1
end):Settarget(target)
)
default_apl:AddSpell(
thunder_clap:CastableIf(function(self)
return self:IsKnownAndUsable() and target:GetAuras():FindMy(rend):GetRemainingTime() < 4 and player:GetEnemies(8) > 1
end):Settarget(none)
)
-- Avatar
default_apl:AddSpell(
avatar:CastableIf(function(self)
return self:IsKnownAndUsable()
end):Settarget(none)
)
-- Sweeping Strikes if 2+ targets
default_apl:AddSpell(
sweeping_strikes:CastableIf(function(self)
return self:IsKnownAndUsable() and player:GetEnemies(8) > 1
end):Settarget(none)
)
-- Colossus Smash on CD
default_apl:AddSpell(
colossus_smash:CastableIf(function(self)
return self:IsKnownAndUsable()
end):Settarget(target)
)
-- Thunderous Roar while enemy has Colossus Smash or you have Test of Might
default_apl:AddSpell(
thunderous_roar:CastableIf(function(self)
return self:IsKnownAndUsable() and (target:GetAuras():FindMy(colossus_smash_aura):IsUp() or player:GetAuras():FindMy(test_of_might):IsUp())
end):Settarget(target)
)
-- Execute if 35% hp or Sudden Death proc
default_apl:AddSpell(
execute:CastableIf(function(self)
return self:IsKnownAndUsable() and target:GetHP() < 35 or player:GetAuras():FindMy(sudden_death):IsUp()
end):Settarget(target)
)
-- Mortal Strike on CD
default_apl:AddSpell(
mortal_strike:CastableIf(function(self)
return self:IsKnownAndUsable()
end):Settarget(target)
)
-- Overpower
default_apl:AddSpell(
overpower:CastableIf(function(self)
return self:IsKnownAndUsable()
end):Settarget(target)
)
-- Slam above 35% hp
default_apl:AddSpell(
slam:CastableIf(function(self)
return self:IsKnownAndUsable() and target:GetHP() >= 35
end):Settarget(target)
)
local move_to_timer = 0
OpenArms:Sync(function()
if not player:IsFacing(target) and target:Exists() and not target:IsDead() then
Caffeine.Util:FaceUnit(target)
end
if not player:InMelee(target) and target:Exists() and not target:IsDead() and target:IsHostile() then
local tx, ty, tz = ObjectPosition('target')
local px, py, pz = ObjectPosition('player')
if GetTime() - move_to_timer > 0.5 and FastDistance(px, py, pz, tx, ty, tz) > 5 then
MoveTo(tx, ty, tz)
move_to_timer = GetTime()
end
end
if player:IsAffectingCombat() and target:Exists() and target:IsHostile() and not target:IsDead() and player:IsFacing(target) then
default_apl:Execute()
end
end)
Caffeine:Register(OpenArms)
Loading…
Cancel
Save