public static void GetNearbyTown(HayCrate hay) { if (hay.Map == Map.SerpentIsland) { hay.HayTown = "the City of Furnace"; } else { foreach (Mobile citizen in hay.GetMobilesInRange(200)) { if (citizen is BaseVendor || citizen is TownGuards || (citizen is Citizens && !(citizen is HouseVisitor))) { if (citizen.Region.Name != null) { hay.HayTown = Server.Misc.Worlds.GetRegionName(citizen.Map, citizen.Location); } } } } if (hay.HayTown == null || hay.HayTown == "") { hay.HayTown = "the City of Britain"; } }
public static void GetNearbyTown(HayCrate hay) { foreach (Mobile citizen in hay.GetMobilesInRange(100)) { if (citizen is BaseVendor || citizen is TownGuards) { hay.HayTown = Server.Misc.Worlds.GetRegionName(citizen.Map, citizen.Location); } } }