I am running a fel ruleset shard. we have evo mercs who have area attack weapons i would like to know how to prevent the pets from attacking each other when using area attack weapons. i have trided everything my limited mind can think of. i do know that it is in the baseweapon scripthere but dont know what to add


public virtual void DoAreaAttack(
Mobile from, Mobile defender, int sound, int hue, int phys, int fire, int cold, int pois, int nrgy)
{
Map map = from.Map;

if (map == null)
{
return;
}

var list = new List<Mobile>();

foreach (Mobile m in from.GetMobilesInRange(10))
{
if (from != m && defender != m && SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false) &&
(!Core.ML || from.InLOS(m)))
{
list.Add(m);
}
}

if (list.Count == 0)
{
return;
}

Effects.PlaySound(from.Location, map, sound);

// TODO: What is the damage calculation?

for (int i = 0; i < list.Count; ++i)
{
Mobile m = list;

double scalar = (11 - from.GetDistanceToSqrt(m)) / 10;

if (scalar > 1.0)
{
scalar = 1.0;
}
else if (scalar < 0.0)
{
continue;
}

from.DoHarmful(m, true);
m.FixedEffect(0x3779, 1, 15, hue, 0);
AOS.Damage(m, from, (int)(GetBaseDamage(from) * scalar), phys, fire, cold, pois, nrgy);
}
}
 
&& from.CanBeHarmful(m, false)

This one is probably your problem. Follow that thread. Look up the Mobile.CanBeHarmful method, and it should have your answer. Most likely, it doesn't see your evo creatures as pets in the same way it sees other basecreatures, for whatever reason. You might have to override the CanBeHarmful method to prevent one evo from attacking another evo or a pet owned by the same master.
 
Was this ever fixed? I have same issue with latest ServUO
[doublepost=1537819172][/doublepost]So this basically happens to me even with regular pets, take 2 pets that have area to fel, they will attack each other.
 
Back