view SkeenCore3BeastMasteryHunter.lua @ 5:afd83bc06b1e v1.3.0

Updated to make use of library
author Emil Madsen <skeen@cs.au.dk>
date Sun, 31 Jul 2011 21:52:18 +0200
parents 629e6e84fd18
children a6e2ff3a8f61
line wrap: on
line source
--
-- SkeenCore3BeastMasteryHunter
-- 
local LibSkeenCore = LibStub("LibSkeenCore");

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 = LibSkeenCore:GetCooldown(34026) --"Kill Command"
    local kill_shot_cooldown = LibSkeenCore:GetCooldown(53351) --"Kill Shot"
    local rapid_fire_cooldown = LibSkeenCore:GetCooldown(3045) --"Rapid Fire"
    local focus_fire_cooldown = LibSkeenCore:GetCooldown(82692) --"Focus Fire"
    local fervor_cooldown = LibSkeenCore:GetCooldown(82726) --"Fervor"
    local bestial_wrath_cooldown = LibSkeenCore:GetCooldown(19574) --"Bestial Wrath"
    
    --Debuff
    local serpent_sting_duration = LibSkeenCore:GetDebuffDuration(1978) --"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)