Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusAlterAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ExodusAlterAddon()
|
||||
{
|
||||
this.AddComponent(0x3F9, 0, 1, 5);
|
||||
this.AddComponent(0x3FA, 1, 0, 5);
|
||||
this.AddComponent(0x3F7, 0, 0, 5);
|
||||
this.AddComponent(0x3F8, 1, 1, 5);
|
||||
}
|
||||
|
||||
public void AddComponent(int id, int x, int y, int z)
|
||||
{
|
||||
AddonComponent ac = new AddonComponent(id);
|
||||
|
||||
ac.Hue = 2702;
|
||||
this.AddComponent(ac, x, y, z);
|
||||
}
|
||||
|
||||
public ExodusAlterAddon(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusChest : DecorativeBox, IRevealableItem
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
TileData.ItemTable[0x2DF3].Flags = TileFlag.None;
|
||||
}
|
||||
|
||||
public override int DefaultGumpID { get { return 0x10C; } }
|
||||
|
||||
public bool CheckWhenHidden { get { return true; } }
|
||||
|
||||
public static Type[] RituelItem { get { return m_RituelItem; } }
|
||||
|
||||
private static Type[] m_RituelItem = new Type[]
|
||||
{
|
||||
typeof(ExodusSummoningRite), typeof(ExodusSacrificalDagger), typeof(RobeofRite), typeof(ExodusSummoningAlter)
|
||||
};
|
||||
|
||||
private Timer m_Timer;
|
||||
private ExodusChestRegion m_Region;
|
||||
|
||||
public override bool IsDecoContainer { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public ExodusChest()
|
||||
: base()
|
||||
{
|
||||
Visible = false;
|
||||
Locked = true;
|
||||
LockLevel = 90;
|
||||
RequiredSkill = 90;
|
||||
MaxLockLevel = 100;
|
||||
Weight = 0.0;
|
||||
Hue = 2700;
|
||||
Movable = false;
|
||||
|
||||
TrapType = TrapType.PoisonTrap;
|
||||
TrapPower = 100;
|
||||
GenerateTreasure();
|
||||
}
|
||||
|
||||
public ExodusChest(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public bool CheckReveal(Mobile m)
|
||||
{
|
||||
if (!m.InRange(Location, 3))
|
||||
return false;
|
||||
|
||||
return m.Skills[SkillName.DetectHidden].Value >= 98.0;
|
||||
}
|
||||
|
||||
public virtual void OnRevealed(Mobile m)
|
||||
{
|
||||
Visible = true;
|
||||
StartDeleteTimer();
|
||||
}
|
||||
|
||||
public virtual bool CheckPassiveDetect(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.Location, 4))
|
||||
{
|
||||
int skill = (int)m.Skills[SkillName.DetectHidden].Value;
|
||||
|
||||
if (skill >= 80 && Utility.Random(300) < skill)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void StartDeleteTimer()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
Item item = Activator.CreateInstance(m_RituelItem[Utility.Random(m_RituelItem.Length)]) as Item;
|
||||
DropItem(item);
|
||||
}
|
||||
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(5), new TimerCallback(Delete));
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLoc)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
UpdateRegion();
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
UpdateRegion();
|
||||
}
|
||||
|
||||
public void UpdateRegion()
|
||||
{
|
||||
if (m_Region != null)
|
||||
m_Region.Unregister();
|
||||
|
||||
if (!Deleted && Map != Map.Internal)
|
||||
{
|
||||
m_Region = new ExodusChestRegion(this);
|
||||
m_Region.Register();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
|
||||
base.OnAfterDelete();
|
||||
|
||||
UpdateRegion();
|
||||
}
|
||||
|
||||
protected virtual void GenerateTreasure()
|
||||
{
|
||||
DropItem(new Gold(1500, 3000));
|
||||
|
||||
Item item = null;
|
||||
|
||||
for (int i = 0 ; i < Loot.GemTypes.Length; i++)
|
||||
{
|
||||
item = Activator.CreateInstance(Loot.GemTypes[i]) as Item;
|
||||
item.Amount = Utility.Random(1, 6);
|
||||
DropItem(item);
|
||||
}
|
||||
|
||||
if (0.25 > Utility.RandomDouble())
|
||||
{
|
||||
item = new SmokeBomb(Utility.Random(3, 6));
|
||||
DropItem(item);
|
||||
}
|
||||
|
||||
if (0.25 > Utility.RandomDouble())
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0:
|
||||
item = new ParasiticPotion(Utility.Random(1, 3)); break;
|
||||
case 1:
|
||||
item = new InvisibilityPotion(Utility.Random(1, 3)); break;
|
||||
}
|
||||
|
||||
DropItem(item);
|
||||
}
|
||||
|
||||
if (0.2 > Utility.RandomDouble())
|
||||
{
|
||||
item = Loot.RandomEssence();
|
||||
item.Amount = Utility.Random(3, 6);
|
||||
DropItem(item);
|
||||
}
|
||||
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: DropItem(new Taint()); break;
|
||||
case 1: DropItem(new Corruption()); break;
|
||||
case 2: DropItem(new Blight()); break;
|
||||
case 3: DropItem(new LuminescentFungi()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void GiveRituelItem(Mobile m)
|
||||
{
|
||||
Item item = Activator.CreateInstance(m_RituelItem[Utility.Random(m_RituelItem.Length)]) as Item;
|
||||
m.PlaySound(0x5B4);
|
||||
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
m.AddToBackpack(item);
|
||||
m.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if (!Locked)
|
||||
Delete();
|
||||
|
||||
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRegion));
|
||||
}
|
||||
}
|
||||
|
||||
public class ExodusChestRegion : BaseRegion
|
||||
{
|
||||
private readonly ExodusChest m_Chest;
|
||||
|
||||
public ExodusChest ExodusChest { get { return m_Chest; } }
|
||||
|
||||
public ExodusChestRegion(ExodusChest chest)
|
||||
: base(null, chest.Map, Region.Find(chest.Location, chest.Map), new Rectangle2D(chest.Location.X - 2, chest.Location.Y - 2 , 5, 5) )
|
||||
{
|
||||
m_Chest = chest;
|
||||
}
|
||||
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
if (!m_Chest.Visible && m is PlayerMobile && m.Skills[SkillName.DetectHidden].Value >= 98.0)
|
||||
{
|
||||
m.SendLocalizedMessage(1153493); // Your keen senses detect something hidden in the area...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,538 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusNexus : NexusAddon
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("GenExodusNexus", AccessLevel.Administrator, Generate_ExodusNexus);
|
||||
}
|
||||
|
||||
public static void Generate_ExodusNexus(CommandEventArgs e)
|
||||
{
|
||||
Decorate.Generate("exodus", "Data/Decoration/Exodus", Map.Ilshenar);
|
||||
}
|
||||
|
||||
private static readonly TimeSpan m_UseTimeout = TimeSpan.FromMinutes(2.0);
|
||||
private Dictionary<Mobile, DamageTimer> DamageTable = new Dictionary<Mobile, DamageTimer>();
|
||||
private int m_SideLength;
|
||||
private Node[] m_Path;
|
||||
private Mobile User { get; set; }
|
||||
private DateTime LastUse { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Active { get { return this.Hue == 0; } }
|
||||
|
||||
[Constructable]
|
||||
public ExodusNexus()
|
||||
: this(Utility.RandomMinMax(3, 6))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ExodusNexus(int sideLength)
|
||||
{
|
||||
this.Hue = 1987;
|
||||
this.SideLength = sideLength;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int SideLength
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SideLength;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 3)
|
||||
value = 3;
|
||||
else if (value > 6)
|
||||
value = 6;
|
||||
|
||||
if (this.m_SideLength != value)
|
||||
{
|
||||
this.m_SideLength = value;
|
||||
this.ExodusInitPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
public Node[] Path { get { return this.m_Path; } }
|
||||
|
||||
public struct Node
|
||||
{
|
||||
private int m_X;
|
||||
private int m_Y;
|
||||
|
||||
public Node(int x, int y)
|
||||
{
|
||||
this.m_X = x;
|
||||
this.m_Y = y;
|
||||
}
|
||||
|
||||
public int X
|
||||
{
|
||||
get { return this.m_X; }
|
||||
set { this.m_X = value; }
|
||||
}
|
||||
|
||||
public int Y
|
||||
{
|
||||
get { return this.m_Y; }
|
||||
set { this.m_Y = value; }
|
||||
}
|
||||
}
|
||||
|
||||
public enum PathDirection
|
||||
{
|
||||
Left,
|
||||
Up,
|
||||
Right,
|
||||
Down
|
||||
}
|
||||
|
||||
public void ExodusInitPath()
|
||||
{
|
||||
// Depth-First Search algorithm
|
||||
int totalNodes = this.SideLength * this.SideLength;
|
||||
|
||||
Node[] stack = new Node[totalNodes];
|
||||
Node current = stack[0] = new Node(0, 0);
|
||||
int stackSize = 1;
|
||||
|
||||
bool[,] visited = new bool[this.SideLength, this.SideLength];
|
||||
visited[0, 0] = true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
PathDirection[] choices = new PathDirection[4];
|
||||
int count = 0;
|
||||
|
||||
if (current.X > 0 && !visited[current.X - 1, current.Y])
|
||||
choices[count++] = PathDirection.Left;
|
||||
|
||||
if (current.Y > 0 && !visited[current.X, current.Y - 1])
|
||||
choices[count++] = PathDirection.Up;
|
||||
|
||||
if (current.X < this.SideLength - 1 && !visited[current.X + 1, current.Y])
|
||||
choices[count++] = PathDirection.Right;
|
||||
|
||||
if (current.Y < this.SideLength - 1 && !visited[current.X, current.Y + 1])
|
||||
choices[count++] = PathDirection.Down;
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
PathDirection dir = choices[Utility.Random(count)];
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case PathDirection.Left:
|
||||
current = new Node(current.X - 1, current.Y);
|
||||
break;
|
||||
case PathDirection.Up:
|
||||
current = new Node(current.X, current.Y - 1);
|
||||
break;
|
||||
case PathDirection.Right:
|
||||
current = new Node(current.X + 1, current.Y);
|
||||
break;
|
||||
default:
|
||||
current = new Node(current.X, current.Y + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
stack[stackSize++] = current;
|
||||
|
||||
if (current.X == this.SideLength - 1 && current.Y == this.SideLength - 1)
|
||||
break;
|
||||
|
||||
visited[current.X, current.Y] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = stack[--stackSize - 1];
|
||||
}
|
||||
}
|
||||
|
||||
this.m_Path = new Node[stackSize];
|
||||
|
||||
for (int i = 0; i < stackSize; i++)
|
||||
{
|
||||
this.m_Path[i] = stack[i];
|
||||
}
|
||||
|
||||
if (this.User != null)
|
||||
{
|
||||
this.User.CloseGump(typeof(NexusGameGump));
|
||||
this.User = null;
|
||||
}
|
||||
}
|
||||
|
||||
public ExodusNexus(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void OpenGump(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this, 3))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.User != null)
|
||||
{
|
||||
if (this.User == from)
|
||||
return;
|
||||
|
||||
if (this.User.Deleted || this.User.Map != this.Map || !this.User.InRange(this, 3) ||
|
||||
this.User.NetState == null || DateTime.UtcNow - this.LastUse >= m_UseTimeout)
|
||||
{
|
||||
this.User.CloseGump(typeof(NexusGameGump));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1152379); // Someone is currently working at the Nexus.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.User = from;
|
||||
this.LastUse = DateTime.UtcNow;
|
||||
|
||||
from.SendGump(new NexusGameGump(this, from, 0, false));
|
||||
}
|
||||
|
||||
public void DoDamage(Mobile to)
|
||||
{
|
||||
to.SendLocalizedMessage(1152372); // The Nexus shoots an arc of energy at you!
|
||||
to.BoltEffect(0);
|
||||
to.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443); // * Your body convulses from electric shock *
|
||||
to.NonlocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443, to.Name); // * ~1_NAME~ spasms from electric shock *
|
||||
|
||||
AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);
|
||||
|
||||
if (!to.Alive)
|
||||
return;
|
||||
|
||||
if (!DamageTable.ContainsKey(to))
|
||||
{
|
||||
DamageTimer timer = new DamageTimer(this, to);
|
||||
|
||||
to.Frozen = true;
|
||||
DamageTable[to] = timer;
|
||||
timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Solve(Mobile from)
|
||||
{
|
||||
Effects.PlaySound(this.Location, this.Map, 0x211);
|
||||
Effects.PlaySound(this.Location, this.Map, 0x1F3);
|
||||
|
||||
Effects.SendLocationEffect(this.Location, this.Map, 0x36B0, 4, 4);
|
||||
Effects.SendLocationEffect(new Point3D(this.X - 1, this.Y - 1, this.Z + 2), this.Map, 0x36B0, 4, 4);
|
||||
Effects.SendLocationEffect(new Point3D(this.X - 2, this.Y - 1, this.Z + 2), this.Map, 0x36B0, 4, 4);
|
||||
|
||||
from.SendLocalizedMessage(1152371); // You repair the mysterious Nexus! As it whirs to life it spits out a punch card!
|
||||
from.AddToBackpack(new PunchCard());
|
||||
|
||||
this.Hue = 0;
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), new TimerCallback(delegate { this.Hue = 1987; }));
|
||||
}
|
||||
|
||||
public class DamageTimer : Timer
|
||||
{
|
||||
private readonly ExodusNexus m_Nexus;
|
||||
private readonly Mobile m_To;
|
||||
private int m_Step;
|
||||
|
||||
public DamageTimer(ExodusNexus nexus, Mobile to)
|
||||
: base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
this.m_Nexus = nexus;
|
||||
this.m_To = to;
|
||||
this.m_Step = 0;
|
||||
|
||||
this.Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (this.m_Nexus.Deleted || this.m_To.Deleted || !this.m_To.Alive)
|
||||
{
|
||||
this.End();
|
||||
return;
|
||||
}
|
||||
|
||||
this.m_To.PlaySound(0x28);
|
||||
|
||||
this.m_To.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
|
||||
this.m_To.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", this.m_To.Name));
|
||||
|
||||
AOS.Damage(this.m_To, this.m_To, 20, 0, 0, 0, 0, 100);
|
||||
|
||||
if (++this.m_Step >= 3 || !this.m_To.Alive)
|
||||
{
|
||||
this.End();
|
||||
}
|
||||
}
|
||||
|
||||
private void End()
|
||||
{
|
||||
m_Nexus.DamageTable.Remove(m_To);
|
||||
this.m_To.Frozen = false;
|
||||
|
||||
this.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write((int)this.m_SideLength);
|
||||
writer.Write((int)this.m_Path.Length);
|
||||
|
||||
for (int i = 0; i < this.m_Path.Length; i++)
|
||||
{
|
||||
Node cur = this.m_Path[i];
|
||||
|
||||
writer.Write(cur.X);
|
||||
writer.Write(cur.Y);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
this.m_SideLength = reader.ReadInt();
|
||||
this.m_Path = new Node[reader.ReadInt()];
|
||||
|
||||
for (int i = 0; i < this.m_Path.Length; i++)
|
||||
{
|
||||
this.m_Path[i] = new Node(reader.ReadInt(), reader.ReadInt());
|
||||
}
|
||||
|
||||
if (this.Hue == 0)
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), new TimerCallback(delegate { this.Hue = 1987; }));
|
||||
}
|
||||
|
||||
public class NexusGameGump : Gump
|
||||
{
|
||||
private readonly ExodusNexus m_Nexus;
|
||||
private readonly Mobile m_From;
|
||||
private readonly int m_Step;
|
||||
public NexusGameGump(ExodusNexus nexus, Mobile from, int step, bool hint)
|
||||
: base(5, 30)
|
||||
{
|
||||
this.m_Nexus = nexus;
|
||||
this.m_From = from;
|
||||
this.m_Step = step;
|
||||
|
||||
int sideLength = nexus.SideLength;
|
||||
|
||||
this.AddBackground(50, 0, 530, 410, 0xA28);
|
||||
|
||||
this.AddImage(0, 0, 0x28C8);
|
||||
this.AddImage(547, 0, 0x28C9);
|
||||
|
||||
this.AddBackground(95, 20, 442, 90, 0xA28);
|
||||
|
||||
this.AddHtmlLocalized(165, 35, 300, 45, 1153747, false, false); // <center>GENERATOR CONTROL nexus</center>
|
||||
this.AddHtmlLocalized(165, 60, 300, 70, 1153748, false, false); // <center>Use the Directional Controls to</center>
|
||||
this.AddHtmlLocalized(165, 75, 300, 85, 1153749, false, false); // <center>Close the Grid Circuit</center>
|
||||
|
||||
this.AddImage(140, 40, 0x28D3);
|
||||
this.AddImage(420, 40, 0x28D3);
|
||||
|
||||
this.AddBackground(365, 120, 178, 210, 0x1400);
|
||||
|
||||
this.AddImage(365, 115, 0x28D4);
|
||||
this.AddImage(365, 288, 0x28D4);
|
||||
|
||||
this.AddImage(414, 189, 0x589);
|
||||
this.AddImage(435, 210, 0xA52);
|
||||
|
||||
this.AddButton(408, 222, 0x29EA, 0x29EC, 1, GumpButtonType.Reply, 0); // Left
|
||||
this.AddButton(448, 185, 0x29CC, 0x29CE, 2, GumpButtonType.Reply, 0); // Up
|
||||
this.AddButton(473, 222, 0x29D6, 0x29D8, 3, GumpButtonType.Reply, 0); // Right
|
||||
this.AddButton(448, 243, 0x29E0, 0x29E2, 4, GumpButtonType.Reply, 0); // Down
|
||||
|
||||
this.AddBackground(90, 115, 30 + 40 * sideLength, 30 + 40 * sideLength, 0xA28);
|
||||
this.AddBackground(100, 125, 10 + 40 * sideLength, 10 + 40 * sideLength, 0x1400);
|
||||
|
||||
for (int i = 0; i < sideLength; i++)
|
||||
{
|
||||
for (int j = 0; j < sideLength - 1; j++)
|
||||
{
|
||||
this.AddImage(120 + 40 * i, 162 + 40 * j, 0x13F9);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < sideLength - 1; i++)
|
||||
{
|
||||
for (int j = 0; j < sideLength; j++)
|
||||
{
|
||||
this.AddImage(138 + 40 * i, 147 + 40 * j, 0x13FD);
|
||||
}
|
||||
}
|
||||
|
||||
Node[] path = nexus.Path;
|
||||
|
||||
NodeHue[,] hues = new NodeHue[sideLength, sideLength];
|
||||
|
||||
for (int i = 0; i <= step; i++)
|
||||
{
|
||||
Node n = path[i];
|
||||
hues[n.X, n.Y] = NodeHue.Blue;
|
||||
}
|
||||
|
||||
Node lastNode = path[path.Length - 1];
|
||||
hues[lastNode.X, lastNode.Y] = NodeHue.Red;
|
||||
|
||||
for (int i = 0; i < sideLength; i++)
|
||||
{
|
||||
for (int j = 0; j < sideLength; j++)
|
||||
{
|
||||
this.AddNode(110 + 40 * i, 135 + 40 * j, hues[i, j]);
|
||||
}
|
||||
}
|
||||
|
||||
Node curNode = path[step];
|
||||
this.AddImage(118 + 40 * curNode.X, 143 + 40 * curNode.Y, 0x13A8);
|
||||
|
||||
if (hint)
|
||||
{
|
||||
Node nextNode = path[step + 1];
|
||||
this.AddImage(119 + 40 * nextNode.X, 143 + 40 * nextNode.Y, 0x939);
|
||||
}
|
||||
|
||||
if (from.Skills.Lockpicking.Value >= 65.0)
|
||||
{
|
||||
this.AddButton(365, 350, 0xFA6, 0xFA7, 5, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(405, 345, 140, 40, 1153750, false, false); // Attempt to Decipher the Circuit Path
|
||||
}
|
||||
}
|
||||
|
||||
private enum NodeHue
|
||||
{
|
||||
Gray,
|
||||
Blue,
|
||||
Red
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Nexus.Deleted || info.ButtonID == 0 || !this.m_From.CheckAlive())
|
||||
{
|
||||
this.m_Nexus.User = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.m_From.Map != this.m_Nexus.Map || !this.m_From.InRange(this.m_Nexus, 3))
|
||||
{
|
||||
this.m_From.SendLocalizedMessage(500446); // That is too far away.
|
||||
this.m_Nexus.User = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Node nextNode = this.m_Nexus.Path[this.m_Step + 1];
|
||||
|
||||
if (info.ButtonID == 5) // Attempt to Decipher
|
||||
{
|
||||
double lockpicking = this.m_From.Skills.Lockpicking.Value;
|
||||
|
||||
if (lockpicking < 65.0)
|
||||
return;
|
||||
|
||||
this.m_From.PlaySound(0x241);
|
||||
|
||||
if (40.0 + Utility.RandomDouble() * 80.0 < lockpicking)
|
||||
{
|
||||
this.m_From.SendGump(new NexusGameGump(this.m_Nexus, this.m_From, this.m_Step, true));
|
||||
this.m_Nexus.LastUse = DateTime.UtcNow;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Nexus.DoDamage(this.m_From);
|
||||
this.m_Nexus.User = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Node curNode = this.m_Nexus.Path[this.m_Step];
|
||||
|
||||
int newX, newY;
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1: // Left
|
||||
newX = curNode.X - 1;
|
||||
newY = curNode.Y;
|
||||
break;
|
||||
case 2: // Up
|
||||
newX = curNode.X;
|
||||
newY = curNode.Y - 1;
|
||||
break;
|
||||
case 3: // Right
|
||||
newX = curNode.X + 1;
|
||||
newY = curNode.Y;
|
||||
break;
|
||||
case 4: // Down
|
||||
newX = curNode.X;
|
||||
newY = curNode.Y + 1;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextNode.X == newX && nextNode.Y == newY)
|
||||
{
|
||||
if (this.m_Step + 1 == this.m_Nexus.Path.Length - 1)
|
||||
{
|
||||
this.m_Nexus.Solve(this.m_From);
|
||||
this.m_Nexus.User = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_From.PlaySound(0x1F4);
|
||||
this.m_From.SendGump(new NexusGameGump(this.m_Nexus, this.m_From, this.m_Step + 1, false));
|
||||
this.m_Nexus.LastUse = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Nexus.DoDamage(this.m_From);
|
||||
this.m_Nexus.User = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddNode(int x, int y, NodeHue hue)
|
||||
{
|
||||
int id;
|
||||
switch (hue)
|
||||
{
|
||||
case NodeHue.Gray:
|
||||
id = 0x25F8;
|
||||
break;
|
||||
case NodeHue.Blue:
|
||||
id = 0x868;
|
||||
break;
|
||||
default:
|
||||
id = 0x9A8;
|
||||
break;
|
||||
}
|
||||
|
||||
this.AddImage(x, y, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Alterable(typeof(DefBlacksmithy), typeof(ExodusSacrificalGargishDagger))]
|
||||
[FlipableAttribute(0x2D21, 0x2D2D)]
|
||||
public class ExodusSacrificalDagger : BaseKnife
|
||||
{
|
||||
public override int LabelNumber { get { return 1153500; } } // exodus sacrificial dagger
|
||||
private int m_Lifespan;
|
||||
private Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public ExodusSacrificalDagger() : base(0x2D2D)
|
||||
{
|
||||
Weight = 4.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = 2500;
|
||||
|
||||
if (Lifespan > 0)
|
||||
{
|
||||
m_Lifespan = Lifespan;
|
||||
StartTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public override int InitMinHits { get { return 60; } }
|
||||
public override int InitMaxHits { get { return 60; } }
|
||||
public override int AosStrengthReq { get { return 15; } }
|
||||
public override SkillName DefSkill { get { return SkillName.Fencing; } }
|
||||
public override float MlSpeed { get { return 2.00f; } }
|
||||
public override int AosMinDamage { get { return 10; } }
|
||||
public override int AosMaxDamage { get { return 12; } }
|
||||
public override int PhysicalResistance { get { return 12; } }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
RobeofRite robe = from.FindItemOnLayer(Layer.OuterTorso) as RobeofRite;
|
||||
ExodusSacrificalDagger dagger = from.FindItemOnLayer(Layer.OneHanded) as ExodusSacrificalDagger;
|
||||
|
||||
if (Party.Get(from) == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153596); // You must join a party with the players you wish to perform the ritual with.
|
||||
}
|
||||
else if (robe == null || dagger == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153591); // Thou art not properly attired to perform such a ritual.
|
||||
}
|
||||
else if (!((PlayerMobile)from).UseSummoningRite)
|
||||
{
|
||||
from.SendLocalizedMessage(1153603); // You must first use the Summoning Rite on a Summoning Tome.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153604); // Target the summoning tome or yourself to declare your intentions for performing this ritual...
|
||||
from.Target = new SacrificalTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class SacrificalTarget : Target
|
||||
{
|
||||
private Item m_Dagger;
|
||||
|
||||
public SacrificalTarget(Item dagger) : base(2, true, TargetFlags.None)
|
||||
{
|
||||
m_Dagger = dagger;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is ExodusTomeAltar)
|
||||
{
|
||||
ExodusTomeAltar altar = (ExodusTomeAltar)targeted;
|
||||
|
||||
if (altar.CheckParty(altar.Owner, from))
|
||||
{
|
||||
bool SacrificalRitual = altar.Rituals.Find(s => s.RitualMobile == from).Ritual2;
|
||||
|
||||
if (!SacrificalRitual)
|
||||
{
|
||||
((PlayerMobile)from).UseSummoningRite = false;
|
||||
from.Say(1153605); // *You thrust the dagger into your flesh as tribute to Exodus!*
|
||||
altar.Rituals.Find(s => s.RitualMobile == from).Ritual2 = true;
|
||||
m_Dagger.Delete();
|
||||
Misc.Titles.AwardKarma(from, 10000, true);
|
||||
Effects.SendLocationParticles(EffectItem.Create(altar.Location, altar.Map, TimeSpan.FromSeconds(2)), 0x373A, 10, 10, 2023);
|
||||
|
||||
from.SendLocalizedMessage(1153598, from.Name); // ~1_PLAYER~ has read the Summoning Rite!
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153599); // You've already used this item in another ritual.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153595); // You must first join the party of the person who built this altar.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153601); // That is not a Summoning Tome.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ExodusSacrificalDagger(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual int Lifespan { get { return 604800; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TimeLeft
|
||||
{
|
||||
get { return m_Lifespan; }
|
||||
set
|
||||
{
|
||||
m_Lifespan = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Lifespan > 0)
|
||||
{
|
||||
TimeSpan t = TimeSpan.FromSeconds(m_Lifespan);
|
||||
|
||||
int weeks = (int)t.Days / 7;
|
||||
int days = t.Days;
|
||||
int hours = t.Hours;
|
||||
int minutes = t.Minutes;
|
||||
|
||||
if (weeks > 0)
|
||||
list.Add(string.Format("Lifespan: {0} {1}", weeks, weeks == 1 ? "week" : "weeks"));
|
||||
else if (days > 0)
|
||||
list.Add(string.Format("Lifespan: {0} {1}", days, days == 1 ? "day" : "days"));
|
||||
else if (hours > 0)
|
||||
list.Add(string.Format("Lifespan: {0} {1}", hours, hours == 1 ? "hour" : "hours"));
|
||||
else if (minutes > 0)
|
||||
list.Add(string.Format("Lifespan: {0} {1}", minutes, minutes == 1 ? "minute" : "minutes"));
|
||||
else
|
||||
list.Add(1072517, m_Lifespan.ToString()); // Lifespan: ~1_val~ seconds
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void StartTimer()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
return;
|
||||
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), new TimerCallback(Slice));
|
||||
m_Timer.Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
public virtual void StopTimer()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
}
|
||||
|
||||
public virtual void Slice()
|
||||
{
|
||||
m_Lifespan -= 10;
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_Lifespan <= 0)
|
||||
Decay();
|
||||
}
|
||||
|
||||
public virtual void Decay()
|
||||
{
|
||||
if (RootParent is Mobile)
|
||||
{
|
||||
Mobile parent = (Mobile)RootParent;
|
||||
|
||||
if (Name == null)
|
||||
parent.SendLocalizedMessage(1072515, "#" + LabelNumber); // The ~1_name~ expired...
|
||||
else
|
||||
parent.SendLocalizedMessage(1072515, Name); // The ~1_name~ expired...
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(parent.Location, parent.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
|
||||
Effects.PlaySound(parent.Location, parent.Map, 0x201);
|
||||
}
|
||||
else
|
||||
{
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
|
||||
Effects.PlaySound(Location, Map, 0x201);
|
||||
}
|
||||
|
||||
StopTimer();
|
||||
Delete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
writer.Write((int)m_Lifespan);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Lifespan = reader.ReadInt();
|
||||
|
||||
StartTimer();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute(0x0902, 0x406A)]
|
||||
public class ExodusSacrificalGargishDagger : ExodusSacrificalDagger
|
||||
{
|
||||
[Constructable]
|
||||
public ExodusSacrificalGargishDagger()
|
||||
{
|
||||
ItemID = 0x406A;
|
||||
Weight = 4.0;
|
||||
}
|
||||
|
||||
public override Race RequiredRace { get { return Race.Gargoyle; } }
|
||||
public override bool CanBeWornByGargoyles { get { return true; } }
|
||||
|
||||
public ExodusSacrificalGargishDagger(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.PartySystem;
|
||||
using System.Linq;
|
||||
using Server.Engines.Exodus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusSummoningAlter : BaseDecayingItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1153502; } } // exodus summoning altar
|
||||
|
||||
[Constructable]
|
||||
public ExodusSummoningAlter() : base(0x14F0)
|
||||
{
|
||||
this.LootType = LootType.Regular;
|
||||
this.Weight = 1;
|
||||
}
|
||||
|
||||
public override int Lifespan { get { return 604800; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
|
||||
public ExodusSummoningAlter(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)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1054107); // This item must be in your backpack.
|
||||
}
|
||||
else if (Party.Get(from) == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153596); // You must join a party with the players you wish to perform the ritual with.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153675); // The Summoning Altar must be built upon a shrine, within Trammel or Felucca it matters not...
|
||||
from.Target = new SummoningTarget(from, this);
|
||||
}
|
||||
}
|
||||
|
||||
public class SummoningTarget : Target
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private Item m_Deed;
|
||||
|
||||
public SummoningTarget(Mobile from, Item deed) : base(2, true, TargetFlags.None)
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_Deed = deed;
|
||||
}
|
||||
|
||||
public static bool IsValidTile(int itemID)
|
||||
{
|
||||
return (itemID >= 0x149F && itemID <= 0x14D6);
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is StaticTarget)
|
||||
{
|
||||
StaticTarget targ = (StaticTarget)targeted;
|
||||
|
||||
if (IsValidTile(targ.ItemID) && (from.Map == Map.Felucca || from.Map == Map.Trammel))
|
||||
{
|
||||
bool alter = from.Map.GetItemsInRange(targ.Location, 5).Where(x => x is ExodusTomeAltar).Any();
|
||||
|
||||
if (alter)
|
||||
{
|
||||
from.SendLocalizedMessage(1153590); // An altar has already been built here.
|
||||
}
|
||||
else if (ExodusTomeAltar.Altar == null && VerLorRegController.Active && VerLorRegController.Mobile != null && CheckExodus())
|
||||
{
|
||||
Point3D p = Point3D.Zero;
|
||||
|
||||
if (from.Region.IsPartOf("Shrine of Compassion"))
|
||||
{
|
||||
p = new Point3D(1858, 875, 12);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Honesty"))
|
||||
{
|
||||
p = new Point3D(4209, 564, 60);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Honor"))
|
||||
{
|
||||
p = new Point3D(1727, 3528, 15);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Humility"))
|
||||
{
|
||||
p = new Point3D(4274, 3697, 12);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Justice"))
|
||||
{
|
||||
p = new Point3D(1301, 634, 28);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Sacrifice"))
|
||||
{
|
||||
p = new Point3D(3355, 290, 16);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Spirituality"))
|
||||
{
|
||||
p = new Point3D(1606, 2490, 20);
|
||||
}
|
||||
else if (from.Region.IsPartOf("Shrine of Valor"))
|
||||
{
|
||||
p = new Point3D(2492, 3931, 17);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
return;
|
||||
}
|
||||
|
||||
if (p != Point3D.Zero)
|
||||
{
|
||||
ExodusTomeAltar altar = new ExodusTomeAltar(from);
|
||||
altar.MoveToWorld(p, from.Map);
|
||||
altar.Owner = from;
|
||||
m_Deed.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1075213); // The master of this realm has already been summoned and is engaged in combat. Your opportunity will come after he has squashed the current batch of intruders!
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckExodus() // Before ritual check
|
||||
{
|
||||
return ClockworkExodus.Instances.FirstOrDefault(m => m.Region.IsPartOf("Ver Lor Reg") && ((m.Hits >= m.HitsMax * 0.60 && m.MinHits >= m.HitsMax * 0.60) || (m.Hits >= m.HitsMax * 0.75))) != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Targeting;
|
||||
using System.Linq;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusSummoningRite : BaseDecayingItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1153498; } } // exodus summoning rite
|
||||
|
||||
[Constructable]
|
||||
public ExodusSummoningRite() : base(0x2258)
|
||||
{
|
||||
Weight = 1;
|
||||
Hue = 1910;
|
||||
LootType = LootType.Regular;
|
||||
}
|
||||
|
||||
public override int Lifespan { get { return 604800; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
|
||||
public ExodusSummoningRite(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
RobeofRite robe = from.FindItemOnLayer(Layer.OuterTorso) as RobeofRite;
|
||||
ExodusSacrificalDagger dagger = from.FindItemOnLayer(Layer.OneHanded) as ExodusSacrificalDagger;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1054107); // This item must be in your backpack.
|
||||
}
|
||||
else if (Party.Get(from) == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153596); // You must join a party with the players you wish to perform the ritual with.
|
||||
}
|
||||
else if (robe == null || dagger == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153591); // Thou art not properly attired to perform such a ritual.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153600); // Which Summoning Tome do you wish to use this on?
|
||||
from.Target = new RiteTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class RiteTarget : Target
|
||||
{
|
||||
private Item m_Deed;
|
||||
|
||||
public RiteTarget(Item deed) : base(2, true, TargetFlags.None)
|
||||
{
|
||||
m_Deed = deed;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is ExodusTomeAltar)
|
||||
{
|
||||
ExodusTomeAltar altar = (ExodusTomeAltar)targeted;
|
||||
|
||||
if (altar.CheckParty(altar.Owner, from))
|
||||
{
|
||||
if (altar.Rituals.Count(s => s.RitualMobile == from) == 0)
|
||||
{
|
||||
altar.Rituals.Add(new RitualArray { RitualMobile = from, Ritual1 = false, Ritual2 = false });
|
||||
}
|
||||
|
||||
bool RiteRitual = altar.Rituals.Find(s => s.RitualMobile == from).Ritual1;
|
||||
|
||||
if (!RiteRitual)
|
||||
{
|
||||
((PlayerMobile)from).UseSummoningRite = true;
|
||||
from.Say(1153597); // You place the rite within the tome and begin to meditate...
|
||||
altar.Rituals.Find(s => s.RitualMobile == from).Ritual1 = true;
|
||||
m_Deed.Delete();
|
||||
from.SendLocalizedMessage(1153598, from.Name); // ~1_PLAYER~ has read the Summoning Rite!
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153599); // You've already used this item in another ritual.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153595); // You must first join the party of the person who built this altar.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153601); // That is not a Summoning Tome.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
using System;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Gumps;
|
||||
using Server.Commands;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.Exodus;
|
||||
using Server.Mobiles;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExodusTomeAltar : BaseDecayingItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1153602; } } // Exodus Summoning Tome
|
||||
public static ExodusTomeAltar Altar { get; set; }
|
||||
public TimeSpan DelayExit { get { return TimeSpan.FromMinutes(10); } }
|
||||
private Point3D m_TeleportDest = new Point3D(764, 640, 0);
|
||||
public override int Lifespan { get { return 420; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
private List<RitualArray> m_Rituals;
|
||||
private Mobile m_Owner;
|
||||
private Item m_ExodusAlterAddon;
|
||||
|
||||
public List<RitualArray> Rituals { get { return m_Rituals; } }
|
||||
public Mobile Owner
|
||||
{
|
||||
get { return this.m_Owner; }
|
||||
set { this.m_Owner = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ExodusTomeAltar(Mobile from)
|
||||
: base(0x1C11)
|
||||
{
|
||||
this.Hue = 1943;
|
||||
this.Movable = false;
|
||||
this.LootType = LootType.Regular;
|
||||
this.Weight = 0.0;
|
||||
|
||||
this.m_Rituals = new List<RitualArray>();
|
||||
this.m_ExodusAlterAddon = new ExodusAlterAddon();
|
||||
this.m_ExodusAlterAddon.Movable = false;
|
||||
}
|
||||
|
||||
public ExodusTomeAltar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private class BeginTheRitual : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private ExodusTomeAltar m_altar;
|
||||
|
||||
public BeginTheRitual(ExodusTomeAltar altar, Mobile from) : base(1153608, 2) // Begin the Ritual
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_altar = altar;
|
||||
|
||||
if (altar.Owner != from)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_altar.Owner == m_Mobile)
|
||||
{
|
||||
m_altar.SendConfirmationsExodus(m_Mobile);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1153610); // Only the altar owner can commence with the ritual.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
list.Add(new BeginTheRitual(this, from));
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.HasGump(typeof(AltarGump)))
|
||||
{
|
||||
from.SendGump(new AltarGump(from));
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (this.m_ExodusAlterAddon != null)
|
||||
this.m_ExodusAlterAddon.Delete();
|
||||
|
||||
if (Altar != null)
|
||||
Altar = null;
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (this.Deleted)
|
||||
return;
|
||||
|
||||
if (this.m_ExodusAlterAddon != null)
|
||||
this.m_ExodusAlterAddon.Map = this.Map;
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLoc)
|
||||
{
|
||||
if (this.Deleted)
|
||||
return;
|
||||
|
||||
if (this.m_ExodusAlterAddon != null)
|
||||
this.m_ExodusAlterAddon.Location = new Point3D(this.X - 1, this.Y - 1, this.Z - 18);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((Item)m_ExodusAlterAddon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_ExodusAlterAddon = reader.ReadItem();
|
||||
}
|
||||
|
||||
public bool CheckParty(Mobile from, Mobile m)
|
||||
{
|
||||
Party party = Party.Get(from);
|
||||
|
||||
if (party != null)
|
||||
{
|
||||
foreach (PartyMemberInfo info in party.Members)
|
||||
{
|
||||
if (info.Mobile == m)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void SendConfirmationsExodus(Mobile from)
|
||||
{
|
||||
Party party = Party.Get(from);
|
||||
|
||||
if (party != null)
|
||||
{
|
||||
int MemberRange = party.Members.Where(x => !from.InRange(x.Mobile, 5)).Count();
|
||||
|
||||
if (MemberRange != 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1153611); // One or more members of your party are not close enough to you to perform the ritual.
|
||||
return;
|
||||
}
|
||||
|
||||
RobeofRite robe;
|
||||
|
||||
foreach (PartyMemberInfo info in party.Members)
|
||||
{
|
||||
robe = info.Mobile.FindItemOnLayer(Layer.OuterTorso) as RobeofRite;
|
||||
|
||||
if (!m_Rituals.Where(z => z.RitualMobile == info.Mobile && z.Ritual1 && z.Ritual2).Any() || robe == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1153609, info.Mobile.Name); // ~1_PLAYER~ has not fulfilled all the requirements of the Ritual! You cannot commence until they do.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PartyMemberInfo info in party.Members)
|
||||
{
|
||||
this.SendBattleground(info.Mobile);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1153596); // You must join a party with the players you wish to perform the ritual with.
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SendBattleground(Mobile from)
|
||||
{
|
||||
if (VerLorRegController.Active && VerLorRegController.Mobile != null && ExodusSummoningAlter.CheckExodus())
|
||||
{
|
||||
// teleport party member
|
||||
from.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
|
||||
from.PlaySound(0x1FE);
|
||||
from.MoveToWorld(this.m_TeleportDest, Map.Ilshenar);
|
||||
BaseCreature.TeleportPets(from, m_TeleportDest, Map.Ilshenar);
|
||||
|
||||
// Robe of Rite Delete
|
||||
RobeofRite robe = from.FindItemOnLayer(Layer.OuterTorso) as RobeofRite;
|
||||
|
||||
if (robe != null)
|
||||
{
|
||||
robe.Delete();
|
||||
}
|
||||
|
||||
// Altar Delete
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerCallback(Delete));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1075213); // The master of this realm has already been summoned and is engaged in combat. Your opportunity will come after he has squashed the current batch of intruders!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RitualArray
|
||||
{
|
||||
public Mobile RitualMobile { get; set; }
|
||||
public bool Ritual1 { get; set; }
|
||||
public bool Ritual2 { get; set; }
|
||||
}
|
||||
|
||||
public class AltarGump : Gump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("TomeAltarGump", AccessLevel.Administrator, new CommandEventHandler(TomeAltarGump_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("TomeAltarGump")]
|
||||
public static void TomeAltarGump_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (!from.HasGump(typeof(AltarGump)))
|
||||
{
|
||||
from.SendGump(new AltarGump(from));
|
||||
}
|
||||
}
|
||||
|
||||
public AltarGump(Mobile owner) : base(100, 100)
|
||||
{
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 447, 195, 5120);
|
||||
AddHtmlLocalized(17, 14, 412, 161, 1153607, 0x7FFF, false, false); // Contained within this Tome is the ritual by which Lord Exodus may once again be called upon Britannia in his physical form, summoned from deep within the Void. Only when the Summoning Rite has been rejoined with the tome and only when the Robe of Rite covers the caster can the Sacrificial Dagger be used to seal thy fate. Stab into this book the dagger and declare thy quest for Valor as thou stand to defend Britannia from this evil, or sacrifice thy blood unto this altar to declare thy quest for greed and wealth...only thou can judge thyself...
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0: {
|
||||
//Cancel
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExoticToolkit : BaseDecayingItem
|
||||
{
|
||||
[Constructable]
|
||||
public ExoticToolkit()
|
||||
: base(0x1EB9)
|
||||
{
|
||||
this.Hue = 2500;
|
||||
this.Weight = 1;
|
||||
}
|
||||
|
||||
public override int Lifespan { get { return 604800; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
|
||||
public override int LabelNumber { get { return 1153866; } } // Exotic Toolkit
|
||||
|
||||
public ExoticToolkit(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(500325); // I am too far away to do that.
|
||||
else
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
from.SendLocalizedMessage(1152378); // Use this on a broken Nexus.
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
public ExoticToolkit m_Toolkit;
|
||||
public InternalTarget(ExoticToolkit toolkit) : base(-1, true, TargetFlags.None)
|
||||
{
|
||||
m_Toolkit = toolkit;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is NexusComponent)
|
||||
{
|
||||
NexusComponent addon = ((NexusComponent)targeted) as NexusComponent;
|
||||
|
||||
if (addon.Addon is ExodusNexus)
|
||||
{
|
||||
if (!((ExodusNexus)addon.Addon).Active)
|
||||
{
|
||||
((ExodusNexus)addon.Addon).OpenGump(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class KeypunchReader : OrnateWoodenChest
|
||||
{
|
||||
public override int LabelNumber { get { return 1153868; } } // Keypunch Reader
|
||||
|
||||
[Constructable]
|
||||
public KeypunchReader()
|
||||
: base()
|
||||
{
|
||||
this.Weight = 0.0;
|
||||
this.Hue = 2500;
|
||||
this.Movable = false;
|
||||
}
|
||||
|
||||
public KeypunchReader(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (!base.OnDragDrop(from, dropped))
|
||||
return false;
|
||||
|
||||
if (this.TotalItems >= 50)
|
||||
{
|
||||
CheckItems(from);
|
||||
}
|
||||
|
||||
if (dropped is PunchCard)
|
||||
{
|
||||
from.SendLocalizedMessage(1152375); // You feed the punch card into the machine but nothing happens.
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
if (!base.OnDragDropInto(from, item, p))
|
||||
return false;
|
||||
|
||||
if (this.TotalItems >= 50)
|
||||
{
|
||||
CheckItems(from);
|
||||
}
|
||||
|
||||
if (item is PunchCard)
|
||||
{
|
||||
from.SendLocalizedMessage(1152375); // You feed the punch card into the machine but nothing happens.
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CheckItems(Mobile m)
|
||||
{
|
||||
List<Item> items = this.Items;
|
||||
|
||||
var punch = items.Where(x => x is PunchCard);
|
||||
var kit = items.Where(x => x is ExoticToolkit);
|
||||
|
||||
if (punch.Count() >= 50 && kit.Count() >= 1)
|
||||
{
|
||||
punch.ToList().ForEach(f => f.Delete());
|
||||
|
||||
this.DropItem(new NexusAddonDeed());
|
||||
m.SendLocalizedMessage(1152376); // As you feed the punch card into the machine it turns on!
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MechanicalComponent : BaseDecayingItem
|
||||
{
|
||||
[Constructable]
|
||||
public MechanicalComponent()
|
||||
: base(0x2DD7)
|
||||
{
|
||||
this.Hue = 2500;
|
||||
this.Weight = 1;
|
||||
}
|
||||
|
||||
public override int Lifespan { get { return 259200; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
|
||||
public override int LabelNumber { get { return 1153865; } } // Mechanical Component
|
||||
|
||||
public MechanicalComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.Skills[SkillName.Tinkering].Value >= 80.0)
|
||||
{
|
||||
from.AddToBackpack(new ExoticToolkit());
|
||||
this.Delete();
|
||||
from.SendLocalizedMessage(1152369); // You successfully convert the component into an exotic tool kit.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1152370); // Only an Adept Tinker would know what to do with this.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PunchCard : BaseDecayingItem
|
||||
{
|
||||
[Constructable]
|
||||
public PunchCard()
|
||||
: base(0x0FF4)
|
||||
{
|
||||
this.LootType = LootType.Regular;
|
||||
this.Hue = Utility.RandomNondyedHue();
|
||||
this.Weight = 2;
|
||||
}
|
||||
|
||||
public override int Lifespan { get { return 21600; } }
|
||||
public override bool UseSeconds { get { return false; } }
|
||||
|
||||
public override int LabelNumber { get { return 1153867; } } // Punch Card
|
||||
|
||||
public PunchCard(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RobeofRite : Robe
|
||||
{
|
||||
public override int LabelNumber { get { return 1153510; } } // robe of rite
|
||||
|
||||
private int m_Lifespan;
|
||||
private Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public RobeofRite() : base(0x1F03)
|
||||
{
|
||||
this.Weight = 3;
|
||||
this.Hue = 2702;
|
||||
this.StrRequirement = 10;
|
||||
|
||||
if (this.Lifespan > 0)
|
||||
{
|
||||
this.m_Lifespan = this.Lifespan;
|
||||
this.StartTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public RobeofRite(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual int Lifespan { get { return 604800; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TimeLeft
|
||||
{
|
||||
get { return this.m_Lifespan; }
|
||||
set
|
||||
{
|
||||
this.m_Lifespan = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.Lifespan > 0)
|
||||
{
|
||||
TimeSpan t = TimeSpan.FromSeconds(this.m_Lifespan);
|
||||
|
||||
int weeks = (int)t.Days / 7;
|
||||
int days = t.Days;
|
||||
int hours = t.Hours;
|
||||
int minutes = t.Minutes;
|
||||
|
||||
if (weeks > 1)
|
||||
list.Add(1153092, weeks.ToString()); // Lifespan: ~1_val~ weeks
|
||||
else if (days > 1)
|
||||
list.Add(1153091, days.ToString()); // Lifespan: ~1_val~ days
|
||||
else if (hours > 1)
|
||||
list.Add(1153090, hours.ToString()); // Lifespan: ~1_val~ hours
|
||||
else if (minutes > 1)
|
||||
list.Add(1153089, minutes.ToString()); // Lifespan: ~1_val~ minutes
|
||||
else
|
||||
list.Add(1072517, this.m_Lifespan.ToString()); // Lifespan: ~1_val~ seconds
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void StartTimer()
|
||||
{
|
||||
if (this.m_Timer != null)
|
||||
return;
|
||||
|
||||
this.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), new TimerCallback(Slice));
|
||||
this.m_Timer.Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
public virtual void StopTimer()
|
||||
{
|
||||
if (this.m_Timer != null)
|
||||
this.m_Timer.Stop();
|
||||
|
||||
this.m_Timer = null;
|
||||
}
|
||||
|
||||
public virtual void Slice()
|
||||
{
|
||||
this.m_Lifespan -= 10;
|
||||
|
||||
this.InvalidateProperties();
|
||||
|
||||
if (this.m_Lifespan <= 0)
|
||||
this.Decay();
|
||||
}
|
||||
|
||||
public virtual void Decay()
|
||||
{
|
||||
if (this.RootParent is Mobile)
|
||||
{
|
||||
Mobile parent = (Mobile)this.RootParent;
|
||||
|
||||
if (this.Name == null)
|
||||
parent.SendLocalizedMessage(1072515, "#" + this.LabelNumber); // The ~1_name~ expired...
|
||||
else
|
||||
parent.SendLocalizedMessage(1072515, this.Name); // The ~1_name~ expired...
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(parent.Location, parent.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
|
||||
Effects.PlaySound(parent.Location, parent.Map, 0x201);
|
||||
}
|
||||
else
|
||||
{
|
||||
Effects.SendLocationParticles(EffectItem.Create(this.Location, this.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
|
||||
Effects.PlaySound(this.Location, this.Map, 0x201);
|
||||
}
|
||||
|
||||
this.StopTimer();
|
||||
this.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
writer.Write((int)this.m_Lifespan);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
this.m_Lifespan = reader.ReadInt();
|
||||
|
||||
this.StartTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user