Mercurial > wow > skeencore3beastmasteryhunter
comparison SkeenCore3BeastMasteryHunter.lua @ 9:a6e2ff3a8f61 v1.4.1
Update
| author | Emil Madsen <skeen@cs.au.dk> |
|---|---|
| date | Sun, 19 Feb 2012 20:42:54 +0100 |
| parents | afd83bc06b1e |
| children | 1040ce99b400 |
comparison
equal
deleted
inserted
replaced
| 8:ec564f511087 | 9:a6e2ff3a8f61 |
|---|---|
| 3 -- | 3 -- |
| 4 local LibSkeenCore = LibStub("LibSkeenCore"); | 4 local LibSkeenCore = LibStub("LibSkeenCore"); |
| 5 | 5 |
| 6 local function Rotation() | 6 local function Rotation() |
| 7 | 7 |
| 8 local guid = UnitGUID("target") | 8 -- Hide the frame, if the target is dead, non existing or friendly. |
| 9 local puid = UnitGUID("player") | |
| 10 | |
| 11 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 |
| 12 return nil-- ignore the dead and friendly | 10 return nil |
| 13 end | 11 end |
| 14 | 12 |
| 15 local spell = {} | 13 -- The table used for spell information (returned to the callee) |
| 14 local spell = {} | |
| 16 spell.current = nil | 15 spell.current = nil |
| 17 spell.next = nil | 16 spell.next = nil |
| 18 spell.cd1 = nil | 17 spell.cd1 = nil |
| 19 spell.cd2 = nil | 18 spell.cd2 = nil |
| 20 spell.cd3 = nil | 19 spell.cd3 = nil |
| 21 spell.cd4 = nil | 20 spell.cd4 = nil |
| 22 | 21 |
| 22 -- Ability SpellID | |
| 23 local KillCommandID = 34026 | |
| 24 local KillShotID = 53351 | |
| 25 local RapidFireID = 3045 | |
| 26 local FocusFireID = 82692 | |
| 27 local FervorID = 82726 | |
| 28 local BestialWrathID = 19574 | |
| 29 local SerpentStingID = 1978 | |
| 30 local ArcaneShotID = 3044 | |
| 31 local CobraShotID = 77767 | |
| 32 | |
| 33 | |
| 23 local focus = UnitPower("player") | 34 local focus = UnitPower("player") |
| 24 | 35 |
| 25 --Cooldowns | 36 --Cooldowns |
| 26 local kill_command_cooldown = LibSkeenCore:GetCooldown(34026) --"Kill Command" | 37 local kill_command_cooldown = LibSkeenCore:GetCooldown(KillCommandID) --"Kill Command" |
| 27 local kill_shot_cooldown = LibSkeenCore:GetCooldown(53351) --"Kill Shot" | 38 local kill_shot_cooldown = LibSkeenCore:GetCooldown(KillShotID) --"Kill Shot" |
| 28 local rapid_fire_cooldown = LibSkeenCore:GetCooldown(3045) --"Rapid Fire" | 39 local rapid_fire_cooldown = LibSkeenCore:GetCooldown(RapidFireID) --"Rapid Fire" |
| 29 local focus_fire_cooldown = LibSkeenCore:GetCooldown(82692) --"Focus Fire" | 40 local focus_fire_cooldown = LibSkeenCore:GetCooldown(FocusFireID) --"Focus Fire" |
| 30 local fervor_cooldown = LibSkeenCore:GetCooldown(82726) --"Fervor" | 41 local fervor_cooldown = LibSkeenCore:GetCooldown(FervorID) --"Fervor" |
| 31 local bestial_wrath_cooldown = LibSkeenCore:GetCooldown(19574) --"Bestial Wrath" | 42 local bestial_wrath_cooldown= LibSkeenCore:GetCooldown(BestialWrathID) --"Bestial Wrath" |
| 32 | 43 |
| 33 --Debuff | 44 --Debuff |
| 34 local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(1978) --"Serpent Sting" | 45 local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(SerpentStingID) --"Serpent Sting" |
| 35 | 46 |
| 36 -- Get the target's health percentage | 47 -- Get the target's health percentage |
| 37 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); | 48 local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100); |
| 38 | 49 |
| 39 if (kill_command_cooldown < 1) then | 50 if (kill_command_cooldown < 1) then |
| 40 if (focus >= 40) then | 51 if (focus >= 40) then |
| 41 spell.current = 34026 --KC | 52 spell.current = KillCommandID --KC |
| 42 else | 53 else |
| 43 spell.next = 34026 --KC | 54 spell.next = KillCommandID --KC |
| 44 end | 55 end |
| 45 elseif (serpent_sting_duration < 1) then | 56 elseif (serpent_sting_duration < 1) then |
| 46 if (focus >= 25) then | 57 if (focus >= 25) then |
| 47 spell.current = 1978 --SS; | 58 spell.current = SerpentStingID --SS; |
| 48 else | 59 else |
| 49 spell.next = 1978 --SS; | 60 spell.next = SerpentStingID --SS; |
| 50 end | 61 end |
| 51 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then | 62 elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then |
| 52 spell.current = 53351 --Kill Shot | 63 spell.current = KillShotID --Kill Shot |
| 53 elseif (focus >= 25) then | 64 elseif (focus >= 25) then |
| 54 spell.current = 3044 --Arcane Shot | 65 spell.current = ArcaneShotID --Arcane Shot |
| 55 else | 66 else |
| 56 spell.current = 77767 --Cobra Shot | 67 spell.current = CobraShotID --Cobra Shot |
| 57 end | 68 end |
| 58 | 69 |
| 59 if (rapid_fire_cooldown < 1) then | 70 if (rapid_fire_cooldown < 1) then |
| 60 spell.cd1 = 3045 --Rapid fire | 71 spell.cd1 = RapidFireID --Rapid fire |
| 61 end | 72 end |
| 62 | 73 |
| 63 if (focus_fire_cooldown < 1) then | 74 if (focus_fire_cooldown < 1) then |
| 64 spell.cd2 = 82692 --Focus fire | 75 spell.cd2 = FocusFireID --Focus fire |
| 65 end | 76 end |
| 66 | 77 |
| 67 if (fervor_cooldown < 1) then | 78 if (fervor_cooldown < 1) then |
| 68 spell.cd3 = 82726 --Fervor | 79 spell.cd3 = FervorID --Fervor |
| 69 end | 80 end |
| 70 | 81 |
| 71 if (bestial_wrath_cooldown < 1) then | 82 if (bestial_wrath_cooldown < 1) then |
| 72 spell.cd4 = 19574 --Bestial Wrath | 83 spell.cd4 = BestialWrathID --Bestial Wrath |
| 73 end | 84 end |
| 74 | 85 |
| 75 return spell | 86 return spell |
| 76 end | 87 end |
| 77 | 88 |
| 78 local SkeenCore3 = _G["SkeenCore3"] | |
| 79 | |
| 80 local SkeenPlugin = {} | 89 local SkeenPlugin = {} |
| 81 SkeenPlugin.Name = "SkeenCore3BeastMasteryHunter" | 90 SkeenPlugin.Name = "Hunter: Beast Mastery" |
| 82 SkeenPlugin.Class = "HUNTER" | 91 SkeenPlugin.Class = "HUNTER" |
| 83 SkeenPlugin.Spec = 1 | 92 SkeenPlugin.Spec = 1 |
| 84 SkeenPlugin.Version = 1.00 | 93 SkeenPlugin.Version = "4.3.0" |
| 85 SkeenPlugin.Rotation = Rotation | 94 SkeenPlugin.Rotation = Rotation |
| 86 --SkeenPlugin.Plugin_Active = Plugin_Active | |
| 87 | 95 |
| 96 local SkeenCore3 = _G["SkeenCore3"] | |
| 88 SkeenCore3:RegisterPlugin(SkeenPlugin) | 97 SkeenCore3:RegisterPlugin(SkeenPlugin) |
| 89 | 98 |
