示例#1
0
文件: Item.cs 项目: Ravenwolfe/xrunuo
 public virtual bool OnDroppedOnto( Mobile from, Item target )
 {
     if ( IsUnderYourFeet( from, target ) )
     {
         from.SendMessage( "No puedes mover eso, ¡estás pisando la bolsa!" );
         return false;
     }
     else if ( Deleted || from.Deleted || target.Deleted || from.Map != target.Map || from.Map == null || target.Map == null )
         return false;
     else if ( from.AccessLevel < AccessLevel.GameMaster && !from.InRange( target.GetWorldLocation(), 2 ) )
         return false;
     else if ( !from.CanSee( target ) || !from.InLOS( target ) )
         return false;
     else if ( !target.IsAccessibleTo( from ) )
         return false;
     else if ( !from.OnDroppedItemOnto( this, target ) )
         return false;
     else if ( NonTransferable && from.IsPlayer && from.AccessLevel <= AccessLevel.GameMaster )
     {
         HandleInvalidTransfer( from );
         return false;
     }
     else
         return target.OnDragDrop( from, this );
 }
示例#2
0
 public virtual bool OnDroppedOnto( Mobile from, Item target )
 {
     if ( Deleted || from.Deleted || target.Deleted || from.Map != target.Map || from.Map == null || target.Map == null )
         return false;
     else if ( from.AccessLevel < AccessLevel.GameMaster && !from.InRange( target.GetWorldLocation(), 2 ) )
         return false;
     else if ( !from.CanSee( target ) || !from.InLOS( target ) )
         return false;
     else if ( !target.IsAccessibleTo( from ) )
         return false;
     else if ( !from.OnDroppedItemOnto( this, target ) )
         return false;
     else
         return target.OnDragDrop( from, this );
 }
        public override bool OnDroppedOnto(Mobile from, Item target)
        {
            if (target == from.Backpack)
            {
                Item item = from.Backpack.FindItemByType(typeof(GoldLedger));

                if (item != null)
                {
                    from.SendMessage(2125, "You can only carry one gold ledger!");
                    return false;
                }
            }

            else if (target.IsChildOf(from.Backpack))
            {
                Item item = from.Backpack.FindItemByType(typeof(GoldLedger));

                if (item != null)
                {
                    from.SendMessage(2125, "You can only carry one gold ledger!");
                    return false;
                }
            }

            return target.OnDragDrop(from, this);
        }