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