RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Xanthos Auction System

test444

Wanderer
try my ultima.dll i dont use dll from this, because this is version 1 or what, and my is version 2 :).. i have also ML version of RUNUO...

ps, to be able upload the dll, i have had to rename it to *.txt, so rename it back to *.dll ok :D

AlexiaGandolf;783404 said:
I am running RC2 with (ML Software and latest patch) and have installed this system.

When I use the Ultima.dll download from this thread I get this error:

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...ScriptCompiler: CS0009: Metadata file 'e:\Docume
nts and Settings\My Documents\RunUO-2\RunUO-2.0-RC2\Ultima.dll' could not be ope
ned -- 'File is corrupt'
done (0 errors, 0 warnings)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

I have even tried the one from PB and when I used it I got alot of Hue errors.

I have the utilities folder installed as listed.

Can anyone help with this?

Thanks
 

Attachments

  • Ultima.txt
    52 KB · Views: 53

renerene

Wanderer
pleace help

I am running RC2 with (ML Software and latest patch) and have installed the Auctionsystem.


Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 3
.NET Framework: 2.0.50727.1433
Time: 09.12.2008 02:30:31
Mobiles: 65
Items: 1671
Clients:
- Count: 1
+ 127.0.0.1: (account = rene) (mobile = 0x2 'Rene')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Map.OnLeave(Item item)
at Server.Item.MoveToWorld(Point3D location, Map map)
at Server.Item.Internalize()
at Arya.Auction.AuctionItemCheck.Deliver(Mobile to)
at Arya.Auction.AuctionDeliveryGump.OnResponse(NetState sender, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)


----------------------------------------------------------
i have show all folders and cs,but i have no idear where is the fu..... problem
any idear???
is the problem the cliloc.cs file?
not much items make this problem,but is enough when one item is bugi

pleace,this is a great script i will use it one my server
what can i do, i make all,but how?
 

test444

Wanderer
at least describe the situation when the server crashes... what you make that shard crashes... say the actions.

renerene;783967 said:
I am running RC2 with (ML Software and latest patch) and have installed the Auctionsystem.
 

renerene

Wanderer
lovely Auction

first:i dont speak english very well.(come from austria)and sorry i have not RC2,ihave RC1
thanks for help!

i can not say ,i have big trouble with the Auc system
only that fucking crashes*g*

example:

this items make problems:

Doublet
raw ribs
bag
soul gem
a lesser heal pot
batwing
necromancer book
Nox Cristal
diamonds
silver gear


no problems:
gold check
iron ingots
bones
candle
malet and chesel

the server crashes only if I liked to redeem the check.
double klick on the check,no problem but if I liked to confirm,CRASH.

I can redeem gold checks without problems

which I do not understand,why it goes with some items,and with others not?
which we to find out must is,which is differentiated between a good item and a bad item

I have already the files controls,but I cannot find the error
or better said, I white not for which I to look is

so far...
 

test444

Wanderer
i will try redeem these items too.... without describing problem is hard to say whats wrong, and thx to it, everyone knows what he should try.... like me now..... and never say sorry for my english because most ppl dont speak english too
:D btw i first read you are from australia, and say what? he dont speak english in australia? :D

hmm... i have placed the doublet, and the necromancer spellbook in auction with gm, and then i bought it now with tester char, and everything was fine... when happen your crash, if you want redeem item which you bought with buy it now, or if you want redeem item which auction has ended without bids?
 

renerene

Wanderer
Auction

I tested straight something!
I provided a completely new server
because I imagined, which is possibly any inserted programs of me incorrect.
is however not like that.
I installed only the auction on it,again same error
pleace,test444,try that times.

I to the auctioneer 50 crystal nox gave
with immediately purchase option.

take a test account and buy crystals
but as soon as I would like to redeem the check, allso doubleclick goes still, but as soon as I confirm, load the complete server again

at least white I now it really only because of the basescripts to be must.

some more
allso the Configparser starts also without problems also.
stands completely normally success.

I do not have also some Ultima.dll dfiles try one after the other-trying one after the other one am correct without the correct Ultima.dll find it cliloc.cs, all problems with cliloc.cs, depend only on the correct or wrong Ultima.dll.

is at least already times progressed!

I want to really help everyone here the problems have, but in addition I must help myself only times and find the error


ps:to ask as he falls.
with items those, is it does not function no matter, as soon as they are once in auction, is broken it.
allso if I it back to take want to give or to the bag want crash like if he these certain files, make as standard equipment broken, as soon as they are taken up to auction.
 

test444

Wanderer
hmm ok.. i wil try again and again nox crystals and bag........... btw you can try my dll i posted it few posts back
 

renerene

Wanderer
I tried and believe somewhat new, that us that perhaps help.
I used and have by that one believe the iris 2 client this times, I, specification of the error gotten.
possibly that helps.
I think the error lie somewhere in the red marked range:

MainWorkingDir ..//
lugreluapath ..//lugre/lua/
gGraphicProfile shadow med
Setting Graphicprofile: ..//data/profiles/gfx_med.lua
auto-detected uo path: C:\Programme\EA Games\Ultima Online Mondain's Legacy\
Lua version : 5.1
loading plugin ..//plugins/example.lua
loading plugin ..//plugins/hudenemylist.lua
loading plugin ..//plugins/lib.spellbar.lua
loading plugin ..//plugins/loot.lua
loading plugin ..//plugins/moblist.lua
bIsFullScreen=1
1879048224 = 1879048224
2484881599 = 2484881599
LuaBitwiseTest: 0x941c48bf & 0x0000000f = 0x0000000f
LuaBitwiseTest: 0x80002600 & 0x00000200 = 0x00000200
LuaBitwiseTest: 0x70000020 & 0x00000020 = 0x00000020
LuaBitwiseTest: 0x80000001 & 0x00000001 = 0x00000001
LuaBitwiseTest: 0xffffffff & 0x00000001 = 0x00000001
LuaBitwiseTest successfull
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont.mul
) : 1.4 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont1.mu
l) : 1.4 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont2.mu
l) : 1.4 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont3.mu
l) : 2.5 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont4.mu
l) : 3.9 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont5.mu
l) : 2.2 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/unifont6.mu
l) : 3.3 MB
CreateSpeechLoaderFullFile : warning : file not found : C:/Programme/EA
Games/Ultima Online Mondain's Legacy/speech.mul
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/texmaps.mul
) : 23.6 MB
SoundInit(fmod,22050.000000)

cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/anim.idx) :
1.7 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/anim3.idx)
: 1.5 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/animdata.mu
l) : 1.1 MB
gGuiSystem2Ok true
##################################
###### START INGAME #####
##################################
none
gTileFreeWalk:UpdateGroundCache : warning, no maploader(yet)
gMapIndex 0
Loading Map id 0
Loading Map name Felucca
Loading Map terrain C:/Programme/EA Games/Ultima Online Mondain's Legacy/map0.mu
l
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/map0.mul) :
85.8 MB
Loading Static static idx C:/Programme/EA Games/Ultima Online Mondain's Legacy/s
taidx0.mul
Loading Static static C:/Programme/EA Games/Ultima Online Mondain's Legacy/stati
cs0.mul
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/statics0.mu
l) : 21.2 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/staidx0.mul
) : 5.3 MB
cStaticBlockLoader_IndexedFullFile miMapW=896
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/map0.mul a53765fc
bddb8a599977a0b2cfe5fcc2
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/staidx0.mul
790f95e1db05c9c58ae0fc63bd5c8436
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/statics0.mul
950774e59d2c30d108721b5ca9ec59aa
..//data/tmp/compass_4b14fe7ea7ab6404e3980cea9fede0b3_small_s.png exists
Welcome to Iris
WARNING ! playerbody serial changed old,new= 0 2
#### MapChangeRequest=1
gMapIndex 1
Loading Map id 1
Loading Map name Trammel
Loading Map terrain C:/Programme/EA Games/Ultima Online Mondain's Legacy/map1.mu
l
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/map1.mul) :
85.8 MB
Loading Static static idx C:/Programme/EA Games/Ultima Online Mondain's Legacy/s
taidx1.mul
Loading Static static C:/Programme/EA Games/Ultima Online Mondain's Legacy/stati
cs1.mul
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/statics1.mu
l) : 21.2 MB
cFullFileLoader(C:/Programme/EA Games/Ultima Online Mondain's Legacy/staidx1.mul
) : 5.3 MB
cStaticBlockLoader_IndexedFullFile miMapW=896
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/map1.mul a3b51346
9024bb9956fccbfcbdceeee8
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/staidx1.mul
790f95e1db05c9c58ae0fc63bd5c8436
DEBUG C:/Programme/EA Games/Ultima Online Mondain's Legacy/statics1.mul
950774e59d2c30d108721b5ca9ec59aa
..//data/tmp/compass_3eca7fd689719f82a21eb361764679c4_small_s.png exists
walk:teleport/resynced
walk:teleport/resynced
walk:teleport/resynced
Send_DoubleClick 0x40000003
walk:teleport/resynced
ABILITY SE Spell Icons abilityID: 0xfa active: 0x00
ABILITY SE Spell Icons abilityID: 0xf9 active: 0x00
ABILITY SE Spell Icons abilityID: 0xf8 active: 0x00
ABILITY SE Spell Icons abilityID: 0xf6 active: 0x00
ABILITY SE Spell Icons abilityID: 0xf5 active: 0x00
ABILITY SE Spell Icons abilityID: 0x96 active: 0x00
ABILITY SE Spell Icons abilityID: 0x95 active: 0x00
ABILITY SE Spell Icons abilityID: 0x91 active: 0x00
warning : terrain : groundblock loader doesn't support group loading, falling ba
ck to copy, but it's a bit slower (group loading not implemented yet)
Gui_StopMouseMoveWidget table: 0BA20AC0 236 482 165 454
Send_DoubleClick 0x40000032
popupmenu.Choose table: 17198820 1
Gui_StopMouseMoveWidget table: 172741C8 0 0 0 0
ERROR in WriteArtMapToImage, could not create art raw id=4179
drop on paperdoll kLayer_Back
Gui_StopMouseMoveWidget table: 17587C50 0 0 870 433
popupmenu.Choose table: 17B876D8 1
Gui_StopMouseMoveWidget table: 0A94BAC8 0 0 0 0
ERROR in WriteArtMapToImage, could not create art raw id=3982
Gui_StopMouseMoveWidget table: 0BA20AC0 165 454 27 469
Send_DoubleClick 0x4000004a
Gui_StopMouseMoveWidget table: 170667C0 0 0 266 431
Gui_StopMouseMoveWidget table: 170667C0 266 431 265 435
Gui_StopMouseMoveWidget table: 170667C0 265 435 265 435
FATAL ! NetTrafficStep (not connected anymore) -> forced Crash
ERROR : CRASH triggered from script, see console for info (start with commandlin
e option -c)
 

test444

Wanderer
hmm hard to say.. did you tried start he console as was written in message

ERROR : CRASH triggered from script, see console for info (start with commandlin
e option -c)
 

test444

Wanderer
rene may be try RUNUO SVN what you mean? you can just install this auction in new RUNUO SVN folder, and try if it wil be without bugs...
 

test444

Wanderer
renerene;784229 said:
i cant find SVN

first install software called Tortoise, thats SVN manager or something like that, then if i remember good, you will craeter some folder for example c:\runuo, then you open context menu of this folder, you will choose SVN Tortoise, it will need SVN http address of RUNUO you will use the address from this thread

http://www.runuo.com/forums/custom-...ins-legacy-simple-installs-neruns-distro.html

and you can in that moment, install that ML pack from this address too, and there is what to do... you will download the ML pack, then you will compile the sources, according the manual on thread i posted... i hope everything will be ok.
 
I found some "bug" in ultima.dll code, Its something like .Net 2.0 issue. After minor modification I have fully working auction script with latest SVN. Code is not beautiful but working.

Here is modified StringList.cs from Ultima.dll project upgraded to .Net 2.0 (you can search and download):

Code:
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

namespace Ultima
{
    public class StringList
    {
        private Dictionary<int, string> m_Table;
        private StringEntry[] m_Entries;
        private string m_Language;

        public StringEntry[] Entries{ get{ return m_Entries; } }
        public Dictionary<int, string> Table { get { return m_Table; } }
        public string Language{ get{ return m_Language; } }

        private static byte[] m_Buffer = new byte[1024];

        public StringList( string language )
        {
            m_Language = language;
            m_Table = new Dictionary<int, string>();

            string path = Client.GetFilePath( String.Format( "cliloc.{0}", language ) );

            if ( path == null )
            {
                m_Entries = new StringEntry[0];
                return;
            }

            List<StringEntry> list = new List<StringEntry>();

            using ( BinaryReader bin = new BinaryReader( new FileStream( path, FileMode.Open, FileAccess.Read, FileShare.Read ) ) )
            {
                bin.ReadInt32();
                bin.ReadInt16();

                [COLOR=Red]try
                {[/COLOR]
                    while ( [COLOR=Red]bin.BaseStream.Position < bin.BaseStream.Length/*bin.PeekChar() != -1*/[/COLOR] )
                    {
                        int number = bin.ReadInt32();
                        bin.ReadByte();
                        int length = bin.ReadInt16();

                        if ( length > m_Buffer.Length )
                            m_Buffer = new byte[( length + 1023 ) & ~1023];

                        bin.Read( m_Buffer, 0, length );
                        string text = Encoding.UTF8.GetString( m_Buffer, 0, length );

                        list.Add( new StringEntry( number, text ) );
                        m_Table[number] = text;
                    }
                [COLOR=Red]}
                catch
                {
                    //EOF
                }[/COLOR]
            }

            m_Entries = (StringEntry[])list.ToArray();
        }
    }
}
 

Dreadfull

Sorceror
Some errors I am not exactly sure where to start with.

+ Core/Authentication.cs:
CS0266: Line 44: Cannot implicitly convert type 'Server.Accounting.IAccount'
to 'Server.Accounting.Account'. An explicit conversion exists (are you missing
a cast?)
CS0029: Line 152: Cannot implicitly convert type 'Server.Misc.PasswordProtec
tion' to 'bool'

Authentication.cs
Code:
using System;

using Server;
using Server.Accounting;
using Server.Network;
using Server.Misc;

namespace TheBox.BoxServer
{
	/// <summary>
	/// Interface for messages that support advanced authentication
	/// </summary>
	public interface IAuthenticable
	{
		/// <summary>
		/// The minimum AccessLevel required for the message to perform
		/// </summary>
		AccessLevel MinAccessLevel
		{
			get;
		}

		/// <summary>
		/// Specifies if an online mobile is needed for the message to perform
		/// </summary>
		bool RequireOnlineMobile
		{
			get;
		}
	}

	/// <summary>
	/// Provides methods for authentication for Pandora's Box users
	/// </summary>
	public class Authentication
	{
		/// <summary>
		/// Gets an account given the username
		/// </summary>
		/// <param name="username">The username for the account</param>
		/// <returns>The Account object</returns>
		public static Account GetAccount( string username )
		{
			return Server.Accounting.Accounts.GetAccount( username );
		}

		/// <summary>
		/// Verifies if an account has a minimum access level
		/// </summary>
		/// <param name="account">The account to examine</param>
		/// <param name="MinAccessLevel">The required access level</param>
		/// <returns>True if the access level is allowed</returns>
		public static bool VerifyAccountAccessLevel( Account account, AccessLevel MinAccessLevel )
		{
			if ( account.AccessLevel >= MinAccessLevel )
			{
				return true; // Staff account
			}

			// Verify all characters
			for( int i = 0; i < 5; i++ )
			{
				if ( account[ i ] != null && account[ i ].AccessLevel >= MinAccessLevel )
				{
					return true;
				}
			}

			return false;
		}

		/// <summary>
		/// Verifies if an account has a minimum access level
		/// </summary>
		/// <param name="account">The username of the account to examine</param>
		/// <param name="MinAccessLevel">The required access level</param>
		/// <returns>True if the access level is allowed</returns>
		public static bool VerifyAccountAccessLevel( string username, AccessLevel MinAccessLevel )
		{
			return VerifyAccountAccessLevel( GetAccount( username ), MinAccessLevel );
		}

		/// <summary>
		/// Verify if an account has a valid mobile logged in
		/// </summary>
		/// <param name="account">The account to examine</param>
		/// <param name="MinAccessLevel">The required access level</param>
		/// <returns>True if the access level is allowed</returns>
		public static bool VerifyMobileAccessLevel( Account account, AccessLevel MinAccessLevel )
		{
			Mobile m = GetOnlineMobile( account );

			return ( m != null && m.AccessLevel >= MinAccessLevel );
		}

		/// <summary>
		/// Verify if an account has a valid mobile logged in
		/// </summary>
		/// <param name="username">The username of the account to examine</param>
		/// <param name="MinAccessLevel">The required access level</param>
		/// <returns>True if the access level is allowed</returns>
		public static bool VerifyMobileAccessLevel( string username, AccessLevel MinAccessLevel )
		{
			return VerifyMobileAccessLevel( GetAccount( username ), MinAccessLevel );
		}

		/// <summary>
		/// Gets the online mobile for a given account
		/// </summary>
		/// <param name="account">The account that's logged into the server</param>
		/// <returns>A Mobile if the account is logged in, null otherwise</returns>
		public static Mobile GetOnlineMobile( Account account )
		{
			foreach( NetState ns in NetState.Instances )
			{
				if ( ( ns.Account as Account ) == account )
				{
					return ns.Mobile;
				}
			}

			return null;
		}

		/// <summary>
		/// Gets the online mobile for a given account
		/// </summary>
		/// <param name="username">The username corresponding to the given account</param>
		/// <returns>A Mobile if the account is logged in, null otherwise</returns>
		public static Mobile GetOnlineMobile( string username )
		{
			return GetOnlineMobile( GetAccount( username ) );
		}

		/// <summary>
		/// Performs authentication for a BoxMessage
		/// </summary>
		/// <param name="msg">The message to authenticate</param>
		/// <returns>The AuthenticationResult defininf the authentication process</returns>
		public static AuthenticationResult Authenticate( BoxMessage msg )
		{
			Account account = GetAccount( msg.Username );

			if ( account == null )
			{
				// Account doesn't exist
				return AuthenticationResult.WrongCredentials;
			}

			AuthenticationResult auth = AuthenticationResult.WrongCredentials;

			if ( AccountHandler.ProtectPasswords )
			{
				auth = msg.Authenticate( account.CryptPassword, true );
			}
			else
			{
				auth = msg.Authenticate( account.PlainPassword, false );
			}

			if ( auth == AuthenticationResult.Success )
			{
				IAuthenticable iAuth = msg as IAuthenticable;

				if ( iAuth != null )
				{
					// This message has further authentication properties
					if ( iAuth.RequireOnlineMobile )
					{
						// Check for online mobile
						if ( Authentication.VerifyMobileAccessLevel( account, iAuth.MinAccessLevel ) )
						{
							return AuthenticationResult.Success;
						}
						else
						{
							return AuthenticationResult.OnlineMobileRequired;
						}
					}
					else
					{
						if ( Authentication.VerifyAccountAccessLevel( account, iAuth.MinAccessLevel ) )
						{
							return AuthenticationResult.Success;
						}
						else
						{
							return AuthenticationResult.AccessLevelError;
						}
					}
				}
				else
				{
					// No need for advanced authentication, check only access level
					if ( Authentication.VerifyAccountAccessLevel( account, BoxConfig.MinAccessLevel ) )
						return AuthenticationResult.Success;
					else
						return AuthenticationResult.AccessLevelError;
				}
			}
			else
			{
				return auth;
			}
		}
	}
}

+ Custom/Xanthos/Auction System/Modified/Banker.cs:
CS0234: Line 66: The type or namespace name 'Savings' does not exist in the
namespace 'Server.Arya' (are you missing an assembly reference?)
CS0234: Line 100: The type or namespace name 'Savings' does not exist in the
namespace 'Server.Arya' (are you missing an assembly reference?)

Banker.cs
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Network;

namespace Server.Mobiles
{
	public class Banker : BaseVendor
	{
		private ArrayList m_SBInfos = new ArrayList();
		protected override ArrayList SBInfos{ get { return m_SBInfos; } }

		public override NpcGuild NpcGuild{ get{ return NpcGuild.MerchantsGuild; } }

		[Constructable]
		public Banker() : base( "the banker" )
		{
		}

		public override void InitSBInfo()
		{
			m_SBInfos.Add( new SBBanker() );
		}

		public static int GetBalance( Mobile from )
		{
			Item[] gold, checks;

			return GetBalance( from, out gold, out checks );
		}

		public static int GetBalance( Mobile from, out Item[] gold, out Item[] checks )
		{
			int balance = 0;

			Container bank = from.BankBox;

			if ( bank != null )
			{
				gold = bank.FindItemsByType( typeof( Gold ) );
				checks = bank.FindItemsByType( typeof( BankCheck ) );

				for ( int i = 0; i < gold.Length; ++i )
					balance += gold[i].Amount;

				for ( int i = 0; i < checks.Length; ++i )
					balance += ((BankCheck)checks[i]).Worth;
			}
			else
			{
				gold = checks = new Item[0];
			}

			return balance;
		}

		public static bool Withdraw( Mobile from, int amount )
		{
			Item[] gold, checks;
			int balance = GetBalance( from, out gold, out checks );

			if ( balance < amount && Arya.Savings.SavingsAccount.BalanceGold( from ) < amount - balance )
				return false;

			for ( int i = 0; amount > 0 && i < gold.Length; ++i )
			{
				if ( gold[i].Amount <= amount )
				{
					amount -= gold[i].Amount;
					gold[i].Delete();
				}
				else
				{
					gold[i].Amount -= amount;
					amount = 0;
				}
			}

			for ( int i = 0; amount > 0 && i < checks.Length; ++i )
			{
				BankCheck check = (BankCheck)checks[i];

				if ( check.Worth <= amount )
				{
					amount -= check.Worth;
					check.Delete();
				}
				else
				{
					check.Worth -= amount;
					amount = 0;
				}
			}

			if ( amount > 0 )
				Arya.Savings.SavingsAccount.WithdrawGold( from, amount );

			return true;
		}

		public static bool Deposit( Mobile from, int amount )
		{
			BankBox box = from.BankBox;
			if ( box == null )
				return false;
			
			ArrayList items = new ArrayList();

			while ( amount > 0 )
			{
				Item item;
				if ( amount < 5000 )
				{
					item = new Gold( amount );
					amount = 0;
				}
				else if ( amount <= 1000000 )
				{
					item = new BankCheck( amount );
					amount = 0;
				}
				else
				{
					item = new BankCheck( 1000000 );
					amount -= 1000000;
				}

				if ( box.TryDropItem( from, item, false ) )
				{
					items.Add( item );
				}
				else
				{
					item.Delete();
					foreach ( Item curItem in items )
					{
						curItem.Delete();
					}

					return false;
				}
			}

			return true;
		}

		public static int DepositUpTo( Mobile from, int amount )
		{
			BankBox box = from.BankBox;
			if ( box == null )
				return 0;

			int amountLeft = amount;
			while ( amountLeft > 0 )
			{
				Item item;
				int amountGiven;

				if ( amountLeft < 5000 )
				{
					item = new Gold( amountLeft );
					amountGiven = amountLeft;
				}
				else if ( amountLeft <= 1000000 )
				{
					item = new BankCheck( amountLeft );
					amountGiven = amountLeft;
				}
				else
				{
					item = new BankCheck( 1000000 );
					amountGiven = 1000000;
				}

				if ( box.TryDropItem( from, item, false ) )
				{
					amountLeft -= amountGiven;
				}
				else
				{
					item.Delete();
					break;
				}
			}

			return amount - amountLeft;
		}

		public static void Deposit( Container cont, int amount )
		{
			while ( amount > 0 )
			{
				Item item;

				if ( amount < 5000 )
				{
					item = new Gold( amount );
					amount = 0;
				}
				else if ( amount <= 1000000 )
				{
					item = new BankCheck( amount );
					amount = 0;
				}
				else
				{
					item = new BankCheck( 1000000 );
					amount -= 1000000;
				}

				cont.DropItem( item );
			}
		}

		public Banker( Serial serial ) : base( serial )
		{
		}

		public override bool HandlesOnSpeech( Mobile from )
		{
			if ( from.InRange( this.Location, 12 ) )
				return true;

			return base.HandlesOnSpeech( from );
		}

		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.Mobile.InRange( this.Location, 12 ) )
			{
				for ( int i = 0; i < e.Keywords.Length; ++i )
				{
					int keyword = e.Keywords[i];

					switch ( keyword )
					{
						case 0x0000: // *withdraw*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

								try
								{
									amount = Int32.Parse( split[1], NumberStyles.AllowThousands );
								}
								catch
								{
									break;
								}

								if ( amount > 5000 )
								{
									this.Say( 500381 ); // Thou canst not withdraw so much at one time!
								}
								else if ( amount > 0 )
								{
									BankBox box = e.Mobile.BankBox;

									if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
									}
									else
									{
										e.Mobile.AddToBackpack( new Gold( amount ) );

										this.Say( 1010005 ); // Thou hast withdrawn gold from thy account.
									}
								}
							}

							break;
						}
						case 0x0001: // *balance*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							BankBox box = e.Mobile.BankBox;

							if ( box != null )
							{
								this.Say( 1042759, box.TotalGold.ToString( "#,0" ) ); // Thy current bank balance is ~1_AMOUNT~ gold.
							}

							break;
						}
						case 0x0002: // *bank*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500378 ); // Thou art a criminal and cannot access thy bank box.
								break;
							}

							BankBox box = e.Mobile.BankBox;

							if ( box != null )
								box.Open();

							break;
						}
						case 0x0003: // *check*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

								try
								{
									amount = Int32.Parse( split[1], NumberStyles.AllowThousands );
								}
								catch
								{
									break;
								}

								if ( amount < 5000 )
								{
									this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold!
								}
								else if ( amount > 1000000 )
								{
									this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
								}
								else
								{
									BankCheck check = new BankCheck( amount );

									BankBox box = e.Mobile.BankBox;

									if ( box == null || !box.TryDropItem( e.Mobile, check, false ) )
									{
										this.Say( 500386 ); // There's not enough room in your bankbox for the check!
										check.Delete();
									}
									else if ( !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
										check.Delete();
									}
									else
									{
										this.Say( 1042673, AffixType.Append, amount.ToString( "#,0" ), "" ); // Into your bank box I have placed a check in the amount of:
									}
								}
							}

							break;
						}
					}
				}
			}

			base.OnSpeech( e );
		}

		public override void AddCustomContextEntries( Mobile from, List<ContextMenuEntry> list )
		{
			if ( from.Alive )
				list.Add( new OpenBankEntry( from, this ) );

			base.AddCustomContextEntries( from, list );
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}

+ Misc/CharacterCreation.cs:
CS0234: Line 758: The type or namespace name 'Savings' does not exist in the
namespace 'Server.Arya' (are you missing an assembly reference?)
CS1502: Line 758: The best overloaded method match for 'Server.Items.Contain
er.DropItem(Server.Item)' has some invalid arguments
CS1503: Line 758: Argument '1': cannot convert from 'Server.Arya.Savings.Sav
ingsAccount' to 'Server.Item'

CharacterCreation.cs
Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;
using Server.Engines.XmlSpawner2;

namespace Server.Misc
{
	public class CharacterCreation
	{
		public static void Initialize()
		{
			// Register our event handler
			EventSink.CharacterCreated += new CharacterCreatedEventHandler( EventSink_CharacterCreated );
		}

		private static void AddBackpack( Mobile m )
		{
			Container pack = m.Backpack;

			if ( pack == null )
			{
				pack = new Backpack();
				pack.Movable = false;

				m.AddItem( pack );
			}

			PackItem( new RedBook( "a book", m.Name, 20, true ) );
            PackItem(new JesusBook());
			PackItem( new Gold( 1000 ) ); // Starting gold can be customized here
			PackItem( new Dagger() );
			PackItem( new Candle() );
		}

		private static Item MakeNewbie( Item item )
		{
			if ( !Core.AOS )
				item.LootType = LootType.Newbied;

			return item;
		}

		private static void PlaceItemIn( Container parent, int x, int y, Item item )
		{
			parent.AddItem( item );
			item.Location = new Point3D( x, y, 0 );
		}

		private static Item MakePotionKeg( PotionEffect type, int hue )
		{
			PotionKeg keg = new PotionKeg();

			keg.Held = 100;
			keg.Type = type;
			keg.Hue = hue;

			return MakeNewbie( keg );
		}

		private static void FillBankAOS( Mobile m )
		{
			BankBox bank = m.BankBox;

			if ( bank == null )
				return;

			// The new AOS bankboxes don't have powerscrolls, they are automatically 'applied':

			for ( int i = 0; i < PowerScroll.Skills.Length; ++i )
				m.Skills[PowerScroll.Skills[ i ]].Cap = 120.0;

			m.StatCap = 9000;


			Container cont;


			// Begin box of money
			cont = new WoodenBox();
			cont.ItemID = 0xE7D;
			cont.Hue = 0x489;

			PlaceItemIn( cont, 16, 51, new BankCheck( 500000 ) );
			PlaceItemIn( cont, 28, 51, new BankCheck( 250000 ) );
			PlaceItemIn( cont, 40, 51, new BankCheck( 100000 ) );
			PlaceItemIn( cont, 52, 51, new BankCheck( 100000 ) );
			PlaceItemIn( cont, 64, 51, new BankCheck(  50000 ) );

			PlaceItemIn( cont, 16, 115, new Factions.Silver( 9000 ) );
			PlaceItemIn( cont, 34, 115, new Gold( 60000 ) );

			PlaceItemIn( bank, 18, 169, cont );
			// End box of money


			// Begin bag of potion kegs
			cont = new Backpack();
			cont.Name = "Various Potion Kegs";

			PlaceItemIn( cont,  45, 149, MakePotionKeg( PotionEffect.CureGreater, 0x2D ) );
			PlaceItemIn( cont,  69, 149, MakePotionKeg( PotionEffect.HealGreater, 0x499 ) );
			PlaceItemIn( cont,  93, 149, MakePotionKeg( PotionEffect.PoisonDeadly, 0x46 ) );
			PlaceItemIn( cont, 117, 149, MakePotionKeg( PotionEffect.RefreshTotal, 0x21 ) );
			PlaceItemIn( cont, 141, 149, MakePotionKeg( PotionEffect.ExplosionGreater, 0x74 ) );

			PlaceItemIn( cont, 93, 82, new Bottle( 1000 ) );

			PlaceItemIn( bank, 53, 169, cont );
			// End bag of potion kegs


			// Begin bag of tools
			cont = new Bag();
			cont.Name = "Tool Bag";

			PlaceItemIn( cont, 30,  35, new TinkerTools( 1000 ) );
			PlaceItemIn( cont, 60,  35, new HousePlacementTool() );
			PlaceItemIn( cont, 90,  35, new DovetailSaw( 1000 ) );
			PlaceItemIn( cont, 30,  68, new Scissors() );
			PlaceItemIn( cont, 45,  68, new MortarPestle( 1000 ) );
			PlaceItemIn( cont, 75,  68, new ScribesPen( 1000 ) );
			PlaceItemIn( cont, 90,  68, new SmithHammer( 1000 ) );
			PlaceItemIn( cont, 30, 118, new TwoHandedAxe() );
			PlaceItemIn( cont, 60, 118, new FletcherTools( 1000 ) );
			PlaceItemIn( cont, 90, 118, new SewingKit( 1000 ) );

			PlaceItemIn( cont, 36, 51, new RunicHammer( CraftResource.DullCopper, 1000 ) );
			PlaceItemIn( cont, 42, 51, new RunicHammer( CraftResource.ShadowIron, 1000 ) );
			PlaceItemIn( cont, 48, 51, new RunicHammer( CraftResource.Copper, 1000 ) );
			PlaceItemIn( cont, 54, 51, new RunicHammer( CraftResource.Bronze, 1000 ) );
			PlaceItemIn( cont, 61, 51, new RunicHammer( CraftResource.Gold, 1000 ) );
			PlaceItemIn( cont, 67, 51, new RunicHammer( CraftResource.Agapite, 1000 ) );
			PlaceItemIn( cont, 73, 51, new RunicHammer( CraftResource.Verite, 1000 ) );
			PlaceItemIn( cont, 79, 51, new RunicHammer( CraftResource.Valorite, 1000 ) );

			PlaceItemIn( cont, 36, 55, new RunicSewingKit( CraftResource.SpinedLeather, 1000 ) );
			PlaceItemIn( cont, 42, 55, new RunicSewingKit( CraftResource.HornedLeather, 1000 ) );
			PlaceItemIn( cont, 48, 55, new RunicSewingKit( CraftResource.BarbedLeather, 1000 ) );

			PlaceItemIn( bank, 118, 169, cont );
			// End bag of tools


			// Begin bag of archery ammo
			cont = new Bag();
			cont.Name = "Bag Of Archery Ammo";

			PlaceItemIn( cont, 48, 76, new Arrow( 5000 ) );
			PlaceItemIn( cont, 72, 76, new Bolt( 5000 ) );

			PlaceItemIn( bank, 118, 124, cont );
			// End bag of archery ammo


			// Begin bag of treasure maps
			cont = new Bag();
			cont.Name = "Bag Of Treasure Maps";

			PlaceItemIn( cont, 30, 35, new TreasureMap( 1, Map.Trammel ) );
			PlaceItemIn( cont, 45, 35, new TreasureMap( 2, Map.Trammel ) );
			PlaceItemIn( cont, 60, 35, new TreasureMap( 3, Map.Trammel ) );
			PlaceItemIn( cont, 75, 35, new TreasureMap( 4, Map.Trammel ) );
			PlaceItemIn( cont, 90, 35, new TreasureMap( 5, Map.Trammel ) );
			PlaceItemIn( cont, 90, 35, new TreasureMap( 6, Map.Trammel ) );

			PlaceItemIn( cont, 30, 50, new TreasureMap( 1, Map.Trammel ) );
			PlaceItemIn( cont, 45, 50, new TreasureMap( 2, Map.Trammel ) );
			PlaceItemIn( cont, 60, 50, new TreasureMap( 3, Map.Trammel ) );
			PlaceItemIn( cont, 75, 50, new TreasureMap( 4, Map.Trammel ) );
			PlaceItemIn( cont, 90, 50, new TreasureMap( 5, Map.Trammel ) );
			PlaceItemIn( cont, 90, 50, new TreasureMap( 6, Map.Trammel ) );

			PlaceItemIn( cont, 55, 100, new Lockpick( 30 ) );
			PlaceItemIn( cont, 60, 100, new Pickaxe() );

			PlaceItemIn( bank, 98, 124, cont );
			// End bag of treasure maps


			// Begin bag of raw materials
			cont = new Bag();
			cont.Hue = 0x835;
			cont.Name = "Raw Materials Bag";

			PlaceItemIn( cont, 92, 60, new BarbedLeather( 5000 ) );
			PlaceItemIn( cont, 92, 68, new HornedLeather( 5000 ) );
			PlaceItemIn( cont, 92, 76, new SpinedLeather( 5000 ) );
			PlaceItemIn( cont, 92, 84, new Leather( 5000 ) );

			PlaceItemIn( cont, 30, 118, new Cloth( 5000 ) );
			PlaceItemIn( cont, 30,  84, new Board( 5000 ) );
			PlaceItemIn( cont, 57,  80, new BlankScroll( 500 ) );

			PlaceItemIn( cont, 30,  35, new DullCopperIngot( 5000 ) );
			PlaceItemIn( cont, 37,  35, new ShadowIronIngot( 5000 ) );
			PlaceItemIn( cont, 44,  35, new CopperIngot( 5000 ) );
			PlaceItemIn( cont, 51,  35, new BronzeIngot( 5000 ) );
			PlaceItemIn( cont, 58,  35, new GoldIngot( 5000 ) );
			PlaceItemIn( cont, 65,  35, new AgapiteIngot( 5000 ) );
			PlaceItemIn( cont, 72,  35, new VeriteIngot( 5000 ) );
			PlaceItemIn( cont, 79,  35, new ValoriteIngot( 5000 ) );
			PlaceItemIn( cont, 86,  35, new IronIngot( 5000 ) );

			PlaceItemIn( cont, 30,  59, new RedScales( 5000 ) );
			PlaceItemIn( cont, 36,  59, new YellowScales( 5000 ) );
			PlaceItemIn( cont, 42,  59, new BlackScales( 5000 ) );
			PlaceItemIn( cont, 48,  59, new GreenScales( 5000 ) );
			PlaceItemIn( cont, 54,  59, new WhiteScales( 5000 ) );
			PlaceItemIn( cont, 60,  59, new BlueScales( 5000 ) );

			PlaceItemIn( bank, 98, 169, cont );
			// End bag of raw materials


			// Begin bag of spell casting stuff
			cont = new Backpack();
			cont.Hue = 0x480;
			cont.Name = "Spell Casting Stuff";

			PlaceItemIn( cont, 45, 105, new Spellbook( UInt64.MaxValue ) );
			PlaceItemIn( cont, 65, 105, new NecromancerSpellbook( (UInt64)0xFFFF ) );
			PlaceItemIn( cont, 85, 105, new BookOfChivalry( (UInt64)0x3FF ) );
			PlaceItemIn( cont, 105, 105, new BookOfBushido() );	//Default ctor = full
			PlaceItemIn( cont, 125, 105, new BookOfNinjitsu() ); //Default ctor = full

			Runebook runebook = new Runebook( 10 );
			runebook.CurCharges = runebook.MaxCharges;
			PlaceItemIn( cont, 145, 105, runebook );

			Item toHue = new BagOfReagents( 150 );
			toHue.Hue = 0x2D;
			PlaceItemIn( cont, 45, 150, toHue );

			toHue = new BagOfNecroReagents( 150 );
			toHue.Hue = 0x488;
			PlaceItemIn( cont, 65, 150, toHue );

			PlaceItemIn( cont, 140, 150, new BagOfAllReagents( 500 ) );

			for ( int i = 0; i < 9; ++i )
				PlaceItemIn( cont, 45 + (i * 10), 75, new RecallRune() );

			PlaceItemIn( cont, 141, 74, new FireHorn() );

			PlaceItemIn( bank, 78, 169, cont );
			// End bag of spell casting stuff


			// Begin bag of ethereals
			cont = new Backpack();
			cont.Hue = 0x490;
			cont.Name = "Bag Of Ethy's!";

			PlaceItemIn( cont, 45, 66, new EtherealHorse() );
			PlaceItemIn( cont, 69, 82, new EtherealOstard() );
			PlaceItemIn( cont, 93, 99, new EtherealLlama() );
			PlaceItemIn( cont, 117, 115, new EtherealKirin() );
			PlaceItemIn( cont, 45, 132, new EtherealUnicorn() );
			PlaceItemIn( cont, 69, 66, new EtherealRidgeback() );
			PlaceItemIn( cont, 93, 82, new EtherealSwampDragon() );
			PlaceItemIn( cont, 117, 99, new EtherealBeetle() );

			PlaceItemIn( bank, 38, 124, cont );
			// End bag of ethereals


			// Begin first bag of artifacts
			cont = new Backpack();
			cont.Hue = 0x48F;
			cont.Name = "Bag of Artifacts";

			PlaceItemIn( cont, 45, 66, new TitansHammer() );
			PlaceItemIn( cont, 69, 82, new InquisitorsResolution() );
			PlaceItemIn( cont, 93, 99, new BladeOfTheRighteous() );
			PlaceItemIn( cont, 117, 115, new ZyronicClaw() );

			PlaceItemIn( bank, 58, 124, cont );
			// End first bag of artifacts


			// Begin second bag of artifacts
			cont = new Backpack();
			cont.Hue = 0x48F;
			cont.Name = "Bag of Artifacts";

			PlaceItemIn( cont, 45, 66, new GauntletsOfNobility() );
			PlaceItemIn( cont, 69, 82, new MidnightBracers() );
			PlaceItemIn( cont, 93, 99, new VoiceOfTheFallenKing() );
			PlaceItemIn( cont, 117, 115, new OrnateCrownOfTheHarrower() );
			PlaceItemIn( cont, 45, 132, new HelmOfInsight() );
			PlaceItemIn( cont, 69, 66, new HolyKnightsBreastplate() );
			PlaceItemIn( cont, 93, 82, new ArmorOfFortune() );
			PlaceItemIn( cont, 117, 99, new TunicOfFire() );
			PlaceItemIn( cont, 45, 115, new LeggingsOfBane() );
			PlaceItemIn( cont, 69, 132, new ArcaneShield() );
			PlaceItemIn( cont, 93, 66, new Aegis() );
			PlaceItemIn( cont, 117, 82, new RingOfTheVile() );
			PlaceItemIn( cont, 45, 99, new BraceletOfHealth() );
			PlaceItemIn( cont, 69, 115, new RingOfTheElements() );
			PlaceItemIn( cont, 93, 132, new OrnamentOfTheMagician() );
			PlaceItemIn( cont, 117, 66, new DivineCountenance() );
			PlaceItemIn( cont, 45, 82, new JackalsCollar() );
			PlaceItemIn( cont, 69, 99, new HuntersHeaddress() );
			PlaceItemIn( cont, 93, 115, new HatOfTheMagi() );
			PlaceItemIn( cont, 117, 132, new ShadowDancerLeggings() );
			PlaceItemIn( cont, 45, 66, new SpiritOfTheTotem() );
			PlaceItemIn( cont, 69, 82, new BladeOfInsanity() );
			PlaceItemIn( cont, 93, 99, new AxeOfTheHeavens() );
			PlaceItemIn( cont, 117, 115, new TheBeserkersMaul() );
			PlaceItemIn( cont, 45, 132, new Frostbringer() );
			PlaceItemIn( cont, 69, 66, new BreathOfTheDead() );
			PlaceItemIn( cont, 93, 82, new TheDragonSlayer() );
			PlaceItemIn( cont, 117, 99, new BoneCrusher() );
			PlaceItemIn( cont, 45, 115, new StaffOfTheMagi() );
			PlaceItemIn( cont, 69, 132, new SerpentsFang() );
			PlaceItemIn( cont, 93, 66, new LegacyOfTheDreadLord() );
			PlaceItemIn( cont, 117, 82, new TheTaskmaster() );
			PlaceItemIn( cont, 45, 99, new TheDryadBow() );

			PlaceItemIn( bank, 78, 124, cont );
			// End second bag of artifacts

			// Begin bag of minor artifacts
			cont = new Backpack();
			cont.Hue = 0x48F;
			cont.Name = "Bag of Minor Artifacts";


			PlaceItemIn( cont, 45, 66, new LunaLance() );
			PlaceItemIn( cont, 69, 82, new VioletCourage() );
			PlaceItemIn( cont, 93, 99, new CavortingClub() );
			PlaceItemIn( cont, 117, 115, new CaptainQuacklebushsCutlass() );
			PlaceItemIn( cont, 45, 132, new NightsKiss() );
			PlaceItemIn( cont, 69, 66, new ShipModelOfTheHMSCape() );
			PlaceItemIn( cont, 93, 82, new AdmiralsHeartyRum() );
			PlaceItemIn( cont, 117, 99, new CandelabraOfSouls() );
			PlaceItemIn( cont, 45, 115, new IolosLute() );
			PlaceItemIn( cont, 69, 132, new GwennosHarp() );
			PlaceItemIn( cont, 93, 66, new ArcticDeathDealer() );
			PlaceItemIn( cont, 117, 82, new EnchantedTitanLegBone() );
			PlaceItemIn( cont, 45, 99, new NoxRangersHeavyCrossbow() );
			PlaceItemIn( cont, 69, 115, new BlazeOfDeath() );
			PlaceItemIn( cont, 93, 132, new DreadPirateHat() );
			PlaceItemIn( cont, 117, 66, new BurglarsBandana() );
			PlaceItemIn( cont, 45, 82, new GoldBricks() );
			PlaceItemIn( cont, 69, 99, new AlchemistsBauble() );
			PlaceItemIn( cont, 93, 115, new PhillipsWoodenSteed() );
			PlaceItemIn( cont, 117, 132, new PolarBearMask() );
			PlaceItemIn( cont, 45, 66, new BowOfTheJukaKing() );
			PlaceItemIn( cont, 69, 82, new GlovesOfThePugilist() );
			PlaceItemIn( cont, 93, 99, new OrcishVisage() );
			PlaceItemIn( cont, 117, 115, new StaffOfPower() );
			PlaceItemIn( cont, 45, 132, new ShieldOfInvulnerability() );
			PlaceItemIn( cont, 69, 66, new HeartOfTheLion() );
			PlaceItemIn( cont, 93, 82, new ColdBlood() );
			PlaceItemIn( cont, 117, 99, new GhostShipAnchor() );
			PlaceItemIn( cont, 45, 115, new SeahorseStatuette() );
			PlaceItemIn( cont, 69, 132, new WrathOfTheDryad() );
			PlaceItemIn( cont, 93, 66, new PixieSwatter() );

			for( int i = 0; i < 10; i++ )
                PlaceItemIn( cont, 117, 128, new MessageInABottle( Utility.RandomBool() ? Map.Trammel : Map.Felucca, 4 ) );

			PlaceItemIn( bank, 18, 124, cont );

			if( TreasuresOfTokuno.Enabled )
			{
				cont = new Bag();
				cont.Hue = 0x501;
				cont.Name = "Tokuno Minor Artifacts";

				PlaceItemIn( cont, 42, 70, new Exiler() );
				PlaceItemIn( cont, 38, 53, new HanzosBow() );
				PlaceItemIn( cont, 45, 40, new TheDestroyer() );
				PlaceItemIn( cont, 92, 80, new DragonNunchaku() );
				PlaceItemIn( cont, 42, 56, new PeasantsBokuto() );
				PlaceItemIn( cont, 44, 71, new TomeOfEnlightenment() );
				//PlaceItemIn( cont, 35, 35, new ChestOfHeirlooms() );	//Chest of Heirlooms
				PlaceItemIn( cont, 29,  0, new HonorableSwords() );
				PlaceItemIn( cont, 49, 85, new AncientUrn() );
				PlaceItemIn( cont, 51, 58, new FluteOfRenewal() );
				PlaceItemIn( cont, 70, 51, new PigmentsOfTokuno() );
				PlaceItemIn( cont, 40, 79, new AncientSamuraiDo() );
				PlaceItemIn( cont, 51, 61, new LegsOfStability() );
				PlaceItemIn( cont, 88, 78, new GlovesOfTheSun() );
				PlaceItemIn( cont, 55, 62, new AncientFarmersKasa() );
				PlaceItemIn( cont, 55, 83, new ArmsOfTacticalExcellence() );
				PlaceItemIn( cont, 50, 85, new DaimyosHelm() );
				PlaceItemIn( cont, 52, 78, new BlackLotusHood() );
				PlaceItemIn( cont, 52, 79, new DemonForks() );
				PlaceItemIn( cont, 33, 49, new PilferedDancerFans() );

				PlaceItemIn( bank, 58, 124, cont );
			}

			if( Core.SE )	//This bag came only after SE.
			{
				cont = new Bag();
				cont.Name = "Bag of Bows";

				PlaceItemIn( cont, 31, 84, new Bow() );
				PlaceItemIn( cont, 78, 74, new CompositeBow() );
				PlaceItemIn( cont, 53, 71, new Crossbow() );
				PlaceItemIn( cont, 56, 39, new HeavyCrossbow() );
				PlaceItemIn( cont, 82, 72, new RepeatingCrossbow() );
				PlaceItemIn( cont, 49, 45, new Yumi() );

				for( int i = 0; i < cont.Items.Count; i++ )
				{
					BaseRanged bow = cont.Items[i] as BaseRanged;

					if( bow != null )
					{
						bow.Attributes.WeaponSpeed = 35;
						bow.Attributes.WeaponDamage = 35;
					}
				}

				PlaceItemIn( bank, 108, 135, cont );
			}
		}

		private static void FillBankbox( Mobile m )
		{
			if ( Core.AOS )
			{
				FillBankAOS( m );
				return;
			}

			BankBox bank = m.BankBox;

			if ( bank != null )
			{
				bank.DropItem( new BankCheck( 1000000 ) );

				// Full spellbook
				Spellbook book = new Spellbook();

				book.Content = ulong.MaxValue;

				bank.DropItem( book );

				Bag bag = new Bag();

				for ( int i = 0; i < 5; ++i )
					bag.DropItem( new Moonstone( MoonstoneType.Felucca ) );

				// Felucca moonstones
				bank.DropItem( bag );

				bag = new Bag();

				for ( int i = 0; i < 5; ++i )
					bag.DropItem( new Moonstone( MoonstoneType.Trammel ) );

				// Trammel moonstones
				bank.DropItem( bag );

				// Treasure maps
				bank.DropItem( new TreasureMap( 1, Map.Trammel ) );
				bank.DropItem( new TreasureMap( 2, Map.Trammel ) );
				bank.DropItem( new TreasureMap( 3, Map.Trammel ) );
				bank.DropItem( new TreasureMap( 4, Map.Trammel ) );
				bank.DropItem( new TreasureMap( 5, Map.Trammel ) );

				// Bag containing 50 of each reagent
				bank.DropItem( new BagOfReagents( 50 ) );

				// Craft tools
				bank.DropItem( MakeNewbie( new Scissors() ) );
				bank.DropItem( MakeNewbie( new SewingKit( 1000 ) ) );
				bank.DropItem( MakeNewbie( new SmithHammer( 1000 ) ) );
				bank.DropItem( MakeNewbie( new FletcherTools( 1000 ) ) );
				bank.DropItem( MakeNewbie( new DovetailSaw( 1000 ) ) );
				bank.DropItem( MakeNewbie( new MortarPestle( 1000 ) ) );
				bank.DropItem( MakeNewbie( new ScribesPen( 1000 ) ) );
				bank.DropItem( MakeNewbie( new TinkerTools( 1000 ) ) );

				// A few dye tubs
				bank.DropItem( new Dyes() );
				bank.DropItem( new DyeTub() );
				bank.DropItem( new DyeTub() );
				bank.DropItem( new BlackDyeTub() );

				DyeTub darkRedTub = new DyeTub();

				darkRedTub.DyedHue = 0x485;
				darkRedTub.Redyable = false;

				bank.DropItem( darkRedTub );

				// Some food
				bank.DropItem( MakeNewbie( new Apple( 1000 ) ) );

				// Resources
				bank.DropItem( MakeNewbie( new Feather( 1000 ) ) );
				bank.DropItem( MakeNewbie( new BoltOfCloth( 1000 ) ) );
				bank.DropItem( MakeNewbie( new BlankScroll( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Hides( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Bandage( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Bottle( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Log( 1000 ) ) );

				bank.DropItem( MakeNewbie( new IronIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new DullCopperIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new ShadowIronIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new CopperIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new BronzeIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new GoldIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new AgapiteIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new VeriteIngot( 5000 ) ) );
				bank.DropItem( MakeNewbie( new ValoriteIngot( 5000 ) ) );

				// Reagents
				bank.DropItem( MakeNewbie( new BlackPearl( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Bloodmoss( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Garlic( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Ginseng( 1000 ) ) );
				bank.DropItem( MakeNewbie( new MandrakeRoot( 1000 ) ) );
				bank.DropItem( MakeNewbie( new Nightshade( 1000 ) ) );
				bank.DropItem( MakeNewbie( new SulfurousAsh( 1000 ) ) );
				bank.DropItem( MakeNewbie( new SpidersSilk( 1000 ) ) );

				// Some extra starting gold
				bank.DropItem( MakeNewbie( new Gold( 9000 ) ) );

				// 5 blank recall runes
				for ( int i = 0; i < 5; ++i )
					bank.DropItem( MakeNewbie( new RecallRune() ) );

				AddPowerScrolls( bank );
			}
		}

		private static void AddPowerScrolls( BankBox bank )
		{
			Bag bag = new Bag();

			for ( int i = 0; i < PowerScroll.Skills.Length; ++i )
				bag.DropItem( new PowerScroll( PowerScroll.Skills[i], 120.0 ) );

			bag.DropItem( new StatCapScroll( 3000 ) );

			bank.DropItem( bag );
		}

		private static void AddShirt( Mobile m, int shirtHue )
		{
			int hue = Utility.ClipDyedHue( shirtHue & 0x3FFF );

			if ( m.Race == Race.Elf )
			{
				EquipItem( new ElvenShirt( hue ), true );
			}
			else
			{
				switch ( Utility.Random( 3 ) )
				{
					case 0: EquipItem( new Shirt( hue ), true ); break;
					case 1: EquipItem( new FancyShirt( hue ), true ); break;
					case 2: EquipItem( new Doublet( hue ), true ); break;
				}
			}
		}

		private static void AddPants( Mobile m, int pantsHue )
		{
			int hue = Utility.ClipDyedHue( pantsHue & 0x3FFF );

			if ( m.Race == Race.Elf )
			{
				EquipItem( new ElvenPants( hue ), true );
			}
			else
			{
				if ( m.Female )
				{
					switch ( Utility.Random( 2 ) )
					{
						case 0: EquipItem( new Skirt( hue ), true ); break;
						case 1: EquipItem( new Kilt( hue ), true ); break;
					}
				}
				else
				{
					switch ( Utility.Random( 2 ) )
					{
						case 0: EquipItem( new LongPants( hue ), true ); break;
						case 1: EquipItem( new ShortPants( hue ), true ); break;
					}
				}
			}
		}

		private static void AddShoes( Mobile m )
		{
			if( m.Race == Race.Elf )
				EquipItem( new ElvenBoots(), true );
			else
				EquipItem( new Shoes( Utility.RandomYellowHue() ), true );
		}

		private static Mobile CreateMobile( Account a )
		{
			if ( a.Count >= a.Limit )
				return null;

			for ( int i = 0; i < a.Length; ++i )
			{
				if ( a[i] == null )
					return (a[i] = new PlayerMobile());
			}

			return null;
		}

		private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
		{
			if ( !VerifyProfession( args.Profession ) )
				args.Profession = 0;

			Mobile newChar = CreateMobile( args.Account as Account );

			if ( newChar == null )
			{
				Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State );
				return;
			}

			args.Mobile = newChar;
			m_Mobile = newChar;

			newChar.Player = true;
			newChar.AccessLevel = args.Account.AccessLevel;
			newChar.Female = args.Female;
			//newChar.Body = newChar.Female ? 0x191 : 0x190;

			if( Core.Expansion >= args.Race.RequiredExpasnion )
				newChar.Race = args.Race;	//Sets body
			else
				newChar.Race = Race.DefaultRace;

			//newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;

			newChar.Hunger = 20;

            newChar.Skills.Cap = 108000;
            newChar.FollowersMax = 10;
            newChar.Skills[SkillName.Alchemy].Cap = 2000;
            newChar.Skills[SkillName.Anatomy].Cap = 2000;
            newChar.Skills[SkillName.AnimalLore].Cap = 2000;
            newChar.Skills[SkillName.ItemID].Cap = 2000;
            newChar.Skills[SkillName.ArmsLore].Cap = 2000;
            newChar.Skills[SkillName.Parry].Cap = 2000;
            newChar.Skills[SkillName.Begging].Cap = 2000;
            newChar.Skills[SkillName.Blacksmith].Cap = 2000;
            newChar.Skills[SkillName.Fletching].Cap = 2000;
            newChar.Skills[SkillName.Peacemaking].Cap = 2000;
            newChar.Skills[SkillName.Camping].Cap = 2000;
            newChar.Skills[SkillName.Carpentry].Cap = 2000;
            newChar.Skills[SkillName.Cartography].Cap = 2000;
            newChar.Skills[SkillName.Cooking].Cap = 2000;
            newChar.Skills[SkillName.DetectHidden].Cap = 2000;
            newChar.Skills[SkillName.Discordance].Cap = 2000;
            newChar.Skills[SkillName.EvalInt].Cap = 2000;
            newChar.Skills[SkillName.Healing].Cap = 2000;
            newChar.Skills[SkillName.Fishing].Cap = 2000;
            newChar.Skills[SkillName.Forensics].Cap = 2000;
            newChar.Skills[SkillName.Herding].Cap = 2000;
            newChar.Skills[SkillName.Hiding].Cap = 2000;
            newChar.Skills[SkillName.Provocation].Cap = 2000;
            newChar.Skills[SkillName.Inscribe].Cap = 2000;
            newChar.Skills[SkillName.Lockpicking].Cap = 2000;
            newChar.Skills[SkillName.Magery].Cap = 2000;
            newChar.Skills[SkillName.MagicResist].Cap = 2000;
            newChar.Skills[SkillName.Tactics].Cap = 2000;
            newChar.Skills[SkillName.Snooping].Cap = 2000;
            newChar.Skills[SkillName.Musicianship].Cap = 2000;
            newChar.Skills[SkillName.Poisoning].Cap = 2000;
            newChar.Skills[SkillName.Archery].Cap = 2000;
            newChar.Skills[SkillName.SpiritSpeak].Cap = 2000;
            newChar.Skills[SkillName.Stealing].Cap = 2000;
            newChar.Skills[SkillName.Tailoring].Cap = 2000;
            newChar.Skills[SkillName.AnimalTaming].Cap = 2000;
            newChar.Skills[SkillName.TasteID].Cap = 2000;
            newChar.Skills[SkillName.Tinkering].Cap = 2000;
            newChar.Skills[SkillName.Tracking].Cap = 2000;
            newChar.Skills[SkillName.Veterinary].Cap = 2000;
            newChar.Skills[SkillName.Swords].Cap = 2000;
            newChar.Skills[SkillName.Macing].Cap = 2000;
            newChar.Skills[SkillName.Fencing].Cap = 2000;
            newChar.Skills[SkillName.Wrestling].Cap = 2000;
            newChar.Skills[SkillName.Lumberjacking].Cap = 2000;
            newChar.Skills[SkillName.Mining].Cap = 2000;
            newChar.Skills[SkillName.Meditation].Cap = 2000;
            newChar.Skills[SkillName.Stealth].Cap = 2000;
            newChar.Skills[SkillName.RemoveTrap].Cap = 2000;
            newChar.Skills[SkillName.Necromancy].Cap = 2000;
            newChar.Skills[SkillName.Focus].Cap = 2000;
            newChar.Skills[SkillName.Chivalry].Cap = 2000;
            newChar.StatCap = 9000;

			bool young = false;

			if ( newChar is PlayerMobile )
			{
				PlayerMobile pm = (PlayerMobile) newChar;

				pm.Profession = args.Profession;

				if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young )
					young = pm.Young = true;
			}

			SetName( newChar, args.Name );

			AddBackpack( newChar );

			SetStats( newChar, args.Str, args.Dex, args.Int );
			SetSkills( newChar, args.Skills, args.Profession );

			Race race = newChar.Race;

			if( race.ValidateHair( newChar, args.HairID ) )
			{
				newChar.HairItemID = args.HairID;
				newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF );
			}

			if( race.ValidateFacialHair( newChar, args.BeardID ) )
			{
				newChar.FacialHairItemID = args.BeardID;
				newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF );
			}

			if ( args.Profession <= 3 )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			if( TestCenter.Enabled )
				FillBankbox( newChar );

			if ( young && newChar.BankBox != null )
			{
				NewPlayerTicket ticket = new NewPlayerTicket();
				ticket.Owner = newChar;
				newChar.BankBox.DropItem( ticket );
			}
    if ( newChar.BankBox != null )
                    newChar.BankBox.DropItem( new Arya.Savings.SavingsAccount());

			CityInfo city = GetStartLocation( args, young );
			//CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

			newChar.MoveToWorld( city.Location, city.Map );

			Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, args.Account.Username );
			Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial );
			Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() );

            new WelcomeTimer(newChar).Start();

            // mod to attach the MobFactions attachment automatically to new chars
            XmlAttach.AttachTo(newChar, new XmlMobFactions());
            // mod to attach the XmlPoints attachment automatically to new chars
            XmlAttach.AttachTo(newChar, new XmlPoints());

		}

		public static bool VerifyProfession( int profession )
		{
			if ( profession < 0 )
				return false;
			else if ( profession < 4 )
				return true;
			else if ( Core.AOS && profession < 6 )
				return true;
			else if ( Core.SE && profession < 8 )
				return true;
			else
				return false;
		}

		private class BadStartMessage : Timer
		{
			Mobile m_Mobile;
			int m_Message;
			public BadStartMessage( Mobile m, int message ) : base( TimeSpan.FromSeconds ( 3.5 ) )
			{
				m_Mobile = m;
				m_Message = message;
				this.Start();
			}

			protected override void OnTick()
			{
				m_Mobile.SendLocalizedMessage( m_Message );
			}
		}
		private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
		{
			bool useHaven = isYoung;

			int flags = args.State == null ? 0 : args.State.Flags;
			Mobile m = args.Mobile;

			switch ( args.Profession )
			{
				case 4: //Necro
				{
					if ( (flags & 0x8) != 0 )
					{
						return new CityInfo( "Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas );
					}
					else
					{
						useHaven = true; 

						new BadStartMessage( m, 1062205 );
						/*
						 * Unfortunately you are playing on a *NON-Age-Of-Shadows* game 
						 * installation and cannot be transported to Malas.  
						 * You will not be able to take your new player quest in Malas 
						 * without an AOS client.  You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
				case 5:	//Paladin
				{
					return new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel );
				}
				case 6:	//Samurai
				{
					if ( (flags & 0x10) != 0 )
					{
						return new CityInfo( "Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas );
					}
					else
					{
						useHaven = true;

						new BadStartMessage( m, 1063487 );
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game 
						 * installation and cannot be transported to Tokuno. 
						 * You will not be able to take your new player quest in Tokuno 
						 * without an SE client. You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
				case 7:	//Ninja
				{
					if ( (flags & 0x10) != 0 )
					{
						return new CityInfo( "Ninja DE", "Enimo's Residence", 414,	823, -1, Map.Malas );
					}
					else
					{
						useHaven = true;

						new BadStartMessage( m, 1063487 );
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game 
						 * installation and cannot be transported to Tokuno. 
						 * You will not be able to take your new player quest in Tokuno 
						 * without an SE client. You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
			}

			if( useHaven )
				return new CityInfo( "Haven", "Uzeraan's Mansion", 3582, 2587, 0, Map.Trammel );
			else
				return args.City;
		}

		private static void FixStats( ref int str, ref int dex, ref int intel )
		{
			int vStr = str - 10;
			int vDex = dex - 10;
			int vInt = intel - 10;

			if ( vStr < 0 )
				vStr = 0;

			if ( vDex < 0 )
				vDex = 0;

			if ( vInt < 0 )
				vInt = 0;

			int total = vStr + vDex + vInt;

			if ( total == 0 || total == 50 )
				return;

			double scalar = 50 / (double)total;

			vStr = (int)(vStr * scalar);
			vDex = (int)(vDex * scalar);
			vInt = (int)(vInt * scalar);

			FixStat( ref vStr, (vStr + vDex + vInt) - 50 );
			FixStat( ref vDex, (vStr + vDex + vInt) - 50 );
			FixStat( ref vInt, (vStr + vDex + vInt) - 50 );

			str = vStr + 10;
			dex = vDex + 10;
			intel = vInt + 10;
		}

		private static void FixStat( ref int stat, int diff )
		{
			stat += diff;

			if ( stat < 0 )
				stat = 0;
			else if ( stat > 50 )
				stat = 50;
		}

		private static void SetStats( Mobile m, int str, int dex, int intel )
		{
			FixStats( ref str, ref dex, ref intel );

			if ( str < 10 || str > 60 || dex < 10 || dex > 60 || intel < 10 || intel > 60 || (str + dex + intel) != 80 )
			{
				str = 10;
				dex = 10;
				intel = 10;
			}

			m.InitStats( str, dex, intel );
		}

		private static void SetName( Mobile m, string name )
		{
			name = name.Trim();

			if ( !NameVerification.Validate( name, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote ) )
				name = "Generic Player";

			m.Name = name;
		}

		private static bool ValidSkills( SkillNameValue[] skills )
		{
			int total = 0;

			for ( int i = 0; i < skills.Length; ++i )
			{
				if ( skills[i].Value < 0 || skills[i].Value > 50 )
					return false;

				total += skills[i].Value;

				for ( int j = i + 1; j < skills.Length; ++j )
				{
					if ( skills[j].Value > 0 && skills[j].Name == skills[i].Name )
						return false;
				}
			}

			return ( total == 100 );
		}

		private static Mobile m_Mobile;

		private static void SetSkills( Mobile m, SkillNameValue[] skills, int prof )
		{
			switch ( prof )
			{
				case 1: // Warrior
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Anatomy, 30 ),
							new SkillNameValue( SkillName.Healing, 45 ),
							new SkillNameValue( SkillName.Swords, 35 ),
							new SkillNameValue( SkillName.Tactics, 50 )
						};

					break;
				}
				case 2: // Magician
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.EvalInt, 30 ),
							new SkillNameValue( SkillName.Wrestling, 30 ),
							new SkillNameValue( SkillName.Magery, 50 ),
							new SkillNameValue( SkillName.Meditation, 50 )
						};

					break;
				}
				case 3: // Blacksmith
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Mining, 30 ),
							new SkillNameValue( SkillName.ArmsLore, 30 ),
							new SkillNameValue( SkillName.Blacksmith, 50 ),
							new SkillNameValue( SkillName.Tinkering, 50 )
						};

					break;
				}
				case 4: // Necromancer
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Necromancy, 50 ),
							new SkillNameValue( SkillName.Focus, 30 ),
							new SkillNameValue( SkillName.SpiritSpeak, 30 ),
							new SkillNameValue( SkillName.Swords, 30 ),
							new SkillNameValue( SkillName.Tactics, 20 )
						};

					break;
				}
				case 5: // Paladin
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Chivalry, 51 ),
							new SkillNameValue( SkillName.Swords, 49 ),
							new SkillNameValue( SkillName.Focus, 30 ),
							new SkillNameValue( SkillName.Tactics, 30 )
						};

					break;
				}
				case 6:	//Samurai
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Bushido, 50 ),
							new SkillNameValue( SkillName.Swords, 50 ),
							new SkillNameValue( SkillName.Anatomy, 30 ),
							new SkillNameValue( SkillName.Healing, 30 )
					};
					break;
				}
				case 7:	//Ninja
				{
					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Ninjitsu, 50 ),
							new SkillNameValue( SkillName.Hiding, 50 ),
							new SkillNameValue( SkillName.Fencing, 30 ),
							new SkillNameValue( SkillName.Stealth, 30 )
						};
					break;
				}
				default:
				{
					if ( !ValidSkills( skills ) )
						return;

					break;
				}
			}

			bool addSkillItems = true;
			bool elf = (m.Race == Race.Elf);

			switch ( prof )
			{
				case 1: // Warrior
				{
					if ( elf )
						EquipItem( new LeafChest() );
					else
						EquipItem( new LeatherChest() );
					break;
				}
				case 4: // Necromancer
				{
					Container regs = new BagOfNecroReagents( 50 );

					if ( !Core.AOS )
					{
						foreach ( Item item in regs.Items )
							item.LootType = LootType.Newbied;
					}

					PackItem( regs );

					regs.LootType = LootType.Regular;

					
					EquipItem( new BoneHelm() );

					if ( elf )
					{
						EquipItem( new ElvenMachete() );
						EquipItem( NecroHue( new LeafChest() ) );
						EquipItem( NecroHue( new LeafArms() ) );
						EquipItem( NecroHue( new LeafGloves() ) );
						EquipItem( NecroHue( new LeafGorget() ) );
						EquipItem( NecroHue( new LeafGorget() ) );
						EquipItem( NecroHue( new ElvenPants() ) );	//TODO: Verify the pants
						EquipItem( new ElvenBoots() );
					}
					else
					{
						EquipItem( new BoneHarvester() );
						EquipItem( NecroHue( new LeatherChest() ) );
						EquipItem( NecroHue( new LeatherArms() ) );
						EquipItem( NecroHue( new LeatherGloves() ) );
						EquipItem( NecroHue( new LeatherGorget() ) );
						EquipItem( NecroHue( new LeatherLegs() ) );
						EquipItem( NecroHue( new Skirt() ) );
						EquipItem( new Sandals( 0x8FD ) );
					}

					Spellbook book = new NecromancerSpellbook( (ulong)0x8981 ); // animate dead, evil omen, pain spike, summon familiar, wraith form

					PackItem( book );

					book.LootType = LootType.Blessed;

					addSkillItems = false;

					break;
				}
				case 5: // Paladin
				{
					if ( elf )
					{
						EquipItem( new ElvenMachete() );
						EquipItem( new WingedHelm() );
						EquipItem( new LeafGorget() );
						EquipItem( new LeafArms() );
						EquipItem( new LeafChest() );
						EquipItem( new LeafLegs() );
						EquipItem( new ElvenBoots() );	//Verify hue
					}
					else
					{
						EquipItem( new Broadsword() );
						EquipItem( new Helmet() );
						EquipItem( new PlateGorget() );
						EquipItem( new RingmailArms() );
						EquipItem( new RingmailChest() );
						EquipItem( new RingmailLegs() );
						EquipItem( new ThighBoots( 0x748 ) );
						EquipItem( new Cloak( 0xCF ) );
						EquipItem( new BodySash( 0xCF ) );
					}

					Spellbook book = new BookOfChivalry( (ulong)0x3FF );

					PackItem( book );

					book.LootType = LootType.Blessed;

					break;
				}
					
				case 6: // Samurai
				{
					addSkillItems = false;
					EquipItem( new HakamaShita( 0x2C3 ) );
					EquipItem( new Hakama( 0x2C3 ) );
					EquipItem( new SamuraiTabi( 0x2C3 ) );
					EquipItem( new TattsukeHakama( 0x22D ) );
					EquipItem( new Bokuto() );

					if ( elf )
						EquipItem( new RavenHelm() );
					else
						EquipItem( new LeatherJingasa() );

					PackItem( new Scissors() );
					PackItem( new Bandage( 50 ) );

					Spellbook book = new BookOfBushido();
					PackItem( book );

					break;
				}
				case 7: // Ninja
				{
					addSkillItems = false;
					EquipItem( new Kasa() );
					
					int[] hues = new int[] { 0x1A8, 0xEC, 0x99, 0x90, 0xB5, 0x336, 0x89	};
					//TODO: Verify that's ALL the hues for that above.

					EquipItem( new TattsukeHakama( hues[Utility.Random(hues.Length)] ) );
					
					EquipItem( new HakamaShita( 0x2C3 ) );
					EquipItem( new NinjaTabi( 0x2C3 ) );

					if ( elf )
						EquipItem( new AssassinSpike() );
					else
						EquipItem( new Tekagi() );

					PackItem( new SmokeBomb() );

					Spellbook book = new BookOfNinjitsu();
					PackItem( book );

					break;
				}
			}

			for ( int i = 0; i < skills.Length; ++i )
			{
				SkillNameValue snv = skills[i];

				if ( snv.Value > 0 && ( snv.Name != SkillName.Stealth || prof == 7 ) && snv.Name != SkillName.RemoveTrap && snv.Name != SkillName.Spellweaving )
				{
					Skill skill = m.Skills[snv.Name];

					if ( skill != null )
					{
						skill.BaseFixedPoint = snv.Value * 10;

						if ( addSkillItems )
							AddSkillItems( snv.Name, m );
					}
				}
			}
		}

		private static void EquipItem( Item item )
		{
			EquipItem( item, false );
		}

		private static void EquipItem( Item item, bool mustEquip )
		{
			if ( !Core.AOS )
				item.LootType = LootType.Newbied;

			if ( m_Mobile != null && m_Mobile.EquipItem( item ) )
				return;

			Container pack = m_Mobile.Backpack;

			if ( !mustEquip && pack != null )
				pack.DropItem( item );
			else
				item.Delete();
		}

		private static void PackItem( Item item )
		{
			if ( !Core.AOS )
				item.LootType = LootType.Newbied;

			Container pack = m_Mobile.Backpack;

			if ( pack != null )
				pack.DropItem( item );
			else
				item.Delete();
		}

		private static void PackInstrument()
		{
			switch ( Utility.Random( 6 ) )
			{
				case 0: PackItem( new Drums() ); break;
				case 1: PackItem( new Harp() ); break;
				case 2: PackItem( new LapHarp() ); break;
				case 3: PackItem( new Lute() ); break;
				case 4: PackItem( new Tambourine() ); break;
				case 5: PackItem( new TambourineTassel() ); break;
			}
		}

		private static void PackScroll( int circle )
		{
			switch ( Utility.Random( 8 ) * (circle * 8) )
			{
				case  0: PackItem( new ClumsyScroll() ); break;
				case  1: PackItem( new CreateFoodScroll() ); break;
				case  2: PackItem( new FeeblemindScroll() ); break;
				case  3: PackItem( new HealScroll() ); break;
				case  4: PackItem( new MagicArrowScroll() ); break;
				case  5: PackItem( new NightSightScroll() ); break;
				case  6: PackItem( new ReactiveArmorScroll() ); break;
				case  7: PackItem( new WeakenScroll() ); break;
				case  8: PackItem( new AgilityScroll() ); break;
				case  9: PackItem( new CunningScroll() ); break;
				case 10: PackItem( new CureScroll() ); break;
				case 11: PackItem( new HarmScroll() ); break;
				case 12: PackItem( new MagicTrapScroll() ); break;
				case 13: PackItem( new MagicUnTrapScroll() ); break;
				case 14: PackItem( new ProtectionScroll() ); break;
				case 15: PackItem( new StrengthScroll() ); break;
				case 16: PackItem( new BlessScroll() ); break;
				case 17: PackItem( new FireballScroll() ); break;
				case 18: PackItem( new MagicLockScroll() ); break;
				case 19: PackItem( new PoisonScroll() ); break;
				case 20: PackItem( new TelekinisisScroll() ); break;
				case 21: PackItem( new TeleportScroll() ); break;
				case 22: PackItem( new UnlockScroll() ); break;
				case 23: PackItem( new WallOfStoneScroll() ); break;
			}
		}

		private static Item NecroHue( Item item )
		{
			item.Hue = 0x2C3;

			return item;
		}

		private static void		AddSkillItems( SkillName skill, Mobile m )
		{
			bool elf = (m.Race == Race.Elf);

			switch ( skill )
			{
				case SkillName.Alchemy:
				{
					PackItem( new Bottle( 4 ) );
					PackItem( new MortarPestle() );

					int hue = Utility.RandomPinkHue();

					if ( elf )
					{
						if ( m.Female )
							EquipItem( new FemaleElvenRobe( hue ) );
						else
							EquipItem( new MaleElvenRobe( hue ) );
					}
					else
					{
						EquipItem( new Robe( Utility.RandomPinkHue() ) );
					}
					break;
				}
				case SkillName.Anatomy:
				{
					PackItem( new Bandage( 3 ) );

					int hue = Utility.RandomYellowHue();

					if ( elf )
					{
						if ( m.Female )
							EquipItem( new FemaleElvenRobe( hue ) );
						else
							EquipItem( new MaleElvenRobe( hue ) );
					}
					else
					{
						EquipItem( new Robe( Utility.RandomPinkHue() ) );
					}
					break;
				}
				case SkillName.AnimalLore:
				{
					

					int hue = Utility.RandomBlueHue();

					if ( elf )
					{
						EquipItem( new WildStaff() );

						if ( m.Female )
							EquipItem( new FemaleElvenRobe( hue ) );
						else
							EquipItem( new MaleElvenRobe( hue ) );
					}
					else
					{
						EquipItem( new ShepherdsCrook() );
						EquipItem( new Robe( hue ) );
					}
					break;
				}
				case SkillName.Archery:
				{
					PackItem( new Arrow( 25 ) );

					if ( elf )
						EquipItem( new ElvenCompositeLongbow() );
					else
						EquipItem( new Bow() );
					
					break;
				}
				case SkillName.ArmsLore:
				{
					if ( elf )
					{
						switch ( Utility.Random( 3 ) )
						{
							case 0: EquipItem( new Leafblade() ); break;
							case 1: EquipItem( new RuneBlade() ); break;
							case 2: EquipItem( new DiamondMace() ); break;
						}
					}
					else
					{
						switch ( Utility.Random( 3 ) )
						{
							case 0: EquipItem( new Kryss() ); break;
							case 1: EquipItem( new Katana() ); break;
							case 2: EquipItem( new Club() ); break;
						}
					}

					break;
				}
				case SkillName.Begging:
				{
					if ( elf )
						EquipItem( new WildStaff() );
					else
						EquipItem( new GnarledStaff() );
					break;
				}
				case SkillName.Blacksmith:
				{
					PackItem( new Tongs() );
					PackItem( new Pickaxe() );
					PackItem( new Pickaxe() );
					PackItem( new IronIngot( 50 ) );
					EquipItem( new HalfApron( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.Bushido:
				{
					EquipItem( new Hakama() );
					EquipItem( new Kasa() );
					EquipItem( new BookOfBushido() );
					break;
				}
				case SkillName.Fletching:
				{
					PackItem( new Board( 14 ) );
					PackItem( new Feather( 5 ) );
					PackItem( new Shaft( 5 ) );
					break;
				}
				case SkillName.Camping:
				{
					PackItem( new Bedroll() );
					PackItem( new Kindling( 5 ) );
					break;
				}
				case SkillName.Carpentry:
				{
					PackItem( new Board( 10 ) );
					PackItem( new Saw() );
					EquipItem( new HalfApron( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.Cartography:
				{
					PackItem( new BlankMap() );
					PackItem( new BlankMap() );
					PackItem( new BlankMap() );
					PackItem( new BlankMap() );
					PackItem( new Sextant() );
					break;
				}
				case SkillName.Cooking:
				{
					PackItem( new Kindling( 2 ) );
					PackItem( new RawLambLeg() );
					PackItem( new RawChickenLeg() );
					PackItem( new RawFishSteak() );
					PackItem( new SackFlour() );
					PackItem( new Pitcher( BeverageType.Water ) );
					break;
				}
				case SkillName.DetectHidden:
				{
					EquipItem( new Cloak( 0x455 ) );
					break;
				}
				case SkillName.Discordance:
				{
					PackInstrument();
					break;
				}
				case SkillName.Fencing:
				{
					if ( elf )
						EquipItem( new Leafblade() );
					else
						EquipItem( new Kryss() );

					break;
				}
				case SkillName.Fishing:
				{
					EquipItem( new FishingPole() );

					int hue = Utility.RandomYellowHue();

					if ( elf )
					{
						Item i = new Circlet();
						i.Hue = hue;
						EquipItem( i );
					}
					else
					{
						EquipItem( new FloppyHat( Utility.RandomYellowHue() ) );
					}

					break;
				}
				case SkillName.Healing:
				{
					PackItem( new Bandage( 50 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Herding:
				{
					if ( elf )
						EquipItem( new WildStaff() );
					else
						EquipItem( new ShepherdsCrook() );

					break;
				}
				case SkillName.Hiding:
				{
					EquipItem( new Cloak( 0x455 ) );
					break;
				}
				case SkillName.Inscribe:
				{
					PackItem( new BlankScroll( 2 ) );
					PackItem( new BlueBook() );
					break;
				}
				case SkillName.ItemID:
				{
					if ( elf )
						EquipItem( new WildStaff() );
					else
						EquipItem( new GnarledStaff() );
					break;
				}
				case SkillName.Lockpicking:
				{
					PackItem( new Lockpick( 20 ) );
					break;
				}
				case SkillName.Lumberjacking:
				{
					EquipItem( new Hatchet() );
					break;
				}
				case SkillName.Macing:
				{
					if ( elf )
						EquipItem( new DiamondMace() );
					else
						EquipItem( new Club() );

					break;
				}
				case SkillName.Magery:
				{
					BagOfReagents regs = new BagOfReagents( 30 );

					if ( !Core.AOS )
					{
						foreach ( Item item in regs.Items )
							item.LootType = LootType.Newbied;
					}

					PackItem( regs );

					regs.LootType = LootType.Regular;

					PackScroll( 0 );
					PackScroll( 1 );
					PackScroll( 2 );

					Spellbook book = new Spellbook( (ulong)0x382A8C38 );

					EquipItem( book );

					book.LootType = LootType.Blessed;

					if ( elf )
					{
						EquipItem( new Circlet() );

						if( m.Female )
							EquipItem( new FemaleElvenRobe( Utility.RandomBlueHue() ) );
						else
							EquipItem( new MaleElvenRobe( Utility.RandomBlueHue() ) );
					}
					else
					{
						EquipItem( new WizardsHat() );
						EquipItem( new Robe( Utility.RandomBlueHue() ) );
					}

					break;
				}
				case SkillName.Mining:
				{
					PackItem( new Pickaxe() );
					break;
				}
				case SkillName.Musicianship:
				{
					PackInstrument();
					break;
				}
				case SkillName.Ninjitsu:
				{
					EquipItem( new Hakama( 0x2C3 ) );	//Only ninjas get the hued one.
					EquipItem( new Kasa() );
					EquipItem( new BookOfNinjitsu() );
					break;
				}
				case SkillName.Parry:
				{
					EquipItem( new WoodenShield() );
					break;
				}
				case SkillName.Peacemaking:
				{
					PackInstrument();
					break;
				}
				case SkillName.Poisoning:
				{
					PackItem( new LesserPoisonPotion() );
					PackItem( new LesserPoisonPotion() );
					break;
				}
				case SkillName.Provocation:
				{
					PackInstrument();
					break;
				}
				case SkillName.Snooping:
				{
					PackItem( new Lockpick( 20 ) );
					break;
				}
				case SkillName.SpiritSpeak:
				{
					EquipItem( new Cloak( 0x455 ) );
					break;
				}
				case SkillName.Stealing:
				{
					PackItem( new Lockpick( 20 ) );
					break;
				}
				case SkillName.Swords:
				{
					if ( elf )
						EquipItem( new RuneBlade() );
					else
						EquipItem( new Katana() );

					break;
				}
				case SkillName.Tactics:
				{
					if ( elf )
						EquipItem( new RuneBlade() );
					else
						EquipItem( new Katana() );

					break;
				}
				case SkillName.Tailoring:
				{
					PackItem( new BoltOfCloth() );
					PackItem( new SewingKit() );
					break;
				}
				case SkillName.Tracking:
				{
					if ( m_Mobile != null )
					{
						Item shoes = m_Mobile.FindItemOnLayer( Layer.Shoes );

						if ( shoes != null )
							shoes.Delete();
					}

					int hue = Utility.RandomYellowHue();

					if ( elf )
						EquipItem( new ElvenBoots( hue ) );
					else
						EquipItem( new Boots( hue ) );

					EquipItem( new SkinningKnife() );
					break;
				}
				case SkillName.Veterinary:
				{
					PackItem( new Bandage( 5 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Wrestling:
				{
					if ( elf )
						EquipItem( new LeafGloves() );
					else
						EquipItem( new LeatherGloves() );

					break;
				}
			}
		}
	}
}
 

trackmage

Wanderer
error :)

The auction system cannot access the cliloc.enu file. Please review the system instructions for proper installation
 

trackmage

Wanderer
auction system cannot running

The auction system cannot access the cliloc.enu file. Please review the system instructions for proper installation

How can ı fix problem ?
 

old_school

Wanderer
My suggestions:

I tried this a while back and it did not work do not know if u ever got it fixed. Anyway heres food for thought. Editing the utima.dll file not a fun thing. You need a better way. Two requireing edits never good. Im a firm beliver in trying to make things drag n drop so if they fail you did not spend hours of editing for nothing. Plus making edits can lead to crashes an other problem later on. So in a nut shell the concept is great, but I suggest you try making a system thats drag n drop. An if you need help let me know. I have a whole team of scriptors. We would love to help ya
 

renerene

Wanderer
who can help me?Arya?

I could fix some errors,
cliloc find my server and I can now also all items in the auc give.
single problem,
when I see three items in the auc admit, I can always buy only the last, and redeem the check without my pc crashes.
it seems as if only a space for the auction items available.

allso if I think alls first item, a bottle in the auction give.dann can be a player that I also buy.gave however, a second item into an diamond around, then I can just buy the diamond without the computer crashes but the bottle is no longer.


so alls would he the space of the bottle, with the diamond rewrite.was is responsible for the items in the auction after the series be saved? what can I change the items he created the series after \ saves?
 
Top