Jump to content

Fighting with mob, attacked by player, bot keep going on mob


Artek

Recommended Posts

So today during grind player attacked me, bot instead of picking a player, was still attacking and chasing fleeing mob. Is there a way to make wrobot switch attacking player ?

Link to comment
Share on other sites

On 10/22/2020 at 2:57 AM, Artek said:

So today during grind player attacked me, bot instead of picking a player, was still attacking and chasing fleeing mob. Is there a way to make wrobot switch attacking player ?

You have to modify ur fightclass.

public void Initialize()
{        
	FightEvents.OnFightLoop += TargetSwitcher;
}

public void Dispose()
{        
	FightEvents.OnFightLoop -= TargetSwitcher;
}

private void TargetSwitcher(WoWUnit woWPlayer, System.ComponentModel.CancelEventArgs cancelable)
{	
    WoWPlayer player = ObjectManager.GetNearestWoWPlayer(ObjectManager.GetObjectWoWPlayer().Where(o => o.IsAttackable).ToList());
    if (player == null || !player.IsValid || !player.IsAlive || player.Faction == ObjectManager.Me.Faction || player.IsFlying || player.IsMyTarget || woWPlayer.Guid == player.Guid)
    	return;
    if (player.InCombatWithMe && ObjectManager.Target.Type != WoWObjectType.Player)
    {
       cancelable.Cancel = true;               
       Fight.StartFight(player.Guid, robotManager.Products.Products.ProductName != "WRotation", false);
    }  
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...