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
Contents:
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
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: