Hey Folks!

So, I found this neat thing in Pub54 where monsters can toss a bola to dismount. I tried adding that into my Pub56 but I'm getting errors. I can't seem to dig this one out, any help would be greatly apreciated:



public static void TossBola(Mobile from)
{

if (from == null)
return;

Mobile target = from.Combatant;

if (target == null)
return;

from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
from.Direction = from.GetDirectionTo(target);
from.Animate(11, 5, 1, true, false, 0);
from.MovingEffect(target, 0x26AC, 10, 0, false, false);

IMount mt = target.Mount;

if (mt != null)
{
mt.Rider = null;
target.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
BaseMount.SetMountPrevention(target, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));
}
}


1613577266300.png
 
Try
Mobile combatant = this.m_Mobile.Combatant as Mobile;

And make sure in top of your script is:

using Server.Mobiles;

but im sure this should work:
Mobile combatant = Combatant as Mobile;

Take a look for example in your AntLion.cs around line 100
 
Last edited:
public static void TossBola(Mobile from)
{

if (from == null)
return;

Mobile combatant = Combatant as Mobile;

if (combatant == null)
return;

from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
from.Direction = from.GetDirectionTo(combatant);
from.Animate(11, 5, 1, true, false, 0);
from.MovingEffect(combatant, 0x26AC, 10, 0, false, false);

IMount mt = combatant.Mount;

if (mt != null)
{
mt.Rider = null;
combatant.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
BaseMount.SetMountPrevention(combatant, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));
}
}

1613762373718.png

1613762352299.png
Post automatically merged:

Got it working by putting the code directly into the monster rather than into another script that I then call

private DateTime m_BolaDelay;

public override void OnThink()
{
if ( DateTime.Now > m_BolaDelay )
{
TossBola( this );
m_BolaDelay = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 6, 24 ) );
}

base.OnThink();
}


public static void TossBola(Mobile from)
{

if (from == null)
return;

Mobile combatant = from.Combatant as Mobile;

if (combatant == null)
return;
else if (!target.Mounted)
return;

from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
from.Direction = from.GetDirectionTo(combatant);
from.Animate(11, 5, 1, true, false, 0);
from.MovingEffect(combatant, 0x26AC, 10, 0, false, false);

IMount mt = combatant.Mount;

if (mt != null)
{
mt.Rider = null;
combatant.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
BaseMount.SetMountPrevention(combatant, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));
}
}
 
Last edited:
Back