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,84 @@
using System;
using Server;
namespace Server.Mobiles
{
public enum ClockworkCreatureType
{
ExodusOverseer = 1075914,
Betrayer = 1029734,
ClockworkScorpion = 1112861,
Vollem = 1112860,
Juggernaut = 1029746,
ExodusMinion = 1075915,
LeatherWolf = 1112859
}
public class ClockworkCreatureDef
{
private ClockworkCreatureType m_CreatureType;
private string m_Name;
private int m_BodyId;
public ClockworkCreatureType CreatureType { get { return m_CreatureType; } }
public string Name { get { return m_Name; } }
public int BodyId { get { return m_BodyId; } }
public ClockworkCreatureDef(ClockworkCreatureType type, string name, int bodyId)
{
m_CreatureType = type;
m_Name = name;
m_BodyId = bodyId;
}
}
public class ClockworkCreature : Mobile
{
public static ClockworkCreatureDef[] Definitions { get { return m_Definitions; } }
private static readonly ClockworkCreatureDef[] m_Definitions = new ClockworkCreatureDef[]
{
new ClockworkCreatureDef( ClockworkCreatureType.ExodusOverseer, "an exodus overseer", 0x2F4 ),
new ClockworkCreatureDef( ClockworkCreatureType.Betrayer, "a betrayer", 0x2FF ),
new ClockworkCreatureDef( ClockworkCreatureType.ClockworkScorpion, "a clockwork scorpion", 0x2CD ),
new ClockworkCreatureDef( ClockworkCreatureType.Vollem, "a vollem", 0x125 ),
new ClockworkCreatureDef( ClockworkCreatureType.Juggernaut, "a juggernaut", 0x300 ),
new ClockworkCreatureDef( ClockworkCreatureType.ExodusMinion, "an exodus minion", 0x2F5 ),
new ClockworkCreatureDef( ClockworkCreatureType.LeatherWolf, "a leather wolf", 0x2E3 ),
};
[Constructable]
public ClockworkCreature(ClockworkCreatureDef def)
{
Name = def.Name;
Body = def.BodyId;
Hits = HitsMax;
Blessed = true;
Frozen = true;
}
public ClockworkCreature(Serial serial)
: base(serial)
{
}
public override bool CanBeDamaged()
{
return false;
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,178 @@
using System;
using Server.Network;
using Server.Mobiles;
using Server.Engines.Quests;
using Server.Gumps;
namespace Server.Items
{
public class ClockworkMechanism : BaseDecayingItem
{
public override bool HiddenQuestItemHue { get { return true; } }
public override int Lifespan { get { return 3600; } }
public override bool UseSeconds { get { return false; } }
private int m_CreatureDef;
public ClockworkCreatureDef CreatureDef
{
get { return ClockworkCreature.Definitions[m_CreatureDef]; }
}
[Constructable]
public ClockworkMechanism()
: base(0x1EAE)
{
m_CreatureDef = Utility.Random(ClockworkCreature.Definitions.Length);
Weight = 1.0;
Hue = 0x450;
}
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add(1112858, String.Format("#{0}", ((int)CreatureDef.CreatureType).ToString())); // ~1_TYPE~ clockwork mechanism
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1072351); // Quest Item
}
public override bool DropToWorld(Mobile from, Point3D p)
{
return false;
}
public override bool DropToItem(Mobile from, Item target, Point3D p)
{
if (from.Backpack == target)
{
base.DropToItem(from, target, p);
return true;
}
return false;
}
public override bool DropToMobile(Mobile from, Mobile target, Point3D p)
{
if (from == target)
{
base.DropToMobile(from, target, p);
return true;
}
return false;
}
public override void OnDoubleClick(Mobile from)
{
if (MadScientistQuest.QuestStarted(from))
{
MadScientistQuest.BarkIngredient(from);
}
else
{
if (!from.HasGump(typeof(BeginQuestGump)))
{
from.SendGump(new BeginQuestGump(this));
}
}
}
public void OnCompleted(Mobile from)
{
Mobile creature = new ClockworkCreature(CreatureDef);
Point3D p = from.Location;
creature.MoveToWorld(p, from.Map);
Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(delegate
{
from.PlaySound(0xFA);
from.PlaySound(0x5BC);
from.PlaySound(0x5C7);
Effects.SendLocationEffect(p, from.Map, 0x1FD4, 30, 16, 0x21, 4);
for (int j = 0; j < 5; j++)
{
Point3D loc = new Point3D(p.X, p.Y, 10 + p.Z + (j * 20));
Effects.SendLocationEffect(loc, from.Map, 0x1AA1, 17, 16, 0x481, 4);
Effects.SendLocationEffect(loc, from.Map, 0x1A9F, 10, 16, 0x481, 4);
Effects.SendLocationEffect(loc, from.Map, 0x1A8, 25, 16, 0x47E, 4);
}
from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1112987, from.NetState); // The training clockwork fails and the creature vanishes.
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerCallback(
delegate
{
creature.Delete();
}));
}));
}
public ClockworkMechanism(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write((int)m_CreatureDef);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version > 0)
m_CreatureDef = reader.ReadInt();
}
public class BeginQuestGump : Gump
{
private ClockworkMechanism m_Mechanism;
public BeginQuestGump(ClockworkMechanism mechanism)
: base(340, 340)
{
m_Mechanism = mechanism;
AddPage(0);
AddBackground(0, 0, 291, 99, 0x13BE);
AddImageTiled(5, 6, 280, 20, 0xA40);
AddHtmlLocalized(9, 8, 280, 20, 1112855, 0x7FFF, false, false); // Begin Mad Scientist Quest
AddImageTiled(5, 31, 280, 40, 0xA40);
AddHtmlLocalized(9, 35, 272, 40, 1112856, 0x7FFF, false, false); // You have a limited amount of time to complete the recipe. Start now?
AddButton(215, 73, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(250, 75, 65, 20, 1006044, 0x7FFF, false, false); // OK
AddButton(5, 73, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 75, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
if (info.ButtonID == 1)
MadScientistQuest.StartQuest(from, m_Mechanism);
}
}
}
}

View File

@@ -0,0 +1,35 @@
using System;
using Server;
namespace Server.Items
{
public class CompletedClockworkAssembly : BaseDecayingItem
{
public override int LabelNumber { get { return 1112879; } } // completed clockwork assembly
public override int Lifespan { get { return 600; } }
[Constructable]
public CompletedClockworkAssembly()
: base(0x1EAE)
{
Weight = 1.0;
}
public CompletedClockworkAssembly(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,60 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class MechanicalLifeManual : Item
{
public override int LabelNumber { get { return 1112874; } } // Mechanical Life Manual
[Constructable]
public MechanicalLifeManual()
: base(0xFF4)
{
Weight = 2.0;
}
public MechanicalLifeManual(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 override void OnDoubleClick(Mobile from)
{
PlayerMobile pm = from as PlayerMobile;
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (pm == null || from.Skills[SkillName.Tinkering].Base < 100.0)
{
from.SendLocalizedMessage(1112255); // Only a Grandmaster Tinker can learn from this book.
}
else if (pm.MechanicalLife)
{
pm.SendLocalizedMessage(1080066); // You have already learned this information.
}
else
{
pm.MechanicalLife = true;
pm.SendLocalizedMessage(1112942); // You have learned how to build mechanical companions.
Delete();
}
}
}
}

View File

@@ -0,0 +1,63 @@
using System;
using Server.Items.MusicBox;
namespace Server.Items
{
public class SuteksDirtyGear : Item
{
public override int LabelNumber { get { return 1115722; } } // Sutek's Dirty Gear
[Constructable]
public SuteksDirtyGear()
: this(1)
{
}
[Constructable]
public SuteksDirtyGear(int amount)
: base (0x1053)
{
Hue = 1102;
}
public SuteksDirtyGear(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (Utility.RandomDouble() < 0.05)
{
from.AddToBackpack(MusicBoxGears.RandomMusixBoxGears(TrackRarity.Rare));
}
else
{
if (Utility.RandomBool())
{
from.AddToBackpack(MusicBoxGears.RandomMusixBoxGears(TrackRarity.Common));
}
else
{
from.AddToBackpack(MusicBoxGears.RandomMusixBoxGears(TrackRarity.UnCommon));
}
}
from.SendLocalizedMessage(1115723); // You have polished the dirty gear...
Delete();
}
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,224 @@
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Network;
using Server.Commands;
using Server.Mobiles;
using System.Linq;
namespace Server.Engines.Quests
{
public class MadScientistQuest
{
#region Generation
public static void Initialize()
{
CommandSystem.Register("GenSutek", AccessLevel.Developer, new CommandEventHandler(GenQuest_Command));
}
private static void GenQuest_Command(CommandEventArgs e)
{
e.Mobile.SendMessage("Creating Mad Scientist Quest...");
foreach (SutekIngredientInfo def in m_Ingredients)
{
WeakEntityCollection.Add("sa", new SutekIngredientItem(def));
}
XmlSpawner sp = new XmlSpawner("Sutek");
sp.SpawnRange = 5;
sp.HomeRange = 5;
sp.MoveToWorld(new Point3D(917, 594, -14), Map.TerMur);
sp.Respawn();
WeakEntityCollection.Add("sa", sp);
List<Item> toDelete = new List<Item>(World.Items.Values.Where(i => i is XmlSpawner && (i.Name == "PerfectTimingSpawner" || i.Name == "PerfectTimingSpawner2")));
foreach (var item in toDelete)
{
item.Delete();
}
e.Mobile.SendMessage("Generation completed, deleted {0} spawners!", toDelete.Count);
ColUtility.Free(toDelete);
}
#endregion
#region Definitions
public static readonly int NeededIngredients = 20;
public static readonly TimeSpan Timeout = TimeSpan.FromSeconds(15.0);
public static readonly SutekIngredientInfo[] m_Ingredients = new SutekIngredientInfo[]
{
new SutekIngredientInfo(SutekIngredient.Feathers, new Point3D(921, 598, -8), 0x1BD3, 1023578),
new SutekIngredientInfo(SutekIngredient.Shafts, new Point3D(918, 591, -14), 0x1BD6, 1027125),
new SutekIngredientInfo(SutekIngredient.PowerCrystal, new Point3D(917, 589, -5), 0x1F1C, 1112811),
new SutekIngredientInfo(SutekIngredient.PowerCrystal, new Point3D(926, 597, -4), 0x1F19, 1112811),
new SutekIngredientInfo(SutekIngredient.YellowPotion, new Point3D(926, 593, -8), 0x183B, 1023852),
new SutekIngredientInfo(SutekIngredient.BarrelHoops, new Point3D(931, 601, -14), 0x1DB7, 1011228),
new SutekIngredientInfo(SutekIngredient.BarrelHoops, new Point3D(931, 601, -12), 0x1DB7, 1011228),
new SutekIngredientInfo(SutekIngredient.BarrelStaves, new Point3D(932, 600, -14), 0x1EB2, 1027857),
new SutekIngredientInfo(SutekIngredient.BarrelStaves, new Point3D(933, 600, -14), 0x1EB3, 1027857),
new SutekIngredientInfo(SutekIngredient.Bones, new Point3D(925, 605, -14), 0x21FC, 1023786),
new SutekIngredientInfo(SutekIngredient.FetidEssence, new Point3D(926, 599, -5), 0x2D92, 1031066),
new SutekIngredientInfo(SutekIngredient.VoidEssence, new Point3D(926, 589, -3), 0x2D92, 1112327, 0x835),
new SutekIngredientInfo(SutekIngredient.SpiritEssence, new Point3D(916, 602, -4), 0x2D87, 1055029, 0x481),
new SutekIngredientInfo(SutekIngredient.Rope, new Point3D(911, 589, -13), 0x14F8, 1020934),
new SutekIngredientInfo(SutekIngredient.Rope, new Point3D(919, 581, -14), 0x14FA, 1020934),
new SutekIngredientInfo(SutekIngredient.WoodenLogs, new Point3D(910, 590, -13), 0x1BDF, 1021217),
new SutekIngredientInfo(SutekIngredient.WoodenLogs, new Point3D(916, 609, -14), 0x1BE1, 1021217),
new SutekIngredientInfo(SutekIngredient.WoodenLogs, new Point3D(939, 593, -14), 0x1BDE, 1021217),
new SutekIngredientInfo(SutekIngredient.WoodenLogs, new Point3D(911, 602, -14), 0x1BE2, 1021217),
new SutekIngredientInfo(SutekIngredient.PurplePotion, new Point3D(916, 601, -6), 0x1841, 1023853),
new SutekIngredientInfo(SutekIngredient.Scales, new Point3D(921, 588, -8), 0x26B5, 1029905),
new SutekIngredientInfo(SutekIngredient.Scales, new Point3D(923, 603, -6), 0x26B2, 1029905),
new SutekIngredientInfo(SutekIngredient.WhiteStone, new Point3D(927, 605, -14), 0x177A, 1112813),
new SutekIngredientInfo(SutekIngredient.DarkStone, new Point3D(931, 583, -14), 0x1776, 1112866),
new SutekIngredientInfo(SutekIngredient.Beeswax, new Point3D(926, 600, -6), 0x1425, 1025154),
new SutekIngredientInfo(SutekIngredient.Beeswax, new Point3D(925, 603, -8), 0x1426, 1025154),
new SutekIngredientInfo(SutekIngredient.Thorns, new Point3D(928, 595, -14), 0x3022, 1112818),
new SutekIngredientInfo(SutekIngredient.Thorns, new Point3D(928, 596, -14), 0x3022, 1112818),
new SutekIngredientInfo(SutekIngredient.WoodenBoards, new Point3D(939, 592, -14), 0x1BDB, 1021189),
new SutekIngredientInfo(SutekIngredient.WoodenBoards, new Point3D(928, 590, -14), 0x1BDC, 1021189),
new SutekIngredientInfo(SutekIngredient.WoodenBoards, new Point3D(911, 591, -14), 0x1BD8, 1021189),
new SutekIngredientInfo(SutekIngredient.WoodenBoards, new Point3D(916, 598, -14), 0x1BD9, 1021189),
new SutekIngredientInfo(SutekIngredient.BrownStone, new Point3D(922, 577, -14), 0x1772, 1112814),
new SutekIngredientInfo(SutekIngredient.RedPotion, new Point3D(925, 603, -8), 0x183E, 1023851),
new SutekIngredientInfo(SutekIngredient.PurplePotion, new Point3D(921, 597, -10), 0x1839, 1023853),
new SutekIngredientInfo(SutekIngredient.BluePotion, new Point3D(921, 596, -7), 0x1844, 1023848),
new SutekIngredientInfo(SutekIngredient.Gears, new Point3D(920, 597, -8), 0x1051, 1024177),
new SutekIngredientInfo(SutekIngredient.MeltedWax, new Point3D(916, 600, -6), 0x142B, 1025162),
new SutekIngredientInfo(SutekIngredient.MeltedWax, new Point3D(926, 595, -7), 0x142A, 1025162),
new SutekIngredientInfo(SutekIngredient.Leather, new Point3D(924, 588, -14), 0x1078, 1024216),
new SutekIngredientInfo(SutekIngredient.CopperWire, new Point3D(910, 589, -8), 0x1879, 1026265),
new SutekIngredientInfo(SutekIngredient.GoldWire, new Point3D(910, 589, -13), 0x1878, 1026264),
new SutekIngredientInfo(SutekIngredient.SilverWire, new Point3D(910, 589, -10), 0x1877, 1026263),
new SutekIngredientInfo(SutekIngredient.IronWire, new Point3D(910, 589, -6), 0x1876, 1026262),
new SutekIngredientInfo(SutekIngredient.SilverIngots, new Point3D(911, 588, -14), 0x1BFA, 1027158),
new SutekIngredientInfo(SutekIngredient.SilverIngots, new Point3D(928, 603, -14), 0x1BF7, 1027158),
new SutekIngredientInfo(SutekIngredient.GoldIngots, new Point3D(914, 581, -14), 0x1BEE, 1027146),
new SutekIngredientInfo(SutekIngredient.GoldIngots, new Point3D(922, 594, -14), 0x1BEB, 1027146),
new SutekIngredientInfo(SutekIngredient.CopperIngots, new Point3D(914, 580, -14), 0x1BE5, 1027140),
new SutekIngredientInfo(SutekIngredient.CopperIngots, new Point3D(916, 590, -11), 0x1BE8, 1027140),
new SutekIngredientInfo(SutekIngredient.IronIngots, new Point3D(915, 580, -14), 0x1BF1, 1027152),
new SutekIngredientInfo(SutekIngredient.IronIngots, new Point3D(912, 602, -15), 0x1BF4, 1027152),
new SutekIngredientInfo(SutekIngredient.OilOfVitriol, new Point3D(916, 601, -8), 0x098D, 1077482),
new SutekIngredientInfo(SutekIngredient.BlackPowder, new Point3D(920, 597, -6), 0x0B48, 1112815, 0x497),
new SutekIngredientInfo(SutekIngredient.WhitePowder, new Point3D(926, 602, -6), 0x241D, 1112816),
new SutekIngredientInfo(SutekIngredient.BluePowder, new Point3D(926, 594, -4), 0x241E, 1112817),
new SutekIngredientInfo(SutekIngredient.Nails, new Point3D(915, 589, -14), 0x102E, 1024142),
};
private static Dictionary<Mobile, QuestContext> m_Table = new Dictionary<Mobile, QuestContext>();
#endregion
public static bool QuestStarted(Mobile from)
{
return m_Table.ContainsKey(from);
}
public static void StartQuest(Mobile from, ClockworkMechanism mechanism)
{
if (QuestStarted(from))
return;
QuestContext context = m_Table[from] = new QuestContext(from, mechanism);
context.StartTimer();
}
public static void OnDoubleClickIngredient(Mobile from, SutekIngredient ingredient)
{
if (!QuestStarted(from))
return;
QuestContext context = m_Table[from];
if (ingredient == context.CurrentIngredient)
{
from.SendLocalizedMessage(1112819); // You've successfully added this ingredient.
context.OnIngredientAcquired();
}
else
{
from.SendLocalizedMessage(1112820); // That is not the right ingredient.
BarkIngredient(from);
}
}
public static void BarkIngredient(Mobile from)
{
if (!QuestStarted(from))
return;
QuestContext context = m_Table[from];
from.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1112821, String.Format("#{0}", (int)context.CurrentIngredient)); // I need to add some ~1_INGREDIENT~.
}
public class QuestContext
{
private Mobile m_Owner;
private int m_IngredientsLeft = NeededIngredients;
private SutekIngredient m_CurrentIngredient;
private Timer m_ExpireTimer;
private ClockworkMechanism m_Mechanism;
public Mobile Owner { get { return m_Owner; } }
public int IngredientsLeft { get { return m_IngredientsLeft; } }
public SutekIngredient CurrentIngredient { get { return m_CurrentIngredient; } }
public Timer ExpireTimer { get { return m_ExpireTimer; } }
public ClockworkMechanism Mechanism { get { return m_Mechanism; } }
public QuestContext(Mobile from, ClockworkMechanism mechanism)
{
m_Owner = from;
m_Mechanism = mechanism;
}
public void StartTimer()
{
if (m_ExpireTimer != null)
m_ExpireTimer.Stop();
m_ExpireTimer = Timer.DelayCall(Timeout, new TimerCallback(OnExpired));
SutekIngredient[] ingredients = (SutekIngredient[])Enum.GetValues(typeof(SutekIngredient));
m_CurrentIngredient = ingredients[Utility.Random(ingredients.Length)];
m_Owner.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1112821, String.Format("#{0}", (int)m_CurrentIngredient)); // I need to add some ~1_INGREDIENT~.
m_IngredientsLeft--;
}
public void OnExpired()
{
m_ExpireTimer.Stop();
m_Owner.SendLocalizedMessage(1112822); // You fail to find the next ingredient in time. Your clockwork assembly crumbles.
m_Mechanism.Delete();
m_Table.Remove(m_Owner);
}
public void OnIngredientAcquired()
{
if (m_IngredientsLeft == 0)
{
m_ExpireTimer.Stop();
m_Mechanism.OnCompleted(m_Owner);
m_Mechanism.Delete();
m_Owner.AddToBackpack(new CompletedClockworkAssembly());
m_Table.Remove(m_Owner);
}
else
{
StartTimer();
}
}
}
}
}

View File

@@ -0,0 +1,140 @@
using System;
using Server.Items;
namespace Server.Engines.Quests
{
public class PerfectTimingQuest : BaseQuest
{
/* Perfect Timing */
public override object Title { get { return 1112870; } }
/* Presumptuous, are we? You think i will just let you get your grubby hands on
* my clever inventions! I think not! If you want to learn how to create these
* wonders of mechanical life, you will have to prove yourself. Correctly combine
* the required ingredients to build one of my inventions in a timely manner and
* I might share my secrets with you. */
public override object Description { get { return 1112873; } }
/* I'm not surprised. *disdainful snort* People with both manual and mental
* dexterity come in short supply. Move along then. Science does not wait for
* anyone. */
public override object Refuse { get { return 1112875; } }
/* Give your assembly the material it requests. You'll find everything lying
* around here. Just use it. But be quick! */
public override object Uncomplete { get { return 1112877; } }
/* There's more to you than meets the eye after all! Well done! You should enjoy
* this copy of my manual. */
public override object Complete { get { return 1112878; } }
public PerfectTimingQuest()
{
AddObjective(new ObtainObjective(typeof(CompletedClockworkAssembly), "Completed Clockwork Assembly", 1));
AddReward(new BaseReward(typeof(MechanicalLifeManual), 1112874)); // Mechanical Life Manual
AddReward(new BaseReward(typeof(SuteksDirtyGear), 1115722)); // Sutek's Dirty Gear
}
public override void OnAccept()
{
base.OnAccept();
Owner.AddToBackpack(new ClockworkMechanism());
}
public override void OnResign(bool resignChain)
{
base.OnResign(resignChain);
Owner.DropHolding();
Item item = Owner.Backpack.FindItemByType(typeof(ClockworkMechanism));
if (item != null)
{
item.Delete();
}
}
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 Sutek : MondainQuester
{
private static Type[] m_Quests = new Type[] { typeof(PerfectTimingQuest) };
public override Type[] Quests { get { return m_Quests; } }
[Constructable]
public Sutek()
: base("Sutek", "the Mage")
{
TalkTimer();
}
public Sutek(Serial serial)
: base(serial)
{
}
public override void Advertise()
{
}
public override void InitBody()
{
InitStats(100, 100, 25);
Race = Race.Human;
Hue = 0x840D;
HairItemID = 0x203C; // Long Hair
HairHue = 0x835;
FacialHairItemID = 0x2040; // goatee
FacialHairHue = 0x835;
}
public override void InitOutfit()
{
AddItem(new Sandals());
AddItem(new TattsukeHakama(0x528));
AddItem(new WizardsHat(0x528));
AddItem(new Tunic(0x528));
}
public void TalkTimer()
{
Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromSeconds(15.0), new TimerCallback(
delegate
{
Say(1113224 + Utility.Random(15));
}
));
}
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();
TalkTimer();
}
}
}

View File

@@ -0,0 +1,127 @@
using System;
using Server;
using Server.Engines.Quests;
namespace Server.Items
{
public enum SutekIngredient
{
Feathers = 1023578,
PowerCrystal = 1112811,
DarkStone = 1112866,
WhiteStone = 1112813,
BrownStone = 1112814,
IronWire = 1026262,
SilverWire = 1026263,
GoldWire = 1026264,
CopperWire = 1026265,
Leather = 1112812,
Thorns = 1112818,
GoldIngots = 1027146,
CopperIngots = 1027140,
IronIngots = 1027152,
SilverIngots = 1027158,
YellowPotion = 1023852,
PurplePotion = 1023853,
RedPotion = 1023851,
BluePotion = 1023848,
Scales = 1113463,
Bones = 1023786,
Shafts = 1027125,
Gears = 1011200,
BarrelHoops = 1011228,
BarrelStaves = 1027857,
SpiritEssence = 1055029,
VoidEssence = 1112327,
FetidEssence = 1031066,
WoodenLogs = 1021217,
Rope = 1020934,
Beeswax = 1025154,
WoodenBoards = 1021189,
MeltedWax = 1016492,
OilOfVitriol = 1077482,
BlackPowder = 1112815,
WhitePowder = 1112816,
BluePowder = 1112817,
Nails = 1024142
}
public class SutekIngredientInfo
{
private SutekIngredient m_Ingredient;
private int m_ItemId, m_TextId, m_Hue;
private Point3D m_Location;
public SutekIngredient Ingredient { get { return m_Ingredient; } }
public int ItemId { get { return m_ItemId; } }
public int TextId { get { return m_TextId; } }
public int Hue { get { return m_Hue; } }
public Point3D Location { get { return m_Location; } }
public SutekIngredientInfo(SutekIngredient ingredient, Point3D location, int itemId, int textId)
: this(ingredient, location, itemId, textId, 0)
{
}
public SutekIngredientInfo(SutekIngredient ingredient, Point3D location, int itemId, int textId, int hue)
{
m_Ingredient = ingredient;
m_Location = location;
m_ItemId = itemId;
m_TextId = textId;
m_Hue = hue;
}
}
public class SutekIngredientItem : Item
{
public override int LabelNumber { get { return m_TextId; } }
public override bool ForceShowProperties { get { return true; } }
private SutekIngredient m_Ingredient;
private int m_TextId;
[Constructable]
public SutekIngredientItem(SutekIngredientInfo info)
: base(info.ItemId)
{
Weight = 0.0;
Movable = false;
Hue = info.Hue;
m_TextId = info.TextId;
m_Ingredient = info.Ingredient;
MoveToWorld(info.Location, Map.TerMur);
}
public override void OnDoubleClick(Mobile from)
{
if (from.InRange(this, 2))
MadScientistQuest.OnDoubleClickIngredient(from, m_Ingredient);
}
public SutekIngredientItem(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write((int)m_Ingredient);
writer.Write((int)m_TextId);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_Ingredient = (SutekIngredient)reader.ReadInt();
m_TextId = reader.ReadInt();
}
}
}