Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
178
Scripts/Quests/Mad Scientist/Items/ClockworkMechanism.cs
Normal file
178
Scripts/Quests/Mad Scientist/Items/ClockworkMechanism.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Scripts/Quests/Mad Scientist/Items/MechanicalLifeManual.cs
Normal file
60
Scripts/Quests/Mad Scientist/Items/MechanicalLifeManual.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Scripts/Quests/Mad Scientist/Items/SuteksDirtyGear.cs
Normal file
63
Scripts/Quests/Mad Scientist/Items/SuteksDirtyGear.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user