Core/Achievements: Defined all modifier tree types and implemented many of them

Port From (https://github.com/TrinityCore/TrinityCore/commit/d0be92ec0ad0334c38b4073a7e24a571982b17da)
This commit is contained in:
hondacrx
2021-06-07 13:13:46 -04:00
parent 9c58042e07
commit 1941148d8f
18 changed files with 1677 additions and 674 deletions
+24
View File
@@ -2089,6 +2089,30 @@ namespace Game.Entities
}
}
public uint GetTotalUnlockedArtifactPowers()
{
uint purchased = GetTotalPurchasedArtifactPowers();
ulong artifactXp = m_itemData.ArtifactXP;
uint currentArtifactTier = GetModifier(ItemModifier.ArtifactTier);
uint extraUnlocked = 0;
do
{
ulong xpCost = 0;
var cost = CliDB.ArtifactLevelXPGameTable.GetRow(purchased + extraUnlocked + 1);
if (cost != null)
xpCost = (ulong)(currentArtifactTier == PlayerConst.MaxArtifactTier ? cost.XP2 : cost.XP);
if (artifactXp < xpCost)
break;
artifactXp -= xpCost;
++extraUnlocked;
} while (true);
return purchased + extraUnlocked;
}
public uint GetTotalPurchasedArtifactPowers()
{
uint purchasedRanks = 0;