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

comyn

New Member
Joined
Mar 28, 2010
Messages
9
Reaction score
1
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:

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]
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).

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.
 

Attachments

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:

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]
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).

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.

Very nice thanks for this post will be running Vyr's tomorrow perfect timing
 
Downloaded your Wizard file but now it dosent cast skill on left or right mouse button just keeps spamming blast
 
Correct, for my build, i don't use left/right abilities as i'm trying to hit as many enemies as possible and blast is by far the best way to do that. I attached a version without those abilities commented out to this post. Of note: only use this version if you're not worried about maximizing archon stacks or your bot isn't stacking in the middle of mobs
 

Attachments

Last edited:
Moved to another topic with updated WizardCombat
 
Last edited:
Big upgrade, but still got couple issues.

Bot doesn't always use archon while facing bosses, doesn't always recast armor and force wep. Anyway someone could help me with that ? I'm actally trying different settings on the trinity setup, but I can't do nothing about modifying the wizardcombat.cs because i don't know what I'm doing.
 
Big upgrade, but still got couple issues.

Bot doesn't always use archon while facing bosses, doesn't always recast armor and force wep. Anyway someone could help me with that ? I'm actally trying different settings on the trinity setup, but I can't do nothing about modifying the wizardcombat.cs because i don't know what I'm doing.

About MagicWeapon, I managed to made the buff priority (see my post on top of yours), every time before using Archon it casts the MagicWeapon, with Armor I'm not having any issues, and remember to put Archon Mob Count on 1, maximize the Range for 41 or 42 (maximum range for spell on a wizz on trinity is 40, this makes the Archon casted even it's casting Meteor, Blizzard or Electrocute from far away), disable the Archon Desintegration Wave (not efficient) and disable the "On Elites Only".
 
About MagicWeapon, I managed to made the buff priority (see my post on top of yours), every time before using Archon it casts the MagicWeapon, with Armor I'm not having any issues, and remember to put Archon Mob Count on 1, maximize the Range for 41 or 42 (maximum range for spell on a wizz on trinity is 40, this makes the Archon casted even it's casting Meteor, Blizzard or Electrocute from far away), disable the Archon Desintegration Wave (not efficient) and disable the "On Elites Only".

Works great, except that 2-3 sec doing nothing once it's get out of archon, and it doesn't put back my ice armor
 
Last edited:
Using your modified version from the OP, and it works nicely for the Stacks of Chantodo. However, it doesn't fix the most annoying issue.

When she leaves archon, she stands still for a few seconds spamming abilities in the air that never gets through.
Any fix for this?

EDIT:
Also does not recast frostarmor / forceweapon sadly. :/
 
Last edited:
Moved to another topic to make more organized
 
Last edited:
Back
Top