Anasayfa
UO Sunucular
Forumlar
Profilim
UO-Developer.COM
Bilinmiyor 26-08-2009
using System;
using System.IO;
using System.Text;
using System.Reflection;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.BulkOrders;
using Server.Commands.Generic;
using System.Collections.Generic;

namespace Server.Commands
{
public class Docs
{
public static void Initialize()
{
CommandSystem.Register( "DocGen", AccessLevel.Administrator, new CommandEventHandler( DocGen_OnCommand ) );
}

[Usage( "DocGen" )]
[Description( "Generates RunUO documentation." )]
private static void DocGen_OnCommand( CommandEventArgs e )
{
World.Broadcast( 0x35, true, "Documentation is being generated, please wait." );
Console.WriteLine( "Documentation is being generated, please wait." );

Network.NetState.FlushAll();
Network.NetState.Pause();

DateTime startTime = DateTime.Now;

bool generated = Document();

DateTime endTime = DateTime.Now;

Network.NetState.Resume();

if( generated )
{
World.Broadcast( 0x35, true, "Documentation has been completed. The entire process took {0:F1} seconds.", (endTime - startTime).TotalSeconds );
Console.WriteLine( "Documentation complete." );
}
else
{
World.Broadcast( 0x35, true, "Docmentation failed: Documentation directories are locked and in use. Please close all open files and directories and try again." );
Console.WriteLine( "Documentation failed." );
}
}

private class MemberComparer : IComparer
{
public int Compare( object x, object y )
{
if( x == y )
return 0;

ConstructorInfo aCtor = x as ConstructorInfo;
ConstructorInfo bCtor = y as ConstructorInfo;

PropertyInfo aProp = x as PropertyInfo;
PropertyInfo bProp = y as PropertyInfo;

MethodInfo aMethod = x as MethodInfo;
MethodInfo bMethod = y as MethodInfo;

bool aStatic = GetStaticFor( aCtor, aProp, aMethod );
bool bStatic = GetStaticFor( bCtor, bProp, bMethod );

if( aStatic && !bStatic )
return -1;
else if( !aStatic && bStatic )
return 1;

int v = 0;

if( aCtor != null )
{
if( bCtor == null )
v = -1;
}
else if( bCtor != null )
{
if( aCtor == null )
v = 1;
}
else if( aProp != null )
{
if( bProp == null )
v = -1;
}
else if( bProp != null )
{
if( aProp == null )
v = 1;
}

if( v == 0 )
{
v = GetNameFrom( aCtor, aProp, aMethod ).CompareTo( GetNameFrom( bCtor, bProp, bMethod ) );
}

if( v == 0 && aCtor != null && bCtor != null )
{
v = aCtor.GetParameters().Length.CompareTo( bCtor.GetParameters().Length );
}
else if( v == 0 && aMethod != null && bMethod != null )
{
v = aMethod.GetParameters().Length.CompareTo( bMethod.GetParameters().Length );
}

return v;
}

private bool GetStaticFor( ConstructorInfo ctor, PropertyInfo prop, MethodInfo method )
{
if( ctor != null )
return ctor.IsStatic;
else if( method != null )
return method.IsStatic;

if( prop != null )
{
MethodInfo getMethod = prop.GetGetMethod();
MethodInfo setMethod = prop.GetGetMethod();

return (getMethod != null && getMethod.IsStatic) || (setMethod != null && setMethod.IsStatic);
}

return false;
}

private string GetNameFrom( ConstructorInfo ctor, PropertyInfo prop, MethodInfo method )
{
if( ctor != null )
return ctor.DeclaringType.Name;
else if( prop != null )
return prop.Name;
else if( method != null )
return method.Name;
else
return "";
}
}

private class TypeComparer : IComparer<TypeInfo>
{
public int Compare( TypeInfo x, TypeInfo y )
{
if( x == null && y == null )
return 0;
else if( x == null )
return -1;
else if( y == null )
return 1;

return x.TypeName.CompareTo( y.TypeName );
}
}

private class TypeInfo
{
public Type m_Type, m_BaseType, m_Declaring;
public List<TypeInfo> m_Derived, m_Nested;
public Type[] m_Interfaces;
private string m_FileName, m_TypeName, m_LinkName;

public TypeInfo( Type type )
{
m_Type = type;

m_BaseType = type.BaseType;
m_Declaring = type.DeclaringType;
m_Interfaces = type.GetInterfaces();

FormatGeneric( m_Type, ref m_TypeName, ref m_FileName, ref m_LinkName );

// Console.WriteLine( ">> inline typeinfo: "+m_TypeName );
// m_TypeName = GetGenericTypeName( m_Type );
// m_FileName = Docs.GetFileName( "docs/types/", GetGenericTypeName( m_Type, "-", "-" ), ".html" );
// m_Writer = Docs.GetWriter( "docs/types/", m_FileName );
}

public string FileName { get { return m_FileName; } }
public string TypeName { get { return m_TypeName; } }

public string LinkName( string dirRoot )
{
return m_LinkName.Replace( "@directory@", dirRoot );
}
}

#region FileSystem
private static readonly char[] ReplaceChars = "<>".ToCharArray();

public static string GetFileName( string root, string name, string ext )
{
if( name.IndexOfAny( ReplaceChars ) >= 0 )
{
StringBuilder sb = new StringBuilder( name );

for( int i = 0; i < ReplaceChars.Length; ++i )
{
sb.Replace( ReplaceChars[i], '-' );
}

name = sb.ToString();
}

int index = 0;
string file = String.Concat( name, ext );

while( File.Exists( Path.Combine( root, file ) ) )
{
file = String.Concat( name, ++index, ext );
}

return file;
}

private static string m_RootDirectory = Path.GetDirectoryName( Environment.GetCommandLineArgs()[0] );

private static void EnsureDirectory( string path )
{
path = Path.Combine( m_RootDirectory, path );

if( !Directory.Exists( path ) )
Directory.CreateDirectory( path );
}

private static void DeleteDirectory( string path )
{
path = Path.Combine( m_RootDirectory, path );

if( Directory.Exists( path ) )
Directory.Delete( path, true );
}

private static StreamWriter GetWriter( string root, string name )
{
return new StreamWriter( Path.Combine( Path.Combine( m_RootDirectory, root ), name ) );
}

private static StreamWriter GetWriter( string path )
{
return new StreamWriter( Path.Combine( m_RootDirectory, path ) );
}
#endregion

#region GetPair

private static string[,] m_Aliases = new string[,]
{
{ "System.Object", "<font color=\"blue\">object</font>" },
{ "System.String", "<font color=\"blue\">string</font>" },
{ "System.Boolean", "<font color=\"blue\">bool</font>" },
{ "System.Byte", "<font color=\"blue\">byte</font>" },
{ "System.SByte", "<font color=\"blue\">sbyte</font>" },
{ "System.Int16", "<font color=\"blue\">short</font>" },
{ "System.UInt16", "<font color=\"blue\">ushort</font>" },
{ "System.Int32", "<font color=\"blue\">int</font>" },
{ "System.UInt32", "<font color=\"blue\">uint</font>" },
{ "System.Int64", "<font color=\"blue\">long</font>" },
{ "System.UInt64", "<font color=\"blue\">ulong</font>" },
{ "System.Single", "<font color=\"blue\">float</font>" },
{ "System.Double", "<font color=\"blue\">double</font>" },
{ "System.Decimal", "<font color=\"blue\">decimal</font>" },
{ "System.Char", "<font color=\"blue\">char</font>" },
{ "System.Void", "<font color=\"blue\">void</font>" },
};

private static int m_AliasLength = m_Aliases.GetLength( 0 );

public static string GetPair( Type varType, string name, bool ignoreRef )
{
string prepend = "";
StringBuilder append = new StringBuilder();

Type realType = varType;

if( varType.IsByRef )
{
if( !ignoreRef )
prepend = RefString;

realType = varType.GetElementType();
}

if( realType.IsPointer )
{
if( realType.IsArray )
{
append.Append( '*' );

do
{
append.Append( '[' );

for( int i = 1; i < realType.GetArrayRank(); ++i )
append.Append( ',' );

append.Append( ']' );

realType = realType.GetElementType();
} while( realType.IsArray );

append.Append( ' ' );
}
else
{
realType = realType.GetElementType();
append.Append( " *" );
}
}
else if( realType.IsArray )
{
do
{
append.Append( '[' );

for( int i = 1; i < realType.GetArrayRank(); ++i )
append.Append( ',' );

append.Append( ']' );

realType = realType.GetElementType();
} while( realType.IsArray );

append.Append( ' ' );
}
else
{
append.Append( ' ' );
}

string fullName = realType.FullName;
string aliased = null;// = realType.Name;

TypeInfo info = null;
m_Types.TryGetValue( realType, out info );

if( info != null )
{
aliased = "<!-- DBG-0 -->"+info.LinkName( null );
//aliased = String.Format( "<a href=\"{0}\">{1}</a>", info.m_FileName, info.m_TypeName );
}
else
{
//FormatGeneric( );
if( realType.IsGenericType )
{
string typeName = "";
string fileName = "";
string linkName = "";

FormatGeneric( realType, ref typeName, ref fileName, ref linkName );
linkName = linkName.Replace( "@directory@", null );
aliased = linkName;
}
else
{
for( int i = 0; i < m_AliasLength; ++i )
{
if( m_Aliases[i, 0] == fullName )
{
aliased = m_Aliases[i, 1];
break;
}
}
}

if( aliased == null )
aliased = realType.Name;
}

string retval = String.Concat( prepend, aliased, append, name );
//Console.WriteLine(">> getpair: "+retval);
return retval;
}

#endregion

private static Dictionary<Type, TypeInfo> m_Types;
private static Dictionary<string, List<TypeInfo>> m_Namespaces;

#region Root documentation

private static bool Document()
{
try { DeleteDirectory( "docs/" ); }
catch { return false; }

EnsureDirectory( "docs/" );
EnsureDirectory( "docs/namespaces/" );
EnsureDirectory( "docs/types/" );
EnsureDirectory( "docs/bods/" );

GenerateStyles();
GenerateIndex();

DocumentCommands();
DocumentKeywords();
DocumentBodies();

DocumentBulkOrders();

m_Types = new Dictionary<Type, TypeInfo>();
m_Namespaces = new Dictionary<string, List<TypeInfo>>();

List<Assembly> assemblies = new List<Assembly>();

assemblies.Add( Core.Assembly );

foreach( Assembly asm in ScriptCompiler.Assemblies )
assemblies.Add( asm );

Assembly[] asms = assemblies.ToArray();

for( int i = 0; i < asms.Length; ++i )
LoadTypes( asms[i], asms );

DocumentLoadedTypes();
DocumentConstructableObjects();

return true;
}

private static void AddIndexLink( StreamWriter html, string filePath, string label, string desc )
{
html.WriteLine( "      <h2><a href=\"{0}\" title=\"{1}\">{2}</a></h2>", filePath, desc, label );
}

private static void GenerateStyles()
{
using( StreamWriter css = GetWriter( "docs/", "styles.css" ) )
{
css.WriteLine( "body { background-color: #FFFFFF; font-family: verdana, arial; font-size: 11px; }" );
css.WriteLine( "a { color: #28435E; }" );
css.WriteLine( "a:hover { color: #4878A9; }" );
css.WriteLine( "td.header { background-color: #9696AA; font-weight: bold; font-size: 12px; }" );
css.WriteLine( "td.lentry { background-color: #D7D7EB; width: 10%; }" );
css.WriteLine( "td.rentry { background-color: #FFFFFF; width: 90%; }" );
css.WriteLine( "td.entry { background-color: #FFFFFF; }" );
css.WriteLine( "td { font-size: 11px; }" );
css.WriteLine( ".tbl-border { background-color: #46465A; }" );

css.WriteLine( "td.ir {{ background-color: #{0:X6}; }}", Iron );
css.WriteLine( "td.du {{ background-color: #{0:X6}; }}", DullCopper );
css.WriteLine( "td.sh {{ background-color: #{0:X6}; }}", ShadowIron );
css.WriteLine( "td.co {{ background-color: #{0:X6}; }}", Copper );
css.WriteLine( "td.br {{ background-color: #{0:X6}; }}", Bronze );
css.WriteLine( "td.go {{ background-color: #{0:X6}; }}", Gold );
css.WriteLine( "td.ag {{ background-color: #{0:X6}; }}", Agapite );
css.WriteLine( "td.ve {{ background-color: #{0:X6}; }}", Verite );
css.WriteLine( "td.va {{ background-color: #{0:X6}; }}", Valorite );

css.WriteLine( "td.cl {{ background-color: #{0:X6}; }}", Cloth );
css.WriteLine( "td.pl {{ background-color: #{0:X6};  }}", Plain );
css.WriteLine( "td.sp {{ background-color: #{0:X6}; }}", Core.AOS ? SpinedAOS : SpinedLBR );
css.WriteLine( "td.ho {{ background-color: #{0:X6}; }}", Core.AOS ? HornedAOS : HornedLBR );
css.WriteLine( "td.ba {{ background-color: #{0:X6}; }}", Core.AOS ? BarbedAOS : BarbedLBR );
}
}

private static void GenerateIndex()
{
using( StreamWriter html = GetWriter( "docs/", "index.html" ) )
{
html.WriteLine( "<html>" );
html.WriteLine( "   <head>" );
html.WriteLine( "      <title>RunUO Documentation - Index</title>" );
html.WriteLine( "      <link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />" );
html.WriteLine( "   </head>" );
html.WriteLine( "   <body>" );

AddIndexLink( html, "commands.html", "Commands", "Every available command. This contains command name, usage, aliases, and description." );
AddIndexLink( html, "objects.html", "Constructable Objects", "Every constructable item or npc. This contains object name and usage. Hover mouse over parameters to see type description." );
AddIndexLink( html, "keywords.html", "Speech Keywords", "Lists speech keyword numbers and associated match patterns. These are used in some scripts for multi-language matching of client speech." );
AddIndexLink( html, "bodies.html", "Body List", "Every usable body number and name. Table is generated from a UO:3D client datafile. If you do not have UO:3D installed, this may be blank." );
AddIndexLink( html, "overview.html", "Class Overview", "Scripting reference. Contains every class type and contained methods in the core and scripts." );
AddIndexLink( html, "bods/bod_smith_rewards.html", "Bulk Order Rewards: Smithing", "Reference table for large and small smithing bulk order deed rewards." );
AddIndexLink( html, "bods/bod_tailor_rewards.html", "Bulk Order Rewards: Tailoring", "Reference table for large and small tailoring bulk order deed rewards." );

html.WriteLine( "   </body>" );
html.WriteLine( "</html>" );
}
}

#endregion

#region BODs

private const int Iron = 0xCCCCDD;
private const int DullCopper = 0xAAAAAA;
private const int ShadowIron = 0x777799;
private const int Copper = 0xDDCC99;
private const int Bronze = 0xAA8866;
private const int Gold = 0xDDCC55;
private const int Agapite = 0xDDAAAA;
private const int Verite = 0x99CC77;
private const int Valorite = 0x88AABB;

private const int Cloth = 0xDDDDDD;
private const int Plain = 0xCCAA88;
private const int SpinedAOS = 0x99BBBB;
private const int HornedAOS = 0xCC8888;
private const int BarbedAOS = 0xAABBAA;
private const int SpinedLBR = 0xAA8833;
private const int HornedLBR = 0xBBBBAA;
private const int BarbedLBR = 0xCCAA88;

private static void DocumentBulkOrders()
{
using( StreamWriter html = GetWriter( "docs/bods/", "bod_smith_rewards.html" ) )
{
html.WriteLine( "<html>" );
html.WriteLine( "   <head>" );
html.WriteLine( "      <title>RunUO Documentation - Bulk Orders - Smith Rewards</title>" );
html.WriteLine( "      <link rel=\"stylesheet\" type=\"text/css\" href=\"../styles.css\" />" );
html.WriteLine( "   </head>" );
html.WriteLine( "   <body>" );

SmallBOD sbod = new SmallSmithBOD();

sbod.Type = typeof( Katana );
sbod.Material = BulkMaterialType.None;
sbod.AmountMax = 10;

WriteSmithBODHeader( html, "(Small) Weapons" );
sbod.RequireExceptional = false;
DocumentSmithBOD( html, sbod.ComputeRewards( true ), "10, 15, 20: Normal", sbod.Material );
sbod.RequireExceptional = true;
DocumentSmithBOD( html, sbod.ComputeRewards( true ), "10, 15, 20: Exceptional", sbod.Material );
WriteSmithBODFooter( html );

html.WriteLine( "      <br><br>" );
html.WriteLine( "      <br><br>" );


sbod.Type = typeof( PlateArms );

WriteSmithBODHeader( html, "(Small) Armor: Normal" );

sbod.RequireExceptional = false;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
{
sbod.Material = mat;
sbod.AmountMax = 10;
DocumentSmithBOD( html, sbod.ComputeRewards( true ), "10, 15, 20", sbod.Material );
}

WriteSmithBODFooter( html );

html.WriteLine( "      <br><br>" );

WriteSmithBODHeader( html, "(Small) Armor: Exceptional" );

sbod.RequireExceptional = true;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
{
sbod.Material = mat;

for( int amt = 15; amt <= 20; amt += 5 )
{
sbod.AmountMax = amt;
DocumentSmithBOD( html, sbod.ComputeRewards( true ), amt == 20 ? "20" : "10, 15", sbod.Material );
}
}

WriteSmithBODFooter( html );

html.WriteLine( "      <br><br>" );
html.WriteLine( "      <br><br>" );

sbod.Delete();

WriteSmithLBOD( html, "Ringmail", LargeBulkEntry.LargeRing );
WriteSmithLBOD( html, "Chainmail", LargeBulkEntry.LargeChain );
WriteSmithLBOD( html, "Platemail", LargeBulkEntry.LargePlate );

html.WriteLine( "   </body>" );
html.WriteLine( "</html>" );
}

using( StreamWriter html = GetWriter( "docs/bods/", "bod_tailor_rewards.html" ) )
{
html.WriteLine( "<html>" );
html.WriteLine( "   <head>" );
html.WriteLine( "      <title>RunUO Documentation - Bulk Orders - Tailor Rewards</title>" );
html.WriteLine( "      <link rel=\"stylesheet\" type=\"text/css\" href=\"../styles.css\" />" );
html.WriteLine( "   </head>" );
html.WriteLine( "   <body>" );

SmallBOD sbod = new SmallTailorBOD();

WriteTailorBODHeader( html, "Small Bulk Order" );

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular: 10, 15</b></td>" );
html.WriteLine( "         </tr>" );

sbod.AmountMax = 10;
sbod.RequireExceptional = false;

sbod.Type = typeof( SkullCap );
sbod.Material = BulkMaterialType.None;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "10, 15", sbod.Material, sbod.Type );

sbod.Type = typeof( LeatherCap );
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
{
if( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
continue;

sbod.Material = mat;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "10, 15", sbod.Material, sbod.Type );
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular: 20</b></td>" );
html.WriteLine( "         </tr>" );

sbod.AmountMax = 20;
sbod.RequireExceptional = false;

sbod.Type = typeof( SkullCap );
sbod.Material = BulkMaterialType.None;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "20", sbod.Material, sbod.Type );

sbod.Type = typeof( LeatherCap );
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
{
if( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
continue;

sbod.Material = mat;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "20", sbod.Material, sbod.Type );
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional: 10, 15</b></td>" );
html.WriteLine( "         </tr>" );

sbod.AmountMax = 10;
sbod.RequireExceptional = true;

sbod.Type = typeof( SkullCap );
sbod.Material = BulkMaterialType.None;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "10, 15", sbod.Material, sbod.Type );

sbod.Type = typeof( LeatherCap );
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
{
if( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
continue;

sbod.Material = mat;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "10, 15", sbod.Material, sbod.Type );
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional: 20</b></td>" );
html.WriteLine( "         </tr>" );

sbod.AmountMax = 20;
sbod.RequireExceptional = true;

sbod.Type = typeof( SkullCap );
sbod.Material = BulkMaterialType.None;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "20", sbod.Material, sbod.Type );

sbod.Type = typeof( LeatherCap );
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
{
if( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
continue;

sbod.Material = mat;
DocumentTailorBOD( html, sbod.ComputeRewards( true ), "20", sbod.Material, sbod.Type );
}

WriteTailorBODFooter( html );

html.WriteLine( "      <br><br>" );
html.WriteLine( "      <br><br>" );

sbod.Delete();

WriteTailorLBOD( html, "Large Bulk Order: 4-part", LargeBulkEntry.Gypsy, true, true );
WriteTailorLBOD( html, "Large Bulk Order: 5-part", LargeBulkEntry.TownCrier, true, true );
WriteTailorLBOD( html, "Large Bulk Order: 6-part", LargeBulkEntry.MaleLeatherSet, false, true );

html.WriteLine( "   </body>" );
html.WriteLine( "</html>" );
}
}

#region Tailor Bods
private static void WriteTailorLBOD( StreamWriter html, string name, SmallBulkEntry[] entries, bool expandCloth, bool expandPlain )
{
WriteTailorBODHeader( html, name );

LargeBOD lbod = new LargeTailorBOD();

lbod.Entries = LargeBulkEntry.ConvertEntries( lbod, entries );

Type type = entries[0].Type;

bool showCloth = !(type.IsSubclassOf( typeof( BaseArmor ) ) || type.IsSubclassOf( typeof( BaseShoes ) ));

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular</b></td>" );
html.WriteLine( "         </tr>" );

lbod.RequireExceptional = false;
lbod.AmountMax = 10;

if( showCloth )
{
lbod.Material = BulkMaterialType.None;

if( expandCloth )
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15", lbod.Material, type );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, type );
}
else
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, type );
}
}

lbod.Material = BulkMaterialType.None;

if( expandPlain )
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, typeof( LeatherCap ) );
}
else
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
}

for( BulkMaterialType mat = BulkMaterialType.Spined; mat <= BulkMaterialType.Barbed; ++mat )
{
lbod.Material = mat;
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15", lbod.Material, type );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, type );
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional</b></td>" );
html.WriteLine( "         </tr>" );

lbod.RequireExceptional = true;
lbod.AmountMax = 10;

if( showCloth )
{
lbod.Material = BulkMaterialType.None;

if( expandCloth )
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15", lbod.Material, type );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, type );
}
else
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, type );
}
}

lbod.Material = BulkMaterialType.None;

if( expandPlain )
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, typeof( LeatherCap ) );
}
else
{
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
}

for( BulkMaterialType mat = BulkMaterialType.Spined; mat <= BulkMaterialType.Barbed; ++mat )
{
lbod.Material = mat;
lbod.AmountMax = 10;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "10, 15", lbod.Material, type );
lbod.AmountMax = 20;
DocumentTailorBOD( html, lbod.ComputeRewards( true ), "20", lbod.Material, type );
}

WriteTailorBODFooter( html );

html.WriteLine( "      <br><br>" );
html.WriteLine( "      <br><br>" );
}

private static void WriteTailorBODHeader( StreamWriter html, string title )
{
html.WriteLine( "      <table width=\"850\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" );
html.WriteLine( "      <tr><td class=\"tbl-border\">" );
html.WriteLine( "      <table border=\"0\" width=\"850\" cellpadding=\"0\" cellspacing=\"1\">" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" rowspan=\"2\" class=\"entry\"><center>{0}</center></td>", title );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_1.jpg\" alt=\"Colored Cloth (Level 1)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_2.jpg\" alt=\"Colored Cloth (Level 2)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_3.jpg\" alt=\"Colored Cloth (Level 3)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_4.jpg\" alt=\"Colored Cloth (Level 4)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_5.jpg\" alt=\"Colored Cloth (Level 5)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_sandals_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_sandals.jpg\" alt=\"Colored Sandals\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_smallhides.jpg\" alt=\"Small Stretched Hide\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_mediumhides.jpg\" alt=\"Medium Stretched Hide\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_lighttapestry.jpg\" alt=\"Light Flower Tapestry\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_darktapestry.jpg\" alt=\"Dark Flower Tapestry\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_brownbearrug.jpg\" alt=\"Brown Bear Rug\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_polarbearrug.jpg\" alt=\"Polar Bear Rug\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_clothingbless.jpg\" alt=\"Clothing Bless Deed\"></center></td>" );
html.WriteLine( "            <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Runic Kits</center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_spined.jpg\" alt=\"Runic Sewing Kit: Spined\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_horned.jpg\" alt=\"Runic Sewing Kit: Horned\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_barbed.jpg\" alt=\"Runic Sewing Kit: Barbed\"></center></td>" );
html.WriteLine( "         </tr>" );
}

private static void WriteTailorBODFooter( StreamWriter html )
{
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" rowspan=\"2\" class=\"entry\">&nbsp;</td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_1.jpg\" alt=\"Colored Cloth (Level 1)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_2.jpg\" alt=\"Colored Cloth (Level 2)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_3.jpg\" alt=\"Colored Cloth (Level 3)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_4.jpg\" alt=\"Colored Cloth (Level 4)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_cloth_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_cloth_5.jpg\" alt=\"Colored Cloth (Level 5)\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><a href=\"http://www.runuo.com/images/bodreward_sandals_full.jpg\"><img src=\"http://www.runuo.com/images/bodreward_sandals.jpg\" alt=\"Colored Sandals\" border=\"0\"></a></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_smallhides.jpg\" alt=\"Small Stretched Hide\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_mediumhides.jpg\" alt=\"Medium Stretched Hide\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_lighttapestry.jpg\" alt=\"Light Flower Tapestry\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_darktapestry.jpg\" alt=\"Dark Flower Tapestry\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_brownbearrug.jpg\" alt=\"Brown Bear Rug\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_polarbearrug.jpg\" alt=\"Polar Bear Rug\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_clothingbless.jpg\" alt=\"Clothing Bless Deed\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_spined.jpg\" alt=\"Runic Sewing Kit: Spined\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_horned.jpg\" alt=\"Runic Sewing Kit: Horned\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_runic_barbed.jpg\" alt=\"Runic Sewing Kit: Barbed\"></center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
html.WriteLine( "            <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Runic Kits</center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "      </table></td></tr></table>" );
}

private static void DocumentTailorBOD( StreamWriter html, List<Item> items, string amt, BulkMaterialType material, Type type )
{
bool[] rewards = new bool[20];

for( int i = 0; i < items.Count; ++i )
{
Item item = (Item)items[i];

if( item is Sandals )
rewards[5] = true;
else if( item is SmallStretchedHideEastDeed || item is SmallStretchedHideSouthDeed )
rewards[10] = rewards[11] = true;
else if( item is MediumStretchedHideEastDeed || item is MediumStretchedHideSouthDeed )
rewards[10] = rewards[11] = true;
else if( item is LightFlowerTapestryEastDeed || item is LightFlowerTapestrySouthDeed )
rewards[12] = rewards[13] = true;
else if( item is DarkFlowerTapestryEastDeed || item is DarkFlowerTapestrySouthDeed )
rewards[12] = rewards[13] = true;
else if( item is BrownBearRugEastDeed || item is BrownBearRugSouthDeed )
rewards[14] = rewards[15] = true;
else if( item is PolarBearRugEastDeed || item is PolarBearRugSouthDeed )
rewards[14] = rewards[15] = true;
else if( item is ClothingBlessDeed )
rewards[16] = true;
else if( item is PowerScroll )
{
PowerScroll ps = (PowerScroll)item;

if( ps.Value == 105.0 )
rewards[6] = true;
else if( ps.Value == 110.0 )
rewards[7] = true;
else if( ps.Value == 115.0 )
rewards[8] = true;
else if( ps.Value == 120.0 )
rewards[9] = true;
}
else if( item is UncutCloth )
{
if( item.Hue == 0x483 || item.Hue == 0x48C || item.Hue == 0x488 || item.Hue == 0x48A )
rewards[0] = true;
else if( item.Hue == 0x495 || item.Hue == 0x48B || item.Hue == 0x486 || item.Hue == 0x485 )
rewards[1] = true;
else if( item.Hue == 0x48D || item.Hue == 0x490 || item.Hue == 0x48E || item.Hue == 0x491 )
rewards[2] = true;
else if( item.Hue == 0x48F || item.Hue == 0x494 || item.Hue == 0x484 || item.Hue == 0x497 )
rewards[3] = true;
else
rewards[4] = true;
}
else if( item is RunicSewingKit )
{
RunicSewingKit rkit = (RunicSewingKit)item;

rewards[16 + CraftResources.GetIndex( rkit.Resource )] = true;
}

item.Delete();
}

string style = null;
string name = null;

switch( material )
{
case BulkMaterialType.None:
{
if( type.IsSubclassOf( typeof( BaseArmor ) ) || type.IsSubclassOf( typeof( BaseShoes ) ) )
{
style = "pl";
name = "Plain";
}
else
{
style = "cl";
name = "Cloth";
}

break;
}
case BulkMaterialType.Spined: style = "sp"; name = "Spined"; break;
case BulkMaterialType.Horned: style = "ho"; name = "Horned"; break;
case BulkMaterialType.Barbed: style = "ba"; name = "Barbed"; break;
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" class=\"entry\">&nbsp;- {0} <font size=\"1pt\">{1}</font></td>", name, amt );

int index = 0;

while( index < 20 )
{
if( rewards[index] )
{
html.WriteLine( "            <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
++index;
}
else
{
int count = 0;

while( index < 20 && !rewards[index] )
{
++count;
++index;

if( index == 5 || index == 6 || index == 10 || index == 17 )
break;
}

html.WriteLine( "            <td width=\"{0}\"{1} class=\"entry\">&nbsp;</td>", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
}
}

html.WriteLine( "         </tr>" );
}

#endregion

#region Smith Bods
private static void WriteSmithLBOD( StreamWriter html, string name, SmallBulkEntry[] entries )
{
LargeBOD lbod = new LargeSmithBOD();

lbod.Entries = LargeBulkEntry.ConvertEntries( lbod, entries );

WriteSmithBODHeader( html, String.Format( "(Large) {0}: Normal", name ) );

lbod.RequireExceptional = false;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
{
lbod.Material = mat;
lbod.AmountMax = 10;
DocumentSmithBOD( html, lbod.ComputeRewards( true ), "10, 15, 20", lbod.Material );
}

WriteSmithBODFooter( html );

html.WriteLine( "      <br><br>" );

WriteSmithBODHeader( html, String.Format( "(Large) {0}: Exceptional", name ) );

lbod.RequireExceptional = true;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
{
lbod.Material = mat;

for( int amt = 15; amt <= 20; amt += 5 )
{
lbod.AmountMax = amt;
DocumentSmithBOD( html, lbod.ComputeRewards( true ), amt == 20 ? "20" : "10, 15", lbod.Material );
}
}

WriteSmithBODFooter( html );

html.WriteLine( "      <br><br>" );
html.WriteLine( "      <br><br>" );
}

private static void WriteSmithBODHeader( StreamWriter html, string title )
{
html.WriteLine( "      <table width=\"850\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" );
html.WriteLine( "      <tr><td class=\"tbl-border\">" );
html.WriteLine( "      <table border=\"0\" width=\"850\" cellpadding=\"0\" cellspacing=\"1\">" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" rowspan=\"2\" class=\"entry\"><center>{0}</center></td>", title );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_sturdytool.jpg\" alt=\"Sturdy Pickaxe/Shovel (150 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Gloves</center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_gargaxe.jpg\" alt=\"Gargoyles Pickaxe (100 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_prospectortool.jpg\" alt=\"Prospectors Tool (50 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_powder.jpg\" alt=\"Powder of Temperament (10 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_anvil.jpg\" alt=\"Colored Anvil\"></center></td>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
html.WriteLine( "            <td width=\"200\" colspan=\"8\" class=\"entry\"><center>Runic Hammers</center></td>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Ancient Hammers</center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+1</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+3</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"du\"><center><small>Du</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"sh\"><center><small>Sh</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"co\"><center><small>Co</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"br\"><center><small>Br</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"go\"><center><small>Go</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"ag\"><center><small>Ag</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"ve\"><center><small>Ve</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"va\"><center><small>Va</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+30</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+60</small></center></td>" );
html.WriteLine( "         </tr>" );
}

private static void WriteSmithBODFooter( StreamWriter html )
{
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" rowspan=\"2\" class=\"entry\">&nbsp;</td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_sturdytool.jpg\" alt=\"Sturdy Pickaxe/Shovel (150 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+1</small></center>&nbsp;</td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+3</small></center>&nbsp;</td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center>&nbsp;</td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_gargaxe.jpg\" alt=\"Gargoyles Pickaxe (100 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_prospectortool.jpg\" alt=\"Prospectors Tool (50 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_powder.jpg\" alt=\"Powder of Temperament (10 uses)\"></center></td>" );
html.WriteLine( "            <td width=\"25\" rowspan=\"2\" class=\"entry\"><center><img src=\"http://www.runuo.com/images/bodreward_anvil.jpg\" alt=\"Colored Anvil\"></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"du\"><center><small>Du</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"sh\"><center><small>Sh</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"co\"><center><small>Co</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"br\"><center><small>Br</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"go\"><center><small>Go</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"ag\"><center><small>Ag</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"ve\"><center><small>Ve</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"va\"><center><small>Va</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+30</small></center></td>" );
html.WriteLine( "            <td width=\"25\" class=\"entry\"><center><small>+60</small></center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Gloves</center></td>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
html.WriteLine( "            <td width=\"200\" colspan=\"8\" class=\"entry\"><center>Runic Hammers</center></td>" );
html.WriteLine( "            <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Ancient Hammers</center></td>" );
html.WriteLine( "         </tr>" );
html.WriteLine( "      </table></td></tr></table>" );
}

private static void DocumentSmithBOD( StreamWriter html, List<Item> items, string amt, BulkMaterialType material )
{
bool[] rewards = new bool[24];

for( int i = 0; i < items.Count; ++i )
{
Item item = (Item)items[i];

if( item is SturdyPickaxe || item is SturdyShovel )
rewards[0] = true;
else if( item is LeatherGlovesOfMining )
rewards[1] = true;
else if( item is StuddedGlovesOfMining )
rewards[2] = true;
else if( item is RingmailGlovesOfMining )
rewards[3] = true;
else if( item is GargoylesPickaxe )
rewards[4] = true;
else if( item is ProspectorsTool )
rewards[5] = true;
else if( item is PowderOfTemperament )
rewards[6] = true;
else if( item is ColoredAnvil )
rewards[7] = true;
else if( item is PowerScroll )
{
PowerScroll ps = (PowerScroll)item;

if( ps.Value == 105.0 )
rewards[8] = true;
else if( ps.Value == 110.0 )
rewards[9] = true;
else if( ps.Value == 115.0 )
rewards[10] = true;
else if( ps.Value == 120.0 )
rewards[11] = true;
}
else if( item is RunicHammer )
{
RunicHammer rh = (RunicHammer)item;

rewards[11 + CraftResources.GetIndex( rh.Resource )] = true;
}
else if( item is AncientSmithyHammer )
{
AncientSmithyHammer ash = (AncientSmithyHammer)item;

if( ash.Bonus == 10 )
rewards[20] = true;
else if( ash.Bonus == 15 )
rewards[21] = true;
else if( ash.Bonus == 30 )
rewards[22] = true;
else if( ash.Bonus == 60 )
rewards[23] = true;
}

item.Delete();
}

string style = null;
string name = null;

switch( material )
{
case BulkMaterialType.None: style = "ir"; name = "Iron"; break;
case BulkMaterialType.DullCopper: style = "du"; name = "Dull Copper"; break;
case BulkMaterialType.ShadowIron: style = "sh"; name = "Shadow Iron"; break;
case BulkMaterialType.Copper: style = "co"; name = "Copper"; break;
case BulkMaterialType.Bronze: style = "br"; name = "Bronze"; break;
case BulkMaterialType.Gold: style = "go"; name = "Gold"; break;
case BulkMaterialType.Agapite: style = "ag"; name = "Agapite"; break;
case BulkMaterialType.Verite: style = "ve"; name = "Verite"; break;
case BulkMaterialType.Valorite: style = "va"; name = "Valorite"; break;
}

html.WriteLine( "         <tr>" );
html.WriteLine( "            <td width=\"250\" class=\"entry\">{0} <font size=\"1pt\">{1}</font></td>", name, amt );

int index = 0;

while( index < 24 )
{
if( rewards[index] )
{
html.WriteLine( "            <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
++index;
}
else
{
int

UO-Dev SPONSOR

Paylaş

XFacebook

Faydalı mı?

Bu içerik size yardımcı oldu mu?

UO-Dev SPONSOR

Henüz yorum yapılmamış. Yorum yazabilmek için giriş yapmanız gerekir.

Üyelerin oylama ortalaması (10 dışında) :

Henüz Oylanmamış

Oylar: 0

Paylaş

XFacebook

Faydalı mı?

Bu içerik size yardımcı oldu mu?