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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user