From 536eb12be1e9eee0a08dbf11a0715ee4b6e374a9 Mon Sep 17 00:00:00 2001 From: Ryan Crockett Date: Sun, 26 Feb 2023 16:04:18 -0500 Subject: [PATCH] Init --- .gitignore | 2 +- {scripts => references}/outlaw.lua | 0 {scripts => references}/restodruid.lua | 0 {scripts => references}/subtlety.lua | 0 scripts/protpaladin.lua | 60 ++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) rename {scripts => references}/outlaw.lua (100%) rename {scripts => references}/restodruid.lua (100%) rename {scripts => references}/subtlety.lua (100%) create mode 100644 scripts/protpaladin.lua diff --git a/.gitignore b/.gitignore index f3c7e76..0af0314 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ DS_Store !.gitkeep ## ignore all files in scripts -scripts/* +# scripts/* ## ignore vscode settings .vscode/* diff --git a/scripts/outlaw.lua b/references/outlaw.lua similarity index 100% rename from scripts/outlaw.lua rename to references/outlaw.lua diff --git a/scripts/restodruid.lua b/references/restodruid.lua similarity index 100% rename from scripts/restodruid.lua rename to references/restodruid.lua diff --git a/scripts/subtlety.lua b/references/subtlety.lua similarity index 100% rename from scripts/subtlety.lua rename to references/subtlety.lua diff --git a/scripts/protpaladin.lua b/scripts/protpaladin.lua new file mode 100644 index 0000000..b7da67e --- /dev/null +++ b/scripts/protpaladin.lua @@ -0,0 +1,60 @@ +local Tinkr, Bastion = ... + +local ProtModule = Bastion.Module:New('prot_paladin') +local Evaluator = Tinkr.Util.Evaluator +local Player = Bastion.UnitManager:Get('player') +local Target = Bastion.UnitManager:Get('target') + +local CrusaderAura = Bastion.SpellBook:GetSpell(32223) +local DevoAura = Bastion.SpellBook:GetSpell(465) + +local PlayerSelfWOGPercent = 40 + +-- local WOGTarget = Bastion.UnitManager:CreateCustomUnit('wogtarget', function(unit) +-- local lowest = nil +-- local lowestHP = math.huge + +-- Bastion.UnitManager:EnumFriends(function(unit) +-- if unit:IsDead() then +-- return false +-- end + +-- if Player:GetDistance(unit) > 40 then +-- return false +-- end + +-- if not Player:CanSee(unit) then +-- return false +-- end + +-- local hp = unit:GetHP() +-- if hp < lowestHP then +-- lowest = unit +-- lowestHP = hp +-- end +-- end) + +-- if not lowest or Player:GetHP() < lowest or Player:GetHealthPercent() <= PlayerSelfWOGPercent then +-- lowest = Player +-- end + +-- return lowest +-- end) + +local isRunning = false + +ProtModule:Sync(function() + if not isRunning then + Bastion:Print('Running Prot Pally Routine') + isRunning = true + end + if Player:IsMounted() and CrusaderAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(CrusaderAura):IsUp() and not Player:IsCastingOrChanneling() then + return CrusaderAura:Cast(Player) + end + + if not Player:IsMounted() and DevoAura:IsKnownAndUsable() and not Player:GetAuras():FindMy(DevoAura):IsUp() and not Player:IsCastingOrChanneling() then + return DevoAura:Cast(Player) + end +end) + +Bastion:Register(ProtModule)