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);
}
}
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);
}
}