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

Dominus Plugin

Jalockin

Member
Joined
Aug 29, 2012
Messages
441
Reaction score
0
Is there a way to make the bot ignore those frigging spawning zombies after dom is dead 1st phase ? (my) bot spends several minutes running back and forth killing those zombies.......
 
The bot itself doesn't handle combat. You'd need to do this in the routine you're using.

If you're using ExampleRoutine, there's two different approaches you can use, depending on why this is a problem in the first place.

If your character can't kill them faster than they spawn, but they pose no real threat to you, then you can just flat out ignore them from combat. To do that, you'd want to modify CombatTargetingOnInclusionCalcuation to the following:
Code:
private bool CombatTargetingOnInclusionCalcuation(NetworkObject entity)
        {
            try
            {
                var m = entity as Monster;
                if (m == null)
                    return false;

                if (AreaStateCache.Current.IsBlacklisted(m))
                    return false;

                // Do not consider inactive/dead mobs.
                if (!m.IsActive)
                    return false;

                // Ignore any mob that cannot die.
                if (m.CannotDie)
                    return false;

                // Ignore mobs that are too far to care about.
                if (m.Distance > (_currentLeashRange != -1 ? ExampleRoutineSettings.Instance.CombatRange : 300))
                    return false;

                // Upper Sceptre of God for any difficulty.
                if (LokiPoe.CurrentWorldArea.Id.Contains("_3_18_2"))
                {
                    if (m.Name == "Miscreation" && m.Rarity == Rarity.Normal)
                    {
                        return false;
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("[CombatOnInclusionCalcuation]", ex);
                return false;
            }
            return true;
        }

The only side-effect possible with that, would be you getting surrounded, and being unable to properly move.

The alternative is to not remove them altogether, but instead try to ignore them when they pose less of a threat, but it'd still be possible for the bot to get stuck killing them if you can't kill them fast enough and they surround you.

That logic would look like this:
Code:
// Upper Sceptre of God for any difficulty.
                if (LokiPoe.CurrentWorldArea.Id.Contains("_3_18_2") && cachedName == "Miscreation")
                {
                    var others =
                        CombatTargeting.Targets<Monster>()
                            .Where(m => m.Name != "Miscreation" && !m.Name.Contains("Dominus") && m.Distance < 15);

                    var miscreationCount =
                        CombatTargeting.Targets<Monster>()
                            .Count(m => m.Name == "Miscreation" && m.Distance < 8);

                    // Ignore Miscreations that are close by when there are no other types of monsters to kill, and we're not surrounded by them.
                    if (!others.Any() && miscreationCount < 5)
                    {
                        return false;
                    }
                }

and would go right below the following code in Logic:
Code:
// Prevent combat loops from happening.
if (pathDistance > ExampleRoutineSettings.Instance.CombatRange)
    return false;

That would make the bot return false for those targets, and since combat was not running, the plugin could move towards Dom to trigger the next phase.
 
Back
Top