Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,669 @@
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
{
private string[] m_Lines;
public string[] Lines
{
get
{
return m_Lines;
}
set
{
m_Lines = value;
}
}
public BookPageInfo()
{
m_Lines = new string[0];
}
public BookPageInfo(params string[] lines)
{
m_Lines = lines;
}
public BookPageInfo(GenericReader reader)
{
int length = reader.ReadInt();
m_Lines = new string[length];
for (int i = 0; i < m_Lines.Length; ++i)
m_Lines[i] = Utility.Intern(reader.ReadString());
}
public void Serialize(GenericWriter writer)
{
writer.Write(m_Lines.Length);
for (int i = 0; i < m_Lines.Length; ++i)
writer.Write(m_Lines[i]);
}
}
public class BaseBook : Item, ISecurable
{
private string m_Title;
private string m_Author;
private BookPageInfo[] m_Pages;
private bool m_Writable;
private SecureLevel m_SecureLevel;
[CommandProperty(AccessLevel.GameMaster)]
public string Title
{
get
{
return m_Title;
}
set
{
m_Title = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public string Author
{
get
{
return m_Author;
}
set
{
m_Author = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Writable
{
get
{
return m_Writable;
}
set
{
m_Writable = value;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PagesCount
{
get
{
return m_Pages.Length;
}
}
public string BookString
{
get { return ContentAsString; }
set { BuildBookFromString(value); }
}
public BookPageInfo[] Pages
{
get
{
return m_Pages;
}
}
[Constructable]
public BaseBook(int itemID)
: this(itemID, 20, true)
{
}
[Constructable]
public BaseBook(int itemID, int pageCount, bool writable)
: this(itemID, null, null, pageCount, writable)
{
}
[Constructable]
public BaseBook(int itemID, string title, string author, int pageCount, bool writable)
: base(itemID)
{
m_Title = title;
m_Author = author;
m_Writable = writable;
BookContent content = DefaultContent;
if (content == null)
{
m_Pages = new BookPageInfo[pageCount];
for (int i = 0; i < m_Pages.Length; ++i)
m_Pages[i] = new BookPageInfo();
}
else
{
m_Pages = content.Copy();
}
}
// Intended for defined books only
public BaseBook(int itemID, bool writable)
: base(itemID)
{
m_Writable = writable;
BookContent content = DefaultContent;
if (content == null)
{
m_Pages = new BookPageInfo[0];
}
else
{
m_Title = content.Title;
m_Author = content.Author;
m_Pages = content.Copy();
}
}
public virtual BookContent DefaultContent
{
get
{
return null;
}
}
public void BuildBookFromString(string content)
{
if (content == null)
return;
const int cpl = 22; //characters per line
int pos = 0, nextpos;
List<string[]> newpages = new List<string[]>();
while (newpages.Count < m_Pages.Length && pos < content.Length)
{
List<string> lines = new List<string>();
for (int i = 0; i < 8; ++i)
{
if (content.Length - pos < cpl)
{
lines.Add(content.Substring(pos));
pos = content.Length;
break;
}
else
{
if ((nextpos = content.LastIndexOfAny(" /|\\.!@#$%^&*()_+=-".ToCharArray(), pos + cpl, cpl)) > 0)
{
lines.Add(content.Substring(pos, (nextpos - pos) + 1));
pos = nextpos + 1;
}
else
{
lines.Add(content.Substring(pos, cpl));
pos += cpl;
}
}
}
newpages.Add(lines.ToArray());
}
for (int i = 0; i < m_Pages.Length; ++i)
{
if (i < newpages.Count)
{
m_Pages[i] = new BookPageInfo(newpages[i]);
}
else
{
m_Pages[i] = new BookPageInfo();
}
}
}
public BaseBook(Serial serial)
: base(serial)
{
}
[Flags]
private enum SaveFlags
{
None = 0x00,
Title = 0x01,
Author = 0x02,
Writable = 0x04,
Content = 0x08
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
BookContent content = DefaultContent;
SaveFlags flags = SaveFlags.None;
if (m_Title != (content == null ? null : content.Title))
flags |= SaveFlags.Title;
if (m_Author != (content == null ? null : content.Author))
flags |= SaveFlags.Author;
if (m_Writable)
flags |= SaveFlags.Writable;
if (content == null || !content.IsMatch(m_Pages))
flags |= SaveFlags.Content;
writer.Write((int)4); // version
writer.Write((int)m_SecureLevel);
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(m_Pages.Length);
for (int i = 0; i < m_Pages.Length; ++i)
m_Pages[i].Serialize(writer);
}
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 4:
{
m_SecureLevel = (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;
m_Writable = (flags & SaveFlags.Writable) != 0;
if ((flags & SaveFlags.Content) != 0)
{
m_Pages = new BookPageInfo[reader.ReadEncodedInt()];
for (int i = 0; i < m_Pages.Length; ++i)
m_Pages[i] = new BookPageInfo(reader);
}
else
{
if (content != null)
m_Pages = content.Copy();
else
m_Pages = new BookPageInfo[0];
}
break;
}
case 1:
case 0:
{
m_Title = reader.ReadString();
m_Author = reader.ReadString();
m_Writable = reader.ReadBool();
if (version == 0 || reader.ReadBool())
{
m_Pages = new BookPageInfo[reader.ReadInt()];
for (int i = 0; i < m_Pages.Length; ++i)
m_Pages[i] = new BookPageInfo(reader);
}
else
{
BookContent content = DefaultContent;
if (content != null)
m_Pages = content.Copy();
else
m_Pages = new BookPageInfo[0];
}
break;
}
}
if (version < 3 && (Weight == 1 || Weight == 2))
Weight = -1;
}
public override void AddNameProperty(ObjectPropertyList list)
{
if (m_Title != null && m_Title.Length > 0)
list.Add(m_Title);
else
base.AddNameProperty(list);
}
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "{0} by {1}", m_Title, m_Author);
LabelTo(from, "[{0} pages]", m_Pages.Length);
}
public override void OnDoubleClick(Mobile from)
{
if (m_Title == null && m_Author == null && m_Writable == true)
{
Title = "a book";
Author = from.Name;
}
from.Send(new BookHeader(from, this));
from.Send(new BookPageDetails(this));
}
public string ContentAsString
{
get
{
StringBuilder sb = new StringBuilder();
foreach (BookPageInfo bpi in m_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 m_Pages)
{
lines.AddRange(bpi.Lines);
}
return lines.ToArray();
}
}
public virtual void ContentChangeEC(NetState state, PacketReader pvSrc)
{
int page = pvSrc.ReadUInt16();
int lineCount = pvSrc.ReadUInt16();
int index = page - 1;
if (index < 0 || index >= m_Pages.Length)
return;
if (lineCount == 0xFFFF)
{
// send for new page
state.Send(new BookPageDetails(this, page, m_Pages[index]));
}
else if (m_Writable && state.Mobile != null && state.Mobile.InRange(GetWorldLocation(), 1))
{
// updates after page is moved away from
if (lineCount <= 19)
{
string[] lines = new string[lineCount];
for (int j = 0; j < lineCount; ++j)
if ((lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80)
return;
m_Pages[index].Lines = lines;
}
else
{
return;
}
}
}
public static void Initialize()
{
PacketHandlers.Register(0xD4, 0, true, new OnPacketReceive(HeaderChange));
PacketHandlers.Register(0x66, 0, true, new OnPacketReceive(ContentChange));
PacketHandlers.Register(0x93, 99, true, new OnPacketReceive(OldHeaderChange));
}
public static void OldHeaderChange(NetState state, PacketReader pvSrc)
{
Mobile from = state.Mobile;
BaseBook book = World.FindItem(pvSrc.ReadInt32()) as BaseBook;
if (book == null || !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;
BaseBook book = World.FindItem(pvSrc.ReadInt32()) as BaseBook;
if (book == null || !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;
BaseBook book = World.FindItem(pvSrc.ReadInt32()) as BaseBook;
if (book == null || !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;
}
}
}
#region ISecurable Members
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level
{
get
{
return m_SecureLevel;
}
set
{
m_SecureLevel = value;
}
}
#endregion
}
public sealed class BookPageDetails : Packet
{
public BookPageDetails(BaseBook book)
: base(0x66)
{
EnsureCapacity(256);
m_Stream.Write((int)book.Serial);
m_Stream.Write((ushort)book.PagesCount);
for (int i = 0; i < book.PagesCount; ++i)
{
BookPageInfo page = book.Pages[i];
m_Stream.Write((ushort)(i + 1));
m_Stream.Write((ushort)page.Lines.Length);
for (int j = 0; j < page.Lines.Length; ++j)
{
byte[] buffer = Utility.UTF8.GetBytes(page.Lines[j]);
m_Stream.Write(buffer, 0, buffer.Length);
m_Stream.Write((byte)0);
}
}
}
public BookPageDetails(BaseBook book, int page, BookPageInfo info)
: base(0x66)
{
EnsureCapacity(256);
m_Stream.Write((int)book.Serial);
m_Stream.Write((ushort)0x1);
m_Stream.Write((ushort)page);
m_Stream.Write((ushort)info.Lines.Length);
for (int i = 0; i < info.Lines.Length; ++i)
{
byte[] buffer = Utility.UTF8.GetBytes(info.Lines[i]);
m_Stream.Write(buffer, 0, buffer.Length);
m_Stream.Write((byte)0);
}
}
}
public sealed class BookHeader : Packet
{
public BookHeader(Mobile from, BaseBook book)
: base(0xD4)
{
string title = book.Title == null ? "" : book.Title;
string author = book.Author == null ? "" : book.Author;
byte[] titleBuffer = Utility.UTF8.GetBytes(title);
byte[] authorBuffer = Utility.UTF8.GetBytes(author);
EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
m_Stream.Write((int)book.Serial);
m_Stream.Write((bool)true);
m_Stream.Write((bool)book.Writable && from.InRange(book.GetWorldLocation(), 1));
m_Stream.Write((ushort)book.PagesCount);
m_Stream.Write((ushort)(titleBuffer.Length + 1));
m_Stream.Write(titleBuffer, 0, titleBuffer.Length);
m_Stream.Write((byte)0); // terminate
m_Stream.Write((ushort)(authorBuffer.Length + 1));
m_Stream.Write(authorBuffer, 0, authorBuffer.Length);
m_Stream.Write((byte)0); // terminate
}
}
}

View File

@@ -0,0 +1,92 @@
using System;
using Server;
using Server.Gumps;
namespace Server.Items
{
public class BaseJournalGump : Gump
{
public BaseJournalGump(TextDefinition title, TextDefinition body)
: base(10, 10)
{
AddImage(0, 0, 0x761C);
int y = 20;
if (title != null)
{
if (title.Number > 0)
{
AddHtmlLocalized(50, y, 450, 20, 1154645, String.Format("#{0}", title.Number.ToString()), 0, false, false);
y += 30;
}
else
{
AddHtml(50, y, 450, 20, String.Format("<CENTER>{0}</CENTER>", title.String), false, false);
y += 30;
}
}
if (body.Number > 0)
{
AddHtmlLocalized(95, y, 380, 600, body.Number, 1, false, true);
}
else
{
AddHtml(95, y, 380, 600, body.String, false, true);
}
}
}
public abstract class BaseJournal : Item
{
public abstract TextDefinition Title { get; }
public abstract TextDefinition Body { get; }
public BaseJournal()
: base(0xFBE)
{
}
public BaseJournal(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile m)
{
if (IsChildOf(m.Backpack))
{
m.SendGump(new BaseJournalGump(Title, Body));
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (Title != null)
{
if (Title.Number > 0)
{
list.Add(Title.Number);
}
else
{
list.Add(Title.String);
}
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // Version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,130 @@
using System;
using Server.Multis;
using Server.Gumps;
using Server.ContextMenus;
using System.Collections.Generic;
namespace Server.Items
{
public abstract class BaseLocalizedBook : Item
{
public virtual object Title { get { return "a book"; } }
public virtual object Author { get { return "unknown"; } }
public abstract int[] Contents { get; }
public BaseLocalizedBook() : base(4082)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
else
{
from.CloseGump(typeof(InternalGump));
from.SendGump(new InternalGump(this));
from.SendSound(0x55);
}
}
private class InternalGump : Gump
{
public readonly int Page1X = 40;
public readonly int Page2X = 230;
public readonly int StartY = 30;
public readonly int Width = 140;
public readonly int Height = 175;
private BaseLocalizedBook m_Book;
public InternalGump(BaseLocalizedBook book)
: base(50, 50)
{
m_Book = book;
int page = 0;
int pages = (int)Math.Ceiling(m_Book.Contents.Length / 2.0);
AddPage(page);
AddImage(0, 0, 500);
page++;
AddPage(page);
if (book.Title is int)
AddHtmlLocalized(Page1X, 60, Width, 48, (int)book.Title, false, false);
else if (book.Title is string)
AddHtml(Page1X, 60, Width, 48, (string)book.Title, false, false);
else
AddLabel(Page1X, 60, 0, "A Book");
AddHtml(40, 130, 200, 16, "by", false, false);
if (book.Author is int)
AddHtmlLocalized(Page1X, 155, Width, 16, (int)book.Author, false, false);
else if (book.Author is string)
AddHtml(Page1X, 155, Width, 16, (string)book.Author, false, false);
else
AddLabel(Page1X, 155, 0, "unknown");
for (int i = 0; i < m_Book.Contents.Length; i++)
{
int cliloc = m_Book.Contents[i];
bool endPage = false;
int x = Page1X;
if (cliloc <= 0)
continue;
if (page == 1)
{
x = Page2X;
endPage = true;
}
else
{
if ((i + 1) % 2 == 0)
x = Page1X;
else if (page <= pages)
{
endPage = true;
x = Page2X;
}
}
AddHtmlLocalized(x, StartY, Width, Height, cliloc, false, false);
if (page < pages)
AddButton(356, 0, 502, 502, 0, GumpButtonType.Page, page + 1);
if (page > 0)
AddButton(0, 0, 501, 501, 0, GumpButtonType.Page, page - 1);
if (endPage)
{
page++;
AddPage(page);
}
}
}
}
public BaseLocalizedBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,252 @@
using System;
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 judgement",
"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 absense",
"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 opression 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 idealogy 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."));
[Constructable]
public BlackthornWelcomeBook()
: base(false)
{
this.Hue = 0x89B;
}
public BlackthornWelcomeBook(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class BlueBook : BaseBook
{
[Constructable]
public BlueBook()
: base(0xFF2, 40, true)
{
}
[Constructable]
public BlueBook(int pageCount, bool writable)
: base(0xFF2, pageCount, writable)
{
}
[Constructable]
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(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

View File

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

View File

@@ -0,0 +1,94 @@
using System;
namespace Server.Items
{
public class BookOfCircles : BrownBook
{
public static readonly BookContent Content = new BookContent(
"Book Of Circles", "unknown",
new BookPageInfo(
"All begins with the three",
"principles:",
"Control Passion and",
"Diligence."),
new BookPageInfo(
"From Control springs",
"Direction.",
"From Passion springs",
"Feeling.",
"From Diligence springs",
"Persistence."),
new BookPageInfo(
"But these three are no",
"more important than the",
"other five: Control com",
"bines with Passion to",
"give Balance. Passion",
"combines with Diligence",
"to yield Achievement."),
new BookPageInfo(
"And Diligence joins with",
"Control to provide",
"Precision.",
"The absence of Control",
"Passion and Diligence is",
"Chaos."),
new BookPageInfo(
"Thus the absence of the",
"principles points toward",
"the seventh virtue, Order.",
"The three principles unify",
"to form Singularity."),
new BookPageInfo(
"This is the eighth virtue,",
"but is also the first,",
"because within Singularity",
"can be found all the",
"principles and thus all",
"the virtues."),
new BookPageInfo(
"A circle has no end",
"It continues forever,",
"with all parts equally",
"important in the success",
"of the whole."),
new BookPageInfo(
"Our society is the same.",
"It too continues forever,",
"with all members (and all",
"virtues) equal parts of",
"The unified whole."));
[Constructable]
public BookOfCircles()
: base(false)
{
this.Hue = 2210;
}
public BookOfCircles(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class BrownBook : BaseBook
{
[Constructable]
public BrownBook()
: base(0xFEF)
{
}
[Constructable]
public BrownBook(int pageCount, bool writable)
: base(0xFEF, pageCount, writable)
{
}
[Constructable]
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(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

View File

@@ -0,0 +1,114 @@
using System;
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."));
[Constructable]
public DrakovsJournal()
: base(false)
{
}
public DrakovsJournal(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,159 @@
using System;
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"));
[Constructable]
public FropozJournal()
: base(false)
{
}
public FropozJournal(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Fropoz's Journal");
}
public override void OnSingleClick(Mobile from)
{
this.LabelTo(from, "Fropoz's Journal");
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,449 @@
using Server;
using System;
using Server.Multis;
using Server.Gumps;
using Server.ContextMenus;
using System.Collections.Generic;
namespace Server.Items
{
public class GargishDocumentBook : BaseLocalizedBook, ISecurable
{
private SecureLevel m_Level;
public override int[] Contents
{
get { return new int[] { }; }
}
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level
{
get { return m_Level; }
set { m_Level = value; }
}
public GargishDocumentBook()
{
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public override void AddNameProperty(ObjectPropertyList list)
{
if (Title is int)
list.Add(1150928, String.Format("#{0}", (int)Title)); // Gargish Document - ~1_NAME~
else if (Title is string)
list.Add(1150928, (string)Title);
else
base.AddNameProperty(list);
}
public GargishDocumentBook( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
writer.Write((int)m_Level);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
m_Level = (SecureLevel)reader.ReadInt();
}
}
public class GargishDocumentNote : Note
{
public virtual int Title { get { return 0; } }
public GargishDocumentNote()
: base()
{
}
public GargishDocumentNote(int content) : base(content)
{
}
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add(1150928, String.Format("#{0}", Title)); // Gargish Document - ~1_NAME~
}
public GargishDocumentNote( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ChallengeRite : GargishDocumentBook
{
public override object Title { get { return 1150904; } } // The Challenge Rite
public override object Author { get { return "unknown"; } }
public override int[] Contents
{
get
{
return new int[] { 1150915, 1150916, 1150917, 1150918, 1150919, 1150920, 1150921, 1150922 };
}
}
[Constructable]
public ChallengeRite()
{
Hue = 1007;
}
public ChallengeRite( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class OnTheVoid : GargishDocumentBook
{
public override object Title { get { return 1150907; } } // On the Void
public override object Author { get { return "Prugyilonus"; } }
public override int[] Contents
{
get
{
return new int[] { 1150894, 1150895, 1150896 };
}
}
[Constructable]
public OnTheVoid()
{
Hue = 404;
}
public OnTheVoid( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class InMemory : GargishDocumentBook
{
public override object Title { get { return 1150913; } } // In Memory
public override object Author { get { return "Queen Zhah"; } }
public override int[] Contents
{
get
{
return new int[] { 1151071, 1151072, 1151073 };
}
}
[Constructable]
public InMemory()
{
Hue = 375;
}
public InMemory( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ChronicleOfTheGargoyleQueen1 : GargishDocumentBook
{
public static void Initialize()
{
for(int i = 0; i < 34; i++)
{
if(i == 0)
m_Contents[i] = 1150901;
else
{
m_Contents[i] = 1150943 + (i - 1);
}
}
}
private static int[] m_Contents = new int[34];
public override object Title { get { return 1150914; } } // Chronicle of the Gargoyle Queen Vol. 1
public override object Author { get { return "Queen Zhah"; } }
public override int[] Contents { get { return m_Contents; } }
private int m_Charges;
[CommandProperty(AccessLevel.GameMaster)]
public int Charges { get { return m_Charges; } set { m_Charges = value; InvalidateProperties(); } }
[Constructable]
public ChronicleOfTheGargoyleQueen1()
{
Hue = 567;
m_Charges = 500;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1153098, m_Charges.ToString());
}
public ChronicleOfTheGargoyleQueen1(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
writer.Write(m_Charges);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
m_Charges = reader.ReadInt();
}
}
public class AnthenaeumDecree : GargishDocumentNote
{
public override int Title { get { return 1150905; } } // Athenaeum Decree
[Constructable]
public AnthenaeumDecree() : base(1150891)
{
}
public AnthenaeumDecree( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class LetterFromTheKing : GargishDocumentNote
{
public override int Title { get { return 1150906; } } // A Letter from the King
private string m_Content = "To Her Honor the High Broodmother, Lady Zhah from his majesty, King Trajalem:<br><br> High Broodmother, I have received your latest petition regarding your desires and I once again must remind you that I have absolutely no interest in altering tradition or granting you the freedom from the slavery you have deluded yourself into believing makes up your life.<br><br>Please remember that your office may be stripped by me if you are deemed unfit to lead the other Broodmothers. Be happy with your place and do not forget it; this is the last time I will lower myself to respond to these ridiculous accusations and requests.";
[Constructable]
public LetterFromTheKing() : base()
{
NoteString = m_Content;
}
public LetterFromTheKing( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ShilaxrinarsMemorial : GargishDocumentNote
{
public override int Title { get { return 1150908; } } // Shilaxrinar's Memorial
[Constructable]
public ShilaxrinarsMemorial() : base(1150899)
{
}
public ShilaxrinarsMemorial( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ToTheHighScholar : GargishDocumentNote
{
public override int Title { get { return 1150909; } } // To the High Scholar
[Constructable]
public ToTheHighScholar() : base(1151062)
{
}
public ToTheHighScholar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ToTheHighBroodmother : GargishDocumentNote
{
public override int Title { get { return 1150910; } } // To the High Broodmother
[Constructable]
public ToTheHighBroodmother() : base(1151064)
{
}
public ToTheHighBroodmother( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class ReplyToTheHighScholar : GargishDocumentNote
{
public override int Title { get { return 1150911; } } // Reply to the High Scholar
[Constructable]
public ReplyToTheHighScholar() : base(1151066)
{
}
public ReplyToTheHighScholar( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
public class AccessToTheIsle : GargishDocumentNote
{
public override int Title { get { return 1150912; } } // Access to the Isle
[Constructable]
public AccessToTheIsle() : base(1151069)
{
}
public AccessToTheIsle( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class GargoyleBook100 : BaseBook
{
[Constructable]
public GargoyleBook100()
: base(0x42B7, 100, true)
{
}
[Constructable]
public GargoyleBook100(int pageCount, bool writable)
: base(0x42B7, pageCount, writable)
{
}
[Constructable]
public GargoyleBook100(string title, string author, int pageCount, bool writable)
: base(0x42B7, title, author, pageCount, writable)
{
}
// Intended for defined books only
public GargoyleBook100(bool writable)
: base(0x42B7, writable)
{
}
public GargoyleBook100(Serial serial)
: base(serial)
{
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class GargoyleBook200 : BaseBook
{
[Constructable]
public GargoyleBook200()
: base(0x42B8, 200, true)
{
}
[Constructable]
public GargoyleBook200(int pageCount, bool writable)
: base(0x42B8, pageCount, writable)
{
}
[Constructable]
public GargoyleBook200(string title, string author, int pageCount, bool writable)
: base(0x42B8, title, author, pageCount, writable)
{
}
// Intended for defined books only
public GargoyleBook200(bool writable)
: base(0x42B8, writable)
{
}
public GargoyleBook200(Serial serial)
: base(serial)
{
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

View File

@@ -0,0 +1,722 @@
using System;
namespace Server.Items
{
public class GrimmochJournal1 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day One :",
"",
"'Tis a grand sight, this",
"primeval tomb, I agree",
"with Tavara on that.",
"And we've a good crew",
"here, they've strong",
"backs and a good"),
new BookPageInfo(
"attitude. I'm a bit",
"concerned by those",
"that worked as guides",
"for us, however. All",
"seemed well enough",
"until we revealed the",
"immense stone doors",
"of the tomb structure"),
new BookPageInfo(
"itself. Seemed to send",
"a shiver up their",
"spines and get them all",
"stirred up with",
"whispering. I'll",
"watch the lot of them",
"with a close eye, but",
"I'm confident we won't"),
new BookPageInfo(
"have any real",
"problems on the dig.",
"I'm especially proud to",
"see Thomas standing",
"out - he was a good",
"hire, despite the",
"warnings from his",
"previous employers."),
new BookPageInfo(
"He's drummed up the",
"workers into a",
"furious pace - we've",
"nearly halved the",
"estimate on the",
"timeline for",
"excavating the Tomb's",
"entrance."));
[Constructable]
public GrimmochJournal1()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal1(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal2 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Two :",
"",
"We managed to dig out",
"the last of the",
"remaining rubble",
"today, revealing the",
"entirety of the giant",
"stone doors that sealed"),
new BookPageInfo(
"ol' Khal Ankur and",
"his folk up ages ago.",
"Actually getting them",
"open was another",
"matter altogether,",
"however. As the",
"workers set to the",
"task with picks and"),
new BookPageInfo(
"crowbars, I could have",
"sworn I saw Lysander",
"Gathenwale fiddling",
"with something in that",
"musty old tome of his.",
" I've no great",
"knowledge of things",
"magical, but the way"),
new BookPageInfo(
"his hand moved over",
"that book, and the look",
"of concentration on his",
"face as he whispered",
"something to himself",
"looked like every",
"description of an",
"incantation I've ever"),
new BookPageInfo(
"heard. The strange",
"thing is, this set of",
"doors that an entire",
"crew of excavators",
"was laboring over for",
"hours, right when",
"Gathenwale finishes",
"with his mumbling..."),
new BookPageInfo(
"well, I swore the doors",
"just gave open at the",
"exact moment he",
"spoke his last bit of",
"whisper and shut the",
"tome tight in his",
"hands. When he",
"looked up, it was"),
new BookPageInfo(
"almost as if he was",
"expecting the doors to",
"be open, rather than",
"shocked that they'd",
"finally given way."));
[Constructable]
public GrimmochJournal2()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal2(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal3 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Three - Day Five:",
"",
"I might have",
"written too hastily in",
"my first entry - this",
"place doesn't seem too",
"bent on giving up any",
"secrets. Though the"),
new BookPageInfo(
"main antechamber is",
"open to us, the main",
"exit hall is blocked by",
"yet another pile of",
"rubble. Doesn't look a",
"bit like anything",
"caused by a quake or",
"instability in the"),
new BookPageInfo(
"stonework... I swear it",
"looks as if someone",
"actually piled the",
"stones up themselves,",
"some time after the",
"tomb was built. The",
"stones aren't of the",
"same set nor quality"),
new BookPageInfo(
"of the carved work",
"that surrounds them",
"- if anything, they",
"resemble the grade of",
"common rock we saw",
"in great quantities on",
"the trip here. Which",
"makes it feel all the"),
new BookPageInfo(
"more like someone",
"hauled them in and",
"deliberately covered",
"this passage. But then",
"why not decorate them",
"in the same ornate",
"manner as the rest of",
"the stone in this"),
new BookPageInfo(
"place? Lysander",
"wouldn't hear a word",
"of what I had to say -",
"to him, it was a quake",
"some time in the",
"history of the tomb,",
"and that was it, shut",
"up and move on. So I"),
new BookPageInfo(
"shut up, and got back",
"to work."));
[Constructable]
public GrimmochJournal3()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal3(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal6 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Six :",
"",
"The camp was",
"attacked last night by",
"a pack of, well, I don't",
"have a clue. I've never",
"seen the like of these",
"beasts anywhere."),
new BookPageInfo(
"Huge things, with",
"fangs the size of your",
"forefinger, covered in",
"hair and with the",
"strangest arched back",
"I've ever seen. And so",
"many of them. We",
"were forced back into"),
new BookPageInfo(
"the Tomb for the",
"night, just to keep our",
"hides on us. And",
"today Gathenwale",
"practically orders us",
"all to move the entire",
"exterior camp into the",
"Tomb. Now, I don't"),
new BookPageInfo(
"disagree that we'd be",
"well off to use the",
"place as a point of",
"fortification... but I",
"don't like it one bit, in",
"any case. I don't like",
"the look of this place,",
"nor the sound of it."),
new BookPageInfo(
"The way the wind",
"gets into the",
"passageways,",
"whistling up the",
"strangest noises.",
"Deep, sustained echoes",
"of the wind, not so",
"much flute-like as..."),
new BookPageInfo(
"well, it sounds",
"ridiculous. In any",
"case, we've set to work",
"moving the bulk of the",
"exterior camp into the",
"main antechamber, so",
"there's no use moaning",
"about it now."));
[Constructable]
public GrimmochJournal6()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal6(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal7 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Seven - Day Ten:",
"",
"I cannot stand this",
"place, I cannot bear it.",
"I've got to get out.",
"Something evil lurks",
"in this ancient place,",
"something best left"),
new BookPageInfo(
"alone. I hear them,",
"yet none of the others",
"do. And yet they",
"must. Hands, claws,",
"scratching at stone,",
"the awful scratching",
"and the piteous cries",
"that sound almost like"),
new BookPageInfo(
"laughter. I can hear",
"them above even the",
"cracks of the",
"workmen's picks, and",
"at night they are all I",
"can hear. And yet the",
"others hear nothing.",
"We must leave this"),
new BookPageInfo(
"place, we must.",
"Three workers have",
"gone missing - Tavara",
"expects they've",
"abandoned us - and I",
"count them lucky if",
"they have. I don't care",
"what the others say,"),
new BookPageInfo(
"we must leave this",
"place. We must do as",
"those before and pile",
"up the stones, block all",
"access to this primeval",
"crypt, seal it up again",
"for all eternity."));
[Constructable]
public GrimmochJournal7()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal7(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal11 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Eleven - Day",
"Thirteen :",
"",
"Lysander is gone, and",
"two more workers",
"with him. Good",
"riddance to the first.",
"He knows something."),
new BookPageInfo(
"He heard them too, I",
"know he did - and yet",
"he scowled at me",
"when I mentioned",
"them. I cannot stop",
"the noise in my head,",
"the scratching, the",
"clawing tears at my"),
new BookPageInfo(
"senses. What is it?",
"What does Lysander",
"seek that I can only",
"turn from? Where",
"has he gone? The",
"only answer to my",
"questions comes as",
"laughter from behind"),
new BookPageInfo(
"the stones."));
[Constructable]
public GrimmochJournal11()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal11(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal14 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Fourteen - Day",
"Sixteen :",
"",
"We are lost... we are",
"lost... all is lost. The",
"dead are piled up at",
"my feet. Bergen and I",
"somehow managed in"),
new BookPageInfo(
"the madness to piece",
"together a barricade,",
"barring access to the",
"camp antechamber.",
"He knows as well as I",
"that we cannot hold it",
"forever. The dead",
"come. They took"),
new BookPageInfo(
"Lysander before our",
"eyes. I pity the soul",
"of even such a",
"madman - no one",
"should die in such a",
"manner. And yet so",
"many have. We're",
"trapped here in this"),
new BookPageInfo(
"horror. So many have",
"died, and for what?",
"What curse have we",
"stumbled upon? I",
"cannot bear it, the",
"moaning, wailing cries",
"of the dead. Poor",
"Thomas, cut to pieces"),
new BookPageInfo(
"by their blades. We",
"had only an hour to",
"properly bury those",
"we could, before the",
"undead legions struck",
"again. I cannot go on...",
"I cannot go on."));
[Constructable]
public GrimmochJournal14()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal14(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal17 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Seventeen - Day",
"Twenty-Two :",
"",
"The fighting never",
"ceases... the blood",
"never stops flowing,",
"like a river through",
"the bloated corpses of"),
new BookPageInfo(
"the dead. And yet",
"there are still more.",
"Always more, with",
"the red fire gleaming",
"in their eyes. My",
"arm aches, I've taken",
"to the sword as my",
"bow seems to do little"),
new BookPageInfo(
"good... the dull ache in",
"my arm... so many",
"swings, cleaving a",
"mountain of decaying",
"flesh. And Thomas...",
"he was there, in the",
"thick of it... Thomas",
"was beside me..."),
new BookPageInfo(
"his face cleaved in",
"twain - and yet beside",
"me, fighting with us",
"against the horde until",
"he was cut down once",
"again. And I swear I",
"see him even now,",
"there in the dark"),
new BookPageInfo(
"corner of the",
"antechamber, his eyes",
"flickering in the last",
"dying embers of the",
"fire... and he stares at",
"me, and a scream fills",
"the vault - whether",
"his or mine, I can no"),
new BookPageInfo(
"longer tell."));
[Constructable]
public GrimmochJournal17()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal17(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class GrimmochJournal23 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"The daily journal of Grimmoch Drummel", "Grimmoch",
new BookPageInfo(
"Day Twenty-Three :",
"",
"We no longer bury the",
"dead."));
[Constructable]
public GrimmochJournal23()
: base(Utility.Random(0xFF1, 2), false)
{
}
public GrimmochJournal23(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,230 @@
using System;
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?"));
[Constructable]
public KaburJournal()
: base(false)
{
}
public KaburJournal(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Khabur's Journal");
}
public override void OnSingleClick(Mobile from)
{
this.LabelTo(from, "Khabur's Journal");
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,496 @@
using System;
namespace Server.Items
{
public class LysanderNotebook1 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day One :",
"",
"At last, it stands",
"before me. The doors",
"of Thy Sanctum will",
"open to me now, after",
"all these years of",
"searching. I give"),
new BookPageInfo(
"myself unto Thee,",
"Khal Ankur, I have",
"come for Thy secrets",
"and I will kneel",
"prostrate before Thee.",
" Blessed are the",
"Keepers, praise unto",
"Thee, a thousand"),
new BookPageInfo(
"fortunes in the night."));
[Constructable]
public LysanderNotebook1()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook1(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class LysanderNotebook2 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day Two:",
"",
"The woman, Tavara",
"Sewel, is unbearable.",
"Her entire demeanor",
"sickens me. I would",
"take her life for Thee",
"now, my Lord. But I"),
new BookPageInfo(
"cannot alert the",
"others. Progress is",
"made too slowly, I",
"cannot stand this",
"perpetual waiting.",
"Today I knelt down",
"with the workers,",
"tossing stones and dirt"),
new BookPageInfo(
"aside with my very",
"hands as they dug at",
"the last of the rubble",
"covering the entrance",
"to Thy Sanctum. The",
"Sewel woman was",
"shocked at my",
"demeanor, dirtying"),
new BookPageInfo(
"my robes, on my",
"knees in the muck as I",
"clawed at the rocks.",
"She thought I did this",
"for those sickly",
"scholars, or for her,",
"or for what she",
"laughably calls 'The"),
new BookPageInfo(
"Gift of Discovery', of",
"learning. As if I did",
"not know what I went",
"to find! I come for",
"Thee, Master. Soon",
"shall I receive Thy",
"gifts, Thy blessings.",
"Patience, eternal"),
new BookPageInfo(
"patience. I must take",
"my lessons well. I",
"have learned from",
"Thee, Master, I have."));
[Constructable]
public LysanderNotebook2()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook2(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class LysanderNotebook3 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day Three - Day Six:",
"",
"What are these Beasts",
"that dare to defy our",
"presence here? Hast",
"Thou sent them,",
"Master? To tear",
"apart these foolish"),
new BookPageInfo(
"ones that accompany",
"me? That repugnant",
"pustule, Drummel, put",
"forth his absurd little",
"theories as to the",
"nature of the Beasts",
"that attacked our",
"camp, but I'll have"),
new BookPageInfo(
"none of his words. He",
"asks too many",
"questions. He is a",
"taint upon the grounds",
"of Thy Sanctum,",
"Master - I will deal",
"with him after the",
"Sewel woman."),
new BookPageInfo(
"Speaking of Sewel, I",
"have convinced that",
"empty-headed harlot",
"that we should move",
"our encampment",
"within the",
"antechamber. She",
"thinks I worry for"),
new BookPageInfo(
"her safety. I come",
"for thee, Master. I",
"make my camp in Thy",
"chambers. I sleep",
"under Thy roof. I can",
"feel Thine presence",
"even now. Soon,",
"Master. Soon."));
[Constructable]
public LysanderNotebook3()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook3(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class LysanderNotebook7 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day Seven :",
"",
"The Sewel woman",
"pratters on endlessly.",
"And she dares to",
"speak Thy Name,",
"Master! I wish so",
"vehemently to take a"),
new BookPageInfo(
"knife to that little",
"neck of hers. She",
"struts around the",
"chambers of Thy",
"Sanctum with her",
"repugnant airs, her",
"scholarly conjecture",
"on this or that. That I"),
new BookPageInfo(
"could peel the skin",
"from her face and",
"show her how vile and",
"ugly she truly is, how",
"unworthy of entrance",
"to Thy Sanctum. I",
"must take her,",
"Master. I must rend"),
new BookPageInfo(
"that little wench to",
"pieces. I ask this gift",
"of Thee, that I might",
"cleanse Thy Sanctum",
"of her presence. Give",
"me the Sewel woman",
"and I shall show you",
"my mastery of Death,"),
new BookPageInfo(
"Master. I shall cut",
"her to bits and scatter",
"them before the",
"others as a warning.",
"I cannot stand her",
"presence, I cannot",
"abide it. And",
"Drummel! He is a"),
new BookPageInfo(
"pustule that must be",
"lanced, a sickness that",
"I must cure by blade",
"and fire. Not a trace",
"of him will be left",
"when I'm done with",
"him. Praises to Thee,",
"Master. I shall honor"),
new BookPageInfo(
"Thee with many",
"sacrifices, soon",
"enough."));
[Constructable]
public LysanderNotebook7()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook7(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class LysanderNotebook8 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day Eight - Day Ten :",
"",
"Have you taken them,",
"Master? They could",
"not have found a way",
"past the stones that",
"block our path! The",
"three workers, My"),
new BookPageInfo(
"Master, where have",
"they gone? Curses",
"upon them! I'll cut",
"them all to pieces if",
"they show their faces",
"again, then burn the",
"rest alive upon a pyre,",
"for all to see, as a"),
new BookPageInfo(
"warning of Thy",
"Power. How could",
"they have gotten past",
"me? I sleep against",
"the very walls, to",
"hear Thy Words, to",
"feel Thy Breath. I",
"can find no egress"),
new BookPageInfo(
"from the chambers",
"that the Sewel woman",
"does not know of nor",
"have men working at",
"excavating. Where",
"have they gone,",
"Master? Have you",
"taken them, or do they"),
new BookPageInfo(
"truly flee from Thy",
"Presence? I will kill",
"them if they show",
"their faces again.",
"Give me Strength, my",
"Master, to let them",
"live a while longer,",
"until they have"),
new BookPageInfo(
"fulfilled their",
"purpose and I kneel",
"before Thee, covered",
"in their blood."));
[Constructable]
public LysanderNotebook8()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook8(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
public class LysanderNotebook11 : BaseBook
{
public static readonly BookContent Content = new BookContent(
"Lysander's Notebook", "L. Gathenwale",
new BookPageInfo(
"Day Eleven - Day",
"Thirteen:",
"",
"I come for Thee, my",
"Master. I come! The",
"way is clear, I have",
"found Thy path and",
"washed it in the blood"),
new BookPageInfo(
"of the two workers",
"that caught sight of",
"me. Ah, how sweet it",
"was to cut them open,",
"to see the blood pour",
"out in great torrents, to",
"stand in it, to revel in",
"it. If only I had time"),
new BookPageInfo(
"for the Sewel woman.",
"But there will be time",
"enough for her. I",
"have learned Thy",
"Patience, Master. I",
"come for Thee. I walk",
"Thy halls in penance,",
"my last steps in this"),
new BookPageInfo(
"repulsive living",
"frame. I come for",
"Thee and Thy Gifts,",
"my Master. Glory",
"Unto Thee, Khal",
"Ankur, Keeper of the",
"Seventh Death,",
"Master, Leader of the"),
new BookPageInfo(
"Chosen, the Khaldun.",
"Praises in Thy",
"Name, Master of Life",
"and Death, Lord of All.",
" Khal Ankur, Master,",
"Prophet, I join Thy",
"ranks this night, a",
"member of the"),
new BookPageInfo(
"Khaldun at last!"));
[Constructable]
public LysanderNotebook11()
: base(Utility.Random(0xFF1, 2), false)
{
}
public LysanderNotebook11(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,117 @@
using System;
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!"));
[Constructable]
public NewAquariumBook()
: base(false)
{
this.Hue = 0;
}
public NewAquariumBook(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,89 @@
using Server;
using Server.Mobiles;
using Server.Gumps;
namespace Server.Items
{
public class Note : Item
{
private string m_String;
public string NoteString { get { return m_String; } set { m_String = value; } }
private int m_Number;
public int Number { get { return m_Number; } set { m_Number = value; } }
[Constructable]
public Note() : base(5357)
{
}
[Constructable]
public Note(string content) : base(5357)
{
m_String = content;
}
[Constructable]
public Note(int number) : base(5357)
{
m_Number = number;
}
public Note(object content) : base(0x1234)
{
if(content is int)
m_Number = (int)content;
else if (content is string)
m_String = (string)content;
}
public override void OnDoubleClick( Mobile m )
{
if( m.InRange( this.GetWorldLocation(), 3 ) )
{
m.CloseGump( typeof( InternalGump ) );
m.SendGump( new InternalGump( this ) );
}
}
private class InternalGump : Gump
{
public InternalGump( Note note ) : base ( 50, 50 )
{
AddImage( 0, 0, 9380 );
AddImage( 114, 0, 9381 );
AddImage( 171, 0, 9382 );
AddImage( 0, 140, 9386 );
AddImage( 114, 140, 9387 );
AddImage( 171, 140, 9388 );
if( note.NoteString != null )
AddHtml(38, 55, 200, 178, "<basefont color=#black>" + note.NoteString, false, true);
else if( note.Number > 0 )
AddHtmlLocalized( 38, 55, 200, 178, note.Number, 1, false, true );
}
}
public Note( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)0);
writer.Write(m_String);
writer.Write(m_Number);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int v = reader.ReadInt();
m_String = reader.ReadString();
m_Number = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class RedBook : BaseBook
{
[Constructable]
public RedBook()
: base(0xFF1)
{
}
[Constructable]
public RedBook(int pageCount, bool writable)
: base(0xFF1, pageCount, writable)
{
}
[Constructable]
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(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

View File

@@ -0,0 +1,565 @@
using System;
using Server.Gumps;
using Server.Prompts;
using Server.Mobiles;
using Server.Spells.Fourth;
using Server.Spells.Seventh;
using Server.Spells.Chivalry;
namespace Server.Items
{
[FlipableAttribute(39958, 39959)]
public class RunicAtlas : Runebook
{
public override int MaxEntries { get { return 48; } }
public override int LabelNumber { get { return 1156443; } } // a runic atlas
public int Selected { get; set; }
[Constructable]
public RunicAtlas() : base(100, 39958)
{
Selected = -1;
}
public override void OnDoubleClick(Mobile from)
{
if (from is PlayerMobile && (from.InRange(GetWorldLocation(), 2) || from.AccessLevel >= AccessLevel.Counselor))
{
if (CheckAccess(from) || from.AccessLevel >= AccessLevel.Counselor)
{
if (DateTime.UtcNow < NextUse)
{
from.SendLocalizedMessage(502406); // This book needs time to recharge.
return;
}
BaseGump.SendGump(new RunicAtlasGump((PlayerMobile)from, this));
Openers.Add(from);
}
else
from.SendLocalizedMessage(502436); // That is not accessible.
}
}
public override bool HasGump(Mobile toCheck)
{
var bookGump = toCheck.FindGump<RunicAtlasGump>();
if (bookGump != null && bookGump.Atlas == this)
{
return true;
}
return false;
}
public override void CloseGump(Mobile m)
{
m.CloseGump(typeof(RunicAtlasGump));
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
int entries = Entries.Count;
bool d = base.OnDragDrop(from, dropped);
if (from is PlayerMobile && d && Entries.Count > entries)
{
int newPage = Math.Max(0, (Entries.Count - 1) / 16);
RunicAtlasGump g = from.FindGump(typeof(RunicAtlasGump)) as RunicAtlasGump;
if (g != null && g.Atlas == this)
{
g.Page = newPage;
g.Refresh();
}
else
{
if (g != null)
from.CloseGump(typeof(RunicAtlasGump));
g = new RunicAtlasGump((PlayerMobile)from, this);
g.Page = newPage;
BaseGump.SendGump(g);
}
}
return d;
}
public override int OnCraft(int quality, bool makersMark, Mobile from, Engines.Craft.CraftSystem craftSystem, Type typeRes, ITool tool, Engines.Craft.CraftItem craftItem, int resHue)
{
if (makersMark)
Crafter = from;
Quality = (BookQuality)(quality - 1);
if (Quality == BookQuality.Exceptional)
{
MaxCharges = Utility.RandomList(80, 90, 100);
}
else
{
MaxCharges = 80;
}
return quality;
}
public RunicAtlas(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(Selected);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
Selected = reader.ReadInt();
if (MaxCharges != 100)
MaxCharges = 100;
}
}
public class RunicAtlasGump : BaseGump
{
public static string ToCoordinates(Point3D location, Map map)
{
int xLong = 0, yLat = 0, xMins = 0, yMins = 0;
bool xEast = false, ySouth = false;
bool valid = Sextant.Format(location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth);
return valid ? string.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W") : "Nowhere";
}
public RunicAtlas Atlas { get; set; }
public int Selected { get { return Atlas == null ? -1 : Atlas.Selected; } }
public int Page { get; set; }
public RunicAtlasGump(PlayerMobile pm, RunicAtlas atlas)
: base(pm, 100, 100)
{
TypeID = 0x1F2;
Atlas = atlas;
Page = 0;
}
public static int GetMapHue(Map map)
{
if (map == Map.Trammel)
return 0xA;
else if (map == Map.Felucca)
return 0x51;
else if (map == Map.Malas)
return 0x44E;
else if (map == Map.Tokuno)
return 0x482;
else if (map == Map.TerMur)
return 0x66D;
return 0;
}
public override void AddGumpLayout()
{
AddImage(0, 0, 39923);
AddHtmlLocalized(60, 9, 147, 22, 1011296, false, false); //Charges:
AddHtml(110, 9, 97, 22, string.Format("{0} / {1}", Atlas.CurCharges, Atlas.MaxCharges), false, false);
AddHtmlLocalized(264, 9, 144, 18, 1011299, false, false); // rename book
AddButton(248, 14, 2103, 2103, 1, GumpButtonType.Reply, 0);
int startIndex = Page * 16;
int index = 0;
for (int i = startIndex; i < startIndex + 16; i++)
{
string desc;
int hue;
if (i < Atlas.Entries.Count)
{
desc = RunebookGump.GetName(Atlas.Entries[i].Description);
hue = Selected == i ? 0x14B : GetMapHue(Atlas.Entries[i].Map);
}
else
{
desc = "Empty";
hue = 0;
}
// Select Button
AddButton(46 + ((index / 8) * 205), 55 + ((index % 8) * 20), 2103, 2104, i + 100, GumpButtonType.Reply, 0);
// Description label
AddLabelCropped(62 + ((index / 8) * 205), 50 + ((index % 8) * 20), 144, 18, hue, desc);
index++;
}
RunebookEntry entry = null;
if (Selected >= 0 && Selected < Atlas.Entries.Count)
{
entry = Atlas.Entries[Selected];
}
string coords = entry != null ? RunebookGump.GetLocation(entry) : "Nowhere";
AddHtml(25, 254, 182, 18, string.Format("<center>{0}</center>", coords), false, false);
AddHtmlLocalized(62, 290, 144, 18, 1011300, false, false); // Set default
AddButton(46, 295, 2103, 2103, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(62, 310, 144, 18, 1011298, false, false); // Drop rune
AddButton(46, 315, 2103, 2103, 3, GumpButtonType.Reply, 0);
AddHtml(25, 348, 182, 18, string.Format("<center>{0}</center>", entry != null ? entry.Description : "Empty"), false, false);
int hy = 284;
int by = 289;
AddHtmlLocalized(280, hy, 128, 18, 1077595, false, false); // Recall (Spell)
AddButton(264, by, 2103, 2103, 4, GumpButtonType.Reply, 0);
hy += 18;
by += 18;
if (Atlas.CurCharges != 0)
{
AddHtmlLocalized(280, hy, 128, 18, 1077594, false, false); // Recall (Charge)
AddButton(264, by, 2103, 2103, 5, GumpButtonType.Reply, 0);
hy += 18;
by += 18;
}
if (User.Skills[SkillName.Magery].Value >= 66.0)
{
AddHtmlLocalized(280, hy, 128, 18, 1015214, false, false); // Gate Travel
AddButton(264, by, 2103, 2103, 6, GumpButtonType.Reply, 0);
hy += 18;
by += 18;
}
AddHtmlLocalized(280, hy, 128, 18, 1060502, false, false); // Sacred Journey
AddButton(264, by, 2103, 2103, 7, GumpButtonType.Reply, 0);
if (Page < 2)
{
AddButton(374, 3, 2206, 2206, 1150, GumpButtonType.Reply, 0);
}
if (Page > 0)
{
AddButton(23, 5, 2205, 2205, 1151, GumpButtonType.Reply, 0);
}
}
public override void OnResponse(RelayInfo info)
{
if (info.ButtonID >= 100 && info.ButtonID < 1000)
{
SelectEntry(info.ButtonID - 100);
}
else
{
RunebookEntry entry = null;
if (Selected >= 0 && Selected < Atlas.Entries.Count)
{
entry = Atlas.Entries[Selected];
}
switch (info.ButtonID)
{
case 0: Atlas.Openers.Remove(User); break;
case 1: RenameBook(); break;
case 2:
{
if (entry != null)
{
SetDefault();
}
else
{
Atlas.Openers.Remove(User);
}
break;
}
case 3:
{
if (entry != null)
{
DropRune(); break;
}
else
{
User.SendLocalizedMessage(502422); // There is no rune to be dropped.
Atlas.Openers.Remove(User);
}
break;
}
case 4:
{
if (entry != null)
{
RecallSpell();
}
else
{
User.SendLocalizedMessage(502423); // This place in the book is empty.
Atlas.Openers.Remove(User);
}
break;
}
case 5:
{
if (entry != null)
{
RecallCharge();
}
else
{
User.SendLocalizedMessage(502423); // This place in the book is empty.
Atlas.Openers.Remove(User);
}
break;
}
case 6:
{
if (entry != null)
{
GateTravel();
}
else
{
User.SendLocalizedMessage(502423); // This place in the book is empty.
Atlas.Openers.Remove(User);
}
break;
}
case 7:
{
if (entry != null)
{
SacredJourney();
}
else
{
User.SendLocalizedMessage(502423); // This place in the book is empty.
Atlas.Openers.Remove(User);
}
break;
}
case 1150:
Page++;
Refresh();
break;
case 1151:
Page--;
Refresh();
break;
}
}
}
public void RenameBook()
{
if (Atlas.CheckAccess(User) && Atlas.Movable != false || User.AccessLevel >= AccessLevel.GameMaster)
{
User.Prompt = new InternalPrompt(Atlas);
}
else
{
User.SendLocalizedMessage(502413); // That cannot be done while the book is locked down.
}
}
private void SelectEntry(int id)
{
Atlas.Selected = id;
Refresh();
}
private void SetDefault()
{
if (Atlas.CheckAccess(User) || User.AccessLevel >= AccessLevel.GameMaster)
{
Atlas.DefaultIndex = Selected;
Refresh();
User.SendLocalizedMessage(502417, "", 0x35); // New default location set.
}
else
{
Atlas.Openers.Remove(User);
User.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down.
}
}
private void DropRune()
{
if (Atlas.CheckAccess(User) && Atlas.Movable != false || User.AccessLevel >= AccessLevel.GameMaster)
{
Atlas.DropRune(User, Atlas.Entries[Selected], Selected);
Refresh();
}
else
{
Atlas.Openers.Remove(User);
User.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down.
}
}
public void SendLocationMessage(RunebookEntry e, Mobile from)
{
if (e.Type == RecallRuneType.Ship)
return;
string coords = ToCoordinates(e.Location, e.Map);
if (coords != "Nowhere")
{
from.SendAsciiMessage(ToCoordinates(e.Location, e.Map));
}
}
private void RecallSpell()
{
RunebookEntry e = Atlas.Entries[Selected];
if (RunebookGump.HasSpell(User, 31))
{
SendLocationMessage(e, User);
Atlas.OnTravel();
new RecallSpell(User, null, e, null).Cast();
}
else
{
User.SendLocalizedMessage(500015); // You do not have that spell!
}
Atlas.Openers.Remove(User);
}
private void RecallCharge()
{
RunebookEntry e = Atlas.Entries[Selected];
if (Atlas.CurCharges <= 0)
{
Refresh();
User.SendLocalizedMessage(502412); // There are no charges left on that item.
}
else
{
SendLocationMessage(e, User);
Atlas.OnTravel();
if (new RecallSpell(User, Atlas, e, Atlas).Cast())
Atlas.NextUse = DateTime.UtcNow;
Atlas.Openers.Remove(User);
}
}
private void GateTravel()
{
RunebookEntry e = Atlas.Entries[Selected];
if (RunebookGump.HasSpell(User, 51))
{
SendLocationMessage(e, User);
Atlas.OnTravel();
if (new GateTravelSpell(User, null, e).Cast())
Atlas.NextUse = DateTime.UtcNow;
}
else
{
User.SendLocalizedMessage(500015); // You do not have that spell!
}
Atlas.Openers.Remove(User);
}
private void SacredJourney()
{
RunebookEntry e = Atlas.Entries[Selected];
if (Core.AOS)
{
if (RunebookGump.HasSpell(User, 209))
{
SendLocationMessage(e, User);
Atlas.OnTravel();
new SacredJourneySpell(User, null, e, null).Cast();
Atlas.NextUse = DateTime.UtcNow;
}
else
{
User.SendLocalizedMessage(500015); // You do not have that spell!
}
}
Atlas.Openers.Remove(User);
}
private class InternalPrompt : Prompt
{
public override int MessageCliloc { get { return 502414; } } // Please enter a title for the runebook:
public RunicAtlas Atlas { get; private set; }
public InternalPrompt(RunicAtlas atlas)
{
Atlas = atlas;
}
public override void OnResponse(Mobile from, string text)
{
if (Atlas.Deleted || !from.InRange(Atlas.GetWorldLocation(), 3) || !(from is PlayerMobile))
return;
if (Atlas.CheckAccess(from) || from.AccessLevel >= AccessLevel.GameMaster)
{
Atlas.Description = Utility.FixHtml(text.Trim());
from.SendGump(new RunicAtlasGump((PlayerMobile)from, Atlas));
from.SendLocalizedMessage(1041531); // You have changed the title of the rune book.
}
else
{
Atlas.Openers.Remove(from);
from.SendLocalizedMessage(502416); // That cannot be done while the book is locked down.
}
}
public override void OnCancel(Mobile from)
{
from.SendLocalizedMessage(502415); // Request cancelled.
if (from is PlayerMobile && !Atlas.Deleted && from.InRange(Atlas.GetWorldLocation(), (Core.ML ? 3 : 1)))
{
from.SendGump(new RunicAtlasGump((PlayerMobile)from, Atlas));
}
}
}
}
}

View File

@@ -0,0 +1,44 @@
using System;
namespace Server.Items
{
public class ShrineMantra : BrownBook
{
public static readonly BookContent Content = new BookContent(
"Shrine of Singularity Mantra", "Naxatillor",
new BookPageInfo(
"unorus"));
[Constructable]
public ShrineMantra()
: base(false)
{
this.Hue = 2210;
}
public ShrineMantra(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,214 @@
using System;
using Server.Gumps;
using Server.Mobiles;
using Server.ContextMenus;
using System.Collections.Generic;
using Server.Multis;
using System.Linq;
namespace Server.Items
{
[Flipable(0x9A95, 0x9AA7)]
public abstract class BaseSpecialScrollBook : Container, ISecurable
{
public const int MaxScrolls = 300;
private int _Capacity;
[CommandProperty(AccessLevel.GameMaster)]
public int Capacity
{
get { return _Capacity <= 0 ? MaxScrolls : _Capacity; }
set
{
_Capacity = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level { get; set; }
public override bool DisplaysContent { get { return false; } }
public override double DefaultWeight { get { return 1.0; } }
public abstract Type ScrollType { get; }
public abstract int BadDropMessage { get; }
public abstract int DropMessage { get; }
public abstract int RemoveMessage { get; }
public abstract int GumpTitle { get; }
public BaseSpecialScrollBook(int id)
: base(id)
{
LootType = LootType.Blessed;
}
public override int GetTotal(TotalType type)
{
return 0;
}
public override void OnDoubleClick(Mobile m)
{
BaseHouse house = BaseHouse.FindHouseAt(this);
if (m is PlayerMobile && m.InRange(GetWorldLocation(), 2) /*&& (house == null || house.HasSecureAccess(m, this))*/)
{
BaseGump.SendGump(new SpecialScrollBookGump((PlayerMobile)m, this));
}
else if (m.AccessLevel > AccessLevel.Player)
{
base.OnDoubleClick(m);
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1151797, String.Format("{0}\t{1}", Items.Count, Capacity)); // Scrolls in book: ~1_val~/~2_val~
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public override bool OnDragDrop(Mobile m, Item dropped)
{
if (m.InRange(GetWorldLocation(), 2))
{
BaseHouse house = BaseHouse.FindHouseAt(this);
if (dropped.GetType() != ScrollType)
{
m.SendLocalizedMessage(BadDropMessage);
}
else if (house == null || !IsLockedDown)
{
m.SendLocalizedMessage(1151765); // You must lock this book down in a house to add scrolls to it.
}
else if (!house.CheckAccessibility(this, m))
{
m.SendLocalizedMessage(1155693); // This item is impermissible and can not be added to the book.
}
else if (Items.Count < Capacity) // TODO: Message for overfilled?
{
DropItem(dropped);
m.SendLocalizedMessage(DropMessage);
dropped.Movable = false;
m.CloseGump(typeof(SpecialScrollBookGump));
return true;
}
}
return false;
}
public virtual void Construct(Mobile m, SkillName sk, double value)
{
var scroll = Items.OfType<SpecialScroll>().FirstOrDefault(s => s.Skill == sk && s.Value == value);
if (scroll != null)
{
if (m.Backpack == null || !m.Backpack.TryDropItem(m, scroll, false))
{
m.SendLocalizedMessage(502868); // Your backpack is too full.
}
else
{
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.LockDowns.ContainsKey(scroll))
{
house.LockDowns.Remove(scroll);
}
if (!scroll.Movable)
{
scroll.Movable = true;
}
if (scroll.IsLockedDown)
{
scroll.IsLockedDown = false;
}
m.SendLocalizedMessage(RemoveMessage);
}
}
}
public BaseSpecialScrollBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(3); // version
writer.Write((int)Level);
writer.Write(_Capacity);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version > 2)
{
Level = (SecureLevel)reader.ReadInt();
_Capacity = reader.ReadInt();
}
Timer.DelayCall(
() =>
{
foreach (var item in Items.Where(i => i.Movable))
item.Movable = false;
});
}
public virtual Dictionary<SkillCat, List<SkillName>> SkillInfo { get { return null; } }
public virtual Dictionary<int, double> ValueInfo { get { return null; } }
public static int GetCategoryLocalization(SkillCat category)
{
switch (category)
{
default:
//case SkillCat.None:
return 0;
case SkillCat.Miscellaneous:
return 1078596;
case SkillCat.Combat:
return 1078592;
case SkillCat.TradeSkills:
return 1078591;
case SkillCat.Magic:
return 1078593;
case SkillCat.Wilderness:
return 1078595;
case SkillCat.Thievery:
return 1078594;
case SkillCat.Bard:
return 1078590;
}
}
}
}

View File

@@ -0,0 +1,71 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using System.Collections.Generic;
namespace Server.Items
{
[Flipable(0x9A95, 0x9AA7)]
public class PowerScrollBook : BaseSpecialScrollBook
{
public override Type ScrollType { get { return typeof(PowerScroll); } }
public override int LabelNumber { get { return 1155684; } } // Power Scroll Book
public override int BadDropMessage { get { return 1155691; } } // This book only holds Power Scrolls.
public override int DropMessage { get { return 1155692; } } // You add the scroll to your Power Scroll book.
public override int RemoveMessage { get { return 1155690; } } // You remove a Power Scroll and put it in your pack.
public override int GumpTitle { get { return 1155689; } } // Power Scrolls
[Constructable]
public PowerScrollBook()
: base(0x9A95)
{
Hue = 1153;
}
public PowerScrollBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override Dictionary<SkillCat, List<SkillName>> SkillInfo { get { return _SkillInfo; } }
public override Dictionary<int, double> ValueInfo { get { return _ValueInfo; } }
public static Dictionary<SkillCat, List<SkillName>> _SkillInfo;
public static Dictionary<int, double> _ValueInfo;
public static void Initialize()
{
_SkillInfo = new Dictionary<SkillCat, List<SkillName>>();
_SkillInfo[SkillCat.Miscellaneous] = new List<SkillName>();
_SkillInfo[SkillCat.Combat] = new List<SkillName>() { SkillName.Anatomy, SkillName.Archery, SkillName.Fencing, SkillName.Focus, SkillName.Healing, SkillName.Macing, SkillName.Parry, SkillName.Swords, SkillName.Tactics, SkillName.Throwing, SkillName.Wrestling };
_SkillInfo[SkillCat.TradeSkills] = new List<SkillName>() { SkillName.Blacksmith, SkillName.Tailoring };
_SkillInfo[SkillCat.Magic] = new List<SkillName>() { SkillName.Bushido, SkillName.Chivalry, SkillName.EvalInt, SkillName.Imbuing, SkillName.Magery, SkillName.Meditation, SkillName.Mysticism, SkillName.Necromancy, SkillName.Ninjitsu, SkillName.MagicResist, SkillName.Spellweaving, SkillName.SpiritSpeak };
_SkillInfo[SkillCat.Wilderness] = new List<SkillName>() { SkillName.AnimalLore, SkillName.AnimalTaming, SkillName.Fishing, SkillName.Veterinary };
_SkillInfo[SkillCat.Thievery] = new List<SkillName>() { SkillName.Stealing, SkillName.Stealth };
_SkillInfo[SkillCat.Bard] = new List<SkillName>() { SkillName.Discordance, SkillName.Musicianship, SkillName.Peacemaking, SkillName.Provocation };
_ValueInfo = new Dictionary<int, double>();
_ValueInfo[1155685] = 105;
_ValueInfo[1155686] = 110;
_ValueInfo[1155687] = 115;
_ValueInfo[1155688] = 120;
}
}
}

View File

@@ -0,0 +1,505 @@
using System;
using System.Collections.Generic;
using Server.Gumps;
using Server.Multis;
using Server.Prompts;
using Server.Mobiles;
using Server.ContextMenus;
using System.Linq;
using Server.Network;
namespace Server.Items
{
public enum RecipeSkillName
{
Alchemy = 0,
Blacksmith = 1,
Carpentry = 2,
Cartography = 3,
Cooking = 4,
Fletching = 5,
Inscription = 6,
Masonry = 7,
Tailoring = 8,
Tinkering = 9,
}
public class RecipeScrollDefinition
{
public int ID { get; set; }
public int RecipeID { get; set; }
public Expansion Expansion { get; set; }
public RecipeSkillName Skill { get; set; }
public int Amount { get; set; }
public int Price { get; set; }
public RecipeScrollDefinition(int id, int rid, Expansion exp, RecipeSkillName skill)
: this(id, rid, exp, skill, 0, 0)
{
}
public RecipeScrollDefinition(int id, int rid, Expansion exp, RecipeSkillName skill, int amount, int price)
{
ID = id;
RecipeID = rid;
Expansion = exp;
Skill = skill;
Amount = amount;
Price = price;
}
}
public class RecipeBook : Item, ISecurable
{
public override int LabelNumber { get { return 1125598; } } // recipe book
[CommandProperty(AccessLevel.GameMaster)]
public string BookName { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public bool Using { get; set; }
public List<RecipeScrollDefinition> Recipes;
public RecipeScrollFilter Filter { get; set; }
public static RecipeScrollDefinition[] Definitions = new RecipeScrollDefinition[]
{
new RecipeScrollDefinition(1, 501, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(2, 502, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(3, 503, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(4, 504, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(5, 505, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(6, 599, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(7, 250, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(8, 251, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(9, 252, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(10, 253, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(11, 254, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(12, 350, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(13, 351, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(14, 354, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(15, 150, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(16, 352, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(17, 353, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(18, 151, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(19, 152, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(20, 551, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(21, 550, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(22, 552, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(23, 452, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(24, 450, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(25, 451, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(26, 453, Expansion.ML, RecipeSkillName.Inscription),
new RecipeScrollDefinition(27, 116, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(28, 106, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(29, 108, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(30, 109, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(31, 100, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(32, 102, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(33, 111, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(34, 118, Expansion.ML, RecipeSkillName.Masonry),
new RecipeScrollDefinition(35, 200, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(36, 201, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(37, 202, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(38, 203, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(39, 204, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(40, 205, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(41, 206, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(42, 207, Expansion.ML, RecipeSkillName.Fletching),
new RecipeScrollDefinition(43, 300, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(44, 301, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(45, 302, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(46, 303, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(47, 304, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(48, 305, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(49, 306, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(50, 307, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(51, 308, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(52, 309, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(53, 310, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(54, 311, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(55, 312, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(56, 313, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(57, 314, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(58, 315, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(59, 332, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(60, 333, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(61, 334, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(62, 335, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(63, 316, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(64, 317, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(65, 318, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(66, 319, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(67, 320, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(68, 321, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(69, 322, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(70, 323, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(71, 324, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(72, 325, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(73, 326, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(74, 327, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(75, 328, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(76, 329, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(77, 330, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(78, 331, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(79, 112, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(80, 113, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(81, 114, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(82, 115, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(83, 400, Expansion.ML, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(84, 402, Expansion.ML, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(85, 401, Expansion.ML, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(86, 117, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(87, 107, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(88, 120, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(89, 110, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(90, 101, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(91, 103, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(92, 105, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(93, 119, Expansion.ML, RecipeSkillName.Masonry),
new RecipeScrollDefinition(94, 104, Expansion.ML, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(95, 336, Expansion.ML, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(96, 500, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(97, 604, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(98, 603, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(99, 702, Expansion.ML, RecipeSkillName.Masonry),
new RecipeScrollDefinition(100, 701, Expansion.ML, RecipeSkillName.Masonry),
new RecipeScrollDefinition(101, 560, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(102, 561, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(103, 562, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(104, 563, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(105, 564, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(106, 565, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(107, 566, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(108, 570, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(109, 575, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(110, 573, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(111, 574, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(112, 576, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(113, 577, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(114, 572, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(115, 571, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(116, 581, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(117, 584, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(118, 583, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(119, 582, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(120, 580, Expansion.TOL, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(121, 600, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(122, 601, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(123, 602, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(124, 800, Expansion.ML, RecipeSkillName.Inscription),
new RecipeScrollDefinition(125, 900, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(126, 901, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(127, 902, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(128, 903, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(129, 904, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(130, 905, Expansion.TOL, RecipeSkillName.Alchemy),
new RecipeScrollDefinition(131, 1000, Expansion.TOL, RecipeSkillName.Cartography),
new RecipeScrollDefinition(132, 455, Expansion.TOL, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(133, 461, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(134, 462, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(135, 460, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(136, 459, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(137, 170, Expansion.TOL, RecipeSkillName.Carpentry),
new RecipeScrollDefinition(138, 457, Expansion.TOL, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(139, 458, Expansion.TOL, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(140, 355, Expansion.SA, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(141, 356, Expansion.SA, RecipeSkillName.Blacksmith),
new RecipeScrollDefinition(142, 585, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(143, 456, Expansion.SA, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(144, 464, Expansion.SA, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(145, 465, Expansion.ML, RecipeSkillName.Tinkering),
new RecipeScrollDefinition(146, 605, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(147, 606, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(148, 607, Expansion.ML, RecipeSkillName.Cooking),
new RecipeScrollDefinition(149, 586, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(150, 587, Expansion.ML, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(151, 588, Expansion.SA, RecipeSkillName.Tailoring),
new RecipeScrollDefinition(152, 463, Expansion.SA, RecipeSkillName.Tinkering)
};
[Constructable]
public RecipeBook()
: base(0xA266)
{
Weight = 1.0;
LootType = LootType.Blessed;
LoadDefinitions();
Filter = new RecipeScrollFilter();
Level = SecureLevel.CoOwners;
}
public void LoadDefinitions()
{
Recipes = new List<RecipeScrollDefinition>();
Definitions.ToList().ForEach(x =>
{
Recipes.Add(x);
});
}
public void ReLoadDefinitions()
{
Definitions.Where(n => !Recipes.Any(o => o.RecipeID == n.RecipeID)).ToList().ForEach(x =>
{
Recipes.Add(x);
});
}
public bool CheckAccessible(Mobile from, Item item)
{
if (from.AccessLevel >= AccessLevel.GameMaster)
return true; // Staff can access anything
BaseHouse house = BaseHouse.FindHouseAt(item);
if (house == null)
return false;
switch (Level)
{
case SecureLevel.Owner: return house.IsOwner(from);
case SecureLevel.CoOwners: return house.IsCoOwner(from);
case SecureLevel.Friends: return house.IsFriend(from);
case SecureLevel.Anyone: return true;
case SecureLevel.Guild: return house.IsGuildMember(from);
}
return false;
}
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
{
from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);
}
else
{
if (from.HasGump(typeof(RecipeBookGump)))
return;
if (!Using)
{
Using = true;
from.SendGump(new RecipeBookGump((PlayerMobile)from, this));
}
else
{
from.SendLocalizedMessage(1062456); // The book is currently in use.
}
}
}
public override void OnDoubleClickSecureTrade(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
{
from.SendLocalizedMessage(500446); // That is too far away.
}
else
{
from.SendGump(new RecipeBookGump(from, this));
SecureTradeContainer cont = GetSecureTradeCont();
if (cont != null)
{
SecureTrade trade = cont.Trade;
if (trade != null && trade.From.Mobile == from)
trade.To.Mobile.SendGump(new RecipeBookGump(trade.To.Mobile, this));
else if (trade != null && trade.To.Mobile == from)
trade.From.Mobile.SendGump(new RecipeBookGump(trade.From.Mobile, this));
}
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (!IsChildOf(from.Backpack) && !IsLockedDown)
{
from.SendLocalizedMessage(1158823); // You must have the book in your backpack to add recipes to it.
return false;
}
else if (dropped is RecipeScroll)
{
RecipeScroll recipe = dropped as RecipeScroll;
if (Recipes.Any(x => x.RecipeID == recipe.RecipeID))
{
Recipes.ForEach(x =>
{
if (x.RecipeID == recipe.RecipeID)
x.Amount = x.Amount + 1;
});
InvalidateProperties();
from.SendLocalizedMessage(1158826); // Recipe added to the book.
if (from is PlayerMobile)
from.SendGump(new RecipeBookGump((PlayerMobile)from, this));
dropped.Delete();
return true;
}
else
{
from.SendLocalizedMessage(1158825); // That is not a recipe.
return false;
}
}
else
{
from.SendLocalizedMessage(1158825); // That is not a recipe.
return false;
}
}
public RecipeBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1);
writer.Write((int)Level);
writer.Write(BookName);
Filter.Serialize(writer);
writer.Write(Recipes.Count);
Recipes.ForEach(s =>
{
writer.Write(s.ID);
writer.Write(s.RecipeID);
writer.Write((int)s.Expansion);
writer.Write((int)s.Skill);
writer.Write(s.Amount);
writer.Write(s.Price);
});
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
case 0:
Level = (SecureLevel)reader.ReadInt();
BookName = reader.ReadString();
Filter = new RecipeScrollFilter(reader);
int count = reader.ReadInt();
Recipes = new List<RecipeScrollDefinition>();
for (int i = count; i > 0; i--)
{
int id = reader.ReadInt();
int rid = reader.ReadInt();
Expansion ex = (Expansion)reader.ReadInt();
RecipeSkillName skill = (RecipeSkillName)reader.ReadInt();
int amount = reader.ReadInt();
int price = reader.ReadInt();
Recipes.Add(new RecipeScrollDefinition(id, rid, ex, skill, amount, price));
}
ReLoadDefinitions();
break;
}
if(version == 0)
LootType = LootType.Blessed;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1158849, String.Format("{0}", Recipes.Sum(x => x.Amount))); // Recipes in book: ~1_val~
if (BookName != null && BookName.Length > 0)
list.Add(1062481, BookName);
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
if (from.CheckAlive() && IsChildOf(from.Backpack))
{
list.Add(new NameBookEntry(from, this));
}
SetSecureLevelEntry.AddTo(from, this, list);
}
private class NameBookEntry : ContextMenuEntry
{
private Mobile m_From;
private RecipeBook m_Book;
public NameBookEntry(Mobile from, RecipeBook book)
: base(6216)
{
m_From = from;
m_Book = book;
}
public override void OnClick()
{
if (m_From.CheckAlive() && m_Book.IsChildOf(m_From.Backpack))
{
m_From.Prompt = new NameBookPrompt(m_Book);
m_From.SendLocalizedMessage(1062479); // Type in the new name of the book:
}
}
}
private class NameBookPrompt : Prompt
{
public override int MessageCliloc { get { return 1062479; } }
private RecipeBook m_Book;
public NameBookPrompt(RecipeBook book)
{
m_Book = book;
}
public override void OnResponse(Mobile from, string text)
{
if (text.Length > 40)
text = text.Substring(0, 40);
if (from.CheckAlive() && m_Book.IsChildOf(from.Backpack))
{
m_Book.BookName = Utility.FixHtml(text.Trim());
from.SendLocalizedMessage(1158827); // The recipe book's name has been changed.
}
}
public override void OnCancel(Mobile from)
{
}
}
}
}

View File

@@ -0,0 +1,487 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Server.Engines.Craft;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Prompts;
namespace Server.Items
{
public class RecipeBookGump : Gump
{
private RecipeBook m_Book;
private List<RecipeScrollDefinition> m_List;
private int m_Page;
private const int LabelColor = 0xFFFFFF;
public bool CheckFilter(RecipeScrollDefinition recipe)
{
RecipeScrollFilter f = m_Book.Filter;
if (f.IsDefault)
return true;
if (f.Skill == 1 && recipe.Skill != RecipeSkillName.Blacksmith )
{
return false;
}
else if (f.Skill == 2 && recipe.Skill != RecipeSkillName.Tailoring)
{
return false;
}
else if (f.Skill == 3 && recipe.Skill != RecipeSkillName.Fletching)
{
return false;
}
else if (f.Skill == 4 && recipe.Skill != RecipeSkillName.Carpentry && recipe.Skill != RecipeSkillName.Masonry)
{
return false;
}
else if (f.Skill == 5 && recipe.Skill != RecipeSkillName.Inscription)
{
return false;
}
else if (f.Skill == 6 && recipe.Skill != RecipeSkillName.Cooking)
{
return false;
}
else if (f.Skill == 7 && recipe.Skill != RecipeSkillName.Alchemy)
{
return false;
}
else if (f.Skill == 8 && recipe.Skill != RecipeSkillName.Tinkering)
{
return false;
}
else if (f.Skill == 9 && recipe.Skill != RecipeSkillName.Cartography)
{
return false;
}
if (f.Expansion == 1 && recipe.Expansion != Expansion.ML)
{
return false;
}
else if (f.Expansion == 2 && recipe.Expansion != Expansion.SA)
{
return false;
}
else if (f.Expansion == 3 && recipe.Expansion != Expansion.TOL)
{
return false;
}
if (f.Amount == 1 && recipe.Amount == 0)
{
return false;
}
return true;
}
public int GetIndexForPage(int page)
{
int index = 0;
while (page-- > 0)
index += GetCountForIndex(index);
return index;
}
public int GetCountForIndex(int index)
{
int slots = 0;
int count = 0;
List<RecipeScrollDefinition> list = m_List;
for (int i = index; i >= 0 && i < list.Count; ++i)
{
var recipe = list[i];
if (CheckFilter(recipe))
{
int add;
add = 1;
if ((slots + add) > 10)
break;
slots += add;
}
++count;
}
return count;
}
public RecipeBookGump(Mobile from, RecipeBook book)
: this(from, book, 0, null)
{
}
private class SetPricePrompt : Prompt
{
private RecipeBook m_Book;
private RecipeScrollDefinition m_Recipe;
private int m_Page;
private List<RecipeScrollDefinition> m_List;
public SetPricePrompt(RecipeBook book, RecipeScrollDefinition recipe, int page, List<RecipeScrollDefinition> list)
{
m_Book = book;
m_Recipe = recipe;
m_Page = page;
m_List = list;
}
public override void OnResponse(Mobile from, string text)
{
int price = Utility.ToInt32(text);
if (price < 0 || price > 250000000)
{
from.SendLocalizedMessage(1062390);
m_Book.Using = false;
}
else
{
m_Book.Recipes.Find(x => x.RecipeID == m_Recipe.RecipeID).Price = price;
from.SendLocalizedMessage(1158822); // Recipe price set.
from.SendGump(new RecipeBookGump((PlayerMobile)from, m_Book, m_Page, m_List));
}
}
}
private string GetExpansion(Expansion expansion)
{
switch (expansion)
{
default:
case Expansion.ML:
return "Mondain's";
case Expansion.SA:
return "Stygian";
case Expansion.TOL:
return "ToL";
}
}
private int GetSkillName(RecipeSkillName skill)
{
switch (skill)
{
default:
case RecipeSkillName.Alchemy:
return 1002000;
case RecipeSkillName.Blacksmith:
return 1150187;
case RecipeSkillName.Carpentry:
return 1002054;
case RecipeSkillName.Cartography:
return 1002057;
case RecipeSkillName.Cooking:
return 1002063;
case RecipeSkillName.Fletching:
return 1044068;
case RecipeSkillName.Inscription:
return 1002090;
case RecipeSkillName.Masonry:
return 1072392;
case RecipeSkillName.Tailoring:
return 1150188;
case RecipeSkillName.Tinkering:
return 1002162;
}
}
public RecipeBookGump(Mobile from, RecipeBook book, int page, List<RecipeScrollDefinition> list)
: base(12, 24)
{
from.CloseGump(typeof(RecipeBookGump));
from.CloseGump(typeof(RecipeScrollFilterGump));
m_Book = book;
m_Page = page;
if (list == null)
{
list = new List<RecipeScrollDefinition>();
m_Book.Recipes.ForEach(x =>
{
if (CheckFilter(x))
{
list.Add(x);
}
});
}
m_List = list;
int index = GetIndexForPage(page);
int count = GetCountForIndex(index);
int tableIndex = 0;
PlayerVendor pv = book.RootParent as PlayerVendor;
bool canLocked = book.IsLockedDown;
bool canDrop = book.IsChildOf(from.Backpack);
bool canBuy = (pv != null);
bool canPrice = (canDrop || canBuy || canLocked);
if (canBuy)
{
VendorItem vi = pv.GetVendorItem(book);
canBuy = (vi != null && !vi.IsForSale);
}
int width = 600;
if (!canPrice)
width = 516;
X = (624 - width) / 2;
AddPage(0);
AddBackground(10, 10, width, 439, 5054);
AddImageTiled(18, 20, width - 17, 420, 2624);
if (canPrice)
{
AddImageTiled(573, 64, 24, 352, 200);
AddImageTiled(493, 64, 78, 352, 1416);
}
if (canDrop)
AddImageTiled(24, 64, 32, 352, 1416);
AddImageTiled(58, 64, 36, 352, 200);
AddImageTiled(96, 64, 133, 352, 1416);
AddImageTiled(231, 64, 80, 352, 200);
AddImageTiled(313, 64, 100, 352, 1416);
AddImageTiled(415, 64, 76, 352, 200);
list = list.OrderBy(x => x.ID).ToList();
for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
{
var recipe = list[i];
if (!CheckFilter(recipe))
continue;
AddImageTiled(24, 94 + (tableIndex * 32), canPrice ? 573 : 489, 2, 2624);
++tableIndex;
}
AddAlphaRegion(18, 20, width - 17, 420);
AddImage(0, 0, 10460);
AddImage(width - 15, 5, 10460);
AddImage(0, 429, 10460);
AddImage(width - 15, 429, 10460);
AddHtmlLocalized(266, 32, 200, 32, 1158810, LabelColor, false, false); // Recipe Book
AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor, false, false); // Item
AddHtmlLocalized(246, 64, 200, 32, 1158814, LabelColor, false, false); // Expansion
AddHtmlLocalized(336, 64, 200, 32, 1158816, LabelColor, false, false); // Crafting
AddHtmlLocalized(429, 64, 100, 32, 1062217, LabelColor, false, false); // Amount
AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor, false, false); // Set Filter
AddButton(35, 32, 4005, 4007, 1, GumpButtonType.Reply, 0);
RecipeScrollFilter f = book.Filter;
if (f.IsDefault)
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927, false, false); // Using No Filter
else if (((PlayerMobile)from).UseOwnFilter)
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927, false, false); // Using Your Filter
else
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927, false, false); // Using Book Filter
AddButton(375, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor, false, false); // EXIT
if (canDrop)
AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor, false, false); // Drop
if (canPrice)
{
AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor, false, false); // Price
if (canBuy)
AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor, false, false); // Buy
else
AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor, false, false); // Set
}
tableIndex = 0;
if (page > 0)
{
AddButton(75, 416, 4014, 4016, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor, false, false); // Previous page
}
if (GetIndexForPage(page + 1) < list.Count)
{
AddButton(225, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor, false, false); // Next page
}
for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
{
var recipe = list[i];
if (!CheckFilter(recipe) || !Recipe.Recipes.ContainsKey(recipe.RecipeID))
continue;
int y = 96 + (tableIndex++ * 32);
if (recipe.Amount > 0 && (canDrop || canLocked))
AddButton(35, y + 2, 5602, 5606, 4 + (i * 2), GumpButtonType.Reply, 0);
AddLabel(61, y, 0x480, String.Format("{0}", recipe.ID));
AddHtmlLocalized(103, y, 130, 32, Recipe.Recipes[recipe.RecipeID].TextDefinition.Number, "#103221", 0xFFFFFF, false, false); // ~1_val~
AddLabel(235, y, 0x480, GetExpansion(recipe.Expansion));
AddHtmlLocalized(316, y, 100, 20, GetSkillName(recipe.Skill), "#104409", 0xFFFFFF, false, false); // ~1_val~
AddLabel(421, y, 0x480, recipe.Amount.ToString());
if (canDrop || (canBuy && recipe.Price > 0))
{
AddButton(579, y + 2, 2117, 2118, 5 + (i * 2), GumpButtonType.Reply, 0);
AddLabel(495, y, 1152, recipe.Price.ToString("N0"));
}
}
}
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
int index = info.ButtonID;
switch (index)
{
case 0: { m_Book.Using = false; break; }
case 1:
{
from.SendGump(new RecipeScrollFilterGump(from, m_Book));
break;
}
case 2:
{
if (m_Page > 0)
from.SendGump(new RecipeBookGump(from, m_Book, m_Page - 1, m_List));
return;
}
case 3:
{
if (GetIndexForPage(m_Page + 1) < m_List.Count)
from.SendGump(new RecipeBookGump(from, m_Book, m_Page + 1, m_List));
break;
}
default:
{
bool canDrop = m_Book.IsChildOf(from.Backpack);
bool canPrice = canDrop || (m_Book.RootParent is PlayerVendor);
index -= 4;
int type = index % 2;
index /= 2;
if (index < 0 || index >= m_List.Count)
break;
var recipe = m_List[index];
if (type == 0)
{
if (!m_Book.CheckAccessible(from, m_Book))
{
m_Book.SendLocalizedMessageTo(from, 1061637); // You are not allowed to access this.
m_Book.Using = false;
break;
}
if (m_Book.IsChildOf(from.Backpack) || m_Book.IsLockedDown)
{
if (recipe.Amount == 0)
{
from.SendLocalizedMessage(1158821); // The recipe selected is not available.
m_Book.Using = false;
break;
}
Item item = new RecipeScroll(recipe.RecipeID);
if (from.AddToBackpack(item))
{
m_Book.Recipes.ForEach(x =>
{
if (x.RecipeID == recipe.RecipeID)
x.Amount = x.Amount - 1;
});
m_Book.InvalidateProperties();
from.SendLocalizedMessage(1158820); // The recipe has been placed in your backpack.
from.SendGump(new RecipeBookGump(from, m_Book, m_Page, null));
}
else
{
m_Book.Using = false;
item.Delete();
from.SendLocalizedMessage(1158819); // There is not enough room in your backpack for the recipe.
}
}
else
{
m_Book.Using = false;
}
}
else
{
if (m_Book.IsChildOf(from.Backpack))
{
from.Prompt = new SetPricePrompt(m_Book, recipe, m_Page, m_List);
from.SendLocalizedMessage(1062383); // Type in a price for the deed:
}
else if (m_Book.RootParent is PlayerVendor)
{
if (recipe.Amount > 0)
{
from.SendGump(new RecipeScrollBuyGump(from, m_Book, recipe, recipe.Price));
}
else
{
m_Book.Using = false;
}
}
}
break;
}
}
}
}
}

View File

@@ -0,0 +1,120 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
public class RecipeScrollBuyGump : Gump
{
private Mobile m_From;
private RecipeBook m_Book;
private RecipeScrollDefinition m_Recipe;
private int m_Price;
public RecipeScrollBuyGump(Mobile from, RecipeBook book, RecipeScrollDefinition recipe, int price)
: base(100, 200)
{
m_From = from;
m_Book = book;
m_Recipe = recipe;
m_Price = price;
AddPage(0);
AddBackground(100, 10, 300, 150, 5054);
AddHtmlLocalized(125, 20, 250, 24, 1019070, false, false); // You have agreed to purchase:
AddHtmlLocalized(125, 45, 250, 24, 1074560, false, false); // recipe scroll
AddHtmlLocalized(125, 70, 250, 24, 1019071, false, false); // for the amount of:
AddLabel(125, 95, 0, price.ToString());
AddButton(250, 130, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(282, 130, 100, 24, 1011012, false, false); // CANCEL
AddButton(120, 130, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(152, 130, 100, 24, 1011036, false, false); // OKAY
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 2)
{
PlayerVendor pv = m_Book.RootParent as PlayerVendor;
if (pv != null)
{
int price = 0;
VendorItem vi = pv.GetVendorItem(m_Book);
if (vi != null && !vi.IsForSale)
{
price = m_Recipe.Price;
}
if (price != m_Price)
{
pv.SayTo(m_From, 1150158); // The price of the selected item has been changed from the value you confirmed. You must select and confirm the purchase again at the new price in order to buy it.
m_Book.Using = false;
}
else if (m_Recipe.Amount == 0 || price == 0)
{
pv.SayTo(m_From, 1158821); // The recipe selected is not available.
m_Book.Using = false;
}
else
{
Item item = new RecipeScroll(m_Recipe.RecipeID);
pv.Say(m_From.Name);
Container pack = m_From.Backpack;
if ((pack != null && pack.ConsumeTotal(typeof(Gold), price)) || Banker.Withdraw(m_From, price))
{
m_Book.Recipes.ForEach(x =>
{
if (x.RecipeID == m_Recipe.RecipeID)
x.Amount = x.Amount - 1;
});
m_Book.InvalidateProperties();
pv.HoldGold += price;
if (m_From.AddToBackpack(item))
m_From.SendLocalizedMessage(1158820); // The recipe has been placed in your backpack.
else
pv.SayTo(m_From, 503204); // You do not have room in your backpack for this.
m_From.SendGump(new RecipeBookGump(m_From, m_Book));
}
else
{
pv.SayTo(m_From, 503205); // You cannot afford this item.
item.Delete();
m_Book.Using = false;
}
}
}
else
{
m_Book.Using = false;
if (pv == null)
m_From.SendLocalizedMessage(1158821); // The recipe selected is not available.
else
pv.SayTo(m_From, 1158821); // The recipe selected is not available.
}
}
else
{
m_Book.Using = false;
m_From.SendLocalizedMessage(503207); // Cancelled purchase.
}
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
namespace Server.Items
{
public class RecipeScrollFilter
{
public bool IsDefault
{
get { return (Skill == 0 && Expansion == 0 && Amount == 0); }
}
public void Clear()
{
Skill = 0;
Expansion = 0;
Amount = 0;
}
public int Skill { get; set; }
public int Expansion { get; set; }
public int Amount { get; set; }
public RecipeScrollFilter()
{
}
public RecipeScrollFilter(GenericReader reader)
{
int version = reader.ReadInt();
switch (version)
{
case 1:
Skill = reader.ReadInt();
Expansion = reader.ReadInt();
Amount = reader.ReadInt();
break;
}
}
public void Serialize(GenericWriter writer)
{
if (IsDefault)
{
writer.Write((int)0);
}
else
{
writer.Write(1);
writer.Write((int)Skill);
writer.Write((int)Expansion);
writer.Write((int)Amount);
}
}
}
}

View File

@@ -0,0 +1,196 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
public class RecipeScrollFilterGump : Gump
{
private Mobile m_From;
private RecipeBook m_Book;
private const int LabelColor = 0x7FFF;
private const int TitleLabelColor = 0xFFFFFF;
private void AddFilterList(int x, int y, int[] xOffsets, int yOffset, int[,] filters, int xHeights, int filterValue, int filterIndex)
{
for (int i = 0; i < filters.GetLength(0); ++i)
{
int number = filters[i, 0];
if (number == 0)
continue;
bool isSelected = (filters[i, 1] == filterValue);
AddHtmlLocalized(x + 35 + xOffsets[i % xOffsets.Length], y + ((i / xOffsets.Length) * yOffset), 80, xHeights, number, isSelected ? 16927 : LabelColor, false, false);
AddButton(x + xOffsets[i % xOffsets.Length], y + ((i / xOffsets.Length) * yOffset), 4005, 4007, 4 + filterIndex + (i * 4), GumpButtonType.Reply, 0);
}
}
private static readonly int[,] m_SkillFilters = new int[,]
{
{ 1062229, 0 }, // All
{ 1150187, 1 }, // Blacksmith
{ 1150188, 2 }, // Tailor
{ 1044068, 3 }, // Fletching
{ 1002054, 4 }, // Carpentry
{ 1002090, 5 }, // Inscription
{ 1002063, 6 }, // Cooking
{ 1002000, 7 }, // Alchemy
{ 1002162, 8 }, // Tinkering
{ 1002057, 9 }, // Cartography
};
private static readonly int[,] m_ExpansionFilters = new int[,]
{
{ 1062229, 0 }, // All
{ 1158817, 1 }, // Mondain's Legacy
{ 1095190, 2 }, // Stygian Abyss
{ 1158818, 3 }, // Time of Legends
};
private static readonly int[,] m_AmountFilters = new int[,]
{
{ 1062229, 0 }, // All
{ 1158815, 1 }, // Owned
{ 1074235, 2 }, // Unknown
};
private static readonly int[][,] m_Filters = new int[][,]
{
m_SkillFilters,
m_ExpansionFilters,
m_AmountFilters
};
private static readonly int[] m_XOffsets_Skill = new int[] { 0, 125, 250, 375 };
private static readonly int[] m_XOffsets_Expansion = new int[] { 0, 125, 250, 375 };
private static readonly int[] m_XOffsets_Amount = new int[] { 0, 125, 250 };
public RecipeScrollFilterGump(Mobile from, RecipeBook book)
: base(12, 24)
{
from.CloseGump(typeof(RecipeBookGump));
from.CloseGump(typeof(RecipeScrollFilterGump));
m_From = from;
m_Book = book;
RecipeScrollFilter f = book.Filter;
AddPage(0);
AddBackground(10, 10, 600, 375, 0x13BE);
AddImageTiled(18, 20, 583, 356, 0xA40);
AddAlphaRegion(18, 20, 583, 356);
AddImage(0, 0, 0x28DC);
AddImage(590, 0, 0x28DC);
AddImage(0, 365, 0x28DC);
AddImage(590, 365, 0x28DC);
AddHtmlLocalized(26, 64, 120, 32, 1158816, TitleLabelColor, false, false); // Crafting
AddHtmlLocalized(270, 32, 200, 32, 1062223, TitleLabelColor, false, false); // Filter Preference
AddHtmlLocalized(26, 64, 120, 32, 1158816, TitleLabelColor, false, false); // Crafting
AddFilterList(25, 96, m_XOffsets_Skill, 32, m_SkillFilters, 32, f.Skill, 0);
AddHtmlLocalized(26, 192, 120, 42, 1158814, TitleLabelColor, false, false); // Expansion
AddFilterList(25, 224, m_XOffsets_Expansion, 32, m_ExpansionFilters, 42, f.Expansion, 1);
AddHtmlLocalized(26, 256, 120, 32, 1062217, TitleLabelColor, false, false); // Amount
AddFilterList(25, 288, m_XOffsets_Amount, 32, m_AmountFilters, 32, f.Amount, 2);
AddHtmlLocalized(75, 352, 120, 32, 1062477, (((PlayerMobile)from).UseOwnFilter ? LabelColor : 16927), false, false); // Set Book Filter
AddButton(40, 352, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(235, 352, 120, 32, 1062478, (((PlayerMobile)from).UseOwnFilter ? 16927 : LabelColor), false, false); // Set Your Filter
AddButton(200, 352, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(405, 352, 120, 32, 1062231, TitleLabelColor, false, false); // Clear Filter
AddButton(370, 352, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(540, 352, 50, 32, 1011046, TitleLabelColor, false, false); // APPLY
AddButton(505, 352, 4017, 4018, 0, GumpButtonType.Reply, 0);
}
public override void OnResponse(NetState sender, RelayInfo info)
{
RecipeScrollFilter f = m_Book.Filter;
int index = info.ButtonID;
switch (index)
{
case 0: // APPLY
{
m_From.SendGump(new RecipeBookGump(m_From, m_Book));
break;
}
case 1: // Set Book Filter
{
((PlayerMobile)m_From).UseOwnFilter = false;
m_From.SendGump(new RecipeScrollFilterGump(m_From, m_Book));
break;
}
case 2: // Set Your Filter
{
((PlayerMobile)m_From).UseOwnFilter = true;
m_From.SendGump(new RecipeScrollFilterGump(m_From, m_Book));
break;
}
case 3: // Clear
{
f.Clear();
m_From.SendGump(new RecipeScrollFilterGump(m_From, m_Book));
break;
}
default:
{
index -= 4;
int type = index % 4;
index /= 4;
int[][,] filter = m_Filters;
if (type >= 0 && type < filter.Length)
{
int[,] filters = filter[type];
if (index >= 0 && index < filters.GetLength(0))
{
if (filters[index, 0] == 0)
break;
switch (type)
{
case 0:
f.Skill = filters[index, 1];
break;
case 1:
f.Expansion = filters[index, 1];
break;
case 2:
f.Amount = filters[index, 1];
break;
}
m_From.SendGump(new RecipeScrollFilterGump(m_From, m_Book));
}
}
break;
}
}
}
}
}

View File

@@ -0,0 +1,68 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using System.Collections.Generic;
namespace Server.Items
{
[Flipable(0x9981, 0x9982)]
public class ScrollOfAlacrityBook : BaseSpecialScrollBook
{
public override Type ScrollType { get { return typeof(ScrollOfAlacrity); } }
public override int LabelNumber { get { return 1154321; } } // Scrolls of Alacrity Book
public override int BadDropMessage { get { return 1154323; } } // This book only holds Scrolls of Alacrity.
public override int DropMessage { get { return 1154326; } } // You add the scroll to your Scrolls of Alacrity book.
public override int RemoveMessage { get { return 1154322; } } // You remove a Scroll of Alacrity and put it in your pack.
public override int GumpTitle { get { return 1154324; } } // Alacrity Scrolls
[Constructable]
public ScrollOfAlacrityBook()
: base(0x9981)
{
Hue = 1195;
}
public ScrollOfAlacrityBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override Dictionary<SkillCat, List<SkillName>> SkillInfo { get { return _SkillInfo; } }
public override Dictionary<int, double> ValueInfo { get { return _ValueInfo; } }
public static Dictionary<SkillCat, List<SkillName>> _SkillInfo;
public static Dictionary<int, double> _ValueInfo;
public static void Initialize()
{
_SkillInfo = new Dictionary<SkillCat, List<SkillName>>();
_SkillInfo[SkillCat.Miscellaneous] = new List<SkillName>() { SkillName.ArmsLore, SkillName.Begging, SkillName.Camping, SkillName.Cartography, SkillName.Forensics, SkillName.ItemID, SkillName.TasteID};
_SkillInfo[SkillCat.Combat] = new List<SkillName>() { SkillName.Anatomy, SkillName.Archery, SkillName.Fencing, SkillName.Focus, SkillName.Healing, SkillName.Macing, SkillName.Parry, SkillName.Swords, SkillName.Tactics, SkillName.Throwing, SkillName.Wrestling };
_SkillInfo[SkillCat.TradeSkills] = new List<SkillName>() { SkillName.Alchemy, SkillName.Blacksmith, SkillName.Fletching, SkillName.Carpentry, SkillName.Cooking, SkillName.Inscribe, SkillName.Lumberjacking, SkillName.Mining, SkillName.Tailoring, SkillName.Tinkering };
_SkillInfo[SkillCat.Magic] = new List<SkillName>() { SkillName.Bushido, SkillName.Chivalry, SkillName.EvalInt, SkillName.Imbuing, SkillName.Magery, SkillName.Meditation, SkillName.Mysticism, SkillName.Necromancy, SkillName.Ninjitsu, SkillName.MagicResist, SkillName.Spellweaving, SkillName.SpiritSpeak };
_SkillInfo[SkillCat.Wilderness] = new List<SkillName>() { SkillName.AnimalLore, SkillName.AnimalTaming, SkillName.Fishing, SkillName.Herding, SkillName.Tracking, SkillName.Veterinary };
_SkillInfo[SkillCat.Thievery] = new List<SkillName>() { SkillName.DetectHidden, SkillName.Hiding, SkillName.Lockpicking, SkillName.Poisoning, SkillName.RemoveTrap, SkillName.Snooping, SkillName.Stealing, SkillName.Stealth };
_SkillInfo[SkillCat.Bard] = new List<SkillName>() { SkillName.Discordance, SkillName.Musicianship, SkillName.Peacemaking, SkillName.Provocation };
_ValueInfo = new Dictionary<int, double>();
_ValueInfo[1154324] = 0.0;
}
}
}

View File

@@ -0,0 +1,79 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using System.Collections.Generic;
namespace Server.Items
{
[Flipable(0x577E, 0x577F)]
public class ScrollOfTranscendenceBook : BaseSpecialScrollBook
{
public override Type ScrollType { get { return typeof(ScrollOfTranscendence); } }
public override int LabelNumber { get { return 1151679; } } // Scrolls of Transcendence Book
public override int BadDropMessage { get { return 1151677; } } // This book only holds Scrolls of Transcendence.
public override int DropMessage { get { return 1151674; } } // You add the scroll to your Scrolls of Transcendence book.
public override int RemoveMessage { get { return 1151658; } } // You remove a Scroll of Transcendence and put it in your pack.
public override int GumpTitle { get { return 1151675; } } // Scrolls of Transcendence
[Constructable]
public ScrollOfTranscendenceBook()
: base(0x577E)
{
Hue = 0x490;
}
public ScrollOfTranscendenceBook(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override Dictionary<SkillCat, List<SkillName>> SkillInfo { get { return _SkillInfo; } }
public override Dictionary<int, double> ValueInfo { get { return _ValueInfo; } }
public static Dictionary<SkillCat, List<SkillName>> _SkillInfo;
public static Dictionary<int, double> _ValueInfo;
public static void Initialize()
{
_SkillInfo = new Dictionary<SkillCat, List<SkillName>>();
_SkillInfo[SkillCat.Miscellaneous] = new List<SkillName>() { SkillName.ArmsLore, SkillName.Begging, SkillName.Camping, SkillName.Cartography, SkillName.Forensics, SkillName.ItemID, SkillName.TasteID};
_SkillInfo[SkillCat.Combat] = new List<SkillName>() { SkillName.Anatomy, SkillName.Archery, SkillName.Fencing, SkillName.Focus, SkillName.Healing, SkillName.Macing, SkillName.Parry, SkillName.Swords, SkillName.Tactics, SkillName.Throwing, SkillName.Wrestling };
_SkillInfo[SkillCat.TradeSkills] = new List<SkillName>() { SkillName.Alchemy, SkillName.Blacksmith, SkillName.Fletching, SkillName.Carpentry, SkillName.Cooking, SkillName.Inscribe, SkillName.Lumberjacking, SkillName.Mining, SkillName.Tailoring, SkillName.Tinkering };
_SkillInfo[SkillCat.Magic] = new List<SkillName>() { SkillName.Bushido, SkillName.Chivalry, SkillName.EvalInt, SkillName.Imbuing, SkillName.Magery, SkillName.Meditation, SkillName.Mysticism, SkillName.Necromancy, SkillName.Ninjitsu, SkillName.MagicResist, SkillName.Spellweaving, SkillName.SpiritSpeak };
_SkillInfo[SkillCat.Wilderness] = new List<SkillName>() { SkillName.AnimalLore, SkillName.AnimalTaming, SkillName.Fishing, SkillName.Herding, SkillName.Tracking, SkillName.Veterinary };
_SkillInfo[SkillCat.Thievery] = new List<SkillName>() { SkillName.DetectHidden, SkillName.Hiding, SkillName.Lockpicking, SkillName.Poisoning, SkillName.RemoveTrap, SkillName.Snooping, SkillName.Stealing, SkillName.Stealth };
_SkillInfo[SkillCat.Bard] = new List<SkillName>() { SkillName.Discordance, SkillName.Musicianship, SkillName.Peacemaking, SkillName.Provocation };
_ValueInfo = new Dictionary<int, double>();
_ValueInfo[1151659] = 0.1;
_ValueInfo[1151660] = 0.2;
_ValueInfo[1151661] = 0.3;
_ValueInfo[1151662] = 0.4;
_ValueInfo[1151663] = 0.5;
_ValueInfo[1151664] = 0.6;
_ValueInfo[1151665] = 0.7;
_ValueInfo[1151666] = 0.8;
_ValueInfo[1151667] = 0.9;
_ValueInfo[1151668] = 1.0;
_ValueInfo[1151669] = 3.0;
_ValueInfo[1151670] = 5.0;
}
}
}

View File

@@ -0,0 +1,232 @@
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Items;
using System.Collections.Generic;
using System.Linq;
namespace Server.Gumps
{
public class SpecialScrollBookGump : BaseGump
{
public BaseSpecialScrollBook Book { get; private set; }
public SkillCat Category { get; set; }
public SkillName Skill { get; set; }
public SpecialScrollBookGump(PlayerMobile pm, BaseSpecialScrollBook book)
: base(pm, 150, 200)
{
Book = book;
pm.CloseGump(typeof(SpecialScrollBookGump));
}
public override void AddGumpLayout()
{
AddImage(0, 0, 2200);
for (int i = 0; i < 2; ++i)
{
int xOffset = 25 + (i * 165);
AddImage(xOffset, 45, 57);
xOffset += 20;
for (int j = 0; j < 6; ++j, xOffset += 15)
AddImage(xOffset, 45, 58);
AddImage(xOffset - 5, 45, 59);
}
if (Category != SkillCat.None)
{
if (Skill != SkillName.Alchemy)
{
BuildSkillPage();
AddButton(20, 5, 2205, 2205, 1, GumpButtonType.Reply, 0);
}
else
{
BuildSkillsPage();
AddButton(20, 5, 2205, 2205, 2, GumpButtonType.Reply, 0);
}
}
else
{
BuildCategoriesPage();
}
}
public virtual void BuildCategoriesPage()
{
AddHtmlLocalized(0, 15, 175, 20, CenterLoc, String.Format("#{0}", Book.GumpTitle), 0, false, false);
if (Book == null || Book.Deleted || Book.SkillInfo == null)
return;
int index = 0;
foreach (var kvp in Book.SkillInfo)
{
AddHtmlLocalized(45, 55 + (index * 15), 100, 20, BaseSpecialScrollBook.GetCategoryLocalization(kvp.Key), false, false);
if (HasScroll(kvp.Value))
{
AddButton(30, 59 + (index * 15), 2103, 2104, 10 + (int)kvp.Key, GumpButtonType.Reply, 0);
}
index++;
}
}
public virtual void BuildSkillsPage()
{
AddHtmlLocalized(0, 15, 175, 20, CenterLoc, String.Format("#{0}", BaseSpecialScrollBook.GetCategoryLocalization(Category)), 0, false, false); // Power Scrolls
if (Category == SkillCat.None || Book == null || Book.Deleted || Book.SkillInfo == null)
return;
List<SkillName> list = Book.SkillInfo[Category];
int x = 45;
int y = 55;
int buttonX = 30;
int split = list.Count >= 9 ? list.Count / 2 : -1;
for (int i = 0; i < list.Count; i++)
{
SkillName skill = list[i];
if (split > -1 && i == split)
{
x = 205;
y = 55;
buttonX = 190;
}
AddHtmlLocalized(x, y, 110, 20, SkillInfo.Table[(int)skill].Localization, false, false);
if (HasScroll(skill))
{
AddButton(buttonX, y + 4, 2103, 2104, 100 + i, GumpButtonType.Reply, 0);
}
y += 15;
}
}
public virtual void BuildSkillPage()
{
AddHtmlLocalized(0, 15, 175, 20, CenterLoc, String.Format("#{0}", SkillInfo.Table[(int)Skill].Localization), 0, false, false);
if (Skill == SkillName.Alchemy || Book == null || Book.Deleted || Book.ValueInfo == null)
return;
int x = 40;
int buttonX = 30;
int y = 55;
int index = 0;
int split = Book.ValueInfo.Count >= 9 ? Book.ValueInfo.Count / 2 : -1;
foreach(var kvp in Book.ValueInfo)
{
if (split > -1 && index == split)
{
x = 205;
buttonX = 195;
y = 55;
}
int total = GetTotalScrolls(Skill, kvp.Value);
AddHtmlLocalized(x, y, 100, 20, kvp.Key, false, false);
AddLabel(x + 100, y, 0, total.ToString());
if (total > 0)
{
AddButton(buttonX, y + 4, 2437, 2438, 1000 + (int)(kvp.Value * 10), GumpButtonType.Reply, 0);
}
y += 15;
index++;
}
}
public override void OnResponse(RelayInfo info)
{
if (info.ButtonID == 1)
{
Skill = SkillName.Alchemy;
Refresh();
}
else if (info.ButtonID == 2)
{
Category = SkillCat.None;
Skill = SkillName.Alchemy;
Refresh();
}
else
{
int id = info.ButtonID;
if (id < 100)
{
id -= 10;
if (id >= 0 && id <= 7)
{
Category = (SkillCat)id;
Refresh();
}
}
else if (id < 1000)
{
id -= 100;
if (Category > SkillCat.None)
{
List<SkillName> list = Book.SkillInfo[Category];
if (id >= 0 && id < list.Count)
{
Skill = list[id];
Refresh();
}
}
}
else
{
double value = id - 1000;
value /= 10;
Book.Construct(User, Skill, value);
}
}
}
public bool HasScroll(List<SkillName> skills)
{
return Book.Items.FirstOrDefault(i => i is SpecialScroll && skills.Contains(((SpecialScroll)i).Skill)) != null;
}
public bool HasScroll(SkillName skill)
{
return Book.Items.FirstOrDefault(i => i is SpecialScroll && skill == ((SpecialScroll)i).Skill) != null;
}
public int GetTotalScrolls(SkillName skill, double value)
{
int count = 0;
foreach (var scroll in Book.Items.OfType<SpecialScroll>().Where(s => s.Skill == skill && value == s.Value))
count++;
return count;
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
namespace Server.Items
{
public class TanBook : BaseBook
{
[Constructable]
public TanBook()
: base(0xFF0)
{
}
[Constructable]
public TanBook(int pageCount, bool writable)
: base(0xFF0, pageCount, writable)
{
}
[Constructable]
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(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,141 @@
using System;
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"));
[Constructable]
public TranslatedGargoyleJournal()
: base(false)
{
}
public TranslatedGargoyleJournal(Serial serial)
: base(serial)
{
}
public override BookContent DefaultContent
{
get
{
return Content;
}
}
public override void AddNameProperty(ObjectPropertyList list)
{
list.Add("Translated Gargoyle Journal");
}
public override void OnSingleClick(Mobile from)
{
this.LabelTo(from, "Translated Gargoyle Journal");
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
}
}
}