I have been working with my charactercreation.cs today and have setup separate starting locations for all 7 templates: Samurai, Ninja, Paladin, Necro, Warrior, Mage and Blacksmith. Right now they all have quest locations in trammel where they start. If you choose Advanced you may select your starting city from the map but what I would also like to do is somehow FLAG that "template" so that if you choose advanced you start out NOT young. All the other profession templates WILL be young. Does anyone know how I can achieve this? Here is where I am working in charactercreation.cs.
Code:
private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
        {
            if( Core.ML )
            {
                if( args.State != null && args.State.NewHaven )
                //return m_NewHavenInfo;    //We don't get the client Version until AFTER Character creation

                return args.City;  //TODO: Uncomment when the old quest system is actually phased out
            }

            bool useHaven = isYoung;

            ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
            Mobile m = args.Mobile;

            switch ( args.Profession )
            {
                case 0:    //Advanced
                {
                    //return new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Trammel );
                    return args.City;
                }
                case 1:    //Warrior
                {
                    return new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel );
                }
                case 2: //Mage
                {
                    return new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel );
                }
                case 3:    //Blacksmith
                {
                    return new CityInfo( "Haven", "Uzeraan's Forge", 3598, 2604, 0, Map.Trammel );
                }
                case 4: //Necro
                {
                    if ( (flags & ClientFlags.Malas) != 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 & ClientFlags.Tokuno) != 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 & ClientFlags.Tokuno) != 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 m_NewHavenInfo;
            else */
                return args.City;
        }
 
Modify the method EventSink_CharacterCreated, below the lines
Code:
if (pm.IsPlayer() && ((Account)pm.Account).Young)
	young = pm.Young = true;
do a check on args.Profession to see if it's 0, and if so make young false.

I think that would do it.
 
Modify the method EventSink_CharacterCreated, below the lines
Code:
if (pm.IsPlayer() && ((Account)pm.Account).Young)
	young = pm.Young = true;
do a check on args.Profession to see if it's 0, and if so make young false.

I think that would do it.
Can you provide an example?
 
Code:
                case 0:    //Advanced
                {
                    young = pm.Young = ((Account)pm.Account).Young = false; //Account one should also be writeable I think not just readable
                    return args.City;
                }
 
Code:
                case 0:    //Advanced
                {
                    young = pm.Young = ((Account)pm.Account).Young = false; //Account one should also be writeable I think not just readable
                    return args.City;
                }
I tried using this example and got this error. I was having the same issue with the method I was trying which was similar.
Code:
Misc/CharacterCreation.cs:
    CS0103: Line 765: The name 'young' does not exist in the current context
    CS0103: Line 765: The name 'pm' does not exist in the current context
    CS0103: Line 765: The name 'pm' does not exist in the current context
 
took a look in the script, thought they were kind of in the same function, my bad :)

you can try ^^
Code:
                case 0:    //Advanced
                {
                    (m as PlayerMobile).Young = ((Account)m.Account).Young = false; //Account one should also be writeable I think not just readable
                    return args.City;
                }
 
Yeah that worked out great! Thanks so much for your help! I have been trying and trying to get this to work! :D
 
Back