skeen@0: -- skeen@0: -- SkeenCore3BeastMasteryHunter skeen@0: -- skeen@5: local LibSkeenCore = LibStub("LibSkeenCore"); skeen@0: skeen@25: local function Plugin_Registed() skeen@25: -- Default saved variables skeen@25: if SkeenCore3BeastMasteryHunterdb == nil then skeen@25: SkeenCore3BeastMasteryHunterdb = {} -- fresh start skeen@25: end skeen@25: skeen@25: -- Load defaults skeen@25: if SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark == nil then skeen@25: SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark = false skeen@25: end skeen@25: end skeen@25: skeen@25: local Option_Functions = {} skeen@25: skeen@25: function Option_Functions:GetHuntersMark() skeen@25: return SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark skeen@25: end skeen@25: skeen@25: skeen@25: function Option_Functions:ToggleHuntersMark() skeen@25: SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark = not SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark skeen@25: end skeen@25: skeen@25: skeen@25: local function Option_Frame() skeen@25: local panel = CreateFrame("FRAME") skeen@25: skeen@25: local string skeen@25: local checkbox skeen@25: skeen@25: local y = -40 skeen@25: local string_X = 10 skeen@25: local checkbox_X = -10 skeen@25: skeen@25: string = panel:CreateFontString(nil,"OVERLAY","GameFontNormal") skeen@25: string:SetText("Suggest Hunters Mark in Rotation") skeen@25: string:SetPoint("TOPLEFT", string_X, y) skeen@25: skeen@25: checkbox = CreateFrame("CheckButton", nil, panel, "OptionsCheckButtonTemplate") skeen@25: checkbox:SetWidth(18) skeen@25: checkbox:SetHeight(18) skeen@25: checkbox:SetScript("OnClick", function() Option_Functions:ToggleVanish() end) skeen@25: checkbox:SetPoint("TOPRIGHT", checkbox_X, y) skeen@25: checkbox:SetChecked(Option_Functions:ToggleHuntersMark()) skeen@25: skeen@25: return panel skeen@25: end skeen@25: skeen@21: local function Cooldowns() skeen@21: skeen@21: -- Ability SpellID skeen@21: local RapidFireID = 3045 skeen@21: local StampedeID = 121818 skeen@21: local ReadinessID = 23989 skeen@21: local BestialWrathID = 19574 skeen@21: skeen@21: return {RapidFireID, StampedeID, ReadinessID, BestialWrathID} skeen@21: end skeen@21: skeen@0: local function Rotation() skeen@0: skeen@9: -- Hide the frame, if the target is dead, non existing or friendly. skeen@17: if UnitName("target") == nil or UnitIsFriend("player","target") ~= nil or UnitHealth("target") == 0 then skeen@17: return nil skeen@17: end skeen@17: skeen@17: --Information from; skeen@17: --http://www.wowpedia.org/API_GetTalentInfo_(Mists) skeen@25: local fervor_chosen = LibSkeenCore:HasChosenTalent(10) skeen@25: local dire_beast_chosen = LibSkeenCore:HasChosenTalent(11) skeen@25: local thrill_of_the_hunt_chosen = LibSkeenCore:HasChosenTalent(12) skeen@19: local glaive_toss_chosen = LibSkeenCore:HasChosenTalent(16) skeen@19: local powershot_chosen = LibSkeenCore:HasChosenTalent(17) skeen@19: local barrage_chosen = LibSkeenCore:HasChosenTalent(18) skeen@17: skeen@9: -- The table used for spell information (returned to the callee) skeen@9: local spell = {} skeen@0: spell.current = nil skeen@0: spell.next = nil skeen@0: spell.cd1 = nil skeen@0: spell.cd2 = nil skeen@0: spell.cd3 = nil skeen@0: spell.cd4 = nil skeen@17: skeen@9: -- Ability SpellID skeen@17: local KillCommandID = 34026 skeen@17: local KillShotID = 53351 skeen@17: local FocusFireID = 82692 skeen@17: local FervorID = 82726 skeen@25: local DireBeastID = 120679 skeen@25: local ThrillOfTheHuntID = 109306 skeen@17: local SerpentStingID = 1978 skeen@17: local ArcaneShotID = 3044 skeen@17: local CobraShotID = 77767 skeen@17: local HuntersMarkID = 1130 skeen@17: local GlaiveTossID = 117050 skeen@17: local PowershotID = 109259 skeen@17: local BarrageID = 120360 skeen@17: local FrenzyID = 19615 skeen@9: skeen@17: local focus = UnitPower("player") skeen@0: skeen@0: --Cooldowns skeen@17: local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command" skeen@17: local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot" skeen@17: local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor" skeen@25: local dire_beast_cooldown = LibSkeenCore:GetCooldown(DireBeastID) --"Dire Beast" skeen@25: local thrill_of_the_hunt_cooldown = LibSkeenCore:GetCooldown(ThrillOfTheHuntID) --"Fervor" skeen@17: local glaive_toss_cooldown = LibSkeenCore:GetCooldown(GlaiveTossID) --"Glaive Toss" skeen@17: local powershot_cooldown = LibSkeenCore:GetCooldown(PowershotID) --"Powershot" skeen@17: local barrage_cooldown = LibSkeenCore:GetCooldown(BarrageID) --"Barrage" skeen@13: skeen@0: --Debuff skeen@9: local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(SerpentStingID) --"Serpent Sting" skeen@17: local HuntersMark_duration = LibSkeenCore:GetDebuffDuration(HuntersMarkID) --"Hunters Mark" skeen@17: skeen@17: --BuffStacks skeen@17: local frenzy_stacks = LibSkeenCore:GetBuffCount(FrenzyID) skeen@0: skeen@0: -- Get the target's health percentage skeen@17: local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); skeen@0: skeen@25: -- Apply Hunter's Mark Icon Hunter's Mark on the target. skeen@25: if ((HuntersMark_duration < 1) and Option_Functions:GetHuntersMark()) then skeen@13: spell.current = HuntersMarkID skeen@25: -- Cast Kill Command Icon Kill Command on cooldown. skeen@25: elseif(kill_command_cooldown < 1) then skeen@25: if (focus >= 40) then skeen@25: spell.current = KillCommandID skeen@25: else skeen@25: spell.next = KillCommandID skeen@25: end skeen@25: -- Cast Kill Shot Icon Kill Shot (only available below 20% health). skeen@25: elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then skeen@25: spell.current = KillShotID skeen@25: -- Apply and maintain Serpent Sting Icon Serpent Sting to the target skeen@25: -- it will be refreshed by Cobra Shot Icon Cobra Shot so it only needs to be done once, normally. skeen@13: elseif (serpent_sting_duration < 1) then skeen@13: if (focus >= 25) then skeen@17: spell.current = SerpentStingID skeen@13: else skeen@17: spell.next = SerpentStingID skeen@13: end skeen@25: -- Cast your Tier 6 talent (normally Glaive Toss Icon Glaive Toss) skeen@25: elseif (glaive_toss_chosen == true) and (glaive_toss_cooldown < 1) then skeen@25: if (focus >= 15) then skeen@25: spell.current = GlaiveTossID skeen@25: else skeen@25: spell.next = GlaiveTossID skeen@25: end skeen@25: elseif (powershot_chosen == true) and (powershot_cooldown < 1) and (focus >= 20) then skeen@25: if (focus >= 20) then skeen@25: spell.current = PowershotID skeen@25: else skeen@25: spell.next = PowershotID skeen@25: end skeen@25: elseif (barrage_chosen == true) and (barrage_cooldown < 1) then skeen@25: if (focus >= 30) then skeen@25: spell.current = BarrageID skeen@25: else skeen@25: spell.next = BarrageID skeen@25: end skeen@25: -- Cast your Tier 4 talent (normally Dire Beast Icon Dire Beast). skeen@25: elseif (fervor_chosen == true) and (fervor_cooldown < 1) then skeen@25: spell.current = FervorID skeen@25: elseif (dire_beast_chosen == true) and (dire_beast_cooldown < 1) then skeen@25: spell.current = DireBeastID skeen@25: elseif (thrill_of_the_hunt_chosen == true) and (thrill_of_the_hunt_cooldown < 1) then skeen@25: spell.current = ThrillOfTheHuntID skeen@25: -- Cast Focus Fire Icon Focus Fire when your pet's Frenzy Icon Frenzy reaches 5 stacks (the icon will glow) skeen@17: elseif (frenzy_stacks == 5) then skeen@17: spell.current = FocusFireID skeen@13: elseif (focus >= 60) then skeen@17: spell.current = ArcaneShotID skeen@0: else skeen@17: spell.current = CobraShotID skeen@0: end skeen@17: skeen@0: return spell skeen@0: end skeen@0: skeen@0: local SkeenPlugin = {} skeen@9: SkeenPlugin.Name = "Hunter: Beast Mastery" skeen@0: SkeenPlugin.Class = "HUNTER" skeen@0: SkeenPlugin.Spec = 1 skeen@25: SkeenPlugin.Version = "5.4.0" skeen@0: SkeenPlugin.Rotation = Rotation skeen@21: SkeenPlugin.Cooldowns = Cooldowns skeen@25: SkeenPlugin.Plugin_Registed = Plugin_Registed skeen@25: SkeenPlugin.Option_Frame = Option_Frame skeen@0: skeen@9: local SkeenCore3 = _G["SkeenCore3"] skeen@0: SkeenCore3:RegisterPlugin(SkeenPlugin)