Core/Items: Item bonus generation improvements

* Pass ItemContext to item creation wherever possible
* Support scaling item levels with m+ keystone levels (not used currently)
* Fixed item link validation when client sends it as default uninitialized bonus list with context only
* Support scaling items depending on current active season (seasons not implemented)
* Implemented content tuning redirection
Port From (https://github.com/TrinityCore/TrinityCore/commit/0fb8765a6638fd947b59fce44d5c31251d0cdadd)
This commit is contained in:
hondacrx
2023-06-21 09:19:40 -04:00
parent 378b0ffccd
commit 49a07ebcce
30 changed files with 796 additions and 336 deletions
+1 -5
View File
@@ -673,11 +673,7 @@ namespace Game.Loots
generatedLoot.context = _itemContext;
generatedLoot.count = (byte)Math.Min(count, proto.GetMaxStackSize());
generatedLoot.LootListId = (uint)items.Count;
if (_itemContext != 0)
{
List<uint> bonusListIDs = Global.DB2Mgr.GetDefaultItemBonusTree(generatedLoot.itemid, _itemContext);
generatedLoot.BonusListIDs.AddRange(bonusListIDs);
}
generatedLoot.BonusListIDs = ItemBonusMgr.GetBonusListsForItem(generatedLoot.itemid, new(_itemContext));
items.Add(generatedLoot);
count -= proto.GetMaxStackSize();
+2 -2
View File
@@ -52,7 +52,7 @@ namespace Game.Loots
}
public static Dictionary<ObjectGuid, Loot> GenerateDungeonEncounterPersonalLoot(uint dungeonEncounterId, uint lootId, LootStore store,
LootType type, WorldObject lootOwner, uint minMoney, uint maxMoney, ushort lootMode, ItemContext context, List<Player> tappers)
LootType type, WorldObject lootOwner, uint minMoney, uint maxMoney, ushort lootMode, MapDifficultyRecord mapDifficulty, List<Player> tappers)
{
Dictionary<Player, Loot> tempLoot = new();
@@ -62,7 +62,7 @@ namespace Game.Loots
continue;
Loot loot = new(lootOwner.GetMap(), lootOwner.GetGUID(), type, null);
loot.SetItemContext(context);
loot.SetItemContext(ItemBonusMgr.GetContextForPlayer(mapDifficulty, tapper));
loot.SetDungeonEncounterId(dungeonEncounterId);
loot.GenerateMoneyLoot(minMoney, maxMoney);