main
Ryan Crockett 2 years ago
parent 536eb12be1
commit 188e415524
  1. 67
      scripts/protpaladin.lua
  2. 2
      src/Spell/Spell.lua

@ -1,4 +1,8 @@
local Tinkr, Bastion = ... local Tinkr = ...
---@class Bastion
local Bastion = ...
local ProtModule = Bastion.Module:New('prot_paladin') local ProtModule = Bastion.Module:New('prot_paladin')
local Evaluator = Tinkr.Util.Evaluator local Evaluator = Tinkr.Util.Evaluator
@ -10,51 +14,62 @@ local DevoAura = Bastion.SpellBook:GetSpell(465)
local PlayerSelfWOGPercent = 40 local PlayerSelfWOGPercent = 40
-- local WOGTarget = Bastion.UnitManager:CreateCustomUnit('wogtarget', function(unit) local WOGTarget = Bastion.UnitManager:CreateCustomUnit('wogtarget', 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 if Player:GetDistance(unit) > 40 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
-- 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)
-- if not lowest or Player:GetHP() < lowest or Player:GetHealthPercent() <= PlayerSelfWOGPercent then return false
-- lowest = Player end)
-- end
-- return lowest if not lowest or Player:GetHP() < lowest then
-- end) lowest = Player
end
return lowest
end)
local isRunning = false local isRunning = false
ProtModule:Sync(function() ProtModule:Sync(function()
if not isRunning then if not isRunning then
Bastion:Print('Running Prot Pally Routine') Bastion:Print('Prot Pally Started')
isRunning = true isRunning = true
end end
-- Cast Crusader Aura if talented and the player is mounted.
if Player:IsMounted() and CrusaderAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(CrusaderAura):IsUp() and not Player:IsCastingOrChanneling() then if Player:IsMounted() and CrusaderAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(CrusaderAura):IsUp() and not Player:IsCastingOrChanneling() then
return CrusaderAura:Cast(Player) return CrusaderAura:Cast(Player)
end end
-- Cast Devo Aura if the player is not mounted.
if not Player:IsMounted() and DevoAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(DevoAura):IsUp() and not Player:IsCastingOrChanneling() then if not Player:IsMounted() and DevoAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(DevoAura):IsUp() and not Player:IsCastingOrChanneling() then
return DevoAura:Cast(Player) return DevoAura:Cast(Player)
end end
if Player:IsAffectingCombat() then
-- Combat Rotation
else
-- Out Of Combat Rotation
end
end) end)
Bastion:Register(ProtModule) Bastion:Register(ProtModule)

@ -128,7 +128,7 @@ end
-- Cast the spell -- Cast the spell
---@param unit Unit ---@param unit Unit
---@param condition string ---@param condition? string
---@return boolean ---@return boolean
function Spell:Cast(unit, condition) function Spell:Cast(unit, condition)
if condition and not self:EvaluateCondition(condition) then if condition and not self:EvaluateCondition(condition) then

Loading…
Cancel
Save