// Required (top of script):
// using System.Linq;
public override void OnCombatantChange()
{
base.OnCombatantChange();
if (Combatant != null)
{
foreach (var pet in AllFollowers.OfType<BaseCreature>())
{
if (pet.Combatant != null && pet.Combatant != Combatant && pet.ControlOrder == OrderType.Guard)
{
pet.Attack(Combatant);
}
}
}
}
You can upgrade your project .NET support.Yes I tried to apply this but sadly my Shard runs on RunUO V. 2.0 so (as far as I know) using System.Linq; does not work for me and neither does the code without it. No idea how this might work in my case but wide open to ideas. Thanks
public override void OnCombatantChange()
{
base.OnCombatantChange();
if (Combatant != null)
{
foreach (var m in AllFollowers)
{
BaseCreature pet = m as BaseCreature;
if (pet != null && pet.Combatant != null && pet.Combatant != Combatant && pet.ControlOrder == OrderType.Guard)
{
pet.Attack(Combatant);
}
}
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.