Mercurial > wow > skeencore3beastmasteryhunter
comparison SkeenCore3BeastMasteryHunter.lua @ 25:a03c3c813e3e v1.5.4
Updated for patch 5.4.0
| author | Emil Madsen <skeen@cs.au.dk> |
|---|---|
| date | Tue, 03 Dec 2013 21:27:10 +0100 |
| parents | 39f3f0dbf42e |
| children | 73b302b898ba |
comparison
equal
deleted
inserted
replaced
| 24:737091a6d012 | 25:a03c3c813e3e |
|---|---|
| 1 -- | 1 -- |
| 2 -- SkeenCore3BeastMasteryHunter | 2 -- SkeenCore3BeastMasteryHunter |
| 3 -- | 3 -- |
| 4 local LibSkeenCore = LibStub("LibSkeenCore"); | 4 local LibSkeenCore = LibStub("LibSkeenCore"); |
| 5 | |
| 6 local function Plugin_Registed() | |
| 7 -- Default saved variables | |
| 8 if SkeenCore3BeastMasteryHunterdb == nil then | |
| 9 SkeenCore3BeastMasteryHunterdb = {} -- fresh start | |
| 10 end | |
| 11 | |
| 12 -- Load defaults | |
| 13 if SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark == nil then | |
| 14 SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark = false | |
| 15 end | |
| 16 end | |
| 17 | |
| 18 local Option_Functions = {} | |
| 19 | |
| 20 function Option_Functions:GetHuntersMark() | |
| 21 return SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark | |
| 22 end | |
| 23 | |
| 24 | |
| 25 function Option_Functions:ToggleHuntersMark() | |
| 26 SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark = not SkeenCore3BeastMasteryHunterdb.SuggestHuntersMark | |
| 27 end | |
| 28 | |
| 29 | |
| 30 local function Option_Frame() | |
| 31 local panel = CreateFrame("FRAME") | |
| 32 | |
| 33 local string | |
| 34 local checkbox | |
| 35 | |
| 36 local y = -40 | |
| 37 local string_X = 10 | |
| 38 local checkbox_X = -10 | |
| 39 | |
| 40 string = panel:CreateFontString(nil,"OVERLAY","GameFontNormal") | |
| 41 string:SetText("Suggest Hunters Mark in Rotation") | |
| 42 string:SetPoint("TOPLEFT", string_X, y) | |
| 43 | |
| 44 checkbox = CreateFrame("CheckButton", nil, panel, "OptionsCheckButtonTemplate") | |
| 45 checkbox:SetWidth(18) | |
| 46 checkbox:SetHeight(18) | |
| 47 checkbox:SetScript("OnClick", function() Option_Functions:ToggleVanish() end) | |
| 48 checkbox:SetPoint("TOPRIGHT", checkbox_X, y) | |
| 49 checkbox:SetChecked(Option_Functions:ToggleHuntersMark()) | |
| 50 | |
| 51 return panel | |
| 52 end | |
| 5 | 53 |
| 6 local function Cooldowns() | 54 local function Cooldowns() |
| 7 | 55 |
| 8 -- Ability SpellID | 56 -- Ability SpellID |
| 9 local RapidFireID = 3045 | 57 local RapidFireID = 3045 |
| 21 return nil | 69 return nil |
| 22 end | 70 end |
| 23 | 71 |
| 24 --Information from; | 72 --Information from; |
| 25 --http://www.wowpedia.org/API_GetTalentInfo_(Mists) | 73 --http://www.wowpedia.org/API_GetTalentInfo_(Mists) |
| 26 local a_murder_of_crows_chosen = LibSkeenCore:HasChosenTalent(13) | 74 local fervor_chosen = LibSkeenCore:HasChosenTalent(10) |
| 27 local blink_strike_chosen = LibSkeenCore:HasChosenTalent(14) | 75 local dire_beast_chosen = LibSkeenCore:HasChosenTalent(11) |
| 28 local lynx_rush_chosen = LibSkeenCore:HasChosenTalent(15) | 76 local thrill_of_the_hunt_chosen = LibSkeenCore:HasChosenTalent(12) |
| 29 local glaive_toss_chosen = LibSkeenCore:HasChosenTalent(16) | 77 local glaive_toss_chosen = LibSkeenCore:HasChosenTalent(16) |
| 30 local powershot_chosen = LibSkeenCore:HasChosenTalent(17) | 78 local powershot_chosen = LibSkeenCore:HasChosenTalent(17) |
| 31 local barrage_chosen = LibSkeenCore:HasChosenTalent(18) | 79 local barrage_chosen = LibSkeenCore:HasChosenTalent(18) |
| 32 | 80 |
| 33 -- The table used for spell information (returned to the callee) | 81 -- The table used for spell information (returned to the callee) |
| 42 -- Ability SpellID | 90 -- Ability SpellID |
| 43 local KillCommandID = 34026 | 91 local KillCommandID = 34026 |
| 44 local KillShotID = 53351 | 92 local KillShotID = 53351 |
| 45 local FocusFireID = 82692 | 93 local FocusFireID = 82692 |
| 46 local FervorID = 82726 | 94 local FervorID = 82726 |
| 95 local DireBeastID = 120679 | |
| 96 local ThrillOfTheHuntID = 109306 | |
| 47 local SerpentStingID = 1978 | 97 local SerpentStingID = 1978 |
| 48 local ArcaneShotID = 3044 | 98 local ArcaneShotID = 3044 |
| 49 local CobraShotID = 77767 | 99 local CobraShotID = 77767 |
| 50 local HuntersMarkID = 1130 | 100 local HuntersMarkID = 1130 |
| 51 local AMurderOfCrowsID = 131894 | |
| 52 local BlinkStrikeID = 130392 | |
| 53 local LynxRushID = 120697 | |
| 54 local GlaiveTossID = 117050 | 101 local GlaiveTossID = 117050 |
| 55 local PowershotID = 109259 | 102 local PowershotID = 109259 |
| 56 local BarrageID = 120360 | 103 local BarrageID = 120360 |
| 57 local FrenzyID = 19615 | 104 local FrenzyID = 19615 |
| 58 | 105 |
| 59 local focus = UnitPower("player") | 106 local focus = UnitPower("player") |
| 60 | 107 |
| 61 --Cooldowns | 108 --Cooldowns |
| 62 local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command" | 109 local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command" |
| 63 local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot" | 110 local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot" |
| 64 local focus_fire_cooldown = LibSkeenCore:GetCooldown(FocusFireID) --"Focus Fire" | |
| 65 local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor" | 111 local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor" |
| 66 local a_murder_of_crows_cooldown = LibSkeenCore:GetCooldown(AMurderOfCrowsID) --"A Murder of Crows" | 112 local dire_beast_cooldown = LibSkeenCore:GetCooldown(DireBeastID) --"Dire Beast" |
| 67 local blink_strike_cooldown = LibSkeenCore:GetCooldown(BlinkStrikeID) --"Blink Strike" | 113 local thrill_of_the_hunt_cooldown = LibSkeenCore:GetCooldown(ThrillOfTheHuntID) --"Fervor" |
| 68 local lynx_rush_cooldown = LibSkeenCore:GetCooldown(LynxRushID) --"Lynx Rush" | |
| 69 local glaive_toss_cooldown = LibSkeenCore:GetCooldown(GlaiveTossID) --"Glaive Toss" | 114 local glaive_toss_cooldown = LibSkeenCore:GetCooldown(GlaiveTossID) --"Glaive Toss" |
| 70 local powershot_cooldown = LibSkeenCore:GetCooldown(PowershotID) --"Powershot" | 115 local powershot_cooldown = LibSkeenCore:GetCooldown(PowershotID) --"Powershot" |
| 71 local barrage_cooldown = LibSkeenCore:GetCooldown(BarrageID) --"Barrage" | 116 local barrage_cooldown = LibSkeenCore:GetCooldown(BarrageID) --"Barrage" |
| 72 | 117 |
| 73 --Debuff | 118 --Debuff |
| 78 local frenzy_stacks = LibSkeenCore:GetBuffCount(FrenzyID) | 123 local frenzy_stacks = LibSkeenCore:GetBuffCount(FrenzyID) |
| 79 | 124 |
| 80 -- Get the target's health percentage | 125 -- Get the target's health percentage |
| 81 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); | 126 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); |
| 82 | 127 |
| 83 if(HuntersMark_duration < 1) then | 128 -- Apply Hunter's Mark Icon Hunter's Mark on the target. |
| 129 if ((HuntersMark_duration < 1) and Option_Functions:GetHuntersMark()) then | |
| 84 spell.current = HuntersMarkID | 130 spell.current = HuntersMarkID |
| 131 -- Cast Kill Command Icon Kill Command on cooldown. | |
| 132 elseif(kill_command_cooldown < 1) then | |
| 133 if (focus >= 40) then | |
| 134 spell.current = KillCommandID | |
| 135 else | |
| 136 spell.next = KillCommandID | |
| 137 end | |
| 138 -- Cast Kill Shot Icon Kill Shot (only available below 20% health). | |
| 139 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then | |
| 140 spell.current = KillShotID | |
| 141 -- Apply and maintain Serpent Sting Icon Serpent Sting to the target | |
| 142 -- it will be refreshed by Cobra Shot Icon Cobra Shot so it only needs to be done once, normally. | |
| 85 elseif (serpent_sting_duration < 1) then | 143 elseif (serpent_sting_duration < 1) then |
| 86 if (focus >= 25) then | 144 if (focus >= 25) then |
| 87 spell.current = SerpentStingID | 145 spell.current = SerpentStingID |
| 88 else | 146 else |
| 89 spell.next = SerpentStingID | 147 spell.next = SerpentStingID |
| 90 end | 148 end |
| 149 -- Cast your Tier 6 talent (normally Glaive Toss Icon Glaive Toss) | |
| 150 elseif (glaive_toss_chosen == true) and (glaive_toss_cooldown < 1) then | |
| 151 if (focus >= 15) then | |
| 152 spell.current = GlaiveTossID | |
| 153 else | |
| 154 spell.next = GlaiveTossID | |
| 155 end | |
| 156 elseif (powershot_chosen == true) and (powershot_cooldown < 1) and (focus >= 20) then | |
| 157 if (focus >= 20) then | |
| 158 spell.current = PowershotID | |
| 159 else | |
| 160 spell.next = PowershotID | |
| 161 end | |
| 162 elseif (barrage_chosen == true) and (barrage_cooldown < 1) then | |
| 163 if (focus >= 30) then | |
| 164 spell.current = BarrageID | |
| 165 else | |
| 166 spell.next = BarrageID | |
| 167 end | |
| 168 -- Cast your Tier 4 talent (normally Dire Beast Icon Dire Beast). | |
| 169 elseif (fervor_chosen == true) and (fervor_cooldown < 1) then | |
| 170 spell.current = FervorID | |
| 171 elseif (dire_beast_chosen == true) and (dire_beast_cooldown < 1) then | |
| 172 spell.current = DireBeastID | |
| 173 elseif (thrill_of_the_hunt_chosen == true) and (thrill_of_the_hunt_cooldown < 1) then | |
| 174 spell.current = ThrillOfTheHuntID | |
| 175 -- Cast Focus Fire Icon Focus Fire when your pet's Frenzy Icon Frenzy reaches 5 stacks (the icon will glow) | |
| 91 elseif (frenzy_stacks == 5) then | 176 elseif (frenzy_stacks == 5) then |
| 92 spell.current = FocusFireID | 177 spell.current = FocusFireID |
| 93 elseif (glaive_toss_chosen == true) and (glaive_toss_cooldown < 1) and (focus >= 15) then | |
| 94 spell.current = GlaiveTossID | |
| 95 elseif (powershot_chosen == true) and (powershot_cooldown < 1) and (focus >= 20) then | |
| 96 spell.current = PowershotID | |
| 97 elseif (barrage_chosen == true) and (barrage_cooldown < 1) and (focus >= 30) then | |
| 98 spell.current = BarrageID | |
| 99 elseif (a_murder_of_crows_chosen == true) and (a_murder_of_crows_cooldown < 1) then | |
| 100 spell.current = AMurderOfCrowsID | |
| 101 elseif (blink_strike_chosen == true) and (blink_strike_cooldown < 1) then | |
| 102 spell.current = BlinkStrikeID | |
| 103 elseif (lynx_rush_chosen == true) and (lynx_rush_cooldown < 1) then | |
| 104 spell.current = LynxRushID | |
| 105 elseif (kill_command_cooldown < 1) then | |
| 106 if (focus >= 40) then | |
| 107 spell.current = KillCommandID | |
| 108 else | |
| 109 spell.next = KillCommandID | |
| 110 end | |
| 111 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then | |
| 112 spell.current = KillShotID | |
| 113 elseif (focus >= 60) then | 178 elseif (focus >= 60) then |
| 114 spell.current = ArcaneShotID | 179 spell.current = ArcaneShotID |
| 115 else | 180 else |
| 116 spell.current = CobraShotID | 181 spell.current = CobraShotID |
| 117 end | 182 end |
| 121 | 186 |
| 122 local SkeenPlugin = {} | 187 local SkeenPlugin = {} |
| 123 SkeenPlugin.Name = "Hunter: Beast Mastery" | 188 SkeenPlugin.Name = "Hunter: Beast Mastery" |
| 124 SkeenPlugin.Class = "HUNTER" | 189 SkeenPlugin.Class = "HUNTER" |
| 125 SkeenPlugin.Spec = 1 | 190 SkeenPlugin.Spec = 1 |
| 126 SkeenPlugin.Version = "5.2.0" | 191 SkeenPlugin.Version = "5.4.0" |
| 127 SkeenPlugin.Rotation = Rotation | 192 SkeenPlugin.Rotation = Rotation |
| 128 SkeenPlugin.Cooldowns = Cooldowns | 193 SkeenPlugin.Cooldowns = Cooldowns |
| 194 SkeenPlugin.Plugin_Registed = Plugin_Registed | |
| 195 SkeenPlugin.Option_Frame = Option_Frame | |
| 129 | 196 |
| 130 local SkeenCore3 = _G["SkeenCore3"] | 197 local SkeenCore3 = _G["SkeenCore3"] |
| 131 SkeenCore3:RegisterPlugin(SkeenPlugin) | 198 SkeenCore3:RegisterPlugin(SkeenPlugin) |
