RunUO Community

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

[RunUO 2.0] Age System

Felladrin

Sorceror
To set age on character creation, you can try that:

In the EventSink_CharacterCreated method, find:

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

                pm.Profession = args.Profession;

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

And change to:

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

                pm.Profession = args.Profession;

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

                // Added to set age at character creation.
                int Age = 18;
                ((Account)pm.Account).SetTag( "Age of " + (pm.RawName), Age );
                ((Account)pm.Account).SetTag( "LastRenewAge " + (pm.RawName), (DateTime.Now).ToString() );
            }

I didn't test, but it should work.

You could also set a random age. I don't remember the exactly code, but I think it would be something like this:
int Age = Utility.RandomMinMax( 18, 23 );

About the papperdoll, you mean displaying it under the character portrait or in the profile gump under the description?
If you don't want to use the command [Age, you would have to create a method to append the age to the title, if you want to show it under the character portrait (papperdoll) while not showing in the name.
 

lorinc

Page
Errors:
+ Misc/CharacterCreation.cs:
CS1502: Line 655: The best overloaded method match for 'Server.Accounting.Account.SetTag<string, string>' has some invalid arguments
CS1503: Line 655: Argument '2': cannot convert from 'int' to 'string'

Please help me i very need it fix thanks for help. :)
 

Felladrin

Sorceror
Ah, change "int" to "string" should fix:

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

                pm.Profession = args.Profession;

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


                // Added to set age at character creation.
                string Age = "18";
                ((Account)pm.Account).SetTag( "Age of " + (pm.RawName), Age );
                ((Account)pm.Account).SetTag( "LastRenewAge " + (pm.RawName), (DateTime.Now).ToString() );
            }
 

Foster

Account Terminated
Here this is how you shouyld fix this;

Administrator's commands:

NewAge - Makes all characters become one year older.

SetAge - Sets the age of a character to the specified value.

VerifyAge - Checks the age of all characters, sends a warning and a Age Change Dee to those who have not recorded their age, and shows statistics on the population's age.

ClearAgeSystem - Removes all tags and items of the Age System from your shard. After that you can re-enable the system or delete the script from RunUO folder and restart the server.

Player Commands
-Age - toggles age display on ad off in paper dolland on mouse over.
 

Foster

Account Terminated
monsters and creatures do not use this age system jus player characters all the info is in the relaease notes from the auther there should be no problems with this it works 100% with later svn and even other versions read up a little more and you will find out what you are looking for.
 
I was wondering if you could script it so that players gain higher stat caps the older they are, I'm not really a scripter but this would be a very interesting addition to player vampire/werewolves theme... If one player who has just started began with a low or regular stat cap, but another player who was 25 days old had the equalivent of +25 stat cap, and that veteran who's played for 400 days had a +200 stat cap, it wouldn't be an exclusive roleplaying addition... it's just that somebody who had a lot of one stat would be kind-of too strong, such as if somebody 150 days old chose 150 additional dex then had instant healing and could never die. again, i'm no scripter but maybe... if there were caps to the individual stats or.. if they lost age or permanently lost stat caps/stats on death
P.S, can somebody pleease script this for me? :D
 

toziel

Sorceror
Greetings.

I have a minor problem with the Age System.
On every server restart the Age Stat boni are deleted/forgotten on the players and unless I set their age per hand again they do not come back.

Any idea why or does anyone else have that problem?
 

mhantra

Sorceror
got the same problem as toziel and more, if i use [verifyage deeds continue to appear even if player has the age
 
Top