Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
167
Scripts/Items/Addons/Craft Addons/GlassKiln.cs
Normal file
167
Scripts/Items/Addons/Craft Addons/GlassKiln.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 GlassKilnAddon : CraftAddon
|
||||
{
|
||||
public override CraftSystem CraftSystem { get { return DefGlassblowing.CraftSystem; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
GlassKilnDeed deed = new GlassKilnDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0)
|
||||
{
|
||||
IsRewardItem = IsRewardItem
|
||||
};
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GlassKilnAddon(DirectionType type, int uses)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DirectionType.South:
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 0xA530, 0xA531, 1157072, 1157073, 1126312, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(0xA52E, 1015081), 0, 1, 0);
|
||||
break;
|
||||
case DirectionType.East:
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 0xA534, 0xA535, 1157072, 1157073, 1126312, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(0xA52F, 1015081), 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public GlassKilnAddon(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 GlassKilnDeed : CraftAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1159420; } } // Glass Kiln
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
GlassKilnAddon addon = new GlassKilnAddon(_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 GlassKilnDeed()
|
||||
: this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GlassKilnDeed(int uses)
|
||||
: base(uses)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public GlassKilnDeed(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/SewingMachine.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/SewingMachine.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SewingMachine : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SewingMachineDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefTailoring.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public SewingMachine(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39496, 39480, 1123504, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(39498, 1123522), -1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39497, 39488, 1123504, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(39498, 1123522), 0, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public SewingMachine(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 SewingMachineDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1123504; } } // Sewing Machine
|
||||
public override BaseAddon Addon { get { return new SewingMachine(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public SewingMachineDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SewingMachineDeed(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 SewingMachineDeed(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/SmithingPress.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/SmithingPress.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmithingPress : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SmithingPressDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefBlacksmithy.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public SmithingPress(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39592, 39553, 1123577, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(39569, 1123593), -1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39593, 39561, 1123577, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(39569, 1123593), 0, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public SmithingPress(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 SmithingPressDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1123577; } } // smithing press
|
||||
public override BaseAddon Addon { get { return new SmithingPress(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public SmithingPressDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmithingPressDeed(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 SmithingPressDeed(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/SpinningLathe.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/SpinningLathe.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpinningLathe : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SpinningLatheDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefCarpentry.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public SpinningLathe(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39962, 39963, 1156369, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40006, 1024014), -1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 39972, 39973, 1156369, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40007, 1024014), 0, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public SpinningLathe(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 SpinningLatheDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1156369; } } // spinning lathe
|
||||
public override BaseAddon Addon { get { return new SpinningLathe(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public SpinningLatheDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpinningLatheDeed(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 SpinningLatheDeed(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/WritingDesk.cs
Normal file
96
Scripts/Items/Addons/Craft Addons/WritingDesk.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WritingDesk : CraftAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new WritingDeskDeed(Tools.Count > 0 ? Tools[0].UsesRemaining : 0); } }
|
||||
public override CraftSystem CraftSystem { get { return DefInscription.CraftSystem; } }
|
||||
|
||||
[Constructable]
|
||||
public WritingDesk(bool south, int uses)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40938, 40939, 1124962, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40953, 1124962), 1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddCraftComponent(new AddonToolComponent(CraftSystem, 40945, 40946, 1124962, uses, this), 0, 0, 0);
|
||||
AddComponent(new ToolDropComponent(40952, 1124962), 0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public WritingDesk(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 WritingDeskDeed : CraftAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1157989; } } // Enchanted Writing Desk
|
||||
public override BaseAddon Addon { get { return new WritingDesk(_South, UsesRemaining); } }
|
||||
|
||||
private bool _South;
|
||||
|
||||
[Constructable]
|
||||
public WritingDeskDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WritingDeskDeed(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 WritingDeskDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user