Enabling locked expansions?

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Damien.
Journeyman Poster
Posts: 63
Joined: Thu Feb 08, 2007 11:14 am

Enabling locked expansions?

Post by Damien. »

I was trying to enable the ML expansion so I could choose "Ninja" and the Elf Race at character creation, but there seems to be a lot of trouble.. This is what I get while trying to choose "Ninja":
Image

I have mentioned it in IRC too, and I did some test, however all without result. So I made a topic instead, with the thought that someone else would find this topic necessary.

I did try to edit the OnCreate script by adding every one of these function (Obviously not at the same time):

Code: Select all

char.acct.set_uo_expansion("ML"); also tried "SE"..
character.acct.set_uo_expansion("ML");
account.set_uo_expansion("ML");
acct.set_uo_expansion("ML"); 
(Like this would do any difference duh :p )
Someone also mentioned to be that I would need to add UOEnableFeature in servspecopt.cfg, so I give it a try, but again without success.. These are the options I tried:

Code: Select all

UOFeatureEnable=0x20 (AOS features) - Also changed InvulTag = 1 -> 2 as it's mentioning is necessary.
UOFeatureEnable=0x40 (SE expansion)
UOFeatureEnable=0x1a8 (Mondain's Legacy + Popups)
I tried them alone and combined them with the code from OnCreate, everything without any result.
Where the hell am I doing wrong? :o
Using POL098 RC2. Mondain's Legacy. Client 6.0.13.0

Thanks.
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Enabling locked expansions?

Post by Pierce »

When you choose the ML options you posted, did you take a look
into the accounts.txt data file if the following appear on that account:

Code: Select all

Account
{
	Name	.......
	Password	.......
	PasswordHash	......
	PasswordOnlyHash	......
	Enabled	1
	Banned	0
	UOExpansion	ML
	......
	......
If not you should perhaps try something like (with UOFeatureEnable=0x1a8):

Code: Select all

 var acc := FindAccount( who.acctname );
 acc.set_uo_expansion("ML");
or if even that don't work try it with UOFeatureEnable=0x1a0 in case the popups are responsible for it.
Damien.
Journeyman Poster
Posts: 63
Joined: Thu Feb 08, 2007 11:14 am

Re: Enabling locked expansions?

Post by Damien. »

A huge thanks for your post Pierce! :D
It sure does set the UOExpansion to ML after adding this (before it was T2A), but there is a problem...
Since the code is placed in OnCreate.src it wont work the first time you create an character...
The first time you create a character you cannot choose Ninja or Samurai but yet must choose the T2A classes.
After choosing one of these classes and creating a character, first then it will set the account UOExpansion to ML.
So to create an Samurai/Ninja or Elf you first need to create a T2A class character and then logoff, create another character and voila, you can choose the Ninja/Samurai and to be an Elf.. So my following question is:
What shall I do to make it possible to create an Ninja as the first character of an account?

Tried both:
UOFeatureEnable=0x1a8
UOFeatureEnable=0x1a0


Thanks!
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Enabling locked expansions?

Post by CWO »

Handle it when the account is created.
Damien.
Journeyman Poster
Posts: 63
Joined: Thu Feb 08, 2007 11:14 am

Re: Enabling locked expansions?

Post by Damien. »

Oh my.. thanks.
Systems -> Accounts -> Include ->Accounts.inc

Code: Select all

function CreateNewAccount(username, password, cmdlevel:=0, expansion:="", email:="")
	var account := CreateAccount(username, password, 1);
	if ( account.errortext )
		return account;
	endif

	if ( cmdlevel )
		account.SetDefaultCmdLevel(CInt(cmdlevel));
	endif

	if ( expansion )
		account.Set_UO_Expansion(expansion);
	endif

	if ( email )
		account.SetProp("EMail", email);
	endif

	ACCT_SetLastLogin(account);

	return account;
endfunction
-> account.Set_UO_Expansion("ML");

Working excellent! Thank you.
Post Reply