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!

A few basic questions!

Soulmancer

Sorceror
1.) Where do I set a specific default starting location?
2.) Where do I alter guard zones?
3.) Where do I alter stat/skill cap and the affects of power scrolls?
4.) Where do I change the rate of stat/skill gain?
5.) How do I enable Felucca pvp rules for other realms?
6.) How do I enable/disable housing for a specific region/map?
7.) Is there a good monster/npc/decoration spawn package available that is compatible with SA?

Thanks a lot!
 

Thagoras

Sorceror
1.) Where do I set a specific default starting location?
In this module: private static void EventSink_CharacterCreated of CharacterCreation.cs

2.) Where do I alter guard zones?
In Regions.xml.

3.) Where do I alter stat/skill cap and the affects of power scrolls?
That should be in PowerScroll.cs or StatScroll.cs.

4.) Where do I change the rate of stat/skill gain?
In SkillCheck.cs.

5.) How do I enable Felucca pvp rules for other realms?
In MapDefinitions.cs, change the other map to FeluccaRules
RegisterMap( 0, 0, 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules );

6.) How do I enable/disable housing for a specific region/map?
Well, there's a lot that can be done in HousePlacement.cs in the module: public static HousePlacementResult Check.

7.) Is there a good monster/npc/decoration spawn package available that is compatible with SA?
I think Nerun may have an SA compatible distro package now...but not sure.

Hope that helps some.
 

Varkasal

Sorceror
I think Nerun is still working on SA but has Mondains done i believe not positive on that though ...
 

Soulmancer

Sorceror
Thanks! I am guessing New Haven is the default location no matter what city you select or is this some type of young status feature? I am using the latest RunUO SVN SA / ML from Orb and no matter what city I select on the starting map I always start in New Haven even if I make a necromancer or paladin; as well I can only select locations on the Trammel map. Is this intended? If this is based on "young status" as it looks to be the case from looking over the script; how do you disable young status on an account?
 

Soulmancer

Sorceror
Look where he told you to, you'll see where the starting city is.

I see that, starting city new haven in trammel. But are you not able to make use of the city selection on the starting screen? Also shouldn't a necromancer start in Umbra and a Paladin in Luna; it does indicate that below? I have selected both and they start in New Haven... Is this due to young status or is this always the case by default regardless of account age?
 

Pure Insanity

Sorceror
You can use the client selection screen by commenting out the starting out location, you can enable the server side client selection by enabling that below also.
 

Wis Weed

Sorceror
I couldn't make any sense of that. I found this at line 700ish:

CityInfo city = GetStartLocation( args,young );

I changes it to this:

//CityInfo city = GetStartLocation( args,young );
CityInfo city = new CityInfo( "Britain", "The Wayfarer's Inn", 1602, 1591, 20, Map.Felucca )

The "//" make the first line become ignored.
The second line sends the player to brit.

My question is:
How can I make the players spawn from the city they choose on the map during the character creation portion?
 

Thagoras

Sorceror
CityInfo city = GetStartLocation( args,young );

I changes it to this:

//CityInfo city = GetStartLocation( args,young );
CityInfo city = new CityInfo( "Britain", "The Wayfarer's Inn", 1602, 1591, 20, Map.Felucca )

If you would have looked a little farther, you would have come across the module named GetStartLocation. This is what mine currently is. I took a few liberties, but I made sure that certain professions started in their proper locations.
Code:
 private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
 {
/* if( Core.ML )
 {
 //if( args.State != null && args.State.Version >= m_NewHavenClient )
 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;

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

 switch ( args.Profession )
 {
 case 1: //Warrior
 {
 if ( (flags & 0x8) != 0 )
 {
 return new CityInfo( "Jhelom", "First Defense", 1377, 3718, 0, Map.Trammel );
 }
 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 2: //Magician
 {
 if ( (flags & 0x8) != 0 )
 {
 return new CityInfo( "Moonglow", "The Scholar's Inn", 4400, 1172, 0, Map.Trammel );
 }
 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 3: //Blacksmith
 {
 if ( (flags & 0x8) != 0 )
 {
 return new CityInfo( "Minoc", "Warriors' Battle Gear", 2519, 587, 0, Map.Trammel );
 }
 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 4: //Necro
 {
 if ( (flags & 0x8) != 0 )
 {
 return new CityInfo( "Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas );
 }
 else
 {
 useHaven = true; 

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

 break;
 }
 case 5: //Paladin
 {
 if ( (flags & 0x8) != 0 )
 {
 return new CityInfo( "Luna", "Inner Wall", 1014, 510, -70, 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;
 //return m_NewHavenInfo;
 }
 case 6: //Samurai
 {
 if ( (flags & 0x10) != 0 )
 {
 return new CityInfo( "Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas );
 }
 else
 {
 useHaven = true;

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

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

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

 break;
 }
 }

 if( useHaven )
 return m_NewHavenInfo;
 else
 return args.City;
  }

And after seeing this again, I realize that it's rather messy and many of these BadStartMessages are unnecessary....but you should get the idea.
 

Wis Weed

Sorceror
Thank you, Thagoras. Awesome help! I can see how to make the certain professions (case 3: //Blacksmith) have you start out in certain cities ("Minoc"). I see case 1-7 (mage, ninja, samurai, etc.). Great info!

1.) Now my question is concerning players that choose to customize their skills/sats by choosing "advanced" option. "Advanced" is the 8th option aside from mage, ninja, samurai, etc. How do I allow a new player to choose advanced and THEN choose to start in Yew, Skara Brae, Brit or where ever they choose on the map during character creation?

By making the change I posted earlier, they are all starting out in Brit and NOT New Haven. That's good enough, but not perfect.

2.) My second question is how to disable Ninja, Samurai, and Paladin while keeping the other 5 options available.
 

Thagoras

Sorceror
2.) My second question is how to disable Ninja, Samurai, and Paladin while keeping the other 5 options available

I FOUND IT!!!!
You WOULD have to modify CharacterCreation.cs so it synchronizes with these changes, but here it is.

If you look in your UO folder, you will find a file named Prof.txt. The file contains 7 entries, the first looking like this
Begin
Name Samurai
TrueName "Samurai"
NameId 1062948
DescId 1062950
Desc 6
TopLevel true
Gump 5591
Type Profession
Skill Bushido 50
Skill Swordsmanship 50
Skill Wrestling 0
Stat Str 40
Stat Dex 30
Stat Int 10
End

Through deduction I will attempt to explain the entries.
Name, TrueName - Not sure. We could probably assume that Name is the Variable name while TrueName is the string name?
NameId, DescId - These are the CliLoc listings.
Desc - This is the Profession number which is used in CharacterCreation...but can override the NameId if you use duplicate numbers.
TopLevel - Not sure
Gump - This is the Decimal reference of the round samurai symbol gump.
Type - As all these listings are "Profession", we could probably assume to always use profession...even though, by having this listed at all, it would imply that there may be other types.
Skill, Stat - Pretty clear here.

Now, as to how to disable them.... by analyzing the CharacterCreation it appears that you need to have some choices made, one way or other because it needs some return values. But if you rename, delete or bak the Prof.txt file (just rename the .txt to .offtxt) you only have the "Advanced" option to select. You shouldn't have more than 7 entries, but you can have fewer.
 

Wis Weed

Sorceror
Man, thank you so much for your work on this.

I have removed the professions like you instructed. It works perfectly on my computer, but when i go to log on from a separate IP (2nd computer) it still allows the new player to pick samurai, ninja, and paladin still. I assume this is why you instructed me to "modify CharacterCreation.cs so it synchronizes with these changes." I just don't know how to do that yet. I'm beginning a forums search now.

Thanks again, Thagoras!
 

Thagoras

Sorceror
Each client that connects to the server would need to have Prof.txt removed too. However, that file is merely a way to choose a template rather than having to customize your character and it's really no big deal to have it. The important part, as with your original question, is starting location. If you decide to modify the Prof.txt and change the profession list (as I'm debating now), you just need to make sure that you send the player to a location that matches their choice. Ninja and Samurai were sent to different unique locations to teach players how to use the new skills. These were locations which were ONLY available to starting ninja or samurai. You could choose advanced and choose ninjitsu or bushido but it would still send you to new haven. Necromancer and Paladin used to send you to umbra and luna. As the other professions sent you to locations which were to their liking. Now, however, everyone is sent to New Haven...which is why I wanted to change my start locations. Just so long as you changed the starting location to what you want, each player should start there. I don't know that profession is used again for anything else in game.
 

Pure Insanity

Sorceror
Man, thank you so much for your work on this.

I have removed the professions like you instructed. It works perfectly on my computer, but when i go to log on from a separate IP (2nd computer) it still allows the new player to pick samurai, ninja, and paladin still. I assume this is why you instructed me to "modify CharacterCreation.cs so it synchronizes with these changes." I just don't know how to do that yet. I'm beginning a forums search now.

Thanks again, Thagoras!

If you patch that file to your players, then it will effect everyone. Just patch the modded file, you can't patch a "deleted" file. Remove what you want, then patch it to all the players. Atm patching is a bitch, but maybe in a few months CUO will be back to make it easier again.
 

Wis Weed

Sorceror
One last question, sry.

I have the file edited perfectly, thanks to other's advice.

Now, how do I patch a file to all players? Is that an in-game command that I type on my Owner account or do I do it out of game-play?

(i'm new if you can't tell)
 

Pure Insanity

Sorceror
You'd have to make a patch of the client modded files, pack them in an archived file and issue them out to your players. Since CUO isn't working, they'd have to patch their clients manually. Which would mess it up if they want to play another server too.
 

Talow

Sorceror
CUO is not currently functional, that means you are looking at having to have your players patch manualy.
 

Wis Weed

Sorceror
1.)

4.) Where do I change the rate of stat/skill gain?
In SkillCheck.cs.

What line controls the rate of stat gain?

I found this at line 339:

private static TimeSpan m_StatGainDelay = TimeSpan.FromMinutes( 2.0 );
private static TimeSpan m_PetStatGainDelay = TimeSpan.FromMinutes( 2.0 );

I changed both of the numbers to 2 mins (from 15.0 and 7.0), but this didn't seem to change anything.
 

Thagoras

Sorceror
I believe that what you want is here
Code:
 public static void Gain( Mobile from, Skill skill )
 {
 if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
 return;

 if ( from is BaseCreature && ((BaseCreature)from).IsDeadPet )
 return;

 if ( skill.SkillName == SkillName.Focus && from is BaseCreature )
 return;

 if ( skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
 {
  int toGain = 1;

That last line, I believe, is what you'd need to change. There are a few more references to toGain which would need to be adjusted too.

HOWEVER, there is this line too. Found in the CheckSkill module.
Code:
            gc *= skill.Info.GainFactor;
which pulls data from the core files. Each of these skills' GainFactor is 1.0. When you multiply any number by 1 you get that number, if you're following my logic.

So try this first.
Code:
            gc *= (skill.Info.GainFactor +1) ;
This should effectively double your rate of gain.
 
Top