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

Witch Doctor melee problem

Hey,

Cant test it right now but i think this should fix your problem if I understand the code the right way.
Only looked over it for 2 minutes thats why im not sure

Go to Trinity\Combat\Abilities\ and open WitchDoctorCombat.cs

Search for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;

            return power;
And Change it for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = null;

            return power;
 
Hey,

Cant test it right now but i think this should fix your problem if I understand the code the right way.
Only looked over it for 2 minutes thats why im not sure

Go to Trinity\Combat\Abilities\ and open WitchDoctorCombat.cs

Search for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;

            return power;
And Change it for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = null;

            return power;
That would throw a null pointer exception
But you could try:
Go to Trinity\Combat\Abilities\ and open WitchDoctorCombat.cs
Search for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;

            return power;
And Change it for:
Code:
            // Default Attacks
            if (IsNull(power))
                power = SNOPower.None;

            return power;
And go to Trinity\Combat\Abilities\HandleTarget.cs Line 998 ff:
PHP:
 NoAbilitiesAvailableInARow++;
                            if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                            {
                                ShouldRefreshHotbarAbilities = true;
                                lastRemindedAboutAbilities = DateTime.UtcNow;
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                            }
And change this to
PHP:
/*
 NoAbilitiesAvailableInARow++;
                            if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                            {
                                ShouldRefreshHotbarAbilities = true;
                                lastRemindedAboutAbilities = DateTime.UtcNow;
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                            }
*/
 
Last edited:
Did not think of this. Did not write code for 2 years and just got back into botting 2 days ago.

Okay, melee is set in trinity\combat\abilities\combatbase.cs

An other possible fix:

line 292 ff
Code:
       public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }

                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }

Change it to this one:

Code:
        public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }


                    if (Trinity.Player.ActorClass == ActorClass.Witchdoctor )
                    {
                        return new TrinityPower();
                    }
                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }

its not tested again beacause I'm at work right now.
 
with this changes bot stops doing anything
With mine or Letsid?
Did not think of this. Did not write code for 2 years and just got back into botting 2 days ago.

Okay, melee is set in trinity\combat\abilities\combatbase.cs

An other possible fix:

line 292 ff
Code:
       public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }

                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }

Change it to this one:

Code:
        public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }


                    if (Trinity.Player.ActorClass == ActorClass.Witchdoctor )
                    {
                        return new TrinityPower();
                    }
                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }

its not tested again beacause I'm at work right now.
These changes will cause an TextFlood, have a look at:
HandleTarget.cs
PHP:
 if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated)
                        {
                                NoAbilitiesAvailableInARow++;
                                if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                                {
                                    ShouldRefreshHotbarAbilities = true;
                                    lastRemindedAboutAbilities = DateTime.UtcNow;
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                                }
                        }
 
Last edited:
so lets comment it out and we are good here ? ;)

EDIT:

Or ask if we are a WD:

PHP:
if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated && !(Trinity.Player.ActorClass == ActorClass.Witchdoctor))
                        {
                                NoAbilitiesAvailableInARow++;
                                if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                                {
                                    ShouldRefreshHotbarAbilities = true;
                                    lastRemindedAboutAbilities = DateTime.UtcNow;
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                                }
                        }

Not sure about syntax eighter
 
Last edited:
so lets comment it out and we are good here ? ;)

EDIT:

Or ask if we are a WD:

PHP:
if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated && !(Trinity.Player.ActorClass == ActorClass.Witchdoctor))
                        {
                                NoAbilitiesAvailableInARow++;
                                if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                                {
                                    ShouldRefreshHotbarAbilities = true;
                                    lastRemindedAboutAbilities = DateTime.UtcNow;
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                                }
                        }

Not sure about syntax eighter

Yep, that should work, thats what i postet an hour ago ^^ or do it the most beautiful way and add it to the config :P :
Code:
if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated &&
    Player.ActorClass == ActorClass.Witchdoctor && !Settings.Combat.WitchDoctor.NoMeleeAttacks)
 
Last edited:
thank you both for the support


fix for melee attack problem ( Witch Doctor )

trinity\combat\abilities\combatbase.cs

line 292

Code:

PHP:
public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }

                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }
Change it to this one:

PHP:
public static TrinityPower DefaultPower
        {
            get
            {

                // Default attacks
                if (!UseOOCBuff && !IsCurrentlyAvoiding)
                {
                    if (Trinity.Player.ActorClass == ActorClass.Monk && Hotbar.Contains(SNOPower.Monk_SweepingWind))
                    {
                        Trinity.Monk_TickSweepingWindSpam();
                    }


                    if (Trinity.Player.ActorClass == ActorClass.Witchdoctor )
                    {
                        return new TrinityPower();
                    }
                    Trinity.ShouldRefreshHotbarAbilities = true;
	
                    return new TrinityPower
                    {
                        SNOPower = DefaultWeaponPower,
                        MinimumRange = DefaultWeaponDistance,
                        TargetACDGUID = CurrentTarget.ACDGuid,
                    };
                }
                return new TrinityPower();
            }
        }


Trinity\Combat\HandleTarget.cs

Line 996
PHP:
if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated)
                        {
                            NoAbilitiesAvailableInARow++;
                            if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                            {
                                ShouldRefreshHotbarAbilities = true;
                                lastRemindedAboutAbilities = DateTime.UtcNow;
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                            }
                        }

Change it to this one:
PHP:
if (CombatBase.CurrentPower.SNOPower == SNOPower.None && !Player.IsIncapacitated && !(Trinity.Player.ActorClass == ActorClass.Witchdoctor))
                        {
                                NoAbilitiesAvailableInARow++;
                                if (DateTime.UtcNow.Subtract(lastRemindedAboutAbilities).TotalSeconds > 60 && NoAbilitiesAvailableInARow >= 4)
                                {
                                    ShouldRefreshHotbarAbilities = true;
                                    lastRemindedAboutAbilities = DateTime.UtcNow;
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Fatal Error: Couldn't find a valid attack ability. Not enough resource for any abilities or all on cooldown");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "If you get this message frequently, you should consider changing your build");
                                    Logger.Log(TrinityLogLevel.Error, LogCategory.Behavior, "Perhaps you don't have enough critical hit chance % for your current build, or just have a bad skill setup?");
                                }
                        }
 
Last edited:
new problem with this code. bot doesn't brake doors and destructible objects. bot doesn't use Piranhas for breaking doors and destructible objects now (
 
Yep, you set defaultPower always to nothing, so there will be never a cast at gates since Piranhas isn't a DestroyObjectPower, i already posted a working solution a few posts ago ;)
And i also added the function to my fork:
https://www.thebuddyforum.com/demon...55-trinity-fork-jade-harvest.html#post1551524
If you want to use Piranhas search in
/trinity/Combat/Anilities/WitchDoctor.cs for at the end
Code:
private static TrinityPower DestroyObjectPower
        {
            get
            {
add below for piranhas:
Code:
if (CanCast(SNOPower.Witchdoctor_Piranhas) && Player.PrimaryResource >= 250)
    return new TrinityPower(SNOPower.Witchdoctor_Piranhas, 25f, CurrentTarget.Position);

And don't set the default power to nothing!
 
Last edited:
Will this fix the melee combat issue for this build as well as?
 
What do you mean? which build?
Maybe this will anwser your question:
https://www.thebuddyforum.com/demon...or-melee-problem-post1555321.html#post1555321
This will add Piranhas to the default object destroy power, so objects wil lbe destroyed with this power(when its ready) -> Not tested but should work
This wil not fix the melee Problem!

Works with every build(i think its better to add it after:
Code:
 if (Hotbar.Contains(SNOPower.Witchdoctor_AcidCloud) && Player.PrimaryResource >= 175)
                    return new TrinityPower(SNOPower.Witchdoctor_AcidCloud, 12f, CurrentTarget.Position);
To improve the use with other builds.
Works with:
Alll Builds

https://www.thebuddyforum.com/demon...or-melee-problem-post1554947.html#post1554947
This will disable the meleeAtack for alll builds where no defaultpower is used. -> Tested
The Bot will just stand there and wait till the mobs are dead or he can cast a skill.
The Bot destroys doors -> tested

https://www.thebuddyforum.com/demon...55-trinity-fork-jade-harvest.html#post1551524
Trinity Fork
Working with all Builds
You can disable/enable melee attacks
some other features ;)
Here is also the SVN repo if you only want the melee attack settings i made.
https://www.assembla.com/code/unifiedtrinity-fork/subversion/commit/8

Damned just saw that i double check if the player is WD ^^
 
Last edited:
Try this instead. Destructible objects will still work, no need to edit any other files other than WitchDoctorCombat.cs

Replace:
Code:
            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;

With:
Code:
            // No default attacks, do nothing
            if (IsNull(power))
                power = new TrinityPower(SNOPower.Walk, 0f, Player.Position);
 
Try this instead. Destructible objects will still work, no need to edit any other files other than WitchDoctorCombat.cs

Replace:
Code:
            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;

With:
Code:
            // No default attacks, do nothing
            if (IsNull(power))
                power = new TrinityPower(SNOPower.Walk, 0f, Player.Position);

Well, thats a much better solution. thanks rrrix
 
@rrrix
Your solution isn't working for me I tested it with a clean Trinity.
- The Bot doesn't port to waypoints.
- The infight movement is laggy and the tps drop to 1-3
 
@rrrix
Your solution isn't working for me I tested it with a clean Trinity.
- The Bot doesn't port to waypoints.
- The infight movement is laggy and the tps drop to 1-3

I've read the whole thread, but I am confused as to which solution works the best. I want to try to stop my crusader from doing skill-less auto-hits on trash mobs instead of using HF. Please advise.
 
Back
Top