Modernization Fixes & Updates to Default Values (#3)
This commit is contained in:
parent
445eddff68
commit
dcf64091b1
768 changed files with 10507 additions and 14196 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Accounting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Ethics;
|
||||
|
|
@ -46,18 +47,18 @@ namespace Server.Multis
|
|||
BuiltOn = DateTime.UtcNow;
|
||||
LastTraded = DateTime.MinValue;
|
||||
|
||||
Doors = new ArrayList();
|
||||
LockDowns = new ArrayList();
|
||||
Secures = new ArrayList();
|
||||
Addons = new ArrayList();
|
||||
Doors = new List<BaseDoor>();
|
||||
LockDowns = new List<Item>();
|
||||
Secures = new List<SecureInfo>();
|
||||
Addons = new List<Item>();
|
||||
|
||||
CoOwners = new ArrayList();
|
||||
Friends = new ArrayList();
|
||||
Bans = new ArrayList();
|
||||
Access = new ArrayList();
|
||||
CoOwners = new List<Mobile>();
|
||||
Friends = new List<Mobile>();
|
||||
Bans = new List<Mobile>();
|
||||
Access = new List<Mobile>();
|
||||
|
||||
VendorRentalContracts = new ArrayList();
|
||||
InternalizedVendors = new ArrayList();
|
||||
VendorRentalContracts = new List<VendorRentalContract>();
|
||||
InternalizedVendors = new List<Mobile>();
|
||||
|
||||
m_Owner = owner;
|
||||
|
||||
|
|
@ -356,15 +357,15 @@ namespace Server.Multis
|
|||
public int MaxLockDowns{ get; set; }
|
||||
|
||||
public Region Region => m_Region;
|
||||
public ArrayList CoOwners{ get; set; }
|
||||
public List<Mobile> CoOwners{ get; set; }
|
||||
|
||||
public ArrayList Friends{ get; set; }
|
||||
public List<Mobile> Friends{ get; set; }
|
||||
|
||||
public ArrayList Access{ get; set; }
|
||||
public List<Mobile> Access{ get; set; }
|
||||
|
||||
public ArrayList Bans{ get; set; }
|
||||
public List<Mobile> Bans{ get; set; }
|
||||
|
||||
public ArrayList Doors{ get; set; }
|
||||
public List<BaseDoor> Doors{ get; set; }
|
||||
|
||||
public int LockDownCount
|
||||
{
|
||||
|
|
@ -377,7 +378,7 @@ namespace Server.Multis
|
|||
if (Secures != null)
|
||||
for (int i = 0; i < Secures.Count; ++i)
|
||||
{
|
||||
SecureInfo info = (SecureInfo)Secures[i];
|
||||
SecureInfo info = Secures[i];
|
||||
|
||||
if (info.Item.Deleted)
|
||||
continue;
|
||||
|
|
@ -400,7 +401,7 @@ namespace Server.Multis
|
|||
if (Secures != null)
|
||||
for (int i = 0; i < Secures.Count; i++)
|
||||
{
|
||||
SecureInfo info = (SecureInfo)Secures[i];
|
||||
SecureInfo info = Secures[i];
|
||||
|
||||
if (info.Item.Deleted)
|
||||
continue;
|
||||
|
|
@ -412,27 +413,27 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public ArrayList Addons{ get; set; }
|
||||
public List<Item> Addons{ get; set; }
|
||||
|
||||
public ArrayList LockDowns{ get; private set; }
|
||||
public List<Item> LockDowns{ get; private set; }
|
||||
|
||||
public ArrayList Secures{ get; private set; }
|
||||
public List<SecureInfo> Secures{ get; private set; }
|
||||
|
||||
public HouseSign Sign{ get; set; }
|
||||
|
||||
public ArrayList PlayerVendors{ get; } = new ArrayList();
|
||||
public List<PlayerVendor> PlayerVendors{ get; } = new List<PlayerVendor>();
|
||||
|
||||
public ArrayList PlayerBarkeepers{ get; } = new ArrayList();
|
||||
public List<PlayerBarkeeper> PlayerBarkeepers{ get; } = new List<PlayerBarkeeper>();
|
||||
|
||||
public ArrayList VendorRentalContracts{ get; private set; }
|
||||
public List<VendorRentalContract> VendorRentalContracts{ get; private set; }
|
||||
|
||||
public ArrayList VendorInventories{ get; } = new ArrayList();
|
||||
public List<VendorInventory> VendorInventories{ get; } = new List<VendorInventory>();
|
||||
|
||||
public ArrayList RelocatedEntities{ get; } = new ArrayList();
|
||||
public List<RelocatedEntity> RelocatedEntities{ get; } = new List<RelocatedEntity>();
|
||||
|
||||
public MovingCrate MovingCrate{ get; set; }
|
||||
|
||||
public ArrayList InternalizedVendors{ get; private set; }
|
||||
public List<Mobile> InternalizedVendors{ get; private set; }
|
||||
|
||||
public DateTime BuiltOn{ get; set; }
|
||||
|
||||
|
|
@ -513,14 +514,10 @@ namespace Server.Multis
|
|||
|
||||
public virtual void KillVendors()
|
||||
{
|
||||
ArrayList list = new ArrayList(PlayerVendors);
|
||||
|
||||
foreach (PlayerVendor vendor in list)
|
||||
foreach (PlayerVendor vendor in PlayerVendors.ToList())
|
||||
vendor.Destroy(true);
|
||||
|
||||
list = new ArrayList(PlayerBarkeepers);
|
||||
|
||||
foreach (PlayerBarkeeper barkeeper in list)
|
||||
foreach (PlayerBarkeeper barkeeper in PlayerBarkeepers.ToList())
|
||||
barkeeper.Delete();
|
||||
}
|
||||
|
||||
|
|
@ -569,13 +566,13 @@ namespace Server.Multis
|
|||
fromLockdowns = 0;
|
||||
fromMovingCrate = 0;
|
||||
|
||||
ArrayList list = Secures;
|
||||
List<SecureInfo> list = Secures;
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
SecureInfo si = (SecureInfo)list[i];
|
||||
SecureInfo si = list[i];
|
||||
|
||||
fromSecures += si.Item.TotalItems;
|
||||
}
|
||||
|
|
@ -667,9 +664,9 @@ namespace Server.Multis
|
|||
eable.Free();
|
||||
}
|
||||
|
||||
public ArrayList AvailableVendorsFor(Mobile m)
|
||||
public List<Mobile> AvailableVendorsFor(Mobile m)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
|
||||
foreach (PlayerVendor vendor in PlayerVendors)
|
||||
if (vendor.CanInteractWith(m, false))
|
||||
|
|
@ -811,7 +808,7 @@ namespace Server.Multis
|
|||
InternalizedVendors.Add(mobile);
|
||||
}
|
||||
|
||||
foreach (Mobile mobile in PlayerBarkeepers)
|
||||
foreach (PlayerBarkeeper mobile in PlayerBarkeepers)
|
||||
{
|
||||
mobile.Internalize();
|
||||
InternalizedVendors.Add(mobile);
|
||||
|
|
@ -990,10 +987,11 @@ namespace Server.Multis
|
|||
m_Trash = null;
|
||||
|
||||
LockDowns.Remove(item);
|
||||
VendorRentalContracts.Remove(item);
|
||||
if (item is VendorRentalContract contract)
|
||||
VendorRentalContracts.Remove(contract);
|
||||
Addons.Remove(item);
|
||||
for (int i = Secures.Count - 1; i >= 0; i--)
|
||||
if (((SecureInfo)Secures[i]).Item == item)
|
||||
if (Secures[i].Item == item)
|
||||
Secures.RemoveAt(i);
|
||||
}
|
||||
else if (entity is Mobile mobile && !mobile.Deleted)
|
||||
|
|
@ -1059,9 +1057,7 @@ namespace Server.Multis
|
|||
|
||||
public virtual bool CheckAosStorage(int need)
|
||||
{
|
||||
int fromSecures, fromVendors, fromLockdowns, fromMovingCrate;
|
||||
|
||||
return GetAosCurSecures(out fromSecures, out fromVendors, out fromLockdowns, out fromMovingCrate) + need <=
|
||||
return GetAosCurSecures(out int fromSecures, out int fromVendors, out int fromLockdowns, out int fromMovingCrate) + need <=
|
||||
GetAosMaxSecures();
|
||||
}
|
||||
|
||||
|
|
@ -1317,7 +1313,7 @@ namespace Server.Multis
|
|||
|
||||
for (int i = 0; i < Secures.Count; ++i)
|
||||
{
|
||||
SecureInfo info = (SecureInfo)Secures[i];
|
||||
SecureInfo info = Secures[i];
|
||||
|
||||
if (info.Item == item)
|
||||
return HasSecureAccess(m, info.Level) ? SecureAccessResult.Accessible : SecureAccessResult.Inaccessible;
|
||||
|
|
@ -1594,15 +1590,15 @@ namespace Server.Multis
|
|||
i.Movable = false;
|
||||
else
|
||||
i.Movable = !locked;
|
||||
|
||||
|
||||
i.IsLockedDown = locked;
|
||||
|
||||
if (locked)
|
||||
{
|
||||
if (i is VendorRentalContract)
|
||||
if (i is VendorRentalContract contract)
|
||||
{
|
||||
if (!VendorRentalContracts.Contains(i))
|
||||
VendorRentalContracts.Add(i);
|
||||
if (!VendorRentalContracts.Contains(contract))
|
||||
VendorRentalContracts.Add(contract);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1612,7 +1608,8 @@ namespace Server.Multis
|
|||
}
|
||||
else
|
||||
{
|
||||
VendorRentalContracts.Remove(i);
|
||||
if (i is VendorRentalContract contract)
|
||||
VendorRentalContracts.Remove(contract);
|
||||
LockDowns.Remove(i);
|
||||
}
|
||||
|
||||
|
|
@ -1756,11 +1753,11 @@ namespace Server.Multis
|
|||
* contract vendor in the house.
|
||||
*/
|
||||
to.SendGump(
|
||||
new WarningGump(1060635, 30720, 1062487, 32512, 420, 280, ConfirmTransfer_Callback, from));
|
||||
new WarningGump(1060635, 30720, 1062487, 32512, 420, 280, okay => ConfirmTransfer_Callback(to, okay, from)));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.CloseGump(typeof(HouseTransferGump));
|
||||
to.CloseGump<HouseTransferGump>();
|
||||
to.SendGump(new HouseTransferGump(from, to, this));
|
||||
}
|
||||
}
|
||||
|
|
@ -1771,16 +1768,14 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
private void ConfirmTransfer_Callback(Mobile to, bool ok, object state)
|
||||
private void ConfirmTransfer_Callback(Mobile to, bool ok, Mobile from)
|
||||
{
|
||||
Mobile from = (Mobile)state;
|
||||
|
||||
if (!ok || Deleted || !from.CheckAlive() || !IsOwner(from))
|
||||
return;
|
||||
|
||||
if (CheckTransferPosition(from, to))
|
||||
{
|
||||
to.CloseGump(typeof(HouseTransferGump));
|
||||
to.CloseGump<HouseTransferGump>();
|
||||
to.SendGump(new HouseTransferGump(from, to, this));
|
||||
}
|
||||
}
|
||||
|
|
@ -1891,12 +1886,12 @@ namespace Server.Multis
|
|||
SecureInfo info = null;
|
||||
|
||||
for (int i = 0; info == null && i < Secures.Count; ++i)
|
||||
if (((SecureInfo)Secures[i]).Item == item)
|
||||
info = (SecureInfo)Secures[i];
|
||||
if (Secures[i].Item == item)
|
||||
info = Secures[i];
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
m.CloseGump(typeof(SetSecureLevelGump));
|
||||
m.CloseGump<SetSecureLevelGump>();
|
||||
m.SendGump(new SetSecureLevelGump(m_Owner, info, this));
|
||||
}
|
||||
else if (item.Parent != null)
|
||||
|
|
@ -1932,7 +1927,7 @@ namespace Server.Multis
|
|||
LockDowns.Remove(item);
|
||||
item.Movable = false;
|
||||
|
||||
m.CloseGump(typeof(SetSecureLevelGump));
|
||||
m.CloseGump<SetSecureLevelGump>();
|
||||
m.SendGump(new SetSecureLevelGump(m_Owner, info, this));
|
||||
}
|
||||
}
|
||||
|
|
@ -1985,7 +1980,7 @@ namespace Server.Multis
|
|||
|
||||
for (int i = 0; i < Secures.Count; ++i)
|
||||
{
|
||||
SecureInfo info = (SecureInfo)Secures[i];
|
||||
SecureInfo info = Secures[i];
|
||||
|
||||
if (info.Item == item && HasSecureAccess(m, info.Level))
|
||||
{
|
||||
|
|
@ -2363,7 +2358,7 @@ namespace Server.Multis
|
|||
writer.WriteEncodedInt(VendorInventories.Count);
|
||||
for (int i = 0; i < VendorInventories.Count; i++)
|
||||
{
|
||||
VendorInventory inventory = (VendorInventory)VendorInventories[i];
|
||||
VendorInventory inventory = VendorInventories[i];
|
||||
inventory.Serialize(writer);
|
||||
}
|
||||
|
||||
|
|
@ -2384,7 +2379,7 @@ namespace Server.Multis
|
|||
writer.Write(Secures.Count);
|
||||
|
||||
for (int i = 0; i < Secures.Count; ++i)
|
||||
((SecureInfo)Secures[i]).Serialize(writer);
|
||||
Secures[i].Serialize(writer);
|
||||
|
||||
writer.Write(m_Public);
|
||||
|
||||
|
|
@ -2416,7 +2411,7 @@ namespace Server.Multis
|
|||
// Items in locked down containers that aren't locked down themselves must decay!
|
||||
for (int i = 0; i < LockDowns.Count; ++i)
|
||||
{
|
||||
Item item = (Item)LockDowns[i];
|
||||
Item item = LockDowns[i];
|
||||
|
||||
if (item is Container cont && !(cont is BaseBoard || cont is Aquarium || cont is FishBowl))
|
||||
{
|
||||
|
|
@ -2465,14 +2460,14 @@ namespace Server.Multis
|
|||
case 13: // removed ban location serialization
|
||||
case 12:
|
||||
{
|
||||
VendorRentalContracts = reader.ReadItemList();
|
||||
InternalizedVendors = reader.ReadMobileList();
|
||||
VendorRentalContracts = reader.ReadStrongItemList<VendorRentalContract>();
|
||||
InternalizedVendors = reader.ReadStrongMobileList();
|
||||
|
||||
int relocatedCount = reader.ReadEncodedInt();
|
||||
for (int i = 0; i < relocatedCount; i++)
|
||||
{
|
||||
Point3D relLocation = reader.ReadPoint3D();
|
||||
IEntity entity = World.FindEntity(reader.ReadInt());
|
||||
IEntity entity = World.FindEntity(reader.ReadUInt());
|
||||
|
||||
if (entity != null)
|
||||
RelocatedEntities.Add(new RelocatedEntity(entity, relLocation));
|
||||
|
|
@ -2506,7 +2501,7 @@ namespace Server.Multis
|
|||
}
|
||||
case 7:
|
||||
{
|
||||
Access = reader.ReadMobileList();
|
||||
Access = reader.ReadStrongMobileList();
|
||||
goto case 6;
|
||||
}
|
||||
case 6:
|
||||
|
|
@ -2518,13 +2513,13 @@ namespace Server.Multis
|
|||
case 5: // just removed fields
|
||||
case 4:
|
||||
{
|
||||
Addons = reader.ReadItemList();
|
||||
Addons = reader.ReadStrongItemList();
|
||||
goto case 3;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
count = reader.ReadInt();
|
||||
Secures = new ArrayList(count);
|
||||
Secures = new List<SecureInfo>(count);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
|
|
@ -2557,15 +2552,15 @@ namespace Server.Multis
|
|||
|
||||
if (version < 12)
|
||||
{
|
||||
VendorRentalContracts = new ArrayList();
|
||||
InternalizedVendors = new ArrayList();
|
||||
VendorRentalContracts = new List<VendorRentalContract>();
|
||||
InternalizedVendors = new List<Mobile>();
|
||||
}
|
||||
|
||||
if (version < 4)
|
||||
Addons = new ArrayList();
|
||||
Addons = new List<Item>();
|
||||
|
||||
if (version < 7)
|
||||
Access = new ArrayList();
|
||||
Access = new List<Mobile>();
|
||||
|
||||
if (version < 8)
|
||||
Price = DefaultPrice;
|
||||
|
|
@ -2582,26 +2577,26 @@ namespace Server.Multis
|
|||
|
||||
UpdateRegion();
|
||||
|
||||
CoOwners = reader.ReadMobileList();
|
||||
Friends = reader.ReadMobileList();
|
||||
Bans = reader.ReadMobileList();
|
||||
CoOwners = reader.ReadStrongMobileList();
|
||||
Friends = reader.ReadStrongMobileList();
|
||||
Bans = reader.ReadStrongMobileList();
|
||||
|
||||
Sign = reader.ReadItem() as HouseSign;
|
||||
m_Trash = reader.ReadItem() as TrashBarrel;
|
||||
|
||||
Doors = reader.ReadItemList();
|
||||
LockDowns = reader.ReadItemList();
|
||||
Doors = reader.ReadStrongItemList<BaseDoor>();
|
||||
LockDowns = reader.ReadStrongItemList();
|
||||
|
||||
for (int i = 0; i < LockDowns.Count; ++i)
|
||||
((Item)LockDowns[i]).IsLockedDown = true;
|
||||
LockDowns[i].IsLockedDown = true;
|
||||
|
||||
for (int i = 0; i < VendorRentalContracts.Count; ++i)
|
||||
((Item)VendorRentalContracts[i]).IsLockedDown = true;
|
||||
VendorRentalContracts[i].IsLockedDown = true;
|
||||
|
||||
if (version < 3)
|
||||
{
|
||||
ArrayList items = reader.ReadItemList();
|
||||
Secures = new ArrayList(items.Count);
|
||||
List<Item> items = reader.ReadStrongItemList();
|
||||
Secures = new List<SecureInfo>(items.Count);
|
||||
|
||||
for (int i = 0; i < items.Count; ++i)
|
||||
{
|
||||
|
|
@ -2663,18 +2658,13 @@ namespace Server.Multis
|
|||
|
||||
private void FixLockdowns_Sandbox()
|
||||
{
|
||||
ArrayList lockDowns = new ArrayList();
|
||||
List<Item> conts = LockDowns?.Where(item => item is Container).ToList();
|
||||
|
||||
for (int i = 0; LockDowns != null && i < LockDowns.Count; ++i)
|
||||
{
|
||||
Item item = (Item)LockDowns[i];
|
||||
if (conts == null)
|
||||
return;
|
||||
|
||||
if (item is Container)
|
||||
lockDowns.Add(item);
|
||||
}
|
||||
|
||||
for (int i = 0; i < lockDowns.Count; ++i)
|
||||
SetLockdown((Item)lockDowns[i], true, true);
|
||||
foreach (Item cont in conts)
|
||||
SetLockdown(cont, true, true);
|
||||
}
|
||||
|
||||
public static void HandleDeletion(Mobile mob)
|
||||
|
|
@ -2726,9 +2716,9 @@ namespace Server.Multis
|
|||
if (LockDowns != null)
|
||||
for (int i = 0; i < LockDowns.Count; ++i)
|
||||
{
|
||||
if (LockDowns[i] is Item)
|
||||
if (LockDowns[i] != null)
|
||||
{
|
||||
Item item = (Item)LockDowns[i];
|
||||
Item item = LockDowns[i];
|
||||
|
||||
if (!(item is Container))
|
||||
count += item.TotalItems;
|
||||
|
|
@ -2777,7 +2767,7 @@ namespace Server.Multis
|
|||
{
|
||||
for (int i = 0; i < Doors.Count; ++i)
|
||||
{
|
||||
Item item = (Item)Doors[i];
|
||||
Item item = Doors[i];
|
||||
|
||||
item?.Delete();
|
||||
}
|
||||
|
|
@ -2789,7 +2779,7 @@ namespace Server.Multis
|
|||
{
|
||||
for (int i = 0; i < LockDowns.Count; ++i)
|
||||
{
|
||||
Item item = (Item)LockDowns[i];
|
||||
Item item = LockDowns[i];
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
|
@ -2807,7 +2797,7 @@ namespace Server.Multis
|
|||
{
|
||||
for (int i = 0; i < VendorRentalContracts.Count; ++i)
|
||||
{
|
||||
Item item = (Item)VendorRentalContracts[i];
|
||||
Item item = VendorRentalContracts[i];
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
|
@ -2825,7 +2815,7 @@ namespace Server.Multis
|
|||
{
|
||||
for (int i = 0; i < Secures.Count; ++i)
|
||||
{
|
||||
SecureInfo info = (SecureInfo)Secures[i];
|
||||
SecureInfo info = Secures[i];
|
||||
|
||||
if (info.Item is StrongBox)
|
||||
{
|
||||
|
|
@ -2847,7 +2837,7 @@ namespace Server.Multis
|
|||
{
|
||||
for (int i = 0; i < Addons.Count; ++i)
|
||||
{
|
||||
Item item = (Item)Addons[i];
|
||||
Item item = Addons[i];
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
|
@ -2886,9 +2876,7 @@ namespace Server.Multis
|
|||
Addons.Clear();
|
||||
}
|
||||
|
||||
ArrayList inventories = new ArrayList(VendorInventories);
|
||||
|
||||
foreach (VendorInventory inventory in inventories)
|
||||
foreach (VendorInventory inventory in VendorInventories.ToList())
|
||||
inventory.Delete();
|
||||
|
||||
MovingCrate?.Delete();
|
||||
|
|
@ -3024,7 +3012,7 @@ namespace Server.Multis
|
|||
|
||||
for (int i = 0; i < Bans.Count; ++i)
|
||||
{
|
||||
Mobile c = (Mobile)Bans[i];
|
||||
Mobile c = Bans[i];
|
||||
|
||||
if (c == m)
|
||||
return true;
|
||||
|
|
@ -3069,13 +3057,8 @@ namespace Server.Multis
|
|||
|
||||
public bool HasLockedDownItem(Item check)
|
||||
{
|
||||
if (check == null)
|
||||
return false;
|
||||
|
||||
if (LockDowns == null)
|
||||
return false;
|
||||
|
||||
return LockDowns.Contains(check) || VendorRentalContracts.Contains(check);
|
||||
return check != null && LockDowns != null &&
|
||||
(LockDowns.Contains(check) || check is VendorRentalContract contract && VendorRentalContracts.Contains(contract));
|
||||
}
|
||||
|
||||
public bool HasSecureItem(Item item)
|
||||
|
|
@ -3089,7 +3072,7 @@ namespace Server.Multis
|
|||
bool contains = false;
|
||||
|
||||
for (int i = 0; !contains && i < Secures.Count; ++i)
|
||||
contains = ((SecureInfo)Secures[i]).Item == item;
|
||||
contains = Secures[i].Item == item;
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
|
@ -3678,7 +3661,7 @@ namespace Server.Multis
|
|||
|
||||
if (item is ISecurable securable)
|
||||
{
|
||||
bool isOwned = house.Doors.Contains(item);
|
||||
bool isOwned = item is BaseDoor door && house.Doors.Contains(door);
|
||||
|
||||
if (!isOwned)
|
||||
isOwned = house is HouseFoundation foundation && foundation.IsFixture(item);
|
||||
|
|
@ -3691,11 +3674,11 @@ namespace Server.Multis
|
|||
}
|
||||
else
|
||||
{
|
||||
ArrayList list = house.Secures;
|
||||
List<SecureInfo> list = house.Secures;
|
||||
|
||||
for (int i = 0; sec == null && list != null && i < list.Count; ++i)
|
||||
{
|
||||
SecureInfo si = (SecureInfo)list[i];
|
||||
SecureInfo si = list[i];
|
||||
|
||||
if (si.Item == item)
|
||||
sec = si;
|
||||
|
|
@ -3719,7 +3702,7 @@ namespace Server.Multis
|
|||
|
||||
if (sec != null)
|
||||
{
|
||||
Owner.From.CloseGump(typeof(SetSecureLevelGump));
|
||||
Owner.From.CloseGump<SetSecureLevelGump>();
|
||||
Owner.From.SendGump(new SetSecureLevelGump(Owner.From, sec, BaseHouse.FindHouseAt(m_Item)));
|
||||
}
|
||||
}
|
||||
|
|
@ -3744,4 +3727,4 @@ namespace Server.Multis
|
|||
return from == m_RegionOwner || AccountHandler.CheckAccount(from, m_RegionOwner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1376,11 +1376,9 @@ namespace Server.Multis
|
|||
{
|
||||
Point2D dest = MapItem.Pins[NextNavPoint];
|
||||
|
||||
int x, y;
|
||||
MapItem.ConvertToWorld(dest.X, dest.Y, out x, out y);
|
||||
MapItem.ConvertToWorld(dest.X, dest.Y, out int x, out int y);
|
||||
|
||||
int maxSpeed;
|
||||
dir = GetMovementFor(x, y, out maxSpeed);
|
||||
dir = GetMovementFor(x, y, out int maxSpeed);
|
||||
|
||||
if (maxSpeed == 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace Server.Multis
|
|||
return;
|
||||
}
|
||||
|
||||
if (from.Region.IsPartOf(typeof(HouseRegion)) || BaseBoat.FindBoatAt(from, from.Map) != null)
|
||||
if (from.Region.IsPartOf<HouseRegion>() || BaseBoat.FindBoatAt(from, from.Map) != null)
|
||||
{
|
||||
from.SendLocalizedMessage(1010568, null,
|
||||
0x25); // You may not place a ship while on another ship or inside a house.
|
||||
|
|
@ -162,9 +162,9 @@ namespace Server.Multis
|
|||
|
||||
Region region = Region.Find(p, from.Map);
|
||||
|
||||
if (region.IsPartOf(typeof(DungeonRegion)))
|
||||
if (region.IsPartOf<DungeonRegion>())
|
||||
from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
|
||||
else if (region.IsPartOf(typeof(HouseRegion)) || region.IsPartOf(typeof(ChampionSpawnRegion)))
|
||||
else if (region.IsPartOf<HouseRegion>() || region.IsPartOf<ChampionSpawnRegion>())
|
||||
from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
|
||||
else
|
||||
m_Deed.OnPlacement(from, p);
|
||||
|
|
|
|||
|
|
@ -181,9 +181,9 @@ namespace Server.Multis
|
|||
|
||||
Region region = Region.Find(p, from.Map);
|
||||
|
||||
if (region.IsPartOf(typeof(DungeonRegion)))
|
||||
if (region.IsPartOf<DungeonRegion>())
|
||||
from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
|
||||
else if (region.IsPartOf(typeof(HouseRegion)) || region.IsPartOf(typeof(ChampionSpawnRegion)))
|
||||
else if (region.IsPartOf<HouseRegion>() || region.IsPartOf<ChampionSpawnRegion>())
|
||||
from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
|
||||
else
|
||||
m_Model.OnPlacement(from, p);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Multis
|
|||
m_From = from;
|
||||
m_Boat = boat;
|
||||
|
||||
m_From.CloseGump(typeof(ConfirmDryDockGump));
|
||||
m_From.CloseGump<ConfirmDryDockGump>();
|
||||
|
||||
AddPage(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ namespace Server.Items
|
|||
z = from.Z + j;
|
||||
|
||||
if (map.CanFit(x, y, z, 16, false, false) && !SpellHelper.CheckMulti(new Point3D(x, y, z), map) &&
|
||||
!Region.Find(new Point3D(x, y, z), map).IsPartOf(typeof(StrongholdRegion)))
|
||||
!Region.Find(new Point3D(x, y, z), map).IsPartOf<StrongholdRegion>())
|
||||
{
|
||||
if (i == 1 && j >= -2 && j <= 2)
|
||||
return true;
|
||||
|
|
@ -204,7 +204,7 @@ namespace Server.Items
|
|||
z = map.GetAverageZ(x, y);
|
||||
|
||||
if (map.CanFit(x, y, z, 16, false, false) && !SpellHelper.CheckMulti(new Point3D(x, y, z), map) &&
|
||||
!Region.Find(new Point3D(x, y, z), map).IsPartOf(typeof(StrongholdRegion)))
|
||||
!Region.Find(new Point3D(x, y, z), map).IsPartOf<StrongholdRegion>())
|
||||
{
|
||||
if (i == 1)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
|
||||
|
|
@ -26,13 +27,13 @@ namespace Server.Multis.Deeds
|
|||
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing(from, p))
|
||||
m_Deed.OnPlacement(from, p);
|
||||
else if (reg.IsPartOf(typeof(TempNoHousingRegion)))
|
||||
else if (reg.IsPartOf<TempNoHousingRegion>())
|
||||
from.SendLocalizedMessage(
|
||||
501270); // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
|
||||
else if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
|
||||
else if (reg.IsPartOf<TreasureRegion>() || reg.IsPartOf<HouseRegion>())
|
||||
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.
|
||||
else if (reg.IsPartOf(typeof(HouseRaffleRegion)))
|
||||
else if (reg.IsPartOf<HouseRaffleRegion>())
|
||||
from.SendLocalizedMessage(1150493); // You must have a deed for this plot of land in order to build here.
|
||||
else
|
||||
from.SendLocalizedMessage(501265); // Housing can not be created in this area.
|
||||
|
|
@ -138,7 +139,7 @@ namespace Server.Multis.Deeds
|
|||
else
|
||||
{
|
||||
Point3D center = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);
|
||||
HousePlacementResult res = HousePlacement.Check(from, MultiID, center, out ArrayList toMove);
|
||||
HousePlacementResult res = HousePlacement.Check(from, MultiID, center, out List<IEntity> toMove);
|
||||
|
||||
switch (res)
|
||||
{
|
||||
|
|
@ -876,4 +877,4 @@ namespace Server.Multis.Deeds
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ namespace Server.Multis
|
|||
{
|
||||
Item item = Fixtures[i];
|
||||
|
||||
if (Doors.Contains(item))
|
||||
if (item is BaseDoor door && Doors.Contains(door))
|
||||
continue;
|
||||
|
||||
item.MoveToWorld(new Point3D(item.X + x, item.Y + y, item.Z + z), Map);
|
||||
|
|
@ -301,8 +301,11 @@ namespace Server.Multis
|
|||
|
||||
for (int i = 0; i < Fixtures.Count; ++i)
|
||||
{
|
||||
Fixtures[i].Delete();
|
||||
Doors.Remove(Fixtures[i]);
|
||||
Item item = Fixtures[i];
|
||||
item.Delete();
|
||||
|
||||
if (item is BaseDoor door)
|
||||
Doors.Remove(door);
|
||||
}
|
||||
|
||||
Fixtures.Clear();
|
||||
|
|
@ -1698,7 +1701,7 @@ namespace Server.Multis
|
|||
Mobile from = state.Mobile;
|
||||
DesignContext context = DesignContext.Find(from);
|
||||
|
||||
if (World.FindItem(pvSrc.ReadInt32()) is HouseFoundation foundation && from.Map == foundation.Map && from.InRange(foundation.GetWorldLocation(), 24) &&
|
||||
if (World.FindItem(pvSrc.ReadUInt32()) is HouseFoundation foundation && from.Map == foundation.Map && from.InRange(foundation.GetWorldLocation(), 24) &&
|
||||
from.CanSee(foundation))
|
||||
{
|
||||
DesignState stateToSend;
|
||||
|
|
@ -2274,7 +2277,7 @@ namespace Server.Multis
|
|||
m_Thread.Start();
|
||||
}
|
||||
|
||||
public DesignStateDetailed(int serial, int revision, int xMin, int yMin, int xMax, int yMax, MultiTileEntry[] tiles)
|
||||
public DesignStateDetailed(uint serial, int revision, int xMin, int yMin, int xMax, int yMax, MultiTileEntry[] tiles)
|
||||
: base(0xD8)
|
||||
{
|
||||
EnsureCapacity(17 + tiles.Length * 5);
|
||||
|
|
@ -2408,7 +2411,7 @@ namespace Server.Multis
|
|||
|
||||
int planeCount = 0;
|
||||
|
||||
byte[] m_DeflatedBuffer = null;
|
||||
byte[] m_DeflatedBuffer;
|
||||
lock (m_DeflatedBufferPool)
|
||||
{
|
||||
m_DeflatedBuffer = m_DeflatedBufferPool.AcquireBuffer();
|
||||
|
|
@ -2520,6 +2523,16 @@ namespace Server.Multis
|
|||
|
||||
m_Stream.UnderlyingStream.Write(m_PrimBuffer, 0, 4);
|
||||
}
|
||||
|
||||
public void Write(uint value)
|
||||
{
|
||||
m_PrimBuffer[0] = (byte)(value >> 24);
|
||||
m_PrimBuffer[1] = (byte)(value >> 16);
|
||||
m_PrimBuffer[2] = (byte)(value >> 8);
|
||||
m_PrimBuffer[3] = (byte)value;
|
||||
|
||||
m_Stream.UnderlyingStream.Write(m_PrimBuffer, 0, 4);
|
||||
}
|
||||
|
||||
public void Write(short value)
|
||||
{
|
||||
|
|
@ -2633,7 +2646,8 @@ namespace Server.Multis
|
|||
{
|
||||
public NetState m_NetState;
|
||||
public DesignState m_Root;
|
||||
public int m_Serial, m_Revision;
|
||||
public int m_Revision;
|
||||
public uint m_Serial;
|
||||
public MultiTileEntry[] m_Tiles;
|
||||
public int m_xMin, m_yMin, m_xMax, m_yMax;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ namespace Server.Multis
|
|||
0x0150, 0x015C // Furrows
|
||||
};
|
||||
|
||||
public static HousePlacementResult Check(Mobile from, int multiID, Point3D center, out ArrayList toMove)
|
||||
public static HousePlacementResult Check(Mobile from, int multiID, Point3D center, out List<IEntity> toMove)
|
||||
{
|
||||
// If this spot is considered valid, every item and mobile in this list will be moved under the house sign
|
||||
toMove = new ArrayList();
|
||||
toMove = new List<IEntity>();
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
|
|
@ -56,9 +56,7 @@ namespace Server.Multis
|
|||
if (map == Map.Malas && (multiID == 0x007C || multiID == 0x007E))
|
||||
return HousePlacementResult.InvalidCastleKeep;
|
||||
|
||||
NoHousingRegion noHousingRegion = (NoHousingRegion)Region.Find(center, map).GetRegion(typeof(NoHousingRegion));
|
||||
|
||||
if (noHousingRegion != null)
|
||||
if (Region.Find(center, map).IsPartOf<NoHousingRegion>())
|
||||
return HousePlacementResult.BadRegion;
|
||||
|
||||
// This holds data describing the internal structure of the house
|
||||
|
|
@ -78,7 +76,7 @@ namespace Server.Multis
|
|||
List<Point2D> yard = new List<Point2D>(), borders = new List<Point2D>();
|
||||
|
||||
/* RULES:
|
||||
*
|
||||
*
|
||||
* 1) All tiles which are around the -outside- of the foundation must not have anything impassable.
|
||||
* 2) No impassable object or land tile may come in direct contact with any part of the house.
|
||||
* 3) Five tiles from the front and back of the house must be completely clear of all house tiles.
|
||||
|
|
@ -103,13 +101,13 @@ namespace Server.Multis
|
|||
|
||||
if (!reg.AllowHousing(from, testPoint)) // Cannot place houses in dungeons, towns, treasure map areas etc
|
||||
{
|
||||
if (reg.IsPartOf(typeof(TempNoHousingRegion)))
|
||||
if (reg.IsPartOf<TempNoHousingRegion>())
|
||||
return HousePlacementResult.BadRegionTemp;
|
||||
|
||||
if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
|
||||
if (reg.IsPartOf<TreasureRegion>() || reg.IsPartOf<HouseRegion>())
|
||||
return HousePlacementResult.BadRegionHidden;
|
||||
|
||||
if (reg.IsPartOf(typeof(HouseRaffleRegion)))
|
||||
if (reg.IsPartOf<HouseRaffleRegion>())
|
||||
return HousePlacementResult.BadRegionRaffle;
|
||||
|
||||
return HousePlacementResult.BadRegion;
|
||||
|
|
@ -362,4 +360,4 @@ namespace Server.Multis
|
|||
return HousePlacementResult.Valid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
|
|
@ -60,8 +62,8 @@ namespace Server.Items
|
|||
{
|
||||
m_From = from;
|
||||
|
||||
from.CloseGump(typeof(HousePlacementCategoryGump));
|
||||
from.CloseGump(typeof(HousePlacementListGump));
|
||||
from.CloseGump<HousePlacementCategoryGump>();
|
||||
from.CloseGump<HousePlacementListGump>();
|
||||
|
||||
AddPage(0);
|
||||
|
||||
|
|
@ -123,8 +125,8 @@ namespace Server.Items
|
|||
m_From = from;
|
||||
m_Entries = entries;
|
||||
|
||||
from.CloseGump(typeof(HousePlacementCategoryGump));
|
||||
from.CloseGump(typeof(HousePlacementListGump));
|
||||
from.CloseGump<HousePlacementCategoryGump>();
|
||||
from.CloseGump<HousePlacementListGump>();
|
||||
|
||||
AddPage(0);
|
||||
|
||||
|
|
@ -245,13 +247,13 @@ namespace Server.Items
|
|||
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing(from, p))
|
||||
m_Placed = m_Entry.OnPlacement(from, p);
|
||||
else if (reg.IsPartOf(typeof(TempNoHousingRegion)))
|
||||
else if (reg.IsPartOf<TempNoHousingRegion>())
|
||||
from.SendLocalizedMessage(
|
||||
501270); // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
|
||||
else if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
|
||||
else if (reg.IsPartOf<TreasureRegion>() || reg.IsPartOf<HouseRegion>())
|
||||
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.
|
||||
else if (reg.IsPartOf(typeof(HouseRaffleRegion)))
|
||||
else if (reg.IsPartOf<HouseRaffleRegion>())
|
||||
from.SendLocalizedMessage(1150493); // You must have a deed for this plot of land in order to build here.
|
||||
else
|
||||
from.SendLocalizedMessage(501265); // Housing can not be created in this area.
|
||||
|
|
@ -270,7 +272,7 @@ namespace Server.Items
|
|||
|
||||
public class HousePlacementEntry
|
||||
{
|
||||
private static Hashtable m_Table;
|
||||
private static Dictionary<Type, object> m_Table;
|
||||
private int m_Lockdowns;
|
||||
private int m_NewLockdowns;
|
||||
private int m_NewStorage;
|
||||
|
|
@ -278,7 +280,7 @@ namespace Server.Items
|
|||
|
||||
static HousePlacementEntry()
|
||||
{
|
||||
m_Table = new Hashtable();
|
||||
m_Table = new Dictionary<Type, object>();
|
||||
|
||||
FillTable(ClassicHouses);
|
||||
FillTable(TwoStoryFoundations);
|
||||
|
|
@ -561,28 +563,27 @@ namespace Server.Items
|
|||
object[] args;
|
||||
|
||||
if (Type == typeof(HouseFoundation))
|
||||
args = new object[4] { from, MultiID, m_Storage, m_Lockdowns };
|
||||
args = new object[] { from, MultiID, m_Storage, m_Lockdowns };
|
||||
else if (Type == typeof(SmallOldHouse) || Type == typeof(SmallShop) || Type == typeof(TwoStoryHouse))
|
||||
args = new object[2] { from, MultiID };
|
||||
args = new object[] { from, MultiID };
|
||||
else
|
||||
args = new object[1] { from };
|
||||
args = new object[] { from };
|
||||
|
||||
return Activator.CreateInstance(Type, args) as BaseHouse;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void PlacementWarning_Callback(Mobile from, bool okay, object state)
|
||||
public void PlacementWarning_Callback(Mobile from, bool okay, PreviewHouse prevHouse)
|
||||
{
|
||||
if (!from.CheckAlive() || from.Backpack?.FindItemByType<HousePlacementTool>() == null)
|
||||
return;
|
||||
|
||||
PreviewHouse prevHouse = (PreviewHouse)state;
|
||||
|
||||
if (!okay)
|
||||
{
|
||||
prevHouse.Delete();
|
||||
|
|
@ -594,19 +595,17 @@ namespace Server.Items
|
|||
/* Too much time has passed and the test house you created has been deleted.
|
||||
* Please try again!
|
||||
*/
|
||||
from.SendGump(new NoticeGump(1060637, 30720, 1060647, 32512, 320, 180, null, null));
|
||||
from.SendGump(new NoticeGump(1060637, 30720, 1060647, 32512, 320, 180));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D center = prevHouse.Location;
|
||||
Map map = prevHouse.Map;
|
||||
|
||||
prevHouse.Delete();
|
||||
|
||||
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, MultiID, center, out toMove);
|
||||
HousePlacementResult res = HousePlacement.Check(from, MultiID, center, out List<IEntity> toMove);
|
||||
|
||||
switch (res)
|
||||
{
|
||||
|
|
@ -653,10 +652,10 @@ namespace Server.Items
|
|||
{
|
||||
object o = toMove[i];
|
||||
|
||||
if (o is Mobile)
|
||||
((Mobile)o).Location = house.BanLocation;
|
||||
else if (o is Item)
|
||||
((Item)o).Location = house.BanLocation;
|
||||
if (o is Mobile mobile)
|
||||
mobile.Location = house.BanLocation;
|
||||
else if (o is Item item)
|
||||
item.Location = house.BanLocation;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -702,7 +701,7 @@ namespace Server.Items
|
|||
return false;
|
||||
|
||||
Point3D center = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);
|
||||
HousePlacementResult res = HousePlacement.Check(from, MultiID, center, out ArrayList toMove);
|
||||
HousePlacementResult res = HousePlacement.Check(from, MultiID, center, out List<IEntity> toMove);
|
||||
|
||||
switch (res)
|
||||
{
|
||||
|
|
@ -739,10 +738,10 @@ namespace Server.Items
|
|||
{
|
||||
object o = toMove[i];
|
||||
|
||||
if (o is Mobile)
|
||||
((Mobile)o).Location = banLoc;
|
||||
else if (o is Item)
|
||||
((Item)o).Location = banLoc;
|
||||
if (o is Mobile mobile)
|
||||
mobile.Location = banLoc;
|
||||
else if (o is Item item)
|
||||
item.Location = banLoc;
|
||||
}
|
||||
|
||||
prev.MoveToWorld(center, from.Map);
|
||||
|
|
@ -759,8 +758,7 @@ namespace Server.Items
|
|||
* If you are absolutely certain you wish to proceed, click the button next to OKAY below.
|
||||
* If you do not wish to trade for this house, click CANCEL.
|
||||
*/
|
||||
from.SendGump(new WarningGump(1060635, 30720, 1049583, 32512, 420, 280, PlacementWarning_Callback,
|
||||
prev));
|
||||
from.SendGump(new WarningGump(1060635, 30720, 1049583, 32512, 420, 280, okay => PlacementWarning_Callback(from, okay, prev)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -807,29 +805,16 @@ namespace Server.Items
|
|||
{
|
||||
object obj = m_Table[house.GetType()];
|
||||
|
||||
if (obj is HousePlacementEntry) return (HousePlacementEntry)obj;
|
||||
if (obj is HousePlacementEntry entry)
|
||||
return entry;
|
||||
|
||||
if (obj is ArrayList)
|
||||
if (obj is List<HousePlacementEntry> list)
|
||||
{
|
||||
ArrayList list = (ArrayList)obj;
|
||||
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
HousePlacementEntry e = (HousePlacementEntry)list[i];
|
||||
|
||||
if (e.MultiID == house.ItemID)
|
||||
return e;
|
||||
}
|
||||
return list.FirstOrDefault(e => e.MultiID == house.ItemID);
|
||||
}
|
||||
else if (obj is Hashtable)
|
||||
{
|
||||
Hashtable table = (Hashtable)obj;
|
||||
|
||||
obj = table[house.ItemID];
|
||||
|
||||
if (obj is HousePlacementEntry)
|
||||
return (HousePlacementEntry)obj;
|
||||
}
|
||||
if (obj is Dictionary<int, HousePlacementEntry> table)
|
||||
return table[house.ItemID];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -846,40 +831,33 @@ namespace Server.Items
|
|||
{
|
||||
m_Table[e.Type] = e;
|
||||
}
|
||||
else if (obj is HousePlacementEntry)
|
||||
else if (obj is HousePlacementEntry entry)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
list.Add(obj);
|
||||
list.Add(e);
|
||||
List<HousePlacementEntry> list = new List<HousePlacementEntry> { entry, e };
|
||||
|
||||
m_Table[e.Type] = list;
|
||||
}
|
||||
else if (obj is ArrayList)
|
||||
else if (obj is List<HousePlacementEntry> list)
|
||||
{
|
||||
ArrayList list = (ArrayList)obj;
|
||||
|
||||
if (list.Count == 8)
|
||||
{
|
||||
Hashtable table = new Hashtable();
|
||||
Dictionary<int, HousePlacementEntry> table = new Dictionary<int, HousePlacementEntry>();
|
||||
|
||||
for (int j = 0; j < list.Count; ++j)
|
||||
table[((HousePlacementEntry)list[j]).MultiID] = list[j];
|
||||
foreach (HousePlacementEntry t in list)
|
||||
table[t.MultiID] = t;
|
||||
|
||||
table[e.MultiID] = e;
|
||||
|
||||
m_Table[e.Type] = table;
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(e);
|
||||
}
|
||||
}
|
||||
else if (obj is Hashtable)
|
||||
else if (obj is Dictionary<int, HousePlacementEntry> table)
|
||||
{
|
||||
((Hashtable)obj)[e.MultiID] = e;
|
||||
table[e.MultiID] = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,11 +148,11 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public void ClaimGump_Callback(Mobile from, bool okay, object state)
|
||||
public void ClaimGump_Callback(Mobile from, bool okay)
|
||||
{
|
||||
if (okay && Owner != null && Owner.Owner == null && Owner.DecayLevel != DecayLevel.DemolitionPending)
|
||||
{
|
||||
bool canClaim = false;
|
||||
bool canClaim;
|
||||
|
||||
if (Owner.CoOwners == null || Owner.CoOwners.Count == 0)
|
||||
canClaim = Owner.IsFriend(from);
|
||||
|
|
@ -185,7 +185,7 @@ namespace Server.Multis
|
|||
canClaim = Owner.IsCoOwner(m);
|
||||
|
||||
if (canClaim && !BaseHouse.HasAccountHouse(m))
|
||||
m.SendGump(new WarningGump(501036, 32512, 1049719, 32512, 420, 280, ClaimGump_Callback, null));
|
||||
m.SendGump(new WarningGump(501036, 32512, 1049719, 32512, 420, 280, okay => ClaimGump_Callback(m, okay)));
|
||||
}
|
||||
|
||||
ShowSign(m);
|
||||
|
|
@ -285,7 +285,7 @@ namespace Server.Multis
|
|||
}
|
||||
else
|
||||
{
|
||||
from.CloseGump(typeof(VendorInventoryGump));
|
||||
from.CloseGump<VendorInventoryGump>();
|
||||
from.SendGump(new VendorInventoryGump(m_Sign.Owner, from));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -568,8 +568,8 @@ namespace Server.Multis
|
|||
door.Locked = true;
|
||||
door.KeyValue = keyValue;
|
||||
|
||||
if (door is BaseHouseDoor)
|
||||
((BaseHouseDoor)door).Facing = DoorFacing.EastCCW;
|
||||
if (door is BaseHouseDoor houseDoor)
|
||||
houseDoor.Facing = DoorFacing.EastCCW;
|
||||
|
||||
AddDoor(door, -2, 0, id == 0xA2 ? 24 : 27);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue