Drake11
Member
I feel like I'm missing something simple and obvious here, maybe it's lack of sleep lol, anyone mind taking and look because I'm definitely missing something.
Code:
private DateTime m_Delay;
public override void OnActionCombat()
{
if ( DateTime.Now > m_Delay )
{
DoDragonCall();
m_Delay = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 15, 15 ) );
}
base.OnActionCombat();
}
public void DoDragonCall( Mobile from )
{
Map map = from.Map;
if ( map == null )
return;
int count = 1;
for ( int i = 0; i < count; ++i )
{
int x = from.X + Utility.RandomMinMax( -1, 1 );
int y = from.Y + Utility.RandomMinMax( -1, 1 );
int z = from.Z;
if ( !map.CanFit( x, y, z, 16, false, true ) )
{
z = map.GetAverageZ( x, y );
if ( z == from.Z || !map.CanFit( x, y, z, 16, false, true ) )
continue;
}
switch ( Utility.Random( 3 ) )
{
case 0:
DrogonEgg egg1 = new DrogonEgg();
egg1.MoveToWorld( from.Location, from.Map );
break;
case 1:
RhaegalEgg egg2 = new RhaegalEgg();
egg2.MoveToWorld( from.Location, from.Map );
break;
case 2:
ViserionEgg egg3 = new ViserionEgg();
egg3.MoveToWorld( from.Location, from.Map );
break;
}
}
}