Server.Mobiles.BaseVendor.OnDragDrop C# (CSharp) Méthode

OnDragDrop() public méthode

public OnDragDrop ( Mobile from, Item dropped ) : bool
from Mobile
dropped Item
Résultat bool
        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            /* TODO: Thou art giving me? and fame/karma for gold gifts */

            if ( dropped is SmallBOD || dropped is LargeBOD )
            {
                PlayerMobile pm = from as PlayerMobile;

                if ( Core.ML && pm != null && pm.NextBODTurnInTime > DateTime.UtcNow )
                {
                    SayTo( from, 1079976 ); // You'll have to wait a few seconds while I inspect the last order.
                    return false;
                }
                else if ( !IsValidBulkOrder( dropped ) )
                {
                    SayTo( from, 1045130 ); // That order is for some other shopkeeper.
                    return false;
                }
                else if ( ( dropped is SmallBOD && !( (SmallBOD)dropped ).Complete ) || ( dropped is LargeBOD && !( (LargeBOD)dropped ).Complete ) )
                {
                    SayTo( from, 1045131 ); // You have not completed the order yet.
                    return false;
                }

                Item reward;
                int gold, fame;

                if ( dropped is SmallBOD )
                    ( (SmallBOD)dropped ).GetRewards( out reward, out gold, out fame );
                else
                    ( (LargeBOD)dropped ).GetRewards( out reward, out gold, out fame );

                from.SendSound( 0x3D );

                SayTo( from, 1045132 ); // Thank you so much!  Here is a reward for your effort.

                if ( reward != null )
                    from.AddToBackpack( reward );

                if ( gold > 1000 )
                    from.AddToBackpack( new BankCheck( gold ) );
                else if ( gold > 0 )
                    from.AddToBackpack( new Gold( gold ) );

                Titles.AwardFame( from, fame, true );

                OnSuccessfulBulkOrderReceive( from );

                if ( Core.ML && pm != null )
                    pm.NextBODTurnInTime = DateTime.UtcNow + TimeSpan.FromSeconds( 10.0 );

                dropped.Delete();
                return true;
            }

            return base.OnDragDrop( from, dropped );
        }