This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
|
|
@ -48,9 +47,22 @@ namespace Server.Items
|
|||
int version = reader.ReadEncodedInt();
|
||||
|
||||
int length = reader.ReadEncodedInt();
|
||||
for (int i = 0;; i++)
|
||||
if (i < length)
|
||||
{
|
||||
PuzzleChestCylinder cylinder = (PuzzleChestCylinder)reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < Cylinders.Length; i++)
|
||||
Cylinders[i] = i < length ? (PuzzleChestCylinder)reader.ReadInt() : RandomCylinder();
|
||||
if (i < Cylinders.Length)
|
||||
Cylinders[i] = cylinder;
|
||||
}
|
||||
else if (i < Cylinders.Length)
|
||||
{
|
||||
Cylinders[i] = RandomCylinder();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public PuzzleChestCylinder[] Cylinders{ get; } = new PuzzleChestCylinder[Length];
|
||||
|
|
@ -284,7 +296,7 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
Effects.SendLocationEffect(to, to.Map, 0x113A, 20);
|
||||
Effects.SendLocationEffect(to, to.Map, 0x113A, 20, 10);
|
||||
to.PlaySound(0x231);
|
||||
to.LocalOverheadMessage(MessageType.Regular, 0x44, 1010523); // A toxic vapor envelops thee.
|
||||
|
||||
|
|
@ -314,7 +326,7 @@ namespace Server.Items
|
|||
}
|
||||
default:
|
||||
{
|
||||
to.BoltEffect();
|
||||
to.BoltEffect(0);
|
||||
to.LocalOverheadMessage(MessageType.Regular, 0xDA, 1010526); // Lightning arcs through thy body.
|
||||
|
||||
AOS.Damage(to, to, Utility.RandomMinMax(10, 40), 0, 0, 0, 0, 100);
|
||||
|
|
@ -397,8 +409,12 @@ namespace Server.Items
|
|||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Item item = Core.AOS ?
|
||||
Loot.RandomArmorOrShieldOrWeaponOrJewelry() : Loot.RandomArmorOrShieldOrWeapon();
|
||||
Item item;
|
||||
|
||||
if (Core.AOS)
|
||||
item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
|
||||
else
|
||||
item = Loot.RandomArmorOrShieldOrWeapon();
|
||||
|
||||
if (item is BaseWeapon weapon)
|
||||
{
|
||||
|
|
@ -459,7 +475,13 @@ namespace Server.Items
|
|||
|
||||
public void CleanupGuesses()
|
||||
{
|
||||
foreach (Mobile m in from kvp in m_Guesses where DateTime.UtcNow - kvp.Value.When > CleanupTime select kvp.Key)
|
||||
List<Mobile> toDelete = new List<Mobile>();
|
||||
|
||||
foreach (KeyValuePair<Mobile, PuzzleChestSolutionAndTime> kvp in m_Guesses)
|
||||
if (DateTime.UtcNow - kvp.Value.When > CleanupTime)
|
||||
toDelete.Add(kvp.Key);
|
||||
|
||||
foreach (Mobile m in toDelete)
|
||||
m_Guesses.Remove(m);
|
||||
}
|
||||
|
||||
|
|
@ -477,10 +499,10 @@ namespace Server.Items
|
|||
for (int i = 0; i < Hints.Length; i++) writer.Write((int)Hints[i]);
|
||||
|
||||
writer.WriteEncodedInt(m_Guesses.Count);
|
||||
foreach (var (key, value) in m_Guesses)
|
||||
foreach (KeyValuePair<Mobile, PuzzleChestSolutionAndTime> kvp in m_Guesses)
|
||||
{
|
||||
writer.Write(key);
|
||||
value.Serialize(writer);
|
||||
writer.Write(kvp.Key);
|
||||
kvp.Value.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -658,7 +680,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
m_Chest.SubmitSolution(m_From, m_Solution);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (info.Switches.Length == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue