Ejemplo n.º 1
0
 public TransferChestDeed(TransferChest original, uint LockVal)
     : base(0x14EF)
 {
     Weight     = 1.0;
     Name       = "Deed for a transfer chest";
     m_KeyValue = LockVal;
     m_original = original;
 }
Ejemplo n.º 2
0
 public TransferChest(TransferChest original, uint KeyVal)
     : base(0xE80)
 {
     KeyValue = KeyVal;
     m_mate   = original;
     AddItem(new TransferKey(KeyType.Gold, this.KeyValue));//add new transfer key
     SetUpProperties();
 }
Ejemplo n.º 3
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!this.Deleted && (this.IsChildOf(from.Backpack)))
     {
         TransferChest chest = new TransferChest(m_original, m_KeyValue); //create the second chest
         from.Backpack.AddItem(chest);                                    //add it to the backpack
         m_original.Mate = chest;                                         //complete the link for the original
         this.Delete();                                                   //delete the deed
     }
 }
Ejemplo n.º 4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
                m_KeyValue = reader.ReadUInt();
                m_original = (TransferChest)reader.ReadItem();
                break;
            }
        }
Ejemplo n.º 5
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!this.Deleted && (this.IsChildOf(from.Backpack)))
     {
         //create chests
         TransferChest chestOne = new TransferChest(m_KeyValue);
         TransferChest chestTwo = new TransferChest(m_KeyValue);
         //link them
         chestOne.Mate = chestTwo;
         chestTwo.Mate = chestOne;
         //add them to the backpack
         from.Backpack.AddItem(chestOne);
         from.Backpack.AddItem(chestTwo);
         this.Delete();//delete the deed
     }
 }
Ejemplo n.º 6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
                m_mate             = (TransferChest)reader.ReadItem();
                m_currentCharge    = reader.ReadInt();
                m_maxCharges       = reader.ReadInt();
                m_maxItems         = reader.ReadInt();
                m_maxItemWeight    = reader.ReadInt();
                m_deleteOnNoCharge = reader.ReadBool();
                break;
            }
        }
Ejemplo n.º 7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(501661); // That key is unreachable.
                    return;
                }

                int number;

                if (targeted is ILockable)
                {
                    ILockable t      = (ILockable)targeted;
                    bool      locked = t.Locked;
                    if (m_Key.UseOn(from, (ILockable)targeted))
                    {
                        number = -1;
                        //it should be the transfer chest since it was unlocked, but check anyways
                        if (targeted is TransferChest)
                        {
                            TransferChest target = (TransferChest)targeted;
                            if (!locked)//if it wasnt locked before the key was used, then send the contents
                            {
                                target.TransferContents(from);
                                target.Delta(ItemDelta.Update);//closes the chest if its still open
                            }
                        }
                    }
                    else
                    {
                        number = 501668; // This key doesn't seem to unlock that.
                    }
                }
                else
                {
                    number = 501666; // You can't unlock that!
                }

                if (number != -1)
                {
                    from.SendLocalizedMessage(number);
                }
            }
Ejemplo n.º 8
0
 public TransferDeleteTimer(TransferChest chest)
     : base(TimeSpan.FromMinutes(5))
 {
     m_chest = chest;
     Priority = TimerPriority.OneMinute;
 }
Ejemplo n.º 9
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!this.Deleted && (this.IsChildOf(from.Backpack)))
     {
         //create chests
         TransferChest chestOne = new TransferChest(m_KeyValue);
         TransferChest chestTwo = new TransferChest(m_KeyValue);
         //link them
         chestOne.Mate = chestTwo;
         chestTwo.Mate = chestOne;
         //add them to the backpack
         from.Backpack.AddItem(chestOne);
         from.Backpack.AddItem(chestTwo);
         this.Delete();//delete the deed
     }
 }
Ejemplo n.º 10
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    m_KeyValue = reader.ReadUInt();
                    m_original = (TransferChest)reader.ReadItem();
                    break;
            }
        }
Ejemplo n.º 11
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!this.Deleted && (this.IsChildOf(from.Backpack)))
     {
         TransferChest chest = new TransferChest(m_original, m_KeyValue);//create the second chest
         from.Backpack.AddItem(chest);//add it to the backpack
         m_original.Mate = chest;//complete the link for the original
         this.Delete();//delete the deed
     }
 }
Ejemplo n.º 12
0
 public TransferChestDeed(TransferChest original, uint LockVal)
     : base(0x14EF)
 {
     Weight = 1.0;
     Name = "Deed for a transfer chest";
     m_KeyValue = LockVal;
     m_original = original;
 }
Ejemplo n.º 13
0
 public override void Deserialize(GenericReader reader)
 {
     base.Deserialize(reader);
     int version = reader.ReadInt();
     switch (version)
     {
         case 0:
             m_mate = (TransferChest)reader.ReadItem();
             m_currentCharge = reader.ReadInt();
             m_maxCharges = reader.ReadInt();
             m_maxItems = reader.ReadInt();
             m_maxItemWeight = reader.ReadInt();
             m_deleteOnNoCharge = reader.ReadBool();
             break;
     }
 }
Ejemplo n.º 14
0
 public TransferChest(TransferChest original, uint KeyVal)
     : base(0xE80)
 {
     KeyValue = KeyVal;
     m_mate = original;
     AddItem(new TransferKey(KeyType.Gold, this.KeyValue));//add new transfer key
     SetUpProperties();
 }
Ejemplo n.º 15
0
 public TransferDeleteTimer(TransferChest chest)
     : base(TimeSpan.FromMinutes(5))
 {
     m_chest  = chest;
     Priority = TimerPriority.OneMinute;
 }