Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
45
Scripts/Services/New Magincia/Housing Lotto/Core/Region.cs
Normal file
45
Scripts/Services/New Magincia/Housing Lotto/Core/Region.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.NewMagincia
|
||||
{
|
||||
public class NewMaginciaRegion : TownRegion
|
||||
{
|
||||
public NewMaginciaRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p)
|
||||
{
|
||||
MaginciaLottoSystem system = MaginciaLottoSystem.Instance;
|
||||
|
||||
if (system != null && system.Enabled && from.Backpack != null)
|
||||
{
|
||||
List<Item> items = new List<Item>();
|
||||
|
||||
Item[] packItems = from.Backpack.FindItemsByType(typeof(WritOfLease));
|
||||
Item[] bankItems = from.BankBox.FindItemsByType(typeof(WritOfLease));
|
||||
|
||||
if (packItems != null && packItems.Length > 0)
|
||||
items.AddRange(packItems);
|
||||
|
||||
if (bankItems != null && bankItems.Length > 0)
|
||||
items.AddRange(bankItems);
|
||||
|
||||
foreach (Item item in items)
|
||||
{
|
||||
WritOfLease lease = item as WritOfLease;
|
||||
|
||||
if (lease != null && !lease.Expired && lease.Plot != null && lease.Plot.Bounds.Contains(p) && from.Map == lease.Plot.Map)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return MaginciaLottoSystem.IsFreeHousingZone(p, this.Map);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user