comparison SkeenCore3BeastMasteryHunter.lua @ 17:58086ea2f944 v1.5.0

Updated for MoP by patch by Balire22
author Emil Madsen <skeen@cs.au.dk>
date Sat, 27 Apr 2013 19:49:49 +0200
parents 6ac320834be1
children d268dd3509fa
comparison
equal deleted inserted replaced
16:24332c8d9009 17:58086ea2f944
4 local LibSkeenCore = LibStub("LibSkeenCore"); 4 local LibSkeenCore = LibStub("LibSkeenCore");
5 5
6 local function Rotation() 6 local function Rotation()
7 7
8 -- Hide the frame, if the target is dead, non existing or friendly. 8 -- Hide the frame, if the target is dead, non existing or friendly.
9 if UnitName("target") == nil or UnitIsFriend("player","target") ~= nil or UnitHealth("target") == 0 then 9 if UnitName("target") == nil or UnitIsFriend("player","target") ~= nil or UnitHealth("target") == 0 then
10 return nil 10 return nil
11 end 11 end
12 12
13 --Information from;
14 --http://www.wowpedia.org/API_GetTalentInfo_(Mists)
15 local _, _, _, _, selected, _ = GetTalentInfo(13)
16 local a_murder_of_crows_chosen = selected
17
18 local _, _, _, _, selected, _ = GetTalentInfo(14)
19 local blink_strike_chosen = selected
20
21 local _, _, _, _, selected, _ = GetTalentInfo(15)
22 local lynx_rush_chosen = selected
23
24 local _, _, _, _, selected, _ = GetTalentInfo(16)
25 local glaive_toss_chosen = selected
26
27 local _, _, _, _, selected, _ = GetTalentInfo(17)
28 local powershot_chosen = selected
29
30 local _, _, _, _, selected, _ = GetTalentInfo(18)
31 local barrage_chosen = selected
32
13 -- The table used for spell information (returned to the callee) 33 -- The table used for spell information (returned to the callee)
14 local spell = {} 34 local spell = {}
15 spell.current = nil 35 spell.current = nil
16 spell.next = nil 36 spell.next = nil
17 spell.cd1 = nil 37 spell.cd1 = nil
18 spell.cd2 = nil 38 spell.cd2 = nil
19 spell.cd3 = nil 39 spell.cd3 = nil
20 spell.cd4 = nil 40 spell.cd4 = nil
21 41
22 -- Ability SpellID 42 -- Ability SpellID
23 local KillCommandID = 34026 43 local KillCommandID = 34026
24 local KillShotID = 53351 44 local KillShotID = 53351
25 local RapidFireID = 3045 45 local RapidFireID = 3045
26 local FocusFireID = 82692 46 local FocusFireID = 82692
27 local FervorID = 82726 47 local FervorID = 82726
28 local BestialWrathID = 19574 48 local BestialWrathID = 19574
29 local SerpentStingID = 1978 49 local SerpentStingID = 1978
30 local ArcaneShotID = 3044 50 local ArcaneShotID = 3044
31 local CobraShotID = 77767 51 local CobraShotID = 77767
32 local HuntersMarkID = 1130 52 local HuntersMarkID = 1130
33 local ReadinessID = 23989 53 local ReadinessID = 23989
54 local AMurderOfCrowsID = 131894
55 local BlinkStrikeID = 130392
56 local LynxRushID = 120697
57 local GlaiveTossID = 117050
58 local PowershotID = 109259
59 local BarrageID = 120360
60 local StampedeID = 121818
61 local FrenzyID = 19615
34 62
35 local focus = UnitPower("player") 63 local focus = UnitPower("player")
36 64
37 --Cooldowns 65 --Cooldowns
38 local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command" 66 local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command"
39 local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot" 67 local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot"
40 local rapid_fire_cooldown = LibSkeenCore:GetCooldown(RapidFireID) --"Rapid Fire" 68 local rapid_fire_cooldown = LibSkeenCore:GetCooldown(RapidFireID) --"Rapid Fire"
41 local focus_fire_cooldown = LibSkeenCore:GetCooldown(FocusFireID) --"Focus Fire" 69 local focus_fire_cooldown = LibSkeenCore:GetCooldown(FocusFireID) --"Focus Fire"
42 local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor" 70 local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor"
43 local bestial_wrath_cooldown= LibSkeenCore:GetCooldown(BestialWrathID) --"Bestial Wrath" 71 local bestial_wrath_cooldown = LibSkeenCore:GetCooldown(BestialWrathID) --"Bestial Wrath"
44 local Readiness_cooldown = LibSkeenCore:GetCooldown(ReadinessID) 72 local Readiness_cooldown = LibSkeenCore:GetCooldown(ReadinessID) --"Readiness"
73 local a_murder_of_crows_cooldown = LibSkeenCore:GetCooldown(AMurderOfCrowsID) --"A Murder of Crows"
74 local blink_strike_cooldown = LibSkeenCore:GetCooldown(BlinkStrikeID) --"Blink Strike"
75 local lynx_rush_cooldown = LibSkeenCore:GetCooldown(LynxRushID) --"Lynx Rush"
76 local glaive_toss_cooldown = LibSkeenCore:GetCooldown(GlaiveTossID) --"Glaive Toss"
77 local powershot_cooldown = LibSkeenCore:GetCooldown(PowershotID) --"Powershot"
78 local barrage_cooldown = LibSkeenCore:GetCooldown(BarrageID) --"Barrage"
79 local stampede_cooldown = LibSkeenCore:GetCooldown(StampedeID) --"Stampede"
45 80
46 --Debuff 81 --Debuff
47 local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(SerpentStingID) --"Serpent Sting" 82 local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(SerpentStingID) --"Serpent Sting"
48 local HuntersMark_duration = LibSkeenCore:GetDebuffDuration(HuntersMarkID) 83 local HuntersMark_duration = LibSkeenCore:GetDebuffDuration(HuntersMarkID) --"Hunters Mark"
84
85 --BuffStacks
86 local frenzy_stacks = LibSkeenCore:GetBuffCount(FrenzyID)
49 87
50 -- Get the target's health percentage 88 -- Get the target's health percentage
51 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); 89 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100);
52 90
53 if(HuntersMark_duration < 1) then 91 if(HuntersMark_duration < 1) then
54 spell.current = HuntersMarkID 92 spell.current = HuntersMarkID
55 elseif (serpent_sting_duration < 1) then 93 elseif (serpent_sting_duration < 1) then
56 if (focus >= 25) then 94 if (focus >= 25) then
57 spell.current = SerpentStingID --SS; 95 spell.current = SerpentStingID
58 else 96 else
59 spell.next = SerpentStingID --SS; 97 spell.next = SerpentStingID
60 end 98 end
99 elseif (frenzy_stacks == 5) then
100 spell.current = FocusFireID
101 elseif (glaive_toss_chosen == true) and (glaive_toss_cooldown < 1) and (focus >= 15) then
102 spell.current = GlaiveTossID
103 elseif (powershot_chosen == true) and (powershot_cooldown < 1) and (focus >= 20) then
104 spell.current = PowershotID
105 elseif (barrage_chosen == true) and (barrage_cooldown < 1) and (focus >= 30) then
106 spell.current = BarrageID
107 elseif (a_murder_of_crows_chosen == true) and (a_murder_of_crows_cooldown < 1) then
108 spell.current = AMurderOfCrowsID
109 elseif (blink_strike_chosen == true) and (blink_strike_cooldown < 1) then
110 spell.current = BlinkStrikeID
111 elseif (lynx_rush_chosen == true) and (lynx_rush_cooldown < 1) then
112 spell.current = LynxRushID
61 elseif (kill_command_cooldown < 1) then 113 elseif (kill_command_cooldown < 1) then
62 if (focus >= 40) then 114 if (focus >= 40) then
63 spell.current = KillCommandID --KC 115 spell.current = KillCommandID
64 else 116 else
65 spell.next = KillCommandID --KC 117 spell.next = KillCommandID
66 end 118 end
67 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then 119 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then
68 spell.current = KillShotID --Kill Shot 120 spell.current = KillShotID
69 --TODO: FOCUS FIRE
70 elseif (focus >= 60) then 121 elseif (focus >= 60) then
71 spell.current = ArcaneShotID --Arcane Shot 122 spell.current = ArcaneShotID
72 else 123 else
73 spell.current = CobraShotID --Cobra Shot 124 spell.current = CobraShotID
74 end 125 end
75 126
76 if (rapid_fire_cooldown < 1) then 127 if (rapid_fire_cooldown < 1) then
77 spell.cd1 = RapidFireID --Rapid fire 128 spell.cd1 = RapidFireID
78 end 129 end
79 130
80 if (focus_fire_cooldown < 1) then 131 if (stampede_cooldown < 1) then
81 spell.cd2 = FocusFireID --Focus fire 132 spell.cd2 = StampedeID
82 end 133 end
83 134
84 if (Readiness_cooldown < 1) then 135 if (Readiness_cooldown < 1) then
85 spell.cd3 = ReadinessID --Readiness 136 spell.cd3 = ReadinessID
86 end 137 end
87 138
88 if (bestial_wrath_cooldown < 1) then 139 if (bestial_wrath_cooldown < 1) then
89 spell.cd4 = BestialWrathID --Bestial Wrath 140 spell.cd4 = BestialWrathID
90 end 141 end
91 142
92 return spell 143 return spell
93 end 144 end
94 145
95 local SkeenPlugin = {} 146 local SkeenPlugin = {}
96 SkeenPlugin.Name = "Hunter: Beast Mastery" 147 SkeenPlugin.Name = "Hunter: Beast Mastery"
97 SkeenPlugin.Class = "HUNTER" 148 SkeenPlugin.Class = "HUNTER"
98 SkeenPlugin.Spec = 1 149 SkeenPlugin.Spec = 1
99 SkeenPlugin.Version = "4.3.0" 150 SkeenPlugin.Version = "5.2.0"
100 SkeenPlugin.Rotation = Rotation 151 SkeenPlugin.Rotation = Rotation
101 152
102 local SkeenCore3 = _G["SkeenCore3"] 153 local SkeenCore3 = _G["SkeenCore3"]
103 SkeenCore3:RegisterPlugin(SkeenPlugin) 154 SkeenCore3:RegisterPlugin(SkeenPlugin)
104