public static bool HasAccountSiegeTent(Mobile m) { ArrayList list = BaseHouse.GetAccountHouses(m); if (list == null) { return(false); } for (int i = 0; i < list.Count; ++i) { if (list[i] is SiegeTent) { if (!((SiegeTent)list[i]).Deleted) { return(true); } } } return(false); }
// called by all house deeds but tents, they have their own implementation public virtual void OnPlacement(Mobile from, Point3D p) { if (Deleted) { return; } if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. return; } if (from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse(from)) { // wea: modified to ignore *siege* tents int i = 0; ArrayList ahouses = new ArrayList(); ahouses = BaseHouse.GetAccountHouses(from); if (ahouses != null) { foreach (object o in ahouses) { if (!(o is SiegeTent)) { i++; } } if (i > 0) { from.SendLocalizedMessage(501271); // You already own a house or a regular tent, you may not place another! return; } } } ArrayList toMove; Point3D center = new Point3D(p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z); HousePlacementResult res = HousePlacement.Check(from, m_MultiID, center, out toMove); switch (res) { case HousePlacementResult.Valid: { BaseHouse house = GetHouse(from); house.MoveToWorld(center, from.Map); Delete(); for (int i = 0; i < toMove.Count; ++i) { object o = toMove[i]; if (o is Tent) { (o as Tent).Annex(house); } else if (o is Mobile) { ((Mobile)o).Location = house.BanLocation; } else if (o is Item) { ((Item)o).Location = house.BanLocation; } } break; } case HousePlacementResult.TentRegion: case HousePlacementResult.BadItem: case HousePlacementResult.BadLand: case HousePlacementResult.BadStatic: case HousePlacementResult.BadRegionHidden: { from.SendLocalizedMessage(1043287); // The house could not be created here. Either something is blocking the house, or the house would not be on valid terrain. break; } case HousePlacementResult.NoSurface: { from.SendMessage("The house could not be created here. Part of the foundation would not be on any surface."); break; } case HousePlacementResult.BadRegion: { from.SendLocalizedMessage(501265); // Housing cannot be created in this area. break; } case HousePlacementResult.BadRegionTownship: { from.SendMessage("You are not authorized to build in this township."); break; } } }