Core/Players: Implemented new talent system

Port From (https://github.com/TrinityCore/TrinityCore/commit/0cc5ab8372f19dad7412038d52dcd39db5e0e171)
This commit is contained in:
hondacrx
2023-01-04 02:50:40 -05:00
parent 0bfc448595
commit 55da7dc549
24 changed files with 3168 additions and 532 deletions
+49 -1
View File
@@ -275,6 +275,7 @@ namespace Game.DataStorage
SceneScriptTextStorage = ReadDB2<SceneScriptTextRecord>("SceneScriptText.db2", HotfixStatements.SEL_SCENE_SCRIPT_TEXT);
SkillLineStorage = ReadDB2<SkillLineRecord>("SkillLine.db2", HotfixStatements.SEL_SKILL_LINE, HotfixStatements.SEL_SKILL_LINE_LOCALE);
SkillLineAbilityStorage = ReadDB2<SkillLineAbilityRecord>("SkillLineAbility.db2", HotfixStatements.SEL_SKILL_LINE_ABILITY);
SkillLineXTraitTreeStorage = ReadDB2<SkillLineXTraitTreeRecord>("SkillLineXTraitTree.db2", HotfixStatements.SEL_SKILL_LINE_X_TRAIT_TREE);
SkillRaceClassInfoStorage = ReadDB2<SkillRaceClassInfoRecord>("SkillRaceClassInfo.db2", HotfixStatements.SEL_SKILL_RACE_CLASS_INFO);
SoulbindConduitRankStorage = ReadDB2<SoulbindConduitRankRecord>("SoulbindConduitRank.db2", HotfixStatements.SEL_SOULBIND_CONDUIT_RANK);
SoundKitStorage = ReadDB2<SoundKitRecord>("SoundKit.db2", HotfixStatements.SEL_SOUND_KIT);
@@ -326,6 +327,29 @@ namespace Game.DataStorage
TaxiPathNodeStorage = ReadDB2<TaxiPathNodeRecord>("TaxiPathNode.db2", HotfixStatements.SEL_TAXI_PATH_NODE);
TotemCategoryStorage = ReadDB2<TotemCategoryRecord>("TotemCategory.db2", HotfixStatements.SEL_TOTEM_CATEGORY, HotfixStatements.SEL_TOTEM_CATEGORY_LOCALE);
ToyStorage = ReadDB2<ToyRecord>("Toy.db2", HotfixStatements.SEL_TOY, HotfixStatements.SEL_TOY_LOCALE);
TraitCondStorage = ReadDB2<TraitCondRecord>("TraitCond.db2", HotfixStatements.SEL_TRAIT_COND);
TraitCostStorage = ReadDB2<TraitCostRecord>("TraitCost.db2", HotfixStatements.SEL_TRAIT_COST);
TraitCurrencyStorage = ReadDB2<TraitCurrencyRecord>("TraitCurrency.db2", HotfixStatements.SEL_TRAIT_CURRENCY);
TraitCurrencySourceStorage = ReadDB2<TraitCurrencySourceRecord>("TraitCurrencySource.db2", HotfixStatements.SEL_TRAIT_CURRENCY_SOURCE, HotfixStatements.SEL_TRAIT_CURRENCY_SOURCE_LOCALE);
TraitDefinitionStorage = ReadDB2<TraitDefinitionRecord>("TraitDefinition.db2", HotfixStatements.SEL_TRAIT_DEFINITION, HotfixStatements.SEL_TRAIT_DEFINITION_LOCALE);
TraitDefinitionEffectPointsStorage = ReadDB2<TraitDefinitionEffectPointsRecord>("TraitDefinitionEffectPoints.db2", HotfixStatements.SEL_TRAIT_DEFINITION_EFFECT_POINTS);
TraitEdgeStorage = ReadDB2<TraitEdgeRecord>("TraitEdge.db2", HotfixStatements.SEL_TRAIT_EDGE);
TraitNodeStorage = ReadDB2<TraitNodeRecord>("TraitNode.db2", HotfixStatements.SEL_TRAIT_NODE);
TraitNodeEntryStorage = ReadDB2<TraitNodeEntryRecord>("TraitNodeEntry.db2", HotfixStatements.SEL_TRAIT_NODE_ENTRY);
TraitNodeEntryXTraitCondStorage = ReadDB2<TraitNodeEntryXTraitCondRecord>("TraitNodeEntryXTraitCond.db2", HotfixStatements.SEL_TRAIT_NODE_ENTRY_X_TRAIT_COND);
TraitNodeEntryXTraitCostStorage = ReadDB2<TraitNodeEntryXTraitCostRecord>("TraitNodeEntryXTraitCost.db2", HotfixStatements.SEL_TRAIT_NODE_ENTRY_X_TRAIT_COST);
TraitNodeGroupStorage = ReadDB2<TraitNodeGroupRecord>("TraitNodeGroup.db2", HotfixStatements.SEL_TRAIT_NODE_GROUP);
TraitNodeGroupXTraitCondStorage = ReadDB2<TraitNodeGroupXTraitCondRecord>("TraitNodeGroupXTraitCond.db2", HotfixStatements.SEL_TRAIT_NODE_GROUP_X_TRAIT_COND);
TraitNodeGroupXTraitCostStorage = ReadDB2<TraitNodeGroupXTraitCostRecord>("TraitNodeGroupXTraitCost.db2", HotfixStatements.SEL_TRAIT_NODE_GROUP_X_TRAIT_COST);
TraitNodeGroupXTraitNodeStorage = ReadDB2<TraitNodeGroupXTraitNodeRecord>("TraitNodeGroupXTraitNode.db2", HotfixStatements.SEL_TRAIT_NODE_GROUP_X_TRAIT_NODE);
TraitNodeXTraitCondStorage = ReadDB2<TraitNodeXTraitCondRecord>("TraitNodeXTraitCond.db2", HotfixStatements.SEL_TRAIT_NODE_X_TRAIT_COND);
TraitNodeXTraitCostStorage = ReadDB2<TraitNodeXTraitCostRecord>("TraitNodeXTraitCost.db2", HotfixStatements.SEL_TRAIT_NODE_X_TRAIT_COST);
TraitNodeXTraitNodeEntryStorage = ReadDB2<TraitNodeXTraitNodeEntryRecord>("TraitNodeXTraitNodeEntry.db2", HotfixStatements.SEL_TRAIT_NODE_X_TRAIT_NODE_ENTRY);
TraitTreeStorage = ReadDB2<TraitTreeRecord>("TraitTree.db2", HotfixStatements.SEL_TRAIT_TREE);
TraitTreeLoadoutStorage = ReadDB2<TraitTreeLoadoutRecord>("TraitTreeLoadout.db2", HotfixStatements.SEL_TRAIT_TREE_LOADOUT);
TraitTreeLoadoutEntryStorage = ReadDB2<TraitTreeLoadoutEntryRecord>("TraitTreeLoadoutEntry.db2", HotfixStatements.SEL_TRAIT_TREE_LOADOUT_ENTRY);
TraitTreeXTraitCostStorage = ReadDB2<TraitTreeXTraitCostRecord>("TraitTreeXTraitCost.db2", HotfixStatements.SEL_TRAIT_TREE_X_TRAIT_COST);
TraitTreeXTraitCurrencyStorage = ReadDB2<TraitTreeXTraitCurrencyRecord>("TraitTreeXTraitCurrency.db2", HotfixStatements.SEL_TRAIT_TREE_X_TRAIT_CURRENCY);
TransmogHolidayStorage = ReadDB2<TransmogHolidayRecord>("TransmogHoliday.db2", HotfixStatements.SEL_TRANSMOG_HOLIDAY);
TransmogIllusionStorage = ReadDB2<TransmogIllusionRecord>("TransmogIllusion.db2", HotfixStatements.SEL_TRANSMOG_ILLUSION);
TransmogSetStorage = ReadDB2<TransmogSetRecord>("TransmogSet.db2", HotfixStatements.SEL_TRANSMOG_SET, HotfixStatements.SEL_TRANSMOG_SET_LOCALE);
@@ -674,6 +698,7 @@ namespace Game.DataStorage
public static DB6Storage<SceneScriptTextRecord> SceneScriptTextStorage;
public static DB6Storage<SkillLineRecord> SkillLineStorage;
public static DB6Storage<SkillLineAbilityRecord> SkillLineAbilityStorage;
public static DB6Storage<SkillLineXTraitTreeRecord> SkillLineXTraitTreeStorage;
public static DB6Storage<SkillRaceClassInfoRecord> SkillRaceClassInfoStorage;
public static DB6Storage<SoulbindConduitRankRecord> SoulbindConduitRankStorage;
public static DB6Storage<SoundKitRecord> SoundKitStorage;
@@ -725,6 +750,29 @@ namespace Game.DataStorage
public static DB6Storage<TaxiPathNodeRecord> TaxiPathNodeStorage;
public static DB6Storage<TotemCategoryRecord> TotemCategoryStorage;
public static DB6Storage<ToyRecord> ToyStorage;
public static DB6Storage<TraitCondRecord> TraitCondStorage;
public static DB6Storage<TraitCostRecord> TraitCostStorage;
public static DB6Storage<TraitCurrencyRecord> TraitCurrencyStorage;
public static DB6Storage<TraitCurrencySourceRecord> TraitCurrencySourceStorage;
public static DB6Storage<TraitDefinitionRecord> TraitDefinitionStorage;
public static DB6Storage<TraitDefinitionEffectPointsRecord> TraitDefinitionEffectPointsStorage;
public static DB6Storage<TraitEdgeRecord> TraitEdgeStorage;
public static DB6Storage<TraitNodeRecord> TraitNodeStorage;
public static DB6Storage<TraitNodeEntryRecord> TraitNodeEntryStorage;
public static DB6Storage<TraitNodeEntryXTraitCondRecord> TraitNodeEntryXTraitCondStorage;
public static DB6Storage<TraitNodeEntryXTraitCostRecord> TraitNodeEntryXTraitCostStorage;
public static DB6Storage<TraitNodeGroupRecord> TraitNodeGroupStorage;
public static DB6Storage<TraitNodeGroupXTraitCondRecord> TraitNodeGroupXTraitCondStorage;
public static DB6Storage<TraitNodeGroupXTraitCostRecord> TraitNodeGroupXTraitCostStorage;
public static DB6Storage<TraitNodeGroupXTraitNodeRecord> TraitNodeGroupXTraitNodeStorage;
public static DB6Storage<TraitNodeXTraitCondRecord> TraitNodeXTraitCondStorage;
public static DB6Storage<TraitNodeXTraitCostRecord> TraitNodeXTraitCostStorage;
public static DB6Storage<TraitNodeXTraitNodeEntryRecord> TraitNodeXTraitNodeEntryStorage;
public static DB6Storage<TraitTreeRecord> TraitTreeStorage;
public static DB6Storage<TraitTreeLoadoutRecord> TraitTreeLoadoutStorage;
public static DB6Storage<TraitTreeLoadoutEntryRecord> TraitTreeLoadoutEntryStorage;
public static DB6Storage<TraitTreeXTraitCostRecord> TraitTreeXTraitCostStorage;
public static DB6Storage<TraitTreeXTraitCurrencyRecord> TraitTreeXTraitCurrencyStorage;
public static DB6Storage<TransmogHolidayRecord> TransmogHolidayStorage;
public static DB6Storage<TransmogIllusionRecord> TransmogIllusionStorage;
public static DB6Storage<TransmogSetRecord> TransmogSetStorage;
@@ -874,7 +922,7 @@ namespace Game.DataStorage
{
return row.Wins * row.Xp;
}
public static float GetIlvlStatMultiplier(GtGenericMultByILvlRecord row, InventoryType invType)
{
switch (invType)
+9 -4
View File
@@ -1985,19 +1985,24 @@ namespace Game.DataStorage
public SkillRaceClassInfoRecord GetSkillRaceClassInfo(uint skill, Race race, Class class_)
{
var bounds = _skillRaceClassInfoBySkill.LookupByKey(skill);
foreach (var record in bounds)
foreach (var skllRaceClassInfo in bounds)
{
if (record.RaceMask != 0 && !Convert.ToBoolean(record.RaceMask & SharedConst.GetMaskForRace(race)))
if (skllRaceClassInfo.RaceMask != 0 && !Convert.ToBoolean(skllRaceClassInfo.RaceMask & SharedConst.GetMaskForRace(race)))
continue;
if (record.ClassMask != 0 && !Convert.ToBoolean(record.ClassMask & (1 << ((byte)class_ - 1))))
if (skllRaceClassInfo.ClassMask != 0 && !Convert.ToBoolean(skllRaceClassInfo.ClassMask & (1 << ((byte)class_ - 1))))
continue;
return record;
return skllRaceClassInfo;
}
return null;
}
public List<SkillRaceClassInfoRecord> GetSkillRaceClassInfo(uint skill)
{
return _skillRaceClassInfoBySkill.LookupByKey(skill);
}
public SoulbindConduitRankRecord GetSoulbindConduitRank(int soulbindConduitId, int rank)
{
return _soulbindConduitRanks.LookupByKey(Tuple.Create(soulbindConduitId, rank));
+1 -1
View File
@@ -292,7 +292,7 @@ namespace Game.DataStorage
public sealed class ChrSpecializationRecord
{
public string Name;
public LocalizedString Name;
public string FemaleName;
public string Description;
public uint Id;
@@ -124,6 +124,14 @@ namespace Game.DataStorage
public ushort SkillupSkillLineID;
}
public sealed class SkillLineXTraitTreeRecord
{
public uint Id;
public int SkillLineID;
public int TraitTreeID;
public int OrderIndex;
}
public sealed class SkillRaceClassInfoRecord
{
public uint Id;
+217 -2
View File
@@ -103,6 +103,222 @@ namespace Game.DataStorage
public int RequiredTransmogHoliday;
}
public sealed class TraitCondRecord
{
public uint Id;
public int CondType;
public int TraitTreeID;
public int GrantedRanks;
public uint QuestID;
public uint AchievementID;
public int SpecSetID;
public int TraitNodeGroupID;
public int TraitNodeID;
public int TraitCurrencyID;
public int SpentAmountRequired;
public int Flags;
public int RequiredLevel;
public int FreeSharedStringID;
public int SpendMoreSharedStringID;
public TraitConditionType GetCondType() { return (TraitConditionType)CondType; }
}
public sealed class TraitCostRecord
{
public string InternalName;
public uint Id;
public int Amount;
public int TraitCurrencyID;
}
public sealed class TraitCurrencyRecord
{
public uint Id;
public int Type;
public int CurrencyTypesID;
public int Flags;
public int Icon;
public TraitCurrencyType GetCurrencyType() { return (TraitCurrencyType)Type; }
}
public sealed class TraitCurrencySourceRecord
{
public LocalizedString Requirement;
public uint Id;
public int TraitCurrencyID;
public int Amount;
public uint QuestID;
public uint AchievementID;
public uint PlayerLevel;
public int TraitNodeEntryID;
public int OrderIndex;
}
public sealed class TraitDefinitionRecord
{
public LocalizedString OverrideName;
public LocalizedString OverrideSubtext;
public LocalizedString OverrideDescription;
public uint Id;
public uint SpellID;
public int OverrideIcon;
public uint OverridesSpellID;
public uint VisibleSpellID;
}
public sealed class TraitDefinitionEffectPointsRecord
{
public uint Id;
public int TraitDefinitionID;
public int EffectIndex;
public int OperationType;
public int CurveID;
public TraitPointsOperationType GetOperationType() { return (TraitPointsOperationType)OperationType; }
}
public sealed class TraitEdgeRecord
{
public uint Id;
public int VisualStyle;
public int LeftTraitNodeID;
public int RightTraitNodeID;
public int Type;
}
public sealed class TraitNodeRecord
{
public uint Id;
public int TraitTreeID;
public int PosX;
public int PosY;
public sbyte Type;
public int Flags;
public TraitNodeType GetNodeType() { return (TraitNodeType)Type; }
}
public sealed class TraitNodeEntryRecord
{
public uint Id;
public int TraitDefinitionID;
public int MaxRanks;
public byte NodeRecordType;
}
public sealed class TraitNodeEntryXTraitCondRecord
{
public uint Id;
public int TraitCondID;
public uint TraitNodeEntryID;
}
public sealed class TraitNodeEntryXTraitCostRecord
{
public uint Id;
public int TraitNodeEntryID;
public int TraitCostID;
}
public sealed class TraitNodeGroupRecord
{
public uint Id;
public int TraitTreeID;
public int Flags;
}
public sealed class TraitNodeGroupXTraitCondRecord
{
public uint Id;
public int TraitCondID;
public int TraitNodeGroupID;
}
public sealed class TraitNodeGroupXTraitCostRecord
{
public uint Id;
public int TraitNodeGroupID;
public int TraitCostID;
}
public sealed class TraitNodeGroupXTraitNodeRecord
{
public uint Id;
public int TraitNodeGroupID;
public int TraitNodeID;
public int Index;
}
public sealed class TraitNodeXTraitCondRecord
{
public uint Id;
public int TraitCondID;
public int TraitNodeID;
}
public sealed class TraitNodeXTraitCostRecord
{
public uint Id;
public uint TraitNodeID;
public int TraitCostID;
}
public sealed class TraitNodeXTraitNodeEntryRecord
{
public uint Id;
public int TraitNodeID;
public int TraitNodeEntryID;
public int Index;
}
public sealed class TraitTreeRecord
{
public uint Id;
public int TraitSystemID;
public int Unused1000_1;
public int FirstTraitNodeID;
public int PlayerConditionID;
public int Flags;
public float Unused1000_2;
public float Unused1000_3;
public TraitTreeFlag GetFlags() { return (TraitTreeFlag)Flags; }
}
public sealed class TraitTreeLoadoutRecord
{
public uint Id;
public int TraitTreeID;
public int ChrSpecializationID;
}
public sealed class TraitTreeLoadoutEntryRecord
{
public uint Id;
public int TraitTreeLoadoutID;
public int SelectedTraitNodeID;
public int SelectedTraitNodeEntryID;
public int NumPoints;
public int OrderIndex;
}
public sealed class TraitTreeXTraitCostRecord
{
public uint Id;
public uint TraitTreeID;
public int TraitCostID;
}
public sealed class TraitTreeXTraitCurrencyRecord
{
public uint Id;
public int Index;
public int TraitTreeID;
public int TraitCurrencyID;
}
public sealed class TransmogIllusionRecord
{
public uint Id;
@@ -161,5 +377,4 @@ namespace Game.DataStorage
public uint TimeIndex;
public uint GameObjectsID;
}
}
}