fix: Updates professions & new player gargish equipment (#819)
* Now reads Prof.txt to get the professions * The templated professions are based on profession `TrueName` * Adds missing starting equipment * Implements gargish starting equipment * Consolidates some of the code * Moves TC stuff to the TC file. * Fixes some starting equipment that was wrong. Note: * Implementing the original T2A professions is possible on the client side, but requires moving the old clilocs to the current clilocs file. In the current file the entries are blank. * Using the original LBR professions (they match AOS but without necromancy/chivalry) is kind of confusing because the profession indexes are ripped out of the UOTD/UOR ones and have non-sequential indexes. This will probably cause confusion and people will get no templated items when they select the wrong profession.
This commit is contained in:
parent
7361c9158b
commit
bfbe2a6512
80 changed files with 2654 additions and 1409 deletions
|
|
@ -23,9 +23,9 @@ namespace Server
|
|||
public class CharacterCreatedEventArgs
|
||||
{
|
||||
public CharacterCreatedEventArgs(
|
||||
NetState state, IAccount a, string name, bool female, int hue, int str, int dex,
|
||||
int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue,
|
||||
int beardID, int beardHue, int profession, Race race
|
||||
NetState state, IAccount a, string name, bool female, int hue, StatNameValue[] stats, CityInfo city,
|
||||
SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue,
|
||||
int profession, Race race
|
||||
)
|
||||
{
|
||||
State = state;
|
||||
|
|
@ -33,9 +33,7 @@ namespace Server
|
|||
Name = name;
|
||||
Female = female;
|
||||
Hue = hue;
|
||||
Str = str;
|
||||
Dex = dex;
|
||||
Int = intel;
|
||||
Stats = stats;
|
||||
City = city;
|
||||
Skills = skills;
|
||||
ShirtHue = shirtHue;
|
||||
|
|
@ -60,11 +58,7 @@ namespace Server
|
|||
|
||||
public int Hue { get; }
|
||||
|
||||
public int Str { get; }
|
||||
|
||||
public int Dex { get; }
|
||||
|
||||
public int Int { get; }
|
||||
public StatNameValue[] Stats { get; }
|
||||
|
||||
public CityInfo City { get; }
|
||||
|
||||
|
|
@ -87,18 +81,8 @@ namespace Server
|
|||
public Race Race { get; }
|
||||
}
|
||||
|
||||
public struct SkillNameValue
|
||||
{
|
||||
public SkillName Name { get; }
|
||||
|
||||
public int Value { get; }
|
||||
|
||||
public SkillNameValue(SkillName name, int value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
public readonly record struct SkillNameValue(SkillName Name, int Value);
|
||||
public readonly record struct StatNameValue(StatType Name, int Value);
|
||||
|
||||
public static partial class EventSink
|
||||
{
|
||||
|
|
|
|||
|
|
@ -158,6 +158,30 @@ namespace Server
|
|||
|
||||
public class ExpansionInfo
|
||||
{
|
||||
public static string GetEraFolder(string parentDirectory)
|
||||
{
|
||||
var expansion = Core.Expansion;
|
||||
var folders = Directory.GetDirectories(
|
||||
parentDirectory,
|
||||
"*",
|
||||
new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive }
|
||||
);
|
||||
|
||||
while (expansion-- >= 0)
|
||||
{
|
||||
foreach (var folder in folders)
|
||||
{
|
||||
var di = new DirectoryInfo(folder);
|
||||
if (di.Name.InsensitiveEquals(expansion.ToString()))
|
||||
{
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static ExpansionInfo()
|
||||
{
|
||||
var path = Path.Combine(Core.BaseDirectory, "Data/expansion.json");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
using System.Runtime.InteropServices;
|
||||
|
|
@ -248,6 +249,17 @@ namespace Server
|
|||
{
|
||||
fullPath = Path.Combine(p, path);
|
||||
|
||||
if (IsLinux)
|
||||
{
|
||||
var fi = new FileInfo(fullPath);
|
||||
fullPath = fi.Directory!.EnumerateFiles(
|
||||
fi.Name,
|
||||
new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive }
|
||||
).FirstOrDefault()?.FullName;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -160,6 +160,8 @@ namespace Server.Network
|
|||
set => _packetEncoder = value;
|
||||
}
|
||||
|
||||
public int CurrentPacket { get; internal set; }
|
||||
|
||||
public bool SentFirstPacket { get; set; }
|
||||
|
||||
public bool BlockAllPackets { get; set; }
|
||||
|
|
|
|||
|
|
@ -73,40 +73,20 @@ namespace Server.Network
|
|||
|
||||
int genderRace = reader.ReadByte();
|
||||
|
||||
int str = reader.ReadByte();
|
||||
int dex = reader.ReadByte();
|
||||
int intl = reader.ReadByte();
|
||||
int is1 = reader.ReadByte();
|
||||
int vs1 = reader.ReadByte();
|
||||
int is2 = reader.ReadByte();
|
||||
int vs2 = reader.ReadByte();
|
||||
int is3 = reader.ReadByte();
|
||||
int vs3 = reader.ReadByte();
|
||||
var stats = new StatNameValue[]
|
||||
{
|
||||
new(StatType.Str, reader.ReadByte()),
|
||||
new(StatType.Dex, reader.ReadByte()),
|
||||
new(StatType.Int, reader.ReadByte())
|
||||
};
|
||||
|
||||
SkillNameValue[] skills;
|
||||
|
||||
// We have protocol changes by now, so this is ok
|
||||
var skills = new SkillNameValue[state.NewCharacterCreation ? 4 : 3];
|
||||
skills[0] = new SkillNameValue((SkillName)reader.ReadByte(), reader.ReadByte());
|
||||
skills[1] = new SkillNameValue((SkillName)reader.ReadByte(), reader.ReadByte());
|
||||
skills[2] = new SkillNameValue((SkillName)reader.ReadByte(), reader.ReadByte());
|
||||
if (state.NewCharacterCreation)
|
||||
{
|
||||
int is4 = reader.ReadByte();
|
||||
int vs4 = reader.ReadByte();
|
||||
|
||||
skills = new[]
|
||||
{
|
||||
new SkillNameValue((SkillName)is1, vs1),
|
||||
new SkillNameValue((SkillName)is2, vs2),
|
||||
new SkillNameValue((SkillName)is3, vs3),
|
||||
new SkillNameValue((SkillName)is4, vs4)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
skills = new[]
|
||||
{
|
||||
new SkillNameValue((SkillName)is1, vs1),
|
||||
new SkillNameValue((SkillName)is2, vs2),
|
||||
new SkillNameValue((SkillName)is3, vs3)
|
||||
};
|
||||
skills[3] = new SkillNameValue((SkillName)reader.ReadByte(), reader.ReadByte());
|
||||
}
|
||||
|
||||
int hue = reader.ReadUInt16();
|
||||
|
|
@ -171,9 +151,7 @@ namespace Server.Network
|
|||
name,
|
||||
female,
|
||||
hue,
|
||||
str,
|
||||
dex,
|
||||
intl,
|
||||
stats,
|
||||
info[cityIndex],
|
||||
skills,
|
||||
shirtHue,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<Delete Files="..\..\Distribution\zlib.dll" ContinueOnError="true" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.0" />
|
||||
<PackageReference Include="PollGroup" Version="1.1.0" />
|
||||
<PackageReference Include="Zlib.Bindings" Version="1.5.0" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Server.Network;
|
||||
|
||||
|
|
@ -384,7 +385,8 @@ namespace Server
|
|||
{
|
||||
public SkillInfo(
|
||||
int skillID, string name, double strScale, double dexScale, double intScale, string title,
|
||||
SkillUseCallback callback, double strGain, double dexGain, double intGain, double gainFactor
|
||||
SkillUseCallback callback, double strGain, double dexGain, double intGain, double gainFactor,
|
||||
string professionSkillName = null
|
||||
)
|
||||
{
|
||||
Name = name;
|
||||
|
|
@ -398,7 +400,7 @@ namespace Server
|
|||
DexGain = dexGain;
|
||||
IntGain = intGain;
|
||||
GainFactor = gainFactor;
|
||||
|
||||
ProfessionSkillName = professionSkillName ?? Name.Replace(" ", "");
|
||||
StatTotal = strScale + dexScale + intScale;
|
||||
}
|
||||
|
||||
|
|
@ -426,25 +428,27 @@ namespace Server
|
|||
|
||||
public double GainFactor { get; set; }
|
||||
|
||||
public string ProfessionSkillName { get; set; }
|
||||
|
||||
public static SkillInfo[] Table { get; set; } =
|
||||
{
|
||||
new(0, "Alchemy", 0.0, 5.0, 5.0, "Alchemist", null, 0.0, 0.5, 0.5, 1.0),
|
||||
new(1, "Anatomy", 0.0, 0.0, 0.0, "Biologist", null, 0.15, 0.15, 0.7, 1.0),
|
||||
new(2, "Animal Lore", 0.0, 0.0, 0.0, "Naturalist", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0, "ItemID"),
|
||||
new(4, "Arms Lore", 0.0, 0.0, 0.0, "Weapon Master", null, 0.75, 0.15, 0.1, 1.0),
|
||||
new(5, "Parrying", 7.5, 2.5, 0.0, "Duelist", null, 0.75, 0.25, 0.0, 1.0),
|
||||
new(6, "Begging", 0.0, 0.0, 0.0, "Beggar", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0),
|
||||
new(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0),
|
||||
new(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0, "Blacksmith"),
|
||||
new(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0, "Bowcraft"),
|
||||
new(9, "Peacemaking", 0.0, 0.0, 0.0, "Pacifier", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(10, "Camping", 20.0, 15.0, 15.0, "Explorer", null, 2.0, 1.5, 1.5, 1.0),
|
||||
new(11, "Carpentry", 20.0, 5.0, 0.0, "Carpenter", null, 2.0, 0.5, 0.0, 1.0),
|
||||
new(12, "Cartography", 0.0, 7.5, 7.5, "Cartographer", null, 0.0, 0.75, 0.75, 1.0),
|
||||
new(13, "Cooking", 0.0, 20.0, 30.0, "Chef", null, 0.0, 2.0, 3.0, 1.0),
|
||||
new(14, "Detecting Hidden", 0.0, 0.0, 0.0, "Scout", null, 0.0, 0.4, 0.6, 1.0),
|
||||
new(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0),
|
||||
new(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0, "Enticement"),
|
||||
new(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0, "EvaluateIntelligence"),
|
||||
new(17, "Healing", 6.0, 6.0, 8.0, "Healer", null, 0.6, 0.6, 0.8, 1.0),
|
||||
new(18, "Fishing", 0.0, 0.0, 0.0, "Fisherman", null, 0.5, 0.5, 0.0, 1.0),
|
||||
new(19, "Forensic Evaluation", 0.0, 0.0, 0.0, "Detective", null, 0.0, 0.2, 0.8, 1.0),
|
||||
|
|
@ -476,7 +480,7 @@ namespace Server
|
|||
new(45, "Mining", 20.0, 0.0, 0.0, "Miner", null, 2.0, 0.0, 0.0, 1.0),
|
||||
new(46, "Meditation", 0.0, 0.0, 0.0, "Stoic", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(47, "Stealth", 0.0, 0.0, 0.0, "Rogue", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0, "Disarm"),
|
||||
new(49, "Necromancy", 0.0, 0.0, 0.0, "Necromancer", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(50, "Focus", 0.0, 0.0, 0.0, "Driven", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(51, "Chivalry", 0.0, 0.0, 0.0, "Paladin", null, 0.0, 0.0, 0.0, 1.0),
|
||||
|
|
@ -892,16 +896,16 @@ namespace Server
|
|||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public SkillsEnumerator GetEnumerator() => new(m_Skills);
|
||||
public Enumerator GetEnumerator() => new(m_Skills);
|
||||
|
||||
public ref struct SkillsEnumerator
|
||||
public ref struct Enumerator
|
||||
{
|
||||
private readonly Skill[] _skills;
|
||||
private int _index;
|
||||
private Skill _current;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal SkillsEnumerator(Skill[] skills)
|
||||
internal Enumerator(Skill[] skills)
|
||||
{
|
||||
_skills = skills;
|
||||
_index = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue