fix: Creates new staff properly on creation (#1830)

This commit is contained in:
Kamron Batman 2024-06-09 12:26:22 -07:00 • committed by GitHub
parent 9847efbb1a
commit cf4c8a9b71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -224,31 +224,35 @@ public static class CharacterCreation
newChar.Player = true; newChar.Player = true;
newChar.AccessLevel = args.Account.AccessLevel; newChar.AccessLevel = args.Account.AccessLevel;
newChar.Female = args.Female; newChar.Female = args.Female;
newChar.Race = Core.Expansion >= args.Race.RequiredExpansion ? args.Race : Race.DefaultRace;
newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;
newChar.Hunger = 20; newChar.Hunger = 20;
var young = false; SetName(newChar, args.Name);
newChar.AddBackpack();
if (newChar.AccessLevel == AccessLevel.Player)
{
var race = Core.Expansion >= args.Race.RequiredExpansion ? args.Race : Race.DefaultRace;
newChar.Race = race;
if (newChar is PlayerMobile pm) if (newChar is PlayerMobile pm)
{ {
pm.Profession = args.Profession; pm.Profession = args.Profession;
if (pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young) if (((Account)pm.Account).Young)
{ {
young = pm.Young = true; pm.Young = true;
newChar.BankBox.DropItem(new NewPlayerTicket
{
Owner = newChar
});
} }
} }
SetName(newChar, args.Name);
newChar.AddBackpack();
SetStats(newChar, state, args.Stats, args.Profession); SetStats(newChar, state, args.Stats, args.Profession);
SetSkills(newChar, args.Skills, args.Profession, args.ShirtHue, args.PantsHue); SetSkills(newChar, args.Skills, args.Profession, args.ShirtHue, args.PantsHue);
var race = newChar.Race;
if (race.ValidateHair(newChar, args.HairID)) if (race.ValidateHair(newChar, args.HairID))
{ {
newChar.HairItemID = args.HairID; newChar.HairItemID = args.HairID;
@ -265,12 +269,21 @@ public static class CharacterCreation
{ {
TestCenter.FillBankbox(newChar); TestCenter.FillBankbox(newChar);
} }
}
if (young) else
{ {
var ticket = new NewPlayerTicket(); newChar.Str = 100;
ticket.Owner = newChar; newChar.Int = 100;
newChar.BankBox.DropItem(ticket); newChar.Dex = 100;
for (var i = 0; i < newChar.Skills.Length; i++)
{
newChar.Skills[i].BaseFixedPoint = 1000;
}
newChar.Race = Race.Human;
newChar.Blessed = true;
newChar.AddItem(new StaffRobe(newChar.AccessLevel));
} }
var city = GetStartLocation(args); var city = GetStartLocation(args);