Working on a method for the account object:
account.AddCharacter(index)
* If you use .AddCharacter() you get an error saying you need to assign an index.
* If Index is 0 (.AddCharacter(0)), it will find the next available slot on the account. (Otherwise pass 1-5)
* If no slots are available, you get an error.
* If the slot passed is taken, you get an error.
Otherwise it makes a blank character named "new character"
Its graphic 400 (naked male) colored 0, no items etc. Kinda looks like Neo when he got flushed out of that matrix pod.
Its placed at x1, y1, z1 of the britannia realm.
You gotta equip it, color it, etc. yourself in the script that makes it.
It does not run scripts/misc/oncreate.ecl (may change..)
Return value is the character idx slot that it was assigned to.
So to access the newly created character you would do..
Code:
var result := account.AddCharacter(0);
if ( result.errortext )
Print("Something went wrong ->"+result.errortext);
return 0;
endif
var character := account.GetCharacter(result);
//Character setup code here.