changeset 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 007dd0e62d27
files .pkgmeta SkeenCore3BeastMasteryHunter.lua SkeenCore3BeastMasteryHunter.toc SkeenCoreLib.lua
diffstat 4 files changed, 136 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.pkgmeta	Tue Jun 28 14:10:09 2011 +0200
@@ -0,0 +1,4 @@
+package-as: SkeenCore3BeastMasteryHunter 
+
+enable-nolib-creation: no
+        
--- /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)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SkeenCore3BeastMasteryHunter.toc	Tue Jun 28 14:10:09 2011 +0200
@@ -0,0 +1,16 @@
+## Title: |cffffd200Skeen|r|cff69ccf0Core3|rBeastMasteryHunter
+## Version: 1.0.1
+## Author: Skeen
+## Interface: 40000
+## Dependencies: SkeenCore3
+## RequiredDeps: SkeenCore3
+## SavedVariables: SkeenBeastMasteryHunterdb
+## Notes: Beast Mastery Hunter plugin for SkeenCore3
+## X-LoadOn-Always: delayed
+## X-LoadOn-Class: Hunter
+## X-Child-Of: SkeenCore3
+## X-Part-Of: SkeenCore3
+
+SkeenCoreLib.lua
+SkeenCore3BeastMasteryHunter.lua
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SkeenCoreLib.lua	Tue Jun 28 14:10:09 2011 +0200
@@ -0,0 +1,28 @@
+function GetDebuffDuration(name)
+	local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitDebuff("target", name)
+
+	if name ~= nil and isMine == "player" then
+		return (expirationTime - GetTime())
+	else
+		return 0
+	end	
+end
+
+function GetBuffDuration(name)
+	local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitBuff("player", name)
+
+	if name ~= nil then
+		return (expirationTime - GetTime())
+	else
+		return 0
+	end
+end
+
+function GetCooldown(name)
+	local start, duration, enabled = GetSpellCooldown(name);
+	if duration ~= nil then 
+		return (duration + start - GetTime())
+	else
+		return 60
+	end
+end