Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. function(trigger)
  2.     local MS_cooldownEndSoon = trigger[1]; -- less than 1.5s cooldown left on MS
  3.     local CS_onCooldown = trigger[2]; -- less than 3s cooldown left on CS
  4.     local targetHealthAbove20 = trigger[3]; -- target health is above 20%
  5.    
  6.     local execPrecisionStacks = select(4, UnitDebuff("target", "Точность палача"));
  7.     if(execPrecisionStacks == nil) then execPrecisionStacks = 0 end;
  8.    
  9.     local shatteredDefenses = select(4, UnitBuff("player", "Брешь в защите")) ~= nil;
  10.    
  11.     local ayalasExecuteBuff = select(4, UnitBuff("player", "Каменное сердце")) ~= nil;   
  12.            
  13.     -- if ms is on cd, don't check anything
  14.     if(not MS_cooldownEndSoon) then return false; end;
  15.    
  16.     -- not an execute phase
  17.     if(targetHealthAbove20) then   
  18.         -- ring proc and CS is available - we don't MS
  19.         if (ayalasExecuteBuff and (not CS_onCooldown or shatteredDefenses)) then return false; end;
  20.         -- CS is available soon - we don't MS
  21.         if (not CS_onCooldown) then return false; end;
  22.         -- target has exec precision stacks and no SD - we don't MS
  23.         if (execPrecisionStacks > 0 and not shatteredDefenses) then return false; end;
  24.     else
  25.         -- exec phase, no precision stacks
  26.         if (execPrecisionStacks < 2) then return false; end;
  27.         -- exec phase, 2 precision stacks but no SD yet
  28.         if (execPrecisionStacks==2 and not shatteredDefenses) then return false; end;
  29.     end    
  30.     return true;
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement