fix: Localizes specialized books, codegens instruments (#1352)

This commit is contained in:
Kamron Batman 2023-02-25 10:56:05 -08:00 • committed by GitHub
parent ac7c3522f4
commit f2fdc0321c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1527 additions and 1866 deletions

View file

@ -1,54 +1,36 @@
using ModernUO.Serialization;
using Server.Mobiles;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class SandMiningBook : Item
{
public class SandMiningBook : Item
[Constructible]
public SandMiningBook() : base(0xFF4) => Weight = 1.0;
public override int LabelNumber => 1153531; // Find Glass-Quality Sand
public override void OnDoubleClick(Mobile from)
{
[Constructible]
public SandMiningBook() : base(0xFF4) => Weight = 1.0;
public SandMiningBook(Serial serial) : base(serial)
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
public override string DefaultName => "Find Glass-Quality Sand";
public override void Serialize(IGenericWriter writer)
else if (from is not PlayerMobile pm || from.Skills.Mining.Base < 100.0)
{
base.Serialize(writer);
writer.Write(0); // version
// Only a Grandmaster Miner can learn from this book.
from.SendLocalizedMessage(1080041);
}
public override void Deserialize(IGenericReader reader)
else if (pm.SandMining)
{
base.Deserialize(reader);
var version = reader.ReadInt();
from.SendLocalizedMessage(1080066); // You have already learned this information.
}
public override void OnDoubleClick(Mobile from)
else
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (from is not PlayerMobile pm || from.Skills.Mining.Base < 100.0)
{
from.SendMessage("Only a Grandmaster Miner can learn from this book.");
}
else if (pm.SandMining)
{
from.SendMessage("You have already learned this information.");
}
else
{
pm.SandMining = true;
from.SendMessage(
"You have learned how to mine fine sand. Target sand areas when mining to look for fine sand."
);
Delete();
}
pm.SandMining = true;
// You have learned to make items from glass. You will need to find miners to mine fine sand for you to make these items.
from.SendLocalizedMessage(1080065);
Delete();
}
}
}