Formats UO Content (#201)

This commit is contained in:
Kamron Batman 2020-08-27 18:30:38 -07:00 committed by GitHub
parent 86b7b3aed1
commit ad3775c4d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3249 changed files with 431083 additions and 440981 deletions

View file

@ -1,470 +1,470 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Server.ContextMenus;
using Server.Gumps;
using Server.Multis;
using Server.Network;
namespace Server.Items
{
public class BookPageInfo
{
public BookPageInfo() => Lines = Array.Empty<string>();
public BookPageInfo(params string[] lines) => Lines = lines;
public BookPageInfo(IGenericReader reader)
{
int length = reader.ReadInt();
Lines = new string[length];
for (int i = 0; i < Lines.Length; ++i)
Lines[i] = Utility.Intern(reader.ReadString());
}
public string[] Lines { get; set; }
public void Serialize(IGenericWriter writer)
{
writer.Write(Lines.Length);
for (int i = 0; i < Lines.Length; ++i)
writer.Write(Lines[i]);
}
}
public class BaseBook : Item, ISecurable
{
private string m_Author;
private string m_Title;
[Constructible]
public BaseBook(int itemID, int pageCount = 20, bool writable = true) : this(itemID, null, null, pageCount, writable)
{
}
[Constructible]
public BaseBook(int itemID, string title, string author, int pageCount, bool writable) : base(itemID)
{
BookContent content = DefaultContent;
m_Title = title ?? content?.Title;
m_Author = author ?? content?.Author;
Writable = writable;
if (content == null)
{
Pages = new BookPageInfo[pageCount];
for (int i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo();
}
else
{
Pages = content.Copy();
}
}
// Intended for defined books only
public BaseBook(int itemID, bool writable) : this(itemID, 0, writable)
{
}
public BaseBook(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public string Title
{
get => m_Title;
set
{
m_Title = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public string Author
{
get => m_Author;
set
{
m_Author = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Writable { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int PagesCount => Pages.Length;
public BookPageInfo[] Pages { get; private set; }
public virtual BookContent DefaultContent => null;
public string ContentAsString
{
get
{
StringBuilder sb = new StringBuilder();
foreach (BookPageInfo bpi in Pages)
foreach (string line in bpi.Lines)
sb.AppendLine(line);
return sb.ToString();
}
}
public string[] ContentAsStringArray
{
get
{
List<string> lines = new List<string>();
foreach (BookPageInfo bpi in Pages) lines.AddRange(bpi.Lines);
return lines.ToArray();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level { get; set; }
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
BookContent content = DefaultContent;
SaveFlags flags = SaveFlags.None;
if (m_Title != content?.Title)
flags |= SaveFlags.Title;
if (m_Author != content?.Author)
flags |= SaveFlags.Author;
if (Writable)
flags |= SaveFlags.Writable;
if (content?.IsMatch(Pages) != true)
flags |= SaveFlags.Content;
writer.Write(4); // version
writer.Write((int)Level);
writer.Write((byte)flags);
if ((flags & SaveFlags.Title) != 0)
writer.Write(m_Title);
if ((flags & SaveFlags.Author) != 0)
writer.Write(m_Author);
if ((flags & SaveFlags.Content) != 0)
{
writer.WriteEncodedInt(Pages.Length);
for (int i = 0; i < Pages.Length; ++i)
Pages[i].Serialize(writer);
}
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 4:
{
Level = (SecureLevel)reader.ReadInt();
goto case 3;
}
case 3:
case 2:
{
BookContent content = DefaultContent;
SaveFlags flags = (SaveFlags)reader.ReadByte();
if ((flags & SaveFlags.Title) != 0)
m_Title = Utility.Intern(reader.ReadString());
else if (content != null)
m_Title = content.Title;
if ((flags & SaveFlags.Author) != 0)
m_Author = reader.ReadString();
else if (content != null)
m_Author = content.Author;
Writable = (flags & SaveFlags.Writable) != 0;
if ((flags & SaveFlags.Content) != 0)
{
Pages = new BookPageInfo[reader.ReadEncodedInt()];
for (int i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo(reader);
}
else
{
if (content != null)
Pages = content.Copy();
else
Pages = Array.Empty<BookPageInfo>();
}
break;
}
case 1:
case 0:
{
m_Title = reader.ReadString();
m_Author = reader.ReadString();
Writable = reader.ReadBool();
if (version == 0 || reader.ReadBool())
{
Pages = new BookPageInfo[reader.ReadInt()];
for (int i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo(reader);
}
else
{
BookContent content = DefaultContent;
if (content != null)
Pages = content.Copy();
else
Pages = Array.Empty<BookPageInfo>();
}
break;
}
}
if (version < 3 && (Weight == 1 || Weight == 2))
Weight = -1;
}
public override void AddNameProperty(ObjectPropertyList list)
{
if (!string.IsNullOrEmpty(m_Title))
list.Add(m_Title);
else
base.AddNameProperty(list);
}
/*public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
if (m_Title?.Length > 0)
list.Add( 1060658, "Title\t{0}", m_Title ); // ~1_val~: ~2_val~
if (m_Author?.Length > 0)
list.Add( 1060659, "Author\t{0}", m_Author ); // ~1_val~: ~2_val~
if (m_Pages?.Length > 0)
list.Add( 1060660, "Pages\t{0}", m_Pages.Length ); // ~1_val~: ~2_val~
}*/
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "{0} by {1}", m_Title, m_Author);
LabelTo(from, "[{0} pages]", Pages.Length);
}
public override void OnDoubleClick(Mobile from)
{
if (m_Title == null && m_Author == null && Writable)
{
Title = "a book";
Author = from.Name;
}
from.Send(new BookHeader(from, this));
from.Send(new BookPageDetails(this));
}
public static void Initialize()
{
PacketHandlers.Register(0xD4, 0, true, HeaderChange);
PacketHandlers.Register(0x66, 0, true, ContentChange);
PacketHandlers.Register(0x93, 99, true, OldHeaderChange);
}
public static void OldHeaderChange(NetState state, PacketReader pvSrc)
{
Mobile from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
string title = pvSrc.ReadStringSafe(60);
string author = pvSrc.ReadStringSafe(30);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
}
public static void HeaderChange(NetState state, PacketReader pvSrc)
{
Mobile from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
int titleLength = pvSrc.ReadUInt16();
if (titleLength > 60)
return;
string title = pvSrc.ReadUTF8StringSafe(titleLength);
int authorLength = pvSrc.ReadUInt16();
if (authorLength > 30)
return;
string author = pvSrc.ReadUTF8StringSafe(authorLength);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
}
public static void ContentChange(NetState state, PacketReader pvSrc)
{
Mobile from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
int pageCount = pvSrc.ReadUInt16();
if (pageCount > book.PagesCount)
return;
for (int i = 0; i < pageCount; ++i)
{
int index = pvSrc.ReadUInt16();
if (index >= 1 && index <= book.PagesCount)
{
--index;
int lineCount = pvSrc.ReadUInt16();
if (lineCount <= 8)
{
string[] lines = new string[lineCount];
for (int j = 0; j < lineCount; ++j)
if ((lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80)
return;
book.Pages[index].Lines = lines;
}
else
{
return;
}
}
else
{
return;
}
}
}
[Flags]
private enum SaveFlags
{
None = 0x00,
Title = 0x01,
Author = 0x02,
Writable = 0x04,
Content = 0x08
}
}
public sealed class BookPageDetails : Packet
{
public BookPageDetails(BaseBook book) : base(0x66)
{
EnsureCapacity(256);
Stream.Write(book.Serial);
Stream.Write((ushort)book.PagesCount);
for (int i = 0; i < book.PagesCount; ++i)
{
BookPageInfo page = book.Pages[i];
Stream.Write((ushort)(i + 1));
Stream.Write((ushort)page.Lines.Length);
for (int j = 0; j < page.Lines.Length; ++j)
{
byte[] buffer = Utility.UTF8.GetBytes(page.Lines[j]);
Stream.Write(buffer, 0, buffer.Length);
Stream.Write((byte)0);
}
}
}
}
public sealed class BookHeader : Packet
{
public BookHeader(Mobile from, BaseBook book) : base(0xD4)
{
string title = book.Title ?? "";
string author = book.Author ?? "";
byte[] titleBuffer = Utility.UTF8.GetBytes(title);
byte[] authorBuffer = Utility.UTF8.GetBytes(author);
EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
Stream.Write(book.Serial);
Stream.Write(true);
Stream.Write(book.Writable && from.InRange(book.GetWorldLocation(), 1));
Stream.Write((ushort)book.PagesCount);
Stream.Write((ushort)(titleBuffer.Length + 1));
Stream.Write(titleBuffer, 0, titleBuffer.Length);
Stream.Write((byte)0); // terminate
Stream.Write((ushort)(authorBuffer.Length + 1));
Stream.Write(authorBuffer, 0, authorBuffer.Length);
Stream.Write((byte)0); // terminate
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Server.ContextMenus;
using Server.Gumps;
using Server.Multis;
using Server.Network;
namespace Server.Items
{
public class BookPageInfo
{
public BookPageInfo() => Lines = Array.Empty<string>();
public BookPageInfo(params string[] lines) => Lines = lines;
public BookPageInfo(IGenericReader reader)
{
var length = reader.ReadInt();
Lines = new string[length];
for (var i = 0; i < Lines.Length; ++i)
Lines[i] = Utility.Intern(reader.ReadString());
}
public string[] Lines { get; set; }
public void Serialize(IGenericWriter writer)
{
writer.Write(Lines.Length);
for (var i = 0; i < Lines.Length; ++i)
writer.Write(Lines[i]);
}
}
public class BaseBook : Item, ISecurable
{
private string m_Author;
private string m_Title;
[Constructible]
public BaseBook(int itemID, int pageCount = 20, bool writable = true) : this(itemID, null, null, pageCount, writable)
{
}
[Constructible]
public BaseBook(int itemID, string title, string author, int pageCount, bool writable) : base(itemID)
{
var content = DefaultContent;
m_Title = title ?? content?.Title;
m_Author = author ?? content?.Author;
Writable = writable;
if (content == null)
{
Pages = new BookPageInfo[pageCount];
for (var i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo();
}
else
{
Pages = content.Copy();
}
}
// Intended for defined books only
public BaseBook(int itemID, bool writable) : this(itemID, 0, writable)
{
}
public BaseBook(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public string Title
{
get => m_Title;
set
{
m_Title = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public string Author
{
get => m_Author;
set
{
m_Author = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Writable { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int PagesCount => Pages.Length;
public BookPageInfo[] Pages { get; private set; }
public virtual BookContent DefaultContent => null;
public string ContentAsString
{
get
{
var sb = new StringBuilder();
foreach (var bpi in Pages)
foreach (var line in bpi.Lines)
sb.AppendLine(line);
return sb.ToString();
}
}
public string[] ContentAsStringArray
{
get
{
var lines = new List<string>();
foreach (var bpi in Pages) lines.AddRange(bpi.Lines);
return lines.ToArray();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level { get; set; }
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
var content = DefaultContent;
var flags = SaveFlags.None;
if (m_Title != content?.Title)
flags |= SaveFlags.Title;
if (m_Author != content?.Author)
flags |= SaveFlags.Author;
if (Writable)
flags |= SaveFlags.Writable;
if (content?.IsMatch(Pages) != true)
flags |= SaveFlags.Content;
writer.Write(4); // version
writer.Write((int)Level);
writer.Write((byte)flags);
if ((flags & SaveFlags.Title) != 0)
writer.Write(m_Title);
if ((flags & SaveFlags.Author) != 0)
writer.Write(m_Author);
if ((flags & SaveFlags.Content) != 0)
{
writer.WriteEncodedInt(Pages.Length);
for (var i = 0; i < Pages.Length; ++i)
Pages[i].Serialize(writer);
}
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
switch (version)
{
case 4:
{
Level = (SecureLevel)reader.ReadInt();
goto case 3;
}
case 3:
case 2:
{
var content = DefaultContent;
var flags = (SaveFlags)reader.ReadByte();
if ((flags & SaveFlags.Title) != 0)
m_Title = Utility.Intern(reader.ReadString());
else if (content != null)
m_Title = content.Title;
if ((flags & SaveFlags.Author) != 0)
m_Author = reader.ReadString();
else if (content != null)
m_Author = content.Author;
Writable = (flags & SaveFlags.Writable) != 0;
if ((flags & SaveFlags.Content) != 0)
{
Pages = new BookPageInfo[reader.ReadEncodedInt()];
for (var i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo(reader);
}
else
{
if (content != null)
Pages = content.Copy();
else
Pages = Array.Empty<BookPageInfo>();
}
break;
}
case 1:
case 0:
{
m_Title = reader.ReadString();
m_Author = reader.ReadString();
Writable = reader.ReadBool();
if (version == 0 || reader.ReadBool())
{
Pages = new BookPageInfo[reader.ReadInt()];
for (var i = 0; i < Pages.Length; ++i)
Pages[i] = new BookPageInfo(reader);
}
else
{
var content = DefaultContent;
if (content != null)
Pages = content.Copy();
else
Pages = Array.Empty<BookPageInfo>();
}
break;
}
}
if (version < 3 && (Weight == 1 || Weight == 2))
Weight = -1;
}
public override void AddNameProperty(ObjectPropertyList list)
{
if (!string.IsNullOrEmpty(m_Title))
list.Add(m_Title);
else
base.AddNameProperty(list);
}
/*public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
if (m_Title?.Length > 0)
list.Add( 1060658, "Title\t{0}", m_Title ); // ~1_val~: ~2_val~
if (m_Author?.Length > 0)
list.Add( 1060659, "Author\t{0}", m_Author ); // ~1_val~: ~2_val~
if (m_Pages?.Length > 0)
list.Add( 1060660, "Pages\t{0}", m_Pages.Length ); // ~1_val~: ~2_val~
}*/
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "{0} by {1}", m_Title, m_Author);
LabelTo(from, "[{0} pages]", Pages.Length);
}
public override void OnDoubleClick(Mobile from)
{
if (m_Title == null && m_Author == null && Writable)
{
Title = "a book";
Author = from.Name;
}
from.Send(new BookHeader(from, this));
from.Send(new BookPageDetails(this));
}
public static void Initialize()
{
PacketHandlers.Register(0xD4, 0, true, HeaderChange);
PacketHandlers.Register(0x66, 0, true, ContentChange);
PacketHandlers.Register(0x93, 99, true, OldHeaderChange);
}
public static void OldHeaderChange(NetState state, PacketReader pvSrc)
{
var from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
var title = pvSrc.ReadStringSafe(60);
var author = pvSrc.ReadStringSafe(30);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
}
public static void HeaderChange(NetState state, PacketReader pvSrc)
{
var from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
int titleLength = pvSrc.ReadUInt16();
if (titleLength > 60)
return;
var title = pvSrc.ReadUTF8StringSafe(titleLength);
int authorLength = pvSrc.ReadUInt16();
if (authorLength > 30)
return;
var author = pvSrc.ReadUTF8StringSafe(authorLength);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
}
public static void ContentChange(NetState state, PacketReader pvSrc)
{
var from = state.Mobile;
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
return;
int pageCount = pvSrc.ReadUInt16();
if (pageCount > book.PagesCount)
return;
for (var i = 0; i < pageCount; ++i)
{
int index = pvSrc.ReadUInt16();
if (index >= 1 && index <= book.PagesCount)
{
--index;
int lineCount = pvSrc.ReadUInt16();
if (lineCount <= 8)
{
var lines = new string[lineCount];
for (var j = 0; j < lineCount; ++j)
if ((lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80)
return;
book.Pages[index].Lines = lines;
}
else
{
return;
}
}
else
{
return;
}
}
}
[Flags]
private enum SaveFlags
{
None = 0x00,
Title = 0x01,
Author = 0x02,
Writable = 0x04,
Content = 0x08
}
}
public sealed class BookPageDetails : Packet
{
public BookPageDetails(BaseBook book) : base(0x66)
{
EnsureCapacity(256);
Stream.Write(book.Serial);
Stream.Write((ushort)book.PagesCount);
for (var i = 0; i < book.PagesCount; ++i)
{
var page = book.Pages[i];
Stream.Write((ushort)(i + 1));
Stream.Write((ushort)page.Lines.Length);
for (var j = 0; j < page.Lines.Length; ++j)
{
var buffer = Utility.UTF8.GetBytes(page.Lines[j]);
Stream.Write(buffer, 0, buffer.Length);
Stream.Write((byte)0);
}
}
}
}
public sealed class BookHeader : Packet
{
public BookHeader(Mobile from, BaseBook book) : base(0xD4)
{
var title = book.Title ?? "";
var author = book.Author ?? "";
var titleBuffer = Utility.UTF8.GetBytes(title);
var authorBuffer = Utility.UTF8.GetBytes(author);
EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
Stream.Write(book.Serial);
Stream.Write(true);
Stream.Write(book.Writable && from.InRange(book.GetWorldLocation(), 1));
Stream.Write((ushort)book.PagesCount);
Stream.Write((ushort)(titleBuffer.Length + 1));
Stream.Write(titleBuffer, 0, titleBuffer.Length);
Stream.Write((byte)0); // terminate
Stream.Write((ushort)(authorBuffer.Length + 1));
Stream.Write(authorBuffer, 0, authorBuffer.Length);
Stream.Write((byte)0); // terminate
}
}
}

View file

@ -1,44 +1,49 @@
namespace Server.Items
{
public class BlueBook : BaseBook
{
[Constructible]
public BlueBook() : base(0xFF2, 40)
{
}
[Constructible]
public BlueBook(int pageCount, bool writable) : base(0xFF2, pageCount, writable)
{
}
[Constructible]
public BlueBook(string title, string author, int pageCount, bool writable) : base(0xFF2, title, author, pageCount,
writable)
{
}
// Intended for defined books only
public BlueBook(bool writable) : base(0xFF2, writable)
{
}
public BlueBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}
namespace Server.Items
{
public class BlueBook : BaseBook
{
[Constructible]
public BlueBook() : base(0xFF2, 40)
{
}
[Constructible]
public BlueBook(int pageCount, bool writable) : base(0xFF2, pageCount, writable)
{
}
[Constructible]
public BlueBook(string title, string author, int pageCount, bool writable) : base(
0xFF2,
title,
author,
pageCount,
writable
)
{
}
// Intended for defined books only
public BlueBook(bool writable) : base(0xFF2, writable)
{
}
public BlueBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}

View file

@ -1,44 +1,49 @@
namespace Server.Items
{
public class BrownBook : BaseBook
{
[Constructible]
public BrownBook() : base(0xFEF)
{
}
[Constructible]
public BrownBook(int pageCount, bool writable) : base(0xFEF, pageCount, writable)
{
}
[Constructible]
public BrownBook(string title, string author, int pageCount, bool writable) : base(0xFEF, title, author, pageCount,
writable)
{
}
// Intended for defined books only
public BrownBook(bool writable) : base(0xFEF, writable)
{
}
public BrownBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}
namespace Server.Items
{
public class BrownBook : BaseBook
{
[Constructible]
public BrownBook() : base(0xFEF)
{
}
[Constructible]
public BrownBook(int pageCount, bool writable) : base(0xFEF, pageCount, writable)
{
}
[Constructible]
public BrownBook(string title, string author, int pageCount, bool writable) : base(
0xFEF,
title,
author,
pageCount,
writable
)
{
}
// Intended for defined books only
public BrownBook(bool writable) : base(0xFEF, writable)
{
}
public BrownBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}

View file

@ -1,241 +1,267 @@
namespace Server.Items
{
public class BlackthornWelcomeBook : RedBook
{
public static readonly BookContent Content = new BookContent(
"A Welcome", "Lord Blackthorn",
new BookPageInfo(
" Greetings to you,",
"new member of the",
"Trusted.",
" You now read these",
"words because you",
"have been deemed",
"worthy to join the",
"ranks of"),
new BookPageInfo(
"Britannia's defenders.",
"Some will call you a",
"betrayer of mankind, I",
"say they are",
"misguided. I call you",
"a defender for Sosaria",
"needs saving from",
"itself."),
new BookPageInfo(
" The forces of order",
"once ruled our world.",
"Like a great",
"darkness over our",
"lives we lived under",
"the oppressive watch",
"of a king who",
"dictated our actions"),
new BookPageInfo(
"and passed judgment",
"on our character. He",
"suppressed our way of",
"life by denying our",
"freedom and the",
"ability to determine",
"who we are and what",
"we stand for. Even"),
new BookPageInfo(
"today in the absence",
"of this man we still",
"see the symbol of his",
"tyranny, we watch his",
"personal guards patrol",
"the cities to",
"intimidate us, and we",
"feel his laws like a"),
new BookPageInfo(
"vice on our lives.",
" You are here",
"because you choose to",
"be free. Like many",
"Britannians you have",
"felt the oppression of",
"one man's ideas",
"weighing down upon"),
new BookPageInfo(
"you like chains. You",
"have felt the embrace",
"of fear, wondering if",
"you face consequence",
"for simply having",
"ideas not in harmony",
"with those forced upon",
"you. You have seen"),
new BookPageInfo(
"men fight and die for",
"the principles of a",
"zealot and wondered,",
"'Who will fight for",
"my principles should",
"they be opposed?'",
"You tire of living",
"under the shadow of"),
new BookPageInfo(
"dreams that do not",
"belong to you. And",
"most of all, you have",
"wondered what you",
"can do to live free.",
" Your journey to",
"freedom begins here.",
" I, like you, once"),
new BookPageInfo(
"desired my freedom",
"from the limits placed",
"on me. I watched in",
"disgust as this world",
"became engrossed with",
"the preaching of",
"virtue and none of the",
"practice. I held my"),
new BookPageInfo(
"convictions in check,",
"fearful of the reaction",
"of men blinded by",
"belief. I forced",
"myself to bury the",
"very ideology that",
"made me an individual.",
"I was fortunate that"),
new BookPageInfo(
"a being of unique",
"power and",
"unimaginable",
"intelligence saw",
"through to the true",
"person I was, the",
"person I was meant to",
"be. Exodus found"),
new BookPageInfo(
"within me a man of",
"free will,",
"determination, and",
"incomprehension for",
"the plight of",
"oppression forced on so",
"many Britannians.",
" Exodus has also"),
new BookPageInfo(
"chosen you because of",
"the strength of your",
"character.",
" Many of the men",
"who were once my",
"peers look upon me",
"and see a betrayer of",
"humanity. They"),
new BookPageInfo(
"claim my newfound",
"form is unnatural and",
"wrong. Because they",
"see the unknown in",
"me, they show fear.",
"They disapprove of",
"my choices and in",
"their ignorance see"),
new BookPageInfo(
"evil. Yet I hide my",
"true self no longer",
"from these men. My",
"thoughts and my",
"personal morality have",
"been liberated in the",
"face of the oppression",
"that once consumed me."),
new BookPageInfo(
"Where they see a",
"man no longer human.",
"I see a man that has",
"not betrayed his",
"humanity but has been",
"freed from it. This",
"is the power that has",
"been granted to me by"),
new BookPageInfo(
"Exodus. I have been",
"given my freedom. I",
"have been released",
"from my fears.",
" Exodus will give",
"you the power to",
"conquer your fears as",
"well."),
new BookPageInfo(
" When your fear",
"of this world is gone,",
"then the world truly",
"belongs to you in a",
"way it never has",
"before. You, trusted",
"one, will soon be given",
"a gift. Your body,"),
new BookPageInfo(
"like mine, will be",
"enlightened and raised",
"to a level no mortal",
"can know. The power",
"to control your own",
"destiny will belong to",
"you for the first time",
"in your life."),
new BookPageInfo(
" You will, at long",
"last, be cleansed of",
"fear.",
" Together, with the",
"power of Exodus",
"behind us, we shall",
"finally wage war on",
"the oppression that"),
new BookPageInfo(
"once held us back",
"from our full",
"potential. We shall",
"claim this world, and",
"reshape it in an image",
"of freedom for all of",
"us. Those who once",
"told you who you are"),
new BookPageInfo(
"and how you should",
"live will no longer be",
"able to stand in the",
"way of your free will.",
"Many say you will",
"be abandoning your",
"humanity but in truth,",
"you will be more than"),
new BookPageInfo(
"human.",
" You will be freed."));
[Constructible]
public BlackthornWelcomeBook() : base(false) => Hue = 0x89B;
public BlackthornWelcomeBook(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class BlackthornWelcomeBook : RedBook
{
public static readonly BookContent Content = new BookContent(
"A Welcome",
"Lord Blackthorn",
new BookPageInfo(
" Greetings to you,",
"new member of the",
"Trusted.",
" You now read these",
"words because you",
"have been deemed",
"worthy to join the",
"ranks of"
),
new BookPageInfo(
"Britannia's defenders.",
"Some will call you a",
"betrayer of mankind, I",
"say they are",
"misguided. I call you",
"a defender for Sosaria",
"needs saving from",
"itself."
),
new BookPageInfo(
" The forces of order",
"once ruled our world.",
"Like a great",
"darkness over our",
"lives we lived under",
"the oppressive watch",
"of a king who",
"dictated our actions"
),
new BookPageInfo(
"and passed judgment",
"on our character. He",
"suppressed our way of",
"life by denying our",
"freedom and the",
"ability to determine",
"who we are and what",
"we stand for. Even"
),
new BookPageInfo(
"today in the absence",
"of this man we still",
"see the symbol of his",
"tyranny, we watch his",
"personal guards patrol",
"the cities to",
"intimidate us, and we",
"feel his laws like a"
),
new BookPageInfo(
"vice on our lives.",
" You are here",
"because you choose to",
"be free. Like many",
"Britannians you have",
"felt the oppression of",
"one man's ideas",
"weighing down upon"
),
new BookPageInfo(
"you like chains. You",
"have felt the embrace",
"of fear, wondering if",
"you face consequence",
"for simply having",
"ideas not in harmony",
"with those forced upon",
"you. You have seen"
),
new BookPageInfo(
"men fight and die for",
"the principles of a",
"zealot and wondered,",
"'Who will fight for",
"my principles should",
"they be opposed?'",
"You tire of living",
"under the shadow of"
),
new BookPageInfo(
"dreams that do not",
"belong to you. And",
"most of all, you have",
"wondered what you",
"can do to live free.",
" Your journey to",
"freedom begins here.",
" I, like you, once"
),
new BookPageInfo(
"desired my freedom",
"from the limits placed",
"on me. I watched in",
"disgust as this world",
"became engrossed with",
"the preaching of",
"virtue and none of the",
"practice. I held my"
),
new BookPageInfo(
"convictions in check,",
"fearful of the reaction",
"of men blinded by",
"belief. I forced",
"myself to bury the",
"very ideology that",
"made me an individual.",
"I was fortunate that"
),
new BookPageInfo(
"a being of unique",
"power and",
"unimaginable",
"intelligence saw",
"through to the true",
"person I was, the",
"person I was meant to",
"be. Exodus found"
),
new BookPageInfo(
"within me a man of",
"free will,",
"determination, and",
"incomprehension for",
"the plight of",
"oppression forced on so",
"many Britannians.",
" Exodus has also"
),
new BookPageInfo(
"chosen you because of",
"the strength of your",
"character.",
" Many of the men",
"who were once my",
"peers look upon me",
"and see a betrayer of",
"humanity. They"
),
new BookPageInfo(
"claim my newfound",
"form is unnatural and",
"wrong. Because they",
"see the unknown in",
"me, they show fear.",
"They disapprove of",
"my choices and in",
"their ignorance see"
),
new BookPageInfo(
"evil. Yet I hide my",
"true self no longer",
"from these men. My",
"thoughts and my",
"personal morality have",
"been liberated in the",
"face of the oppression",
"that once consumed me."
),
new BookPageInfo(
"Where they see a",
"man no longer human.",
"I see a man that has",
"not betrayed his",
"humanity but has been",
"freed from it. This",
"is the power that has",
"been granted to me by"
),
new BookPageInfo(
"Exodus. I have been",
"given my freedom. I",
"have been released",
"from my fears.",
" Exodus will give",
"you the power to",
"conquer your fears as",
"well."
),
new BookPageInfo(
" When your fear",
"of this world is gone,",
"then the world truly",
"belongs to you in a",
"way it never has",
"before. You, trusted",
"one, will soon be given",
"a gift. Your body,"
),
new BookPageInfo(
"like mine, will be",
"enlightened and raised",
"to a level no mortal",
"can know. The power",
"to control your own",
"destiny will belong to",
"you for the first time",
"in your life."
),
new BookPageInfo(
" You will, at long",
"last, be cleansed of",
"fear.",
" Together, with the",
"power of Exodus",
"behind us, we shall",
"finally wage war on",
"the oppression that"
),
new BookPageInfo(
"once held us back",
"from our full",
"potential. We shall",
"claim this world, and",
"reshape it in an image",
"of freedom for all of",
"us. Those who once",
"told you who you are"
),
new BookPageInfo(
"and how you should",
"live will no longer be",
"able to stand in the",
"way of your free will.",
"Many say you will",
"be abandoning your",
"humanity but in truth,",
"you will be more than"
),
new BookPageInfo(
"human.",
" You will be freed."
)
);
[Constructible]
public BlackthornWelcomeBook() : base(false) => Hue = 0x89B;
public BlackthornWelcomeBook(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

View file

@ -1,49 +1,49 @@
namespace Server.Items
{
public class BookContent
{
public BookContent(string title, string author, params BookPageInfo[] pages)
{
Title = title;
Author = author;
Pages = pages;
}
public string Title { get; }
public string Author { get; }
public BookPageInfo[] Pages { get; }
public BookPageInfo[] Copy()
{
BookPageInfo[] copy = new BookPageInfo[Pages.Length];
for (int i = 0; i < copy.Length; ++i)
copy[i] = new BookPageInfo(Pages[i].Lines);
return copy;
}
public bool IsMatch(BookPageInfo[] cmp)
{
if (cmp.Length != Pages.Length)
return false;
for (int i = 0; i < cmp.Length; ++i)
{
string[] a = Pages[i].Lines;
string[] b = cmp[i].Lines;
if (a.Length != b.Length) return false;
if (a != b)
for (int j = 0; j < a.Length; ++j)
if (a[j] != b[j])
return false;
}
return true;
}
}
}
namespace Server.Items
{
public class BookContent
{
public BookContent(string title, string author, params BookPageInfo[] pages)
{
Title = title;
Author = author;
Pages = pages;
}
public string Title { get; }
public string Author { get; }
public BookPageInfo[] Pages { get; }
public BookPageInfo[] Copy()
{
var copy = new BookPageInfo[Pages.Length];
for (var i = 0; i < copy.Length; ++i)
copy[i] = new BookPageInfo(Pages[i].Lines);
return copy;
}
public bool IsMatch(BookPageInfo[] cmp)
{
if (cmp.Length != Pages.Length)
return false;
for (var i = 0; i < cmp.Length; ++i)
{
var a = Pages[i].Lines;
var b = cmp[i].Lines;
if (a.Length != b.Length) return false;
if (a != b)
for (var j = 0; j < a.Length; ++j)
if (a[j] != b[j])
return false;
}
return true;
}
}
}

View file

@ -1,106 +1,117 @@
namespace Server.Items
{
public class DrakovsJournal : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Drakov's Journal", "Drakov",
new BookPageInfo(
"My Master",
"",
"This journal was",
"found on one of",
"our controllers. It",
"seems he has lost",
"faith in you. Know",
"that he has been"),
new BookPageInfo(
"dealth with and will",
"never again speak",
"ill of you or our",
"cause.",
" -Galzon"),
new BookPageInfo(
"We have completted",
"construction of the",
"devices needed to",
"build the clockwork",
"overseers and minions",
"as per the request of",
"the Master. The",
"gargoyles have been"),
new BookPageInfo(
"most useful and their",
"knowledge of the",
"techniques for the",
"construction of these",
"creatures will serve",
"us well.",
" -----",
"I am not one to"),
new BookPageInfo(
"criticize the Master,",
"but I believe he may",
"have erred in his",
"decision to destroy",
"the wingless ones.",
"Already our forces",
"are weakened by the",
"constant attacks of"),
new BookPageInfo(
"the humans Their",
"strength and",
"unquestioning",
"compliance would",
"have made them very",
"useful in the fight",
"against the humans.",
"But the Master felt"),
new BookPageInfo(
"their presence to be",
"an annoyance and",
"a distraction to the",
"winged ones. It was",
"not difficult at all",
"to remove them from",
"this world. But now",
"I fear without more"),
new BookPageInfo(
"allies, willing or",
"not, we stand",
"little chance of",
"defeating the foul",
"humans from our",
"lands. Perhaps if",
"the Master had",
"shown a little"),
new BookPageInfo(
"mercy and forsight",
"we would not be",
"in such dire peril."));
[Constructible]
public DrakovsJournal() : base(false)
{
}
public DrakovsJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class DrakovsJournal : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Drakov's Journal",
"Drakov",
new BookPageInfo(
"My Master",
"",
"This journal was",
"found on one of",
"our controllers. It",
"seems he has lost",
"faith in you. Know",
"that he has been"
),
new BookPageInfo(
"dealth with and will",
"never again speak",
"ill of you or our",
"cause.",
" -Galzon"
),
new BookPageInfo(
"We have completted",
"construction of the",
"devices needed to",
"build the clockwork",
"overseers and minions",
"as per the request of",
"the Master. The",
"gargoyles have been"
),
new BookPageInfo(
"most useful and their",
"knowledge of the",
"techniques for the",
"construction of these",
"creatures will serve",
"us well.",
" -----",
"I am not one to"
),
new BookPageInfo(
"criticize the Master,",
"but I believe he may",
"have erred in his",
"decision to destroy",
"the wingless ones.",
"Already our forces",
"are weakened by the",
"constant attacks of"
),
new BookPageInfo(
"the humans Their",
"strength and",
"unquestioning",
"compliance would",
"have made them very",
"useful in the fight",
"against the humans.",
"But the Master felt"
),
new BookPageInfo(
"their presence to be",
"an annoyance and",
"a distraction to the",
"winged ones. It was",
"not difficult at all",
"to remove them from",
"this world. But now",
"I fear without more"
),
new BookPageInfo(
"allies, willing or",
"not, we stand",
"little chance of",
"defeating the foul",
"humans from our",
"lands. Perhaps if",
"the Master had",
"shown a little"
),
new BookPageInfo(
"mercy and forsight",
"we would not be",
"in such dire peril."
)
);
[Constructible]
public DrakovsJournal() : base(false)
{
}
public DrakovsJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

View file

@ -1,151 +1,165 @@
namespace Server.Items
{
public class FropozJournal : RedBook
{
public static readonly BookContent Content = new BookContent(
"Journal", "Fropoz",
new BookPageInfo(
"I have done as my",
"Master has",
"instructed me.",
"",
"The painted humans",
"have been driven into",
"Britannia and are even",
"now wreaking havoc"),
new BookPageInfo(
"across the land,",
"providing us with the",
"distraction my Master",
"requested. We",
"have provided them",
"with the masks",
"necessary to defeat",
"the orcs, thus"),
new BookPageInfo(
"causing even more",
"distress for the people",
"of Britannia. The",
"unsuspecting fools",
"are too busy dealing",
"with the orc hordes to",
"continue their",
"exploration of our"),
new BookPageInfo(
"lands. We are",
"safe...for now.",
" ----",
"The attacks",
"continue exactly as",
"planned. My Master",
"is pleased with my",
"work and we are"),
new BookPageInfo(
"closer to our goals than",
"ever before. The",
"gargoyles have proven",
"to be more troublesome",
"than we first",
"anticipated, but I",
"believe we can",
"subjugate them fully"),
new BookPageInfo(
"given enough time. It's",
"unfortunate that we",
"did not discover their",
"knowledge sooner.",
"Even now they",
"prepare our armies",
"for battle, but not",
"without resistance."),
new BookPageInfo(
"Now that some of",
"them know of the",
"other lands and of",
"humans, they will",
"double their efforts to",
"seek help. This",
"cannot be allowed.",
" -----"),
new BookPageInfo(
"Damn them!! The",
"humans proved",
"more resourcefull than",
"we thought them",
"capable of. Already",
"their homes are free",
"of orcs and savages",
"and they once again"),
new BookPageInfo(
"are treading in our",
"lands. We may have to",
"move sooner than we",
"thought. I will",
"prepar my brethern",
"and our golems.",
"Hopefully, we can",
"buy our Master some"),
new BookPageInfo(
"more time before the",
"humans discover us.",
" -----",
"It's too late. The",
"gargoyles whom have",
"evaded our capture",
"have opened the doors",
"to our land."),
new BookPageInfo(
"They pray the",
"humans will help",
"them, despite the",
"actions of their",
"cousins in Britannia. I",
"fear they are right.",
"I must go to warn",
"the MastKai Hohiro,"),
new BookPageInfo(),
new BookPageInfo(
"10.11.2001",
"first one to be here",
"",
"Congrats. I didn't really",
"care to log on earlier,",
"nor did I come straight",
"here. 2pm, Magus"));
[Constructible]
public FropozJournal() : base(false)
{
}
public FropozJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Fropoz's Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Fropoz's Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class FropozJournal : RedBook
{
public static readonly BookContent Content = new BookContent(
"Journal",
"Fropoz",
new BookPageInfo(
"I have done as my",
"Master has",
"instructed me.",
"",
"The painted humans",
"have been driven into",
"Britannia and are even",
"now wreaking havoc"
),
new BookPageInfo(
"across the land,",
"providing us with the",
"distraction my Master",
"requested. We",
"have provided them",
"with the masks",
"necessary to defeat",
"the orcs, thus"
),
new BookPageInfo(
"causing even more",
"distress for the people",
"of Britannia. The",
"unsuspecting fools",
"are too busy dealing",
"with the orc hordes to",
"continue their",
"exploration of our"
),
new BookPageInfo(
"lands. We are",
"safe...for now.",
" ----",
"The attacks",
"continue exactly as",
"planned. My Master",
"is pleased with my",
"work and we are"
),
new BookPageInfo(
"closer to our goals than",
"ever before. The",
"gargoyles have proven",
"to be more troublesome",
"than we first",
"anticipated, but I",
"believe we can",
"subjugate them fully"
),
new BookPageInfo(
"given enough time. It's",
"unfortunate that we",
"did not discover their",
"knowledge sooner.",
"Even now they",
"prepare our armies",
"for battle, but not",
"without resistance."
),
new BookPageInfo(
"Now that some of",
"them know of the",
"other lands and of",
"humans, they will",
"double their efforts to",
"seek help. This",
"cannot be allowed.",
" -----"
),
new BookPageInfo(
"Damn them!! The",
"humans proved",
"more resourcefull than",
"we thought them",
"capable of. Already",
"their homes are free",
"of orcs and savages",
"and they once again"
),
new BookPageInfo(
"are treading in our",
"lands. We may have to",
"move sooner than we",
"thought. I will",
"prepar my brethern",
"and our golems.",
"Hopefully, we can",
"buy our Master some"
),
new BookPageInfo(
"more time before the",
"humans discover us.",
" -----",
"It's too late. The",
"gargoyles whom have",
"evaded our capture",
"have opened the doors",
"to our land."
),
new BookPageInfo(
"They pray the",
"humans will help",
"them, despite the",
"actions of their",
"cousins in Britannia. I",
"fear they are right.",
"I must go to warn",
"the MastKai Hohiro,"
),
new BookPageInfo(),
new BookPageInfo(
"10.11.2001",
"first one to be here",
"",
"Congrats. I didn't really",
"care to log on earlier,",
"nor did I come straight",
"here. 2pm, Magus"
)
);
[Constructible]
public FropozJournal() : base(false)
{
}
public FropozJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Fropoz's Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Fropoz's Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

View file

@ -1,222 +1,244 @@
namespace Server.Items
{
public class KaburJournal : RedBook
{
public static readonly BookContent Content = new BookContent(
"Journal", "Kabur",
new BookPageInfo(
"The campaign to slaughter",
"the Meer goes well.",
"Although they seem to",
"oppose the forces of",
"ours at every turn, we",
"still defeat them in",
"combat. Spies of the",
"Meer have been found and"),
new BookPageInfo(
"slain outside of the",
"fortress of ours. The",
"fools underestimate us.",
"We have the power of",
"Lord Exodus behind us.",
"Soon they will learn to",
"serve the Juka and I",
"shall carry the head of"),
new BookPageInfo(
"the wench, Dasha, on a",
"spike for all the warriors",
"of ours to share triumph",
"under.",
"",
"One of the warriors of",
"the Juka died today.",
"During the training"),
new BookPageInfo(
"exercises of ours he",
"spoke out in favor of",
"the warriors of the",
"Meer, saying that they",
"were indeed powerful and",
"would provide a challenge",
"to the Juka. A Juka in",
"fear is no Juka. I gave"),
new BookPageInfo(
"him the death of a",
"coward, outside of battle.",
"",
"More spies of the Meer",
"have been found around",
"the fortress of ours.",
"Many have been seen and",
"escaped the wrath of the"),
new BookPageInfo(
"warriors of ours. Those",
"who have been captured",
"and tortured have",
"revealed nothing to us,",
"even when subjected to",
"the spells of the females.",
" I know the Meer must",
"have plans against us if"),
new BookPageInfo(
"they send so many spies.",
" I may send the troops",
"of the Juka to invade",
"the camps of theirs as a",
"warning.",
"",
"I have met Dasha in",
"battle this day. The"),
new BookPageInfo(
"efforts of hers to draw",
"me into a Black Duel",
"were foolish. Had we",
"not been interrupted in",
"the cave I would have",
"ended the life of hers",
"but I will have to wait",
"for another battle. Lord"),
new BookPageInfo(
"Exodus has ordered more",
"patrols around the",
"fortress of ours. If",
"Dasha is any indication,",
"the Meer will strike soon.",
"",
"More Meer stand outside",
"of the fortress of ours"),
new BookPageInfo(
"than I have ever seen at",
"once. They must seek",
"vengeance for the",
"destruction of their",
"forest. Many Juka stand",
"ready at the base of the",
"mountain to face the",
"forces of theirs but"),
new BookPageInfo(
"today may be the final",
"battle. Exodus has",
"summoned me, I must",
"prepare.",
"",
"Dusk has passed and the",
"Juka now live in a new",
"age, a later time. I have"),
new BookPageInfo(
"just returned from",
"exploring the new world",
"that surrounds the",
"fortress of the Juka.",
"During the attack of the",
"Meer the madman",
"Adranath tried to destroy",
"the fortress of ours"),
new BookPageInfo(
"with great magic. At",
"once he was still and",
"light surrounded the",
"fortress. Everything",
"faded from view. When I",
"regained the senses of",
"mine I saw no sign of",
"the Meer but Dasha."),
new BookPageInfo(
"She has not been found",
"since this new being,",
"Blackthorn, blasted her",
"from the top of the",
"fortress.",
"The forest was gone, now",
"replaced by grasslands.",
"In the far distance I"),
new BookPageInfo(
"could see humans that",
"had covered the bodies of",
"theirs in marks. Even",
"Gargoyles populate this",
"place. Exodus has",
"explained to me that the",
"Juka and the fortress of",
"ours have been pulled"),
new BookPageInfo(
"forward in time. The",
"world we knew is now",
"thousands of years in the",
"past. Lord Exodus say",
"he has has saved the",
"Juka from extinction. I",
"do not want to believe",
"him. I asked this"),
new BookPageInfo(
"stranger about the Meer,",
"but he tells me a new",
"enemy remains to be",
"destroyed. It seems the",
"enemies of ours have",
"passed away to dust like",
"the forest."),
new BookPageInfo(
"I have spoken with other",
"Juka and I suspect I have",
"been told the truth. All",
"the Juka had powerful",
"dreams. In the dreams",
"of ours the Meer invaded",
"the fortress of ours and",
"a great battle took place."),
new BookPageInfo(
" All the Juka and all the",
"Meer perished and the",
"fortress was destroyed",
"from Adranath's spells. I",
"would not like to believe",
"that the Meer could ever",
"destroy us, but now it",
"seems we have seen a"),
new BookPageInfo(
"vision of the fate of",
"ours now lost in time. I",
"must now wonder if the",
"Meer did not die in the",
"battle with the Juka, how",
"did they die? And more",
"importantly, where is",
"Dasha?"));
[Constructible]
public KaburJournal() : base(false)
{
}
public KaburJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Khabur's Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Khabur's Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class KaburJournal : RedBook
{
public static readonly BookContent Content = new BookContent(
"Journal",
"Kabur",
new BookPageInfo(
"The campaign to slaughter",
"the Meer goes well.",
"Although they seem to",
"oppose the forces of",
"ours at every turn, we",
"still defeat them in",
"combat. Spies of the",
"Meer have been found and"
),
new BookPageInfo(
"slain outside of the",
"fortress of ours. The",
"fools underestimate us.",
"We have the power of",
"Lord Exodus behind us.",
"Soon they will learn to",
"serve the Juka and I",
"shall carry the head of"
),
new BookPageInfo(
"the wench, Dasha, on a",
"spike for all the warriors",
"of ours to share triumph",
"under.",
"",
"One of the warriors of",
"the Juka died today.",
"During the training"
),
new BookPageInfo(
"exercises of ours he",
"spoke out in favor of",
"the warriors of the",
"Meer, saying that they",
"were indeed powerful and",
"would provide a challenge",
"to the Juka. A Juka in",
"fear is no Juka. I gave"
),
new BookPageInfo(
"him the death of a",
"coward, outside of battle.",
"",
"More spies of the Meer",
"have been found around",
"the fortress of ours.",
"Many have been seen and",
"escaped the wrath of the"
),
new BookPageInfo(
"warriors of ours. Those",
"who have been captured",
"and tortured have",
"revealed nothing to us,",
"even when subjected to",
"the spells of the females.",
" I know the Meer must",
"have plans against us if"
),
new BookPageInfo(
"they send so many spies.",
" I may send the troops",
"of the Juka to invade",
"the camps of theirs as a",
"warning.",
"",
"I have met Dasha in",
"battle this day. The"
),
new BookPageInfo(
"efforts of hers to draw",
"me into a Black Duel",
"were foolish. Had we",
"not been interrupted in",
"the cave I would have",
"ended the life of hers",
"but I will have to wait",
"for another battle. Lord"
),
new BookPageInfo(
"Exodus has ordered more",
"patrols around the",
"fortress of ours. If",
"Dasha is any indication,",
"the Meer will strike soon.",
"",
"More Meer stand outside",
"of the fortress of ours"
),
new BookPageInfo(
"than I have ever seen at",
"once. They must seek",
"vengeance for the",
"destruction of their",
"forest. Many Juka stand",
"ready at the base of the",
"mountain to face the",
"forces of theirs but"
),
new BookPageInfo(
"today may be the final",
"battle. Exodus has",
"summoned me, I must",
"prepare.",
"",
"Dusk has passed and the",
"Juka now live in a new",
"age, a later time. I have"
),
new BookPageInfo(
"just returned from",
"exploring the new world",
"that surrounds the",
"fortress of the Juka.",
"During the attack of the",
"Meer the madman",
"Adranath tried to destroy",
"the fortress of ours"
),
new BookPageInfo(
"with great magic. At",
"once he was still and",
"light surrounded the",
"fortress. Everything",
"faded from view. When I",
"regained the senses of",
"mine I saw no sign of",
"the Meer but Dasha."
),
new BookPageInfo(
"She has not been found",
"since this new being,",
"Blackthorn, blasted her",
"from the top of the",
"fortress.",
"The forest was gone, now",
"replaced by grasslands.",
"In the far distance I"
),
new BookPageInfo(
"could see humans that",
"had covered the bodies of",
"theirs in marks. Even",
"Gargoyles populate this",
"place. Exodus has",
"explained to me that the",
"Juka and the fortress of",
"ours have been pulled"
),
new BookPageInfo(
"forward in time. The",
"world we knew is now",
"thousands of years in the",
"past. Lord Exodus say",
"he has has saved the",
"Juka from extinction. I",
"do not want to believe",
"him. I asked this"
),
new BookPageInfo(
"stranger about the Meer,",
"but he tells me a new",
"enemy remains to be",
"destroyed. It seems the",
"enemies of ours have",
"passed away to dust like",
"the forest."
),
new BookPageInfo(
"I have spoken with other",
"Juka and I suspect I have",
"been told the truth. All",
"the Juka had powerful",
"dreams. In the dreams",
"of ours the Meer invaded",
"the fortress of ours and",
"a great battle took place."
),
new BookPageInfo(
" All the Juka and all the",
"Meer perished and the",
"fortress was destroyed",
"from Adranath's spells. I",
"would not like to believe",
"that the Meer could ever",
"destroy us, but now it",
"seems we have seen a"
),
new BookPageInfo(
"vision of the fate of",
"ours now lost in time. I",
"must now wonder if the",
"Meer did not die in the",
"battle with the Juka, how",
"did they die? And more",
"importantly, where is",
"Dasha?"
)
);
[Constructible]
public KaburJournal() : base(false)
{
}
public KaburJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Khabur's Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Khabur's Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,106 +1,117 @@
namespace Server.Items
{
public class NewAquariumBook : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Your New Aquarium", "Les Bilgewater",
new BookPageInfo(
"Welcome to the",
"wonderful world",
"of aquarium ownership.",
"With a little time and",
"skill your aquarium can",
"become a work of art!"),
new BookPageInfo(
"Catching Fish:",
"You will need to",
"aquire a fishing net,",
"and a number of fish",
"bowls, from your local",
"fisherman.",
"To use the net,",
"select it from your"),
new BookPageInfo(
"backpack, and cast it",
"into shallow water.",
"Then we wait.",
" The fish will be so",
"happy to be in your",
"aquarium, they will",
"jump right into your",
"fish bowl when caught!"),
new BookPageInfo(
"Just take them home",
"and pour them into",
"your aquarium, and",
"BING! You have a happy",
"new addition to your",
"collection!"),
new BookPageInfo(
"Caring for our",
"Underwater Allies:",
"",
" Fish need clean",
"water and food to",
"survive.",
" Our aquarium comes",
"with a status monitoring"),
new BookPageInfo(
"aid. Must be Magic!",
" Just look at the",
"front of your aquarium",
"(mouse over). See the",
"helpful and friendly",
"guide? It tells how much",
"food and water is",
"needed to maintain,"),
new BookPageInfo(
"and improve the quality",
"of your tank.",
" You dont want to",
"overfeed your fish",
"very often. In fact,",
"you only want to feed",
"them every other day.",
"But, remember to keep"),
new BookPageInfo(
"the water strong and",
"healthy, and add more",
"on a regular basis",
"to keep your aquarium",
"a pretty, sparkely blue.",
"",
" Well, I hope you",
"get as much enjoyment,"),
new BookPageInfo(
"collecting a beautiful",
"array of our fine, finned,",
"friends from the sea,",
"as I do!",
"",
"Happy Fishing!"));
[Constructible]
public NewAquariumBook() : base(false) => Hue = 0;
public NewAquariumBook(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class NewAquariumBook : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Your New Aquarium",
"Les Bilgewater",
new BookPageInfo(
"Welcome to the",
"wonderful world",
"of aquarium ownership.",
"With a little time and",
"skill your aquarium can",
"become a work of art!"
),
new BookPageInfo(
"Catching Fish:",
"You will need to",
"aquire a fishing net,",
"and a number of fish",
"bowls, from your local",
"fisherman.",
"To use the net,",
"select it from your"
),
new BookPageInfo(
"backpack, and cast it",
"into shallow water.",
"Then we wait.",
" The fish will be so",
"happy to be in your",
"aquarium, they will",
"jump right into your",
"fish bowl when caught!"
),
new BookPageInfo(
"Just take them home",
"and pour them into",
"your aquarium, and",
"BING! You have a happy",
"new addition to your",
"collection!"
),
new BookPageInfo(
"Caring for our",
"Underwater Allies:",
"",
" Fish need clean",
"water and food to",
"survive.",
" Our aquarium comes",
"with a status monitoring"
),
new BookPageInfo(
"aid. Must be Magic!",
" Just look at the",
"front of your aquarium",
"(mouse over). See the",
"helpful and friendly",
"guide? It tells how much",
"food and water is",
"needed to maintain,"
),
new BookPageInfo(
"and improve the quality",
"of your tank.",
" You dont want to",
"overfeed your fish",
"very often. In fact,",
"you only want to feed",
"them every other day.",
"But, remember to keep"
),
new BookPageInfo(
"the water strong and",
"healthy, and add more",
"on a regular basis",
"to keep your aquarium",
"a pretty, sparkely blue.",
"",
" Well, I hope you",
"get as much enjoyment,"
),
new BookPageInfo(
"collecting a beautiful",
"array of our fine, finned,",
"friends from the sea,",
"as I do!",
"",
"Happy Fishing!"
)
);
[Constructible]
public NewAquariumBook() : base(false) => Hue = 0;
public NewAquariumBook(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

View file

@ -1,133 +1,146 @@
namespace Server.Items
{
public class TranslatedGargoyleJournal : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Translated Journal", "Velis",
new BookPageInfo(
"This text has been",
"translated from a",
"gargoyle's journal",
"following his capture",
"and subsequent",
"reeducation.",
"",
" -Velis"),
new BookPageInfo(
"I write this in the",
"hopes that someday a",
"soul of pure heart and",
"mind will read it. We",
"are not the evil beings",
"that our cousin",
"gargoyles have made",
"us out to be. We"),
new BookPageInfo(
"consider them",
"uncivilized and they",
"have no concept of the",
"Principles. To you",
"who reads this, I beg",
"for your help in",
"saving my brethern",
"and preserving my"),
new BookPageInfo(
"race. We stand at the",
"edge of destruction as",
"does the rest of the",
"world. Once it was",
"written law that we",
"would not allow the",
"knowledge of our",
"civilization to spread"),
new BookPageInfo(
"into the world, no we",
"are left with little",
"choice...contact the",
"outside world in the hopes",
"of finding help to save",
"it or becoming the",
"unwilling bringers of",
"its damnation."),
new BookPageInfo(
" I fear my capture is",
"certain, the",
"controllers grow ever",
"closer to my hiding",
"place and I know if",
"they discover me, my",
"fate will be as that of",
"my brothers."),
new BookPageInfo(
"Although we resisted",
"with all our strength",
"it is now clear that we",
"must have assistance",
"or our people will be",
"gone. And if our",
"oppressor achieves",
"his goals our race will"),
new BookPageInfo(
"surely be joined buy",
"others.",
" Those of us who",
"have not yet been",
"taken hope to open a",
"path from the outside",
"world into the city.",
"We believe we have"),
new BookPageInfo(
"found weak areas in",
"the mountains that we",
"can successfully",
"knock through with",
"our limited supplies.",
"We will have to work",
"quickly and the risk",
"of being discovered is"),
new BookPageInfo(
"great, but no choice",
"remains..."),
new BookPageInfo(),
new BookPageInfo(),
new BookPageInfo(
"Kai Hohiro, 12pm.",
"10.11.2001",
"first one to be here"));
[Constructible]
public TranslatedGargoyleJournal() : base(false)
{
}
public TranslatedGargoyleJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Translated Gargoyle Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Translated Gargoyle Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}
namespace Server.Items
{
public class TranslatedGargoyleJournal : BlueBook
{
public static readonly BookContent Content = new BookContent(
"Translated Journal",
"Velis",
new BookPageInfo(
"This text has been",
"translated from a",
"gargoyle's journal",
"following his capture",
"and subsequent",
"reeducation.",
"",
" -Velis"
),
new BookPageInfo(
"I write this in the",
"hopes that someday a",
"soul of pure heart and",
"mind will read it. We",
"are not the evil beings",
"that our cousin",
"gargoyles have made",
"us out to be. We"
),
new BookPageInfo(
"consider them",
"uncivilized and they",
"have no concept of the",
"Principles. To you",
"who reads this, I beg",
"for your help in",
"saving my brethern",
"and preserving my"
),
new BookPageInfo(
"race. We stand at the",
"edge of destruction as",
"does the rest of the",
"world. Once it was",
"written law that we",
"would not allow the",
"knowledge of our",
"civilization to spread"
),
new BookPageInfo(
"into the world, no we",
"are left with little",
"choice...contact the",
"outside world in the hopes",
"of finding help to save",
"it or becoming the",
"unwilling bringers of",
"its damnation."
),
new BookPageInfo(
" I fear my capture is",
"certain, the",
"controllers grow ever",
"closer to my hiding",
"place and I know if",
"they discover me, my",
"fate will be as that of",
"my brothers."
),
new BookPageInfo(
"Although we resisted",
"with all our strength",
"it is now clear that we",
"must have assistance",
"or our people will be",
"gone. And if our",
"oppressor achieves",
"his goals our race will"
),
new BookPageInfo(
"surely be joined buy",
"others.",
" Those of us who",
"have not yet been",
"taken hope to open a",
"path from the outside",
"world into the city.",
"We believe we have"
),
new BookPageInfo(
"found weak areas in",
"the mountains that we",
"can successfully",
"knock through with",
"our limited supplies.",
"We will have to work",
"quickly and the risk",
"of being discovered is"
),
new BookPageInfo(
"great, but no choice",
"remains..."
),
new BookPageInfo(),
new BookPageInfo(),
new BookPageInfo(
"Kai Hohiro, 12pm.",
"10.11.2001",
"first one to be here"
)
);
[Constructible]
public TranslatedGargoyleJournal() : base(false)
{
}
public TranslatedGargoyleJournal(Serial serial) : base(serial)
{
}
public override BookContent DefaultContent => Content;
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Translated Gargoyle Journal");
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Translated Gargoyle Journal");
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
}

View file

@ -1,44 +1,49 @@
namespace Server.Items
{
public class RedBook : BaseBook
{
[Constructible]
public RedBook() : base(0xFF1)
{
}
[Constructible]
public RedBook(int pageCount, bool writable) : base(0xFF1, pageCount, writable)
{
}
[Constructible]
public RedBook(string title, string author, int pageCount, bool writable) : base(0xFF1, title, author, pageCount,
writable)
{
}
// Intended for defined books only
public RedBook(bool writable) : base(0xFF1, writable)
{
}
public RedBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}
namespace Server.Items
{
public class RedBook : BaseBook
{
[Constructible]
public RedBook() : base(0xFF1)
{
}
[Constructible]
public RedBook(int pageCount, bool writable) : base(0xFF1, pageCount, writable)
{
}
[Constructible]
public RedBook(string title, string author, int pageCount, bool writable) : base(
0xFF1,
title,
author,
pageCount,
writable
)
{
}
// Intended for defined books only
public RedBook(bool writable) : base(0xFF1, writable)
{
}
public RedBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}

View file

@ -1,44 +1,49 @@
namespace Server.Items
{
public class TanBook : BaseBook
{
[Constructible]
public TanBook() : base(0xFF0)
{
}
[Constructible]
public TanBook(int pageCount, bool writable) : base(0xFF0, pageCount, writable)
{
}
[Constructible]
public TanBook(string title, string author, int pageCount, bool writable) : base(0xFF0, title, author, pageCount,
writable)
{
}
// Intended for defined books only
public TanBook(bool writable) : base(0xFF0, writable)
{
}
public TanBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}
namespace Server.Items
{
public class TanBook : BaseBook
{
[Constructible]
public TanBook() : base(0xFF0)
{
}
[Constructible]
public TanBook(int pageCount, bool writable) : base(0xFF0, pageCount, writable)
{
}
[Constructible]
public TanBook(string title, string author, int pageCount, bool writable) : base(
0xFF0,
title,
author,
pageCount,
writable
)
{
}
// Intended for defined books only
public TanBook(bool writable) : base(0xFF0, writable)
{
}
public TanBook(Serial serial) : base(serial)
{
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
}
}