Server.Items.SpecialFishingNet.Spawn C# (CSharp) Method

Spawn() protected method

protected Spawn ( Server.Point3D p, Server.Map map, BaseCreature spawn ) : void
p Server.Point3D
map Server.Map
spawn BaseCreature
return void
		protected void Spawn( Point3D p, Map map, BaseCreature spawn )
		{
			if ( map == null )
			{
				spawn.Delete();
				return;
			}

			int x = p.X, y = p.Y;

			for ( int j = 0; j < 20; ++j )
			{
				int tx = p.X - 2 + Utility.Random( 5 );
				int ty = p.Y - 2 + Utility.Random( 5 );

				LandTile t = map.Tiles.GetLandTile( tx, ty );

				if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
				{
					x = tx;
					y = ty;
					break;
				}
			}

			spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );

			if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
				spawn.PackItem( new MessageInABottle( Map.Felucca ) );
		}