Пример #1
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 3:
					Level = reader.ReadFlag<SecureLevel>();
					goto case 2;
				case 2:
					RemoveLocked = reader.ReadBool();
					goto case 1;
				case 1:
					{
						EditLocked = reader.ReadBool();
						AddLocked = reader.ReadBool();
						CloneEntryChargeCost = reader.ReadInt();

						ChargeTypes = reader.ReadDictionary(
							() =>
							{
								Type k = reader.ReadType();
								int v = reader.ReadInt();
								return new KeyValuePair<Type, int>(k, v);
							});
					}
					goto case 0;
				case 0:
					{
						Charges = reader.ReadInt();
						RecallChargeCost = reader.ReadInt();
						GateChargeCost = reader.ReadInt();
						_Descripton = reader.ReadString();
						Categories = new RuneCodexCategoryGrid(reader);
					}
					break;
			}

			if (version > 0)
			{
				return;
			}

			Charges = 1000;
			CloneEntryChargeCost = 5;
			RecallChargeCost = 1;
			GateChargeCost = 2;
			ChargeTypes = new Dictionary<Type, int>
			{
				{typeof(Gold), 100}
			};
		}
Пример #2
0
		public RuneCodex(int charges)
			: base(0x22C5)
		{
			Users = new Dictionary<PlayerMobile, UICache>();

			ChargeTypes = new Dictionary<Type, int>
			{
				{typeof(Gold), 100}
			};

			Categories = new RuneCodexCategoryGrid();
			Charges = Math.Max(0, charges);

			CloneEntryChargeCost = 5;
			RecallChargeCost = 1;
			GateChargeCost = 2;

			Name = "Rune Codex";
			Weight = 1.0;
			Hue = 74;

			LootType = LootType.Blessed;
		}