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

            m_LootContentType = (FillableContentType)reader.ReadInt();
        }
Пример #2
0
        public static FillableContent Lookup(FillableContentType type)
        {
            int v = (int)type;

            if (v >= 0 && v < m_ContentTypes.Length)
            {
                return(m_ContentTypes[v]);
            }

            return(null);
        }
Пример #3
0
    public static FillableContentType Acquire(Point3D loc, Map map)
    {
        FillableContentType content = FillableContentType.None;

        if (map == null || map == Map.Internal)
        {
            return(content);
        }

        if (_acquireTable == null)
        {
            _acquireTable = new Dictionary <Type, FillableContentType>();

            for (var i = 0; i < ContentTypes.Length; ++i)
            {
                var fill = ContentTypes[i];

                for (var j = 0; j < fill.Vendors.Length; ++j)
                {
                    _acquireTable[fill.Vendors[j]] = fill.TypeID;
                }
            }
        }

        Mobile nearest = null;

        // TODO: Replace with vendor shop regions and a fallback override.
        foreach (var mob in map.GetMobilesInRange(loc, 20))
        {
            if (nearest != null && mob.GetDistanceToSqrt(loc) > nearest.GetDistanceToSqrt(loc) &&
                !(nearest is Mobiles.Cobbler && mob is Mobiles.Provisioner))
            {
                continue;
            }

            if (_acquireTable.TryGetValue(mob.GetType(), out var check))
            {
                nearest = mob;
                content = check;
            }
        }

        return(content);
    }
        public static FillableContent Lookup(FillableContentType type)
        {
            int v = (int)type;

            if (v >= 0 && v < m_ContentTypes.Length)
                return m_ContentTypes[v];

            return null;
        }
Пример #5
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize (reader);
			int version = reader.ReadInt();
			m_LootContentType = (FillableContentType)reader.ReadInt();
		}
Пример #6
0
		public LootMap() : base()
		{
			//SetDisplay( 0, 0, 5119, 4095, 400, 400 );
			LootContentType = FillableContentType.None;
		}
Пример #7
0
 public LootMap() : base()
 {
     //SetDisplay( 0, 0, 5119, 4095, 400, 400 );
     LootContentType = FillableContentType.None;
 }