Page 1 of 1

Added code for Brewmaster if you want

Posted: 06 Nov 2018, 23:16
by Altastic
Kaminaris,

I play brewmaster as well and added the following code for it for your review if you would like to use it.
Under Auras
  1. -- Brewmaster
  2. local _IronskinBrewAura = 215479;
Brewmaster Spells
  1. local BM = {
  2.     TigerPalmBrew           = 100780,
  3.     Transcendence           = 101643,
  4.     TranscendenceTransfer           = 119996,
  5.     KegSmash                = 121253,
  6.     BlackoutStrike          = 205523,
  7.     BreathofFire                    = 115181,
  8.     Stagger                         = 115069,
  9.     IronskinBrew                    = 115308,
  10.     FortifyingBrew          = 115203,
  11.     PurifyingBrew                   = 119582,
  12.     MasteryElusiveBrawler           = 117906,
  13.     GiftoftheOx                     = 124502,
  14.     ExpelHarm               = 115072,
  15.     ChiWaveBrew             = 115098,
  16.     ChiBurstBrew                    = 123986,
  17.     Spitfire                        = 242580,
  18.     BlackOxBrew                     = 115399,
  19.     RingofPeace                     = 116844,
  20.     SummonBlackOxStatue             = 115315,
  21.     HealingElixir                   = 122281,
  22.     DampenHarm              = 122278,
  23.     InvokeNiuzaotheBlackOx  = 132578,
  24.     HighTolerance           = 196737,
  25.     RushingJadeWindBrew     = 116847,
  26.     Guard                   = 115295,
  27.     BlackoutCombo           = 196736,
  28. };
  29.  
  30. function Monk:Brewmaster(timeShift, currentSpell, gcd, talents)
  31.     local fd = MaxDps.FrameData;
  32.     local cooldown, buff, debuff, talents, azerite, currentSpell, spellHistory =
  33.         fd.cooldown, fd.buff, fd.debuff, fd.talents, fd.azerite, fd.currentSpell, fd.spellHistory;
  34.  
  35.     local chi = UnitPower('player', Enum.PowerType.Chi);
  36.     local chiMax = UnitPowerMax('player', Enum.PowerType.Chi);
  37.     local energy = UnitPower('player', Enum.PowerType.Energy);
  38.     local energyRegen = GetPowerRegen();
  39.     local energyMax = UnitPowerMax('player', Enum.PowerType.Energy);
  40.     local energyTimeToMax = (energyMax - energy) / energyRegen;
  41.  
  42.     local targets = MaxDps:SmartAoe();
  43.  
  44.     fd.chi, fd.chiMax, fd.energy, fd.energyRegen, fd.energyMax, fd.energyTimeToMax, fd.targets =
  45.     chi, chiMax, energy, energyRegen, energyMax, energyTimeToMax, targets;
  46.    
  47.     if not buff[_IronskinBrewAura].up and cooldown[BM.IronskinBrew].ready then
  48.         return BM.IronskinBrew;
  49.     end
  50.    
  51.     if buff[_IronskinBrewAura].up and buff[_IronskinBrewAura].remains < 3 and cooldown[BM.IronskinBrew].ready then
  52.         return BM.IronskinBrew;
  53.     end
  54.    
  55.     if cooldown[BM.KegSmash].ready then
  56.         return BM.KegSmash;
  57.     end
  58.    
  59.     if cooldown[BM.BlackoutStrike].ready then
  60.         return BM.BlackoutStrike;
  61.     end
  62.    
  63.     if cooldown[BM.BreathofFire].ready then
  64.         return BM.BreathofFire;
  65.     end
  66.    
  67.     if talents[BM.RushingJadeWindBrew] and
  68.         not buff[BM.RushingJadeWindBrew].up
  69.     then
  70.         return BM.RushingJadeWindBrew;
  71.     end
  72.        
  73.     --[[ this is affected by your regen rate (Haste determines it).
  74.     if you find TigerPalm is reducting your energy to low to recast Keg Smash when availble,
  75.     increase the number below -- ]]
  76.    
  77.     if energy >= 50 then
  78.         return BM.TigerPalmBrew;
  79.     end
  80.    
  81.     if talents[BM.ChiWaveBrew] and cooldown[BM.ChiWaveBrew].ready then
  82.         return BM.ChiWaveBrew;
  83.     end
  84.    
  85.     if talents[BM.ChiBurst] and cooldown[BM.ChiBurst].ready and chi <= 3 then
  86.         return BM.ChiBurstBrew;
  87.     end
  88.    
  89.     return nil;
  90. end

Cheers!

Re: Added code for Brewmaster if you want

Posted: 07 Nov 2018, 05:32
by Kaminaris
I have edited your post.

Correct way to use Codebox is like this
 [Codebox=lua file=ANYTHING] code here [/Codebox]
it looks like this:
  1.  code here
I will check on your rotation but have you seen this?
https://github.com/simulationcraft/simc ... aster.simc

I have near automated way to convert simcraft profiles into lua code. Its on my github (But requires minimal PHP knowledge).

Re: Added code for Brewmaster if you want

Posted: 07 Nov 2018, 13:12
by Altastic
Thanks for the edit and update. I haven't checked the rotation on simcraft but simply used the older method of converting the icy veins recommended rotation to something simple. I'll check out simcraft stuff also. Not afraid of PHP as I have used it before along with several other languages.

Re: Added code for Brewmaster if you want

Posted: 16 Nov 2018, 19:03
by Mokolade
Hey :)

I also play a bit of Brewmaster and thank you for the job you did on the script !

I felt the need to do two updates :

Instead of
  1.  
  2.   if energy >= 45 then
  3.         return BM.TigerPalmBrew;
  4.   end
I did
  1.  
  2.   local energyTimeToKeg = (40 - (energy - 25) ) / energyRegen;
  3.  
  4.   if (energy >= 25 and (cooldown[BM.KegSmash].remains >= energyTimeToKeg) )  then    
  5.         return BM.TigerPalmBrew;
  6.   end
Wich allows you to use Tiger Palm only if it will not affect your next Keg Smash cast.

I added the same code just after the Keg Smash in the rotation so it will show Tiger Palm if our Brew charges are low.
  1.  
  2.   if (energy >= 25 and (cooldown[BM.KegSmash].remains >= energyTimeToKeg) )
  3.             and (cooldown[BM.IronskinBrew].charges <= 1.5)  then      
  4.                    return BM.TigerPalmBrew;
  5.   end
Fell free to give me some feedback !

I also wanted to add "Expel Harm" to the rotation but I didn't found a way to count the charges :(