My Restoration druid Custom Rotation

1 post Page 1 of 1
Gadgetsan
Posts: 12
Joined: 13 Aug 2018, 19:33


Of course, since it is healing class, the rotation check for the health of your focus (which should be the tank). in solo mode it insteads look for you own health.

this rotation probably won't work for raid but i didn't test it.

feedback is appreciated
Code: Select all
function(_, timeShift, currentSpell, gcd, talents)
    local DEBUG = false;
--Links
    --http://maxdps.net/viewtopic.php?f=6&t=5&sid=134ea7dae4e3b8092032fb116836c364

--SKILLS
	local _Moonfire = 8921;
	local _Sunfire = 93402;
	local _Starsurge = 78674;
	local _CelestialAlignment = 194223;
	local _IncarnationChosenofElune = 102560;
	local _StellarFlare = 202347;
	local _Starfall = 191034;
	local _MasteryStarlight = 77492;
	local _StellarEmpowerment = 197637;
	local _Heroism = 32182;
	local _Bloodlust = 2825;
	local _Berserking = 26297;
	local _ForceofNature = 205636;
	local _WarriorofElune = 202425;
	local _AstralCommunion = 202359;
	local _BlessingoftheAncients = 202360;
	local _BlessingofElune = 202737;
	local _FuryofElune = 202770;
	local _MoonkinMoonfire = 164812;
	local _MoonkinSunfire = 164815;
    local _WarriorofEluneAura = 202425;
    local _SolarWrath = 5176;
    local _Lifebloom = 33763;
    local _Rejunevation = 774;
    local _Germination = 155777;
    local _WildGrowth = 48438;
    local _Tranquility = 740;
    local _Swiftmend = 18562;
    local _Regrowth = 8936;
    local _Flourish = 197721;
    local _CenarionWard = 102351;
    local _Efflorescence = 145205;    
    local _Innervate = 29166;  
    local _Clearcasting = 16870;
    local _GerminationTalent = 155675;
    local _Ironbark = 102342;

    local debug = function(text)
        if(DEBUG) then print(text);end;
    end
    
    local healthPercentage = function(unit)        
        local health = UnitHealth(unit);
        if health <= 0 then
            return 0;
        end;
        local healthMax = UnitHealthMax(unit);
        if healthMax <= 0 then
            return 0;
        end;
        return health/healthMax;
    end

    local focusExists = function()
        if healthPercentage("Focus") < 0.0000001 then
            return false;
        else
            return true;
        end
    end

    local numberOfPartyMembersUnderPercent = function(percent)
        if(not focusExists()) then
            return 0;
        end

        local lowHealthCount = 0;
        for i=1,4 do
            local index = string.format('party%s', i);
            local health = healthPercentage(index);
            if(health < percent ) then
                lowHealthCount = lowHealthCount+1
            end
        end
        return lowHealthCount;
    end

-------------------------------VARIABLES--------------------------------------------
	
    local Mana = UnitPower('player', Enum.PowerType.Mana);
    local mainHealingTarget = "Focus";
    if not focusExists() then
        mainHealingTarget = "Player";
    end

    local focusHasLifebloom = MaxDps:UnitAura(_Lifebloom, timeShift+4, mainHealingTarget);    
    local focusHasGermination = MaxDps:UnitAura(_Germination, timeShift+4, mainHealingTarget);
    local focusHasRejunevation = MaxDps:UnitAura(_Rejunevation, timeShift+4, mainHealingTarget);
    local focusHasIronbark = MaxDps:UnitAura(_Ironbark, timeShift, mainHealingTarget);
    local focusHealth = healthPercentage(mainHealingTarget);
    local clearcastingTriggered, clearCastingCharges = MaxDps:Aura(_Clearcasting, timeShift);
    local focusIsFullLife = focusHealth >= 0.98;

	local targetHasMoonfireDot = MaxDps:TargetAura(_MoonkinMoonfire, timeShift + 5);
	local targetHasSunfireDot = MaxDps:TargetAura(_MoonkinSunfire, timeShift + 4);

-------------------------------COOLDOWNS--------------------------------------------
    
-------------------------------PRIORITY--------------------------------------------
    --debug(string.format("Focus Health: %s", focusHealth));
--if i'm really low on mana, i need Innervate
    if Mana < 10000 and MaxDps:SpellAvailable(_Innervate, timeShift) then
        return _Innervate;
    end

--if tank health is really low, he really need healing
    if focusHealth < 0.3 and MaxDps:SpellAvailable(_Swiftmend, timeShift) then
        return _Swiftmend;
    end

--HOTs on Focus (Tank) are a priority (unless full life))
    if not focusHasLifebloom and not focusIsFullLife then		
        debug("Target does not have Lifebloom!");
        return _Lifebloom;
    end
    if not focusHasRejunevation and not focusHasGermination and not focusIsFullLife then		
        debug("Target does not have Rejunevation!");
        return _Rejunevation;
    end

--if i have clearcasting, cast regrowth
    if clearcastingTriggered and focusHealth < 0.9 and MaxDps:SpellAvailable(_Regrowth, timeShift) then
        return _Regrowth;
    end

--if tank is taking a beating and i have talent Germination, cast a second Rejunevation
    if talents[_GerminationTalent] and focusHealth < 0.6 and (not focusHasGermination or not focusHasLifebloom) then
        return _Rejunevation;
    end

--to reduce incoming damage, Cast Ironbark
    if focusHealth < 0.5 and focusHasIronbark and MaxDps:SpellAvailable(_Ironbark, timeShift) then
        return _Ironbark;
    end

--if tank is still taking damage, cast Regrowth
    if focusHealth < 0.5 and MaxDps:SpellAvailable(_Regrowth, timeShift) then
        return _Regrowth;
    end

--If a lot of party member need a little healing, cast Wild Growth
    if numberOfPartyMembersUnderPercent(0.9) >= 4  and MaxDps:SpellAvailable(_WildGrowth, timeShift)then
        return _WildGrowth;
    end

--If a lot of party member need a lot of healing, cast Tranquility
    if numberOfPartyMembersUnderPercent(0.5) >= 4  and MaxDps:SpellAvailable(_Tranquility, timeShift)then
        return _Tranquility;
    end
--If people are still in need of healing, cast Efflorescence
    if numberOfPartyMembersUnderPercent(0.5) >= 4  and MaxDps:SpellAvailable(_Efflorescence, timeShift)then
        return _Efflorescence;
    end

--DOTS have a lower priority
	if not targetHasMoonfireDot then		
		--debug("Target does not have Moonfire!");
		return _Moonfire;
	end

	if not targetHasSunfireDot then
		--debug("Target does not have Sunfire!");
		return _Sunfire;
    end    

	return _SolarWrath;
end
1 post Page 1 of 1
drogie łóżka stolik kawowy stół dębowy rozkładany