Server.Items.AquariumFishNet.FinishEffect C# (CSharp) Méthode

FinishEffect() protected méthode

protected FinishEffect ( Server.Point3D p, Server.Map map, Server.Mobile from ) : void
p Server.Point3D
map Server.Map
from Server.Mobile
Résultat void
        protected override void FinishEffect( Point3D p, Map map, Mobile from )
        {
            if ( Utility.RandomDouble() < 0.02 )
            {
                from.SendLocalizedMessage( 1074487 ); // The creatures are too quick for you!
            }
            else
            {
                BaseFish fish = GiveFish( from );
                FishBowl bowl = Aquarium.GetEmptyBowl( from );

                if ( bowl != null )
                {
                    fish.StopTimer();
                    bowl.AddItem( fish );
                    from.SendLocalizedMessage( 1074489 ); // A live creature jumps into the fish bowl in your pack!
                    Delete();
                    return;
                }
                else
                {
                    if ( from.PlaceInBackpack( fish ) )
                    {
                        from.PlaySound( 0x5A2 );
                        from.SendLocalizedMessage( 1074490 ); // A live creature flops around in your pack before running out of air.

                        fish.Kill();
                        Delete();
                        return;
                    }
                    else
                    {
                        fish.Delete();

                        from.SendLocalizedMessage( 1074488 ); // You could not hold the creature.
                    }
                }
            }

            InUse = false;
            Movable = true;

            if ( !from.PlaceInBackpack( this ) )
            {
                if ( from.Map == null || from.Map == Map.Internal )
                    Delete();
                else
                    MoveToWorld( from.Location, from.Map );
            }
        }