Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,139 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
public class BlanketOfDarkness : Item
{
public override bool IsArtifact { get { return true; } }
public override int LabelNumber { get { return 1152304; } } // Blanket Of Darkness
[Constructable]
public BlanketOfDarkness()
: base(0xA57)
{
Hue = 2076;
Weight = 10.0;
}
public BlanketOfDarkness(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (this.Parent != null || !this.VerifyMove(from))
return;
if (!from.InRange(this, 2))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
return;
}
if (this.ItemID == 0xA57) // rolled
{
Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);
if (dir == Direction.North || dir == Direction.South)
this.ItemID = 0xA55;
else
this.ItemID = 0xA56;
}
else // unrolled
{
this.ItemID = 0xA57;
if (!from.HasGump(typeof(LogoutGump)))
{
CampfireEntry entry = Campfire.GetEntry(from);
if (entry != null && entry.Safe)
from.SendGump(new LogoutGump(entry, this));
}
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1061078, "8"); // artifact rarity ~1_val~
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
private class LogoutGump : Gump
{
private readonly Timer m_CloseTimer;
private readonly CampfireEntry m_Entry;
private readonly BlanketOfDarkness m_BlanketOfDarkness;
public LogoutGump(CampfireEntry entry, BlanketOfDarkness BlanketOfDarkness)
: base(100, 0)
{
this.m_Entry = entry;
this.m_BlanketOfDarkness = BlanketOfDarkness;
this.m_CloseTimer = Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(CloseGump));
this.AddBackground(0, 0, 400, 350, 0xA28);
this.AddHtmlLocalized(100, 20, 200, 35, 1011015, false, false); // <center>Logging out via camping</center>
/* Using a bedroll in the safety of a camp will log you out of the game safely.
* If this is what you wish to do choose CONTINUE and you will be logged out.
* Otherwise, select the CANCEL button to avoid logging out at this time.
* The camp will remain secure for 10 seconds at which time this window will close
* and you not be logged out.
*/
this.AddHtmlLocalized(50, 55, 300, 140, 1011016, true, true);
this.AddButton(45, 298, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(80, 300, 110, 35, 1011011, false, false); // CONTINUE
this.AddButton(200, 298, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(235, 300, 110, 35, 1011012, false, false); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
PlayerMobile pm = this.m_Entry.Player;
this.m_CloseTimer.Stop();
if (Campfire.GetEntry(pm) != this.m_Entry)
return;
if (info.ButtonID == 1 && this.m_Entry.Safe && this.m_BlanketOfDarkness.Parent == null && this.m_BlanketOfDarkness.IsAccessibleTo(pm) &&
this.m_BlanketOfDarkness.VerifyMove(pm) && this.m_BlanketOfDarkness.Map == pm.Map && pm.InRange(this.m_BlanketOfDarkness, 2))
{
pm.PlaceInBackpack(this.m_BlanketOfDarkness);
pm.BlanketOfDarknessLogout = true;
sender.Dispose();
}
Campfire.RemoveEntry(this.m_Entry);
}
private void CloseGump()
{
Campfire.RemoveEntry(this.m_Entry);
this.m_Entry.Player.CloseGump(typeof(LogoutGump));
}
}
}
}

View File

@@ -0,0 +1,164 @@
using Server;
using System;
namespace Server.Items
{
public class TortureRackComponent : AddonComponent, IArtifact
{
public override int LabelNumber { get { return 1152307; } } // Torture Rack
public virtual bool ShowArtifactRarity { get { return true; } }
public TortureRackComponent(int itemID)
: base(itemID)
{
}
public TortureRackComponent(Serial serial)
: base(serial)
{
}
public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } }
public virtual int ArtifactRarity { get { return 10; } }
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (ShowArtifactRarity)
list.Add(1061078, this.ArtifactRarity.ToString()); // artifact rarity ~1_val~
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class TortureRackEast : BaseAddon
{
[Constructable]
public TortureRackEast()
{
this.AddComponent(new TortureRackComponent(0x4AAB), 0, 0, 0);
this.AddComponent(new TortureRackComponent(0x4AA3), 0, 1, 0);
this.AddComponent(new TortureRackComponent(0x4AA2), 0, 2, 0);
}
public TortureRackEast(Serial serial)
: base(serial)
{
}
public override BaseAddonDeed Deed { get { return new TortureRackEastDeed(); } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class TortureRackEastDeed : BaseAddonDeed
{
public override int LabelNumber { get { return 1152305; } }
[Constructable]
public TortureRackEastDeed()
{
}
public TortureRackEastDeed(Serial serial)
: base(serial)
{
}
public override BaseAddon Addon { get { return new TortureRackEast(); } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class TortureRackSouth : BaseAddon
{
[Constructable]
public TortureRackSouth()
{
this.AddComponent(new TortureRackComponent(0x4AA0), 0, 0, 0);
this.AddComponent(new TortureRackComponent(0x4AA1), 1, 0, 0);
this.AddComponent(new TortureRackComponent(0x4AAD), 2, 0, 0);
}
public TortureRackSouth(Serial serial)
: base(serial)
{
}
public override BaseAddonDeed Deed { get { return new TortureRackSouthDeed(); } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class TortureRackSouthDeed : BaseAddonDeed
{
public override int LabelNumber { get { return 1152306; } }
[Constructable]
public TortureRackSouthDeed()
{
}
public TortureRackSouthDeed(Serial serial)
: base(serial)
{
}
public override BaseAddon Addon { get { return new TortureRackSouth(); } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,345 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Server.Items
{
public class BedrollSpawner : Item
{
public static Point3D[] m_RoomDestinations = new Point3D[]
{
new Point3D(5651, 555, 20),
new Point3D(5658, 562, 20),
new Point3D(5666, 558, 20),
new Point3D(5793, 594, 10),
new Point3D(5790, 587, 10),
new Point3D(5789, 579, 10),
new Point3D(5790, 571, 10),
new Point3D(5793, 563, 10),
new Point3D(5792, 555, 10),
new Point3D(5863, 594, 15),
new Point3D(5864, 585, 15),
new Point3D(5864, 578, 15),
new Point3D(5863, 570, 15),
new Point3D(5865, 562, 15),
new Point3D(5868, 554 ,15)
};
public static Point3D[] m_OutsideTunnels = new Point3D[]
{
new Point3D(5670, 550, 22),
new Point3D(5721, 550, 20),
new Point3D(5670, 535, 0),
new Point3D(5864, 532, 15),
new Point3D(5782, 536, 10)
};
private static readonly BedrollEntry[] m_Entries = new BedrollEntry[]
{
// Upper Floor Room 1
new BedrollEntry(new Point3D(5653, 565, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5651, 564, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5653, 561, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5650, 560, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5651, 555, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5651, 557, 20), typeof(WrongBedrollEast)),
// Upper Floor Room 2
new BedrollEntry(new Point3D(5657, 554, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5659, 555, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5661, 558, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5657, 559, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5657, 561, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5660, 561, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5658, 563, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5657, 565, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5661, 563, 20), typeof(WrongBedrollEast)),
// Upper Floor Room 3
new BedrollEntry(new Point3D(5666, 554, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5665, 557, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5668, 558, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5665, 560, 20), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5668, 563, 20), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5665, 565, 20), typeof(WrongBedrollEast)),
// Left Room 1
new BedrollEntry(new Point3D(5787, 594, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5789, 596, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5792, 596, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5792, 593, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 596, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5795, 593, 10), typeof(WrongBedrollEast)),
// Left Room 2
new BedrollEntry(new Point3D(5787, 588, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5790, 589, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5791, 585, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5793, 589, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 585, 10), typeof(WrongBedrollEast)),
// Left Room 3
new BedrollEntry(new Point3D(5787, 581, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5791, 577, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5793, 581, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 579, 10), typeof(WrongBedrollSouth)),
// Left Room 4
new BedrollEntry(new Point3D(5787, 570, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5789, 573, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5792, 573, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5792, 570, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 570, 10), typeof(WrongBedrollSouth)),
// Left Room 5
new BedrollEntry(new Point3D(5787, 561, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5788, 564, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5790, 562, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5791, 565, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 565, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5795, 561, 10), typeof(WrongBedrollEast)),
// Left Room 6
new BedrollEntry(new Point3D(5789, 553, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5790, 555, 10), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5791, 557, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5794, 557, 10), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5795, 554, 10), typeof(WrongBedrollSouth)),
// Rigth Room 1
new BedrollEntry(new Point3D(5861, 596, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5862, 593, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5865, 596, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5866, 594, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5867, 592, 15), typeof(WrongBedrollEast)),
// Rigth Room 2
new BedrollEntry(new Point3D(5860, 585, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5861, 588, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5864, 588, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5866, 585, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5867, 588, 15), typeof(WrongBedrollSouth)),
// Rigth Room 3
new BedrollEntry(new Point3D(5860, 577, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5861, 580, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5863, 580, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5864, 576, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5866, 579, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5867, 576, 15), typeof(WrongBedrollEast)),
// Rigth Room 4
new BedrollEntry(new Point3D(5860, 568, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5861, 572, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5863, 569, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5865, 571, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5867, 568, 15), typeof(WrongBedrollSouth)),
// Rigth Room 5
new BedrollEntry(new Point3D(5860, 562, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5861, 560, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5862, 564, 15), typeof(WrongBedrollSouth)),
new BedrollEntry(new Point3D(5864, 563, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5864, 561, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5866, 564, 15), typeof(WrongBedrollEast)),
new BedrollEntry(new Point3D(5867, 561, 15), typeof(WrongBedrollEast)),
};
public readonly TimeSpan RestartDelay = TimeSpan.FromHours(2.0);
private Timer m_Timer;
private List<WrongBedrollBase> Bedrolls { get; set; }
public List<MysteriousTunnel> MysteriousTunnels { get; set; }
public static List<BedrollSpawner> Instances { get; set; }
public BedrollSpawner()
: base(3796)
{
Movable = false;
Visible = false;
Bedrolls = new List<WrongBedrollBase>();
MysteriousTunnels = new List<MysteriousTunnel>();
Timer.DelayCall(TimeSpan.FromSeconds(10), CheckRespawn);
m_Timer = Timer.DelayCall(RestartDelay, RestartDelay, new TimerCallback(CheckRespawn));
m_Timer.Start();
if (Instances == null)
Instances = new List<BedrollSpawner>();
Instances.Add(this);
}
private void CheckRespawn()
{
Cleanup();
// Bedrolls Spawn
foreach (BedrollEntry entry in m_Entries)
{
WrongBedrollBase item = (WrongBedrollBase)Activator.CreateInstance(entry.Type);
item.Movable = false;
item.MoveToWorld(entry.Location, Map);
Bedrolls.Add(item);
}
// Mysterious Tunnels Spawn
MysteriousTunnel mt;
WrongBedrollBase bedroll;
int mtrandom;
for (int i = 0; i < m_OutsideTunnels.Length; i++)
{
mt = new MysteriousTunnel();
if (i < 3)
{
mtrandom = Utility.Random(m_Entries.Length);
mt.PointDest = Bedrolls[mtrandom].Location;
Bedrolls[mtrandom].PointDest = m_OutsideTunnels[i];
Bedrolls[mtrandom].BedrollSpawner = this;
}
else
{
mt.PointDest = m_RoomDestinations[Utility.Random(m_RoomDestinations.Length)];
bedroll = Bedrolls.Where(x => x.InRange(mt.PointDest, 4) && x.PointDest == Point3D.Zero).FirstOrDefault();
if (bedroll != null)
{
bedroll.PointDest = m_OutsideTunnels[i];
bedroll.BedrollSpawner = this;
}
}
mt.MoveToWorld(m_OutsideTunnels[i], Map);
MysteriousTunnels.Add(mt);
}
}
public BedrollSpawner(Serial serial)
: base(serial)
{
}
public void Cleanup()
{
if (Bedrolls != null)
{
Bedrolls.ForEach(f => f.Delete());
Bedrolls.Clear();
}
if (MysteriousTunnels != null)
{
MysteriousTunnels.ForEach(f => f.Delete());
MysteriousTunnels.Clear();
}
}
public override void OnDelete()
{
if (m_Timer != null)
{
m_Timer.Stop();
m_Timer = null;
}
Cleanup();
base.OnDelete();
}
public override string DefaultName { get { return "Wrong Bedrolls Spawner " + Map; } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
if (m_Timer != null)
writer.Write(m_Timer.Next);
else
writer.Write(DateTime.UtcNow + RestartDelay);
writer.Write(Bedrolls == null ? 0 : Bedrolls.Count);
if (Bedrolls != null)
{
Bedrolls.ForEach(x => writer.Write(x));
}
writer.Write(MysteriousTunnels == null ? 0 : MysteriousTunnels.Count);
if (MysteriousTunnels != null)
{
MysteriousTunnels.ForEach(y => writer.Write(y));
}
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (Instances == null)
Instances = new List<BedrollSpawner>();
Instances.Add(this);
DateTime next = reader.ReadDateTime();
if (next < DateTime.UtcNow)
next = DateTime.UtcNow;
m_Timer = Timer.DelayCall(next - DateTime.UtcNow, RestartDelay, new TimerCallback(CheckRespawn));
m_Timer.Start();
Bedrolls = new List<WrongBedrollBase>();
MysteriousTunnels = new List<MysteriousTunnel>();
int bedrollcount = reader.ReadInt();
for (int x = 0; x < bedrollcount; x++)
{
WrongBedrollBase wb = reader.ReadItem() as WrongBedrollBase;
if (wb != null)
Bedrolls.Add(wb);
}
int mysteriouscount = reader.ReadInt();
for (int y = 0; y < mysteriouscount; y++)
{
MysteriousTunnel mt = reader.ReadItem() as MysteriousTunnel;
if (mt != null)
MysteriousTunnels.Add(mt);
}
if (version == 0)
{
Timer.DelayCall<Map>(TimeSpan.FromSeconds(5), map =>
{
EnchantedHotItem.SpawnChests(map);
Console.WriteLine("Hot Item chests spawned for {0}.", this.Map);
}, Map);
}
}
public class BedrollEntry
{
private readonly Point3D m_Location;
private readonly Type m_Type;
public BedrollEntry(Point3D location, Type type)
{
m_Location = location;
m_Type = type;
}
public Point3D Location { get { return m_Location; } }
public Type Type { get { return m_Type; } }
}
}
}

View File

@@ -0,0 +1,60 @@
using System;
using Server.Mobiles;
namespace Server.Items
{
public class MysteriousTunnel : Item
{
public override int LabelNumber { get { return 1152265; } } // mysterious tunnel
private Point3D m_PointDest;
[CommandProperty(AccessLevel.GameMaster)]
public Point3D PointDest
{
get { return m_PointDest; }
set { m_PointDest = value; }
}
[Constructable]
public MysteriousTunnel()
: base(0x1B71)
{
this.Movable = false;
}
public MysteriousTunnel(Serial serial)
: base(serial)
{
}
public override bool OnMoveOver(Mobile m)
{
if (m is PlayerMobile)
{
Point3D loc = PointDest;
m.MoveToWorld(loc, this.Map);
BaseCreature.TeleportPets(m, loc, this.Map);
return false;
}
return true;
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(this.m_PointDest);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
this.m_PointDest = reader.ReadPoint3D();
}
}
}

View File

@@ -0,0 +1,42 @@
using System;
namespace Server.Items
{
public class Soap : Item
{
public override int LabelNumber { get { return 1152267; } } // soap
[Constructable]
public Soap()
: this(1)
{
}
[Constructable]
public Soap(int amount)
: base(0x1422)
{
this.Hue = 1285;
this.Weight = 1.0;
this.Stackable = true;
this.Amount = amount;
}
public Soap(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class StinkingCauldron : Item
{
public override int LabelNumber { get { return 1152163; } } // stinking cauldron
[Constructable]
public StinkingCauldron()
: base(0x142A)
{
Movable = false;
Hue = 363;
Weight = 0.0;
Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(GooeyMaggotsSpawn));
}
private void GooeyMaggotsSpawn()
{
if (Map != null && Map != Map.Internal)
{
int amount = Utility.RandomMinMax(1, 2);
for (int i = 0; i < amount; ++i)
{
BaseCreature creature = new GooeyMaggots();
creature.MoveToWorld(Map.GetSpawnPosition(Location, 2), Map);
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
}
}
Delete();
}
public StinkingCauldron(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(GooeyMaggotsSpawn));
}
}
}

View File

@@ -0,0 +1,143 @@
using Server.Network;
using Server.Spells.Third;
using System;
namespace Server.Items
{
public class WrongBarredMetalDoor : BaseDoor, ILockpickable, IMageUnlockable
{
private int m_LockLevel, m_MaxLockLevel, m_RequiredSkill;
private Mobile m_Picker;
private Timer m_Timer;
private bool m_MagicUnlocked;
[CommandProperty(AccessLevel.GameMaster)]
public Mobile Picker
{
get { return this.m_Picker; }
set { this.m_Picker = value; }
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxLockLevel
{
get { return this.m_MaxLockLevel; }
set { this.m_MaxLockLevel = value; }
}
[CommandProperty(AccessLevel.GameMaster)]
public int LockLevel
{
get { return this.m_LockLevel; }
set { this.m_LockLevel = value; }
}
[CommandProperty(AccessLevel.GameMaster)]
public int RequiredSkill
{
get { return this.m_RequiredSkill; }
set { this.m_RequiredSkill = value; }
}
[Constructable]
public WrongBarredMetalDoor(DoorFacing facing)
: base(0x685 + (2 * (int)facing), 0x686 + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing))
{
this.Locked = true;
this.m_LockLevel = 80;
this.m_MaxLockLevel = 110;
this.m_RequiredSkill = 100;
}
public WrongBarredMetalDoor(Serial serial) : base(serial)
{
}
public virtual void LockPick(Mobile from)
{
this.Picker = from;
this.Locked = false;
this.m_Timer = new InternalTimer(this);
this.m_Timer.Start();
}
public override void OnTelekinesis(Mobile from)
{
this.m_Timer = new InternalTimer(this);
this.m_Timer.Start();
if (from.Skills.Magery.Value >= m_RequiredSkill)
{
m_MagicUnlocked = true;
}
Use(from);
}
public void OnMageUnlock(Mobile from)
{
this.m_Timer = new InternalTimer(this);
this.m_Timer.Start();
if (from.Skills.Magery.Value >= m_RequiredSkill)
{
m_MagicUnlocked = true;
}
}
public override void Use(Mobile from)
{
if (m_MagicUnlocked)
{
this.Locked = false;
m_MagicUnlocked = false;
}
if (this.Locked && !this.Open)
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501746); // It appears to be locked.
return;
}
base.Use(from);
}
private class InternalTimer : Timer
{
private readonly BaseDoor m_Door;
public InternalTimer(BaseDoor door)
: base(TimeSpan.FromSeconds(10.0))
{
this.Priority = TimerPriority.OneSecond;
this.m_Door = door;
}
protected override void OnTick()
{
this.m_Door.Locked = true;
}
}
public override void Serialize(GenericWriter writer) // Default Serialize method
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write((int)m_RequiredSkill);
writer.Write((int)m_MaxLockLevel);
writer.Write((int)m_LockLevel);
}
public override void Deserialize(GenericReader reader) // Default Deserialize method
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_RequiredSkill = reader.ReadInt();
m_MaxLockLevel = reader.ReadInt();
m_LockLevel = reader.ReadInt();
this.Locked = true;
}
}
}

View File

@@ -0,0 +1,210 @@
using System;
namespace Server.Items
{
public class WrongBedrollBase : Item
{
private Point3D m_PointDest;
private BedrollSpawner m_Spawner;
[CommandProperty(AccessLevel.GameMaster)]
public Point3D PointDest
{
get { return m_PointDest; }
set { m_PointDest = value; }
}
[CommandProperty(AccessLevel.GameMaster)]
public BedrollSpawner BedrollSpawner
{
get { return m_Spawner; }
set { m_Spawner = value; }
}
[Constructable]
public WrongBedrollBase(int id)
: base(id)
{
this.Movable = false;
}
public WrongBedrollBase(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
{
from.SendLocalizedMessage(500446); // That is too far away.
return;
}
from.RevealingAction();
if (this.PointDest != Point3D.Zero)
{
MysteriousTunnel mt = new MysteriousTunnel();
Effects.PlaySound(from.Location, from.Map, 0x3BD);
mt.PointDest = this.PointDest;
mt.MoveToWorld(Location, Map);
m_Spawner.MysteriousTunnels.Add(mt);
}
else
{
if (Utility.RandomDouble() < 0.5)
{
Point3D loc = this.GetWorldLocation();
Map facet = this.Map;
this.SendMessageTo(from, 502999, 0x3B2); // You set off a trap!
AOS.Damage(from, 40, 0, 100, 0, 0, 0);
switch (Utility.Random(3))
{
case 0:
{
Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
Effects.PlaySound(loc, facet, 0x307);
break;
}
case 1:
{
Effects.PlaySound(loc, this.Map, 0x307);
Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), this.Map, 0x36BD, 15);
Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), this.Map, 0x36BD, 15);
Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), this.Map, 0x36BD, 15);
Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), this.Map, 0x36BD, 15);
Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), this.Map, 0x36BD, 15);
break;
}
case 2:
{
Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20);
Effects.PlaySound(loc, facet, 0x231);
break;
}
}
}
else
{
if (Utility.RandomDouble() < 0.01)
{
Item soap = new Soap();
Effects.PlaySound(from.Location, from.Map, 0x247); //powder
if (Utility.RandomBool())
{
from.AddToBackpack(soap);
from.SendLocalizedMessage(1152268, String.Format("soap"));
}
else
{
soap.MoveToWorld(this.Location, this.Map);
}
}
else
{
Effects.PlaySound(from.Location, from.Map, 0x3E3); //leather
from.SendLocalizedMessage(1152212); //You tear the bedroll to pieces but find nothing.
}
}
}
this.Delete();
}
private void SendMessageTo(Mobile to, int number, int hue)
{
if (this.Deleted || !to.CanSee(this))
return;
to.Send(new Network.MessageLocalized(this.Serial, this.ItemID, Network.MessageType.Regular, hue, 3, number, "", ""));
}
private void SendMessageTo(Mobile to, string text, int hue)
{
if (this.Deleted || !to.CanSee(this))
return;
to.Send(new Network.UnicodeMessage(this.Serial, this.ItemID, Network.MessageType.Regular, hue, 3, "ENU", "", text));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(this.m_Spawner);
writer.Write(this.m_PointDest);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
this.m_Spawner = (BedrollSpawner)reader.ReadItem();
this.m_PointDest = reader.ReadPoint3D();
}
}
public class WrongBedrollSouth : WrongBedrollBase
{
public override int LabelNumber { get { return 1022645; } } // bedroll
[Constructable]
public WrongBedrollSouth()
: base(0x0A56)
{
}
public WrongBedrollSouth(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class WrongBedrollEast : WrongBedrollBase
{
public override int LabelNumber { get { return 1022645; } } // bedroll
[Constructable]
public WrongBedrollEast()
: base(0xA55)
{
}
public WrongBedrollEast(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using Server.Network;
namespace Server.Items
{
public class WrongMazeWall : BaseWall
{
[Constructable]
public WrongMazeWall()
: base(578)
{
Movable = false;
Visible = false;
}
public override void OnSingleClick(Mobile from)
{
if (this.Name != null)
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
else
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a dungeon wall"));
}
public override bool HandlesOnMovement { get { return true; } }
public override void OnMovement(Mobile m, Point3D oldLocation)
{
IPooledEnumerable eable = GetMobilesInRange(2);
foreach (object o in eable)
{
if (o is Mobile && ((Mobile)o).InRange(Location, 1))
{
eable.Free();
Visible = true;
return;
}
}
eable.Free();
Visible = false;
}
public WrongMazeWall(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}