Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 10-05-2004, 04:42 PM   #51 (permalink)
Forum Novice
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 39
Posts: 508
Send a message via ICQ to hudel
Default

Hmm,... I tried the Post office stone 1.9 and got the following error:

Code:
 - Error: Scripts\Custom\Modified\Misc\CharacterCreation.cs: CS0246: (line 16, c
olumn 4) Der Typ oder Namespace 'newChar' konnte nicht gefunden werden. Mögliche
rweise fehlt eine Anweisung oder ein Assemblyverweis.
 - Error: Scripts\Custom\Modified\Misc\LoginStats.cs: CS0246: (line 13, column 2
2) Der Typ oder Namespace 'm' konnte nicht gefunden werden. Möglicherweise fehlt
 eine Anweisung oder ein Assemblyverweis.
 - Error: Scripts\Custom\Modified\Misc\LoginStats.cs: CS0246: (line 17, column 2
1) Der Typ oder Namespace 'NewMailGump' konnte nicht gefunden werden. Möglicherweise fehlt eine Anweisung oder ein Assemblyverweis.
Can you help me with that, please?
hudel is offline   Reply With Quote
Old 10-05-2004, 09:57 PM   #52 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by hudel
Hmm,... I tried the Post office stone 1.9 and got the following error:

Code:
 - Error: Scripts\Custom\Modified\Misc\CharacterCreation.cs: CS0246: (line 16, c
olumn 4) Der Typ oder Namespace 'newChar' konnte nicht gefunden werden. Mögliche
rweise fehlt eine Anweisung oder ein Assemblyverweis.
- Error: Scripts\Custom\Modified\Misc\LoginStats.cs: CS0246: (line 13, column 2
2) Der Typ oder Namespace 'm' konnte nicht gefunden werden. Möglicherweise fehlt
eine Anweisung oder ein Assemblyverweis.
- Error: Scripts\Custom\Modified\Misc\LoginStats.cs: CS0246: (line 17, column 2
1) Der Typ oder Namespace 'NewMailGump' konnte nicht gefunden werden. Möglicherweise fehlt eine Anweisung oder ein Assemblyverweis.
Can you help me with that, please?
can you post your charactercreation.cs and loginstats.cs so I can look at them?
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-10-2004, 04:16 PM   #53 (permalink)
Forum Novice
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 39
Posts: 508
Send a message via ICQ to hudel
Default

Ok. My loginstats.cs is the following:

Code:
using System;
using Server.Network;

namespace Server.Misc
{
	public class LoginStats
	{
		public static void Initialize()
		{
			// Register our event handler
			EventSink.Login += new LoginEventHandler( EventSink_Login );
		}

		private static void EventSink_Login( LoginEventArgs args )
		{
			int userCount = NetState.Instances.Count;
			int itemCount = World.Items.Count;
			int mobileCount = World.Mobiles.Count;
			int spellCount = Spells.SpellRegistry.Count;

			Mobile m = args.Mobile;

			m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
				args.Mobile.Name,
				userCount == 1 ? "is" : "are",
				userCount, userCount == 1 ? "" : "s",
				itemCount, itemCount == 1 ? "" : "s",
				mobileCount, mobileCount == 1 ? "" : "s" );
		}
	}
}
My charactercreation.cs is as follows:

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;

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 Gold( 1000 ) ); // Starting gold can be customized here
			PackItem( new Dagger() );
			PackItem( new Candle() );
			//////Hunger & Thirst System Start Modification//////
			m.Thirst = 20;
			//////Hunger & Thirst System End Modification//////
		}

		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 = 250;


			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, 34, 115, MakeNewbie( 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, MakeNewbie( 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, MakeNewbie( new TinkerTools( 1000 ) ) );
			PlaceItemIn( cont, 60,  35, new HousePlacementTool() );
			PlaceItemIn( cont, 90,  35, MakeNewbie( new DovetailSaw( 1000 ) ) );
			PlaceItemIn( cont, 30,  68, MakeNewbie( new Scissors() ) );
			PlaceItemIn( cont, 45,  68, MakeNewbie( new MortarPestle( 1000 ) ) );
			PlaceItemIn( cont, 75,  68, MakeNewbie( new ScribesPen( 1000 ) ) );
			PlaceItemIn( cont, 90,  68, MakeNewbie( new SmithHammer( 1000 ) ) );
			PlaceItemIn( cont, 30, 118, MakeNewbie( new TwoHandedAxe() ) );
			PlaceItemIn( cont, 60, 118, MakeNewbie( new FletcherTools( 1000 ) ) );
			PlaceItemIn( cont, 90, 118, MakeNewbie( new SewingKit( 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, MakeNewbie( new Arrow( 5000 ) ) );
			PlaceItemIn( cont, 72, 76, MakeNewbie( 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, MakeNewbie( new TreasureMap( 1, Map.Trammel ) ) );
			PlaceItemIn( cont, 45, 35, MakeNewbie( new TreasureMap( 2, Map.Trammel ) ) );
			PlaceItemIn( cont, 60, 35, MakeNewbie( new TreasureMap( 3, Map.Trammel ) ) );
			PlaceItemIn( cont, 75, 35, MakeNewbie( new TreasureMap( 4, Map.Trammel ) ) );
			PlaceItemIn( cont, 90, 35, MakeNewbie( new TreasureMap( 5, Map.Trammel ) ) );

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

			PlaceItemIn( cont, 55, 100, MakeNewbie( new Lockpick( 30 ) ) );
			PlaceItemIn( cont, 60, 100, MakeNewbie( 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, MakeNewbie( new BarbedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 68, MakeNewbie( new HornedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 76, MakeNewbie( new SpinedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 84, MakeNewbie( new Leather( 5000 ) ) );

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

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

			PlaceItemIn( cont, 30,  59, MakeNewbie( new RedScales( 5000 ) ) );
			PlaceItemIn( cont, 36,  59, MakeNewbie( new YellowScales( 5000 ) ) );
			PlaceItemIn( cont, 42,  59, MakeNewbie( new BlackScales( 5000 ) ) );
			PlaceItemIn( cont, 48,  59, MakeNewbie( new GreenScales( 5000 ) ) );
			PlaceItemIn( cont, 54,  59, MakeNewbie( new WhiteScales( 5000 ) ) );
			PlaceItemIn( cont, 60,  59, MakeNewbie( 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 ) );

			Runebook runebook = new Runebook( 10 );
			runebook.CurCharges = runebook.MaxCharges;
			PlaceItemIn( cont, 105, 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, MakeNewbie( new RecallRune() ) );

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

		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( 250 ) );

			bank.DropItem( bag );
		}

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

			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.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 )
		{
			EquipItem( new Shoes( Utility.RandomYellowHue() ), true );
		}

		private static void AddHair( Mobile m, int itemID, int hue )
		{
			Item item;

			switch ( itemID & 0x3FFF )
			{
				case 0x2044: item = new Mohawk( hue ); break;
				case 0x2045: item = new PageboyHair( hue ); break;
				case 0x2046: item = new BunsHair( hue ); break;
				case 0x2047: item = new Afro( hue ); break;
				case 0x2048: item = new ReceedingHair( hue ); break;
				case 0x2049: item = new TwoPigTails( hue ); break;
				case 0x204A: item = new KrisnaHair( hue ); break;
				case 0x203B: item = new ShortHair( hue ); break;
				case 0x203C: item = new LongHair( hue ); break;
				case 0x203D: item = new PonyTail( hue ); break;
				default: return;
			}

			m.AddItem( item );
		}

		private static void AddBeard( Mobile m, int itemID, int hue )
		{
			if ( m.Female )
				return;

			Item item;

			switch ( itemID & 0x3FFF )
			{
				case 0x203E: item = new LongBeard( hue ); break;
				case 0x203F: item = new ShortBeard( hue ); break;
				case 0x2040: item = new Goatee( hue ); break;
				case 0x2041: item = new Mustache( hue ); break;
				case 0x204B: item = new MediumShortBeard( hue ); break;
				case 0x204C: item = new MediumLongBeard( hue ); break;
				case 0x204D: item = new Vandyke( hue ); break;
				default: return;
			}

			m.AddItem( item );
		}

		private static Mobile CreateMobile( Account a )
		{
			for ( int i = 0; i < 5; ++i )
				if ( a[i] == null )
					return (a[i] = new PlayerMobile());

			return null;
		}

		private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
		{
			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 = ((Account)args.Account).AccessLevel;
			newChar.Female = args.Female;
			newChar.Body = newChar.Female ? 0x191 : 0x190;
			newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hunger = 20;

			if ( newChar is PlayerMobile )
				((PlayerMobile)newChar).Profession = args.Profession;

			SetName( newChar, args.Name );

			AddBackpack( newChar );

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

			AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) );
			AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) );

			if ( !Core.AOS || (args.Profession != 4 && args.Profession != 5) )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			//FillBankbox( newChar );

			//CityInfo city = args.City;
			CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10 );

			//newChar.MoveToWorld( city.Location, Map.Felucca );
			newChar.MoveToWorld( city.Location, Map.Trammel );

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

			new WelcomeTimer( newChar ).Start();
		}

		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
				{
					if ( !Core.AOS )
						goto default;

					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
				{
					if ( !Core.AOS )
						goto default;

					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Chivalry, 51 ),
							new SkillNameValue( SkillName.Swords, 49 ),
							new SkillNameValue( SkillName.Focus, 30 ),
							new SkillNameValue( SkillName.Tactics, 30 )
						};

					break;
				}
				default:
				{
					if ( !ValidSkills( skills ) )
						return;

					break;
				}
			}

			bool addSkillItems = true;

			switch ( prof )
			{
				case 1: // Warrior
				{
					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 BoneHarvester() );
					EquipItem( new BoneHelm() );

					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
				{
					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;
				}
			}

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

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

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

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

		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 )
		{
			switch ( skill )
			{
				case SkillName.Alchemy:
				{
					PackItem( new Bottle( 4 ) );
					PackItem( new MortarPestle() );
					EquipItem( new Robe( Utility.RandomPinkHue() ) );
					break;
				}
				case SkillName.Anatomy:
				{
					PackItem( new Bandage( 3 ) );
					EquipItem( new Robe( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.AnimalLore:
				{
					EquipItem( new ShepherdsCrook() );
					EquipItem( new Robe( Utility.RandomBlueHue() ) );
					break;
				}
				case SkillName.Archery:
				{
					PackItem( new Arrow( 25 ) );
					EquipItem( new Bow() );
					break;
				}
				case SkillName.ArmsLore:
				{
					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:
				{
					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.Fletching:
				{
					PackItem( new Board( 14 ) );
					PackItem( new Feather( 5 ) );
					PackItem( new Shaft( 5 ) );
					break;
				}
				case SkillName.Camping:
				{
					// TODO: 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:
				{
					EquipItem( new Kryss() );
					break;
				}
				case SkillName.Fishing:
				{
					EquipItem( new FishingPole() );
					EquipItem( new FloppyHat( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.Healing:
				{
					PackItem( new Bandage( 50 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Herding:
				{
					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:
				{
					EquipItem( new GnarledStaff() );
					break;
				}
				case SkillName.Lockpicking:
				{
					PackItem( new Lockpick( 20 ) );
					break;
				}
				case SkillName.Lumberjacking:
				{
					EquipItem( new Hatchet() );
					break;
				}
				case SkillName.Macing:
				{
					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;

					EquipItem( new Robe( Utility.RandomBlueHue() ) );
					EquipItem( new WizardsHat() );

					break;
				}
				case SkillName.Mining:
				{
					PackItem( new Pickaxe() );
					break;
				}
				case SkillName.Musicianship:
				{
					PackInstrument();
					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:
				{
					EquipItem( new Katana() );
					break;
				}
				case SkillName.Tactics:
				{
					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();
					}

					EquipItem( new Boots( Utility.RandomYellowHue() ) );
					EquipItem( new SkinningKnife() );
					break;
				}
				case SkillName.Veterinary:
				{
					PackItem( new Bandage( 5 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Wrestling:
				{
					EquipItem( new LeatherGloves() );
					break;
				}
			}
		}
	}
}
I hope this hleps to find my problem... Thanks for your help raisor.
hudel is offline   Reply With Quote
Old 10-10-2004, 06:15 PM   #54 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by hudel
Ok. My loginstats.cs is the following:

Code:
using System;
using Server.Network;

namespace Server.Misc
{
	public class LoginStats
	{
		public static void Initialize()
		{
			// Register our event handler
			EventSink.Login += new LoginEventHandler( EventSink_Login );
		}

		private static void EventSink_Login( LoginEventArgs args )
		{
			int userCount = NetState.Instances.Count;
			int itemCount = World.Items.Count;
			int mobileCount = World.Mobiles.Count;
			int spellCount = Spells.SpellRegistry.Count;

			Mobile m = args.Mobile;

			m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
				args.Mobile.Name,
				userCount == 1 ? "is" : "are",
				userCount, userCount == 1 ? "" : "s",
				itemCount, itemCount == 1 ? "" : "s",
				mobileCount, mobileCount == 1 ? "" : "s" );
		}
	}
}
My charactercreation.cs is as follows:

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;

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 Gold( 1000 ) ); // Starting gold can be customized here
			PackItem( new Dagger() );
			PackItem( new Candle() );
			//////Hunger & Thirst System Start Modification//////
			m.Thirst = 20;
			//////Hunger & Thirst System End Modification//////
		}

		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 = 250;


			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, 34, 115, MakeNewbie( 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, MakeNewbie( 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, MakeNewbie( new TinkerTools( 1000 ) ) );
			PlaceItemIn( cont, 60,  35, new HousePlacementTool() );
			PlaceItemIn( cont, 90,  35, MakeNewbie( new DovetailSaw( 1000 ) ) );
			PlaceItemIn( cont, 30,  68, MakeNewbie( new Scissors() ) );
			PlaceItemIn( cont, 45,  68, MakeNewbie( new MortarPestle( 1000 ) ) );
			PlaceItemIn( cont, 75,  68, MakeNewbie( new ScribesPen( 1000 ) ) );
			PlaceItemIn( cont, 90,  68, MakeNewbie( new SmithHammer( 1000 ) ) );
			PlaceItemIn( cont, 30, 118, MakeNewbie( new TwoHandedAxe() ) );
			PlaceItemIn( cont, 60, 118, MakeNewbie( new FletcherTools( 1000 ) ) );
			PlaceItemIn( cont, 90, 118, MakeNewbie( new SewingKit( 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, MakeNewbie( new Arrow( 5000 ) ) );
			PlaceItemIn( cont, 72, 76, MakeNewbie( 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, MakeNewbie( new TreasureMap( 1, Map.Trammel ) ) );
			PlaceItemIn( cont, 45, 35, MakeNewbie( new TreasureMap( 2, Map.Trammel ) ) );
			PlaceItemIn( cont, 60, 35, MakeNewbie( new TreasureMap( 3, Map.Trammel ) ) );
			PlaceItemIn( cont, 75, 35, MakeNewbie( new TreasureMap( 4, Map.Trammel ) ) );
			PlaceItemIn( cont, 90, 35, MakeNewbie( new TreasureMap( 5, Map.Trammel ) ) );

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

			PlaceItemIn( cont, 55, 100, MakeNewbie( new Lockpick( 30 ) ) );
			PlaceItemIn( cont, 60, 100, MakeNewbie( 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, MakeNewbie( new BarbedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 68, MakeNewbie( new HornedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 76, MakeNewbie( new SpinedLeather( 5000 ) ) );
			PlaceItemIn( cont, 92, 84, MakeNewbie( new Leather( 5000 ) ) );

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

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

			PlaceItemIn( cont, 30,  59, MakeNewbie( new RedScales( 5000 ) ) );
			PlaceItemIn( cont, 36,  59, MakeNewbie( new YellowScales( 5000 ) ) );
			PlaceItemIn( cont, 42,  59, MakeNewbie( new BlackScales( 5000 ) ) );
			PlaceItemIn( cont, 48,  59, MakeNewbie( new GreenScales( 5000 ) ) );
			PlaceItemIn( cont, 54,  59, MakeNewbie( new WhiteScales( 5000 ) ) );
			PlaceItemIn( cont, 60,  59, MakeNewbie( 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 ) );

			Runebook runebook = new Runebook( 10 );
			runebook.CurCharges = runebook.MaxCharges;
			PlaceItemIn( cont, 105, 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, MakeNewbie( new RecallRune() ) );

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

		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( 250 ) );

			bank.DropItem( bag );
		}

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

			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.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 )
		{
			EquipItem( new Shoes( Utility.RandomYellowHue() ), true );
		}

		private static void AddHair( Mobile m, int itemID, int hue )
		{
			Item item;

			switch ( itemID & 0x3FFF )
			{
				case 0x2044: item = new Mohawk( hue ); break;
				case 0x2045: item = new PageboyHair( hue ); break;
				case 0x2046: item = new BunsHair( hue ); break;
				case 0x2047: item = new Afro( hue ); break;
				case 0x2048: item = new ReceedingHair( hue ); break;
				case 0x2049: item = new TwoPigTails( hue ); break;
				case 0x204A: item = new KrisnaHair( hue ); break;
				case 0x203B: item = new ShortHair( hue ); break;
				case 0x203C: item = new LongHair( hue ); break;
				case 0x203D: item = new PonyTail( hue ); break;
				default: return;
			}

			m.AddItem( item );
		}

		private static void AddBeard( Mobile m, int itemID, int hue )
		{
			if ( m.Female )
				return;

			Item item;

			switch ( itemID & 0x3FFF )
			{
				case 0x203E: item = new LongBeard( hue ); break;
				case 0x203F: item = new ShortBeard( hue ); break;
				case 0x2040: item = new Goatee( hue ); break;
				case 0x2041: item = new Mustache( hue ); break;
				case 0x204B: item = new MediumShortBeard( hue ); break;
				case 0x204C: item = new MediumLongBeard( hue ); break;
				case 0x204D: item = new Vandyke( hue ); break;
				default: return;
			}

			m.AddItem( item );
		}

		private static Mobile CreateMobile( Account a )
		{
			for ( int i = 0; i < 5; ++i )
				if ( a[i] == null )
					return (a[i] = new PlayerMobile());

			return null;
		}

		private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
		{
			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 = ((Account)args.Account).AccessLevel;
			newChar.Female = args.Female;
			newChar.Body = newChar.Female ? 0x191 : 0x190;
			newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hunger = 20;

			if ( newChar is PlayerMobile )
				((PlayerMobile)newChar).Profession = args.Profession;

			SetName( newChar, args.Name );

			AddBackpack( newChar );

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

			AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) );
			AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) );

			if ( !Core.AOS || (args.Profession != 4 && args.Profession != 5) )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			//FillBankbox( newChar );

			//CityInfo city = args.City;
			CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10 );

			//newChar.MoveToWorld( city.Location, Map.Felucca );
			newChar.MoveToWorld( city.Location, Map.Trammel );

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

			new WelcomeTimer( newChar ).Start();
		}

		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
				{
					if ( !Core.AOS )
						goto default;

					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
				{
					if ( !Core.AOS )
						goto default;

					skills = new SkillNameValue[]
						{
							new SkillNameValue( SkillName.Chivalry, 51 ),
							new SkillNameValue( SkillName.Swords, 49 ),
							new SkillNameValue( SkillName.Focus, 30 ),
							new SkillNameValue( SkillName.Tactics, 30 )
						};

					break;
				}
				default:
				{
					if ( !ValidSkills( skills ) )
						return;

					break;
				}
			}

			bool addSkillItems = true;

			switch ( prof )
			{
				case 1: // Warrior
				{
					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 BoneHarvester() );
					EquipItem( new BoneHelm() );

					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
				{
					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;
				}
			}

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

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

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

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

		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 )
		{
			switch ( skill )
			{
				case SkillName.Alchemy:
				{
					PackItem( new Bottle( 4 ) );
					PackItem( new MortarPestle() );
					EquipItem( new Robe( Utility.RandomPinkHue() ) );
					break;
				}
				case SkillName.Anatomy:
				{
					PackItem( new Bandage( 3 ) );
					EquipItem( new Robe( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.AnimalLore:
				{
					EquipItem( new ShepherdsCrook() );
					EquipItem( new Robe( Utility.RandomBlueHue() ) );
					break;
				}
				case SkillName.Archery:
				{
					PackItem( new Arrow( 25 ) );
					EquipItem( new Bow() );
					break;
				}
				case SkillName.ArmsLore:
				{
					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:
				{
					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.Fletching:
				{
					PackItem( new Board( 14 ) );
					PackItem( new Feather( 5 ) );
					PackItem( new Shaft( 5 ) );
					break;
				}
				case SkillName.Camping:
				{
					// TODO: 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:
				{
					EquipItem( new Kryss() );
					break;
				}
				case SkillName.Fishing:
				{
					EquipItem( new FishingPole() );
					EquipItem( new FloppyHat( Utility.RandomYellowHue() ) );
					break;
				}
				case SkillName.Healing:
				{
					PackItem( new Bandage( 50 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Herding:
				{
					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:
				{
					EquipItem( new GnarledStaff() );
					break;
				}
				case SkillName.Lockpicking:
				{
					PackItem( new Lockpick( 20 ) );
					break;
				}
				case SkillName.Lumberjacking:
				{
					EquipItem( new Hatchet() );
					break;
				}
				case SkillName.Macing:
				{
					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;

					EquipItem( new Robe( Utility.RandomBlueHue() ) );
					EquipItem( new WizardsHat() );

					break;
				}
				case SkillName.Mining:
				{
					PackItem( new Pickaxe() );
					break;
				}
				case SkillName.Musicianship:
				{
					PackInstrument();
					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:
				{
					EquipItem( new Katana() );
					break;
				}
				case SkillName.Tactics:
				{
					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();
					}

					EquipItem( new Boots( Utility.RandomYellowHue() ) );
					EquipItem( new SkinningKnife() );
					break;
				}
				case SkillName.Veterinary:
				{
					PackItem( new Bandage( 5 ) );
					PackItem( new Scissors() );
					break;
				}
				case SkillName.Wrestling:
				{
					EquipItem( new LeatherGloves() );
					break;
				}
			}
		}
	}
}
I hope this hleps to find my problem... Thanks for your help raisor.
And these are the files that you modified to get those error messages? I don't see any of the modifications in there that I stated needed to be done. Can you please check to make sure they are the correct ones and repost the error messages you receive.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-11-2004, 10:02 AM   #55 (permalink)
Newbie
 
Join Date: Mar 2004
Posts: 42
Default

Great script! I am having one problem so far though. I have put the address books on a vendor to sell. When I buy the books they are blessed; however, for some reason they arent staying blessed. Im not sure when it happens, but i have several players whose books are no longer blessed. Any ideas?
McClintock is offline   Reply With Quote
Old 10-11-2004, 01:49 PM   #56 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by McClintock
Great script! I am having one problem so far though. I have put the address books on a vendor to sell. When I buy the books they are blessed; however, for some reason they arent staying blessed. Im not sure when it happens, but i have several players whose books are no longer blessed. Any ideas?
That is very very odd. Let me take a look at the script and see if I can figure out whats happening with it.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-11-2004, 06:17 PM   #57 (permalink)
Lurker
 
Join Date: Oct 2004
Age: 56
Posts: 7
Default Server!

Welcome guys please check out creedgaming UOG Server
Server Info
Run Uo Server
Custom Scripts
Custom Maps <---Soon to come
Friendly Staff
Skill Gain <--- No Skill Sets (removes noobs)
AOS <---Activated
-------------------------------------------------------------------------
All new players will be set up with a new house
1st 5 will live in minoc
6-10 will live in brit
11-15 will live in Luna
16-21 will live in Ilsh (Must find clear land)
creedgaming is offline   Reply With Quote
Old 10-11-2004, 09:17 PM   #58 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by creedgaming
Welcome guys please check out creedgaming UOG Server
Server Info
Run Uo Server
Custom Scripts
Custom Maps <---Soon to come
Friendly Staff
Skill Gain <--- No Skill Sets (removes noobs)
AOS <---Activated
-------------------------------------------------------------------------
All new players will be set up with a new house
1st 5 will live in minoc
6-10 will live in brit
11-15 will live in Luna
16-21 will live in Ilsh (Must find clear land)
Advertising is against the rules except in designated forums, hope you enjoyed your 2 posts.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-12-2004, 01:07 PM   #59 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by raisor
That is very very odd. Let me take a look at the script and see if I can figure out whats happening with it.
Ok, I know what I didn't do. The loottype is not being de/serialized and not being saved. Let me figure out how to do that and I will post the update. Thanks for pointing this out McClintock
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-14-2004, 01:29 AM   #60 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Ok, LootType issue fixed. Should stay blessed now after restart of server!
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-14-2004, 08:32 PM   #61 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

UPDATED as of 5:50PM MST! please see first post for changes!
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 10-17-2004, 02:20 PM   #62 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: In Your Internet
Age: 22
Posts: 794
Send a message via AIM to Darkness_PR Send a message via MSN to Darkness_PR
Default Little TINY Problem

Yeah im having a little problem setting LogInStats.cs adding


MailBox mailbox = m.BankBox.FindItemByType( typeof( MailBox ) ) as MailBox;
if ( mailbox != null )
{
if ( mailbox.NewMail == "true" )
m.SendGump( new NewMailGump( m, mailbox ) );
}



cant seem to fidn where to add it into the script
Darkness_PR is offline   Reply With Quote
Old 10-17-2004, 03:03 PM   #63 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by Darkness_PR
Yeah im having a little problem setting LogInStats.cs adding


MailBox mailbox = m.BankBox.FindItemByType( typeof( MailBox ) ) as MailBox;
if ( mailbox != null )
{
if ( mailbox.NewMail == "true" )
m.SendGump( new NewMailGump( m, mailbox ) );
}



cant seem to fidn where to add it into the script
You can add it anywhere really, I just placed it after the last line but before the }'s in the script.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 11-07-2004, 08:35 PM   #64 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Updated to resolve some issues!
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 11-07-2004, 09:16 PM   #65 (permalink)
Forum Novice
 
Join Date: Nov 2003
Location: Buckhannon, WV
Age: 35
Posts: 409
Send a message via ICQ to iZJokersWild Send a message via Yahoo to iZJokersWild
Default

Cool idea!
iZJokersWild is offline   Reply With Quote
Old 11-25-2004, 12:38 PM   #66 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: In Your Internet
Age: 22
Posts: 794
Send a message via AIM to Darkness_PR Send a message via MSN to Darkness_PR
Unhappy Errors and more erros

you might think im kinda stupid but i have ebing playing with this script and allwas get the same error dunno why.....the error is this

Code:
  - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 21, column 22) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
 - Error: Scripts\Misc\LoginStats.cs: CS0029: (line 24, column 9) Cannot implici
tly convert type 'string' to 'bool'
 - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 34) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
 - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 5) The type or na
mespace name 'm' could not be found (are you missing a using directive or an ass
embly reference?)
please help me!
Darkness_PR is offline   Reply With Quote
Old 11-25-2004, 12:59 PM   #67 (permalink)
walmart
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Darkness_PR
you might think im kinda stupid but i have ebing playing with this script and allwas get the same error dunno why.....the error is this

Code:
  - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 21, column 22) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
 - Error: Scripts\Misc\LoginStats.cs: CS0029: (line 24, column 9) Cannot implici
tly convert type 'string' to 'bool'
 - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 34) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
 - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 5) The type or na
mespace name 'm' could not be found (are you missing a using directive or an ass
embly reference?)
please help me!
show me your LoginStats.cs: script if you show it i can help you out
  Reply With Quote
Old 11-25-2004, 04:22 PM   #68 (permalink)
Forum Novice
 
Join Date: Nov 2004
Age: 27
Posts: 153
Default

nice script but a problem is i had a character named reggie and a char named reggie noble on the shard and the letter was sent to the wrong one

any idea to fix that?

i just wrote the lette and clicked done
i dont know if there anything else to do with it
Reggie is offline   Reply With Quote
Old 11-26-2004, 02:08 PM   #69 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by Darkness_PR
you might think im kinda stupid but i have ebing playing with this script and allwas get the same error dunno why.....the error is this

Code:
 - Error: Scripts\Misc\LoginStats.cs: CS0246: (line 21, column 22) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
- Error: Scripts\Misc\LoginStats.cs: CS0029: (line 24, column 9) Cannot implici
tly convert type 'string' to 'bool'
- Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 34) The type or n
amespace name 'm' could not be found (are you missing a using directive or an as
sembly reference?)
- Error: Scripts\Misc\LoginStats.cs: CS0246: (line 25, column 5) The type or na
mespace name 'm' could not be found (are you missing a using directive or an ass
embly reference?)
please help me!
Please post your LoginStats.cs and I will see what is wrong with it.

Quote:
Originally Posted by Reggie
nice script but a problem is i had a character named reggie and a char named reggie noble on the shard and the letter was sent to the wrong one

any idea to fix that?

i just wrote the lette and clicked done
i dont know if there anything else to do with it
I will see what I can figure out. Probably has to do with the space in the name but I shall figure it out and post a fix. Thanks for pointing it out.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 11-26-2004, 03:36 PM   #70 (permalink)
Forum Novice
 
Join Date: Oct 2003
Posts: 116
Default

anyone el se having problems with letters....? mine are erased when i closed them..
akrondar is offline   Reply With Quote
Old 11-27-2004, 04:37 PM   #71 (permalink)
Forum Novice
 
raisor's Avatar
 
Join Date: Sep 2004
Location: Mesa, Az
Age: 33
Posts: 221
Send a message via ICQ to raisor Send a message via AIM to raisor Send a message via MSN to raisor Send a message via Yahoo to raisor
Default

Quote:
Originally Posted by akrondar
anyone el se having problems with letters....? mine are erased when i closed them..
And you are positive that you are using the most current version? I did just make an update to fix another bug but in v2.4 the problem you mention should have been fixed.
__________________
Thanks,
Tom Sapp
raisor is offline   Reply With Quote
Old 01-21-2005, 03:53 PM   #72 (permalink)
Newbie
 
Join Date: Mar 2004
Posts: 42
Default

For some reaon when players click on the Mail entry for the postal worker nothing happens. Got any ideas?
McClintock is offline   Reply With Quote
Old 03-01-2005, 08:48 AM   #73 (permalink)
Lurker
 
Join Date: Sep 2004
Location: USA
Age: 31
Posts: 11
Default

ok same deal here with me as Hudel lol! Looks like he posted the scripts unmodded cause I think he wants you to add the code in correctly. Anyway, I don't write scripts but I do some editing here and there so I know I messed this up since I keep getting errors every way I edit it. So I will post my scripts as I inserted the code. If you could please take a look at it and show me my mistake so I can see and learn from it, I would be grateful.

LoginStats

Code:
using System;
using Server.Network;
using Server.Gumps;
using Server.Items;

namespace Server.Misc
{
	public class LoginStats
	{
		public static void Initialize()
		{
			// Register our event handler
			EventSink.Login += new LoginEventHandler( EventSink_Login );
		}


                MailBox mailbox = m.BankBox.FindItemByType( typeof( MailBox ) ) as MailBox;
                if ( mailbox != null )

                {
                if ( mailbox.NewMail == "true" )
                m.SendGump( new NewMailGump( m, mailbox ) );
                }



		private static void EventSink_Login( LoginEventArgs args )
		{

CharacterCreation

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;

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

                {

                        newChar.BankBox.DropItem( new MailBox() );
                }

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

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

				m.AddItem( pack );
			}
monnie is offline   Reply With Quote
Old 03-06-2005, 07:35 PM   #74 (permalink)
Forum Novice
 
Join Date: Mar 2005
Location: las vegas nevada
Age: 37
Posts: 401
Default

why would the letters show up in the mail box empty. i placed this script in last night and when i sent the letter to a char they recieved the letter but when they opened it, it was empty.

this really would be a nice thing to have.

Edit****

ok i just tried to do this step by step as you had said and still it sends the message to the player but when the player opened it from the mailbox its just blank.

when i sent it it said a message from Dragonwalker but when they got it it was completly blank. at no time did i right click it and i hit done.

as for the script i got it from your site so i assume that is the latest
sirbum69 is offline   Reply With Quote
Old 03-06-2005, 08:12 PM   #75 (permalink)
Forum Novice
 
Join Date: Mar 2005
Location: las vegas nevada
Age: 37
Posts: 401
Default

ok after further testing of this i have found out what is wrong. if the player pulls the letter from the mail box to there backpack with out reading it first then it will show up blank.

if they dbl click it while its in the mailbox first then it will show the message like it should and from then on it will stay in there backpack and can be read.

could someone tell me how this could be fixed.
sirbum69 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5