This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -485,6 +485,9 @@ namespace Server.Items
|
|||
int extraItems = 0;
|
||||
int extraWeight = 0;
|
||||
|
||||
// from.SendMessage( String.Format( "There are {0} items in this container.", this.Items.Count ) );
|
||||
// from.SendMessage( String.Format( "There are {0} items being dropped into this container.", droppedItems.Length ) );
|
||||
|
||||
for (int i = 0; i < droppedItems.Length; i++)
|
||||
{
|
||||
Item dropped = droppedItems[i];
|
||||
|
|
@ -593,7 +596,9 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CheckContentDisplay(Mobile from) =>
|
||||
|
|
@ -625,7 +630,10 @@ namespace Server.Items
|
|||
|
||||
if (ns != null)
|
||||
{
|
||||
Packets.SendDisplayContainer(ns, Serial, (short)GumpID);
|
||||
if (ns.HighSeas)
|
||||
to.Send(new ContainerDisplayHS(this));
|
||||
else
|
||||
to.Send(new ContainerDisplay(this));
|
||||
|
||||
SendContentTo(ns);
|
||||
|
||||
|
|
@ -634,7 +642,7 @@ namespace Server.Items
|
|||
List<Item> items = Items;
|
||||
|
||||
for (int i = 0; i < items.Count; ++i)
|
||||
items[i].PropertyList.SendOPLInfo(ns);
|
||||
to.Send(items[i].OPLPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -656,7 +664,9 @@ namespace Server.Items
|
|||
Mobile mob = Openers[i];
|
||||
|
||||
if (mob == opener)
|
||||
{
|
||||
contains = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int range = GetUpdateRange(mob);
|
||||
|
|
@ -669,14 +679,24 @@ namespace Server.Items
|
|||
|
||||
if (!contains)
|
||||
{
|
||||
Openers ??= new List<Mobile>();
|
||||
if (Openers == null)
|
||||
Openers = new List<Mobile>();
|
||||
|
||||
Openers.Add(opener);
|
||||
}
|
||||
else if (Openers?.Count == 0)
|
||||
{
|
||||
Openers = null;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SendContentTo(NetState state) => Packets.SendContainerContent(state, state.Mobile, this);
|
||||
public virtual void SendContentTo(NetState state)
|
||||
{
|
||||
if (state?.ContainerGridLines == true)
|
||||
state.Send(new ContainerContent6017(state.Mobile, this));
|
||||
else
|
||||
state.Send(new ContainerContent(state.Mobile, this));
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
|
|
@ -788,7 +808,8 @@ namespace Server.Items
|
|||
for (int j = 0; j < items[i].Length; ++j)
|
||||
totals[i] += items[i][j].Amount;
|
||||
|
||||
hasEnough |= totals[i] >= amount;
|
||||
if (totals[i] >= amount)
|
||||
hasEnough = true;
|
||||
}
|
||||
|
||||
if (!hasEnough)
|
||||
|
|
@ -880,7 +901,8 @@ namespace Server.Items
|
|||
for (int k = 0; k < items[i][j].Length; ++k)
|
||||
totals[i][j] += items[i][j][k].Amount;
|
||||
|
||||
hasEnough |= totals[i][j] >= amounts[i];
|
||||
if (totals[i][j] >= amounts[i])
|
||||
hasEnough = true;
|
||||
}
|
||||
|
||||
if (!hasEnough)
|
||||
|
|
@ -974,7 +996,8 @@ namespace Server.Items
|
|||
for (int k = 0; k < items[i][j].Length; ++k)
|
||||
totals[i][j] += items[i][j][k].Amount;
|
||||
|
||||
hasEnough |= totals[i][j] >= amounts[i];
|
||||
if (totals[i][j] >= amounts[i])
|
||||
hasEnough = true;
|
||||
}
|
||||
|
||||
if (!hasEnough)
|
||||
|
|
@ -1575,10 +1598,12 @@ namespace Server.Items
|
|||
|
||||
public class ContainerData
|
||||
{
|
||||
private static readonly Dictionary<int, ContainerData> Table = new Dictionary<int, ContainerData>();
|
||||
private static Dictionary<int, ContainerData> m_Table;
|
||||
|
||||
static ContainerData()
|
||||
{
|
||||
m_Table = new Dictionary<int, ContainerData>();
|
||||
|
||||
string path = Path.Combine(Core.BaseDirectory, "Data/containers.cfg");
|
||||
|
||||
if (!File.Exists(path))
|
||||
|
|
@ -1604,7 +1629,7 @@ namespace Server.Items
|
|||
|
||||
if (split.Length >= 3)
|
||||
{
|
||||
int gumpId = Utility.ToInt32(split[0]);
|
||||
int gumpID = Utility.ToInt32(split[0]);
|
||||
|
||||
string[] aRect = split[1].Split(' ');
|
||||
if (aRect.Length < 4)
|
||||
|
|
@ -1619,9 +1644,10 @@ namespace Server.Items
|
|||
|
||||
int dropSound = Utility.ToInt32(split[2]);
|
||||
|
||||
ContainerData data = new ContainerData(gumpId, bounds, dropSound);
|
||||
ContainerData data = new ContainerData(gumpID, bounds, dropSound);
|
||||
|
||||
Default ??= data;
|
||||
if (Default == null)
|
||||
Default = data;
|
||||
|
||||
if (split.Length >= 4)
|
||||
{
|
||||
|
|
@ -1631,10 +1657,10 @@ namespace Server.Items
|
|||
{
|
||||
int id = Utility.ToInt32(aIDs[i]);
|
||||
|
||||
if (Table.ContainsKey(id))
|
||||
if (m_Table.ContainsKey(id))
|
||||
Console.WriteLine(@"Warning: double ItemID entry in Data\containers.cfg");
|
||||
else
|
||||
Table[id] = data;
|
||||
m_Table[id] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1646,12 +1672,13 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
Default ??= new ContainerData(0x3C, new Rectangle2D(44, 65, 142, 94), 0x48);
|
||||
if (Default == null)
|
||||
Default = new ContainerData(0x3C, new Rectangle2D(44, 65, 142, 94), 0x48);
|
||||
}
|
||||
|
||||
public ContainerData(int gumpId, Rectangle2D bounds, int dropSound)
|
||||
public ContainerData(int gumpID, Rectangle2D bounds, int dropSound)
|
||||
{
|
||||
GumpID = gumpId;
|
||||
GumpID = gumpID;
|
||||
Bounds = bounds;
|
||||
DropSound = dropSound;
|
||||
}
|
||||
|
|
@ -1664,9 +1691,9 @@ namespace Server.Items
|
|||
|
||||
public int DropSound{ get; }
|
||||
|
||||
public static ContainerData GetData(int itemId)
|
||||
public static ContainerData GetData(int itemID)
|
||||
{
|
||||
Table.TryGetValue(itemId, out ContainerData data);
|
||||
m_Table.TryGetValue(itemID, out ContainerData data);
|
||||
return data ?? Default;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Accounting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
|
|
@ -53,9 +54,7 @@ namespace Server.Items
|
|||
{
|
||||
Owner.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true,
|
||||
$"Bank container has {TotalItems} items, {TotalWeight} stones", Owner.NetState);
|
||||
|
||||
if (Owner.NetState != null)
|
||||
Packets.SendEquipUpdate(Owner.NetState, this);
|
||||
Owner.Send(new EquipUpdate(this));
|
||||
DisplayTo(Owner);
|
||||
}
|
||||
}
|
||||
|
|
@ -98,8 +97,8 @@ namespace Server.Items
|
|||
{
|
||||
Opened = false;
|
||||
|
||||
if (SendDeleteOnClose && Owner != null)
|
||||
Packets.SendRemoveEntity(Owner.NetState, Serial);
|
||||
if (SendDeleteOnClose)
|
||||
Owner?.Send(RemovePacket);
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Accounting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server
|
||||
{
|
||||
public sealed class VirtualCheck : Item
|
||||
{
|
||||
|
|
@ -34,7 +35,7 @@ namespace Server.Items
|
|||
|
||||
public override string DefaultName => "Offer Of Currency";
|
||||
|
||||
public EditGump Editor { get; private set; }
|
||||
public EditGump Editor{ get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Administrator)]
|
||||
public int Plat
|
||||
|
|
@ -170,8 +171,8 @@ namespace Server.Items
|
|||
CompileLayout();
|
||||
}
|
||||
|
||||
public Mobile User { get; }
|
||||
public VirtualCheck Check { get; private set; }
|
||||
public Mobile User{ get; }
|
||||
public VirtualCheck Check{ get; private set; }
|
||||
|
||||
public override void OnServerClose(NetState owner)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
namespace Server.Items
|
||||
using Server.Network;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public abstract class BaseHairInfo
|
||||
{
|
||||
|
|
@ -59,7 +61,12 @@ namespace Server.Items
|
|||
|
||||
public class HairInfo : BaseHairInfo
|
||||
{
|
||||
public HairInfo(int itemid, int hue = 0)
|
||||
public HairInfo(int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
}
|
||||
|
||||
public HairInfo(int itemid, int hue)
|
||||
: base(itemid, hue)
|
||||
{
|
||||
}
|
||||
|
|
@ -75,7 +82,12 @@ namespace Server.Items
|
|||
|
||||
public class FacialHairInfo : BaseHairInfo
|
||||
{
|
||||
public FacialHairInfo(int itemid, int hue = 0)
|
||||
public FacialHairInfo(int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
}
|
||||
|
||||
public FacialHairInfo(int itemid, int hue)
|
||||
: base(itemid, hue)
|
||||
{
|
||||
}
|
||||
|
|
@ -144,4 +156,4 @@ namespace Server.Items
|
|||
m_Stream.Write(FacialHairInfo.FakeSerial(parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue