fix(core): Converts some packets & misc fixes/cleanup (#414)
- [X] Adds a stop music packet - [X] Converts chat packets - [X] Breaks out chat code a little bit more - [X] Converts character statue animation packet - [X] Renames some folders to have spaces - [X] Organizes and consolidates incoming/outgoing packets for other content - [X] Fixes virtual checks
This commit is contained in:
parent
a146955f6c
commit
fbafd7210d
49 changed files with 814 additions and 662 deletions
86
Projects/UOContent/Special Systems/Engines/GiftGiving.cs
Normal file
86
Projects/UOContent/Special Systems/Engines/GiftGiving.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Accounting;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public enum GiftResult
|
||||
{
|
||||
Backpack,
|
||||
BankBox
|
||||
}
|
||||
|
||||
public static class GiftGiving
|
||||
{
|
||||
private static readonly List<GiftGiver> m_Givers = new();
|
||||
|
||||
public static void Register(GiftGiver giver)
|
||||
{
|
||||
m_Givers.Add(giver);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if (!(m.Account is Account acct))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
for (var i = 0; i < m_Givers.Count; ++i)
|
||||
{
|
||||
var giver = m_Givers[i];
|
||||
|
||||
if (now < giver.Start || now >= giver.Finish)
|
||||
{
|
||||
continue; // not in the correct time frame
|
||||
}
|
||||
|
||||
if (acct.Created > giver.Start - giver.MinimumAge)
|
||||
{
|
||||
continue; // newly created account
|
||||
}
|
||||
|
||||
if (acct.LastLogin >= giver.Start)
|
||||
{
|
||||
continue; // already got one
|
||||
}
|
||||
|
||||
giver.DelayGiveGift(TimeSpan.FromSeconds(5.0), m);
|
||||
}
|
||||
|
||||
acct.LastLogin = now;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class GiftGiver
|
||||
{
|
||||
public virtual TimeSpan MinimumAge => TimeSpan.FromDays(30.0);
|
||||
|
||||
public abstract DateTime Start { get; }
|
||||
public abstract DateTime Finish { get; }
|
||||
public abstract void GiveGift(Mobile mob);
|
||||
|
||||
public virtual void DelayGiveGift(TimeSpan delay, Mobile mob)
|
||||
{
|
||||
Timer.DelayCall(delay, GiveGift, mob);
|
||||
}
|
||||
|
||||
public virtual GiftResult GiveGift(Mobile mob, Item item)
|
||||
{
|
||||
if (mob.PlaceInBackpack(item) && !WeightOverloading.IsOverloaded(mob))
|
||||
{
|
||||
return GiftResult.Backpack;
|
||||
}
|
||||
|
||||
mob.BankBox.DropItem(item);
|
||||
return GiftResult.BankBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Projects/UOContent/Special Systems/Engines/ItemFixes.cs
Normal file
16
Projects/UOContent/Special Systems/Engines/ItemFixes.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
namespace Server.Misc
|
||||
{
|
||||
public static class ItemFixes
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
// Missing NoShoot flags
|
||||
TileData.ItemTable[0x2A0].Flags |= TileFlag.NoShoot;
|
||||
TileData.ItemTable[0x3E0].Flags |= TileFlag.NoShoot;
|
||||
TileData.ItemTable[0x3E1].Flags |= TileFlag.NoShoot;
|
||||
|
||||
// Incorrect height
|
||||
TileData.ItemTable[0x34D2].Height = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
/*
|
||||
* This system prevents the inability for server staff to
|
||||
* access their server due to data overflows during login.
|
||||
*
|
||||
* Whenever a staff character's NetState is disposed right after
|
||||
* the login process, the character is moved to and logged out
|
||||
* at a "safe" alternative.
|
||||
*
|
||||
* The location the character was moved from will be reported
|
||||
* to the player upon the next successful login.
|
||||
*
|
||||
* This system does not affect non-staff players.
|
||||
*/
|
||||
public static class PreventInaccess
|
||||
{
|
||||
public static readonly bool Enabled = true;
|
||||
|
||||
private static readonly LocationInfo[] m_Destinations =
|
||||
{
|
||||
new(new Point3D(5275, 1163, 0), Map.Felucca), // Jail
|
||||
new(new Point3D(5275, 1163, 0), Map.Trammel),
|
||||
new(new Point3D(5445, 1153, 0), Map.Felucca), // Green acres
|
||||
new(new Point3D(5445, 1153, 0), Map.Trammel)
|
||||
};
|
||||
|
||||
private static Dictionary<Mobile, LocationInfo> m_MoveHistory;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_MoveHistory = new Dictionary<Mobile, LocationInfo>();
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
EventSink.Login += OnLogin;
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnLogin(Mobile from)
|
||||
{
|
||||
if (from == null || from.AccessLevel < AccessLevel.Counselor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasDisconnected(from))
|
||||
{
|
||||
if (!m_MoveHistory.ContainsKey(from))
|
||||
{
|
||||
m_MoveHistory[from] = new LocationInfo(from.Location, from.Map);
|
||||
}
|
||||
|
||||
var dest = GetRandomDestination();
|
||||
|
||||
from.Location = dest.Location;
|
||||
from.Map = dest.Map;
|
||||
}
|
||||
else if (m_MoveHistory.Remove(from, out var orig))
|
||||
{
|
||||
from.SendMessage(
|
||||
"Your character was moved from {0} ({1}) due to a detected client crash.",
|
||||
orig.Location,
|
||||
orig.Map
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool HasDisconnected(Mobile m) => m.NetState?.Connection == null;
|
||||
|
||||
private static LocationInfo GetRandomDestination() => m_Destinations.RandomElement();
|
||||
|
||||
private class LocationInfo
|
||||
{
|
||||
public LocationInfo(Point3D loc, Map map)
|
||||
{
|
||||
Location = loc;
|
||||
Map = map;
|
||||
}
|
||||
|
||||
public Point3D Location { get; }
|
||||
|
||||
public Map Map { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
287
Projects/UOContent/Special Systems/Engines/TestCenter.cs
Normal file
287
Projects/UOContent/Special Systems/Engines/TestCenter.cs
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using Microsoft.Toolkit.HighPerformance.Extensions;
|
||||
using Server.Commands;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public static class TestCenter
|
||||
{
|
||||
public static bool Enabled { get; private set; }
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
Enabled = ServerConfiguration.GetOrUpdateSetting("testCenter.enable", false);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
// Register our speech handler
|
||||
if (Enabled)
|
||||
{
|
||||
EventSink.Speech += EventSink_Speech;
|
||||
}
|
||||
}
|
||||
|
||||
private static void EventSink_Speech(SpeechEventArgs args)
|
||||
{
|
||||
if (args.Handled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Speech.InsensitiveStartsWith("set"))
|
||||
{
|
||||
var from = args.Mobile;
|
||||
|
||||
var tokenizer = args.Speech.Tokenize(' ');
|
||||
if (!tokenizer.MoveNext())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var name = tokenizer.MoveNext() ? tokenizer.Current : null;
|
||||
var valueStr = tokenizer.MoveNext() ? tokenizer.Current : null;
|
||||
if (valueStr == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var value = double.Parse(valueStr);
|
||||
|
||||
try
|
||||
{
|
||||
if (name.InsensitiveEquals("str"))
|
||||
{
|
||||
ChangeStrength(from, (int)value);
|
||||
}
|
||||
else if (name.InsensitiveEquals("dex"))
|
||||
{
|
||||
ChangeDexterity(from, (int)value);
|
||||
}
|
||||
else if (name.InsensitiveEquals("int"))
|
||||
{
|
||||
ChangeIntelligence(from, (int)value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeSkill(from, name.ToString(), value);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
else if (args.Speech.InsensitiveEquals("help"))
|
||||
{
|
||||
args.Mobile.SendGump(new TCHelpGump());
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ChangeStrength(Mobile from, int value)
|
||||
{
|
||||
if (value < 10 || value > 125)
|
||||
{
|
||||
from.SendLocalizedMessage(1005628); // Stats range between 10 and 125.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value + from.RawDex + from.RawInt > from.StatCap)
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005629
|
||||
); // You can not exceed the stat cap. Try setting another stat lower first.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.RawStr = value;
|
||||
from.SendLocalizedMessage(1005630); // Your stats have been adjusted.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ChangeDexterity(Mobile from, int value)
|
||||
{
|
||||
if (value < 10 || value > 125)
|
||||
{
|
||||
from.SendLocalizedMessage(1005628); // Stats range between 10 and 125.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.RawStr + value + from.RawInt > from.StatCap)
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005629
|
||||
); // You can not exceed the stat cap. Try setting another stat lower first.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.RawDex = value;
|
||||
from.SendLocalizedMessage(1005630); // Your stats have been adjusted.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ChangeIntelligence(Mobile from, int value)
|
||||
{
|
||||
if (value < 10 || value > 125)
|
||||
{
|
||||
from.SendLocalizedMessage(1005628); // Stats range between 10 and 125.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.RawStr + from.RawDex + value > from.StatCap)
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005629
|
||||
); // You can not exceed the stat cap. Try setting another stat lower first.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.RawInt = value;
|
||||
from.SendLocalizedMessage(1005630); // Your stats have been adjusted.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ChangeSkill(Mobile from, string name, double value)
|
||||
{
|
||||
if (!Enum.TryParse(name, true, out SkillName index) || !Core.SE && (int)index > 51 ||
|
||||
!Core.AOS && (int)index > 48)
|
||||
{
|
||||
from.SendLocalizedMessage(1005631); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
|
||||
var skill = from.Skills[index];
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
if (value < 0 || value > skill.Cap)
|
||||
{
|
||||
from.SendMessage($"Your skill in {skill.Info.Name} is capped at {skill.Cap:F1}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
var newFixedPoint = (int)(value * 10.0);
|
||||
var oldFixedPoint = skill.BaseFixedPoint;
|
||||
|
||||
if (skill.Owner.Total - oldFixedPoint + newFixedPoint > skill.Owner.Cap)
|
||||
{
|
||||
from.SendMessage("You can not exceed the skill cap. Try setting another skill lower first.");
|
||||
}
|
||||
else
|
||||
{
|
||||
skill.BaseFixedPoint = newFixedPoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005631); // You have specified an invalid skill to set.
|
||||
}
|
||||
}
|
||||
|
||||
public class TCHelpGump : Gump
|
||||
{
|
||||
public TCHelpGump() : base(40, 40)
|
||||
{
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 160, 120, 5054);
|
||||
|
||||
AddButton(10, 10, 0xFB7, 0xFB9, 1);
|
||||
AddLabel(45, 10, 0x34, "ModernUO");
|
||||
|
||||
AddButton(10, 35, 0xFB7, 0xFB9, 2);
|
||||
AddLabel(45, 35, 0x34, "List of skills");
|
||||
|
||||
AddButton(10, 60, 0xFB7, 0xFB9, 3);
|
||||
AddLabel(45, 60, 0x34, "Command list");
|
||||
|
||||
AddButton(10, 85, 0xFB1, 0xFB3, 0);
|
||||
AddLabel(45, 85, 0x34, "Close");
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
sender.LaunchBrowser("https://www.modernuo.com");
|
||||
break;
|
||||
}
|
||||
case 2: // List of skills
|
||||
{
|
||||
var strings = Enum.GetNames(typeof(SkillName));
|
||||
|
||||
Array.Sort(strings);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (strings.Length > 0)
|
||||
{
|
||||
sb.Append(strings[0]);
|
||||
}
|
||||
|
||||
for (var i = 1; i < strings.Length; ++i)
|
||||
{
|
||||
var v = strings[i];
|
||||
|
||||
if (sb.Length + 1 + v.Length >= 256)
|
||||
{
|
||||
sender.SendMessage(
|
||||
Server.Serial.MinusOne,
|
||||
-1,
|
||||
MessageType.Label,
|
||||
0x35,
|
||||
3,
|
||||
true,
|
||||
null,
|
||||
"System",
|
||||
sb.ToString()
|
||||
);
|
||||
|
||||
sb = new StringBuilder();
|
||||
sb.Append(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(' ');
|
||||
sb.Append(v);
|
||||
}
|
||||
}
|
||||
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
sender.SendMessage(
|
||||
Server.Serial.MinusOne,
|
||||
-1,
|
||||
MessageType.Label,
|
||||
0x35,
|
||||
3,
|
||||
true,
|
||||
null,
|
||||
"System",
|
||||
sb.ToString()
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 3: // Command list
|
||||
{
|
||||
sender.Mobile.SendAsciiMessage(0x482, "The command prefix is \"{0}\"", CommandSystem.Prefix);
|
||||
CommandHandlers.Help_OnCommand(new CommandEventArgs(sender.Mobile, "help", "", Array.Empty<string>()));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ResGate : Item
|
||||
{
|
||||
[Constructible]
|
||||
public ResGate() : base(0xF6C)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x2D1;
|
||||
Light = LightType.Circle300;
|
||||
}
|
||||
|
||||
public ResGate(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a resurrection gate";
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (!m.Alive && m.Map?.CanFit(m.Location, 16, false, false) == true)
|
||||
{
|
||||
m.PlaySound(0x214);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
m.CloseGump<ResurrectGump>();
|
||||
m.SendGump(new ResurrectGump(m));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class AlchemyStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public AlchemyStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x250;
|
||||
}
|
||||
|
||||
public AlchemyStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "an Alchemist Supply Stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var alcBag = new AlchemyBag();
|
||||
|
||||
if (!from.AddToBackpack(alcBag))
|
||||
{
|
||||
alcBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
126
Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs
Normal file
126
Projects/UOContent/Special Systems/Items/Stones/GamblingStone.cs
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class GamblingStone : Item
|
||||
{
|
||||
private int m_GamblePot = 2500;
|
||||
|
||||
[Constructible]
|
||||
public GamblingStone()
|
||||
: base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x56;
|
||||
}
|
||||
|
||||
public GamblingStone(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int GamblePot
|
||||
{
|
||||
get => m_GamblePot;
|
||||
set
|
||||
{
|
||||
m_GamblePot = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override string DefaultName => "a gambling stone";
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add("Jackpot: {0}gp", m_GamblePot);
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
LabelTo(from, "Jackpot: {0}gp", m_GamblePot);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var pack = from.Backpack;
|
||||
|
||||
if (pack?.ConsumeTotal(typeof(Gold), 250) == true)
|
||||
{
|
||||
m_GamblePot += 150;
|
||||
InvalidateProperties();
|
||||
|
||||
var roll = Utility.Random(1200);
|
||||
|
||||
if (roll == 0) // Jackpot
|
||||
{
|
||||
var maxCheck = 1000000;
|
||||
|
||||
from.SendMessage(0x35, "You win the {0}gp jackpot!", m_GamblePot);
|
||||
|
||||
while (m_GamblePot > maxCheck)
|
||||
{
|
||||
from.AddToBackpack(new BankCheck(maxCheck));
|
||||
|
||||
m_GamblePot -= maxCheck;
|
||||
}
|
||||
|
||||
from.AddToBackpack(new BankCheck(m_GamblePot));
|
||||
|
||||
m_GamblePot = 2500;
|
||||
}
|
||||
else if (roll <= 20) // Chance for a regbag
|
||||
{
|
||||
from.SendMessage(0x35, "You win a bag of reagents!");
|
||||
from.AddToBackpack(new BagOfReagents());
|
||||
}
|
||||
else if (roll <= 40) // Chance for gold
|
||||
{
|
||||
from.SendMessage(0x35, "You win 1500gp!");
|
||||
from.AddToBackpack(new BankCheck(1500));
|
||||
}
|
||||
else if (roll <= 100) // Another chance for gold
|
||||
{
|
||||
from.SendMessage(0x35, "You win 1000gp!");
|
||||
from.AddToBackpack(new BankCheck(1000));
|
||||
}
|
||||
else // Loser!
|
||||
{
|
||||
from.SendMessage(0x22, "You lose!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(0x22, "You need at least 250gp in your backpack to use this.");
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(m_GamblePot);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_GamblePot = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class IngotStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public IngotStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x480;
|
||||
}
|
||||
|
||||
public IngotStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "an Ingot stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var ingotBag = new BagOfingots();
|
||||
|
||||
if (!from.AddToBackpack(ingotBag))
|
||||
{
|
||||
ingotBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Projects/UOContent/Special Systems/Items/Stones/RegStone.cs
Normal file
42
Projects/UOContent/Special Systems/Items/Stones/RegStone.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RegStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RegStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x2D1;
|
||||
}
|
||||
|
||||
public RegStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a reagent stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var regBag = new BagOfReagents();
|
||||
|
||||
if (!from.AddToBackpack(regBag))
|
||||
{
|
||||
regBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class ScribeStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public ScribeStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x105;
|
||||
}
|
||||
|
||||
public ScribeStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a Scribe Supply Stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var scribeBag = new ScribeBag();
|
||||
|
||||
if (!from.AddToBackpack(scribeBag))
|
||||
{
|
||||
scribeBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class SmithStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SmithStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x476;
|
||||
}
|
||||
|
||||
public SmithStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a Blacksmith Supply Stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var SmithBag = new SmithBag();
|
||||
|
||||
if (!from.AddToBackpack(SmithBag))
|
||||
{
|
||||
SmithBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class TailorStone : Item
|
||||
{
|
||||
[Constructible]
|
||||
public TailorStone() : base(0xED4)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 0x315;
|
||||
}
|
||||
|
||||
public TailorStone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a Tailor Supply Stone";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var tailorBag = new TailorBag();
|
||||
|
||||
if (!from.AddToBackpack(tailorBag))
|
||||
{
|
||||
tailorBag.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlchemyBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public AlchemyBag(int amount = 5000)
|
||||
{
|
||||
Hue = 0x250;
|
||||
DropItem(new MortarPestle(Math.Max(amount / 1000, 1)));
|
||||
DropItem(new BagOfReagents(5000));
|
||||
DropItem(new Bottle(5000));
|
||||
}
|
||||
|
||||
public AlchemyBag(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "an Alchemy Kit";
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class BagOfingots : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public BagOfingots(int amount = 5000)
|
||||
{
|
||||
DropItem(new DullCopperIngot(amount));
|
||||
DropItem(new ShadowIronIngot(amount));
|
||||
DropItem(new CopperIngot(amount));
|
||||
DropItem(new BronzeIngot(amount));
|
||||
DropItem(new GoldIngot(amount));
|
||||
DropItem(new AgapiteIngot(amount));
|
||||
DropItem(new VeriteIngot(amount));
|
||||
DropItem(new ValoriteIngot(amount));
|
||||
DropItem(new IronIngot(amount));
|
||||
DropItem(new Tongs());
|
||||
DropItem(new TinkerTools());
|
||||
}
|
||||
|
||||
public BagOfingots(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class ScribeBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public ScribeBag(int amount = 5000)
|
||||
{
|
||||
Hue = 0x105;
|
||||
DropItem(new BagOfReagents(amount));
|
||||
DropItem(new BlankScroll(amount));
|
||||
}
|
||||
|
||||
public ScribeBag(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a Scribe Kit";
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class SmithBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public SmithBag(int amount = 5000)
|
||||
{
|
||||
DropItem(new DullCopperIngot(amount));
|
||||
DropItem(new ShadowIronIngot(amount));
|
||||
DropItem(new CopperIngot(amount));
|
||||
DropItem(new BronzeIngot(amount));
|
||||
DropItem(new GoldIngot(amount));
|
||||
DropItem(new AgapiteIngot(amount));
|
||||
DropItem(new VeriteIngot(amount));
|
||||
DropItem(new ValoriteIngot(amount));
|
||||
DropItem(new IronIngot(amount));
|
||||
DropItem(new Tongs(amount));
|
||||
DropItem(new TinkerTools(amount));
|
||||
}
|
||||
|
||||
public SmithBag(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TailorBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public TailorBag(int amount = 500)
|
||||
{
|
||||
Hue = 0x315;
|
||||
DropItem(new SewingKit(Math.Max(amount / 100, 1)));
|
||||
DropItem(new Scissors());
|
||||
DropItem(new Hides(amount));
|
||||
DropItem(new BoltOfCloth(Math.Max(amount / 25, 1)));
|
||||
DropItem(new DyeTub());
|
||||
DropItem(new DyeTub());
|
||||
DropItem(new BlackDyeTub());
|
||||
DropItem(new Dyes());
|
||||
}
|
||||
|
||||
public TailorBag(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName => "a Tailoring Kit";
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue