Core/Items: Implemented new item bonus types: limit category and pvp item level

Port From (https://github.com/TrinityCore/TrinityCore/commit/8fff15ba7c63bc12fa00664bfe067bbc9586d3f2)
This commit is contained in:
Hondacrx
2025-12-08 16:09:02 -05:00
parent b962dc7a48
commit f01f61c464
4 changed files with 92 additions and 28 deletions
+11 -4
View File
@@ -886,9 +886,9 @@ namespace Game
// unique limit type item
int limit_newcount = 0;
if (iGemProto.GetItemLimitCategory() != 0)
if (gems[i].GetItemLimitCategory() != 0)
{
ItemLimitCategoryRecord limitEntry = CliDB.ItemLimitCategoryStorage.LookupByKey(iGemProto.GetItemLimitCategory());
ItemLimitCategoryRecord limitEntry = CliDB.ItemLimitCategoryStorage.LookupByKey(gems[i].GetItemLimitCategory());
if (limitEntry != null)
{
// NOTE: limitEntry.mode is not checked because if item has limit then it is applied in equip case
@@ -897,7 +897,7 @@ namespace Game
if (gems[j] != null)
{
// new gem
if (iGemProto.GetItemLimitCategory() == gems[j].GetTemplate().GetItemLimitCategory())
if (gems[i].GetItemLimitCategory() == gems[j].GetTemplate().GetItemLimitCategory())
++limit_newcount;
}
else if (oldGemData[j] != null)
@@ -905,8 +905,15 @@ namespace Game
// existing gem
ItemTemplate jProto = Global.ObjectMgr.GetItemTemplate(oldGemData[j].ItemId);
if (jProto != null)
if (iGemProto.GetItemLimitCategory() == jProto.GetItemLimitCategory())
{
BonusData oldGemBonus = new(jProto);
foreach (ushort bonusListID in oldGemData[j].BonusListIDs)
oldGemBonus.AddBonusList(bonusListID);
if (gems[i].GetItemLimitCategory() == oldGemBonus.LimitCategory)
++limit_newcount;
}
}
}