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

Trinity DH Companion On-Use Abilities

Stede

New Member
Joined
Mar 29, 2014
Messages
5
Reaction score
0
Hi folks - longtime lurker / tinkerer, but 1st post here. I noticed while farming Legendary Road on Torment 1 that I'd run out of hatred fairly often and that would really slow down my farming. After doing some digging, I wrote up some some custom code that will use the Companion On-Use abilities for Demon Hunters.

What it does:
* Spider: Roots when Mobs within 25 yards.
* Bat: Gains 50 Hatred when at least 60 Hatred is Missing.
* Boar: Taunts when 4 or more Trash mobs or 1 Elite are within 20 yards.
* Wolf: Howls on CD when you're engaging an Elite.

To use it, you need to edit the DemonHunter.cs file in the following directory: \db\Plugins\Trinity\Combat\Abilities

Just above this line of code in that file:
Code:
//skillDict.Add("EvasiveFire", SNOPower.DemonHunter_EvasiveFire);

Insert the following:
Code:
            // Companion On-Use Abilities Added in 2.0
            bool hasSpider = HotbarSkills.AssignedSkills.Any(s => s.Power == SNOPower.X1_DemonHunter_Companion && s.RuneIndex == 0);
            bool hasBat = HotbarSkills.AssignedSkills.Any(s => s.Power == SNOPower.X1_DemonHunter_Companion && s.RuneIndex == 3);
            bool hasBoar = HotbarSkills.AssignedSkills.Any(s => s.Power == SNOPower.X1_DemonHunter_Companion && s.RuneIndex == 1);
            bool hasFerret = HotbarSkills.AssignedSkills.Any(s => s.Power == SNOPower.X1_DemonHunter_Companion && s.RuneIndex == 4);
            bool hasWolf = HotbarSkills.AssignedSkills.Any(s => s.Power == SNOPower.X1_DemonHunter_Companion && s.RuneIndex == 2);

            if (!Player.IsIncapacitated && Hotbar.Contains(SNOPower.X1_DemonHunter_Companion))
            {

               // Use Spider Slow on 4 or more trash mobs in an area or on Unique/Elite/Champion
               if (hasSpider && CombatBase.CanCast(SNOPower.X1_DemonHunter_Companion) && TargetUtil.ClusterExists(25f, 4) && TargetUtil.EliteOrTrashInRange(25f))
               {
                   return new TrinityPower(SNOPower.X1_DemonHunter_Companion, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 2, 1, WAIT_FOR_ANIM);
               }
                
               //Use Bat when Hatred is Needed
               if (hasBat && CombatBase.CanCast(SNOPower.X1_DemonHunter_Companion) && Player.PrimaryResourceMissing >= 60)
               {
                   return new TrinityPower(SNOPower.X1_DemonHunter_Companion, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 2, 1, WAIT_FOR_ANIM);
               }

               // Use Boar Taunt on 3 or more trash mobs in an area or on Unique/Elite/Champion
               if (hasBoar && CombatBase.CanCast(SNOPower.X1_DemonHunter_Companion) && ((TargetUtil.ClusterExists(20f, 4) && TargetUtil.EliteOrTrashInRange(20f)) || CurrentTarget.IsEliteRareUnique))
               {
                   return new TrinityPower(SNOPower.X1_DemonHunter_Companion, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 1, 1, WAIT_FOR_ANIM);
               }

               // Placeholder for Ferrets Logic - Unsure if utilities Exist to Determine Whether Gold and Health Globes are Within a Certain Range - Consider Interaction with Blood Vengeance for Optimized Results

               // Use Wolf Howl on Unique/Elite/Champion - Would help for farming trash, but trash farming should not need this - Used on Elites to reduce Deaths per hour
               if (hasWolf && CombatBase.CanCast(SNOPower.X1_DemonHunter_Companion) && CurrentTarget.IsEliteRareUnique)
               {
                   return new TrinityPower(SNOPower.X1_DemonHunter_Companion, 0f, Vector3.Zero, CurrentWorldDynamicId, -1, 2, 1, WAIT_FOR_ANIM);
               }
            }

I don't have anything written up for Ferrets, as I'm not sure how to detect gold / health globes in range. I think they'd be fun to use especially with Blood Vengeance, so if anybody has some tips, send them my way.

I've a few other custom tweaks I've been working on, including extending the range on using Marked for Death (as I run with Contagion and Ball Lightning, and MfD has a 40 yd default range while BL has a 60 yd range - leads to unnecessary hatred spent) and more conservative triggers for Smoke Screen and Shadow Power, to conserve Discipline.

Finally - I've tested this for Bat, but if you notice it acting funny for Boar / Spider / Wolf, just let me know. I'm a hobbyist, not a pro, so please backup your files before making any edits - just in case - and keep the feedback constructive - thanks!
 
ty man for realising my suggestions! :)

will test it as soon as possible, and if you dont mind, i can post more ideas here :)
 
ty man for realising my suggestions! :)

will test it as soon as posible, and if you dont mind, i can post more ideas here :)

That would be awesome, man! I really appreciate that and I'm loving your profiles!
 
- i think you read this already - Marked for Death SpellDealy in TVars need to increase for some runes. by default now it 3.000, seems like little mistake. The debuff lasts 30.000 ms. 29.000 will be good for fightes with boss. BUT with specific runes - Contagion and Valley of Death we need a low Spell delay, 5.000. All othe runes of this skill people using typically for boss fighting. Suggestion - add a switch for this skill in trinity - elites only(29.000 ms), trash only(5.000 ms).
May be its not really so important, because this skill costs 3 disc only, but he have some cast time, so we just saving our time on a boss, when casting in only every 30sec insead of every 3sec

- Lets speak about the turrets. Now bot casting it by cd - every 6 seconds, but we can have only two at once(if we not have a special legendary offhand), and this is the problem - because it costs 30 hatred. Can you fix this? To cast third turret only when first turret dissapear? (30 seconds after). like (!) 6sec (!) 24sec (!)
 
Last edited:
- i think you read this already - Marked for Death SpellDealy in TVars need to increase for some runes. by default now it 3.000, seems like little mistake. The debuff lasts 30.000 ms. 29.000 will be good for fightes with boss. BUT with specific runes - Contagion and Valley of Death we need a low Spell delay, 5.000. All othe runes of this skill people using typically for boss fighting. Suggestion - add a switch for this skill in trinity - elites only(29.000 ms), trash only(5.000 ms).
May be its not really so important, because this skill costs 3 disc only, but he have some cast time, so we just saving our time on a boss, when casting in only every 30sec insead of every 3sec

That's a good suggestion - I'll look at the SpellDelay in TVars when I've a chance and see if I can't condition the delay on the equipped rune.

- Lets speak about the turrets. Now bot casting it by cd - every 6 seconds, but we can have only two at once(if we not have a special legendary offhand), and this is the problem - because it costs 30 hatred. Can you fix this? To cast third turret only when first turret dissapear? (30 seconds after). like (!) 6sec (!) 24sec (!)

I can have a closer look at that when I get some time. The hatred cost on turrets is significant. If I can figure out which Trinity functions can check passive skills and which can check equipped gear names, I should be able to work something out. The main issuefrom there would be finding a way to count the turrets that are up already, and I'd have to check to see if SpellTracker can do that.
 
yes, i think the turrets have their ActorSNOs when they placed
 
Interesting thread. I'm gonna play the spike build in T1 difficulty (Hardcore), for exclusive legs. (build link : Demon Hunter - Game Guide - Diablo III)

Effectively, the bot simply spam all I have, especially caltrops (while I need just one for the 10% CHC buff). Seems to also spam <Marked for death> on the same spot.

Moreover, as Kevin Spacey said, turrets are expansive. I think just simply increase the cooldown could be fine (because sometimes the bot get outside the -15% damage bubble, e.g. feared or warped, and need to recreate a camp spot under his feet). I could do it by myself if I knew how to set cooldown on this file.

Anyway, this thread is really a good initiative to enhance the DH behavior.
 
@Stede

id of turrets, if you need

[QuestTools] Unit ActorSNO: 150025 Name: DH_sentry_addsMissiles-1026 Type: None Radius: 6.79 Position: x="2982" y="2816" z="24" (2982, 2816, 24) Animation: DH_sentry_idle_01 has Attributes: PrimaryDamageAttribute=1, Level=60, TeamID=2, Invulnerable=1, HitpointsCur=1264350456, HitpointsMax=1264350456, HitpointsMaxTotal=1264350456, PetOwner=1, PetCreator=1, PetType=17, SummonedByACDID=2069758367, ProjectileReflectDamageScalar=1065353216, BuffVisualEffect=1, EffectOwnerANN=2069758367,
 
can somoene make for dh chakrams with last rune works like buff not dmg skill? seems its trigger not so often now.
 
When I paste the code into the file I my bot freezes up and moves extreamly slow because it keeps getting a trinity error.

Hmmm... I get a lot of Trinity errors when I run, but none of them reference the DemonHunter.cs file. I'm not sure what's causing your error, as I can't reproduce it. I know it sounds basic, but you might double-check that you copied/pasted everything correctly.

I know Trinity has been updating lately as rrix puts more work into it, so I'll make sure I'm up-to-date and try this again to be certain that's not somehow causing it too. What rune were you using for the Companion ability?

Thanks for letting me know you're having trouble - will hopefully sort something out!

Edit: So I grabbed the new demon buddy update and then updated Trinity with the new version rrix posted a couple days ago in the forum. I had to copy / paste the code from the OP back into my DemonHunter.cs file. I'm not having any trouble anymore with any Trinity errors (Just performance warnings when I'm doing a lot at once). You might try making sure everything is updated and copying the code in again. If you still have trouble afterwards, let me know and I'll keep digging.

Another Edit: It looks like Trinity 1.8.13 (latest version as I type) is running at less than half the tick rate that the previous version (1.8.12) was. I've rolled back to 1.8.12 just because the low tick rate is having a big impact on my survivability. If you've updated, that could be why youre bot is running slow now. More Info: http://www.thebuddyforum.com/demonbuddy-forum/155389-low-tick-rate-temp-fix.html
 
Last edited:
Hmmm... I get a lot of Trinity errors when I run, but none of them reference the DemonHunter.cs file. I'm not sure what's causing your error, as I can't reproduce it. I know it sounds basic, but you might double-check that you copied/pasted everything correctly.

I know Trinity has been updating lately as rrix puts more work into it, so I'll make sure I'm up-to-date and try this again to be certain that's not somehow causing it too. What rune were you using for the Companion ability?

Thanks for letting me know you're having trouble - will hopefully sort something out!

Edit: So I grabbed the new demon buddy update and then updated Trinity with the new version rrix posted a couple days ago in the forum. I had to copy / paste the code from the OP back into my DemonHunter.cs file. I'm not having any trouble anymore with any Trinity errors (Just performance warnings when I'm doing a lot at once). You might try making sure everything is updated and copying the code in again. If you still have trouble afterwards, let me know and I'll keep digging.

Another Edit: It looks like Trinity 1.8.13 (latest version as I type) is running at less than half the tick rate that the previous version (1.8.12) was. I've rolled back to 1.8.12 just because the low tick rate is having a big impact on my survivability. If you've updated, that could be why youre bot is running slow now. More Info: http://www.thebuddyforum.com/demonbuddy-forum/155389-low-tick-rate-temp-fix.html

Thanks for the response I have been using .13 so I will try switching back. I was using the wolf rune. I thought like you said that I had copied wrong or something so I reverted to the old one and went back and tried again with the same effect. Ill just wait until Rixx gets this code implemented into the bot. This kinda of collaborate work is awesome and thanks for writing this!

Edit: working fine after switchign to .12
 
Last edited:
Lets speak about the turrets. Now bot casting it by cd - every 6 seconds,
Do you have some absurdly large amount of cooldown reduction on your gear? How is your cd 6 seconds and not 30?
 
oZUbEDf.jpg
 
Can you select that rune and click 'dump skill's from the debug tab in Trinity? I'll add it
 
Back
Top