Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
88
Scripts/Items/Addons/AbbatoirAddon.cs
Normal file
88
Scripts/Items/Addons/AbbatoirAddon.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AbbatoirAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AbbatoirAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x120E), -1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x120F), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1210), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1215), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1216), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1211), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1214), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1213), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1212), 1, 1, 0);
|
||||
}
|
||||
|
||||
public AbbatoirAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AbbatoirDeed();
|
||||
}
|
||||
}
|
||||
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 AbbatoirDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AbbatoirDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AbbatoirDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AbbatoirAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044329;
|
||||
}
|
||||
}// abbatoir
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
398
Scripts/Items/Addons/AddonComponent.cs
Normal file
398
Scripts/Items/Addons/AddonComponent.cs
Normal file
@@ -0,0 +1,398 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Network;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Anvil]
|
||||
public class AnvilComponent : AddonComponent
|
||||
{
|
||||
[Constructable]
|
||||
public AnvilComponent(int itemID)
|
||||
: base(itemID)
|
||||
{ }
|
||||
|
||||
public AnvilComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Forge]
|
||||
public class ForgeComponent : AddonComponent
|
||||
{
|
||||
[Constructable]
|
||||
public ForgeComponent(int itemID)
|
||||
: base(itemID)
|
||||
{ }
|
||||
|
||||
public ForgeComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalizedAddonComponent : AddonComponent
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
|
||||
[Constructable]
|
||||
public LocalizedAddonComponent(int itemID, int labelNumber)
|
||||
: base(itemID)
|
||||
{
|
||||
m_LabelNumber = labelNumber;
|
||||
}
|
||||
|
||||
public LocalizedAddonComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Number
|
||||
{
|
||||
get { return m_LabelNumber; }
|
||||
set
|
||||
{
|
||||
m_LabelNumber = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return m_LabelNumber; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(m_LabelNumber);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_LabelNumber = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AddonComponent : Item, IChopable
|
||||
{
|
||||
public override bool ForceShowProperties { get { return Addon != null && Addon.ForceShowProperties; } }
|
||||
|
||||
private static readonly LightEntry[] m_Entries =
|
||||
{
|
||||
new LightEntry(
|
||||
LightType.WestSmall,
|
||||
1122,
|
||||
1123,
|
||||
1124,
|
||||
1141,
|
||||
1142,
|
||||
1143,
|
||||
1144,
|
||||
1145,
|
||||
1146,
|
||||
2347,
|
||||
2359,
|
||||
2360,
|
||||
2361,
|
||||
2362,
|
||||
2363,
|
||||
2364,
|
||||
2387,
|
||||
2388,
|
||||
2389,
|
||||
2390,
|
||||
2391,
|
||||
2392),
|
||||
new LightEntry(
|
||||
LightType.NorthSmall,
|
||||
1131,
|
||||
1133,
|
||||
1134,
|
||||
1147,
|
||||
1148,
|
||||
1149,
|
||||
1150,
|
||||
1151,
|
||||
1152,
|
||||
2352,
|
||||
2373,
|
||||
2374,
|
||||
2375,
|
||||
2376,
|
||||
2377,
|
||||
2378,
|
||||
2401,
|
||||
2402,
|
||||
2403,
|
||||
2404,
|
||||
2405,
|
||||
2406),
|
||||
new LightEntry(LightType.Circle300, 6526, 6538, 6571), new LightEntry(LightType.Circle150, 5703, 6587)
|
||||
};
|
||||
|
||||
[Constructable]
|
||||
public AddonComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
ApplyLightTo(this);
|
||||
}
|
||||
|
||||
public AddonComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseAddon Addon { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D Offset { get; set; }
|
||||
|
||||
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (Addon != null && Addon.ShareHue)
|
||||
Addon.Hue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool NeedsWall { get { return false; } }
|
||||
public virtual Point3D WallPosition { get { return Point3D.Zero; } }
|
||||
|
||||
public static void ApplyLightTo(Item item)
|
||||
{
|
||||
if ((item.ItemData.Flags & TileFlag.LightSource) == 0)
|
||||
return; // not a light source
|
||||
|
||||
var itemID = item.ItemID;
|
||||
|
||||
foreach (var entry in m_Entries)
|
||||
{
|
||||
var toMatch = entry.m_ItemIDs;
|
||||
var contains = false;
|
||||
|
||||
for (var j = 0; !contains && j < toMatch.Length; ++j)
|
||||
contains = (itemID == toMatch[j]);
|
||||
|
||||
if (contains)
|
||||
{
|
||||
item.Light = entry.m_Light;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.OnComponentUsed(this, from);
|
||||
}
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (Addon != null && from.InRange(GetWorldLocation(), 3))
|
||||
Addon.OnChop(from);
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Location = new Point3D(X - Offset.X, Y - Offset.Y, Z - Offset.Z);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (Addon != null)
|
||||
Addon.Delete();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Addon != null)
|
||||
{
|
||||
Addon.GetProperties(list, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile m, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(m, list);
|
||||
|
||||
if (Addon != null)
|
||||
{
|
||||
Addon.GetContextMenuEntries(m, list);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write(Addon);
|
||||
writer.Write(Offset);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
Addon = reader.ReadItem() as BaseAddon;
|
||||
Offset = reader.ReadPoint3D();
|
||||
|
||||
if (Addon != null)
|
||||
{
|
||||
Addon.OnComponentLoaded(this);
|
||||
ApplyLightTo(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 1 && Weight == 0)
|
||||
Weight = -1;
|
||||
}
|
||||
|
||||
private class LightEntry
|
||||
{
|
||||
public readonly LightType m_Light;
|
||||
public readonly int[] m_ItemIDs;
|
||||
|
||||
public LightEntry(LightType light, params int[] itemIDs)
|
||||
{
|
||||
m_Light = light;
|
||||
m_ItemIDs = itemIDs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class InstrumentedAddonComponent : AddonComponent
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int SuccessSound { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public InstrumentedAddonComponent(int itemID, int wellSound)
|
||||
: base(itemID)
|
||||
{
|
||||
SuccessSound = wellSound;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else if (from.BeginAction(typeof(InstrumentedAddonComponent)))
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(1000), () =>
|
||||
{
|
||||
from.EndAction(typeof(InstrumentedAddonComponent));
|
||||
});
|
||||
|
||||
from.PlaySound(SuccessSound);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500119); // You must wait to perform another action
|
||||
}
|
||||
}
|
||||
|
||||
public InstrumentedAddonComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(SuccessSound);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
|
||||
SuccessSound = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
177
Scripts/Items/Addons/AddonContainerComponent.cs
Normal file
177
Scripts/Items/Addons/AddonContainerComponent.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
#region References
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.ContextMenus;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AddonContainerComponent : Item, IChopable
|
||||
{
|
||||
[Constructable]
|
||||
public AddonContainerComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
AddonComponent.ApplyLightTo(this);
|
||||
}
|
||||
|
||||
public AddonContainerComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public virtual bool NeedsWall { get { return false; } }
|
||||
public virtual Point3D WallPosition { get { return Point3D.Zero; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseAddonContainer Addon { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D Offset { get; set; }
|
||||
|
||||
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (Addon != null && Addon.ShareHue)
|
||||
Addon.Hue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (Addon != null)
|
||||
return Addon.OnDragDrop(from, dropped);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.OnComponentUsed(this, from);
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Location = new Point3D(X - Offset.X, Y - Offset.Y, Z - Offset.Z);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (Addon != null)
|
||||
Addon.Delete();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Addon != null)
|
||||
{
|
||||
Addon.GetProperties(list, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile m, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(m, list);
|
||||
|
||||
if (Addon != null)
|
||||
{
|
||||
Addon.GetContextMenuEntries(m, list);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Addon);
|
||||
writer.Write(Offset);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
|
||||
Addon = reader.ReadItem() as BaseAddonContainer;
|
||||
Offset = reader.ReadPoint3D();
|
||||
|
||||
if (Addon != null)
|
||||
Addon.OnComponentLoaded(this);
|
||||
|
||||
AddonComponent.ApplyLightTo(this);
|
||||
}
|
||||
|
||||
public virtual void OnChop(Mobile from)
|
||||
{
|
||||
if (Addon != null && from.InRange(GetWorldLocation(), 3))
|
||||
Addon.OnChop(from);
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalizedContainerComponent : AddonContainerComponent
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
|
||||
public LocalizedContainerComponent(int itemID, int labelNumber)
|
||||
: base(itemID)
|
||||
{
|
||||
m_LabelNumber = labelNumber;
|
||||
}
|
||||
|
||||
public LocalizedContainerComponent(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_LabelNumber > 0)
|
||||
return m_LabelNumber;
|
||||
|
||||
return base.LabelNumber;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_LabelNumber);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
|
||||
m_LabelNumber = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
193
Scripts/Items/Addons/AdvancedTrainingDummy.cs
Normal file
193
Scripts/Items/Addons/AdvancedTrainingDummy.cs
Normal file
@@ -0,0 +1,193 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x971C, 0x9821)]
|
||||
public class AdvancedTrainingDummy : TrainingDummy
|
||||
{
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummy() : this(0x971C)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummy(int itemID) : base(itemID)
|
||||
{
|
||||
MinSkill = -25.0;
|
||||
MaxSkill = +60.0;
|
||||
}
|
||||
|
||||
public override void UpdateItemID()
|
||||
{
|
||||
}
|
||||
|
||||
public override void BeginSwing()
|
||||
{
|
||||
ItemID = ItemID + 1;
|
||||
base.BeginSwing();
|
||||
}
|
||||
|
||||
public override void EndSwing()
|
||||
{
|
||||
ItemID = ItemID - 1;
|
||||
base.EndSwing();
|
||||
}
|
||||
|
||||
public AdvancedTrainingDummy(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AdvancedTrainingDummyEastAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new AdvancedTrainingDummyEastDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummyEastAddon()
|
||||
{
|
||||
AddComponent(new AdvancedTrainingDummy(38945), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(38962), 0, -1, 0);
|
||||
AddComponent(new AddonComponent(38960), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(38958), 0, 1, 0);
|
||||
|
||||
AddComponent(new AddonComponent(38959), -1, 1, 0);
|
||||
AddComponent(new AddonComponent(38961), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(38963), -1, -1, 0);
|
||||
AddComponent(new AddonComponent(38957), 1, -1, 0);
|
||||
}
|
||||
|
||||
public AdvancedTrainingDummyEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AdvancedTrainingDummyEastDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon { get { return new AdvancedTrainingDummyEastAddon(); } }
|
||||
public override int LabelNumber { get { return 1150596; } } // advanced training dummy (east)
|
||||
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummyEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AdvancedTrainingDummyEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AdvancedTrainingDummySouthAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new AdvancedTrainingDummySouthDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummySouthAddon()
|
||||
{
|
||||
AddComponent(new AdvancedTrainingDummy(38940), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(38955), -1, 0, 0);
|
||||
AddComponent(new AddonComponent(38953), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(38951), 1, 0, 0);
|
||||
|
||||
AddComponent(new AddonComponent(38954), -1, 1, 0);
|
||||
AddComponent(new AddonComponent(38956), -1, -1, 0);
|
||||
|
||||
AddComponent(new AddonComponent(38950), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(38952), 1, -1, 0);
|
||||
}
|
||||
|
||||
public AdvancedTrainingDummySouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AdvancedTrainingDummySouthDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon { get { return new AdvancedTrainingDummySouthAddon(); } }
|
||||
public override int LabelNumber { get { return 1150595; } } // advanced training dummy (south)
|
||||
|
||||
[Constructable]
|
||||
public AdvancedTrainingDummySouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AdvancedTrainingDummySouthDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Addons/AlchemistTableEastAddon.cs
Normal file
81
Scripts/Items/Addons/AlchemistTableEastAddon.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlchemistTableEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AlchemistTableEastAddon()
|
||||
{
|
||||
AddComponent(new AddonComponent(0x3077), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x3078), 0, -1, 0);
|
||||
}
|
||||
|
||||
public AlchemistTableEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AlchemistTableEastDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AlchemistTableEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AlchemistTableEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AlchemistTableEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AlchemistTableEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073397;
|
||||
}
|
||||
}// alchemist table (east)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Addons/AlchemistTableSouthAddon.cs
Normal file
81
Scripts/Items/Addons/AlchemistTableSouthAddon.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlchemistTableSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AlchemistTableSouthAddon()
|
||||
{
|
||||
AddComponent(new AddonComponent(0x3079), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x307A), -1, 0, 0);
|
||||
}
|
||||
|
||||
public AlchemistTableSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AlchemistTableSouthDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AlchemistTableSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AlchemistTableSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AlchemistTableSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AlchemistTableSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073396;
|
||||
}
|
||||
}// alchemist table (south)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
370
Scripts/Items/Addons/AnkhOfSacrifice.cs
Normal file
370
Scripts/Items/Addons/AnkhOfSacrifice.cs
Normal file
@@ -0,0 +1,370 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnkhOfSacrificeComponent : AddonComponent
|
||||
{
|
||||
public AnkhOfSacrificeComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return ObjectPropertyList.Enabled;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1027772;
|
||||
}
|
||||
}// Ankh of Sacrifice
|
||||
public static void Resurrect(PlayerMobile m, AnkhOfSacrificeAddon ankh)
|
||||
{
|
||||
if (m == null)
|
||||
{
|
||||
}
|
||||
else if (!m.InRange(ankh.GetWorldLocation(), 2))
|
||||
{
|
||||
m.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (m.Alive)
|
||||
{
|
||||
m.SendLocalizedMessage(1060197); // You are not dead, and thus cannot be resurrected!
|
||||
}
|
||||
else if (m.AnkhNextUse > DateTime.UtcNow)
|
||||
{
|
||||
TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;
|
||||
|
||||
if (delay.TotalMinutes > 0)
|
||||
m.SendLocalizedMessage(1079265, Math.Round(delay.TotalMinutes).ToString()); // You must wait ~1_minutes~ minutes before you can use this item.
|
||||
else
|
||||
m.SendLocalizedMessage(1079263, Math.Round(delay.TotalSeconds).ToString()); // You must wait ~1_seconds~ seconds before you can use this item.
|
||||
}
|
||||
else
|
||||
{
|
||||
m.CloseGump(typeof(AnkhResurrectGump));
|
||||
m.SendGump(new AnkhResurrectGump(m, ResurrectMessage.VirtueShrine));
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from is PlayerMobile)
|
||||
list.Add(new LockKarmaEntry((PlayerMobile)from, this.Addon as AnkhOfSacrificeAddon));
|
||||
|
||||
list.Add(new ResurrectEntry(from, this.Addon as AnkhOfSacrificeAddon));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private class ResurrectEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
private readonly AnkhOfSacrificeAddon m_Ankh;
|
||||
public ResurrectEntry(Mobile mobile, AnkhOfSacrificeAddon ankh)
|
||||
: base(6195, 2)
|
||||
{
|
||||
this.m_Mobile = mobile;
|
||||
this.m_Ankh = ankh;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (this.m_Ankh == null || this.m_Ankh.Deleted)
|
||||
return;
|
||||
|
||||
Resurrect(this.m_Mobile as PlayerMobile, this.m_Ankh);
|
||||
}
|
||||
}
|
||||
|
||||
private class LockKarmaEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly PlayerMobile m_Mobile;
|
||||
private readonly AnkhOfSacrificeAddon m_Ankh;
|
||||
public LockKarmaEntry(PlayerMobile mobile, AnkhOfSacrificeAddon ankh)
|
||||
: base(mobile.KarmaLocked ? 6197 : 6196, 2)
|
||||
{
|
||||
this.m_Mobile = mobile;
|
||||
this.m_Ankh = ankh;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (!this.m_Mobile.InRange(this.m_Ankh.GetWorldLocation(), 2))
|
||||
this.m_Mobile.SendLocalizedMessage(500446); // That is too far away.
|
||||
else
|
||||
{
|
||||
this.m_Mobile.KarmaLocked = !this.m_Mobile.KarmaLocked;
|
||||
|
||||
if (this.m_Mobile.KarmaLocked)
|
||||
this.m_Mobile.SendLocalizedMessage(1060192); // Your karma has been locked. Your karma can no longer be raised.
|
||||
else
|
||||
this.m_Mobile.SendLocalizedMessage(1060191); // Your karma has been unlocked. Your karma can be raised again.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AnkhResurrectGump : ResurrectGump
|
||||
{
|
||||
public AnkhResurrectGump(Mobile owner, ResurrectMessage msg)
|
||||
: base(owner, owner, msg, false)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (info.ButtonID == 1 || info.ButtonID == 2)
|
||||
{
|
||||
if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
|
||||
{
|
||||
from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
|
||||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile)
|
||||
{
|
||||
((PlayerMobile)from).AnkhNextUse = DateTime.UtcNow + TimeSpan.FromHours(1);
|
||||
}
|
||||
|
||||
base.OnResponse(state, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AnkhOfSacrificeAddon : BaseAddon, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east)
|
||||
{
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1D98), 0, 0, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1D97), 0, 1, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CD6), 1, 0, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CD4), 1, 1, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CD0), 2, 0, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CCE), 2, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1E5D), 0, 0, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1E5C), 1, 0, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CD2), 0, 1, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CD8), 1, 1, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CCD), 0, 2, 0);
|
||||
this.AddComponent(new AnkhOfSacrificeComponent(0x1CCE), 1, 2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
AnkhOfSacrificeDeed deed = new AnkhOfSacrificeDeed();
|
||||
deed.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||
{
|
||||
if (!m.Alive && Utility.InRange(this.Location, m.Location, 1) && !Utility.InRange(this.Location, oldLocation, 1))
|
||||
AnkhOfSacrificeComponent.Resurrect(m as PlayerMobile, this);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class AnkhOfSacrificeDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
private bool m_East;
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeDeed()
|
||||
: this(false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeDeed(bool isRewardItem)
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
|
||||
this.m_IsRewardItem = isRewardItem;
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1080397;
|
||||
}
|
||||
}// Deed For An Ankh Of Sacrifice
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
AnkhOfSacrificeAddon addon = new AnkhOfSacrificeAddon(this.m_East);
|
||||
addon.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1080457); // 10th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(1, 1080398); // Ankh of Sacrifice South
|
||||
list.Add(2, 1080399); // Ankh of Sacrifice East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int option)
|
||||
{
|
||||
switch ( option )
|
||||
{
|
||||
case 1:
|
||||
this.m_East = false;
|
||||
break;
|
||||
case 2:
|
||||
this.m_East = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this.Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Addons/AnvilEastAddon.cs
Normal file
81
Scripts/Items/Addons/AnvilEastAddon.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnvilEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AnvilEastAddon()
|
||||
{
|
||||
this.AddComponent(new AnvilComponent(0xFAF), 0, 0, 0);
|
||||
}
|
||||
|
||||
public AnvilEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AnvilEastDeed();
|
||||
}
|
||||
}
|
||||
|
||||
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 AnvilEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AnvilEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AnvilEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AnvilEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044333;
|
||||
}
|
||||
}// anvil (east)
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Addons/AnvilSouthAddon.cs
Normal file
81
Scripts/Items/Addons/AnvilSouthAddon.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnvilSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AnvilSouthAddon()
|
||||
{
|
||||
this.AddComponent(new AnvilComponent(0xFB0), 0, 0, 0);
|
||||
}
|
||||
|
||||
public AnvilSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AnvilSouthDeed();
|
||||
}
|
||||
}
|
||||
|
||||
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 AnvilSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AnvilSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public AnvilSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AnvilSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044334;
|
||||
}
|
||||
}// anvil (south)
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Items/Addons/AppleTrunk.cs
Normal file
83
Scripts/Items/Addons/AppleTrunk.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AppleTrunkAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AppleTrunkAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xD98, 1076785), 0, 0, 0);
|
||||
}
|
||||
|
||||
public AppleTrunkAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AppleTrunkDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AppleTrunkDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AppleTrunkDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public AppleTrunkDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AppleTrunkAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076785;
|
||||
}
|
||||
}// Apple Trunk
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
1251
Scripts/Items/Addons/Aquarium/Aquarium.cs
Normal file
1251
Scripts/Items/Addons/Aquarium/Aquarium.cs
Normal file
File diff suppressed because it is too large
Load Diff
232
Scripts/Items/Addons/Aquarium/AquariumFishingNet.cs
Normal file
232
Scripts/Items/Addons/Aquarium/AquariumFishingNet.cs
Normal file
@@ -0,0 +1,232 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AquariumFishNet : SpecialFishingNet
|
||||
{
|
||||
[Constructable]
|
||||
public AquariumFishNet()
|
||||
{
|
||||
this.ItemID = 0xDC8;
|
||||
|
||||
if (this.Hue == 0x8A0)
|
||||
this.Hue = 0x240;
|
||||
}
|
||||
|
||||
public AquariumFishNet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074463;
|
||||
}
|
||||
}// An aquarium fishing net
|
||||
public override bool RequireDeepWater
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
protected override void AddNetProperties(ObjectPropertyList list)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void FinishEffect(Point3D p, Map map, Mobile from)
|
||||
{
|
||||
if (from.Skills.Fishing.Value < 10)
|
||||
{
|
||||
from.SendLocalizedMessage(1074487); // The creatures are too quick for you!
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseFish fish = this.GiveFish(from);
|
||||
FishBowl bowl = Aquarium.GetEmptyBowl(from);
|
||||
|
||||
if (bowl != null)
|
||||
{
|
||||
fish.StopTimer();
|
||||
bowl.AddItem(fish);
|
||||
from.SendLocalizedMessage(1074489); // A live creature jumps into the fish bowl in your pack!
|
||||
this.Delete();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.PlaceInBackpack(fish))
|
||||
{
|
||||
from.PlaySound(0x5A2);
|
||||
from.SendLocalizedMessage(1074490); // A live creature flops around in your pack before running out of air.
|
||||
|
||||
fish.Kill();
|
||||
this.Delete();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
fish.Delete();
|
||||
|
||||
from.SendLocalizedMessage(1074488); // You could not hold the creature.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.InUse = false;
|
||||
this.Movable = true;
|
||||
|
||||
if (!from.PlaceInBackpack(this))
|
||||
{
|
||||
if (from.Map == null || from.Map == Map.Internal)
|
||||
this.Delete();
|
||||
else
|
||||
this.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
}
|
||||
|
||||
private BaseFish GiveFish(Mobile from)
|
||||
{
|
||||
double skill = from.Skills.Fishing.Value;
|
||||
|
||||
if ((skill / 100.0) >= Utility.RandomDouble())
|
||||
{
|
||||
int max = (int)skill / 5;
|
||||
|
||||
if (max > 20)
|
||||
max = 20;
|
||||
|
||||
switch ( Utility.Random(max) )
|
||||
{
|
||||
case 0:
|
||||
return new MinocBlueFish();
|
||||
case 1:
|
||||
return new Shrimp();
|
||||
case 2:
|
||||
return new FandancerFish();
|
||||
case 3:
|
||||
return new GoldenBroadtail();
|
||||
case 4:
|
||||
return new RedDartFish();
|
||||
case 5:
|
||||
return new AlbinoCourtesanFish();
|
||||
case 6:
|
||||
return new MakotoCourtesanFish();
|
||||
case 7:
|
||||
return new NujelmHoneyFish();
|
||||
case 8:
|
||||
return new Jellyfish();
|
||||
case 9:
|
||||
return new SpeckledCrab();
|
||||
case 10:
|
||||
return new LongClawCrab();
|
||||
case 11:
|
||||
return new AlbinoFrog();
|
||||
case 12:
|
||||
return new KillerFrog();
|
||||
case 13:
|
||||
return new VesperReefTiger();
|
||||
case 14:
|
||||
return new PurpleFrog();
|
||||
case 15:
|
||||
return new BritainCrownFish();
|
||||
case 16:
|
||||
return new YellowFinBluebelly();
|
||||
case 17:
|
||||
return new SpottedBuccaneer();
|
||||
case 18:
|
||||
return new SpinedScratcherFish();
|
||||
default:
|
||||
return new SmallMouthSuckerFin();
|
||||
}
|
||||
}
|
||||
|
||||
return new MinocBlueFish();
|
||||
}
|
||||
}
|
||||
|
||||
// Legacy code
|
||||
public class AquariumFishingNet : Item
|
||||
{
|
||||
public AquariumFishingNet()
|
||||
{
|
||||
}
|
||||
|
||||
public AquariumFishingNet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074463;
|
||||
}
|
||||
}// An aquarium fishing net
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
Item replacement = this.CreateReplacement();
|
||||
|
||||
if (!from.PlaceInBackpack(replacement))
|
||||
{
|
||||
replacement.Delete();
|
||||
from.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Delete();
|
||||
from.Use(replacement);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private Item CreateReplacement()
|
||||
{
|
||||
Item result = new AquariumFishNet();
|
||||
result.Hue = this.Hue;
|
||||
result.LootType = this.LootType;
|
||||
result.Movable = this.Movable;
|
||||
result.Name = this.Name;
|
||||
result.QuestItem = this.QuestItem;
|
||||
result.Visible = this.Visible;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/AquariumFood.cs
Normal file
39
Scripts/Items/Addons/Aquarium/AquariumFood.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AquariumFood : Item
|
||||
{
|
||||
[Constructable]
|
||||
public AquariumFood()
|
||||
: base(0xEFC)
|
||||
{
|
||||
}
|
||||
|
||||
public AquariumFood(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074819;
|
||||
}
|
||||
}// Aquarium food
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
90
Scripts/Items/Addons/Aquarium/AquariumGump.cs
Normal file
90
Scripts/Items/Addons/Aquarium/AquariumGump.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AquariumGump : Gump
|
||||
{
|
||||
private readonly Aquarium m_Aquarium;
|
||||
public AquariumGump(Aquarium aquarium, bool edit)
|
||||
: base(100, 100)
|
||||
{
|
||||
this.m_Aquarium = aquarium;
|
||||
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
|
||||
this.AddPage(0);
|
||||
this.AddBackground(0, 0, 350, 323, 0xE10);
|
||||
this.AddImage(0, 0, 0x2C96);
|
||||
|
||||
if (this.m_Aquarium.Items.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 1; i <= this.m_Aquarium.Items.Count; i ++)
|
||||
this.DisplayPage(i, edit);
|
||||
}
|
||||
|
||||
public virtual void DisplayPage(int page, bool edit)
|
||||
{
|
||||
this.AddPage(page);
|
||||
|
||||
Item item = this.m_Aquarium.Items[page - 1];
|
||||
|
||||
// item name
|
||||
if (item.LabelNumber != 0)
|
||||
this.AddHtmlLocalized(20, 217, 250, 20, item.LabelNumber, 0xFFFFFF, false, false); // Name
|
||||
|
||||
// item details
|
||||
if (item is BaseFish)
|
||||
this.AddHtmlLocalized(20, 239, 315, 20, ((BaseFish)item).GetDescription(), 0xFFFFFF, false, false);
|
||||
else
|
||||
this.AddHtmlLocalized(20, 239, 315, 20, 1073634, 0xFFFFFF, false, false); // An aquarium decoration
|
||||
|
||||
// item image
|
||||
this.AddItem(150, 80, item.ItemID, item.Hue);
|
||||
|
||||
// item number / all items
|
||||
this.AddHtml(20, 195, 250, 20, String.Format("<BASEFONT COLOR=#FFFFFF>{0}/{1}</BASEFONT>", page, this.m_Aquarium.Items.Count), false, false);
|
||||
|
||||
// remove item
|
||||
if (edit)
|
||||
{
|
||||
this.AddBackground(230, 195, 100, 26, 0x13BE);
|
||||
this.AddButton(235, 200, 0x845, 0x846, page, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(260, 198, 60, 26, 1073838, 0x0, false, false); // Remove
|
||||
}
|
||||
|
||||
// next page
|
||||
if (page < this.m_Aquarium.Items.Count)
|
||||
{
|
||||
this.AddButton(195, 280, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page + 1);
|
||||
this.AddHtmlLocalized(230, 283, 100, 18, 1044045, 0xFFFFFF, false, false); // NEXT PAGE
|
||||
}
|
||||
|
||||
// previous page
|
||||
if (page > 1)
|
||||
{
|
||||
this.AddButton(45, 280, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page - 1);
|
||||
this.AddHtmlLocalized(80, 283, 100, 18, 1044044, 0xFFFFFF, false, false); // PREV PAGE
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Aquarium == null || this.m_Aquarium.Deleted)
|
||||
return;
|
||||
|
||||
bool edit = this.m_Aquarium.HasAccess(sender.Mobile);
|
||||
|
||||
if (info.ButtonID > 0 && info.ButtonID <= this.m_Aquarium.Items.Count && edit)
|
||||
this.m_Aquarium.RemoveItem(sender.Mobile, info.ButtonID - 1);
|
||||
|
||||
if (info.ButtonID > 0)
|
||||
sender.Mobile.SendGump(new AquariumGump(this.m_Aquarium, edit));
|
||||
}
|
||||
}
|
||||
}
|
||||
113
Scripts/Items/Addons/Aquarium/AquariumState.cs
Normal file
113
Scripts/Items/Addons/Aquarium/AquariumState.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum WaterState
|
||||
{
|
||||
Dead,
|
||||
Dying,
|
||||
Unhealthy,
|
||||
Healthy,
|
||||
Strong
|
||||
}
|
||||
|
||||
public enum FoodState
|
||||
{
|
||||
Dead,
|
||||
Starving,
|
||||
Hungry,
|
||||
Full,
|
||||
Overfed
|
||||
}
|
||||
|
||||
[PropertyObject]
|
||||
public class AquariumState
|
||||
{
|
||||
private int m_State;
|
||||
private int m_Maintain;
|
||||
private int m_Improve;
|
||||
private int m_Added;
|
||||
public AquariumState()
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int State
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_State;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_State = value;
|
||||
|
||||
if (this.m_State < 0)
|
||||
this.m_State = 0;
|
||||
|
||||
if (this.m_State > 4)
|
||||
this.m_State = 4;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Maintain
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Maintain;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Maintain = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Improve
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Improve;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Improve = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Added
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Added;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Added = value;
|
||||
}
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
|
||||
public virtual void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(this.m_State);
|
||||
writer.Write(this.m_Maintain);
|
||||
writer.Write(this.m_Improve);
|
||||
writer.Write(this.m_Added);
|
||||
}
|
||||
|
||||
public virtual void Deserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
this.m_State = reader.ReadInt();
|
||||
this.m_Maintain = reader.ReadInt();
|
||||
this.m_Improve = reader.ReadInt();
|
||||
this.m_Added = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/AlbinoCourtesanFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/AlbinoCourtesanFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlbinoCourtesanFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public AlbinoCourtesanFish()
|
||||
: base(0x3B04)
|
||||
{
|
||||
}
|
||||
|
||||
public AlbinoCourtesanFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074592;
|
||||
}
|
||||
}// Albino Courtesan Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Addons/Aquarium/Fish/AlbinoFrog.cs
Normal file
40
Scripts/Items/Addons/Aquarium/Fish/AlbinoFrog.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlbinoFrog : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public AlbinoFrog()
|
||||
: base(0x3B0D)
|
||||
{
|
||||
this.Hue = 0x47E;
|
||||
}
|
||||
|
||||
public AlbinoFrog(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073824;
|
||||
}
|
||||
}// An Albino Frog
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/BritainCrownFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/BritainCrownFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BritainCrownFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public BritainCrownFish()
|
||||
: base(0x3AFF)
|
||||
{
|
||||
}
|
||||
|
||||
public BritainCrownFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074589;
|
||||
}
|
||||
}// Britain Crown Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/FandancerFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/FandancerFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FandancerFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public FandancerFish()
|
||||
: base(0x3B02)
|
||||
{
|
||||
}
|
||||
|
||||
public FandancerFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074591;
|
||||
}
|
||||
}// Fandancer Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/GoldenBroadtail.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/GoldenBroadtail.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GoldenBroadtail : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public GoldenBroadtail()
|
||||
: base(0x3B03)
|
||||
{
|
||||
}
|
||||
|
||||
public GoldenBroadtail(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073828;
|
||||
}
|
||||
}// A Golden Broadtail
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/Jellyfish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/Jellyfish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Jellyfish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public Jellyfish()
|
||||
: base(0x3B0E)
|
||||
{
|
||||
}
|
||||
|
||||
public Jellyfish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074593;
|
||||
}
|
||||
}// Jellyfish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/KillerFrog.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/KillerFrog.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class KillerFrog : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public KillerFrog()
|
||||
: base(0x3B0D)
|
||||
{
|
||||
}
|
||||
|
||||
public KillerFrog(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073825;
|
||||
}
|
||||
}// A Killer Frog
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Addons/Aquarium/Fish/LongClawCrab.cs
Normal file
40
Scripts/Items/Addons/Aquarium/Fish/LongClawCrab.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LongClawCrab : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public LongClawCrab()
|
||||
: base(0x3AFC)
|
||||
{
|
||||
this.Hue = 0x527;
|
||||
}
|
||||
|
||||
public LongClawCrab(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073827;
|
||||
}
|
||||
}// A Long Claw Crab
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/MakotoCourtesanFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/MakotoCourtesanFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MakotoCourtesanFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public MakotoCourtesanFish()
|
||||
: base(0x3AFD)
|
||||
{
|
||||
}
|
||||
|
||||
public MakotoCourtesanFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073835;
|
||||
}
|
||||
}// A Makoto Courtesan Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/MinocBlueFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/MinocBlueFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MinocBlueFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public MinocBlueFish()
|
||||
: base(0x3AFE)
|
||||
{
|
||||
}
|
||||
|
||||
public MinocBlueFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073829;
|
||||
}
|
||||
}// A Minoc Blue Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/NujelmHoneyFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/NujelmHoneyFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class NujelmHoneyFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public NujelmHoneyFish()
|
||||
: base(0x3B06)
|
||||
{
|
||||
}
|
||||
|
||||
public NujelmHoneyFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073830;
|
||||
}
|
||||
}// A Nujel'm Honey Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Addons/Aquarium/Fish/PurpleFrog.cs
Normal file
40
Scripts/Items/Addons/Aquarium/Fish/PurpleFrog.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PurpleFrog : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public PurpleFrog()
|
||||
: base(0x3B0D)
|
||||
{
|
||||
this.Hue = 0x4FA;
|
||||
}
|
||||
|
||||
public PurpleFrog(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073823;
|
||||
}
|
||||
}// A Purple Frog
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/RedDartFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/RedDartFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RedDartFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public RedDartFish()
|
||||
: base(0x3B00)
|
||||
{
|
||||
}
|
||||
|
||||
public RedDartFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073834;
|
||||
}
|
||||
}// A Red Dart Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/Shrimp.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/Shrimp.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Shrimp : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public Shrimp()
|
||||
: base(0x3B14)
|
||||
{
|
||||
}
|
||||
|
||||
public Shrimp(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074596;
|
||||
}
|
||||
}// Shrimp
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/SmallMouthSuckerFin.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/SmallMouthSuckerFin.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallMouthSuckerFin : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public SmallMouthSuckerFin()
|
||||
: base(0x3B01)
|
||||
{
|
||||
}
|
||||
|
||||
public SmallMouthSuckerFin(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074590;
|
||||
}
|
||||
}// Small Mouth Sucker Fin
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/SpeckledCrab.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/SpeckledCrab.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpeckledCrab : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public SpeckledCrab()
|
||||
: base(0x3AFC)
|
||||
{
|
||||
}
|
||||
|
||||
public SpeckledCrab(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073826;
|
||||
}
|
||||
}// A Speckled Crab
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/SpinedScratcherFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/SpinedScratcherFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpinedScratcherFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public SpinedScratcherFish()
|
||||
: base(0x3B05)
|
||||
{
|
||||
}
|
||||
|
||||
public SpinedScratcherFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073832;
|
||||
}
|
||||
}// A Spined Scratcher Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/SpottedBuccaneer.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/SpottedBuccaneer.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpottedBuccaneer : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public SpottedBuccaneer()
|
||||
: base(0x3B09)
|
||||
{
|
||||
}
|
||||
|
||||
public SpottedBuccaneer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073833;
|
||||
}
|
||||
}// A Spotted Buccaneer
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/VesperReefTiger.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/VesperReefTiger.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class VesperReefTiger : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public VesperReefTiger()
|
||||
: base(0x3B08)
|
||||
{
|
||||
}
|
||||
|
||||
public VesperReefTiger(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073836;
|
||||
}
|
||||
}// A Vesper Reef Tiger
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Fish/YellowFinBluebelly.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Fish/YellowFinBluebelly.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class YellowFinBluebelly : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public YellowFinBluebelly()
|
||||
: base(0x3B07)
|
||||
{
|
||||
}
|
||||
|
||||
public YellowFinBluebelly(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073831;
|
||||
}
|
||||
}// A Yellow Fin Bluebelly
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
190
Scripts/Items/Addons/Aquarium/FishBowl.cs
Normal file
190
Scripts/Items/Addons/Aquarium/FishBowl.cs
Normal file
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FishBowl : BaseContainer
|
||||
{
|
||||
[Constructable]
|
||||
public FishBowl()
|
||||
: base(0x241C)
|
||||
{
|
||||
this.Hue = 0x47E;
|
||||
this.MaxItems = 1;
|
||||
}
|
||||
|
||||
public FishBowl(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074499;
|
||||
}
|
||||
}// A fish bowl
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Empty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.Items.Count == 0);
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseFish Fish
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.Empty)
|
||||
return null;
|
||||
|
||||
if (this.Items[0] is BaseFish)
|
||||
return (BaseFish)this.Items[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 2.0;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
|
||||
{
|
||||
if (!this.CheckHold(from, dropped, sendFullMessage, true))
|
||||
return false;
|
||||
|
||||
this.DropItem(dropped);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (!this.IsAccessibleTo(from))
|
||||
{
|
||||
from.SendLocalizedMessage(502436); // That is not accessible.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(dropped is BaseFish))
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container can not hold that type of object.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (base.OnDragDrop(from, dropped))
|
||||
{
|
||||
((BaseFish)dropped).StopTimer();
|
||||
this.InvalidateProperties();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckItemUse(Mobile from, Item item)
|
||||
{
|
||||
if (item != this)
|
||||
return false;
|
||||
|
||||
return base.CheckItemUse(from, item);
|
||||
}
|
||||
|
||||
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
|
||||
{
|
||||
if (item != this)
|
||||
{
|
||||
reject = LRReason.CannotLift;
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckLift(from, item, ref reject);
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
if (!this.Empty)
|
||||
{
|
||||
BaseFish fish = this.Fish;
|
||||
|
||||
if (fish != null)
|
||||
list.Add(1074494, "#{0}", fish.LabelNumber); // Contains: ~1_CREATURE~
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (!this.Empty && this.IsAccessibleTo(from))
|
||||
list.Add(new RemoveCreature(this));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
this.Weight = this.DefaultWeight;
|
||||
}
|
||||
|
||||
private class RemoveCreature : ContextMenuEntry
|
||||
{
|
||||
private readonly FishBowl m_Bowl;
|
||||
public RemoveCreature(FishBowl bowl)
|
||||
: base(6242, 3)// Remove creature
|
||||
{
|
||||
this.m_Bowl = bowl;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (this.m_Bowl == null || this.m_Bowl.Deleted || !this.m_Bowl.IsAccessibleTo(this.Owner.From))
|
||||
return;
|
||||
|
||||
BaseFish fish = this.m_Bowl.Fish;
|
||||
|
||||
if (fish != null)
|
||||
{
|
||||
if (fish.IsLockedDown) // for legacy fish bowls
|
||||
{
|
||||
this.Owner.From.SendLocalizedMessage(1010449); // You may not use this object while it is locked down.
|
||||
}
|
||||
else if (!this.Owner.From.PlaceInBackpack(fish))
|
||||
{
|
||||
this.Owner.From.SendLocalizedMessage(1074496); // There is no room in your pack for the creature.
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Owner.From.SendLocalizedMessage(1074495); // The creature has been removed from the fish bowl.
|
||||
fish.StartTimer();
|
||||
this.m_Bowl.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Reward Fish/BrineShrimp.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Reward Fish/BrineShrimp.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BrineShrimp : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public BrineShrimp()
|
||||
: base(0x3B11)
|
||||
{
|
||||
}
|
||||
|
||||
public BrineShrimp(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074415;
|
||||
}
|
||||
}// Brine shrimp
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Reward Fish/Coral.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Reward Fish/Coral.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Coral : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public Coral()
|
||||
: base(Utility.RandomList(0x3AF9, 0x3AFA, 0x3AFB))
|
||||
{
|
||||
}
|
||||
|
||||
public Coral(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074588;
|
||||
}
|
||||
}// Coral
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Reward Fish/FullMoonFish.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Reward Fish/FullMoonFish.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FullMoonFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public FullMoonFish()
|
||||
: base(0x3B15)
|
||||
{
|
||||
}
|
||||
|
||||
public FullMoonFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074597;
|
||||
}
|
||||
}// A Full Moon Fish
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Addons/Aquarium/Reward Fish/SeaHorse.cs
Normal file
39
Scripts/Items/Addons/Aquarium/Reward Fish/SeaHorse.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SeaHorseFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public SeaHorseFish()
|
||||
: base(0x3B10)
|
||||
{
|
||||
}
|
||||
|
||||
public SeaHorseFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074414;
|
||||
}
|
||||
}// A sea horse
|
||||
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,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrippedFlakeFish : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public StrippedFlakeFish()
|
||||
: base(0x3B0A)
|
||||
{
|
||||
}
|
||||
|
||||
public StrippedFlakeFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074595;
|
||||
}
|
||||
}// Stripped Flake Fish
|
||||
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,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrippedSosarianSwill : BaseFish
|
||||
{
|
||||
[Constructable]
|
||||
public StrippedSosarianSwill()
|
||||
: base(0x3B0A)
|
||||
{
|
||||
}
|
||||
|
||||
public StrippedSosarianSwill(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074594;
|
||||
}
|
||||
}// Stripped Sosarian Swill
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Addons/Aquarium/Rewards/AquariumMessage.cs
Normal file
46
Scripts/Items/Addons/Aquarium/Rewards/AquariumMessage.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AquariumMessage : MessageInABottle
|
||||
{
|
||||
[Constructable]
|
||||
public AquariumMessage()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public AquariumMessage(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073894;
|
||||
}
|
||||
}// Message in a Bottle
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CaptainBlackheartsFishingPole : FishingPole
|
||||
{
|
||||
[Constructable]
|
||||
public CaptainBlackheartsFishingPole()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public CaptainBlackheartsFishingPole(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074571;
|
||||
}
|
||||
}// Captain Blackheart's Fishing Pole
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
95
Scripts/Items/Addons/Aquarium/Rewards/CraftysFishingHat.cs
Normal file
95
Scripts/Items/Addons/Aquarium/Rewards/CraftysFishingHat.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CraftysFishingHat : BaseHat
|
||||
{
|
||||
[Constructable]
|
||||
public CraftysFishingHat()
|
||||
: base(0x1713)
|
||||
{
|
||||
}
|
||||
|
||||
public CraftysFishingHat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074572;
|
||||
}
|
||||
}// Crafty's Fishing Hat
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int InitMinHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
public override int InitMaxHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Addons/Aquarium/Rewards/FishBones.cs
Normal file
53
Scripts/Items/Addons/Aquarium/Rewards/FishBones.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FishBones : Item
|
||||
{
|
||||
[Constructable]
|
||||
public FishBones()
|
||||
: base(0x3B0C)
|
||||
{
|
||||
}
|
||||
|
||||
public FishBones(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074601;
|
||||
}
|
||||
}// Fish bones
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Addons/Aquarium/Rewards/IslandStatue.cs
Normal file
53
Scripts/Items/Addons/Aquarium/Rewards/IslandStatue.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class IslandStatue : Item
|
||||
{
|
||||
[Constructable]
|
||||
public IslandStatue()
|
||||
: base(0x3B0F)
|
||||
{
|
||||
}
|
||||
|
||||
public IslandStatue(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074600;
|
||||
}
|
||||
}// An island statue
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Addons/Aquarium/Rewards/Shell.cs
Normal file
53
Scripts/Items/Addons/Aquarium/Rewards/Shell.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Shell : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Shell()
|
||||
: base(Utility.RandomList(0x3B12, 0x3B13))
|
||||
{
|
||||
}
|
||||
|
||||
public Shell(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074598;
|
||||
}
|
||||
}// A shell
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Scripts/Items/Addons/Aquarium/Rewards/ToyBoat.cs
Normal file
54
Scripts/Items/Addons/Aquarium/Rewards/ToyBoat.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x14F3, 0x14F4)]
|
||||
public class ToyBoat : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ToyBoat()
|
||||
: base(0x14F4)
|
||||
{
|
||||
}
|
||||
|
||||
public ToyBoat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074363;
|
||||
}
|
||||
}// A toy boat
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Scripts/Items/Addons/Aquarium/Rewards/WaterloggedBoots.cs
Normal file
58
Scripts/Items/Addons/Aquarium/Rewards/WaterloggedBoots.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WaterloggedBoots : BaseShoes
|
||||
{
|
||||
[Constructable]
|
||||
public WaterloggedBoots()
|
||||
: base(0x1711)
|
||||
{
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
// thigh boots
|
||||
this.ItemID = 0x1711;
|
||||
this.Weight = 4.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// boots
|
||||
this.ItemID = 0x170B;
|
||||
this.Weight = 3.0;
|
||||
}
|
||||
}
|
||||
|
||||
public WaterloggedBoots(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074364;
|
||||
}
|
||||
}// Waterlogged boots
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1073634); // An aquarium decoration
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Scripts/Items/Addons/Aquarium/VacationWafer.cs
Normal file
50
Scripts/Items/Addons/Aquarium/VacationWafer.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class VacationWafer : Item
|
||||
{
|
||||
public const int VacationDays = 7;
|
||||
[Constructable]
|
||||
public VacationWafer()
|
||||
: base(0x973)
|
||||
{
|
||||
}
|
||||
|
||||
public VacationWafer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074431;
|
||||
}
|
||||
}// An aquarium flake sphere
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1074432, VacationDays.ToString()); // Vacation days: ~1_DAYS~
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version < 1 && this.ItemID == 0x971)
|
||||
this.ItemID = 0x973;
|
||||
}
|
||||
}
|
||||
}
|
||||
205
Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs
Normal file
205
Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArcaneBookShelfAddonEast : BaseAddonContainer
|
||||
{
|
||||
public override BaseAddonContainerDeed Deed { get { return new ArcaneBookShelfDeedEast(); } }
|
||||
public override bool RetainDeedHue { get { return true; } }
|
||||
public override int DefaultGumpID { get { return 0x107; } }
|
||||
public override int DefaultDropSound { get { return 0x42; } }
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public ArcaneBookShelfAddonEast()
|
||||
: base(0x3086)
|
||||
{
|
||||
AddComponent(new AddonContainerComponent(0x3087), 0, -1, 0);
|
||||
}
|
||||
|
||||
public ArcaneBookShelfAddonEast(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookShelfDeedEast : BaseAddonContainerDeed
|
||||
{
|
||||
public override BaseAddonContainer Addon { get { return new ArcaneBookShelfAddonEast(); } }
|
||||
public override int LabelNumber { get { return 1073371; } } // arcane bookshelf (east)
|
||||
|
||||
[Constructable]
|
||||
public ArcaneBookShelfDeedEast()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneBookShelfDeedEast(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookshelfEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneBookshelfEastAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x3084), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x3085), -1, 0, 0);
|
||||
}
|
||||
|
||||
public ArcaneBookshelfEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneBookshelfEastDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), Replace);
|
||||
}
|
||||
|
||||
private void Replace()
|
||||
{
|
||||
Server.Multis.BaseHouse house = Server.Multis.BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
Point3D p = this.Location;
|
||||
Map map = this.Map;
|
||||
|
||||
house.Addons.Remove(this);
|
||||
Delete();
|
||||
|
||||
var addon = new ArcaneBookShelfAddonSouth();
|
||||
addon.MoveToWorld(p, map);
|
||||
house.Addons[addon] = house.Owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookshelfEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneBookshelfEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneBookshelfEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneBookshelfEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073371;
|
||||
}
|
||||
}// arcane bookshelf (east)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), Replace);
|
||||
}
|
||||
|
||||
private void Replace()
|
||||
{
|
||||
Container c = this.Parent as Container;
|
||||
|
||||
if (c != null)
|
||||
{
|
||||
var deed = new ArcaneBookShelfDeedEast();
|
||||
c.DropItem(deed);
|
||||
}
|
||||
else if (this.Parent == null)
|
||||
{
|
||||
Server.Multis.BaseHouse house = Server.Multis.BaseHouse.FindHouseAt(this);
|
||||
|
||||
var deed = new ArcaneBookShelfDeedEast();
|
||||
deed.MoveToWorld(this.Location, this.Map);
|
||||
|
||||
deed.IsLockedDown = IsLockedDown;
|
||||
deed.IsSecure = IsSecure;
|
||||
deed.Movable = Movable;
|
||||
|
||||
if (house != null && house.LockDowns.ContainsKey(this))
|
||||
{
|
||||
house.LockDowns.Remove(this);
|
||||
house.LockDowns.Add(deed, house.Owner);
|
||||
}
|
||||
else if (house != null && house.IsSecure(this))
|
||||
{
|
||||
house.ReleaseSecure(house.Owner, this);
|
||||
house.AddSecure(house.Owner, deed);
|
||||
}
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
205
Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs
Normal file
205
Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArcaneBookShelfAddonSouth : BaseAddonContainer
|
||||
{
|
||||
public override BaseAddonContainerDeed Deed { get { return new ArcaneBookShelfDeedSouth(); } }
|
||||
public override bool RetainDeedHue { get { return true; } }
|
||||
public override int DefaultGumpID { get { return 0x107; } }
|
||||
public override int DefaultDropSound { get { return 0x42; } }
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public ArcaneBookShelfAddonSouth()
|
||||
: base(0x3084)
|
||||
{
|
||||
AddComponent(new AddonContainerComponent(0x3085), -1, 0, 0);
|
||||
}
|
||||
|
||||
public ArcaneBookShelfAddonSouth(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookShelfDeedSouth : BaseAddonContainerDeed
|
||||
{
|
||||
public override BaseAddonContainer Addon { get { return new ArcaneBookShelfAddonSouth(); } }
|
||||
public override int LabelNumber { get { return 1072871; } } // arcane bookshelf (south)
|
||||
|
||||
[Constructable]
|
||||
public ArcaneBookShelfDeedSouth()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneBookShelfDeedSouth(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookshelfSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneBookshelfSouthAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x3087), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x3086), 0, 1, 0);
|
||||
}
|
||||
|
||||
public ArcaneBookshelfSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneBookshelfSouthDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), Replace);
|
||||
}
|
||||
|
||||
private void Replace()
|
||||
{
|
||||
Server.Multis.BaseHouse house = Server.Multis.BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
Point3D p = this.Location;
|
||||
Map map = this.Map;
|
||||
|
||||
house.Addons.Remove(this);
|
||||
Delete();
|
||||
|
||||
var addon = new ArcaneBookShelfAddonEast();
|
||||
addon.MoveToWorld(new Point3D(p.X, p.Y + 1, p.Z), map);
|
||||
house.Addons[addon] = house.Owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneBookshelfSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneBookshelfSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneBookshelfSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneBookshelfSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072871;
|
||||
}
|
||||
}// arcane bookshelf (south)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), Replace);
|
||||
}
|
||||
|
||||
private void Replace()
|
||||
{
|
||||
Container c = this.Parent as Container;
|
||||
|
||||
if (c != null)
|
||||
{
|
||||
var deed = new ArcaneBookShelfDeedSouth();
|
||||
c.DropItem(deed);
|
||||
}
|
||||
else if (this.Parent == null)
|
||||
{
|
||||
Server.Multis.BaseHouse house = Server.Multis.BaseHouse.FindHouseAt(this);
|
||||
|
||||
var deed = new ArcaneBookShelfDeedSouth();
|
||||
deed.MoveToWorld(this.Location, this.Map);
|
||||
|
||||
deed.IsLockedDown = IsLockedDown;
|
||||
deed.IsSecure = IsSecure;
|
||||
deed.Movable = Movable;
|
||||
|
||||
if (house != null && house.LockDowns.ContainsKey(this))
|
||||
{
|
||||
house.LockDowns.Remove(this);
|
||||
house.LockDowns.Add(deed, house.Owner);
|
||||
}
|
||||
else if (house != null && house.IsSecure(this))
|
||||
{
|
||||
house.ReleaseSecure(house.Owner, this);
|
||||
house.AddSecure(house.Owner, deed);
|
||||
}
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/Items/Addons/ArcaneCircleAddon.cs
Normal file
103
Scripts/Items/Addons/ArcaneCircleAddon.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArcaneCircleAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneCircleAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x3083), -1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x3080), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x3082), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x3081), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x307D), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x307F), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x307E), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x307C), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x307B), 1, 1, 0);
|
||||
}
|
||||
|
||||
public ArcaneCircleAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneCircleDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if (version == 0)
|
||||
ValidationQueue<ArcaneCircleAddon>.Add(this);
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
foreach (AddonComponent c in this.Components)
|
||||
{
|
||||
if (c.ItemID == 0x3083)
|
||||
{
|
||||
c.Offset = new Point3D(-1, -1, 0);
|
||||
c.MoveToWorld(new Point3D(this.X + c.Offset.X, this.Y + c.Offset.Y, this.Z + c.Offset.Z), this.Map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcaneCircleDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public ArcaneCircleDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneCircleDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcaneCircleAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072703;
|
||||
}
|
||||
}// arcane circle
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
80
Scripts/Items/Addons/ArcanistStatueEastAddon.cs
Normal file
80
Scripts/Items/Addons/ArcanistStatueEastAddon.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArcanistStatueEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcanistStatueEastAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x2D0E), 0, 0, 0);
|
||||
}
|
||||
|
||||
public ArcanistStatueEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcanistStatueEastDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcanistStatueEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public ArcanistStatueEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcanistStatueEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcanistStatueEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072886;
|
||||
}
|
||||
}// arcanist statue (east)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
80
Scripts/Items/Addons/ArcanistStatueSouthAddon.cs
Normal file
80
Scripts/Items/Addons/ArcanistStatueSouthAddon.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArcanistStatueSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcanistStatueSouthAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x2D0F), 0, 0, 0);
|
||||
}
|
||||
|
||||
public ArcanistStatueSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcanistStatueSouthDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcanistStatueSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public ArcanistStatueSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcanistStatueSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcanistStatueSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072885;
|
||||
}
|
||||
}// arcanist statue (south)
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
494
Scripts/Items/Addons/ArcheryButteAddon.cs
Normal file
494
Scripts/Items/Addons/ArcheryButteAddon.cs
Normal file
@@ -0,0 +1,494 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x100A/*East*/, 0x100B/*South*/)]
|
||||
public class ArcheryButte : AddonComponent
|
||||
{
|
||||
private static readonly TimeSpan UseDelay = TimeSpan.FromSeconds(2.0);
|
||||
|
||||
private double m_MinSkill;
|
||||
private double m_MaxSkill;
|
||||
private int m_Arrows, m_Bolts;
|
||||
private DateTime m_LastUse;
|
||||
private Hashtable m_Entries;
|
||||
|
||||
public ArcheryButte()
|
||||
: this(0x100A)
|
||||
{
|
||||
}
|
||||
|
||||
public ArcheryButte(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
m_MinSkill = -25.0;
|
||||
m_MaxSkill = +25.0;
|
||||
}
|
||||
|
||||
public ArcheryButte(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public double MinSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MinSkill;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_MinSkill = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public double MaxSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MaxSkill;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_MaxSkill = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime LastUse
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_LastUse;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_LastUse = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool FacingEast
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ItemID == 0x100A);
|
||||
}
|
||||
set
|
||||
{
|
||||
ItemID = value ? 0x100A : 0x100B;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Arrows
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Arrows;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Arrows = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Bolts
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bolts;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bolts = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if ((from.Weapon is Boomerang || from.Weapon is Cyclone || from.Weapon is BaseThrown) && from.InRange(GetWorldLocation(), 1))
|
||||
Fire(from);
|
||||
if ((m_Arrows > 0 || m_Bolts > 0) && from.InRange(GetWorldLocation(), 1))
|
||||
Gather(from);
|
||||
else
|
||||
Fire(from);
|
||||
}
|
||||
|
||||
public void Gather(Mobile from)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500592); // You gather the arrows and bolts.
|
||||
|
||||
if (m_Arrows > 0)
|
||||
from.AddToBackpack(new Arrow(m_Arrows));
|
||||
|
||||
if (m_Bolts > 0)
|
||||
from.AddToBackpack(new Bolt(m_Bolts));
|
||||
|
||||
m_Arrows = 0;
|
||||
m_Bolts = 0;
|
||||
|
||||
m_Entries = null;
|
||||
}
|
||||
|
||||
public void Fire(Mobile from)
|
||||
{
|
||||
BaseRanged ranged = from.Weapon as BaseRanged;
|
||||
|
||||
if (ranged == null)
|
||||
{
|
||||
SendLocalizedMessageTo(from, 500593); // You must practice with ranged weapons on
|
||||
return;
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow < (m_LastUse + UseDelay))
|
||||
return;
|
||||
|
||||
Point3D worldLoc = GetWorldLocation();
|
||||
|
||||
if (FacingEast ? from.X <= worldLoc.X : from.Y <= worldLoc.Y)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500596); // You would do better to stand in front of the archery butte.
|
||||
return;
|
||||
}
|
||||
|
||||
if (FacingEast ? from.Y != worldLoc.Y : from.X != worldLoc.X)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500597); // You aren't properly lined up with the archery butte to get an accurate shot.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.InRange(worldLoc, 6))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500598); // You are too far away from the archery butte to get an accurate shot.
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(worldLoc, 4))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500599); // You are too close to the target.
|
||||
return;
|
||||
}
|
||||
|
||||
Type ammoType = ranged.AmmoType;
|
||||
|
||||
bool isArrow = (ammoType == typeof(Arrow));
|
||||
bool isBolt = (ammoType == typeof(Bolt));
|
||||
|
||||
BaseThrown thrown = ranged as BaseThrown;
|
||||
|
||||
if (ammoType == null && thrown == null)
|
||||
{
|
||||
isArrow = ranged.Animation == WeaponAnimation.ShootBow;
|
||||
isBolt = ranged.Animation == WeaponAnimation.ShootXBow;
|
||||
}
|
||||
|
||||
bool isKnown = (isArrow || isBolt);
|
||||
|
||||
if (thrown == null)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (pack == null || ammoType == null || !pack.ConsumeTotal(ammoType, 1))
|
||||
{
|
||||
if (isArrow)
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500594); // You do not have any arrows with which to practice.
|
||||
else if (isBolt)
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500595); // You do not have any crossbow bolts with which to practice.
|
||||
else
|
||||
SendLocalizedMessageTo(from, 500593); // You must practice with ranged weapons on
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_LastUse = DateTime.UtcNow;
|
||||
|
||||
from.MovingEffect(this, ranged.EffectID, 18, 1, false, false);
|
||||
from.Direction = from.GetDirectionTo(GetWorldLocation());
|
||||
ranged.PlaySwingAnimation(from);
|
||||
|
||||
ScoreEntry se = GetEntryFor(from);
|
||||
|
||||
if (!from.CheckSkill(ranged.Skill, m_MinSkill, m_MaxSkill))
|
||||
{
|
||||
from.PlaySound(ranged.MissSound);
|
||||
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 500604, from.Name); // You miss the target altogether.
|
||||
|
||||
se.Record(0);
|
||||
|
||||
if (se.Count == 1)
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1062719, se.Total.ToString());
|
||||
else
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1042683, String.Format("{0}\t{1}", se.Total, se.Count));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.PlaySound(Location, Map, 0x2B1);
|
||||
|
||||
double rand = Utility.RandomDouble();
|
||||
|
||||
int area, score, splitScore;
|
||||
|
||||
if (0.10 > rand)
|
||||
{
|
||||
area = 0; // bullseye
|
||||
score = 50;
|
||||
splitScore = 100;
|
||||
}
|
||||
else if (0.25 > rand)
|
||||
{
|
||||
area = 1; // inner ring
|
||||
score = 10;
|
||||
splitScore = 20;
|
||||
}
|
||||
else if (0.50 > rand)
|
||||
{
|
||||
area = 2; // middle ring
|
||||
score = 5;
|
||||
splitScore = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
area = 3; // outer ring
|
||||
score = 2;
|
||||
splitScore = 5;
|
||||
}
|
||||
|
||||
bool split = (isKnown && ((m_Arrows + m_Bolts) * 0.02) > Utility.RandomDouble());
|
||||
|
||||
if (split)
|
||||
{
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1010027 + area, String.Format("{0}\t{1}", from.Name, isArrow ? "arrow" : "bolt"));
|
||||
}
|
||||
else
|
||||
{
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1010035 + area, from.Name);
|
||||
|
||||
if(ammoType != null)
|
||||
{
|
||||
if (isArrow)
|
||||
++m_Arrows;
|
||||
else if (isBolt)
|
||||
++m_Bolts;
|
||||
}
|
||||
}
|
||||
|
||||
se.Record(split ? splitScore : score);
|
||||
|
||||
if (se.Count == 1)
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1062719, se.Total.ToString());
|
||||
else
|
||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, 1042683, String.Format("{0}\t{1}", se.Total, se.Count));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_MinSkill);
|
||||
writer.Write(m_MaxSkill);
|
||||
writer.Write(m_Arrows);
|
||||
writer.Write(m_Bolts);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_MinSkill = reader.ReadDouble();
|
||||
m_MaxSkill = reader.ReadDouble();
|
||||
m_Arrows = reader.ReadInt();
|
||||
m_Bolts = reader.ReadInt();
|
||||
|
||||
if (m_MinSkill == 0.0 && m_MaxSkill == 30.0)
|
||||
{
|
||||
m_MinSkill = -25.0;
|
||||
m_MaxSkill = +25.0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ScoreEntry GetEntryFor(Mobile from)
|
||||
{
|
||||
if (m_Entries == null)
|
||||
m_Entries = new Hashtable();
|
||||
|
||||
ScoreEntry e = (ScoreEntry)m_Entries[from];
|
||||
|
||||
if (e == null)
|
||||
m_Entries[from] = e = new ScoreEntry();
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
private class ScoreEntry
|
||||
{
|
||||
private int m_Total;
|
||||
private int m_Count;
|
||||
|
||||
public int Total
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Total;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Total = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Count;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Count = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Record(int score)
|
||||
{
|
||||
m_Total += score;
|
||||
m_Count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcheryButteAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ArcheryButteAddon(AddonFacing facing)
|
||||
{
|
||||
switch (facing)
|
||||
{
|
||||
case AddonFacing.East:
|
||||
AddComponent(new ArcheryButte(0x100A), 0, 0, 0);
|
||||
break;
|
||||
case AddonFacing.South:
|
||||
AddComponent(new ArcheryButte(0x100B), 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public ArcheryButteAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcheryButteDeed();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ArcheryButteDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
private AddonFacing Facing { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public ArcheryButteDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public ArcheryButteDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArcheryButteAddon(Facing);
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1080205;
|
||||
}
|
||||
}// archery butte
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)AddonFacing.South, 1080204);
|
||||
list.Add((int)AddonFacing.East, 1080203);
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
Facing = (AddonFacing)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
219
Scripts/Items/Addons/AwesomeDisturbingPortrait.cs
Normal file
219
Scripts/Items/Addons/AwesomeDisturbingPortrait.cs
Normal file
@@ -0,0 +1,219 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x2A5D, 0x2A61)]
|
||||
public class AwesomeDisturbingPortraitComponent : AddonComponent
|
||||
{
|
||||
private InternalTimer m_Timer;
|
||||
public AwesomeDisturbingPortraitComponent()
|
||||
: base(0x2A5D)
|
||||
{
|
||||
this.m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(1));
|
||||
this.m_Timer.Start();
|
||||
}
|
||||
|
||||
public AwesomeDisturbingPortraitComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074479;
|
||||
}
|
||||
}// Disturbing portrait
|
||||
public bool FacingSouth
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ItemID < 0x2A61;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Utility.InRange(this.Location, from.Location, 2))
|
||||
{
|
||||
int hours;
|
||||
int minutes;
|
||||
|
||||
Clock.GetTime(this.Map, this.X, this.Y, out hours, out minutes);
|
||||
|
||||
if (hours < 4 || hours > 20)
|
||||
Effects.PlaySound(this.Location, this.Map, 0x569);
|
||||
|
||||
this.UpdateImage();
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (this.m_Timer != null && this.m_Timer.Running)
|
||||
this.m_Timer.Stop();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Timer = new InternalTimer(this, TimeSpan.Zero);
|
||||
this.m_Timer.Start();
|
||||
}
|
||||
|
||||
private void UpdateImage()
|
||||
{
|
||||
int hours;
|
||||
int minutes;
|
||||
|
||||
Clock.GetTime(this.Map, this.X, this.Y, out hours, out minutes);
|
||||
|
||||
if (this.FacingSouth)
|
||||
{
|
||||
if (hours < 4)
|
||||
this.ItemID = 0x2A60;
|
||||
else if (hours < 6)
|
||||
this.ItemID = 0x2A5F;
|
||||
else if (hours < 8)
|
||||
this.ItemID = 0x2A5E;
|
||||
else if (hours < 16)
|
||||
this.ItemID = 0x2A5D;
|
||||
else if (hours < 18)
|
||||
this.ItemID = 0x2A5E;
|
||||
else if (hours < 20)
|
||||
this.ItemID = 0x2A5F;
|
||||
else
|
||||
this.ItemID = 0x2A60;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hours < 4)
|
||||
this.ItemID = 0x2A64;
|
||||
else if (hours < 6)
|
||||
this.ItemID = 0x2A63;
|
||||
else if (hours < 8)
|
||||
this.ItemID = 0x2A62;
|
||||
else if (hours < 16)
|
||||
this.ItemID = 0x2A61;
|
||||
else if (hours < 18)
|
||||
this.ItemID = 0x2A62;
|
||||
else if (hours < 20)
|
||||
this.ItemID = 0x2A63;
|
||||
else
|
||||
this.ItemID = 0x2A64;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly AwesomeDisturbingPortraitComponent m_Component;
|
||||
public InternalTimer(AwesomeDisturbingPortraitComponent c, TimeSpan delay)
|
||||
: base(delay, TimeSpan.FromMinutes(10))
|
||||
{
|
||||
this.m_Component = c;
|
||||
|
||||
this.Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (this.m_Component != null && !this.m_Component.Deleted)
|
||||
this.m_Component.UpdateImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AwesomeDisturbingPortraitAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public AwesomeDisturbingPortraitAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new AwesomeDisturbingPortraitComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public AwesomeDisturbingPortraitAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AwesomeDisturbingPortraitDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AwesomeDisturbingPortraitDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public AwesomeDisturbingPortraitDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public AwesomeDisturbingPortraitDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AwesomeDisturbingPortraitAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074479;
|
||||
}
|
||||
}// Disturbing portrait
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
442
Scripts/Items/Addons/BallotBox.cs
Normal file
442
Scripts/Items/Addons/BallotBox.cs
Normal file
@@ -0,0 +1,442 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BallotBox : AddonComponent
|
||||
{
|
||||
public static readonly int MaxTopicLines = 6;
|
||||
private string[] m_Topic;
|
||||
private List<Mobile> m_Yes;
|
||||
private List<Mobile> m_No;
|
||||
[Constructable]
|
||||
public BallotBox()
|
||||
: base(0x9A8)
|
||||
{
|
||||
this.m_Topic = new string[0];
|
||||
this.m_Yes = new List<Mobile>();
|
||||
this.m_No = new List<Mobile>();
|
||||
}
|
||||
|
||||
public BallotBox(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041006;
|
||||
}
|
||||
}// a ballot box
|
||||
public string[] Topic
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Topic;
|
||||
}
|
||||
}
|
||||
public List<Mobile> Yes
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Yes;
|
||||
}
|
||||
}
|
||||
public List<Mobile> No
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_No;
|
||||
}
|
||||
}
|
||||
public void ClearTopic()
|
||||
{
|
||||
this.m_Topic = new string[0];
|
||||
|
||||
this.ClearVotes();
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public void AddLineToTopic(string line)
|
||||
{
|
||||
if (this.m_Topic.Length >= MaxTopicLines)
|
||||
return;
|
||||
|
||||
string[] newTopic = new string[this.m_Topic.Length + 1];
|
||||
this.m_Topic.CopyTo(newTopic, 0);
|
||||
newTopic[this.m_Topic.Length] = line;
|
||||
|
||||
this.m_Topic = newTopic;
|
||||
|
||||
this.ClearVotes();
|
||||
}
|
||||
|
||||
public void ClearVotes()
|
||||
{
|
||||
this.Yes.Clear();
|
||||
this.No.Clear();
|
||||
}
|
||||
|
||||
public bool IsOwner(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster)
|
||||
return true;
|
||||
|
||||
if (Owner != null && from == Owner)
|
||||
return true;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
return (house != null && house.IsOwner(from));
|
||||
}
|
||||
|
||||
public bool HasVoted(Mobile from)
|
||||
{
|
||||
return (this.Yes.Contains(from) || this.No.Contains(from));
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
this.SendLocalizedMessageTo(from, 500369); // I'm a ballot box, not a container!
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isOwner = this.IsOwner(from);
|
||||
from.SendGump(new InternalGump(this, isOwner));
|
||||
}
|
||||
}
|
||||
|
||||
public void SendGumpTo(Mobile m)
|
||||
{
|
||||
if (IsOwner(m))
|
||||
m.SendGump(new InternalGump(this, true));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
|
||||
writer.Write(Owner);
|
||||
|
||||
writer.WriteEncodedInt(this.m_Topic.Length);
|
||||
|
||||
for (int i = 0; i < this.m_Topic.Length; i++)
|
||||
writer.Write((string)this.m_Topic[i]);
|
||||
|
||||
writer.Write(this.m_Yes, true);
|
||||
writer.Write(this.m_No, true);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
Owner = reader.ReadMobile();
|
||||
goto case 0;
|
||||
case 0:
|
||||
this.m_Topic = new string[reader.ReadEncodedInt()];
|
||||
|
||||
for (int i = 0; i < this.m_Topic.Length; i++)
|
||||
this.m_Topic[i] = reader.ReadString();
|
||||
|
||||
this.m_Yes = reader.ReadStrongMobileList();
|
||||
this.m_No = reader.ReadStrongMobileList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly BallotBox m_Box;
|
||||
public InternalGump(BallotBox box, bool isOwner)
|
||||
: base(110, 70)
|
||||
{
|
||||
this.m_Box = box;
|
||||
|
||||
this.AddBackground(0, 0, 400, 350, 0xA28);
|
||||
|
||||
if (isOwner)
|
||||
this.AddHtmlLocalized(0, 15, 400, 35, 1011000, false, false); // <center>Ballot Box Owner's Menu</center>
|
||||
else
|
||||
this.AddHtmlLocalized(0, 15, 400, 35, 1011001, false, false); // <center>Ballot Box -- Vote Here!</center>
|
||||
|
||||
this.AddHtmlLocalized(0, 50, 400, 35, 1011002, false, false); // <center>Topic</center>
|
||||
|
||||
int lineCount = box.Topic.Length;
|
||||
this.AddBackground(25, 90, 350, Math.Max(20 * lineCount, 20), 0x1400);
|
||||
|
||||
for (int i = 0; i < lineCount; i++)
|
||||
{
|
||||
string line = box.Topic[i];
|
||||
|
||||
if (!String.IsNullOrEmpty(line))
|
||||
this.AddLabelCropped(30, 90 + i * 20, 340, 20, 0x3E3, line);
|
||||
}
|
||||
|
||||
int yesCount = box.Yes.Count;
|
||||
int noCount = box.No.Count;
|
||||
int totalVotes = yesCount + noCount;
|
||||
|
||||
this.AddHtmlLocalized(0, 215, 400, 35, 1011003, false, false); // <center>votes</center>
|
||||
|
||||
if (!isOwner)
|
||||
this.AddButton(20, 240, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(55, 242, 25, 35, 1011004, false, false); // aye:
|
||||
this.AddLabel(78, 242, 0x0, String.Format("[{0}]", yesCount));
|
||||
|
||||
if (!isOwner)
|
||||
this.AddButton(20, 275, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(55, 277, 25, 35, 1011005, false, false); // nay:
|
||||
this.AddLabel(78, 277, 0x0, String.Format("[{0}]", noCount));
|
||||
|
||||
if (totalVotes > 0)
|
||||
{
|
||||
this.AddImageTiled(130, 242, (yesCount * 225) / totalVotes, 10, 0xD6);
|
||||
this.AddImageTiled(130, 277, (noCount * 225) / totalVotes, 10, 0xD6);
|
||||
}
|
||||
|
||||
this.AddButton(45, 305, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(80, 308, 40, 35, 1011008, false, false); // done
|
||||
|
||||
if (isOwner)
|
||||
{
|
||||
this.AddButton(120, 305, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(155, 308, 100, 35, 1011006, false, false); // change topic
|
||||
|
||||
this.AddButton(240, 305, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(275, 308, 300, 100, 1011007, false, false); // reset votes
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Box.Deleted || info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (from.Map != this.m_Box.Map || !from.InRange(this.m_Box.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
bool isOwner = this.m_Box.IsOwner(from);
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 1: // change topic
|
||||
{
|
||||
if (isOwner)
|
||||
{
|
||||
this.m_Box.ClearTopic();
|
||||
|
||||
from.SendLocalizedMessage(500370, "", 0x35); // Enter a line of text for your ballot, and hit ENTER. Hit ESC after the last line is entered.
|
||||
from.Prompt = new TopicPrompt(this.m_Box);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // reset votes
|
||||
{
|
||||
if (isOwner)
|
||||
{
|
||||
this.m_Box.ClearVotes();
|
||||
from.SendLocalizedMessage(500371); // Votes zeroed out.
|
||||
}
|
||||
|
||||
goto default;
|
||||
}
|
||||
case 3: // aye
|
||||
{
|
||||
if (!isOwner)
|
||||
{
|
||||
if (this.m_Box.HasVoted(from))
|
||||
{
|
||||
from.SendLocalizedMessage(500374); // You have already voted on this ballot.
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Box.Yes.Add(from);
|
||||
from.SendLocalizedMessage(500373); // Your vote has been registered.
|
||||
}
|
||||
}
|
||||
|
||||
goto default;
|
||||
}
|
||||
case 4: // nay
|
||||
{
|
||||
if (!isOwner)
|
||||
{
|
||||
if (this.m_Box.HasVoted(from))
|
||||
{
|
||||
from.SendLocalizedMessage(500374); // You have already voted on this ballot.
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Box.No.Add(from);
|
||||
from.SendLocalizedMessage(500373); // Your vote has been registered.
|
||||
}
|
||||
}
|
||||
|
||||
goto default;
|
||||
}
|
||||
default:
|
||||
{
|
||||
from.SendGump(new InternalGump(this.m_Box, isOwner));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TopicPrompt : Prompt
|
||||
{
|
||||
private readonly BallotBox m_Box;
|
||||
public TopicPrompt(BallotBox box)
|
||||
{
|
||||
this.m_Box = box;
|
||||
}
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (this.m_Box.Deleted || !this.m_Box.IsOwner(from))
|
||||
return;
|
||||
|
||||
if (from.Map != this.m_Box.Map || !from.InRange(this.m_Box.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
this.m_Box.AddLineToTopic(text.TrimEnd());
|
||||
|
||||
if (this.m_Box.Topic.Length < MaxTopicLines)
|
||||
{
|
||||
from.SendLocalizedMessage(500377, "", 0x35); // Next line or ESC to finish:
|
||||
from.Prompt = new TopicPrompt(this.m_Box);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500376, "", 0x35); // Ballot entry complete.
|
||||
from.SendGump(new InternalGump(this.m_Box, true));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCancel(Mobile from)
|
||||
{
|
||||
if (this.m_Box.Deleted || !this.m_Box.IsOwner(from))
|
||||
return;
|
||||
|
||||
if (from.Map != this.m_Box.Map || !from.InRange(this.m_Box.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(500376, "", 0x35); // Ballot entry complete.
|
||||
from.SendGump(new InternalGump(this.m_Box, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BallotBoxAddon : BaseAddon
|
||||
{
|
||||
public BallotBoxAddon()
|
||||
{
|
||||
this.AddComponent(new BallotBox(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BallotBoxAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BallotBoxDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BallotBoxDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BallotBoxDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public BallotBoxDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BallotBoxAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044327;
|
||||
}
|
||||
}// ballot box
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
416
Scripts/Items/Addons/Banner.cs
Normal file
416
Scripts/Items/Addons/Banner.cs
Normal file
@@ -0,0 +1,416 @@
|
||||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Banner : Item, IAddon, IDyable, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public Banner(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Banner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return ObjectPropertyList.Enabled;
|
||||
}
|
||||
}
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
BannerDeed deed = new BannerDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public bool FacingSouth
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ItemID & 0x1) == 0;
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && m_IsRewardItem)
|
||||
list.Add(1076218); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
void IChopable.OnChop(Mobile user)
|
||||
{
|
||||
OnDoubleClick(user);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(Location, 2))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && house.IsOwner(from))
|
||||
{
|
||||
from.CloseGump(typeof(RewardDemolitionGump));
|
||||
from.SendGump(new RewardDemolitionGump(this, 1018318)); // Do you wish to re-deed this banner?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1018330); // You can only re-deed a banner if you placed it or you are the owner of the house.
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
if (map == null || !map.CanFit(p.X, p.Y, p.Z, ItemData.Height))
|
||||
return false;
|
||||
|
||||
if (FacingSouth)
|
||||
return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // north wall
|
||||
else
|
||||
return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // west wall
|
||||
}
|
||||
}
|
||||
|
||||
public class BannerDeed : Item, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public BannerDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BannerDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041007;
|
||||
}
|
||||
}// a banner deed
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_IsRewardItem)
|
||||
list.Add(1076218); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && house.IsOwner(from))
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public const int Start = 0x15AE;
|
||||
public const int End = 0x15F4;
|
||||
private readonly BannerDeed m_Banner;
|
||||
public InternalGump(BannerDeed banner)
|
||||
: base(100, 200)
|
||||
{
|
||||
m_Banner = banner;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(25, 0, 520, 230, 0xA28);
|
||||
AddLabel(70, 12, 0x3E3, "Choose a Banner:");
|
||||
|
||||
int itemID = Start;
|
||||
|
||||
for (int i = 1; i <= 5; i++)
|
||||
{
|
||||
AddPage(i);
|
||||
|
||||
for (int j = 0; j < 8; j++, itemID += 2)
|
||||
{
|
||||
AddItem(50 + 60 * j, 70, itemID);
|
||||
AddButton(50 + 60 * j, 50, 0x845, 0x846, itemID, GumpButtonType.Reply, 0);
|
||||
|
||||
if (itemID >= End)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i > 1)
|
||||
AddButton(75, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, i - 1);
|
||||
|
||||
if (i < 5)
|
||||
AddButton(475, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Banner == null || m_Banner.Deleted)
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if (info.ButtonID >= Start && info.ButtonID <= End)
|
||||
{
|
||||
if ((info.ButtonID & 0x1) == 0)
|
||||
{
|
||||
m.SendLocalizedMessage(1042037); // Where would you like to place this banner?
|
||||
m.Target = new InternalTarget(m_Banner, info.ButtonID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly BannerDeed m_Banner;
|
||||
private readonly int m_ItemID;
|
||||
public InternalTarget(BannerDeed banner, int itemID)
|
||||
: base(-1, true, TargetFlags.None)
|
||||
{
|
||||
m_Banner = banner;
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Banner == null || m_Banner.Deleted)
|
||||
return;
|
||||
|
||||
if (m_Banner.IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && house.IsOwner(from))
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if (p == null || map == null)
|
||||
return;
|
||||
|
||||
Point3D p3d = new Point3D(p);
|
||||
ItemData id = TileData.ItemTable[m_ItemID & TileData.MaxItemValue];
|
||||
|
||||
if (map.CanFit(p3d, id.Height))
|
||||
{
|
||||
house = BaseHouse.FindHouseAt(p3d, map, id.Height);
|
||||
|
||||
if (house != null && house.IsOwner(from))
|
||||
{
|
||||
bool north = BaseAddon.IsWall(p3d.X, p3d.Y - 1, p3d.Z, map);
|
||||
bool west = BaseAddon.IsWall(p3d.X - 1, p3d.Y, p3d.Z, map);
|
||||
|
||||
if (north && west)
|
||||
{
|
||||
from.CloseGump(typeof(FacingGump));
|
||||
from.SendGump(new FacingGump(m_Banner, m_ItemID, p3d, house));
|
||||
}
|
||||
else if (north || west)
|
||||
{
|
||||
Banner banner = null;
|
||||
|
||||
if (north)
|
||||
banner = new Banner(m_ItemID);
|
||||
else if (west)
|
||||
banner = new Banner(m_ItemID + 1);
|
||||
|
||||
house.Addons[banner] = from;
|
||||
|
||||
banner.IsRewardItem = m_Banner.IsRewardItem;
|
||||
banner.MoveToWorld(p3d, map);
|
||||
|
||||
m_Banner.Delete();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042039); // The banner must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042036); // That location is not in your house.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
private class FacingGump : Gump
|
||||
{
|
||||
private readonly BannerDeed m_Banner;
|
||||
private readonly int m_ItemID;
|
||||
private readonly Point3D m_Location;
|
||||
private readonly BaseHouse m_House;
|
||||
public FacingGump(BannerDeed banner, int itemID, Point3D location, BaseHouse house)
|
||||
: base(150, 50)
|
||||
{
|
||||
m_Banner = banner;
|
||||
m_ItemID = itemID;
|
||||
m_Location = location;
|
||||
m_House = house;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 300, 150, 0xA28);
|
||||
|
||||
AddItem(90, 30, itemID + 1);
|
||||
AddItem(180, 30, itemID);
|
||||
|
||||
AddButton(50, 35, 0x868, 0x869, (int)Buttons.East, GumpButtonType.Reply, 0);
|
||||
AddButton(145, 35, 0x868, 0x869, (int)Buttons.South, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
East,
|
||||
South
|
||||
}
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Banner == null || m_Banner.Deleted || m_House == null)
|
||||
return;
|
||||
|
||||
Banner banner = null;
|
||||
|
||||
if (info.ButtonID == (int)Buttons.East)
|
||||
banner = new Banner(m_ItemID + 1);
|
||||
if (info.ButtonID == (int)Buttons.South)
|
||||
banner = new Banner(m_ItemID);
|
||||
|
||||
if (banner != null)
|
||||
{
|
||||
m_House.Addons[banner] = sender.Mobile;
|
||||
|
||||
banner.IsRewardItem = m_Banner.IsRewardItem;
|
||||
banner.MoveToWorld(m_Location, sender.Mobile.Map);
|
||||
|
||||
m_Banner.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
345
Scripts/Items/Addons/BaseAddon.cs
Normal file
345
Scripts/Items/Addons/BaseAddon.cs
Normal file
@@ -0,0 +1,345 @@
|
||||
#region References
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.Multis;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum AddonFitResult
|
||||
{
|
||||
Valid,
|
||||
Blocked,
|
||||
NotInHouse,
|
||||
DoorTooClose,
|
||||
NoWall,
|
||||
DoorsNotClosed
|
||||
}
|
||||
|
||||
public interface IAddon : IEntity, IChopable
|
||||
{
|
||||
Item Deed { get; }
|
||||
|
||||
bool CouldFit(IPoint3D p, Map map);
|
||||
}
|
||||
|
||||
public abstract class BaseAddon : Item, IChopable, IAddon
|
||||
{
|
||||
#region Mondain's Legacy
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty(AccessLevel.Decorator)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set
|
||||
{
|
||||
if (m_Resource != value)
|
||||
{
|
||||
m_Resource = value;
|
||||
Hue = CraftResources.GetHue(m_Resource);
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private List<AddonComponent> m_Components;
|
||||
|
||||
public void AddComponent(AddonComponent c, int x, int y, int z)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Components.Add(c);
|
||||
|
||||
c.Addon = this;
|
||||
c.Offset = new Point3D(x, y, z);
|
||||
c.MoveToWorld(new Point3D(X + x, Y + y, Z + z), Map);
|
||||
}
|
||||
|
||||
public BaseAddon()
|
||||
: base(1)
|
||||
{
|
||||
Movable = false;
|
||||
Visible = false;
|
||||
|
||||
m_Components = new List<AddonComponent>();
|
||||
}
|
||||
|
||||
public void ApplyLight(LightType light)
|
||||
{
|
||||
Light = light;
|
||||
|
||||
foreach (var c in Components)
|
||||
{
|
||||
c.Light = light;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool RetainDeedHue { get { return Hue != 0 && CraftResources.GetHue(Resource) != Hue; } }
|
||||
|
||||
public virtual void OnChop(Mobile from)
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
#region High Seas
|
||||
var boat = BaseBoat.FindBoatAt(from, from.Map);
|
||||
if (boat != null && boat is BaseGalleon)
|
||||
{
|
||||
((BaseGalleon)boat).OnChop(this, from);
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (house != null && (house.IsOwner(from) || (house.Addons.ContainsKey(this) && house.Addons[this] == from)))
|
||||
{
|
||||
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
|
||||
var hue = 0;
|
||||
|
||||
if (RetainDeedHue)
|
||||
{
|
||||
for (var i = 0; hue == 0 && i < m_Components.Count; ++i)
|
||||
{
|
||||
var c = m_Components[i];
|
||||
|
||||
if (c.Hue != 0)
|
||||
hue = c.Hue;
|
||||
}
|
||||
}
|
||||
|
||||
Delete();
|
||||
|
||||
house.Addons.Remove(this);
|
||||
|
||||
var deed = GetDeed();
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
if (RetainDeedHue)
|
||||
deed.Hue = hue;
|
||||
else
|
||||
deed.Hue = 0;
|
||||
|
||||
deed.IsReDeed = true;
|
||||
|
||||
from.AddToBackpack(deed);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1113134); // You can only redeed items in your own house!
|
||||
}
|
||||
}
|
||||
|
||||
public virtual BaseAddonDeed Deed { get { return null; } }
|
||||
|
||||
public virtual BaseAddonDeed GetDeed()
|
||||
{
|
||||
var deed = Deed;
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
deed.Resource = Resource;
|
||||
}
|
||||
|
||||
return deed;
|
||||
}
|
||||
|
||||
Item IAddon.Deed { get { return GetDeed(); } }
|
||||
|
||||
public List<AddonComponent> Components { get { return m_Components; } }
|
||||
|
||||
public BaseAddon(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
BaseHouse h = null;
|
||||
return (CouldFit(p, map, null, ref h) == AddonFitResult.Valid);
|
||||
}
|
||||
|
||||
public virtual AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house)
|
||||
{
|
||||
if (Deleted)
|
||||
return AddonFitResult.Blocked;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
{
|
||||
var p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
|
||||
|
||||
if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0)))
|
||||
return AddonFitResult.Blocked;
|
||||
if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house))
|
||||
return AddonFitResult.NotInHouse;
|
||||
|
||||
if (c.NeedsWall)
|
||||
{
|
||||
var wall = c.WallPosition;
|
||||
|
||||
if (!IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map))
|
||||
return AddonFitResult.NoWall;
|
||||
}
|
||||
}
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
var doors = house.Doors;
|
||||
|
||||
for (var i = 0; i < doors.Count; ++i)
|
||||
{
|
||||
var door = doors[i] as BaseDoor;
|
||||
|
||||
var doorLoc = door.GetWorldLocation();
|
||||
var doorHeight = door.ItemData.CalcHeight;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
{
|
||||
var addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
|
||||
var addonHeight = c.ItemData.CalcHeight;
|
||||
|
||||
if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z ||
|
||||
((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z)))
|
||||
return AddonFitResult.DoorTooClose;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return AddonFitResult.Valid;
|
||||
}
|
||||
|
||||
public static bool CheckHouse(Mobile from, Point3D p, Map map, int height, ref BaseHouse house)
|
||||
{
|
||||
house = BaseHouse.FindHouseAt(p, map, height);
|
||||
|
||||
if (house == null || (from != null && !house.IsCoOwner(from)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsWall(int x, int y, int z, Map map)
|
||||
{
|
||||
if (map == null)
|
||||
return false;
|
||||
|
||||
var tiles = map.Tiles.GetStaticTiles(x, y, true);
|
||||
|
||||
for (var i = 0; i < tiles.Length; ++i)
|
||||
{
|
||||
var t = tiles[i];
|
||||
var id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
|
||||
|
||||
if ((id.Flags & TileFlag.Wall) != 0 && (z + 16) > t.Z && (t.Z + t.Height) > z)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void OnComponentLoaded(AddonComponent c)
|
||||
{ }
|
||||
|
||||
public virtual void OnComponentUsed(AddonComponent c, Mobile from)
|
||||
{ }
|
||||
|
||||
public override void OnLocationChange(Point3D oldLoc)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Location = new Point3D(X + c.Offset.X, Y + c.Offset.Y, Z + c.Offset.Z);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Delete();
|
||||
}
|
||||
|
||||
public virtual bool ShareHue { get { return true; } }
|
||||
|
||||
[Hue, CommandProperty(AccessLevel.Decorator)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
if (base.Hue != value)
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (!Deleted && ShareHue && m_Components != null)
|
||||
{
|
||||
foreach (var c in m_Components)
|
||||
c.Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void UpdateProperties()
|
||||
{
|
||||
InvalidateProperties();
|
||||
|
||||
foreach (var o in Components)
|
||||
{
|
||||
o.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void GetProperties(ObjectPropertyList list, AddonComponent c)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(2); // version
|
||||
|
||||
writer.Write((int)m_Resource);
|
||||
|
||||
writer.WriteItemList(m_Components);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
goto case 1;
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
m_Components = reader.ReadStrongItemList<AddonComponent>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 1 && Weight == 0)
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
327
Scripts/Items/Addons/BaseAddonContainer.cs
Normal file
327
Scripts/Items/Addons/BaseAddonContainer.cs
Normal file
@@ -0,0 +1,327 @@
|
||||
#region References
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.Multis;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseAddonContainer : BaseContainer, IChopable, IAddon
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
private List<AddonContainerComponent> m_Components;
|
||||
|
||||
public BaseAddonContainer(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
|
||||
AddonComponent.ApplyLightTo(this);
|
||||
|
||||
m_Components = new List<AddonContainerComponent>();
|
||||
}
|
||||
|
||||
public BaseAddonContainer(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override bool DisplayWeight { get { return false; } }
|
||||
|
||||
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get { return base.Hue; }
|
||||
set
|
||||
{
|
||||
if (base.Hue != value)
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (!Deleted && ShareHue && m_Components != null)
|
||||
{
|
||||
Hue = value;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set
|
||||
{
|
||||
if (m_Resource != value)
|
||||
{
|
||||
m_Resource = value;
|
||||
Hue = CraftResources.GetHue(m_Resource);
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool RetainDeedHue { get { return false; } }
|
||||
public virtual bool NeedsWall { get { return false; } }
|
||||
public virtual bool ShareHue { get { return true; } }
|
||||
public virtual Point3D WallPosition { get { return Point3D.Zero; } }
|
||||
public virtual BaseAddonContainerDeed Deed { get { return null; } }
|
||||
public List<AddonContainerComponent> Components { get { return m_Components; } }
|
||||
Item IAddon.Deed { get { return Deed; } }
|
||||
|
||||
public override void OnLocationChange(Point3D oldLoc)
|
||||
{
|
||||
base.OnLocationChange(oldLoc);
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Location = new Point3D(X + c.Offset.X, Y + c.Offset.Y, Z + c.Offset.Z);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null)
|
||||
house.Addons.Remove(this);
|
||||
|
||||
var components = new List<AddonContainerComponent>(m_Components);
|
||||
|
||||
foreach (var component in components)
|
||||
{
|
||||
component.Addon = null;
|
||||
component.Delete();
|
||||
}
|
||||
|
||||
components.Clear();
|
||||
components.TrimExcess();
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public virtual void UpdateProperties()
|
||||
{
|
||||
InvalidateProperties();
|
||||
|
||||
foreach (var o in Components)
|
||||
{
|
||||
o.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void GetProperties(ObjectPropertyList list, AddonContainerComponent c)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!CraftResources.IsStandard(m_Resource))
|
||||
list.Add(CraftResources.GetLocalizationNumber(m_Resource));
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
foreach (var c in m_Components)
|
||||
c.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.WriteItemList(m_Components);
|
||||
writer.Write((int)m_Resource);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
m_Components = reader.ReadStrongItemList<AddonContainerComponent>();
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
|
||||
AddonComponent.ApplyLightTo(this);
|
||||
}
|
||||
|
||||
public virtual void DropItemsToGround()
|
||||
{
|
||||
for (var i = Items.Count - 1; i >= 0; i--)
|
||||
Items[i].MoveToWorld(Location);
|
||||
}
|
||||
|
||||
public void AddComponent(AddonContainerComponent c, int x, int y, int z)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Components.Add(c);
|
||||
|
||||
c.Addon = this;
|
||||
c.Offset = new Point3D(x, y, z);
|
||||
c.MoveToWorld(new Point3D(X + x, Y + y, Z + z), Map);
|
||||
}
|
||||
|
||||
public AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house)
|
||||
{
|
||||
if (Deleted)
|
||||
return AddonFitResult.Blocked;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
{
|
||||
var p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
|
||||
|
||||
if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0)))
|
||||
return AddonFitResult.Blocked;
|
||||
if (!BaseAddon.CheckHouse(from, p3D, map, c.ItemData.Height, ref house))
|
||||
return AddonFitResult.NotInHouse;
|
||||
|
||||
if (c.NeedsWall)
|
||||
{
|
||||
var wall = c.WallPosition;
|
||||
|
||||
if (!BaseAddon.IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map))
|
||||
return AddonFitResult.NoWall;
|
||||
}
|
||||
}
|
||||
|
||||
var p3 = new Point3D(p.X, p.Y, p.Z);
|
||||
|
||||
if (!map.CanFit(p3.X, p3.Y, p3.Z, ItemData.Height, false, true, (Z == 0)))
|
||||
return AddonFitResult.Blocked;
|
||||
if (!BaseAddon.CheckHouse(@from, p3, map, ItemData.Height, ref house))
|
||||
return AddonFitResult.NotInHouse;
|
||||
|
||||
if (NeedsWall)
|
||||
{
|
||||
var wall = WallPosition;
|
||||
|
||||
if (!BaseAddon.IsWall(p3.X + wall.X, p3.Y + wall.Y, p3.Z + wall.Z, map))
|
||||
return AddonFitResult.NoWall;
|
||||
}
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
var doors = house.Doors;
|
||||
|
||||
for (var i = 0; i < doors.Count; ++i)
|
||||
{
|
||||
var door = doors[i] as BaseDoor;
|
||||
|
||||
if (door != null && door.Open)
|
||||
return AddonFitResult.DoorsNotClosed;
|
||||
|
||||
var doorLoc = door.GetWorldLocation();
|
||||
var doorHeight = door.ItemData.CalcHeight;
|
||||
|
||||
foreach (var c in m_Components)
|
||||
{
|
||||
var addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
|
||||
var addonHeight = c.ItemData.CalcHeight;
|
||||
|
||||
if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z ||
|
||||
((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z)))
|
||||
return AddonFitResult.DoorTooClose;
|
||||
}
|
||||
|
||||
var addonLo = new Point3D(p.X, p.Y, p.Z);
|
||||
var addonHeigh = ItemData.CalcHeight;
|
||||
|
||||
if (Utility.InRange(doorLoc, addonLo, 1) && (addonLo.Z == doorLoc.Z ||
|
||||
((addonLo.Z + addonHeigh) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLo.Z)))
|
||||
return AddonFitResult.DoorTooClose;
|
||||
}
|
||||
}
|
||||
|
||||
return AddonFitResult.Valid;
|
||||
}
|
||||
|
||||
public bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
BaseHouse house = null;
|
||||
|
||||
return (CouldFit(p, map, null, ref house) == AddonFitResult.Valid);
|
||||
}
|
||||
|
||||
public virtual void OnChop(Mobile from)
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && house.IsOwner(from))
|
||||
{
|
||||
if (!IsSecure)
|
||||
{
|
||||
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
|
||||
var hue = 0;
|
||||
|
||||
if (RetainDeedHue)
|
||||
{
|
||||
for (var i = 0; hue == 0 && i < m_Components.Count; ++i)
|
||||
{
|
||||
var c = m_Components[i];
|
||||
|
||||
if (c.Hue != 0)
|
||||
hue = c.Hue;
|
||||
}
|
||||
}
|
||||
|
||||
DropItemsToGround();
|
||||
|
||||
Delete();
|
||||
|
||||
house.Addons.Remove(this);
|
||||
|
||||
var deed = Deed;
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
deed.Resource = Resource;
|
||||
|
||||
if (RetainDeedHue)
|
||||
deed.Hue = hue;
|
||||
|
||||
from.AddToBackpack(deed);
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1074870); // This item must be unlocked/unsecured before re-deeding it.
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnComponentLoaded(AddonContainerComponent c)
|
||||
{ }
|
||||
|
||||
public virtual void OnComponentUsed(AddonContainerComponent c, Mobile from)
|
||||
{
|
||||
if (!Deleted)
|
||||
{
|
||||
OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
180
Scripts/Items/Addons/BaseAddonContainerDeed.cs
Normal file
180
Scripts/Items/Addons/BaseAddonContainerDeed.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x14F0, 0x14EF)]
|
||||
public abstract class BaseAddonContainerDeed : Item, ICraftable
|
||||
{
|
||||
public abstract BaseAddonContainer Addon { get; }
|
||||
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Resource;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.m_Resource != value)
|
||||
{
|
||||
m_Resource = value;
|
||||
Hue = CraftResources.GetHue(this.m_Resource);
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseAddonContainerDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
if (!Core.AOS)
|
||||
LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
public BaseAddonContainerDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
|
||||
// version 1
|
||||
writer.Write((int)m_Resource);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
from.Target = new InternalTarget(this);
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!CraftResources.IsStandard(this.m_Resource))
|
||||
list.Add(CraftResources.GetLocalizationNumber(this.m_Resource));
|
||||
}
|
||||
|
||||
#region ICraftable
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Type resourceType = typeRes;
|
||||
|
||||
if (resourceType == null)
|
||||
resourceType = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(resourceType);
|
||||
|
||||
CraftContext context = craftSystem.GetContext(from);
|
||||
|
||||
if (context != null && context.DoNotColor)
|
||||
Hue = 0;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly BaseAddonContainerDeed m_Deed;
|
||||
|
||||
public InternalTarget(BaseAddonContainerDeed deed)
|
||||
: base(-1, true, TargetFlags.None)
|
||||
{
|
||||
m_Deed = deed;
|
||||
|
||||
CheckLOS = false;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if (p == null || map == null || this.m_Deed.Deleted)
|
||||
return;
|
||||
|
||||
if (this.m_Deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseAddonContainer addon = this.m_Deed.Addon;
|
||||
addon.Resource = this.m_Deed.Resource;
|
||||
|
||||
Server.Spells.SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
BaseHouse house = null;
|
||||
|
||||
AddonFitResult res = addon.CouldFit(p, map, from, ref house);
|
||||
|
||||
if (res == AddonFitResult.Valid)
|
||||
addon.MoveToWorld(new Point3D(p), map);
|
||||
else if (res == AddonFitResult.Blocked)
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
else if (res == AddonFitResult.NotInHouse)
|
||||
from.SendLocalizedMessage(500274); // You can only place this in a house that you own!
|
||||
else if (res == AddonFitResult.DoorsNotClosed)
|
||||
from.SendMessage("You must close all house doors before placing this.");
|
||||
else if (res == AddonFitResult.DoorTooClose)
|
||||
from.SendLocalizedMessage(500271); // You cannot build near the door.
|
||||
else if (res == AddonFitResult.NoWall)
|
||||
from.SendLocalizedMessage(500268); // This object needs to be mounted on something.
|
||||
|
||||
if (res == AddonFitResult.Valid)
|
||||
{
|
||||
this.m_Deed.Delete();
|
||||
house.Addons[addon] = from;
|
||||
|
||||
if (addon is GardenShedAddon)
|
||||
{
|
||||
GardenShedAddon ad = addon as GardenShedAddon;
|
||||
house.Addons[ad.SecondContainer] = from;
|
||||
}
|
||||
|
||||
if (addon.Security)
|
||||
{
|
||||
house.AddSecure(from, addon);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addon.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
242
Scripts/Items/Addons/BaseAddonDeed.cs
Normal file
242
Scripts/Items/Addons/BaseAddonDeed.cs
Normal file
@@ -0,0 +1,242 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x14F0, 0x14EF)]
|
||||
public abstract class BaseAddonDeed : Item, ICraftable
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
private bool m_ReDeed;
|
||||
|
||||
public BaseAddonDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
if (!Core.AOS)
|
||||
LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
public BaseAddonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract BaseAddon Addon { get; }
|
||||
|
||||
public virtual bool UseCraftResource { get { return true; } }
|
||||
|
||||
public virtual bool ExcludeDeedHue { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Resource;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (UseCraftResource && m_Resource != value)
|
||||
{
|
||||
m_Resource = value;
|
||||
Hue = CraftResources.GetHue(m_Resource);
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsReDeed
|
||||
{
|
||||
get { return m_ReDeed; }
|
||||
set
|
||||
{
|
||||
m_ReDeed = value;
|
||||
|
||||
if (UseCraftResource)
|
||||
{
|
||||
if (m_ReDeed && ItemID == 0x14F0)
|
||||
{
|
||||
ItemID = 0x14EF;
|
||||
}
|
||||
else if (!m_ReDeed && ItemID == 0x14EF)
|
||||
{
|
||||
ItemID = 0x14F0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(2); // version
|
||||
|
||||
// Version 2
|
||||
writer.Write(m_ReDeed);
|
||||
|
||||
// Version 1
|
||||
writer.Write((int)m_Resource);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_ReDeed = reader.ReadBool();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version == 1 && UseCraftResource && Hue == 0 && m_Resource != CraftResource.None)
|
||||
{
|
||||
Hue = CraftResources.GetHue(m_Resource);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
from.Target = new InternalTarget(this);
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public virtual void DeleteDeed()
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!CraftResources.IsStandard(m_Resource))
|
||||
list.Add(CraftResources.GetLocalizationNumber(m_Resource));
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Type resourceType = typeRes;
|
||||
|
||||
if (resourceType == null)
|
||||
resourceType = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(resourceType);
|
||||
|
||||
CraftContext context = craftSystem.GetContext(from);
|
||||
|
||||
if (context != null && context.DoNotColor)
|
||||
Hue = 0;
|
||||
else if (Hue == 0)
|
||||
Hue = resHue;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly BaseAddonDeed m_Deed;
|
||||
public InternalTarget(BaseAddonDeed deed)
|
||||
: base(-1, true, TargetFlags.None)
|
||||
{
|
||||
m_Deed = deed;
|
||||
|
||||
CheckLOS = false;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if (p == null || map == null || m_Deed.Deleted)
|
||||
return;
|
||||
|
||||
if (m_Deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseAddon addon = m_Deed.Addon;
|
||||
|
||||
Server.Spells.SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
BaseHouse house = null;
|
||||
BaseGalleon galleon = CheckGalleonPlacement(from, addon, new Point3D(p), map);
|
||||
|
||||
AddonFitResult res = galleon != null ? AddonFitResult.Valid : addon.CouldFit(p, map, from, ref house);
|
||||
|
||||
if (res == AddonFitResult.Valid)
|
||||
{
|
||||
addon.Resource = m_Deed.Resource;
|
||||
|
||||
if (!m_Deed.ExcludeDeedHue)
|
||||
{
|
||||
if (addon.RetainDeedHue || (m_Deed.Hue != 0 && CraftResources.GetHue(m_Deed.Resource) != m_Deed.Hue))
|
||||
addon.Hue = m_Deed.Hue;
|
||||
}
|
||||
|
||||
addon.MoveToWorld(new Point3D(p), map);
|
||||
|
||||
if (house != null)
|
||||
house.Addons[addon] = from;
|
||||
|
||||
if (galleon != null)
|
||||
galleon.AddAddon(addon);
|
||||
|
||||
m_Deed.DeleteDeed();
|
||||
}
|
||||
else if (res == AddonFitResult.Blocked)
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
else if (res == AddonFitResult.NotInHouse)
|
||||
from.SendLocalizedMessage(500274); // You can only place this in a house that you own!
|
||||
else if (res == AddonFitResult.DoorTooClose)
|
||||
from.SendLocalizedMessage(500271); // You cannot build near the door.
|
||||
else if (res == AddonFitResult.NoWall)
|
||||
from.SendLocalizedMessage(500268); // This object needs to be mounted on something.
|
||||
|
||||
if (res != AddonFitResult.Valid)
|
||||
{
|
||||
addon.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public BaseGalleon CheckGalleonPlacement(Mobile from, BaseAddon addon, Point3D p, Map map)
|
||||
{
|
||||
if (!Core.HS || addon.Components.Count > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var galleon = BaseGalleon.FindGalleonAt(p, map);
|
||||
|
||||
if (galleon != null && galleon.CanAddAddon(p))
|
||||
{
|
||||
return galleon;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
340
Scripts/Items/Addons/BearRugs.cs
Normal file
340
Scripts/Items/Addons/BearRugs.cs
Normal file
@@ -0,0 +1,340 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BrownBearRugEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrownBearRugEastAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x1E40), 1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E41), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E42), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E43), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E44), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E45), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E46), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E47), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E48), -1, -1, 0);
|
||||
}
|
||||
|
||||
public BrownBearRugEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrownBearRugEastDeed();
|
||||
}
|
||||
}
|
||||
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 BrownBearRugEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrownBearRugEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public BrownBearRugEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrownBearRugEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049397;
|
||||
}
|
||||
}// a brown bear rug deed facing east
|
||||
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 BrownBearRugSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrownBearRugSouthAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x1E36), 1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E37), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E38), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E39), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E3A), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E3B), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E3C), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E3D), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E3E), -1, -1, 0);
|
||||
}
|
||||
|
||||
public BrownBearRugSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrownBearRugSouthDeed();
|
||||
}
|
||||
}
|
||||
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 BrownBearRugSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrownBearRugSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public BrownBearRugSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrownBearRugSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049398;
|
||||
}
|
||||
}// a brown bear rug deed facing south
|
||||
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 PolarBearRugEastAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public PolarBearRugEastAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x1E53), 1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E54), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E55), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E56), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E57), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E58), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E59), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E5A), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E5B), -1, -1, 0);
|
||||
}
|
||||
|
||||
public PolarBearRugEastAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PolarBearRugEastDeed();
|
||||
}
|
||||
}
|
||||
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 PolarBearRugEastDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public PolarBearRugEastDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public PolarBearRugEastDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PolarBearRugEastAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049399;
|
||||
}
|
||||
}// a polar bear rug deed facing east
|
||||
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 PolarBearRugSouthAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public PolarBearRugSouthAddon()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x1E49), 1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4A), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4B), -1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4C), -1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4D), 0, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4E), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E4F), 1, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E50), 0, -1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1E51), -1, -1, 0);
|
||||
}
|
||||
|
||||
public PolarBearRugSouthAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PolarBearRugSouthDeed();
|
||||
}
|
||||
}
|
||||
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 PolarBearRugSouthDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public PolarBearRugSouthDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public PolarBearRugSouthDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PolarBearRugSouthAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049400;
|
||||
}
|
||||
}// a polar bear rug deed facing south
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
214
Scripts/Items/Addons/BedOfNails.cs
Normal file
214
Scripts/Items/Addons/BedOfNails.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BedOfNailsComponent : AddonComponent
|
||||
{
|
||||
public BedOfNailsComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BedOfNailsComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074801;
|
||||
}
|
||||
}// Bed of Nails
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
bool allow = base.OnMoveOver(m);
|
||||
|
||||
if (allow && this.Addon is BedOfNailsAddon)
|
||||
((BedOfNailsAddon)this.Addon).OnMoveOver(m);
|
||||
|
||||
return allow;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAddon(Direction.South, Direction.East)]
|
||||
public class BedOfNailsAddon : BaseAddon
|
||||
{
|
||||
private InternalTimer m_Timer;
|
||||
[Constructable]
|
||||
public BedOfNailsAddon()
|
||||
: base()
|
||||
{
|
||||
this.Direction = Direction.South;
|
||||
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A81), 0, 0, 0);
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A82), 0, -1, 0);
|
||||
}
|
||||
|
||||
public BedOfNailsAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BedOfNailsDeed();
|
||||
}
|
||||
}
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (m.Alive && (m.IsPlayer() || !m.Hidden))
|
||||
{
|
||||
if (m.Player)
|
||||
{
|
||||
if (m.Female)
|
||||
Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x53B, 0x53D));
|
||||
else
|
||||
Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x53E, 0x540));
|
||||
}
|
||||
|
||||
if (this.m_Timer == null || !this.m_Timer.Running)
|
||||
(this.m_Timer = new InternalTimer(m)).Start();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public virtual void Flip(Mobile from, Direction direction)
|
||||
{
|
||||
switch( direction )
|
||||
{
|
||||
case Direction.East:
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A89), 0, 0, 0);
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A8A), -1, 0, 0);
|
||||
break;
|
||||
case Direction.South:
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A81), 0, 0, 0);
|
||||
this.AddComponent(new BedOfNailsComponent(0x2A82), 0, -1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
private Point3D m_Location;
|
||||
public InternalTimer(Mobile m)
|
||||
: base(TimeSpan.Zero, TimeSpan.FromSeconds(1), 5)
|
||||
{
|
||||
this.m_Mobile = m;
|
||||
this.m_Location = Point3D.Zero;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (this.m_Mobile == null || this.m_Mobile.Map == null || this.m_Mobile.Deleted || !this.m_Mobile.Alive || this.m_Mobile.Map == Map.Internal)
|
||||
{
|
||||
this.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.m_Location != this.m_Mobile.Location)
|
||||
{
|
||||
int amount = Utility.RandomMinMax(0, 7);
|
||||
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
int x = this.m_Mobile.X + Utility.RandomMinMax(-1, 1);
|
||||
int y = this.m_Mobile.Y + Utility.RandomMinMax(-1, 1);
|
||||
int z = this.m_Mobile.Z;
|
||||
|
||||
if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true))
|
||||
{
|
||||
z = this.m_Mobile.Map.GetAverageZ(x, y);
|
||||
|
||||
if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
|
||||
blood.MoveToWorld(new Point3D(x, y, z), this.m_Mobile.Map);
|
||||
}
|
||||
this.m_Location = this.m_Mobile.Location;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BedOfNailsDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BedOfNailsDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BedOfNailsDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BedOfNailsAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074801;
|
||||
}
|
||||
}// Bed of Nails
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
70
Scripts/Items/Addons/BloodPentagram.cs
Normal file
70
Scripts/Items/Addons/BloodPentagram.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BloodPentagram : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BloodPentagram()
|
||||
{
|
||||
this.AddComponent(new AddonComponent(0x1CF9), 0, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF8), 0, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF7), 0, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF6), 0, 4, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF5), 0, 5, 0);
|
||||
|
||||
this.AddComponent(new AddonComponent(0x1CFB), 1, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CFA), 1, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D09), 1, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D08), 1, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D07), 1, 4, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF4), 1, 5, 0);
|
||||
|
||||
this.AddComponent(new AddonComponent(0x1CFC), 2, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0A), 2, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D11), 2, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D10), 2, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D06), 2, 4, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF3), 2, 5, 0);
|
||||
|
||||
this.AddComponent(new AddonComponent(0x1CFD), 3, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0B), 3, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D12), 3, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0F), 3, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D05), 3, 4, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF2), 3, 5, 0);
|
||||
|
||||
this.AddComponent(new AddonComponent(0x1CFE), 4, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0C), 4, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0D), 4, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D0E), 4, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D04), 4, 4, 0);
|
||||
this.AddComponent(new AddonComponent(0x1CF1), 4, 5, 0);
|
||||
|
||||
this.AddComponent(new AddonComponent(0x1CFF), 5, 0, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D00), 5, 1, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D01), 5, 2, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D02), 5, 3, 0);
|
||||
this.AddComponent(new AddonComponent(0x1D03), 5, 4, 0);
|
||||
}
|
||||
|
||||
public BloodPentagram(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
221
Scripts/Items/Addons/BloodyPentagram.cs
Normal file
221
Scripts/Items/Addons/BloodyPentagram.cs
Normal file
@@ -0,0 +1,221 @@
|
||||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BloodyPentagramComponent : AddonComponent
|
||||
{
|
||||
public BloodyPentagramComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BloodyPentagramComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DisplayWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1080279;
|
||||
}
|
||||
}// Bloody Pentagram
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodyPentagramAddon : BaseAddon, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public BloodyPentagramAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF9), 0, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF8), 0, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF7), 0, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF6), 0, 4, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF5), 0, 5, 0);
|
||||
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFB), 1, 0, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFA), 1, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D09), 1, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D08), 1, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D07), 1, 4, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF4), 1, 5, 0);
|
||||
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFC), 2, 0, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0A), 2, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D11), 2, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D10), 2, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D06), 2, 4, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF3), 2, 5, 0);
|
||||
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFD), 3, 0, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0B), 3, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D12), 3, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0F), 3, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D05), 3, 4, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF2), 3, 5, 0);
|
||||
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFE), 4, 0, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0C), 4, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0D), 4, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D0E), 4, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D04), 4, 4, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CF1), 4, 5, 0);
|
||||
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1CFF), 5, 0, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D00), 5, 1, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D01), 5, 2, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D02), 5, 3, 0);
|
||||
this.AddComponent(new BloodyPentagramComponent(0x1D03), 5, 4, 0);
|
||||
}
|
||||
|
||||
public BloodyPentagramAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
BloodyPentagramDeed deed = new BloodyPentagramDeed();
|
||||
deed.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodyPentagramDeed : BaseAddonDeed, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public BloodyPentagramDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BloodyPentagramDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1080384;
|
||||
}
|
||||
}// Bloody Pentagram
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
BloodyPentagramAddon addon = new BloodyPentagramAddon();
|
||||
addon.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Scripts/Items/Addons/BlueDecorativeRug.cs
Normal file
91
Scripts/Items/Addons/BlueDecorativeRug.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlueDecorativeRugAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BlueDecorativeRugAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD2, 1076589), 1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD3, 1076589), -1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD4, 1076589), -1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD5, 1076589), 1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD6, 1076589), -1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD7, 1076589), 0, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD8, 1076589), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD9, 1076589), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAD1, 1076589), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BlueDecorativeRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BlueDecorativeRugDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueDecorativeRugDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BlueDecorativeRugDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BlueDecorativeRugDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BlueDecorativeRugAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076589;
|
||||
}
|
||||
}// Blue decorative rug
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Scripts/Items/Addons/BlueFancyRug.cs
Normal file
91
Scripts/Items/Addons/BlueFancyRug.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlueFancyRugAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BlueFancyRugAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC2, 1076273), 1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC3, 1076273), -1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC4, 1076273), -1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC5, 1076273), 1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF6, 1076273), -1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF7, 1076273), 0, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF8, 1076273), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF9, 1076273), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAFA, 1076273), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BlueFancyRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BlueFancyRugDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueFancyRugDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BlueFancyRugDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BlueFancyRugDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BlueFancyRugAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076273;
|
||||
}
|
||||
}// Blue fancy rug
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
155
Scripts/Items/Addons/BlueMarbleFireplace.cs
Normal file
155
Scripts/Items/Addons/BlueMarbleFireplace.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlueMarbleFireplaceAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BlueMarbleFireplaceAddon(DirectionType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DirectionType.South:
|
||||
AddComponent(new LocalizedAddonComponent(0x9A56, 1021117), -1, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9A55, 1021117), 0, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9A54, 1021117), 1, 0, 0);
|
||||
break;
|
||||
case DirectionType.East:
|
||||
AddComponent(new LocalizedAddonComponent(0x9A53, 1021117), 0, -1, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9A52, 1021117), 0, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9A51, 1021117), 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed(AddonComponent c, Mobile from)
|
||||
{
|
||||
if ((from.InRange(c.Location, 3)))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && (house.IsOwner(from) || (house.LockDowns.ContainsKey(this) && house.LockDowns[this] == from)))
|
||||
{
|
||||
Components.ForEach(x =>
|
||||
{
|
||||
switch (x.ItemID)
|
||||
{
|
||||
case 0x9A52:
|
||||
{
|
||||
x.ItemID = 0x9A69;
|
||||
break;
|
||||
}
|
||||
case 0x9A69:
|
||||
{
|
||||
x.ItemID = 0x9A52;
|
||||
break;
|
||||
}
|
||||
case 0x9A55:
|
||||
{
|
||||
x.ItemID = 0x9A6F;
|
||||
break;
|
||||
}
|
||||
case 0x9A6F:
|
||||
{
|
||||
x.ItemID = 0x9A55;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
from.PlaySound(958);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public BlueMarbleFireplaceAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed { get { return new BlueMarbleFireplaceDeed(); } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueMarbleFireplaceDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1155696; } } // Blue Marble Fireplace
|
||||
|
||||
public override BaseAddon Addon { get { return new BlueMarbleFireplaceAddon(_Direction); } }
|
||||
|
||||
private DirectionType _Direction;
|
||||
|
||||
[Constructable]
|
||||
public BlueMarbleFireplaceDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BlueMarbleFireplaceDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)DirectionType.South, 1075386); // South
|
||||
list.Add((int)DirectionType.East, 1075387); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
_Direction = (DirectionType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1154194)); // Choose a Facing:
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Scripts/Items/Addons/BluePlainRug.cs
Normal file
91
Scripts/Items/Addons/BluePlainRug.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BluePlainRugAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BluePlainRugAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC2, 1076585), 1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC3, 1076585), -1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC4, 1076585), -1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC5, 1076585), 1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF6, 1076585), -1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF7, 1076585), 0, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF8, 1076585), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAF9, 1076585), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAC0, 1076585), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BluePlainRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BluePlainRugDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BluePlainRugDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BluePlainRugDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BluePlainRugDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BluePlainRugAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076585;
|
||||
}
|
||||
}// Blue plain rug
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
146
Scripts/Items/Addons/BoneCouch.cs
Normal file
146
Scripts/Items/Addons/BoneCouch.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BoneCouchComponent : AddonComponent
|
||||
{
|
||||
public BoneCouchComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BoneCouchComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074477;
|
||||
}
|
||||
}// Bone couch
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
bool allow = base.OnMoveOver(m);
|
||||
|
||||
if (allow && m.Alive && m.Player && (m.IsPlayer() || !m.Hidden))
|
||||
Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x547, 0x54A));
|
||||
|
||||
return allow;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAddon(Direction.South, Direction.East)]
|
||||
public class BoneCouchAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BoneCouchAddon()
|
||||
: base()
|
||||
{
|
||||
this.Direction = Direction.South;
|
||||
|
||||
this.AddComponent(new BoneCouchComponent(0x2A5A), 0, 0, 0);
|
||||
this.AddComponent(new BoneCouchComponent(0x2A5B), -1, 0, 0);
|
||||
}
|
||||
|
||||
public BoneCouchAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneCouchDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public virtual void Flip(Mobile from, Direction direction)
|
||||
{
|
||||
switch ( direction )
|
||||
{
|
||||
case Direction.East:
|
||||
this.AddComponent(new BoneCouchComponent(0x2A80), 0, 0, 0);
|
||||
this.AddComponent(new BoneCouchComponent(0x2A7F), 0, 1, 0);
|
||||
break;
|
||||
case Direction.South:
|
||||
this.AddComponent(new BoneCouchComponent(0x2A5A), 0, 0, 0);
|
||||
this.AddComponent(new BoneCouchComponent(0x2A5B), -1, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BoneCouchDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BoneCouchDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BoneCouchDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneCouchAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074477;
|
||||
}
|
||||
}// Bone couch
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Items/Addons/BoneTable.cs
Normal file
83
Scripts/Items/Addons/BoneTable.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BoneTableAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BoneTableAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0x2A5C, 1074478), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BoneTableAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneTableDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BoneTableDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BoneTableDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BoneTableDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneTableAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074478;
|
||||
}
|
||||
}// Bone table
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
128
Scripts/Items/Addons/BoneThrone.cs
Normal file
128
Scripts/Items/Addons/BoneThrone.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x2A58, 0x2A59)]
|
||||
public class BoneThroneComponent : AddonComponent
|
||||
{
|
||||
public BoneThroneComponent()
|
||||
: base(0x2A58)
|
||||
{
|
||||
}
|
||||
|
||||
public BoneThroneComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074476;
|
||||
}
|
||||
}// Bone throne
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
bool allow = base.OnMoveOver(m);
|
||||
|
||||
if (allow && m.Alive && m.Player && (m.IsPlayer() || !m.Hidden))
|
||||
Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x54B, 0x54D));
|
||||
|
||||
return allow;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BoneThroneAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BoneThroneAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BoneThroneComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BoneThroneAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneThroneDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BoneThroneDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BoneThroneDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BoneThroneDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BoneThroneAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074476;
|
||||
}
|
||||
}// Bone throne
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
266
Scripts/Items/Addons/Brazier.cs
Normal file
266
Scripts/Items/Addons/Brazier.cs
Normal file
@@ -0,0 +1,266 @@
|
||||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RewardBrazier : Item, IRewardItem
|
||||
{
|
||||
private static readonly int[] m_Art = new int[]
|
||||
{
|
||||
0x19AA, 0x19BB
|
||||
};
|
||||
private bool m_IsRewardItem;
|
||||
private Item m_Fire;
|
||||
[Constructable]
|
||||
public RewardBrazier()
|
||||
: this(Utility.RandomList(m_Art))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardBrazier(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Weight = 10.0;
|
||||
}
|
||||
|
||||
public RewardBrazier(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ForceShowProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return ObjectPropertyList.Enabled;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnDelete()
|
||||
{
|
||||
this.TurnOff();
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
if (this.m_Fire != null)
|
||||
{
|
||||
this.m_Fire.Delete();
|
||||
this.m_Fire = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void TurnOn()
|
||||
{
|
||||
if (this.m_Fire == null)
|
||||
this.m_Fire = new Item();
|
||||
|
||||
this.m_Fire.ItemID = 0x19AB;
|
||||
this.m_Fire.Movable = false;
|
||||
this.m_Fire.MoveToWorld(new Point3D(this.X, this.Y, this.Z + this.ItemData.Height + 2), this.Map);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else if (this.IsLockedDown)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
if (this.m_Fire != null)
|
||||
this.TurnOff();
|
||||
else
|
||||
this.TurnOn();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502436); // That is not accessible.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502692); // This must be in a house and be locked down to work.
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
if (this.m_Fire != null)
|
||||
this.m_Fire.MoveToWorld(new Point3D(this.X, this.Y, this.Z + this.ItemData.Height), this.Map);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076222); // 6th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
writer.Write((Item)this.m_Fire);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
this.m_Fire = reader.ReadItem();
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardBrazierDeed : Item, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public RewardBrazierDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public RewardBrazierDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1080527;
|
||||
}
|
||||
}// Brazier Deed
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076222); // 6th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly RewardBrazierDeed m_Brazier;
|
||||
public InternalGump(RewardBrazierDeed brazier)
|
||||
: base(100, 200)
|
||||
{
|
||||
this.m_Brazier = brazier;
|
||||
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
|
||||
this.AddPage(0);
|
||||
this.AddBackground(0, 0, 200, 200, 2600);
|
||||
|
||||
this.AddPage(1);
|
||||
this.AddLabel(45, 15, 0, "Choose a Brazier:");
|
||||
|
||||
this.AddItem(40, 75, 0x19AA);
|
||||
this.AddButton(55, 50, 0x845, 0x846, 0x19AA, GumpButtonType.Reply, 0);
|
||||
|
||||
this.AddItem(100, 75, 0x19BB);
|
||||
this.AddButton(115, 50, 0x845, 0x846, 0x19BB, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Brazier == null || this.m_Brazier.Deleted)
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if (info.ButtonID == 0x19AA || info.ButtonID == 0x19BB)
|
||||
{
|
||||
RewardBrazier brazier = new RewardBrazier(info.ButtonID);
|
||||
brazier.IsRewardItem = this.m_Brazier.IsRewardItem;
|
||||
|
||||
if (!m.PlaceInBackpack(brazier))
|
||||
{
|
||||
brazier.Delete();
|
||||
m.SendLocalizedMessage(1078837); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
this.m_Brazier.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Scripts/Items/Addons/BrokenArmoire.cs
Normal file
118
Scripts/Items/Addons/BrokenArmoire.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xC12, 0xC13)]
|
||||
public class BrokenArmoireComponent : AddonComponent
|
||||
{
|
||||
public BrokenArmoireComponent()
|
||||
: base(0xC12)
|
||||
{
|
||||
}
|
||||
|
||||
public BrokenArmoireComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076262;
|
||||
}
|
||||
}// Broken Armoire
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenArmoireAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenArmoireAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BrokenArmoireComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BrokenArmoireAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenArmoireDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenArmoireDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenArmoireDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenArmoireDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenArmoireAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076262;
|
||||
}
|
||||
}// Broken Armoire
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
152
Scripts/Items/Addons/BrokenBed.cs
Normal file
152
Scripts/Items/Addons/BrokenBed.cs
Normal file
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BrokenBedAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenBedAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east) // east
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1895, 1076263), 0, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1894, 1076263), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1897, 1076263), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1896, 1076263), 1, 1, 0);
|
||||
}
|
||||
else // south
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1899, 1076263), 0, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x1898, 1076263), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x189B, 1076263), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x189A, 1076263), 1, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public BrokenBedAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenBedDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenBedDeed : BaseAddonDeed
|
||||
{
|
||||
private bool m_East;
|
||||
[Constructable]
|
||||
public BrokenBedDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenBedDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenBedAddon(this.m_East);
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076263;
|
||||
}
|
||||
}// Broken Bed
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly BrokenBedDeed m_Deed;
|
||||
public InternalGump(BrokenBedDeed deed)
|
||||
: base(60, 36)
|
||||
{
|
||||
this.m_Deed = deed;
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(0, 0, 273, 324, 0x13BE);
|
||||
this.AddImageTiled(10, 10, 253, 20, 0xA40);
|
||||
this.AddImageTiled(10, 40, 253, 244, 0xA40);
|
||||
this.AddImageTiled(10, 294, 253, 20, 0xA40);
|
||||
this.AddAlphaRegion(10, 10, 253, 304);
|
||||
this.AddButton(10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
this.AddHtmlLocalized(14, 12, 273, 20, 1076749, 0x7FFF, false, false); // Please select your broken bed position
|
||||
|
||||
this.AddPage(1);
|
||||
|
||||
this.AddButton(19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF, false, false); // South
|
||||
this.AddButton(19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF, false, false); // East
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Deed == null || this.m_Deed.Deleted || info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
this.m_Deed.m_East = (info.ButtonID != 1);
|
||||
this.m_Deed.SendTarget(sender.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Scripts/Items/Addons/BrokenBookcase.cs
Normal file
118
Scripts/Items/Addons/BrokenBookcase.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xC14, 0xC15)]
|
||||
public class BrokenBookcaseComponent : AddonComponent
|
||||
{
|
||||
public BrokenBookcaseComponent()
|
||||
: base(0xC14)
|
||||
{
|
||||
}
|
||||
|
||||
public BrokenBookcaseComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076258;
|
||||
}
|
||||
}// Broken Bookcase
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenBookcaseAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenBookcaseAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BrokenBookcaseComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BrokenBookcaseAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenBookcaseDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenBookcaseDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenBookcaseDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenBookcaseDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenBookcaseAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076258;
|
||||
}
|
||||
}// Broken Bookcase
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Scripts/Items/Addons/BrokenChestOfDrawers.cs
Normal file
118
Scripts/Items/Addons/BrokenChestOfDrawers.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xC24, 0xC25)]
|
||||
public class BrokenChestOfDrawersComponent : AddonComponent
|
||||
{
|
||||
public BrokenChestOfDrawersComponent()
|
||||
: base(0xC24)
|
||||
{
|
||||
}
|
||||
|
||||
public BrokenChestOfDrawersComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076261;
|
||||
}
|
||||
}// Broken Chest of Drawers
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenChestOfDrawersAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenChestOfDrawersAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BrokenChestOfDrawersComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BrokenChestOfDrawersAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenChestOfDrawersDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenChestOfDrawersDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenChestOfDrawersDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenChestOfDrawersDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenChestOfDrawersAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076261;
|
||||
}
|
||||
}// Broken Chest of Drawers
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Scripts/Items/Addons/BrokenCoveredChair.cs
Normal file
118
Scripts/Items/Addons/BrokenCoveredChair.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xC17, 0xC18)]
|
||||
public class BrokenCoveredChairComponent : AddonComponent
|
||||
{
|
||||
public BrokenCoveredChairComponent()
|
||||
: base(0xC17)
|
||||
{
|
||||
}
|
||||
|
||||
public BrokenCoveredChairComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076257;
|
||||
}
|
||||
}// Broken Covered Chair
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenCoveredChairAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenCoveredChairAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BrokenCoveredChairComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BrokenCoveredChairAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenCoveredChairDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenCoveredChairDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenCoveredChairDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenCoveredChairDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenCoveredChairAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076257;
|
||||
}
|
||||
}// Broken Covered Chair
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Scripts/Items/Addons/BrokenFallenChair.cs
Normal file
121
Scripts/Items/Addons/BrokenFallenChair.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xC19, 0xC1A)]
|
||||
public class BrokenFallenChairComponent : AddonComponent
|
||||
{
|
||||
public BrokenFallenChairComponent()
|
||||
: base(0xC19)
|
||||
{
|
||||
}
|
||||
|
||||
public BrokenFallenChairComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076264;
|
||||
}
|
||||
}// Broken Fallen Chair
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if (version == 0)
|
||||
ItemID = 0xC19;
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenFallenChairAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenFallenChairAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new BrokenFallenChairComponent(), 0, 0, 0);
|
||||
}
|
||||
|
||||
public BrokenFallenChairAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenFallenChairDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenFallenChairDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenFallenChairDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenFallenChairDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenFallenChairAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076264;
|
||||
}
|
||||
}// Broken Fallen Chair
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
148
Scripts/Items/Addons/BrokenVanity.cs
Normal file
148
Scripts/Items/Addons/BrokenVanity.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BrokenVanityAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BrokenVanityAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east) // east
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xC20, 1076260), 0, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xC21, 1076260), 0, -1, 0);
|
||||
}
|
||||
else // south
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xC22, 1076260), 0, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xC23, 1076260), -1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public BrokenVanityAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenVanityDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokenVanityDeed : BaseAddonDeed
|
||||
{
|
||||
private bool m_East;
|
||||
[Constructable]
|
||||
public BrokenVanityDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BrokenVanityDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BrokenVanityAddon(this.m_East);
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076260;
|
||||
}
|
||||
}// Broken Vanity
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly BrokenVanityDeed m_Deed;
|
||||
public InternalGump(BrokenVanityDeed deed)
|
||||
: base(60, 63)
|
||||
{
|
||||
this.m_Deed = deed;
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(0, 0, 273, 324, 0x13BE);
|
||||
this.AddImageTiled(10, 10, 253, 20, 0xA40);
|
||||
this.AddImageTiled(10, 40, 253, 244, 0xA40);
|
||||
this.AddImageTiled(10, 294, 253, 20, 0xA40);
|
||||
this.AddAlphaRegion(10, 10, 253, 304);
|
||||
this.AddButton(10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
this.AddHtmlLocalized(14, 12, 273, 20, 1076747, 0x7FFF, false, false); // Please select your broken vanity position
|
||||
|
||||
this.AddPage(1);
|
||||
|
||||
this.AddButton(19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF, false, false); // South
|
||||
this.AddButton(19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF, false, false); // East
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (this.m_Deed == null || this.m_Deed.Deleted || info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
this.m_Deed.m_East = (info.ButtonID != 1);
|
||||
this.m_Deed.SendTarget(sender.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
119
Scripts/Items/Addons/BuffetTable.cs
Normal file
119
Scripts/Items/Addons/BuffetTable.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BuffetTableAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public BuffetTableAddon(DirectionType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DirectionType.South:
|
||||
AddComponent(new AddonComponent(40269), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(40270), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(40271), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(40272), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(40273), 2, 0, 0);
|
||||
AddComponent(new AddonComponent(40274), 2, 1, 0);
|
||||
AddComponent(new AddonComponent(40265), -2, 0, 0);
|
||||
AddComponent(new AddonComponent(40266), -2, 1, 0);
|
||||
AddComponent(new AddonComponent(40267), -1, 0, 0);
|
||||
AddComponent(new AddonComponent(40268), -1, 1, 0);
|
||||
break;
|
||||
case DirectionType.East:
|
||||
AddComponent(new AddonComponent(40264), 1, 2, 0);
|
||||
AddComponent(new AddonComponent(40263), 0, 2, 0);
|
||||
AddComponent(new AddonComponent(40262), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(40261), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(40260), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(40259), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(40258), 1, -1, 0);
|
||||
AddComponent(new AddonComponent(40257), 0, -1, 0);
|
||||
AddComponent(new AddonComponent(40256), 1, -2, 0);
|
||||
AddComponent(new AddonComponent(40255), 0, -2, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public BuffetTableAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed { get { return new BuffetTableDeed(); } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BuffetTableDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1157068; } } // Buffet Table
|
||||
|
||||
public override BaseAddon Addon { get { return new BuffetTableAddon(_Direction); } }
|
||||
|
||||
private DirectionType _Direction;
|
||||
|
||||
[Constructable]
|
||||
public BuffetTableDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BuffetTableDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)DirectionType.South, 1075386); // South
|
||||
list.Add((int)DirectionType.East, 1075387); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
_Direction = (DirectionType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1154194)); // Choose a Facing:
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
494
Scripts/Items/Addons/Cannon.cs
Normal file
494
Scripts/Items/Addons/Cannon.cs
Normal file
@@ -0,0 +1,494 @@
|
||||
using System;
|
||||
using Server.Engines.Quests.Haven;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CannonAddonComponent : AddonComponent
|
||||
{
|
||||
public CannonAddonComponent(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CannonAddonComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076157;
|
||||
}
|
||||
}// Decorative Cannon
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.Addon is CannonAddon)
|
||||
{
|
||||
if (((CannonAddon)this.Addon).IsRewardItem)
|
||||
list.Add(1076223); // 7th Year Veteran Reward
|
||||
|
||||
list.Add(1076207, ((CannonAddon)this.Addon).Charges.ToString()); // Remaining Charges: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CannonAddon : BaseAddon
|
||||
{
|
||||
private static readonly int[] m_Effects = new int[]
|
||||
{
|
||||
0x36B0, 0x3728, 0x3709, 0x36FE
|
||||
};
|
||||
private CannonDirection m_CannonDirection;
|
||||
private int m_Charges;
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public CannonAddon(CannonDirection direction)
|
||||
{
|
||||
this.m_CannonDirection = direction;
|
||||
|
||||
switch ( direction )
|
||||
{
|
||||
case CannonDirection.North:
|
||||
{
|
||||
this.AddComponent(new CannonAddonComponent(0xE8D), 0, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE8C), 0, 1, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE8B), 0, 2, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
case CannonDirection.East:
|
||||
{
|
||||
this.AddComponent(new CannonAddonComponent(0xE96), 0, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE95), -1, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE94), -2, 0, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
case CannonDirection.South:
|
||||
{
|
||||
this.AddComponent(new CannonAddonComponent(0xE91), 0, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE92), 0, -1, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE93), 0, -2, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
this.AddComponent(new CannonAddonComponent(0xE8E), 0, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE8F), 1, 0, 0);
|
||||
this.AddComponent(new CannonAddonComponent(0xE90), 2, 0, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CannonAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
CannonDeed deed = new CannonDeed();
|
||||
deed.Charges = this.m_Charges;
|
||||
deed.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CannonDirection CannonDirection
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_CannonDirection;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Charges = value;
|
||||
|
||||
foreach (AddonComponent c in this.Components)
|
||||
c.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
|
||||
foreach (AddonComponent c in this.Components)
|
||||
c.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnComponentUsed(AddonComponent c, Mobile from)
|
||||
{
|
||||
if (from.InRange(this.Location, 2))
|
||||
{
|
||||
if (this.m_Charges > 0)
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.Backpack != null)
|
||||
{
|
||||
PotionKeg keg = from.Backpack.FindItemByType(typeof(PotionKeg)) as PotionKeg;
|
||||
|
||||
if (this.Validate(keg) > 0)
|
||||
from.SendGump(new InternalGump(this, keg));
|
||||
else
|
||||
from.SendLocalizedMessage(1076198); // You do not have a full keg of explosion potions needed to recharge the cannon.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1076766); // That is too far away.
|
||||
}
|
||||
|
||||
public int Validate(PotionKeg keg)
|
||||
{
|
||||
if (keg != null && !keg.Deleted && keg.Held == 100)
|
||||
{
|
||||
if (keg.Type == PotionEffect.ExplosionLesser)
|
||||
return 5;
|
||||
else if (keg.Type == PotionEffect.Explosion)
|
||||
return 10;
|
||||
else if (keg.Type == PotionEffect.ExplosionGreater)
|
||||
return 15;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void Fill(Mobile from, PotionKeg keg)
|
||||
{
|
||||
this.Charges = this.Validate(keg);
|
||||
|
||||
if (this.Charges > 0)
|
||||
{
|
||||
keg.Delete();
|
||||
from.SendLocalizedMessage(1076199); // Your cannon is recharged.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1076198); // You do not have a full keg of explosion potions needed to recharge the cannon.
|
||||
}
|
||||
|
||||
public void DoFireEffect(IPoint3D target)
|
||||
{
|
||||
Map map = this.Map;
|
||||
|
||||
if (target == null || map == null)
|
||||
return;
|
||||
|
||||
Effects.PlaySound(target, map, Utility.RandomList(0x11B, 0x11C, 0x11D));
|
||||
Effects.SendLocationEffect(target, map, Utility.RandomList(m_Effects), 16, 1);
|
||||
|
||||
for (int count = Utility.Random(3); count > 0; count--)
|
||||
{
|
||||
IPoint3D location = new Point3D(target.X + Utility.RandomMinMax(-1, 1), target.Y + Utility.RandomMinMax(-1, 1), target.Z);
|
||||
int effect = Utility.RandomList(m_Effects);
|
||||
Effects.SendLocationEffect(location, map, effect, 16, 1);
|
||||
}
|
||||
|
||||
this.Charges -= 1;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((int)this.m_CannonDirection);
|
||||
writer.Write((int)this.m_Charges);
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_CannonDirection = (CannonDirection)reader.ReadInt();
|
||||
this.m_Charges = reader.ReadInt();
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly CannonAddon m_Cannon;
|
||||
public InternalTarget(CannonAddon cannon)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
this.m_Cannon = cannon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (this.m_Cannon == null || this.m_Cannon.Deleted)
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if (p == null)
|
||||
return;
|
||||
|
||||
if (from.InLOS(new Point3D(p)))
|
||||
{
|
||||
if (!Utility.InRange(new Point3D(p), this.m_Cannon.Location, 2))
|
||||
{
|
||||
bool allow = false;
|
||||
|
||||
int x = p.X - this.m_Cannon.X;
|
||||
int y = p.Y - this.m_Cannon.Y;
|
||||
|
||||
switch ( this.m_Cannon.CannonDirection )
|
||||
{
|
||||
case CannonDirection.North:
|
||||
if (y < 0 && Math.Abs(x) <= -y / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.East:
|
||||
if (x > 0 && Math.Abs(y) <= x / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.South:
|
||||
if (y > 0 && Math.Abs(x) <= y / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.West:
|
||||
if (x < 0 && Math.Abs(y) <= -x / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (allow && Utility.InRange(new Point3D(p), this.m_Cannon.Location, 14))
|
||||
this.m_Cannon.DoFireEffect(p);
|
||||
else
|
||||
from.SendLocalizedMessage(1076203); // Target out of range.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1076215); // Cannon must be aimed farther away.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1049630); // You cannot see that target!
|
||||
}
|
||||
|
||||
protected override void OnTargetOutOfRange(Mobile from, object targeted)
|
||||
{
|
||||
from.SendLocalizedMessage(1076203); // Target out of range.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly CannonAddon m_Cannon;
|
||||
private readonly PotionKeg m_Keg;
|
||||
public InternalGump(CannonAddon cannon, PotionKeg keg)
|
||||
: base(50, 50)
|
||||
{
|
||||
this.m_Cannon = cannon;
|
||||
this.m_Keg = keg;
|
||||
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
this.AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
|
||||
this.AddHtmlLocalized(9, 9, 272, 100, 1076196, cannon.Validate(keg).ToString(), 0x7FFF, false, false); // You will need a full keg of explosion potions to recharge the cannon. Your keg will provide ~1_CHARGES~ charges.
|
||||
|
||||
this.AddButton(5, 107, 0xFB1, 0xFB2, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
|
||||
this.AddButton(160, 107, 0xFB7, 0xFB8, (int)Buttons.Recharge, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(195, 109, 120, 20, 1076197, 0x7FFF, false, false); // Recharge
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
Recharge
|
||||
}
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (this.m_Cannon == null || this.m_Cannon.Deleted)
|
||||
return;
|
||||
|
||||
if (info.ButtonID == (int)Buttons.Recharge)
|
||||
this.m_Cannon.Fill(state.Mobile, this.m_Keg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CannonDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
private CannonDirection m_Direction;
|
||||
private int m_Charges;
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public CannonDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CannonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076195;
|
||||
}
|
||||
}// A deed for a cannon
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
CannonAddon addon = new CannonAddon(this.m_Direction);
|
||||
addon.Charges = this.m_Charges;
|
||||
addon.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Charges = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076223); // 7th Year Veteran Reward
|
||||
|
||||
list.Add(1076207, this.m_Charges.ToString()); // Remaining Charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((int)this.m_Charges);
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Charges = reader.ReadInt();
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)CannonDirection.South, 1075386); // South
|
||||
list.Add((int)CannonDirection.East, 1075387); // East
|
||||
list.Add((int)CannonDirection.North, 1075389); // North
|
||||
list.Add((int)CannonDirection.West, 1075390); // West
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int option)
|
||||
{
|
||||
this.m_Direction = (CannonDirection)option;
|
||||
|
||||
if (!this.Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Scripts/Items/Addons/CherryBlossomTree.cs
Normal file
84
Scripts/Items/Addons/CherryBlossomTree.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CherryBlossomTreeAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public CherryBlossomTreeAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0x26EE, 1076268), 0, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0x3122, 1076268), 0, 0, 0);
|
||||
}
|
||||
|
||||
public CherryBlossomTreeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CherryBlossomTreeDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CherryBlossomTreeDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public CherryBlossomTreeDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CherryBlossomTreeDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CherryBlossomTreeAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076268;
|
||||
}
|
||||
}// Cherry Blossom Tree
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Items/Addons/CherryBlossomTrunk.cs
Normal file
83
Scripts/Items/Addons/CherryBlossomTrunk.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CherryBlossomTrunkAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public CherryBlossomTrunkAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0x26EE, 1076784), 0, 0, 0);
|
||||
}
|
||||
|
||||
public CherryBlossomTrunkAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CherryBlossomTrunkDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CherryBlossomTrunkDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public CherryBlossomTrunkDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CherryBlossomTrunkDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CherryBlossomTrunkAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076784;
|
||||
}
|
||||
}// Cherry Blossom Trunk
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Scripts/Items/Addons/CinnamonFancyRug.cs
Normal file
91
Scripts/Items/Addons/CinnamonFancyRug.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CinnamonFancyRugAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public CinnamonFancyRugAddon()
|
||||
: base()
|
||||
{
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE3, 1076587), 1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE4, 1076587), -1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE5, 1076587), -1, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE6, 1076587), 1, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE7, 1076587), -1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE8, 1076587), 0, -1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAE9, 1076587), 1, 0, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAEA, 1076587), 0, 1, 0);
|
||||
this.AddComponent(new LocalizedAddonComponent(0xAEB, 1076587), 0, 0, 0);
|
||||
}
|
||||
|
||||
public CinnamonFancyRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CinnamonFancyRugDeed();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CinnamonFancyRugDeed : BaseAddonDeed
|
||||
{
|
||||
[Constructable]
|
||||
public CinnamonFancyRugDeed()
|
||||
: base()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CinnamonFancyRugDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CinnamonFancyRugAddon();
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076587;
|
||||
}
|
||||
}// Cinnamon fancy rug
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
153
Scripts/Items/Addons/ClawFootTub.cs
Normal file
153
Scripts/Items/Addons/ClawFootTub.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ClawFootTubAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public ClawFootTubAddon(DirectionType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DirectionType.South:
|
||||
AddComponent(new LocalizedAddonComponent(0x996D, 1123299), 0, -1, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x996C, 1123299), 0, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x996B, 1123299), 0, 1, 0);
|
||||
break;
|
||||
case DirectionType.East:
|
||||
AddComponent(new LocalizedAddonComponent(0x9978, 1123299), -1, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9977, 1123299), 0, 0, 0);
|
||||
AddComponent(new LocalizedAddonComponent(0x9976, 1123299), 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed(AddonComponent c, Mobile from)
|
||||
{
|
||||
if ((from.InRange(c.Location, 3)))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && (house.IsOwner(from) || (house.LockDowns.ContainsKey(this) && house.LockDowns[this] == from)))
|
||||
{
|
||||
Components.ForEach(x =>
|
||||
{
|
||||
switch(x.ItemID)
|
||||
{
|
||||
case 0x996D:
|
||||
{
|
||||
x.ItemID = 0x9972;
|
||||
break;
|
||||
}
|
||||
case 0x9972:
|
||||
{
|
||||
x.ItemID = 0x996D;
|
||||
break;
|
||||
}
|
||||
case 0x9978:
|
||||
{
|
||||
x.ItemID = 0x997D;
|
||||
break;
|
||||
}
|
||||
case 0x997D:
|
||||
{
|
||||
x.ItemID = 0x9978;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public ClawFootTubAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed { get { return new ClawFootTubDeed(); } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ClawFootTubDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1154632; } } // Claw Foot Tub
|
||||
|
||||
public override BaseAddon Addon { get { return new ClawFootTubAddon(_Direction); } }
|
||||
|
||||
private DirectionType _Direction;
|
||||
|
||||
[Constructable]
|
||||
public ClawFootTubDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public ClawFootTubDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)DirectionType.South, 1075386); // South
|
||||
list.Add((int)DirectionType.East, 1075387); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
_Direction = (DirectionType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1154194)); // Choose a Facing:
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
96
Scripts/Items/Addons/CodexOfVirtue.cs
Normal file
96
Scripts/Items/Addons/CodexOfVirtue.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CodexOfVirtueAddon : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public CodexOfVirtueAddon()
|
||||
{
|
||||
AddComponent(new AddonComponent(16637), 3, 3, 0);
|
||||
AddComponent(new AddonComponent(16636), 2, 3, 0);
|
||||
AddComponent(new AddonComponent(16635), 1, 3, 0);
|
||||
AddComponent(new AddonComponent(16634), 0, 3, 0);
|
||||
AddComponent(new AddonComponent(16633), -1, 3, 0);
|
||||
AddComponent(new AddonComponent(16632), -2, 3, 0);
|
||||
AddComponent(new AddonComponent(16631), 3, 2, 0);
|
||||
AddComponent(new AddonComponent(16630), 2, 2, 0);
|
||||
AddComponent(new AddonComponent(16629), 1, 2, 0);
|
||||
AddComponent(new AddonComponent(16628), 0, 2, 0);
|
||||
AddComponent(new AddonComponent(16627), -1, 2, 0);
|
||||
AddComponent(new AddonComponent(16626), -2, 2, 0);
|
||||
AddComponent(new AddonComponent(16625), 3, 1, 0);
|
||||
AddComponent(new AddonComponent(16624), 2, 1, 0);
|
||||
AddComponent(new AddonComponent(16623), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(16622), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(16621), -1, 1, 0);
|
||||
AddComponent(new AddonComponent(16620), -2, 1, 0);
|
||||
AddComponent(new AddonComponent(16619), 3, 0, 0);
|
||||
AddComponent(new AddonComponent(16618), 2, 0, 0);
|
||||
AddComponent(new AddonComponent(16617), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(16616), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(16615), -1, 0, 0);
|
||||
AddComponent(new AddonComponent(16614), -2, 0, 0);
|
||||
AddComponent(new AddonComponent(16613), 3, -1, 0);
|
||||
AddComponent(new AddonComponent(16612), 2, -1, 0);
|
||||
AddComponent(new AddonComponent(16611), 1, -1, 0);
|
||||
AddComponent(new AddonComponent(16610), 0, -1, 0);
|
||||
AddComponent(new AddonComponent(16609), -1, -1, 0);
|
||||
AddComponent(new AddonComponent(16608), -2, -1, 0);
|
||||
AddComponent(new AddonComponent(16607), 3, -2, 0);
|
||||
AddComponent(new AddonComponent(16606), 2, -2, 0);
|
||||
AddComponent(new AddonComponent(16605), 1, -2, 0);
|
||||
AddComponent(new AddonComponent(16604), 0, -2, 0);
|
||||
AddComponent(new AddonComponent(16603), -1, -2, 0);
|
||||
AddComponent(new AddonComponent(16602), -2, -2, 0);
|
||||
}
|
||||
|
||||
public CodexOfVirtueAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed { get { return new CodexOfVirtueDeed(); } }
|
||||
|
||||
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 CodexOfVirtueDeed : BaseAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1113919; } }// a Codex of Virtue deed
|
||||
|
||||
[Constructable]
|
||||
public CodexOfVirtueDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public CodexOfVirtueDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon { get { return new CodexOfVirtueAddon(); } }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Addons/ColoredAnvil.cs
Normal file
40
Scripts/Items/Addons/ColoredAnvil.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Anvil, Flipable(0xFAF, 0xFB0)]
|
||||
public class ColoredAnvil : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ColoredAnvil()
|
||||
: this(CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite)))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ColoredAnvil(int hue)
|
||||
: base(0xFAF)
|
||||
{
|
||||
this.Hue = hue;
|
||||
this.Weight = 20;
|
||||
}
|
||||
|
||||
public ColoredAnvil(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
139
Scripts/Items/Addons/ContestMiniHouse.cs
Normal file
139
Scripts/Items/Addons/ContestMiniHouse.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ContestMiniHouse : MiniHouseAddon
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouse()
|
||||
: base(MiniHouseType.MalasMountainPass)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouse(MiniHouseType type)
|
||||
: base(type)
|
||||
{
|
||||
}
|
||||
|
||||
public ContestMiniHouse(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
ContestMiniHouseDeed deed = new ContestMiniHouseDeed(Type);
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class ContestMiniHouseDeed : MiniHouseDeed, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouseDeed()
|
||||
: base(MiniHouseType.MalasMountainPass)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouseDeed(MiniHouseType type)
|
||||
: base(type)
|
||||
{
|
||||
}
|
||||
|
||||
public ContestMiniHouseDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
ContestMiniHouse addon = new ContestMiniHouse(Type);
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, new object[] { Type }))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && m_IsRewardItem)
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Addons/CorporealBrumeStatuette.cs
Normal file
40
Scripts/Items/Addons/CorporealBrumeStatuette.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorporealBrumeStatuette : ShimmeringEffusionStatuette
|
||||
{
|
||||
[Constructable]
|
||||
public CorporealBrumeStatuette()
|
||||
: base(0x2D94)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public CorporealBrumeStatuette(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074506;
|
||||
}
|
||||
}// Corporeal Brume Statuette
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
281
Scripts/Items/Addons/Craft Addons/AddonToolComponenet.cs
Normal file
281
Scripts/Items/Addons/Craft Addons/AddonToolComponenet.cs
Normal file
@@ -0,0 +1,281 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AddonToolComponent : BaseTool, IChopable
|
||||
{
|
||||
private CraftSystem _CraftSystem;
|
||||
private int _LabelNumber;
|
||||
private bool _TurnedOn;
|
||||
|
||||
public override CraftSystem CraftSystem { get { return _CraftSystem; } }
|
||||
public override bool BreakOnDepletion { get { return false; } }
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
public override int LabelNumber { get { return _LabelNumber; } }
|
||||
|
||||
public virtual bool NeedsWall { get { return false; } }
|
||||
public virtual int MaxUses { get { return 5000; } }
|
||||
public virtual Point3D WallPosition { get { return Point3D.Zero; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftAddon Addon { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D Offset { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int InactiveID { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int ActiveID { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int InactiveMessage { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int ActiveMessage { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool TurnedOn
|
||||
{
|
||||
get
|
||||
{
|
||||
return _TurnedOn;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_TurnedOn != value)
|
||||
{
|
||||
if (value)
|
||||
ItemID = ActiveID;
|
||||
else
|
||||
ItemID = InactiveID;
|
||||
}
|
||||
|
||||
_TurnedOn = value;
|
||||
}
|
||||
}
|
||||
|
||||
public AddonToolComponent(CraftSystem system, int inactiveid, int activeid, int cliloc, int uses, CraftAddon addon)
|
||||
: this(system, inactiveid, activeid, 0, 0, cliloc, uses, addon)
|
||||
{
|
||||
}
|
||||
|
||||
public AddonToolComponent(CraftSystem system, int inactiveid, int activeid, int inactivemessage, int activemessage, int cliloc, int uses, CraftAddon addon)
|
||||
: base(0, inactiveid)
|
||||
{
|
||||
_CraftSystem = system;
|
||||
_LabelNumber = cliloc;
|
||||
Addon = addon;
|
||||
Movable = false;
|
||||
|
||||
InactiveID = inactiveid;
|
||||
ActiveID = activeid;
|
||||
|
||||
InactiveMessage = inactivemessage;
|
||||
ActiveMessage = activemessage;
|
||||
|
||||
UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (Addon != null && from.InRange(GetWorldLocation(), 3))
|
||||
Addon.OnChop(from);
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Addon == null)
|
||||
return;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && house.HasSecureAccess(from, Addon.Level))
|
||||
{
|
||||
list.Add(new SimpleContextMenuEntry(from, 1155742, m => // Toggle: On/Off
|
||||
{
|
||||
if (_TurnedOn)
|
||||
{
|
||||
TurnedOn = false;
|
||||
|
||||
if (InactiveMessage != 0)
|
||||
PrivateOverheadMessage(MessageType.Regular, 0x3B2, InactiveMessage, from.NetState);
|
||||
}
|
||||
else
|
||||
{
|
||||
TurnedOn = true;
|
||||
|
||||
if (ActiveMessage != 0)
|
||||
{
|
||||
PrivateOverheadMessage(MessageType.Regular, 0x3B2, ActiveMessage, from.NetState);
|
||||
from.PlaySound(84);
|
||||
}
|
||||
}
|
||||
}, 8));
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, Addon, list);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckAccessible(Mobile m, ref int num)
|
||||
{
|
||||
if (m.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(m);
|
||||
|
||||
if (house == null || Addon == null || !house.HasSecureAccess(m, Addon.Level))
|
||||
{
|
||||
num = 1061637; // You are not allowed to access
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num = 500295;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.OnCraftComponentUsed(from, this);
|
||||
}
|
||||
|
||||
public void SetCraftSystem(CraftSystem system)
|
||||
{
|
||||
_CraftSystem = system;
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Location = new Point3D(X - Offset.X, Y - Offset.Y, Z - Offset.Z);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (Addon != null)
|
||||
Addon.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (Addon != null)
|
||||
Addon.Delete();
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && Addon != null && house.HasSecureAccess(from, Addon.Level))
|
||||
{
|
||||
if (dropped is ITool && !(dropped is BaseRunicTool))
|
||||
{
|
||||
var tool = dropped as ITool;
|
||||
|
||||
if (tool.CraftSystem == _CraftSystem)
|
||||
{
|
||||
if (UsesRemaining >= MaxUses)
|
||||
{
|
||||
from.SendLocalizedMessage(1155740); // Adding this to the power tool would put it over the max number of charges the tool can hold.
|
||||
}
|
||||
else
|
||||
{
|
||||
int toadd = Math.Min(tool.UsesRemaining, MaxUses - UsesRemaining);
|
||||
|
||||
UsesRemaining += toadd;
|
||||
tool.UsesRemaining -= toadd;
|
||||
|
||||
if (tool.UsesRemaining <= 0 && !tool.Deleted)
|
||||
tool.Delete();
|
||||
|
||||
from.SendLocalizedMessage(1155741); // Charges have been added to the power tool.
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container cannot hold that type of object.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container cannot hold that type of object.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container cannot hold that type of object.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public AddonToolComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(InactiveMessage);
|
||||
writer.Write(ActiveMessage);
|
||||
writer.Write(Offset);
|
||||
writer.Write(Addon);
|
||||
writer.Write(_LabelNumber);
|
||||
writer.Write(ActiveID);
|
||||
writer.Write(InactiveID);
|
||||
writer.Write(TurnedOn);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
InactiveMessage = reader.ReadInt();
|
||||
ActiveMessage = reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Offset = reader.ReadPoint3D();
|
||||
Addon = reader.ReadItem() as CraftAddon;
|
||||
_LabelNumber = reader.ReadInt();
|
||||
ActiveID = reader.ReadInt();
|
||||
InactiveID = reader.ReadInt();
|
||||
TurnedOn = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Addon != null)
|
||||
Addon.OnCraftComponentLoaded(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
96
Scripts/Items/Addons/Craft Addons/AlchemyStation.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/AlchemyStation.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlchemyStation : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new AlchemyStationDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefAlchemy.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public AlchemyStation(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40323, 40324, 1157070, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40332, 1157070), 1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40334, 40335, 1157070, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40343, 1157070), 0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public AlchemyStation(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AlchemyStationDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1157070; } } // Alchemy Station
|
||||
public override BaseAddon Addon { get { return new AlchemyStation(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public AlchemyStationDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AlchemyStationDeed(int uses) : base(uses)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new SouthEastGump(s =>
|
||||
{
|
||||
_South = s;
|
||||
base.OnDoubleClick(from);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public AlchemyStationDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
96
Scripts/Items/Addons/Craft Addons/BBQSmoker.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/BBQSmoker.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BBQSmoker : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new BBQSmokerDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefCooking.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public BBQSmoker(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40344, 40345, 1157071, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40349, 1157071), -1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40350, 40351, 1157071, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40355, 1157071), 0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public BBQSmoker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BBQSmokerDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1157071; } } // BBQ Smoker
|
||||
public override BaseAddon Addon { get { return new BBQSmoker(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public BBQSmokerDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BBQSmokerDeed(int uses) : base(uses)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new SouthEastGump(s =>
|
||||
{
|
||||
_South = s;
|
||||
base.OnDoubleClick(from);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public BBQSmokerDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
264
Scripts/Items/Addons/Craft Addons/CraftAddon.cs
Normal file
264
Scripts/Items/Addons/Craft Addons/CraftAddon.cs
Normal file
@@ -0,0 +1,264 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
using System.Linq;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class CraftAddon : BaseAddon, Server.Gumps.ISecurable
|
||||
{
|
||||
public List<AddonToolComponent> Tools { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
public abstract CraftSystem CraftSystem { get; }
|
||||
|
||||
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||
public override int Hue
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Hue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (base.Hue != value)
|
||||
{
|
||||
base.Hue = value;
|
||||
|
||||
if (!Deleted && ShareHue && Tools != null)
|
||||
{
|
||||
foreach (AddonToolComponent tool in Tools)
|
||||
tool.Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed { get { return null; } }
|
||||
|
||||
[Constructable]
|
||||
public CraftAddon()
|
||||
{
|
||||
Tools = new List<AddonToolComponent>();
|
||||
}
|
||||
|
||||
public void AddCraftComponent(AddonToolComponent tool, int x, int y, int z)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
Tools.Add(tool);
|
||||
Level = SecureLevel.CoOwners;
|
||||
|
||||
tool.Addon = this;
|
||||
tool.Offset = new Point3D(x, y, z);
|
||||
tool.MoveToWorld(new Point3D(X + x, Y + y, Z + z), Map);
|
||||
}
|
||||
|
||||
public override AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house)
|
||||
{
|
||||
AddonFitResult result = base.CouldFit(p, map, from, ref house);
|
||||
|
||||
if (result == AddonFitResult.Valid)
|
||||
{
|
||||
foreach (AddonToolComponent c in Tools)
|
||||
{
|
||||
Point3D p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
|
||||
|
||||
if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0)))
|
||||
return AddonFitResult.Blocked;
|
||||
else if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house))
|
||||
return AddonFitResult.NotInHouse;
|
||||
|
||||
if (c.NeedsWall)
|
||||
{
|
||||
Point3D wall = c.WallPosition;
|
||||
|
||||
if (!BaseAddon.IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map))
|
||||
return AddonFitResult.NoWall;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void OnCraftComponentUsed(Mobile from, AddonToolComponent tool)
|
||||
{
|
||||
if (!tool.TurnedOn)
|
||||
return;
|
||||
|
||||
if (from.InRange(tool.Location, 2))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && house.HasSecureAccess(from, Level))
|
||||
{
|
||||
from.SendGump(new CraftGump(from, CraftSystem, tool, null));
|
||||
}
|
||||
else
|
||||
{
|
||||
tool.PublicOverheadMessage(MessageType.Regular, 0x3E9, 1061637); // You are not allowed to access this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500325); // I am too far away to do that.
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnCraftComponentLoaded(AddonToolComponent tool)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
base.OnLocationChange(old);
|
||||
|
||||
Tools.ForEach(t => t.Location = new Point3D(X + t.Offset.X, Y + t.Offset.Y, Z + t.Offset.Z));
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
Tools.ForEach(t => t.Map = Map);
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
Tools.ForEach(t => t.Delete());
|
||||
}
|
||||
|
||||
public CraftAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write((int)Level);
|
||||
|
||||
writer.Write(Tools.Count);
|
||||
Tools.ForEach(t => writer.Write(t));
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
|
||||
Tools = new List<AddonToolComponent>();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
AddonToolComponent tool = reader.ReadItem() as AddonToolComponent;
|
||||
|
||||
if (tool != null)
|
||||
{
|
||||
tool.SetCraftSystem(CraftSystem);
|
||||
Tools.Add(tool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ToolDropComponent : LocalizedAddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public ToolDropComponent(int id, int cliloc)
|
||||
: base(id, cliloc)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
CraftAddon addon = Addon as CraftAddon;
|
||||
|
||||
if (house != null && addon != null && house.HasSecureAccess(from, addon.Level))
|
||||
{
|
||||
if (dropped is ITool && !(dropped is BaseRunicTool))
|
||||
{
|
||||
var tool = dropped as ITool;
|
||||
|
||||
if (tool.CraftSystem == addon.CraftSystem)
|
||||
{
|
||||
AddonToolComponent comp = addon.Tools.FirstOrDefault(t => t != null);
|
||||
|
||||
if (comp == null)
|
||||
return false;
|
||||
|
||||
if (comp.UsesRemaining >= comp.MaxUses)
|
||||
{
|
||||
from.SendLocalizedMessage(1155740); // Adding this to the power tool would put it over the max number of charges the tool can hold.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int toadd = Math.Min(tool.UsesRemaining, comp.MaxUses - comp.UsesRemaining);
|
||||
|
||||
comp.UsesRemaining += toadd;
|
||||
tool.UsesRemaining -= toadd;
|
||||
|
||||
if (tool.UsesRemaining <= 0 && !tool.Deleted)
|
||||
tool.Delete();
|
||||
|
||||
from.SendLocalizedMessage(1155741); // Charges have been added to the power tool.
|
||||
|
||||
Effects.PlaySound(Location, Map, 0x42);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container cannot hold that type of object.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1074836); // The container cannot hold that type of object.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendLocalizedMessageTo(from, 1061637); // You are not allowed to access this.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public ToolDropComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Addons/Craft Addons/CraftAddonDeed.cs
Normal file
51
Scripts/Items/Addons/Craft Addons/CraftAddonDeed.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class CraftAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public int UsesRemaining { get; set; }
|
||||
|
||||
public CraftAddonDeed(int uses)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060584, UsesRemaining.ToString());
|
||||
}
|
||||
|
||||
public CraftAddonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
UsesRemaining = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
167
Scripts/Items/Addons/Craft Addons/EnchantedSculptingTool.cs
Normal file
167
Scripts/Items/Addons/Craft Addons/EnchantedSculptingTool.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedSculptingToolAddon : CraftAddon
|
||||
{
|
||||
public override CraftSystem CraftSystem { get { return DefMasonry.CraftSystem; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
EnchantedSculptingToolDeed deed = new EnchantedSculptingToolDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0)
|
||||
{
|
||||
IsRewardItem = IsRewardItem
|
||||
};
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnchantedSculptingToolAddon(DirectionType type, int uses)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DirectionType.South:
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 0xA538, 0xA541, 1157988, 1157987, 1029241, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(0xA549, 1029241), 0, 1, 0);
|
||||
break;
|
||||
case DirectionType.East:
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 0xA540, 0xA539, 1157988, 1157987, 1029241, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(0xA548, 1029241), 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public EnchantedSculptingToolAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write((bool)IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class EnchantedSculptingToolDeed : CraftAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1159421; } } // Enchanted Sculpting Tool
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
EnchantedSculptingToolAddon addon = new EnchantedSculptingToolAddon(_Direction, UsesRemaining)
|
||||
{
|
||||
IsRewardItem = m_IsRewardItem
|
||||
};
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private DirectionType _Direction;
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnchantedSculptingToolDeed()
|
||||
: this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnchantedSculptingToolDeed(int uses)
|
||||
: base(uses)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public EnchantedSculptingToolDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_IsRewardItem)
|
||||
list.Add(1076223); // 7th Year Veteran Reward
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)DirectionType.South, 1075386); // South
|
||||
list.Add((int)DirectionType.East, 1075387); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
_Direction = (DirectionType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1154194)); // Choose a Facing:
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
96
Scripts/Items/Addons/Craft Addons/FletchingStation.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/FletchingStation.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FletchingStation : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new FletchingStationDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefBowFletching.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public FletchingStation(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39982, 39983, 1124006, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40004, 1124006), -1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39992, 39993, 1124006, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40003, 1124006), 1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public FletchingStation(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FletchingStationDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1156370; } } // Fletching Station
|
||||
public override BaseAddon Addon { get { return new FletchingStation(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public FletchingStationDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FletchingStationDeed(int uses) : base(uses)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new SouthEastGump(s =>
|
||||
{
|
||||
_South = s;
|
||||
base.OnDoubleClick(from);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public FletchingStationDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user