kgilmore

Member
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.
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 127 Online
    • 273 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 86 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 79 Online
    • 190 Peak
  • Insane UO
    Endless Journey
    • Players
    • 76 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 27 Online
    • 85 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 22 Online
    • 48 Peak
  • Arth
    Custom (Modern)
    • Players
    • 22 Online
    • 34 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 20 Online
    • 172 Peak
  • Pandora
    Custom (Modern)
    • Players
    • 17 Online
    • 32 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 15 Online
    • 30 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back