I am curious. Has anyone ever made an unbeatable AI in UO that can counter nearly any attack thrown at it by any player, or group of players? What is the most challenging foe to date anyone has ever seen in the game?
If you are a good coder you could make an AI like this.I'm wondering if there is any AI that can sniff you out with detect hidden, hide and stealth away themselves, use a myriad of spells in appropriate manners, teleport away or heck even recall away and maybe even actively track you down over long distances, maybe even use summoned pets to attack, too. The possibilities are endless.
public override void OnThink()
{
base.OnThink();
if ( Combatant != null && m_NextWeb < DateTime.Now )
DoWebAttack();
}
#region Web Attack
private DateTime m_NextWeb;
public void DoWebAttack()
{
List<Mobile> targets = new List<Mobile>();
foreach (Mobile m in GetMobilesInRange(RangePerception))
if (CanBeHarmful(m) && m.Player && !InRange(m, 1) && !m.Paralyzed)
targets.Add(m);
if (targets.Count > 0)
{
Mobile target = targets[Utility.Random(targets.Count)];
TimeSpan delay = TimeSpan.FromSeconds(GetDistanceToSqrt(target) / 15.0);
Effects.SendMovingEffect(this, target, 0x10D2, 20, 1, false, false);
Timer.DelayCall<Mobile>(delay, new TimerStateCallback<Mobile>(Entangle), target);
}
m_NextWeb = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 15));
}
public void Entangle( Mobile m )
{
Point3D p = Location;
if ( SpellHelper.FindValidSpawnLocation( Map, ref p, true ) )
{
TimeSpan delay = TimeSpan.FromSeconds( Utility.RandomMinMax( 3, 6 ) );
m.MoveToWorld( p, Map );
m.Freeze( delay );
m.SendLocalizedMessage( 1042555 ); // You become entangled in the spider web.
SpiderWeb web = new SpiderWeb( delay );
p.Z += 2;
web.MoveToWorld( p, Map );
Combatant = m;
}
}
private class SpiderWeb : Static
{
public SpiderWeb( TimeSpan delay ) : base( 0x10D2 )
{
Timer.DelayCall( delay, new TimerCallback( Delete ) );
}
public SpiderWeb( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
Delete();
}
}
#endregion
We use essential cookies to make this site work, and optional cookies to enhance your experience.