public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_LootContentType = (FillableContentType)reader.ReadInt(); }
public static FillableContent Lookup(FillableContentType type) { int v = (int)type; if (v >= 0 && v < m_ContentTypes.Length) { return(m_ContentTypes[v]); } return(null); }
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; }
public override void Deserialize(GenericReader reader) { base.Deserialize (reader); int version = reader.ReadInt(); m_LootContentType = (FillableContentType)reader.ReadInt(); }
public LootMap() : base() { //SetDisplay( 0, 0, 5119, 4095, 400, 400 ); LootContentType = FillableContentType.None; }