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

[Custom Class] Mammon - The Prince of Greed, All-In-One Combat Routine

Status
Not open for further replies.
after getting some advice in, syncirc, #crypts. i came up with the following wizard script. im going to run it now and see the results. this one should actually work.


Code:
using System;
using System.Linq;

using Mammon.Dynamics;
using Mammon.Helpers;
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Internals.Actors;
using Zeta.TreeSharp;
using Action = Zeta.TreeSharp.Action;

namespace Mammon.Routines
{
    public class Wizard
    {
        private static int ClusterCount { get { return Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 20f); } }


        [Class(ActorClass.Wizard)]
        [Behavior(BehaviorType.OutOfCombat)]
        [Priority(2)]
        public static Composite WizardBuff()
        {
            return
            new PrioritySelector(
                    Spell.Buff(SNOPower.Wizard_IceArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_IceArmor)),
                    Spell.Buff(SNOPower.Wizard_StormArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_StormArmor)),
                    Spell.Buff(SNOPower.Wizard_EnergyArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_EnergyArmor)),
                    Spell.Buff(SNOPower.Wizard_MagicWeapon, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_MagicWeapon))
            );
        }
        [Class(ActorClass.Wizard)]
        [Behavior(BehaviorType.Combat)]
        [Priority(1)]
        public static Composite WizardCombat()
        {
            return
                new PrioritySelector(ctx => CombatTargeting.Instance.FirstNpc,

                    Common.CreateWaitWhileIncapacitated(),
                    Common.CreateWaitForAttack(),
                    Common.CreateUsePotion(),

                    // Make sure we are within range/line of sight of the unit.
                    Movement.MoveTo(ctx => ((DiaUnit)ctx).Position, 30f),
                    //Movement.MoveToLineOfSight(ctx => ((DiaUnit)ctx)),

                    // Low health stuff
                    Spell.CastAOESpell(SNOPower.Wizard_DiamondSkin, extra => ZetaDia.Me.HitpointsCurrentPct <= 0.4),
                    Spell.Buff(SNOPower.Wizard_MirrorImage, extra => ZetaDia.Me.HitpointsCurrentPct <= 0.5),

                    //Buffs
                    Spell.Buff(SNOPower.Wizard_IceArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_IceArmor)),
                    Spell.Buff(SNOPower.Wizard_StormArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_StormArmor)),
                    Spell.Buff(SNOPower.Wizard_EnergyArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_EnergyArmor)),
                    Spell.Buff(SNOPower.Wizard_MagicWeapon, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_MagicWeapon)),
                    Spell.Buff(SNOPower.Wizard_Familiar, extra => !HasFamiliar),

                    // AoE spells.
                    Spell.CastAOESpell(SNOPower.Wizard_WaveOfForce,
                        require => Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_WaveOfForce) && CombatTargeting.Instance.FirstNpc.Distance < 2f && Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 8f) >= 2 && ZetaDia.Me.HitpointsCurrentPct <= 0.8
                    ),
                    Spell.CastAOESpell(SNOPower.Wizard_FrostNova,
                        require => Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_FrostNova) && CombatTargeting.Instance.FirstNpc.Distance < 2f && Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 8f) >= 2 && ZetaDia.Me.HitpointsCurrentPct <= 0.8
                    ),
                    Spell.CastOnUnit(SNOPower.Wizard_EnergyTwister,
                         ctx => ((DiaUnit)ctx).ACDGuid,
                         req => Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 15f) >= 2 && CombatTargeting.Instance.FirstNpc.Distance < 4f && Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_EnergyTwister)
                    ),
                    Spell.CastOnUnit(SNOPower.Wizard_Meteor,
                         ctx => ((DiaUnit)ctx).ACDGuid,
                         req => Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 15f) >= 2 && CombatTargeting.Instance.FirstNpc.Distance < 4f && Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_Meteor)
                    ),

                    Spell.CastOnUnit(SNOPower.Wizard_Blizzard,
                         ctx => ((DiaUnit)ctx).ACDGuid,
                         req => Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 15f) >= 2 && CombatTargeting.Instance.FirstNpc.Distance < 4f && Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_Blizzard)
                    ),

                    Spell.CastAOESpell(SNOPower.Wizard_ExplosiveBlast,
                         require => Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_ExplosiveBlast) && CombatTargeting.Instance.FirstNpc.Distance < 5f && Clusters.GetClusterCount(ZetaDia.Me, CombatTargeting.Instance.LastObjects, ClusterType.Radius, 8f) >= 2
                    ),

                    //Hydra
                    Spell.CastAtLocation(SNOPower.Wizard_Hydra, ctx => ((DiaUnit)ctx).Position, exta => !HasHydra),

                    // Arcane power spenders.
                    Spell.CastOnUnit(SNOPower.Wizard_ArcaneOrb, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_RayOfFrost, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_ArcaneTorrent, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_Disintegrate, ctx => ((DiaUnit)ctx).ACDGuid),

                    // Signature spells.
                    Spell.CastOnUnit(SNOPower.Wizard_SpectralBlade, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_Electrocute, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_ShockPulse, ctx => ((DiaUnit)ctx).ACDGuid),
                    Spell.CastOnUnit(SNOPower.Wizard_MagicMissile, ctx => ((DiaUnit)ctx).ACDGuid)

                );
        }

        public static bool HasFamiliar
        {
            get
            {
                int dynId = ZetaDia.Me.CommonData.DynamicId;
                var summoned = ZetaDia.Actors.GetActorsOfType<DiaUnit>().FirstOrDefault(u => u.SummonedByACDId == dynId && u.Name.Contains("Familiar"));
                return summoned != null;
            }
        }

        public static bool HasHydra
        {
            get
            {
                int dynId = ZetaDia.Me.CommonData.DynamicId;
                var summoned = ZetaDia.Actors.GetActorsOfType<DiaUnit>().FirstOrDefault(u => u.SummonedByACDId == dynId && u.Name.Contains("Hydra"));
                return summoned != null;
            }
        }

        public static void WizardOnLevelUp(object sender, EventArgs e)
        {
            if (ZetaDia.Me.ActorClass != ActorClass.Wizard)
                return;

            int myLevel = ZetaDia.Me.Level;

            Logger.Write("Player leveled up, congrats! Your level is now: {0}",
                myLevel
                );

            // Set Ray of Frost as secondary spell.
            if (myLevel == 2)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_RayOfFrost, -1, 1);
                Logger.Write("Setting Ray of Frost as Secondary");
            }

            // Set Shock Pulse as primary.
            if (myLevel == 3)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_ShockPulse, -1, 0);
                Logger.Write("Setting Shock Pulse as Primary");
            }

            if (myLevel == 4)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_FrostNova, -1, 2);
                Logger.Write("Setting Frost Nova as Defensive");
            }

            if (myLevel == 5)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_ArcaneOrb, -1, 1);
                Logger.Write("Setting Arcane Orb as Secondary");
            }

            if (myLevel == 8)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_DiamondSkin, -1, 2);
                Logger.Write("Setting Diamond Skin as Defensive");
            }

            if (myLevel == 9)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_WaveOfForce, -1, 3);
                Logger.Write("Setting Wave of Force as Force");

                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_ShockPulse, -1, 2);
                Logger.Write("Changing rune for Shock Pulse: \"Explosive Bolts\"");
            }

            // First passive skill!
            if (myLevel == 10)
            {
                // Blur - Decreases melee damage taken by 20%.
                ZetaDia.Me.SetTraits(SNOPower.Wizard_Passive_Blur);
            }

            if (myLevel == 11)
            {
                ZetaDia.Me.SetActiveSkill(SNOPower.Wizard_ArcaneOrb, 2, 1);
                Logger.Write("Changing rune for Arcane Orb: \"Obliteration\"");
            }
        }
    }
}
 
Thanks and i will look at it later, i have been planning on doing a 1-60 Demon Hunter once I'm done with the 1-60 Barbarian.

leveling 3 demon hunters from 1-60 atm, poke me if you need something tested on them :)
 
nice routines !

but my barbarian won't break objects... he walks there, stops and leaves the object unbroken.
 
nice routines !

but my barbarian won't break objects... he walks there, stops and leaves the object unbroken.

same here. Sometimes he does break it but most of the time he just goes up to a breakable e.g. a tree stump, looks at it for a bit and then walks off again xD
 
I will see what i can find a little later perhaps something that is used on breakables.
 
leveling 3 demon hunters from 1-60 atm, poke me if you need something tested on them :)
Any chance you can tell me what profile you are using for leveling them? I want to do a DH but my hands don't want to. :D

@j0achim. Good work man. Barb is kicking ass.
 
I need a good Barbarian skill setup for this call... any suggestions ? :)
 
@j0achim: It seems that the barb can double use sprint right in a row, might solve some issues with sprint downtime.

Perhaps a short wait after using it if possible?

if anyone knows the syntax for it I can just add it myself :/
 
Last edited:
Lots of small changes are being made on the svn server right now and cooldowns are one of them.

I've just had a "perfect" session where bot was going strong without a single hiccup for 4 hours. So i can finally start benchmark changes being made and get some real data from changes i make :)
 
Works great, but dh uses smokescreen on cool down even with no enemies around.

It would be great if it used it on incoming projectiles it can't dodge, and for melee that are in too close. (Can the bot be made to dodge projectiles?)
 
Last edited:
does ur svn contain updates not yet posted here?


Edit: just svned ya looks like u made some changes, would be easier if u just made updates to ur svn rather than uploading in thread all the time. not sure if thats something u plan to do or not.
 
Last edited:
Status
Not open for further replies.
Back
Top