Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. local _Marrowrend = 195182;
  2. local _BoneShield = 195181;
  3. local _BloodBoil = 50842;
  4. local _BloodPlague = 195740;
  5. local _DeathandDecay = 43265;
  6. local _CrimsonScourge = 81136;
  7. local _RapidDecomposition = 194662;
  8. local _DeathStrike = 49998;
  9. local _HeartStrike = 206930;
  10. local _Ossuary = 219786;
  11. local _Consumption = 205223;
  12. local _DarkCommand = 56222;
  13. local _DeathGrip = 49576;
  14. local _AntiMagicShell = 48707;
  15. local _DancingRuneWeapon = 49028;
  16. local _MouthofHell = 192570;
  17. local _VampiricBlood = 55233;
  18. local _IceboundFortitude = 48792;
  19. local _AntiMagicBarrier = 205727;
  20. local _RedThirst = 205723;
  21. local _WebofPain = 215288;
  22. local _MasteryBloodShield = 77513;
  23.  
  24. -- Frost
  25. local _IcyTalons = 194878;
  26. local _RunicAttenuation = 207104;
  27. local _Avalanche = 207142;
  28. local _Obliteration = 207256;
  29. local _FrostStrike = 49143;
  30. local _FrostFever = 55095;
  31. local _HowlingBlast = 49184;
  32. local _Rime = 59057;
  33. local _Obliterate = 49020;
  34. local _KillingMachine = 51128;
  35. local _RemorselessWinter = 196770;
  36. local _FrozenPulse = 194909;
  37. local _Frostscythe = 207230;
  38. local _GlacialAdvance = 194913;
  39. local _RunicEmpowerment = 81229;
  40. local _PillarofFrost = 51271;
  41. local _EmpowerRuneWeapon = 47568;
  42. local _SindragosasFury = 190778;
  43. local _MasteryFrozenHeart = 77514;
  44. local _AntiMagicShell = 48707;
  45. local _VolatileShielding = 207188;
  46. local _BreathofSindragosa = 152279;
  47. local _CrystallineSwords = 189186;
  48. local _Vial = 242497;
  49.  
  50. -- Talents
  51. local _isDefile = false;
  52. local _isRapidDecomposition = false;
  53. local _isObliteration = false;
  54. local _isBreathofSindragosa = false;
  55.  
  56. MaxDps.DeathKnight = {};
  57.  
  58. function MaxDps.DeathKnight.CheckTalents()
  59. MaxDps:CheckTalents();
  60. _isRapidDecomposition = MaxDps:HasTalent(_RapidDecomposition);
  61. _isObliteration = MaxDps:HasTalent(_Obliteration);
  62. _isBreathofSindragosa = MaxDps:HasTalent(_BreathofSindragosa);
  63. -- other checking functions
  64. end
  65.  
  66. function MaxDps:EnableRotationModule(mode)
  67. mode = mode or 1;
  68. MaxDps.Description = 'Death Knight Module [Blood]';
  69. MaxDps.ModuleOnEnable = MaxDps.DeathKnight.CheckTalents;
  70. if mode == 1 then
  71. MaxDps.NextSpell = MaxDps.DeathKnight.Blood;
  72. end;
  73. if mode == 2 then
  74. MaxDps.NextSpell = MaxDps.DeathKnight.Frost;
  75. end;
  76. if mode == 3 then
  77. MaxDps.NextSpell = MaxDps.DeathKnight.Unholy;
  78. end;
  79. end
  80.  
  81. function MaxDps.DeathKnight.Blood()
  82. return nil;
  83. end
  84.  
  85. function MaxDps.DeathKnight.Unholy()
  86. local timeShift, currentSpell, gcd = MaxDps:EndCast();
  87.  
  88. return nil;
  89. end
  90.  
  91. function MaxDps.DeathKnight.Frost()
  92. local timeShift, currentSpell, gcd = MaxDps:EndCast();
  93.  
  94. local runic = UnitPower('player', SPELL_POWER_RUNIC_POWER);
  95. local runicMax = UnitPowerMax('player', SPELL_POWER_RUNIC_POWER);
  96. local runes, runeCd = MaxDps.DeathKnight.Runes();
  97.  
  98. local oblit = MaxDps:Aura(_Obliteration, timeShift);
  99. local km = MaxDps:Aura(_KillingMachine, timeShift);
  100.  
  101. if (MaxDps:SpellAvailable(_PillarofFrost, timeShift)) then
  102. return _PillarofFrost;
  103. end
  104.  
  105. if MaxDps:SpellAvailable(_Obliteration, timeShift) then
  106. return _Obliteration;
  107. end
  108.  
  109. if MaxDps:SpellAvailable(_SindragosasFury, timeShift) then
  110. return _SindragosasFury;
  111. end
  112.  
  113. if MaxDps:SpellAvailable(_RemorselessWinter, timeShift) and runes > 0 then
  114. return _RemorselessWinter;
  115. end
  116.  
  117. if km and runes > 0 then
  118. return _Obliterate;
  119. end
  120.  
  121. if MaxDps:Aura(_Rime, timeShift) then
  122. return _HowlingBlast;
  123. end
  124.  
  125. if runic > 30 then
  126. return _FrostStrike;
  127. end
  128.  
  129. if runes > 1 then
  130. return _Obliterate;
  131. end
  132.  
  133. if (MaxDps:SpellAvailable(_EmpowerRuneWeapon, timeShift)) then
  134. return _EmpowerRuneWeapon
  135. end
  136.  
  137. return nil;
  138.  
  139. end
  140.  
  141. function MaxDps.DeathKnight.Runes()
  142. local count = 0;
  143. local cd = 0;
  144. local time = GetTime();
  145. for i = 1, 10 do
  146. local start, duration, runeReady = GetRuneCooldown(i);
  147. if start and start > 0 then
  148. local rcd = duration + start - time;
  149. if cd == 0 or cd > rcd then
  150. cd = rcd;
  151. end
  152. end
  153.  
  154. if runeReady then
  155. count = count + 1;
  156. end
  157. end
  158.  
  159. return count, cd;
  160. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement