diff SkeenCore3BeastMasteryHunter.lua @ 0:4dbfbe163c49 v1.0.1

Added files
author Emil Madsen <skeen@cs.au.dk>
date Tue, 28 Jun 2011 14:10:09 +0200
parents
children 629e6e84fd18
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SkeenCore3BeastMasteryHunter.lua	Tue Jun 28 14:10:09 2011 +0200
@@ -0,0 +1,88 @@
+--
+-- SkeenCore3BeastMasteryHunter
+-- 
+
+local function Rotation()
+
+	local guid = UnitGUID("target")
+	local puid = UnitGUID("player")
+	
+	if UnitName("target") == nil or UnitIsFriend("player","target") ~= nil or UnitHealth("target") == 0 then
+		return nil-- ignore the dead and friendly
+	end
+	
+	local spell = {}
+    spell.current = nil
+    spell.next = nil
+    spell.cd1 = nil
+    spell.cd2 = nil
+    spell.cd3 = nil
+    spell.cd4 = nil
+	
+	local focus = UnitPower("player")
+
+    --Cooldowns
+    local kill_command_cooldown = GetCooldown("Kill Command")
+    local kill_shot_cooldown = GetCooldown("Kill Shot")
+    local rapid_fire_cooldown = GetCooldown("Rapid Fire")
+    local focus_fire_cooldown = GetCooldown("Focus Fire")
+    local fervor_cooldown = GetCooldown("Fervor")
+    local bestial_wrath_cooldown = GetCooldown("Bestial Wrath")
+    
+    --Debuff
+    local serpent_sting_duration = GetDebuffDuration("Serpent Sting")
+
+    -- Get the target's health percentage
+	local TargetsPercentOfHealth = (UnitHealth("target") / UnitHealthMax("target") * 100);
+
+    if (kill_command_cooldown < 1) then
+        if (focus >= 40) then
+             spell.current = 34026 --KC
+        else
+             spell.next = 34026 --KC
+        end
+    elseif (serpent_sting_duration < 1) then
+        if (focus >= 25) then
+            spell.current = 1978 --SS;
+        else
+            spell.next = 1978 --SS;
+        end
+    elseif ((TargetsPercentOfHealth < 20) and (kill_shot_cooldown<1)) then
+        spell.current = 53351 --Kill Shot
+    elseif (focus >= 25) then
+        spell.current = 3044 --Arcane Shot
+    else
+        spell.current = 77767 --Cobra Shot
+    end
+    
+	if (rapid_fire_cooldown < 1) then
+		spell.cd1 = 3045 --Rapid fire
+	end
+	
+	if (focus_fire_cooldown < 1) then
+		spell.cd2 = 82692 --Focus fire
+	end
+	
+    if (fervor_cooldown < 1) then
+		spell.cd3 = 82726 --Fervor
+	end
+	
+	if (bestial_wrath_cooldown < 1) then
+		spell.cd4 = 19574 --Bestial Wrath
+	end
+
+    return spell
+end
+
+local SkeenCore3 = _G["SkeenCore3"]
+
+local SkeenPlugin = {}
+SkeenPlugin.Name = "SkeenCore3BeastMasteryHunter"
+SkeenPlugin.Class = "HUNTER"
+SkeenPlugin.Spec = 1
+SkeenPlugin.Version = 1.00
+SkeenPlugin.Rotation = Rotation
+--SkeenPlugin.Plugin_Active = Plugin_Active
+
+SkeenCore3:RegisterPlugin(SkeenPlugin)
+