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

About the problem of DH's Preparation/Punishment

cmcc2

New Member
Joined
Apr 12, 2014
Messages
5
Reaction score
0
hi all, when I use DB with trinity I found that if DH has discipline over 60, bot will use ALL discipline at once. I want trinity to use Preparation/Punishment with proper limit, for excample, if hatred>100 or something it won't use Preparation. Can I fix this with modifying some paras in trinity configuration files?
 
hi all, when I use DB with trinity I found that if DH has discipline over 60, bot will use ALL discipline at once. I want trinity to use Preparation/Punishment with proper limit, for excample, if hatred>100 or something it won't use Preparation. Can I fix this with modifying some paras in trinity configuration files?


Let me know if you figure anything out. been asking about this the last week.
 
I fixed it myself.

Add the following condition to Combat\Abilities\DemonHunter.cs
Code:
TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500

Because the ability has no cooldown, the routine uses it several times before the game actually updates your hatred. The final code should look something like below:

Code:
                // Preperation w/ Punishment
                if (hasPunishment && CombatBase.CanCast(SNOPower.DemonHunter_Preparation, CombatBase.CanCastFlags.NoTimer) && Player.SecondaryResource >= 21 && Player.PrimaryResourceMissing >= 75 && TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500)
                {
                    return new TrinityPower(SNOPower.DemonHunter_Preparation, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 1, 1, WAIT_FOR_ANIM);
                }

P.S. I changed the discipline requirement because my Preparation only costs 21.
 
I fixed it myself.

Add the following condition to Combat\Abilities\DemonHunter.cs
Code:
TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500

Because the ability has no cooldown, the routine uses it several times before the game actually updates your hatred. The final code should look something like below:

Code:
                // Preperation w/ Punishment
                if (hasPunishment && CombatBase.CanCast(SNOPower.DemonHunter_Preparation, CombatBase.CanCastFlags.NoTimer) && Player.SecondaryResource >= 21 && Player.PrimaryResourceMissing >= 75 && TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500)
                {
                    return new TrinityPower(SNOPower.DemonHunter_Preparation, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 1, 1, WAIT_FOR_ANIM);
                }

P.S. I changed the discipline requirement because my Preparation only costs 21.


finally it worked! thanks dude you are awesome :)
 
I fixed it myself.

Add the following condition to Combat\Abilities\DemonHunter.cs
Code:
TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500

Because the ability has no cooldown, the routine uses it several times before the game actually updates your hatred. The final code should look something like below:

Code:
                // Preperation w/ Punishment
                if (hasPunishment && CombatBase.CanCast(SNOPower.DemonHunter_Preparation, CombatBase.CanCastFlags.NoTimer) && Player.SecondaryResource >= 21 && Player.PrimaryResourceMissing >= 75 && TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500)
                {
                    return new TrinityPower(SNOPower.DemonHunter_Preparation, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 1, 1, WAIT_FOR_ANIM);
                }

P.S. I changed the discipline requirement because my Preparation only costs 21.

when i add this my trinity no longer works
 
Whats the point in having the discipline requirement to use the punishment +75 hatred rune? I made a fix for this and showed how to copy paste it into your demonhunter combat routine file, soon as you had less then 40 hatred it casted prep. What are you using that takes discipline that you need to trigger a hatred replenishment? I was going to think vault, but then I realized vault would take discipline and using hatred would do nothing, and if you were using danettas to vault with hatred there would be no reason for SecondaryResource command. Just curious to see what im missing out on. I don't run bloody vengeance, I have 150 hatred. and this is what I use for the bot to use prep punishment I basically took a ability no one uses(shadow power) and rewrote a few lines and values to work for hatred. It still has a bit of shadow power code in it, but it doesn't effect it in any way just makes it look a tad ugly and unclean code as opposed to someone making a neater one that simply checks if bots under 40 hatred to use prep punishment, code below:


// Spam Shadow Power - fixed for prep punishment
if (Settings.Combat.DemonHunter.SpamShadowPower && CanCast(SNOPower.DemonHunter_ShadowPower) && !Player.IsIncapacitated &&
(!GetHasBuff(SNOPower.DemonHunter_ShadowPower) || Player.CurrentHealthPct <= Trinity.PlayerEmergencyHealthPotionLimit) && // Uses Preparation when equal or less then 40 hatred
((!Runes.DemonHunter.Punishment.IsActive && Player.PrimaryResource <= 40) || (Runes.DemonHunter.Punishment.IsActive && Player.PrimaryResource <= 40)) &&
(Settings.Combat.DemonHunter.SpamShadowPower && Player.SecondaryResource <= 25))
{
return new TrinityPower(SNOPower.DemonHunter_ShadowPower);
}

By the look of it you would think it would only use it when your at emergency health level because it checks for that on when to use, but it doesn't. You can run the bot and spam CA down to <40 and the bot will pop prep properly restoring hatred. Anyone who wants to rewrite the above code to clean it up and get rid of the shadow power junk is welcome.
 
I fixed it myself.

Add the following condition to Combat\Abilities\DemonHunter.cs
Code:
TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500

Because the ability has no cooldown, the routine uses it several times before the game actually updates your hatred. The final code should look something like below:

Code:
                // Preperation w/ Punishment
                if (hasPunishment && CombatBase.CanCast(SNOPower.DemonHunter_Preparation, CombatBase.CanCastFlags.NoTimer) && Player.SecondaryResource >= 21 && Player.PrimaryResourceMissing >= 75 && TimeSinceUse(SNOPower.DemonHunter_Preparation) > 500)
                {
                    return new TrinityPower(SNOPower.DemonHunter_Preparation, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 1, 1, WAIT_FOR_ANIM);
                }

P.S. I changed the discipline requirement because my Preparation only costs 21.

i tried adding this and it makes my trinity not show up in the plugins list can any one tell me why ?
 
Back
Top