Core/Items: Implement azerite essences

Port From (https://github.com/TrinityCore/TrinityCore/commit/ec9d624aec9e0a39b1bcee7d4077f46be358faad)
This commit is contained in:
hondacrx
2019-11-22 21:39:35 -05:00
parent c05d592f4c
commit 796c11795f
30 changed files with 1231 additions and 74 deletions
+23 -6
View File
@@ -38,10 +38,10 @@ namespace Game.Entities
{
public partial class Player
{
void _LoadInventory(SQLResult result, SQLResult artifactsResult, SQLResult azeriteResult, uint timeDiff)
void _LoadInventory(SQLResult result, SQLResult artifactsResult, SQLResult azeriteResult, SQLResult azeriteItemMilestonePowersResult, SQLResult azeriteItemUnlockedEssencesResult, uint timeDiff)
{
Dictionary<ulong, ItemAdditionalLoadInfo> additionalData = new Dictionary<ulong, ItemAdditionalLoadInfo>();
ItemAdditionalLoadInfo.Init(additionalData, artifactsResult, azeriteResult);
ItemAdditionalLoadInfo.Init(additionalData, artifactsResult, azeriteResult, azeriteItemMilestonePowersResult, azeriteItemUnlockedEssencesResult);
if (!result.IsEmpty())
{
@@ -68,7 +68,7 @@ namespace Game.Entities
{
AzeriteItem azeriteItem = item.ToAzeriteItem();
if (azeriteItem != null)
azeriteItem.LoadAzeriteItemData(addionalData.AzeriteItem);
azeriteItem.LoadAzeriteItemData(this, addionalData.AzeriteItem);
}
}
@@ -1189,8 +1189,16 @@ namespace Game.Entities
stmt.AddValue(0, GetGUID().GetCounter());
SQLResult azeriteResult = DB.Characters.Query(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_MILESTONE_POWER);
stmt.AddValue(0, GetGUID().GetCounter());
SQLResult azeriteItemMilestonePowersResult = DB.Characters.Query(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_UNLOCKED_ESSENCE);
stmt.AddValue(0, GetGUID().GetCounter());
SQLResult azeriteItemUnlockedEssencesResult = DB.Characters.Query(stmt);
Dictionary<ulong, ItemAdditionalLoadInfo> additionalData = new Dictionary<ulong, ItemAdditionalLoadInfo>();
ItemAdditionalLoadInfo.Init(additionalData, artifactResult, azeriteResult);
ItemAdditionalLoadInfo.Init(additionalData, artifactResult, azeriteResult, azeriteItemMilestonePowersResult, azeriteItemUnlockedEssencesResult);
do
{
@@ -1250,7 +1258,7 @@ namespace Game.Entities
{
AzeriteItem azeriteItem = item.ToAzeriteItem();
if (azeriteItem != null)
azeriteItem.LoadAzeriteItemData(additionalLoadInfo.AzeriteItem);
azeriteItem.LoadAzeriteItemData(this, additionalLoadInfo.AzeriteItem);
}
}
@@ -2898,7 +2906,8 @@ namespace Game.Entities
// must be before inventory (some items required reputation check)
reputationMgr.LoadFromDB(holder.GetResult(PlayerLoginQueryLoad.Reputation));
_LoadInventory(holder.GetResult(PlayerLoginQueryLoad.Inventory), holder.GetResult(PlayerLoginQueryLoad.Artifacts), holder.GetResult(PlayerLoginQueryLoad.LoadAzerite), time_diff);
_LoadInventory(holder.GetResult(PlayerLoginQueryLoad.Inventory), holder.GetResult(PlayerLoginQueryLoad.Artifacts), holder.GetResult(PlayerLoginQueryLoad.LoadAzerite),
holder.GetResult(PlayerLoginQueryLoad.LoadAzeriteMilestonePowers), holder.GetResult(PlayerLoginQueryLoad.LoadAzeriteUnlockedEssences), time_diff);
if (IsVoidStorageUnlocked())
_LoadVoidStorage(holder.GetResult(PlayerLoginQueryLoad.VoidStorage));
@@ -3846,6 +3855,14 @@ namespace Game.Entities
stmt.AddValue(0, guid);
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER_BY_OWNER);
stmt.AddValue(0, guid);
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE_BY_OWNER);
stmt.AddValue(0, guid);
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_BY_OWNER);
stmt.AddValue(0, guid);
trans.Append(stmt);