main.lua now including Subtletey rogue

10 posts Page 1 of 1
Orynge
Posts: 3
Joined: 23 Sep 2017, 18:20


Known issues:

1. Switching specs you will have to reload only to fix the MaxDps.Description setting. This setting seems to be
retained from prior spec load.

2. Not sure my use of MaxDps:TargetsInRange(_ShurikenStorm) is correct, since target value not getting set, or from
what I can tell my spell ShurikenStorm is never getting called out(highlighted)

3. Multiple abilities are highlighted from the start; it us up to user to figure out their ideal Subtlety rotation from the
start.


Below is my first workable version of my new main.lua file that now includes the rogue Subtlety spec rotation.
-----------------------------------------------------------------------------------------------------------------
  1. -- Outlaw
  2. local _BladeFlurry = 13877;
  3. local _RolltheBones = 193316;
  4. local _TrueBearing = 193359;
  5. local _SharkInfestedWaters = 193357;
  6. local _GhostlyStrike = 196937;
  7. local _CurseoftheDreadblades = 202665;
  8. local _AdrenalineRush = 13750;
  9. local _MarkedforDeath = 137619;
  10. local _RunThrough = 2098;
  11. local _Broadsides = 193356;
  12. local _PistolShot = 185763;
  13. local _Opportunity = 195627;
  14. local _SaberSlash = 193315;
  15. local _Ambush = 8676;
  16. local _CheapShot = 1833;
  17. local _PreyontheWeak = 131511;
  18. local _DeeperStratagem = 193531;
  19. local _JollyRoger = 199603;
  20. local _GrandMelee = 193358;
  21. local _BuriedTreasure = 199600;
  22. local _SliceandDice = 5171;
  23. local _DeathfromAbove = 152150;
  24. local _Vigor = 14983;
  25. local _CombatPotency = 35551;
  26. local _Bloodlust = 2825;
  27. local _Heroism = 32182;
  28. local _TimeWarp = 80353;
  29. local _Ruthlessness = 14161;
  30. local _Sprint = 2983;
  31. local _BetweentheEyes = 199804;
  32. local _Blind = 2094;
  33. local _CloakofShadows = 31224;
  34. local _Riposte = 199754;
  35. local _GrapplingHook = 195457;
  36. local _CannonballBarrage = 185767;
  37. local _KillingSpree = 51690;
  38. local _Feint = 1966;
  39. local _Elusiveness = 79008;
  40. local _CheatDeath = 31230;
  41. local _CrimsonVial = 185311;
  42. local _HiddenBlade = 202753;
  43.  
  44. -- Auras
  45. local _Stealth = 1784;
  46. local _Vanish = 1856;
  47.  
  48. -- Subtlety
  49. local _ShadowBlades = 121471;
  50. local _ShadowDance = 185313;
  51. local _ShadowStrike = 185438;
  52. local _GoremawsBite = 209782;
  53. local _NightBlade = 195452;
  54. local _SymbolsofDeath = 212283;
  55. local _Eviscerate = 196819;
  56. local _BackStab = 53;
  57. local _DeathfromAbove = 152150;
  58. local _ShurikenStorm = 197835;
  59. local _Shadowstep = 36554;
  60. local _Feint = 1966;
  61. local _ShurikenToss = 114014;
  62. local _KidneyShot = 408;
  63. local _CheapShot = 1833;
  64.  
  65.  
  66. -- Talents
  67. local _isGhostlyStrike = false;
  68. local _isMarkedforDeath = false;
  69. local _isDeathfromAbove = false;
  70.  
  71. MaxDps.Rogue = {};
  72.  
  73. function MaxDps.Rogue.CheckTalents()
  74.     MaxDps:CheckTalents();
  75.     _isGhostlyStrike = MaxDps:HasTalent(_GhostlyStrike);
  76.     _isMarkedforDeath = MaxDps:HasTalent(_MarkedforDeath);
  77.     _isDeathfromAbove = MaxDps:HasTalent(_DeathfromAbove);
  78. end
  79.  
  80. function MaxDps:EnableRotationModule(mode)
  81.     mode = mode or 1;
  82.     -- MaxDps.Description = 'Rogue [Outlaw]';
  83.     MaxDps.ModuleOnEnable = MaxDps.Rogue.CheckTalents;
  84.     if mode == 1 then
  85.         MaxDps.NextSpell = MaxDps.Rogue.Assassination;
  86.     end;
  87.     if mode == 2 then
  88.         MaxDps.Description = 'Rogue [Outlaw]';
  89.         MaxDps.NextSpell = MaxDps.Rogue.Outlaw;
  90.     end;
  91.     if mode == 3 then
  92.          MaxDps.Description = 'Rogue [Subtlety]';
  93.          MaxDps.NextSpell = MaxDps.Rogue.Subtlety;
  94.     end;
  95. end
  96.  
  97. function MaxDps.Rogue.Assassination()
  98.     local timeShift, currentSpell, gcd = MaxDps:EndCast();
  99.  
  100.     return nil;
  101. end
  102.  
  103. function MaxDps.Rogue.Outlaw()
  104.     local timeShift, currentSpell, gcd = MaxDps:EndCast();
  105.  
  106.     local energy = UnitPower('player', SPELL_POWER_ENERGY);
  107.     local combo = GetComboPoints('player', 'target');
  108.  
  109.     MaxDps:GlowCooldown(_AdrenalineRush, MaxDps:SpellAvailable(_AdrenalineRush, timeShift));
  110.     MaxDps:GlowCooldown(_CurseoftheDreadblades, MaxDps:SpellAvailable(_CurseoftheDreadblades, timeShift));
  111.     MaxDps:GlowCooldown(_KillingSpree, MaxDps:SpellAvailable(_KillingSpree, timeShift));
  112.  
  113.     if MaxDps:PersistentAura(_Stealth, timeShift) then
  114.         return _Ambush;
  115.     end
  116.  
  117.     local curse = MaxDps:Aura(_CurseoftheDreadblades, timeShift, 'HARMFUL');
  118.  
  119.     -- roll the bones auras
  120.     local rb = {
  121.         TB = MaxDps:Aura(_TrueBearing, timeShift + 3),
  122.         SIW = MaxDps:Aura(_SharkInfestedWaters, timeShift + 3),
  123.         JR = MaxDps:Aura(_JollyRoger, timeShift + 3),
  124.         GM = MaxDps:Aura(_GrandMelee, timeShift + 3),
  125.         BS = MaxDps:Aura(_Broadsides, timeShift + 3),
  126.         BT = MaxDps:Aura(_BuriedTreasure, timeShift + 3),
  127.     }
  128.     -- buty, sprint co CD
  129.     local rbCount = 0;
  130.     for k, v in pairs(rb) do
  131.         if v then
  132.             rbCount = rbCount + 1;
  133.         end
  134.     end
  135.  
  136.     local shouldRoll = not rb.TB and rbCount < 2;
  137.  
  138.     if shouldRoll and combo >=4 and energy >= 20 then
  139.         return _RolltheBones;
  140.     end
  141.  
  142.     if _isGhostlyStrike and not MaxDps:TargetAura(_GhostlyStrike, timeShift + 3) and energy > 30 then
  143.         return _GhostlyStrike;
  144.     end
  145.  
  146.     if _isMarkedforDeath and combo < 2 and MaxDps:SpellAvailable(_MarkedforDeath, timeShift) then
  147.         return _MarkedforDeath;
  148.     end
  149.  
  150.     if (combo >= 6 or (combo >= 5 and rb.BS)) then
  151.         return _RunThrough;
  152.     end
  153.  
  154.     if MaxDps:Aura(_Opportunity, timeShift) and combo <= 4 then
  155.         return _PistolShot;
  156.     end
  157.  
  158.     return _SaberSlash;
  159. end
  160.  
  161.  
  162. function MaxDps.Rogue.Subtlety()
  163.     local timeShift, currentSpell, gcd = MaxDps:EndCast();
  164.  
  165.     local energy = UnitPower('player', SPELL_POWER_ENERGY);
  166.     local combo = GetComboPoints('player', 'target');
  167.     local targets = MaxDps:TargetsInRange(_ShurikenStorm);
  168.  
  169.     MaxDps:GlowCooldown(_GoremawsBite, MaxDps:SpellAvailable(_GoremawsBite, timeShift));
  170.     MaxDps:GlowCooldown(_ShadowBlades, MaxDps:SpellAvailable(_ShadowBlades, timeShift));
  171.     MaxDps:GlowCooldown(_Vanish, MaxDps:SpellAvailable(_Vanish, timeShift));
  172.  
  173.     if _isDeathfromAbove then
  174.        MaxDps:GlowCooldown(_DeathfromAbove, MaxDps:SpellAvailable(_DeathfromAbove, timeShift));
  175.     end
  176.  
  177.     MaxDps:GlowCooldown(_ShadowDance, MaxDps:SpellAvailable(_ShadowDance, timeShift));
  178.     MaxDps:GlowCooldown(_SymbolsofDeath, MaxDps:SpellAvailable(_SymbolsofDeath, timeShift));
  179.  
  180. -- The Rotation!
  181.  
  182.     if MaxDps:SpellAvailable(_ShadowBlades, timeShift) then
  183.        return _ShadowBlades;
  184.     end
  185.  
  186.     if MaxDps:SpellAvailable(_ShadowDance, timeShift) and (energy > 80) then
  187.         return _ShadowDance;
  188.     end
  189.  
  190.     if  MaxDps:PersistentAura(_Stealth, timeShift) or MaxDps:PersistentAura(_Vanish, timeShift) then
  191.         if MaxDps:SpellAvailable(_ShadowStrike, timeShift) then
  192.             return _ShadowStrike;
  193.         end
  194.     end
  195.  
  196.     if (MaxDps:SpellAvailable(_DeathfromAbove, timeShift) and MaxDps:Aura(_Stealth, timeShift)) then
  197.         return _DeathfromAbove;
  198.     end
  199.  
  200.     if (MaxDps:SpellAvailable(_GoremawsBite, timeShift)) and (combo <= 3 and energy <= 25) then
  201.         return _GoremawsBite;
  202.     end
  203.  
  204.     if MaxDps:SpellAvailable(_NightBlade, timeShiftsss) and (combo >= 4) then
  205.         return _NightBlade;
  206.     end
  207.  
  208.     if MaxDps:SpellAvailable(_SymbolsofDeath, timeShift) then
  209.         return _SymbolsofDeath;
  210.     end
  211.  
  212.     if  MaxDps:SpellAvailable(_Eviscerate, timeShift) and (combo >= 5) then
  213.         return _Eviscerate;
  214.     end
  215.  
  216.     if targets > 2 then
  217.       return _ShurikenStorm;
  218.     end
  219.  
  220.     return _BackStab;
  221. end
Orynge
Posts: 3
Joined: 23 Sep 2017, 18:20


Another issue:

ShadowStrike is not highlighted as expected soon after calling ShadowDance. Still need to figure that out.
Kaminaris
Site Admin
Posts: 121
Joined: 25 Jun 2017, 03:45


I am not sure if you know, but since quite long time there is an option to write a single rotation without needing to override whole addon module code:

viewtopic.php?f=4&t=4
Orynge
Posts: 3
Joined: 23 Sep 2017, 18:20


Thank you. So for the single rotation for subtlety, simply cut and paste within the pre-built function call the following code:

local _ShadowBlades = 121471;
local _ShadowDance = 185313;
local _ShadowStrike = 185438;
local _GoremawsBite = 209782;
local _NightBlade = 195452;
local _SymbolsofDeath = 212283;
local _Eviscerate = 196819;
local _BackStab = 53;
local _DeathfromAbove = 152150;
local _ShurikenStorm = 197835;
local _Shadowstep = 36554;
local _Feint = 1966;
local _ShurikenToss = 114014;
local _KidneyShot = 408;
local _CheapShot = 1833;

-- Auras
local _Stealth = 1784;
local _Vanish = 1856;

-- Talents
local _isDeathfromAbove = false;

MaxDps.Rogue = {};

function MaxDps.Rogue.CheckTalents()
MaxDps:CheckTalents();
_isDeathfromAbove = MaxDps:HasTalent(_DeathfromAbove);
end


local timeShift, currentSpell, gcd = MaxDps:EndCast();

local energy = UnitPower('player', SPELL_POWER_ENERGY);
local combo = GetComboPoints('player', 'target');
local targets = MaxDps:TargetsInRange(_ShurikenStorm);

MaxDps:GlowCooldown(_GoremawsBite, MaxDps:SpellAvailable(_GoremawsBite, timeShift));
MaxDps:GlowCooldown(_ShadowBlades, MaxDps:SpellAvailable(_ShadowBlades, timeShift));
MaxDps:GlowCooldown(_Vanish, MaxDps:SpellAvailable(_Vanish, timeShift));

if _isDeathfromAbove then
MaxDps:GlowCooldown(_DeathfromAbove, MaxDps:SpellAvailable(_DeathfromAbove, timeShift));
end

MaxDps:GlowCooldown(_ShadowDance, MaxDps:SpellAvailable(_ShadowDance, timeShift));
MaxDps:GlowCooldown(_SymbolsofDeath, MaxDps:SpellAvailable(_SymbolsofDeath, timeShift));

-- The Rotation!

if MaxDps:SpellAvailable(_ShadowBlades, timeShift) then
return _ShadowBlades;
end

if MaxDps:SpellAvailable(_ShadowDance, timeShift) and (energy > 80) then
return _ShadowDance;
end

if (MaxDps:PersistentAura(_Stealth, timeShift)) or (MaxDps:PersistentAura(_Vanish, timeShift)) then
if MaxDps:SpellAvailable(_ShadowStrike, timeShift) then
return _ShadowStrike;
end
end

if (MaxDps:SpellAvailable(_DeathfromAbove, timeShift) and MaxDps:Aura(_Stealth, timeShift)) then
return _DeathfromAbove;
end

if (MaxDps:SpellAvailable(_GoremawsBite, timeShift)) and (combo <= 3 and energy <= 25) then
return _GoremawsBite;
end

if MaxDps:SpellAvailable(_NightBlade, timeShiftsss) and (combo >= 4) then
return _NightBlade;
end

if MaxDps:SpellAvailable(_SymbolsofDeath, timeShift) then
return _SymbolsofDeath;
end

if MaxDps:SpellAvailable(_Eviscerate, timeShift) and (combo >= 5) then
return _Eviscerate;
end

if targets > 2 then
return _ShurikenStorm;
end

return _BackStab;
zalid
Posts: 2
Joined: 30 Nov 2017, 23:35


I've just tried this.
I placed the rotation in the /maxdps system and it keeps saying :
[string "return local_ShadowBlades = 121471;...."]:1:'<eof>' expected near '='
Any ideas why it's not working ?
Kaminaris
Site Admin
Posts: 121
Joined: 25 Jun 2017, 03:45


Look at this topic:
viewtopic.php?f=4&t=4

basically the code above misses function part,
just above:
function(_, timeShift, currentSpell, gcd)
and just below:
end
zalid
Posts: 2
Joined: 30 Nov 2017, 23:35


Thanks for the reply and fix. Seems to have gotten it to work though all it seems to do is highlight Goremaw's Bite and nothing else. Shame.
Kaminaris
Site Admin
Posts: 121
Joined: 25 Jun 2017, 03:45


I will check it and see if it works. But i see some bugs there.
Emmaleah
Posts: 2
Joined: 25 Feb 2018, 07:14


It seems to work. The only problem i had with it is it always says It cant find shadow strike on my bars. I have it on the stance bar for when I am stealthed. but not on the other (unstealthed) which seems to work fine for playing, but makes this setup unhappy.
Kaminaris
Site Admin
Posts: 121
Joined: 25 Jun 2017, 03:45


Yeah thats the major problem with rogue, his bars are changing so unless i will be performing fast scans (which are out of question because it will make FPS drop like crazy) it will be calling Spell not found, you may try to change this piece of code:

core.lua of MaxDps CORE addon, not rogue module, line 387
Code: Select all
function MaxDps:ButtonFetch()
	if self.rotationEnabled then
		if self.fetchTimer then
			self:CancelTimer(self.fetchTimer);
		end
		self.fetchTimer = self:ScheduleTimer('Fetch', 0.5);
	end
end
See there is a timer for fetching buttons set to 0.5s, try setting it to 0.2s or even lower and see what happens.
10 posts Page 1 of 1
drogie łóżka stolik kawowy stół dębowy rozkładany