PageRenderTime 63ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/Scripts/Commands/Docs.cs

https://bitbucket.org/Kel/crepuscule
C# | 2386 lines | 1543 code | 121 blank | 722 comment | 129 complexity | 59a3a7f578505bc85c19cec3d109981f MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. using System;
  2. using System.IO;
  3. using System.Text;
  4. using System.Reflection;
  5. using System.Collections;
  6. using Server;
  7. using Server.Items;
  8. //using Server.Engines.BulkOrders;
  9. namespace Server.Scripts.Commands
  10. {
  11. public class Docs
  12. {
  13. public static void Initialize()
  14. {
  15. Server.Commands.Register( "DocGen", AccessLevel.Administrator, new CommandEventHandler( DocGen_OnCommand ) );
  16. }
  17. [Usage( "DocGen" )]
  18. [Description( "Generates RunUO documentation." )]
  19. private static void DocGen_OnCommand( CommandEventArgs e )
  20. {
  21. World.Broadcast( 0x35, true, "Documentation is being generated, please wait." );
  22. DateTime startTime = DateTime.Now;
  23. Document();
  24. DateTime endTime = DateTime.Now;
  25. World.Broadcast( 0x35, true, "Documentation has been completed. The entire process took {0:F1} seconds.", (endTime - startTime).TotalSeconds );
  26. }
  27. private class MemberComparer : IComparer
  28. {
  29. public int Compare( object x, object y )
  30. {
  31. if ( x == y )
  32. return 0;
  33. ConstructorInfo aCtor = x as ConstructorInfo;
  34. ConstructorInfo bCtor = y as ConstructorInfo;
  35. PropertyInfo aProp = x as PropertyInfo;
  36. PropertyInfo bProp = y as PropertyInfo;
  37. MethodInfo aMethod = x as MethodInfo;
  38. MethodInfo bMethod = y as MethodInfo;
  39. bool aStatic = GetStaticFor( aCtor, aProp, aMethod );
  40. bool bStatic = GetStaticFor( bCtor, bProp, bMethod );
  41. if ( aStatic && !bStatic )
  42. return -1;
  43. else if ( !aStatic && bStatic )
  44. return 1;
  45. int v = 0;
  46. if ( aCtor != null )
  47. {
  48. if ( bCtor == null )
  49. v = -1;
  50. }
  51. else if ( bCtor != null )
  52. {
  53. if ( aCtor == null )
  54. v = 1;
  55. }
  56. else if ( aProp != null )
  57. {
  58. if ( bProp == null )
  59. v = -1;
  60. }
  61. else if ( bProp != null )
  62. {
  63. if ( aProp == null )
  64. v = 1;
  65. }
  66. if ( v == 0 )
  67. {
  68. v = GetNameFrom( aCtor, aProp, aMethod ).CompareTo( GetNameFrom( bCtor, bProp, bMethod ) );
  69. }
  70. if ( v == 0 && aCtor != null && bCtor != null )
  71. {
  72. v = aCtor.GetParameters().Length.CompareTo( bCtor.GetParameters().Length );
  73. }
  74. else if ( v == 0 && aMethod != null && bMethod != null )
  75. {
  76. v = aMethod.GetParameters().Length.CompareTo( bMethod.GetParameters().Length );
  77. }
  78. return v;
  79. }
  80. private bool GetStaticFor( ConstructorInfo ctor, PropertyInfo prop, MethodInfo method )
  81. {
  82. if ( ctor != null )
  83. return ctor.IsStatic;
  84. else if ( method != null )
  85. return method.IsStatic;
  86. if ( prop != null )
  87. {
  88. MethodInfo getMethod = prop.GetGetMethod();
  89. MethodInfo setMethod = prop.GetGetMethod();
  90. return (getMethod != null && getMethod.IsStatic) || (setMethod != null && setMethod.IsStatic);
  91. }
  92. return false;
  93. }
  94. private string GetNameFrom( ConstructorInfo ctor, PropertyInfo prop, MethodInfo method )
  95. {
  96. if ( ctor != null )
  97. return ctor.DeclaringType.Name;
  98. else if ( prop != null )
  99. return prop.Name;
  100. else if ( method != null )
  101. return method.Name;
  102. else
  103. return "";
  104. }
  105. }
  106. private class TypeComparer : IComparer
  107. {
  108. public int Compare( object x, object y )
  109. {
  110. if ( x == null && y == null )
  111. return 0;
  112. else if ( x == null )
  113. return -1;
  114. else if ( y == null )
  115. return 1;
  116. TypeInfo a = x as TypeInfo;
  117. TypeInfo b = y as TypeInfo;
  118. if ( a == null || b == null )
  119. throw new ArgumentException();
  120. return a.m_TypeName.CompareTo( b.m_TypeName );
  121. }
  122. }
  123. private class NamespaceComparer : IComparer
  124. {
  125. public int Compare( object x, object y )
  126. {
  127. DictionaryEntry a = (DictionaryEntry)x;
  128. DictionaryEntry b = (DictionaryEntry)y;
  129. return ((string)a.Key).CompareTo( (string)b.Key );
  130. }
  131. }
  132. private class TypeInfo
  133. {
  134. public Type m_Type, m_BaseType, m_Declaring;
  135. public string m_FileName, m_TypeName;
  136. public ArrayList m_Derived, m_Nested;
  137. public Type[] m_Interfaces;
  138. public StreamWriter m_Writer;
  139. public TypeInfo( Type type )
  140. {
  141. m_Type = type;
  142. m_BaseType = type.BaseType;
  143. m_Declaring = type.DeclaringType;
  144. m_Interfaces = type.GetInterfaces();
  145. m_TypeName = type.Name;
  146. m_FileName = Docs.GetFileName( "docs/types/", m_TypeName, ".html" );
  147. m_Writer = Docs.GetWriter( "docs/types/", m_FileName );
  148. }
  149. }
  150. public static string GetFileName( string root, string name, string ext )
  151. {
  152. int index = 0;
  153. string file = String.Concat( name, ext );
  154. while ( File.Exists( Path.Combine( root, file ) ) )
  155. file = String.Concat( name, ++index, ext );
  156. return file;
  157. }
  158. private static string[,] m_Aliases = new string[,]
  159. {
  160. { "System.Object", "<font color=\"blue\">object</font>" },
  161. { "System.String", "<font color=\"blue\">string</font>" },
  162. { "System.Boolean", "<font color=\"blue\">bool</font>" },
  163. { "System.Byte", "<font color=\"blue\">byte</font>" },
  164. { "System.SByte", "<font color=\"blue\">sbyte</font>" },
  165. { "System.Int16", "<font color=\"blue\">short</font>" },
  166. { "System.UInt16", "<font color=\"blue\">ushort</font>" },
  167. { "System.Int32", "<font color=\"blue\">int</font>" },
  168. { "System.UInt32", "<font color=\"blue\">uint</font>" },
  169. { "System.Int64", "<font color=\"blue\">long</font>" },
  170. { "System.UInt64", "<font color=\"blue\">ulong</font>" },
  171. { "System.Single", "<font color=\"blue\">float</font>" },
  172. { "System.Double", "<font color=\"blue\">double</font>" },
  173. { "System.Decimal", "<font color=\"blue\">decimal</font>" },
  174. { "System.Char", "<font color=\"blue\">char</font>" },
  175. { "System.Void", "<font color=\"blue\">void</font>" }
  176. };
  177. private static string m_RootDirectory = Path.GetDirectoryName( Environment.GetCommandLineArgs()[0] );
  178. private const string RefString = "<font color=\"blue\">ref</font> ";
  179. private static int m_AliasLength = m_Aliases.GetLength( 0 );
  180. public static string GetPair( Type varType, string name, bool ignoreRef )
  181. {
  182. string prepend = "";
  183. StringBuilder append = new StringBuilder();
  184. Type realType = varType;
  185. if ( varType.IsByRef )
  186. {
  187. if ( !ignoreRef )
  188. prepend = RefString;
  189. realType = varType.GetElementType();
  190. }
  191. if ( realType.IsPointer )
  192. {
  193. if ( realType.IsArray )
  194. {
  195. append.Append( '*' );
  196. do
  197. {
  198. append.Append( '[' );
  199. for ( int i = 1; i < realType.GetArrayRank(); ++i )
  200. append.Append( ',' );
  201. append.Append( ']' );
  202. realType = realType.GetElementType();
  203. } while ( realType.IsArray );
  204. append.Append( ' ' );
  205. }
  206. else
  207. {
  208. realType = realType.GetElementType();
  209. append.Append( " *" );
  210. }
  211. }
  212. else if ( realType.IsArray )
  213. {
  214. do
  215. {
  216. append.Append( '[' );
  217. for ( int i = 1; i < realType.GetArrayRank(); ++i )
  218. append.Append( ',' );
  219. append.Append( ']' );
  220. realType = realType.GetElementType();
  221. } while ( realType.IsArray );
  222. append.Append( ' ' );
  223. }
  224. else
  225. {
  226. append.Append( ' ' );
  227. }
  228. string fullName = realType.FullName;
  229. string aliased = null;// = realType.Name;
  230. TypeInfo info = (TypeInfo)m_Types[realType];
  231. if ( info != null )
  232. {
  233. aliased = String.Format( "<a href=\"{0}\">{1}</a>", info.m_FileName, info.m_TypeName );
  234. }
  235. else
  236. {
  237. for ( int i = 0; i < m_AliasLength; ++i )
  238. {
  239. if ( m_Aliases[i, 0] == fullName )
  240. {
  241. aliased = m_Aliases[i, 1];
  242. break;
  243. }
  244. }
  245. if ( aliased == null )
  246. aliased = realType.Name;
  247. }
  248. return String.Concat( prepend, aliased, append, name );
  249. }
  250. private static Hashtable m_Types;
  251. private static Hashtable m_Namespaces;
  252. private static void EnsureDirectory( string path )
  253. {
  254. path = Path.Combine( m_RootDirectory, path );
  255. if ( !Directory.Exists( path ) )
  256. Directory.CreateDirectory( path );
  257. }
  258. private static void DeleteDirectory( string path )
  259. {
  260. path = Path.Combine( m_RootDirectory, path );
  261. if ( Directory.Exists( path ) )
  262. Directory.Delete( path, true );
  263. }
  264. private static void Document()
  265. {
  266. DeleteDirectory( "docs/" );
  267. EnsureDirectory( "docs/" );
  268. EnsureDirectory( "docs/namespaces/" );
  269. EnsureDirectory( "docs/types/" );
  270. EnsureDirectory( "docs/bods/" );
  271. GenerateStyles();
  272. GenerateIndex();
  273. DocumentCommands();
  274. DocumentKeywords();
  275. DocumentBodies();
  276. //DocumentBulkOrders();
  277. m_Types = new Hashtable();
  278. m_Namespaces = new Hashtable();
  279. ArrayList assemblies = new ArrayList();
  280. assemblies.Add( Core.Assembly );
  281. foreach ( Assembly asm in ScriptCompiler.Assemblies )
  282. assemblies.Add( asm );
  283. Assembly[] asms = (Assembly[])assemblies.ToArray( typeof( Assembly ) );
  284. for ( int i = 0; i < asms.Length; ++i )
  285. LoadTypes( asms[i], asms );
  286. DocumentLoadedTypes();
  287. DocumentConstructableObjects();
  288. }
  289. private static void AddIndexLink( StreamWriter html, string filePath, string label, string desc )
  290. {
  291. html.WriteLine( " <h2><a href=\"{0}\" title=\"{1}\">{2}</a></h2>", filePath, desc, label );
  292. }
  293. private static void GenerateStyles()
  294. {
  295. using ( StreamWriter css = GetWriter( "docs/", "styles.css" ) )
  296. {
  297. css.WriteLine( "body { background-color: #FFFFFF; font-family: verdana, arial; font-size: 11px; }" );
  298. css.WriteLine( "a { color: #28435E; }" );
  299. css.WriteLine( "a:hover { color: #4878A9; }" );
  300. css.WriteLine( "td.header { background-color: #9696AA; font-weight: bold; font-size: 12px; }" );
  301. css.WriteLine( "td.lentry { background-color: #D7D7EB; width: 10%; }" );
  302. css.WriteLine( "td.rentry { background-color: #FFFFFF; width: 90%; }" );
  303. css.WriteLine( "td.entry { background-color: #FFFFFF; }" );
  304. css.WriteLine( "td { font-size: 11px; }" );
  305. css.WriteLine( ".tbl-border { background-color: #46465A; }" );
  306. css.WriteLine( "td.ir {{ background-color: #{0:X6}; }}", Iron );
  307. css.WriteLine( "td.du {{ background-color: #{0:X6}; }}", DullCopper );
  308. css.WriteLine( "td.sh {{ background-color: #{0:X6}; }}", ShadowIron );
  309. css.WriteLine( "td.co {{ background-color: #{0:X6}; }}", Copper );
  310. css.WriteLine( "td.br {{ background-color: #{0:X6}; }}", Bronze );
  311. css.WriteLine( "td.go {{ background-color: #{0:X6}; }}", Gold );
  312. css.WriteLine( "td.ag {{ background-color: #{0:X6}; }}", Agapite );
  313. css.WriteLine( "td.ve {{ background-color: #{0:X6}; }}", Verite );
  314. css.WriteLine( "td.va {{ background-color: #{0:X6}; }}", Valorite );
  315. css.WriteLine( "td.cl {{ background-color: #{0:X6}; }}", Cloth );
  316. css.WriteLine( "td.pl {{ background-color: #{0:X6}; }}", Plain );
  317. css.WriteLine( "td.sp {{ background-color: #{0:X6}; }}", Core.AOS ? SpinedAOS : SpinedLBR );
  318. css.WriteLine( "td.ho {{ background-color: #{0:X6}; }}", Core.AOS ? HornedAOS : HornedLBR );
  319. css.WriteLine( "td.ba {{ background-color: #{0:X6}; }}", Core.AOS ? BarbedAOS : BarbedLBR );
  320. }
  321. }
  322. private static void GenerateIndex()
  323. {
  324. using ( StreamWriter html = GetWriter( "docs/", "index.html" ) )
  325. {
  326. html.WriteLine( "<html>" );
  327. html.WriteLine( " <head>" );
  328. html.WriteLine( " <title>RunUO Documentation - Index</title>" );
  329. html.WriteLine( " <link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />" );
  330. html.WriteLine( " </head>" );
  331. html.WriteLine( " <body>" );
  332. AddIndexLink( html, "commands.html", "Commands", "Every available command. This contains command name, usage, aliases, and description." );
  333. 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." );
  334. 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." );
  335. 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." );
  336. AddIndexLink( html, "overview.html", "Class Overview", "Scripting reference. Contains every class type and contained methods in the core and scripts." );
  337. //AddIndexLink( html, "bods/bod_smith_rewards.html", "Bulk Order Rewards: Smithing", "Reference table for large and small smithing bulk order deed rewards." );
  338. //AddIndexLink( html, "bods/bod_tailor_rewards.html", "Bulk Order Rewards: Tailoring", "Reference table for large and small tailoring bulk order deed rewards." );
  339. html.WriteLine( " </body>" );
  340. html.WriteLine( "</html>" );
  341. }
  342. }
  343. private const int Iron = 0xCCCCDD;
  344. private const int DullCopper = 0xAAAAAA;
  345. private const int ShadowIron = 0x777799;
  346. private const int Copper = 0xDDCC99;
  347. private const int Bronze = 0xAA8866;
  348. private const int Gold = 0xDDCC55;
  349. private const int Agapite = 0xDDAAAA;
  350. private const int Verite = 0x99CC77;
  351. private const int Valorite = 0x88AABB;
  352. private const int Cloth = 0xDDDDDD;
  353. private const int Plain = 0xCCAA88;
  354. private const int SpinedAOS = 0x99BBBB;
  355. private const int HornedAOS = 0xCC8888;
  356. private const int BarbedAOS = 0xAABBAA;
  357. private const int SpinedLBR = 0xAA8833;
  358. private const int HornedLBR = 0xBBBBAA;
  359. private const int BarbedLBR = 0xCCAA88;
  360. /*
  361. private static void DocumentBulkOrders()
  362. {
  363. using ( StreamWriter html = GetWriter( "docs/bods/", "bod_smith_rewards.html" ) )
  364. {
  365. html.WriteLine( "<html>" );
  366. html.WriteLine( " <head>" );
  367. html.WriteLine( " <title>RunUO Documentation - Bulk Orders - Smith Rewards</title>" );
  368. html.WriteLine( " <link rel=\"stylesheet\" type=\"text/css\" href=\"../styles.css\" />" );
  369. html.WriteLine( " </head>" );
  370. html.WriteLine( " <body>" );
  371. SmallBOD sbod = new SmallSmithBOD();
  372. sbod.Type = typeof( Katana );
  373. sbod.Material = BulkMaterialType.None;
  374. sbod.AmountMax = 10;
  375. WriteSmithBODHeader( html, "(Small) Weapons" );
  376. sbod.RequireExceptional = false;
  377. DocumentSmithBOD( html, sbod.ComputeRewards(), "10, 15, 20: Normal", sbod.Material );
  378. sbod.RequireExceptional = true;
  379. DocumentSmithBOD( html, sbod.ComputeRewards(), "10, 15, 20: Exceptional", sbod.Material );
  380. WriteSmithBODFooter( html );
  381. html.WriteLine( " <br><br>" );
  382. html.WriteLine( " <br><br>" );
  383. sbod.Type = typeof( PlateArms );
  384. WriteSmithBODHeader( html, "(Small) Armor: Normal" );
  385. sbod.RequireExceptional = false;
  386. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
  387. {
  388. sbod.Material = mat;
  389. sbod.AmountMax = 10;
  390. DocumentSmithBOD( html, sbod.ComputeRewards(), "10, 15, 20", sbod.Material );
  391. }
  392. WriteSmithBODFooter( html );
  393. html.WriteLine( " <br><br>" );
  394. WriteSmithBODHeader( html, "(Small) Armor: Exceptional" );
  395. sbod.RequireExceptional = true;
  396. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
  397. {
  398. sbod.Material = mat;
  399. for ( int amt = 15; amt <= 20; amt += 5 )
  400. {
  401. sbod.AmountMax = amt;
  402. DocumentSmithBOD( html, sbod.ComputeRewards(), amt == 20 ? "20" : "10, 15", sbod.Material );
  403. }
  404. }
  405. WriteSmithBODFooter( html );
  406. html.WriteLine( " <br><br>" );
  407. html.WriteLine( " <br><br>" );
  408. sbod.Delete();
  409. WriteSmithLBOD( html, "Ringmail", LargeBulkEntry.LargeRing );
  410. WriteSmithLBOD( html, "Chainmail", LargeBulkEntry.LargeChain );
  411. WriteSmithLBOD( html, "Platemail", LargeBulkEntry.LargePlate );
  412. html.WriteLine( " </body>" );
  413. html.WriteLine( "</html>" );
  414. }
  415. using ( StreamWriter html = GetWriter( "docs/bods/", "bod_tailor_rewards.html" ) )
  416. {
  417. html.WriteLine( "<html>" );
  418. html.WriteLine( " <head>" );
  419. html.WriteLine( " <title>RunUO Documentation - Bulk Orders - Tailor Rewards</title>" );
  420. html.WriteLine( " <link rel=\"stylesheet\" type=\"text/css\" href=\"../styles.css\" />" );
  421. html.WriteLine( " </head>" );
  422. html.WriteLine( " <body>" );
  423. SmallBOD sbod = new SmallTailorBOD();
  424. WriteTailorBODHeader( html, "Small Bulk Order" );
  425. html.WriteLine( " <tr>" );
  426. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular: 10, 15</b></td>" );
  427. html.WriteLine( " </tr>" );
  428. sbod.AmountMax = 10;
  429. sbod.RequireExceptional = false;
  430. sbod.Type = typeof( SkullCap );
  431. sbod.Material = BulkMaterialType.None;
  432. DocumentTailorBOD( html, sbod.ComputeRewards(), "10, 15", sbod.Material, sbod.Type );
  433. sbod.Type = typeof( LeatherCap );
  434. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
  435. {
  436. if ( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
  437. continue;
  438. sbod.Material = mat;
  439. DocumentTailorBOD( html, sbod.ComputeRewards(), "10, 15", sbod.Material, sbod.Type );
  440. }
  441. html.WriteLine( " <tr>" );
  442. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular: 20</b></td>" );
  443. html.WriteLine( " </tr>" );
  444. sbod.AmountMax = 20;
  445. sbod.RequireExceptional = false;
  446. sbod.Type = typeof( SkullCap );
  447. sbod.Material = BulkMaterialType.None;
  448. DocumentTailorBOD( html, sbod.ComputeRewards(), "20", sbod.Material, sbod.Type );
  449. sbod.Type = typeof( LeatherCap );
  450. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
  451. {
  452. if ( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
  453. continue;
  454. sbod.Material = mat;
  455. DocumentTailorBOD( html, sbod.ComputeRewards(), "20", sbod.Material, sbod.Type );
  456. }
  457. html.WriteLine( " <tr>" );
  458. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional: 10, 15</b></td>" );
  459. html.WriteLine( " </tr>" );
  460. sbod.AmountMax = 10;
  461. sbod.RequireExceptional = true;
  462. sbod.Type = typeof( SkullCap );
  463. sbod.Material = BulkMaterialType.None;
  464. DocumentTailorBOD( html, sbod.ComputeRewards(), "10, 15", sbod.Material, sbod.Type );
  465. sbod.Type = typeof( LeatherCap );
  466. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
  467. {
  468. if ( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
  469. continue;
  470. sbod.Material = mat;
  471. DocumentTailorBOD( html, sbod.ComputeRewards(), "10, 15", sbod.Material, sbod.Type );
  472. }
  473. html.WriteLine( " <tr>" );
  474. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional: 20</b></td>" );
  475. html.WriteLine( " </tr>" );
  476. sbod.AmountMax = 20;
  477. sbod.RequireExceptional = true;
  478. sbod.Type = typeof( SkullCap );
  479. sbod.Material = BulkMaterialType.None;
  480. DocumentTailorBOD( html, sbod.ComputeRewards(), "20", sbod.Material, sbod.Type );
  481. sbod.Type = typeof( LeatherCap );
  482. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Barbed; ++mat )
  483. {
  484. if ( mat >= BulkMaterialType.DullCopper && mat <= BulkMaterialType.Valorite )
  485. continue;
  486. sbod.Material = mat;
  487. DocumentTailorBOD( html, sbod.ComputeRewards(), "20", sbod.Material, sbod.Type );
  488. }
  489. WriteTailorBODFooter( html );
  490. html.WriteLine( " <br><br>" );
  491. html.WriteLine( " <br><br>" );
  492. sbod.Delete();
  493. WriteTailorLBOD( html, "Large Bulk Order: 4-part", LargeBulkEntry.Gypsy, true, true );
  494. WriteTailorLBOD( html, "Large Bulk Order: 5-part", LargeBulkEntry.TownCrier, true, true );
  495. WriteTailorLBOD( html, "Large Bulk Order: 6-part", LargeBulkEntry.MaleLeatherSet, false, true );
  496. html.WriteLine( " </body>" );
  497. html.WriteLine( "</html>" );
  498. }
  499. }
  500. private static void WriteTailorLBOD( StreamWriter html, string name, SmallBulkEntry[] entries, bool expandCloth, bool expandPlain )
  501. {
  502. WriteTailorBODHeader( html, name );
  503. LargeBOD lbod = new LargeTailorBOD();
  504. lbod.Entries = LargeBulkEntry.ConvertEntries( lbod, entries );
  505. Type type = entries[0].Type;
  506. bool showCloth = !( type.IsSubclassOf( typeof( BaseArmor ) ) || type.IsSubclassOf( typeof( BaseShoes ) ) );
  507. html.WriteLine( " <tr>" );
  508. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Regular</b></td>" );
  509. html.WriteLine( " </tr>" );
  510. lbod.RequireExceptional = false;
  511. lbod.AmountMax = 10;
  512. if ( showCloth )
  513. {
  514. lbod.Material = BulkMaterialType.None;
  515. if ( expandCloth )
  516. {
  517. lbod.AmountMax = 10;
  518. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15", lbod.Material, type );
  519. lbod.AmountMax = 20;
  520. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, type );
  521. }
  522. else
  523. {
  524. lbod.AmountMax = 10;
  525. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, type );
  526. }
  527. }
  528. lbod.Material = BulkMaterialType.None;
  529. if ( expandPlain )
  530. {
  531. lbod.AmountMax = 10;
  532. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
  533. lbod.AmountMax = 20;
  534. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, typeof( LeatherCap ) );
  535. }
  536. else
  537. {
  538. lbod.AmountMax = 10;
  539. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
  540. }
  541. for ( BulkMaterialType mat = BulkMaterialType.Spined; mat <= BulkMaterialType.Barbed; ++mat )
  542. {
  543. lbod.Material = mat;
  544. lbod.AmountMax = 10;
  545. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15", lbod.Material, type );
  546. lbod.AmountMax = 20;
  547. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, type );
  548. }
  549. html.WriteLine( " <tr>" );
  550. html.WriteLine( " <td width=\"850\" colspan=\"21\" class=\"entry\"><b>Exceptional</b></td>" );
  551. html.WriteLine( " </tr>" );
  552. lbod.RequireExceptional = true;
  553. lbod.AmountMax = 10;
  554. if ( showCloth )
  555. {
  556. lbod.Material = BulkMaterialType.None;
  557. if ( expandCloth )
  558. {
  559. lbod.AmountMax = 10;
  560. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15", lbod.Material, type );
  561. lbod.AmountMax = 20;
  562. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, type );
  563. }
  564. else
  565. {
  566. lbod.AmountMax = 10;
  567. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, type );
  568. }
  569. }
  570. lbod.Material = BulkMaterialType.None;
  571. if ( expandPlain )
  572. {
  573. lbod.AmountMax = 10;
  574. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
  575. lbod.AmountMax = 20;
  576. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, typeof( LeatherCap ) );
  577. }
  578. else
  579. {
  580. lbod.AmountMax = 10;
  581. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material, typeof( LeatherCap ) );
  582. }
  583. for ( BulkMaterialType mat = BulkMaterialType.Spined; mat <= BulkMaterialType.Barbed; ++mat )
  584. {
  585. lbod.Material = mat;
  586. lbod.AmountMax = 10;
  587. DocumentTailorBOD( html, lbod.ComputeRewards(), "10, 15", lbod.Material, type );
  588. lbod.AmountMax = 20;
  589. DocumentTailorBOD( html, lbod.ComputeRewards(), "20", lbod.Material, type );
  590. }
  591. WriteTailorBODFooter( html );
  592. html.WriteLine( " <br><br>" );
  593. html.WriteLine( " <br><br>" );
  594. }
  595. private static void WriteTailorBODHeader( StreamWriter html, string title )
  596. {
  597. html.WriteLine( " <table width=\"850\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" );
  598. html.WriteLine( " <tr><td class=\"tbl-border\">" );
  599. html.WriteLine( " <table border=\"0\" width=\"850\" cellpadding=\"0\" cellspacing=\"1\">" );
  600. html.WriteLine( " <tr>" );
  601. html.WriteLine( " <td width=\"250\" rowspan=\"2\" class=\"entry\"><center>{0}</center></td>", title );
  602. 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>" );
  603. 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>" );
  604. 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>" );
  605. 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>" );
  606. 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>" );
  607. 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>" );
  608. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
  609. 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>" );
  610. 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>" );
  611. 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>" );
  612. 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>" );
  613. 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>" );
  614. 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>" );
  615. 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>" );
  616. html.WriteLine( " <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Runic Kits</center></td>" );
  617. html.WriteLine( " </tr>" );
  618. html.WriteLine( " <tr>" );
  619. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
  620. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  621. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  622. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
  623. 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>" );
  624. 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>" );
  625. 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>" );
  626. html.WriteLine( " </tr>" );
  627. }
  628. private static void WriteTailorBODFooter( StreamWriter html )
  629. {
  630. html.WriteLine( " <tr>" );
  631. html.WriteLine( " <td width=\"250\" rowspan=\"2\" class=\"entry\">&nbsp;</td>" );
  632. 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>" );
  633. 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>" );
  634. 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>" );
  635. 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>" );
  636. 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>" );
  637. 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>" );
  638. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
  639. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  640. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  641. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
  642. 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>" );
  643. 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>" );
  644. 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>" );
  645. 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>" );
  646. 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>" );
  647. 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>" );
  648. 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>" );
  649. 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>" );
  650. 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>" );
  651. 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>" );
  652. html.WriteLine( " </tr>" );
  653. html.WriteLine( " <tr>" );
  654. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
  655. html.WriteLine( " <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Runic Kits</center></td>" );
  656. html.WriteLine( " </tr>" );
  657. html.WriteLine( " </table></td></tr></table>" );
  658. }
  659. private static void DocumentTailorBOD( StreamWriter html, ArrayList items, string amt, BulkMaterialType material, Type type )
  660. {
  661. bool[] rewards = new bool[20];
  662. for ( int i = 0; i < items.Count; ++i )
  663. {
  664. Item item = (Item)items[i];
  665. if ( item is Sandals )
  666. rewards[5] = true;
  667. else if ( item is SmallStretchedHideEastDeed || item is SmallStretchedHideSouthDeed )
  668. rewards[10] = true;
  669. else if ( item is MediumStretchedHideEastDeed || item is MediumStretchedHideSouthDeed )
  670. rewards[11] = true;
  671. else if ( item is LightFlowerTapestryEastDeed || item is LightFlowerTapestrySouthDeed )
  672. rewards[12] = true;
  673. else if ( item is DarkFlowerTapestryEastDeed || item is DarkFlowerTapestrySouthDeed )
  674. rewards[13] = true;
  675. else if ( item is BrownBearRugEastDeed || item is BrownBearRugSouthDeed )
  676. rewards[14] = true;
  677. else if ( item is PolarBearRugEastDeed || item is PolarBearRugSouthDeed )
  678. rewards[15] = true;
  679. else if ( item is ClothingBlessDeed )
  680. rewards[16] = true;
  681. else if ( item is PowerScroll )
  682. {
  683. PowerScroll ps = (PowerScroll)item;
  684. if ( ps.Value == 105.0 )
  685. rewards[6] = true;
  686. else if ( ps.Value == 110.0 )
  687. rewards[7] = true;
  688. else if ( ps.Value == 115.0 )
  689. rewards[8] = true;
  690. else if ( ps.Value == 120.0 )
  691. rewards[9] = true;
  692. }
  693. else if ( item is UncutCloth )
  694. {
  695. if ( item.Hue == 0x483 || item.Hue == 0x48C || item.Hue == 0x488 || item.Hue == 0x48A )
  696. rewards[0] = true;
  697. else if ( item.Hue == 0x495 || item.Hue == 0x48B || item.Hue == 0x486 || item.Hue == 0x485 )
  698. rewards[1] = true;
  699. else if ( item.Hue == 0x48D || item.Hue == 0x490 || item.Hue == 0x48E || item.Hue == 0x491 )
  700. rewards[2] = true;
  701. else if ( item.Hue == 0x48F || item.Hue == 0x494 || item.Hue == 0x484 || item.Hue == 0x497 )
  702. rewards[3] = true;
  703. else
  704. rewards[4] = true;
  705. }
  706. else if ( item is RunicSewingKit )
  707. {
  708. RunicSewingKit rkit = (RunicSewingKit)item;
  709. rewards[16 + CraftResources.GetIndex( rkit.Resource )] = true;
  710. }
  711. item.Delete();
  712. }
  713. string style = null;
  714. string name = null;
  715. switch ( material )
  716. {
  717. case BulkMaterialType.None:
  718. {
  719. if ( type.IsSubclassOf( typeof( BaseArmor ) ) || type.IsSubclassOf( typeof( BaseShoes ) ) )
  720. {
  721. style = "pl";
  722. name = "Plain";
  723. }
  724. else
  725. {
  726. style = "cl";
  727. name = "Cloth";
  728. }
  729. break;
  730. }
  731. case BulkMaterialType.Spined: style = "sp"; name = "Spined"; break;
  732. case BulkMaterialType.Horned: style = "ho"; name = "Horned"; break;
  733. case BulkMaterialType.Barbed: style = "ba"; name = "Barbed"; break;
  734. }
  735. html.WriteLine( " <tr>" );
  736. html.WriteLine( " <td width=\"250\" class=\"entry\">&nbsp;- {0} <font size=\"1pt\">{1}</font></td>", name, amt );
  737. int index = 0;
  738. while ( index < 20 )
  739. {
  740. if ( rewards[index] )
  741. {
  742. html.WriteLine( " <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
  743. ++index;
  744. }
  745. else
  746. {
  747. int count = 0;
  748. while ( index < 20 && !rewards[index] )
  749. {
  750. ++count;
  751. ++index;
  752. if ( index == 5 || index == 6 || index == 10 || index == 17 )
  753. break;
  754. }
  755. html.WriteLine( " <td width=\"{0}\"{1} class=\"entry\">&nbsp;</td>", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
  756. }
  757. }
  758. html.WriteLine( " </tr>" );
  759. }
  760. private static void WriteSmithLBOD( StreamWriter html, string name, SmallBulkEntry[] entries )
  761. {
  762. LargeBOD lbod = new LargeSmithBOD();
  763. lbod.Entries = LargeBulkEntry.ConvertEntries( lbod, entries );
  764. WriteSmithBODHeader( html, String.Format( "(Large) {0}: Normal", name ) );
  765. lbod.RequireExceptional = false;
  766. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
  767. {
  768. lbod.Material = mat;
  769. lbod.AmountMax = 10;
  770. DocumentSmithBOD( html, lbod.ComputeRewards(), "10, 15, 20", lbod.Material );
  771. }
  772. WriteSmithBODFooter( html );
  773. html.WriteLine( " <br><br>" );
  774. WriteSmithBODHeader( html, String.Format( "(Large) {0}: Exceptional", name ) );
  775. lbod.RequireExceptional = true;
  776. for ( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
  777. {
  778. lbod.Material = mat;
  779. for ( int amt = 15; amt <= 20; amt += 5 )
  780. {
  781. lbod.AmountMax = amt;
  782. DocumentSmithBOD( html, lbod.ComputeRewards(), amt == 20 ? "20" : "10, 15", lbod.Material );
  783. }
  784. }
  785. WriteSmithBODFooter( html );
  786. html.WriteLine( " <br><br>" );
  787. html.WriteLine( " <br><br>" );
  788. }
  789. private static void WriteSmithBODHeader( StreamWriter html, string title )
  790. {
  791. html.WriteLine( " <table width=\"850\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" );
  792. html.WriteLine( " <tr><td class=\"tbl-border\">" );
  793. html.WriteLine( " <table border=\"0\" width=\"850\" cellpadding=\"0\" cellspacing=\"1\">" );
  794. html.WriteLine( " <tr>" );
  795. html.WriteLine( " <td width=\"250\" rowspan=\"2\" class=\"entry\"><center>{0}</center></td>", title );
  796. 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>" );
  797. html.WriteLine( " <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Gloves</center></td>" );
  798. 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>" );
  799. 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>" );
  800. 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>" );
  801. 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>" );
  802. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
  803. html.WriteLine( " <td width=\"200\" colspan=\"8\" class=\"entry\"><center>Runic Hammers</center></td>" );
  804. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Ancient Hammers</center></td>" );
  805. html.WriteLine( " </tr>" );
  806. html.WriteLine( " <tr>" );
  807. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+1</small></center></td>" );
  808. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+3</small></center></td>" );
  809. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
  810. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
  811. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  812. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  813. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
  814. html.WriteLine( " <td width=\"25\" class=\"du\"><center><small>Du</small></center></td>" );
  815. html.WriteLine( " <td width=\"25\" class=\"sh\"><center><small>Sh</small></center></td>" );
  816. html.WriteLine( " <td width=\"25\" class=\"co\"><center><small>Co</small></center></td>" );
  817. html.WriteLine( " <td width=\"25\" class=\"br\"><center><small>Br</small></center></td>" );
  818. html.WriteLine( " <td width=\"25\" class=\"go\"><center><small>Go</small></center></td>" );
  819. html.WriteLine( " <td width=\"25\" class=\"ag\"><center><small>Ag</small></center></td>" );
  820. html.WriteLine( " <td width=\"25\" class=\"ve\"><center><small>Ve</small></center></td>" );
  821. html.WriteLine( " <td width=\"25\" class=\"va\"><center><small>Va</small></center></td>" );
  822. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  823. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  824. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+30</small></center></td>" );
  825. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+60</small></center></td>" );
  826. html.WriteLine( " </tr>" );
  827. }
  828. private static void WriteSmithBODFooter( StreamWriter html )
  829. {
  830. html.WriteLine( " <tr>" );
  831. html.WriteLine( " <td width=\"250\" rowspan=\"2\" class=\"entry\">&nbsp;</td>" );
  832. 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>" );
  833. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+1</small></center>&nbsp;</td>" );
  834. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+3</small></center>&nbsp;</td>" );
  835. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center>&nbsp;</td>" );
  836. 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>" );
  837. 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>" );
  838. 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>" );
  839. 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>" );
  840. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+5</small></center></td>" );
  841. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  842. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  843. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+20</small></center></td>" );
  844. html.WriteLine( " <td width=\"25\" class=\"du\"><center><small>Du</small></center></td>" );
  845. html.WriteLine( " <td width=\"25\" class=\"sh\"><center><small>Sh</small></center></td>" );
  846. html.WriteLine( " <td width=\"25\" class=\"co\"><center><small>Co</small></center></td>" );
  847. html.WriteLine( " <td width=\"25\" class=\"br\"><center><small>Br</small></center></td>" );
  848. html.WriteLine( " <td width=\"25\" class=\"go\"><center><small>Go</small></center></td>" );
  849. html.WriteLine( " <td width=\"25\" class=\"ag\"><center><small>Ag</small></center></td>" );
  850. html.WriteLine( " <td width=\"25\" class=\"ve\"><center><small>Ve</small></center></td>" );
  851. html.WriteLine( " <td width=\"25\" class=\"va\"><center><small>Va</small></center></td>" );
  852. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+10</small></center></td>" );
  853. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+15</small></center></td>" );
  854. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+30</small></center></td>" );
  855. html.WriteLine( " <td width=\"25\" class=\"entry\"><center><small>+60</small></center></td>" );
  856. html.WriteLine( " </tr>" );
  857. html.WriteLine( " <tr>" );
  858. html.WriteLine( " <td width=\"75\" colspan=\"3\" class=\"entry\"><center>Gloves</center></td>" );
  859. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Power Scrolls</center></td>" );
  860. html.WriteLine( " <td width=\"200\" colspan=\"8\" class=\"entry\"><center>Runic Hammers</center></td>" );
  861. html.WriteLine( " <td width=\"100\" colspan=\"4\" class=\"entry\"><center>Ancient Hammers</center></td>" );
  862. html.WriteLine( " </tr>" );
  863. html.WriteLine( " </table></td></tr></table>" );
  864. }
  865. private static void DocumentSmithBOD( StreamWriter html, ArrayList items, string amt, BulkMaterialType material )
  866. {
  867. bool[] rewards = new bool[24];
  868. for ( int i = 0; i < items.Count; ++i )
  869. {
  870. Item item = (Item)items[i];
  871. if ( item is SturdyPickaxe || item is SturdyShovel )
  872. rewards[0] = true;
  873. else if ( item is LeatherGlovesOfMining )
  874. rewards[1] = true;
  875. else if ( item is StuddedGlovesOfMining )
  876. rewards[2] = true;
  877. else if ( item is RingmailGlovesOfMining )
  878. rewards[3] = true;
  879. else if ( item is GargoylesPickaxe )
  880. rewards[4] = true;
  881. else if ( item is ProspectorsTool )
  882. rewards[5] = true;
  883. else if ( item is PowderOfTemperament )
  884. rewards[6] = true;
  885. else if ( item is ColoredAnvil )
  886. rewards[7] = true;
  887. else if ( item is PowerScroll )
  888. {
  889. PowerScroll ps = (PowerScroll)item;
  890. if ( ps.Value == 105.0 )
  891. rewards[8] = true;
  892. else if ( ps.Value == 110.0 )
  893. rewards[9] = true;
  894. else if ( ps.Value == 115.0 )
  895. rewards[10] = true;
  896. else if ( ps.Value == 120.0 )
  897. rewards[11] = true;
  898. }
  899. else if ( item is RunicHammer )
  900. {
  901. RunicHammer rh = (RunicHammer)item;
  902. rewards[11 + CraftResources.GetIndex( rh.Resource )] = true;
  903. }
  904. else if ( item is AncientSmithyHammer )
  905. {
  906. AncientSmithyHammer ash = (AncientSmithyHammer)item;
  907. if ( ash.Bonus == 10 )
  908. rewards[20] = true;
  909. else if ( ash.Bonus == 15 )
  910. rewards[21] = true;
  911. else if ( ash.Bonus == 30 )
  912. rewards[22] = true;
  913. else if ( ash.Bonus == 60 )
  914. rewards[23] = true;
  915. }
  916. item.Delete();
  917. }
  918. string style = null;
  919. string name = null;
  920. switch ( material )
  921. {
  922. case BulkMaterialType.None: style = "ir"; name = "Iron"; break;
  923. case BulkMaterialType.DullCopper: style = "du"; name = "Dull Copper"; break;
  924. case BulkMaterialType.ShadowIron: style = "sh"; name = "Shadow Iron"; break;
  925. case BulkMaterialType.Copper: style = "co"; name = "Copper"; break;
  926. case BulkMaterialType.Bronze: style = "br"; name = "Bronze"; break;
  927. case BulkMaterialType.Gold: style = "go"; name = "Gold"; break;
  928. case BulkMaterialType.Agapite: style = "ag"; name = "Agapite"; break;
  929. case BulkMaterialType.Verite: style = "ve"; name = "Verite"; break;
  930. case BulkMaterialType.Valorite: style = "va"; name = "Valorite"; break;
  931. }
  932. html.WriteLine( " <tr>" );
  933. html.WriteLine( " <td width=\"250\" class=\"entry\">{0} <font size=\"1pt\">{1}</font></td>", name, amt );
  934. int index = 0;
  935. while ( index < 24 )
  936. {
  937. if ( rewards[index] )
  938. {
  939. html.WriteLine( " <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
  940. ++index;
  941. }
  942. else
  943. {
  944. int count = 0;
  945. while ( index < 24 && !rewards[index] )
  946. {
  947. ++count;
  948. ++index;
  949. if ( index == 4 || index == 8 || index == 12 || index == 20 )
  950. break;
  951. }
  952. html.WriteLine( " <td width=\"{0}\"{1} class=\"entry\">&nbsp;</td>", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
  953. }
  954. }
  955. html.WriteLine( " </tr>" );
  956. }
  957. */
  958. public static ArrayList LoadBodies()
  959. {
  960. ArrayList list = new ArrayList();
  961. string path = Core.FindDataFile( "models/models.txt" );
  962. if ( File.Exists( path ) )
  963. {
  964. using ( StreamReader ip = new StreamReader( path ) )
  965. {
  966. string line;
  967. while ( (line = ip.ReadLine()) != null )
  968. {
  969. line = line.Trim();
  970. if ( line.Length == 0 || line.StartsWith( "#" ) )
  971. continue;
  972. string[] split = line.Split( '\t' );
  973. if ( split.Length >= 9 )
  974. {
  975. Body body = Utility.ToInt32( split[0] );
  976. ModelBodyType type = (ModelBodyType)Utility.ToInt32( split[1] );
  977. string name = split[8];
  978. BodyEntry entry = new BodyEntry( body, type, name );
  979. if ( !list.Contains( entry ) )
  980. list.Add( entry );
  981. }
  982. }
  983. }
  984. }
  985. return list;
  986. }
  987. private static void DocumentBodies()
  988. {
  989. ArrayList list = LoadBodies();
  990. using ( StreamWriter html = G

Large files files are truncated, but you can click here to view the full file