What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Detecting Crit Chance w/ Routine

jaksemurf

Member
Joined
Apr 5, 2014
Messages
75
Reaction score
1
Is it possible to detect critical hit chance for use in a Trinity 2.x routine?

Aka I only want to add SSS to spell list if Broken Promises ring has proc'ed. As far as I know this isn't a visible buff (at least not to the player) so I was thinking I would just detect crit chance instead.

Can anyone help?
 
I had the same idea; haven't been able to find anything simple to hook into for the crit chance. I traced down where most of the other player stat values are being pulled from to Cache\CacheData.Player.cs

If you look at line 170 (internal void UpdateFastChangingData()), it defines each property using the value from the _me object which references the Demonbuddy assembly files. There are a few "crit" related properties exposed on the _me object:



I don't really know where to go from here though..
 
Did some more digging around and I think I have it working fairly well -- bot usually waits until the proc to cast SSS now. Here are the changes if you want to give it a shot:

In Trinity\Cache\CacheData.Player.cs, add the following after line 101:
Code:
public double CritPercentChance { get; private set; }

And the following after line 194:
Code:
CritPercentChance = _me.CritPercentBonusUncapped;

In Trinity\Combat\Abilities\MonkCombat.cs, change line 562 to this:
Code:
(Player.PrimaryResource >= 50 || (Player.PrimaryResource >= EnergyReserve && IsWaitingForSpecial)) && Player.CritPercentChance >= .5;

Let me know how it goes.
 
Did some more digging around and I think I have it working fairly well -- bot usually waits until the proc to cast SSS now. Here are the changes if you want to give it a shot:

In Trinity\Cache\CacheData.Player.cs, add the following after line 101:
Code:
public double CritPercentChance { get; private set; }

And the following after line 194:
Code:
CritPercentChance = _me.CritPercentBonusUncapped;

In Trinity\Combat\Abilities\MonkCombat.cs, change line 562 to this:
Code:
(Player.PrimaryResource >= 50 || (Player.PrimaryResource >= EnergyReserve && IsWaitingForSpecial)) && Player.CritPercentChance >= .5;

Let me know how it goes.

Very nice job, working perfectly, the only problem I get is when you get some unlucky streak and the ring takes long to proc.
 
Last edited:
this work perfect. I checked it also with turbohud and stormreaver theme. there you could see ingame, when he gets from 5%cc -> 100%cc

ohoh: but you get problems with your spirit gards bracers and also with your binding of the lost belt on really high grifts >50!!! so for me I went back to normal monk.cs
 
Last edited:
yeah I have enough issues with the bot trying to get to something or out of something and interrupting the auto attack chain to get up EP. I do however notice when I am doing a rift guardian that about every other SSS has the ring proc.

If anyone tries this let me know how it really works in t10/45+ Grifts. I have a feeling it could lead to unneeded deaths.
 
I did some more testing as well and it definitely seems to be causing some issues in certain situations. Oh well, worth a shot :(
 
Maybe a better implementation would be to track the number of attacks that didnt crit and make a check if fail crits in a role >= 4 wait for the fifth non crit to SSS, else use SSS. Dont know if it is possible, my knowledge in DB API and C# is very limited. That way the routine wouldnt waste so much time waiting for the buff.
 
Back
Top