fix: Creates new staff properly on creation (#1830)
This commit is contained in:
parent
9847efbb1a
commit
cf4c8a9b71
1 changed files with 49 additions and 36 deletions
|
|
@ -224,53 +224,66 @@ 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;
|
|
||||||
|
|
||||||
if (newChar is PlayerMobile pm)
|
|
||||||
{
|
|
||||||
pm.Profession = args.Profession;
|
|
||||||
|
|
||||||
if (pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young)
|
|
||||||
{
|
|
||||||
young = pm.Young = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SetName(newChar, args.Name);
|
SetName(newChar, args.Name);
|
||||||
|
|
||||||
newChar.AddBackpack();
|
newChar.AddBackpack();
|
||||||
|
|
||||||
SetStats(newChar, state, args.Stats, args.Profession);
|
if (newChar.AccessLevel == AccessLevel.Player)
|
||||||
SetSkills(newChar, args.Skills, args.Profession, args.ShirtHue, args.PantsHue);
|
|
||||||
|
|
||||||
var race = newChar.Race;
|
|
||||||
|
|
||||||
if (race.ValidateHair(newChar, args.HairID))
|
|
||||||
{
|
{
|
||||||
newChar.HairItemID = args.HairID;
|
var race = Core.Expansion >= args.Race.RequiredExpansion ? args.Race : Race.DefaultRace;
|
||||||
newChar.HairHue = race.ClipHairHue(args.HairHue & 0x3FFF);
|
newChar.Race = race;
|
||||||
|
|
||||||
|
if (newChar is PlayerMobile pm)
|
||||||
|
{
|
||||||
|
pm.Profession = args.Profession;
|
||||||
|
|
||||||
|
if (((Account)pm.Account).Young)
|
||||||
|
{
|
||||||
|
pm.Young = true;
|
||||||
|
|
||||||
|
newChar.BankBox.DropItem(new NewPlayerTicket
|
||||||
|
{
|
||||||
|
Owner = newChar
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SetStats(newChar, state, args.Stats, args.Profession);
|
||||||
|
SetSkills(newChar, args.Skills, args.Profession, args.ShirtHue, args.PantsHue);
|
||||||
|
|
||||||
|
if (race.ValidateHair(newChar, args.HairID))
|
||||||
|
{
|
||||||
|
newChar.HairItemID = args.HairID;
|
||||||
|
newChar.HairHue = race.ClipHairHue(args.HairHue & 0x3FFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (race.ValidateFacialHair(newChar, args.BeardID))
|
||||||
|
{
|
||||||
|
newChar.FacialHairItemID = args.BeardID;
|
||||||
|
newChar.FacialHairHue = race.ClipHairHue(args.BeardHue & 0x3FFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TestCenter.Enabled)
|
||||||
|
{
|
||||||
|
TestCenter.FillBankbox(newChar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (race.ValidateFacialHair(newChar, args.BeardID))
|
|
||||||
{
|
{
|
||||||
newChar.FacialHairItemID = args.BeardID;
|
newChar.Str = 100;
|
||||||
newChar.FacialHairHue = race.ClipHairHue(args.BeardHue & 0x3FFF);
|
newChar.Int = 100;
|
||||||
}
|
newChar.Dex = 100;
|
||||||
|
|
||||||
if (TestCenter.Enabled)
|
for (var i = 0; i < newChar.Skills.Length; i++)
|
||||||
{
|
{
|
||||||
TestCenter.FillBankbox(newChar);
|
newChar.Skills[i].BaseFixedPoint = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (young)
|
newChar.Race = Race.Human;
|
||||||
{
|
newChar.Blessed = true;
|
||||||
var ticket = new NewPlayerTicket();
|
newChar.AddItem(new StaffRobe(newChar.AccessLevel));
|
||||||
ticket.Owner = newChar;
|
|
||||||
newChar.BankBox.DropItem(ticket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var city = GetStartLocation(args);
|
var city = GetStartLocation(args);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue