Protection Base

1 post Page 1 of 1
Играмур
Posts: 1
Joined: 28 Sep 2018, 11:23


Requires LibRangeCheck-2.0
local LibRangeCheck = LibStub:GetLibrary('LibRangeCheck-2.0')
local flag_31935 = 0
local flag_53600 = 0

function Paladin:Protection(timeShift, currentSpell, gcd, talents)
    local _, charges_53595 = MaxDps:SpellCharges(53595, timeShift);
    local _, charges_53600 = MaxDps:SpellCharges(53600, timeShift);
    charges_53595 = math.floor(charges_53595);
    charges_53600 = math.floor(charges_53600);
    if flag_53600 ~= 0 and charges_53600 ~= flag_53600 then
       flag_53600 = 0;
       flag_31935 = 0;
    end
    if flag_31935 == 1 and not MaxDps:SpellAvailable(31935, timeShift) then
       flag_31935 = 2;
    end
    -- Target exists
    if UnitExists('target') and not ( UnitIsDead('target') or UnitIsFriend('player', 'target') ) then
       local minRange, maxRange = LibRangeCheck:GetRange('target')
       if not minRange then
          minRange = 1000
       end
       if not maxRange then
          maxRange = 1000
       end
       if minRange <= 3 then
          if not MaxDps:Aura(188370, timeShift - 1) then
             MaxDps:GlowCooldown(26573, MaxDps:SpellAvailable(26573, timeShift));
          end
       end
       if maxRange <= 2 then
          if flag_31935 == 2 and charges_53600 >= 1 then
             flag_53600 = charges_53600;
             return 53600;
          end
          if not MaxDps:SpellAvailable(31935, timeShift) and charges_53595 > 1 then
             return 53595;
          end
          if not MaxDps:Aura(132403, timeShift) and charges_53600 >= 2 then
             return 53600;
          end
          if not MaxDps:SpellAvailable(31935, timeShift) and MaxDps:SpellAvailable(53595, timeShift) then
             return 53595;
          end
          if not MaxDps:SpellAvailable(31935, timeShift) and charges_53600 > 1 then
             return 53600;
          end
       end
       if maxRange < 30 then
          if MaxDps:SpellAvailable(31935, timeShift) then
             flag_31935 = 1;
             return 31935;
          end
          if MaxDps:SpellAvailable(275779, timeShift) then
             return 275779;
          end
       end
       return nil
    end
    return nil
end
1 post Page 1 of 1
drogie łóżka stolik kawowy stół dębowy rozkładany