To get the archon build up and running with chantodos efficiently some source edits are required for trinity(2.x)'s default Wizard build.
In the Wizard-specific routine file ( db\Plugins\Trinity\Combat\Abilities\WizardCombat.cs ), there is one function that needs to be modified, with two extra modifications that can be done to assist with getting the bot running properly with this build.
The first function that's critical to modify is ShouldStartArchon(). This is what controls whether or not you should enter Archon mode. Because this build is entirely about keeping uptime on Archon with Chantodo stacks, there's a few things we want to do in this routine.
Here is the original function:
In that code block, you can see that it first checks to make sure that you're buffed with any armors/magic weapon/familiars, then sets up the booleans for elitesOnly and trashInRange options, finally it returns if it can cast Archon and one of the two archon priority selectors are true (Elites Only or if there's a minimum number of trash mobs in range).
This is where we need to change out some of the functionality, we need to drop the elites only and trashInRange options in favor of checking the chantodos stacks.
This is a modified version of the function that also checks for Chantodo's bonus and only pops it at 20 stacks.
This replacement function removes the two checks for elites only or trash in range settings and replaces it with a check to see if we have the Chantodos bonus and haven't hit 20 stacks yet. If we don't have chantodos set bonus or we're at 20 stacks, it allows archon to be cast.
The first of the optional modifications is to prioritize Archon skill casting. The function to modify is GetCombatPower():
Towards the top of the function, you will see this section:
Immediately after this if check, insert the following check:
The final result should look like:
If we have an Archon power that can be cast, there's no need to continue executing anything below this point as we have a valid power and cannot cast regular abilities in Archon form.
The second optional modification is to clean up the GetArchonPower function referenced in the previous example code. This may be important if your bot isn't keeping SlowTime cast properly, or it's spamming something other than the blast spell.
To get started, add this function to the class (I placed it above the GetArchonPower() function).
Now that we have this function added, we need to replace the outdated check for archon slow time, The original code inside GetArchonPower that needs to be fixed:
We need to replace the bolded line with a call to our new IsSlowTimeActive check:
Further down, you will want to modify the kiting routine so that you're not constantly bouncing out of groups of mobs
The original block:
This needs to have an extra check added to prevent the teleport unless you're taking large spike damage, feel free to adjust the percentage until the bot isn't bouncing out unless there's a real danger. I used 40 during my testing.
I won't go over specifics for the last code edit, but if the bot is spamming Disintegrate instead of Blast, towards the bottom of GetArchonPower, you can comment out the abilities you don't want the bot casting.
I personally commented out all of the ability casts other than Blast.
I have attached my copy of the WizardCombat.cs file with my specific edits for those of you that aren't comfortable with making these edits yourself.
* Credit given to Trinty 3.x team for most of the edits in this code, aside from the Chantodo-specific code.
In the Wizard-specific routine file ( db\Plugins\Trinity\Combat\Abilities\WizardCombat.cs ), there is one function that needs to be modified, with two extra modifications that can be done to assist with getting the bot running properly with this build.
The first function that's critical to modify is ShouldStartArchon(). This is what controls whether or not you should enter Archon mode. Because this build is entirely about keeping uptime on Archon with Chantodo stacks, there's a few things we want to do in this routine.
Here is the original function:
Code:
private static bool ShouldStartArchon()
{
bool canCastArchon = (
CheckAbilityAndBuff(SNOPower.Wizard_MagicWeapon) &&
(!Hotbar.Contains(SNOPower.Wizard_Familiar) || IsFamiliarActive) &&
CheckAbilityAndBuff(SNOPower.Wizard_EnergyArmor) &&
CheckAbilityAndBuff(SNOPower.Wizard_IceArmor) &&
CheckAbilityAndBuff(SNOPower.Wizard_StormArmor)
);
[B]bool elitesOnly = Settings.Combat.Wizard.ArchonElitesOnly && TargetUtil.AnyElitesInRange(Settings.Combat.Wizard.ArchonEliteDistance);
bool trashInRange = !Settings.Combat.Wizard.ArchonElitesOnly && TargetUtil.AnyMobsInRange(Settings.Combat.Wizard.ArchonMobDistance, Settings.Combat.Wizard.ArchonMobCount);[/B]
return canCastArchon && [B](elitesOnly || trashInRange)[/B];
}
In that code block, you can see that it first checks to make sure that you're buffed with any armors/magic weapon/familiars, then sets up the booleans for elitesOnly and trashInRange options, finally it returns if it can cast Archon and one of the two archon priority selectors are true (Elites Only or if there's a minimum number of trash mobs in range).
This is where we need to change out some of the functionality, we need to drop the elites only and trashInRange options in favor of checking the chantodos stacks.
This is a modified version of the function that also checks for Chantodo's bonus and only pops it at 20 stacks.
Code:
private static bool ShouldStartArchon()
{
bool canCastArchon = (
CheckAbilityAndBuff(SNOPower.Wizard_MagicWeapon) &&
(!Hotbar.Contains(SNOPower.Wizard_Familiar) || IsFamiliarActive) &&
CheckAbilityAndBuff(SNOPower.Wizard_EnergyArmor) &&
CheckAbilityAndBuff(SNOPower.Wizard_IceArmor) &&
CheckAbilityAndBuff(SNOPower.Wizard_StormArmor)
);
[B] if (CacheData.Buffs.HasBuff(SNOPower.P3_ItemPassive_Unique_Ring_021) && CacheData.Buffs.GetBuff(SNOPower.P3_ItemPassive_Unique_Ring_021).StackCount < 20) {
return false;
}[/B]
[B] return canCastArchon;[/B]
}
This replacement function removes the two checks for elites only or trash in range settings and replaces it with a check to see if we have the Chantodos bonus and haven't hit 20 stacks yet. If we don't have chantodos set bonus or we're at 20 stacks, it allows archon to be cast.
The first of the optional modifications is to prioritize Archon skill casting. The function to modify is GetCombatPower():
Towards the top of the function, you will see this section:
Code:
if (GetHasBuff(SNOPower.Wizard_Archon))
{
power = GetArchonPower();
}
Immediately after this if check, insert the following check:
Code:
if (!IsNull(power)) {
return power;
}
The final result should look like:
Code:
if (GetHasBuff(SNOPower.Wizard_Archon))
{
power = GetArchonPower();
}
[B]if (!IsNull(power))
{
return power;
}[/B]
The second optional modification is to clean up the GetArchonPower function referenced in the previous example code. This may be important if your bot isn't keeping SlowTime cast properly, or it's spamming something other than the blast spell.
To get started, add this function to the class (I placed it above the GetArchonPower() function).
Code:
public static bool IsSlowTimeActive()
{
return ZetaDia.Actors.GetActorsOfType<DiaObject>().Any(a => a.ActorSNO == 5422 || a.ActorSNO == 5423);
}
Now that we have this function added, we need to replace the outdated check for archon slow time, The original code inside GetArchonPower that needs to be fixed:
Code:
if (!Player.IsIncapacitated &&
CanCast(SNOPower.Wizard_Archon_SlowTime, CanCastFlags.NoTimer) &&
[B](TimeSpanSincePowerUse(SNOPower.Wizard_Archon_SlowTime) > TimeSpan.FromSeconds(30))[/B])
{
return new TrinityPower(SNOPower.Wizard_Archon_SlowTime, 0f, Player.Position);
}
We need to replace the bolded line with a call to our new IsSlowTimeActive check:
Code:
if (!Player.IsIncapacitated &&
CanCast(SNOPower.Wizard_Archon_SlowTime, CanCastFlags.NoTimer) &&
[B]!IsSlowTimeActive()[/B])
{
return new TrinityPower(SNOPower.Wizard_Archon_SlowTime, 0f, Player.Position);
}
Further down, you will want to modify the kiting routine so that you're not constantly bouncing out of groups of mobs
The original block:
Code:
// Archon Teleport in combat for kiting
if (!Player.IsIncapacitated && CanCast(SNOPower.Wizard_Archon_Teleport, CanCastFlags.NoTimer) &&
Settings.Combat.Wizard.KiteLimit > 0 &&
// Try and teleport-retreat from 1 elite or 3+ greys or a boss at 15 foot range
(TargetUtil.AnyElitesInRange(15, 1) || TargetUtil.AnyMobsInRange(15, 3) || (CurrentTarget.IsBoss && CurrentTarget.RadiusDistance <= 15f)))
{
Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -20f);
return new TrinityPower(SNOPower.Wizard_Archon_Teleport, 35f, vNewTarget);
}
This needs to have an extra check added to prevent the teleport unless you're taking large spike damage, feel free to adjust the percentage until the bot isn't bouncing out unless there's a real danger. I used 40 during my testing.
Code:
// Archon Teleport in combat for kiting
if (!Player.IsIncapacitated && CanCast(SNOPower.Wizard_Archon_Teleport, CanCastFlags.NoTimer) &&
[B] Player.CurrentHealthPct <= 0.40 &&[/B]
Settings.Combat.Wizard.KiteLimit > 0 &&
// Try and teleport-retreat from 1 elite or 3+ greys or a boss at 15 foot range
(TargetUtil.AnyElitesInRange(15, 1) || TargetUtil.AnyMobsInRange(15, 3) || (CurrentTarget.IsBoss && CurrentTarget.RadiusDistance <= 15f)))
{
Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -20f);
return new TrinityPower(SNOPower.Wizard_Archon_Teleport, 35f, vNewTarget);
}
I won't go over specifics for the last code edit, but if the bot is spamming Disintegrate instead of Blast, towards the bottom of GetArchonPower, you can comment out the abilities you don't want the bot casting.
I personally commented out all of the ability casts other than Blast.
I have attached my copy of the WizardCombat.cs file with my specific edits for those of you that aren't comfortable with making these edits yourself.
* Credit given to Trinty 3.x team for most of the edits in this code, aside from the Chantodo-specific code.