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!

CharacterCreation item limited to first char?

rtaylor1987

Sorceror
CharacterCreation item limited to first char?

I'm wanting to make it so the first character on the account is given a check for 100k - that way the user can't make 5 different characters and have half a mil - only the first character created on a new account is given the 100k bonus - any character after that is only given the original 1,000gp.

Any tips on how I could do this would be appreciated.
 

Tresdni

Squire
I'll give you the part of my character creation that does just this. Replace your top section, with this one.

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;
using Server.Engines.XmlSpawner2;  //[COLOR="Red"]If you do NOT use XmlSpawner, comment it out!![/COLOR]

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

                        bool FirstChar = Convert.ToBoolean( ((Account)m.Account).GetTag("FirstChar") );

			if ( FirstChar ) //this part checks to see if the account already has this tag, if it does it will add the following items


                        {

			PackItem( new RedBook( "a book", m.Name, 20, true ) );
			PackItem( new Gold( 1000 ) );
			        //PackItem( new Dagger() );
			        //PackItem( new Candle() );
                          //PackItem( new SkillBall() );
                          PackItem( new StatBall() );
			        PackItem( new Spellbook( UInt64.MaxValue ) );
                          PackItem( new NecromancerSpellbook( (UInt64)0xFFFF ) );
                          PackItem( new BookOfChivalry( (UInt64)0x3FF ) );
			        PackItem( new Runebook( 10 ) );  
                          //PackItem( new EtherealHorse() );
                       

		        }

                        else // if the account does not have this tag it will add these following items instead

			{
				PackItem( new RedBook( "a book", m.Name, 20, true ) );
			        PackItem( new Gold( 1000 ) );
			        //PackItem( new Dagger() );
			        //PackItem( new Candle() );
                          PackItem( new SkillBall() );
                          PackItem( new StatBall() );
			        PackItem( new Spellbook( UInt64.MaxValue ) );
                          PackItem( new NecromancerSpellbook( (UInt64)0xFFFF ) );
                          PackItem( new BookOfChivalry( (UInt64)0x3FF ) );
			        PackItem( new Runebook( 10 ) );  
                          //PackItem( new EtherealHorse() );
                            //PackItem( new ReferralItem() );
				((Account)m.Account).SetTag( "FirstChar", "true" ); // this part will add the tag onto the account
			}

		}
 

tpopcaz

Sorceror
This is my top section of the script. I've tried adding things to make it so the skillball only goes on the first character but haven't gotten it to work yet. Maybe someone could show me what I'd need to put in mine.





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( 3000 ) ); // Starting gold can be customized here
PackItem( new Dagger() );
PackItem( new Candle() );
PackItem( new TokenBox( m ) );
PackItem( new SkillBall2() );
}


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

JamzeMcC

Squire
The example directly above yours shows you EXACTLY what to type into your CharacterCreation.cs Theres no guess work. You copy the code and paste it directly onto that same part of yours. Look at the following example again:
Code:
ing System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;
using Server.Engines.XmlSpawner2;  //If you do NOT use XmlSpawner, comment it out!!

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

                        bool FirstChar = Convert.ToBoolean( ((Account)m.Account).GetTag("FirstChar") );

			if ( FirstChar ) //this part checks to see if the account already has this tag, if it does it will add the following items


                        {

			PackItem( new RedBook( "a book", m.Name, 20, true ) );
			PackItem( new Gold( 1000 ) );
			        //PackItem( new Dagger() );
			        //PackItem( new Candle() );
                          //PackItem( new SkillBall() );
                          PackItem( new StatBall() );
			        PackItem( new Spellbook( UInt64.MaxValue ) );
                          PackItem( new NecromancerSpellbook( (UInt64)0xFFFF ) );
                          PackItem( new BookOfChivalry( (UInt64)0x3FF ) );
			        PackItem( new Runebook( 10 ) );  
                          //PackItem( new EtherealHorse() );
                       

		        }

                        else // if the account does not have this tag it will add these following items instead

			{
				PackItem( new RedBook( "a book", m.Name, 20, true ) );
			        PackItem( new Gold( 1000 ) );
			        //PackItem( new Dagger() );
			        //PackItem( new Candle() );
                          PackItem( new SkillBall() );
                          PackItem( new StatBall() );
			        PackItem( new Spellbook( UInt64.MaxValue ) );
                          PackItem( new NecromancerSpellbook( (UInt64)0xFFFF ) );
                          PackItem( new BookOfChivalry( (UInt64)0x3FF ) );
			        PackItem( new Runebook( 10 ) );  
                          //PackItem( new EtherealHorse() );
                            //PackItem( new ReferralItem() );
				((Account)m.Account).SetTag( "FirstChar", "true" ); // this part will add the tag onto the account
			}

		}
That is the top part of your Character Creation. The next section is one you will leave there.
Code:
private static Item MakeNewbie( Item item )
		{
			if ( !Core.AOS )
				item.LootType = LootType.Newbied;

			return item;
		}
You just change your items in the top part like the example I showed you yesterday.
 

JamzeMcC

Squire
tpopcaz;835695 said:
so just copy everything he put and take out the chiv books and stuff and add the skillball I use?

Yes. The top section of stuff to add is what it adds if the account DOES have the tag, the second half is what it adds if its the first character created. So add your stuff in there accordingly
 
Top