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

[Guide] A walkthrough of changing skill activation criteria (range etc) for Dummies!

beardi

Member
Joined
Sep 20, 2012
Messages
586
Reaction score
21
NOTE:I've currently stopped botting/playing Diablo 3 so this post will no longer be updated/replied on unless I return. Feel free to keep it sticky'd for reference though :)


Contents:

1. Introduction
2. Editing Programs
3. Finding the right place to edit
4. Changing Range, # of monsters within that distance before using and health %.
5. Changing activation based on Fury/Mana/AP/Discipline/Spirit amount
6. Small Notes
7. Examples
8. Extra's
9. Final Thoughts




1. Introduction:

Hello there, I read a lot of posts asking for someone to change how a skill is activated, some examples: halving the range on Seven Sided Strike, increasing the base hp Mirror images is activated, decreasing the range the character is from trash mobs or elites before popping Archon.

Now the process itself is very simple! However there are some of you out there that might need a helping hand. So I hope to explain to you exactly what you can do to edit Giles' latest version of trinity without messing up any code and, hopefully, tweaking it to your skill/character build! So without further ado!



BIG Note: All ranges for Elites in skills will work perfectly, however for skill activation against trash mobs you MUST change the slider in GilesTrinity settings for "Trigger range for non-elite combat" to a higher value, if it's set at the default (18) then nothing will be attacked unless it's within 18f.

2. Editing Programs:

- Standard Windows Notepad
- Notepad++

There are many others, personally I use Notepad++ instead of Notepad because it provides a much better visual view of the code you're looking at instead of 10,000 lines of black text. I would recommend it and it is freeware to download and use :)



3. Finding the correct code to edit:

The file we are looking to change is *Insert Class*.cs, located in DBRoot/Plugins/GilesTrinity/Abilities

To find what you want to edit simply search for the skill but place "// " beforehand, for example search for
Code:
// Whirlwind
to find the code that manages whirlwind skill usage.

Sample Code we will be working from:

Code:
// Archon
                        if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Wizard_Archon) &&
                            (iElitesWithinRange[RANGE_30] >= 1 || iAnythingWithinRange[RANGE_30] >= 1 || playerStatus.dCurrentHealthPct <= 0.6 || (targetCurrent.bThisEliteRareUnique && targetCurrent.fRadiusDistance <= 30f)) &&
                            playerStatus.dCurrentEnergy >= 25 &&
                            (GilesUseTimer(SNOPower.Wizard_Archon) || 
                             (settings.bEnableCriticalMass && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Wizard_Archon]).TotalMilliseconds >= 20000)) &&
                            PowerManager.CanCast(SNOPower.Wizard_Archon))
                        {



4. Range, # of mobs within this range to activate a skill and health %:

Code:
(iElitesWithinRange[RANGE_[COLOR=#FF0000]30[/COLOR]] >= [COLOR=#0000FF]1[/COLOR] || iAnythingWithinRange[RANGE_[COLOR=#FF0000]30[/COLOR]] >= [COLOR=#0000FF]1[/COLOR] || playerStatus.dCurrentHealthPct <= [COLOR=#800080]0.6[/COLOR] || (targetCurrent.bThisEliteRareUnique && targetCurrent.fRadiusDistance <= [COLOR=#008000]30[/COLOR]f))

For the activation range simply change these numbers to 7, 12, 15, 20, 25, 30, 40 (no other numbers will work) and also change this to any number, but keep the f!

To change how many mobs within range until activation change these values, they can be different so that you can customize differences between elite and trash combat routines.

Lastly with this section of the code we can change the health % to activate the skill, very useful for defensive buffs or teleports/vault. Change this number between 0 and 1 (0.99 representing 99% of max hp)



5. Energy Criteria:

To change activation of a skill when the player reaches a certain amount of energy, or less than that amount (if you have skills that regenerate energy) some skills will have this

Code:
playerStatus.dCurrentEnergy >= 25 &&

Simply change the number to the desired amount!



6. A few things to note:

Code:
"<" - less than
">" - greater than
"<=" - less than or equal to
">=" - greater than or equal to
"==" - is exactly equal too
"||" - or
"&&" - and
"!" - not



7. Examples:

1) I want to change Archon activation to the following properties:
- 2 or more elites within 15 yards
- 4 or more trash mobs within 15 yards

The sample code above becomes

Code:
// Archon
                        if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Wizard_Archon) &&
                            (iElitesWithinRange[[COLOR=#FF0000]RANGE_15[/COLOR]] >= [COLOR=#FF8C00]2[/COLOR] || iAnythingWithinRange[[COLOR=#FF0000]RANGE_15[/COLOR]] >= [COLOR=#FF8C00]4 [/COLOR]|| playerStatus.dCurrentHealthPct <= 0.6 || (targetCurrent.bThisEliteRareUnique && targetCurrent.fRadiusDistance <= 15f)) &&
                            playerStatus.dCurrentEnergy >= 25 &&
                            (GilesUseTimer(SNOPower.Wizard_Archon) || 
                             (settings.bEnableCriticalMass && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Wizard_Archon]).TotalMilliseconds >= 20000)) &&
                            PowerManager.CanCast(SNOPower.Wizard_Archon))
                        {

2) I want to change the wizard skill Mirror Images to:
- Activate when less than 80% hp
- or when 2 or more mobs are within 30 yards.

Original code:

Code:
// Mirror Image  @ half health or 5+ monsters or rooted/incapacitated and is not a goblin or bodyblocked
                        if (!bOOCBuff && hashPowerHotbarAbilities.Contains(SNOPower.Wizard_MirrorImage) &&
                            !targetCurrent.bThisTreasureGoblin && targetCurrent.fRadiusDistance <= 25f &&
                            (playerStatus.dCurrentHealthPct <= 0.50 || iAnythingWithinRange[RANGE_25] >= 5 || playerStatus.bIsIncapacitated || playerStatus.bIsRooted) &&
                            GilesUseTimer(SNOPower.Wizard_MirrorImage, true) && PowerManager.CanCast(SNOPower.Wizard_MirrorImage))
                        {
                            return new GilesPower(SNOPower.Wizard_MirrorImage, 0f, vNullLocation, iCurrentWorldID, -1, USE_INSTANTLY);
                        }

Edited Code:
Code:
// Mirror Image  @ half health or 5+ monsters or rooted/incapacitated and is not a goblin or bodyblocked
                        if (!bOOCBuff && hashPowerHotbarAbilities.Contains(SNOPower.Wizard_MirrorImage) &&
                            !targetCurrent.bThisTreasureGoblin && targetCurrent.fRadiusDistance <= 30f &&
                            (playerStatus.dCurrentHealthPct <= [COLOR=#FF0000]0.80[/COLOR] || iAnythingWithinRange[RANGE_30] >=[COLOR=#FF8C00] 2[/COLOR] || playerStatus.bIsIncapacitated || playerStatus.bIsRooted) &&
                            GilesUseTimer(SNOPower.Wizard_MirrorImage, true) && PowerManager.CanCast(SNOPower.Wizard_MirrorImage))
                        {
                            return new GilesPower(SNOPower.Wizard_MirrorImage, 0f, vNullLocation, iCurrentWorldID, -1, USE_INSTANTLY);
                        }



8. Extra's


Removing certain item properties from the item scoring process (if you feel they aren't worth any score). Search for:

Code:
// Note that these values get all sorts of bonuses, multipliers, and extra things applied in the actual scoring routine. These values are more of a "base" value.        //                                                              Dex    Int    Str    Vit    Life%  LOH    Steal% LPS   Magic%  Gold%  MSPD   Rad  Sox    Crit%  CDam%  ASPD   Min+  Max+ Block% Thorn Allres Res   DPS    ARMOR  Disc.  Mana  Arc.  Regen  Globes
        private static double[] iWeaponPointsAtMax = new double[29] {   14000, 14000, 14000, 14000, 13000, 20000,  7000,  1000,  6000,  6000, 6000,  500, 16000, 15000, 15000,     0,    0,    0,    0, 1000, 11000,    0, 64000,     0, 10000, 8500, 8500, 10000,  8000 };
        //                                                              Dex    Int    Str    Vit    Life%  LOH    Steal% LPS   Magic%  Gold%  MSPD   Rad. Sox    Crit%  CDam%  ASPD   Min+  Max+ Block% Thorn Allres Res   DPS    ARMOR  Disc.  Mana  Arc.  Regen  Globes
        private static double[] iArmorPointsAtMax = new double[29] {    11000, 10500,  9500,  9500,  9000, 10000,  4000,  1200,  5000,  5000, 3500, 1000,  4300,  9000,  6100,  7000, 3000, 3000, 5000, 1200,  7500, 1500,     0,  5000,  4000, 3000, 3000,  6000,  5000 };
        private static double[] iJewelryPointsAtMax = new double[29] {  11500, 11000, 10000, 10000,  8000, 11000,  4000,  1200,  7500,  7500, 3500, 1000,  3500,  7500,  6300,  6800,  800,  800, 5000, 1200,  7500, 1500,     0,  4500,  4000, 3000, 3000,  6000,  5000 };

Simply change the number that corresponds to the affix you don't want to 0. This is added because I've seen a few posts regarding undesirable affixes being stashed, and people don't want to increase the base scores because they may miss something else that could sell etc.

Changing (and removing) monster priorities:

Search for:

Code:
// A list of ranged mobs that should be attacked even if they are outside of the routines current kill radius        //365, 4100 = fallen; 4300, 4304 = goat shaman; 4738 = pestilence; 4299 = goat ranged; 62736, 130794 = demon flyer; 5508 = succubus
        private static readonly HashSet<int> hashActorSNORanged = new HashSet<int> { 
            365, 4100, 4304, 4300, 4738, 4299, 62736, 130794, 5508,

And simply delete the number that corresponds to the mob you don't want to ignore (you can also add some priorities in from the list slightly above if you want :)).



9. Final Thoughts:

I hope you feel a little more confident changing the code in GilesTrinity after reading this guide. I invite all of you to ask any questions/comments/suggestions that you may have, perhaps we can turn this into a complete re-code GilesTrinity for dummies thread.

Thanks!
Beardi
 
Last edited:
"||" = or, "&&" = and, "!" = not
otherwise good job on the guide :) also check out notepad++ compare plugin
 
Great guide, I have stickied this!

But, muhahahaha, I shall leave you at the whim of the wrath of the userbase and you can maintain this guide completely how you wish! It saves me having to do it! ;)

Thanks for sharing, and it's very well written :D
 
"||" = or, "&&" = and, "!" = not
otherwise good job on the guide :) also check out notepad++ compare plugin

Ah of course :P slipped my mind, updated! And yeah I'll check out the compare plugin momentarily

Great guide, I have stickied this!

But, muhahahaha, I shall leave you at the whim of the wrath of the userbase and you can maintain this guide completely how you wish! It saves me having to do it!

Thanks for sharing, and it's very well written

Wow, thanks a lot for the sticky! I shall keep it updated etc so long as I'm botting and playing around with coding :)
 
Last edited:
Thank you for this, I tried to change something, but I cann't get it.

I run a weaponthrow built with my barb. Actually my toon goes into melee range and then uses weaponthrow. That doesn't mean that my toon always goes into melee range. If he is in combat, he uses range, but not at the start so he gets in melee range. I wanted my barb to use weaponthrow at a real range if mobs comes into maximum range. What do I have to edit or to add?
 
Btw, the "RANGE_xx" codes as of a version or two ago support a few extra ranges, ones I thought might be convenient;
The full list is:

RANGE_40, RANGE_30, RANGE_25, RANGE_20, RANGE_15, RANGE_12, RANGE_7.

And I may end up with a 50 and 60 range depending on what I end up doing with some of the Demon hunter stuff ;P

(the range stuff may be changed to a function that supports a variable number of any amount in the future, though I'd have to check timers etc. first to see what ends up faster, the current way saves many repeat-checks with every set of "if" commands for each skill and is lightning fast, and should cover most needs anyway!).
 
Thank you for this, I tried to change something, but I cann't get it.

I run a weaponthrow built with my barb. Actually my toon goes into melee range and then uses weaponthrow. That doesn't mean that my toon always goes into melee range. If he is in combat, he uses range, but not at the start so he gets in melee range. I wanted my barb to use weaponthrow at a real range if mobs comes into maximum range. What do I have to edit or to add?

By the sounds of it it's because the range to activate the Melee distance skills is quite far, if you change the melee range skills to range_7 and up the range of weapon throw to range_30 then that may fix it. Tell me how it goes :)

Btw, the "RANGE_xx" codes as of a version or two ago support a few extra ranges, ones I thought might be convenient;
The full list is:

RANGE_40, RANGE_30, RANGE_25, RANGE_20, RANGE_15, RANGE_12, RANGE_7.

And I may end up with a 50 and 60 range depending on what I end up doing with some of the Demon hunter stuff ;P

(the range stuff may be changed to a function that supports a variable number of any amount in the future, though I'd have to check timers etc. first to see what ends up faster, the current way saves many repeat-checks with every set of "if" commands for each skill and is lightning fast, and should cover most needs anyway!).

Alrighty, well I've updated the currently allowed ranges, and if you change it to a variable R then I'll change accordingly :)
 
Last edited:
By the sounds of it it's because the range to activate the Melee distance skills is quite far, if you change the melee range skills to range_7 and up the range of weapon throw to range_30 then that may fix it. Tell me how it goes :)



Alrighty, well I've updated the currently allowed ranges, and if you change it to a variable R then I'll change accordingly :)

Yeah I thought about this, but i cant find the code where I have to change it. Could you quote it for me?
 
Here it is

weaponthrow (leftmouse), rune for hitting 3 targets
Ancient spear (rightmouse), 60% heal
1: WotB
2: Revenge, rune provocation
3: Battlerage, rune rage for crits
4: War Cry, rune Impunity

Sorry, I dont play english client so I dont know all skillnames :D
 
Here it is

weaponthrow (leftmouse), rune for hitting 3 targets
Ancient spear (rightmouse), 60% heal
1: WotB
2: Revenge, rune provocation
3: Battlerage, rune rage for crits
4: War Cry, rune Impunity

Sorry, I dont play english client so I dont know all skillnames :D

Ok, I won't post the original code but if you want to see what the original code was then just search for, say, "// Weapon Throw" to find weapon throw in your original .cs

Code:
// Weapon throw
                    if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_WeaponThrow) && 
					(iElitesWithinRange[RANGE_40] >= 0 || iAnythingWithinRange[RANGE_40] >= 0 || (targetCurrent.bThisEliteRareUnique && targetCurrent.fRadiusDistance <= 40f)) && !playerStatus.bIsIncapacitated &&
                        playerStatus.dCurrentEnergy >= 10)
                    {
                        return new GilesPower(SNOPower.Barbarian_WeaponThrow, 44f, vNullLocation, -1, targetCurrent.iThisACDGUID, USE_SLOWLY);
                    }

Put in a better range modifier for the choice of when to use (40), and also previously had no specific elite/trash range stated.

Code:
// Ancient spear 
                    if (!bOOCBuff && !bCurrentlyAvoiding && !playerStatus.bIsIncapacitated && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_AncientSpear) &&
                        // Don't use if target < 20% health
                        (targetCurrent.iThisHitPoints >= 0.2 || playerStatus.dCurrentHealthPct <= 0.5) &&
                        GilesUseTimer(SNOPower.Barbarian_AncientSpear) &&
                        PowerManager.CanCast(SNOPower.Barbarian_AncientSpear))
                    {

It will now use it (if possible) when player health drops below 50% or when target mob health is above 20%

The rest of the skills shouldn't need to be edited, it was only the main attack skill and weapon throw that needed the change (I think!).

Please tell me if this has made any improvements to the combat for you :)

EDIT: Sorry if you've downloaded it already, made a small mistake in my save so have re-uploaded it for you
 

Attachments

Last edited:
Thank you for this, I tried to change something, but I cann't get it.
I run a weaponthrow built with my barb. Actually my toon goes into melee range and then uses weaponthrow. That doesn't mean that my toon always goes into melee range. If he is in combat, he uses range, but not at the start so he gets in melee range. I wanted my barb to use weaponthrow at a real range if mobs comes into maximum range. What do I have to edit or to add?

Have you increased the "Trigger Range for Non Elite Combat" in the main Trinity config, combat option tab (1st tab)?

It defaults to 18 (so if no elites in range, it ignores trash up to 18 feet away - this is very useful for people farming inferno champion packs and wanting to skip most mobs).

The value can be increased up to 80. Try setting it to 50. Weapon throw and ancient spear should already be being used at a good range.
 
Have you increased the "Trigger Range for Non Elite Combat" in the main Trinity config, combat option tab (1st tab)?

It defaults to 18 (so if no elites in range, it ignores trash up to 18 feet away - this is very useful for people farming inferno champion packs and wanting to skip most mobs).

The value can be increased up to 80. Try setting it to 50. Weapon throw and ancient spear should already be being used at a good range.

Probably a simpler way of doing it, slipped my mind as I'm always running a wiz with 45 trashrange ha.
 
Ok, I won't post the original code but if you want to see what the original code was then just search for, say, "// Weapon Throw" to find weapon throw in your original .cs

Code:
// Weapon throw
                    if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_WeaponThrow) && 
                    (iElitesWithinRange[RANGE_40] >= 0 || iAnythingWithinRange[RANGE_40] >= 0 || (targetCurrent.bThisEliteRareUnique && targetCurrent.fRadiusDistance <= 40f)) && !playerStatus.bIsIncapacitated &&
                        playerStatus.dCurrentEnergy >= 10)
                    {
                        return new GilesPower(SNOPower.Barbarian_WeaponThrow, 44f, vNullLocation, -1, targetCurrent.iThisACDGUID, USE_SLOWLY);
                    }

Put in a better range modifier for the choice of when to use (40), and also previously had no specific elite/trash range stated.

Code:
// Ancient spear 
                    if (!bOOCBuff && !bCurrentlyAvoiding && !playerStatus.bIsIncapacitated && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_AncientSpear) &&
                        // Don't use if target < 20% health
                        (targetCurrent.iThisHitPoints >= 0.2 || playerStatus.dCurrentHealthPct <= 0.5) &&
                        GilesUseTimer(SNOPower.Barbarian_AncientSpear) &&
                        PowerManager.CanCast(SNOPower.Barbarian_AncientSpear))
                    {

It will now use it (if possible) when player health drops below 50% or when target mob health is above 20%

The rest of the skills shouldn't need to be edited, it was only the main attack skill and weapon throw that needed the change (I think!).

Please tell me if this has made any improvements to the combat for you :)

EDIT: Sorry if you've downloaded it already, made a small mistake in my save so have re-uploaded it for you

Thanks for that, I'll try that out :D
 
Have you increased the "Trigger Range for Non Elite Combat" in the main Trinity config, combat option tab (1st tab)?

It defaults to 18 (so if no elites in range, it ignores trash up to 18 feet away - this is very useful for people farming inferno champion packs and wanting to skip most mobs).

The value can be increased up to 80. Try setting it to 50. Weapon throw and ancient spear should already be being used at a good range.

Its sort of a double edged sword because by increasing that trigger range, ill be targeting too many trash mobs while enroute to the waypoints, but what would be ideal would be to only target mobs at max range within its cone or what is aggroed, or when targeting elites & goblins.
 
Last edited:
Have you increased the "Trigger Range for Non Elite Combat" in the main Trinity config, combat option tab (1st tab)?

It defaults to 18 (so if no elites in range, it ignores trash up to 18 feet away - this is very useful for people farming inferno champion packs and wanting to skip most mobs).

The value can be increased up to 80. Try setting it to 50. Weapon throw and ancient spear should already be being used at a good range.

Nope, I haven't change that, so this could be the "problem" ;D. A way to easy :)
 
Have you increased the "Trigger Range for Non Elite Combat" in the main Trinity config, combat option tab (1st tab)?

It defaults to 18 (so if no elites in range, it ignores trash up to 18 feet away - this is very useful for people farming inferno champion packs and wanting to skip most mobs).

The value can be increased up to 80. Try setting it to 50. Weapon throw and ancient spear should already be being used at a good range.
Its sort of a double edged sword because by increasing that trigger range, ill be targeting too many trash mobs while enroute to the waypoints, but what would be ideal would be to only target mobs at max range within its cone or what is aggroed, or when targeting elites & goblins.

also to add:

I have tried increasing target range to 30 yday when testing it out and at maps such as stonefort or skycrown, i would try to throw weapons at mobs at the top level around the corner of staircases or ledge while im at the bottom, essentially spending all my fury hitting nothing.
 
Back
Top