Core/Items: Add loot scaling support

This commit is contained in:
hondacrx
2018-04-28 11:38:00 -04:00
parent 1106aa3659
commit fc237004f2
8 changed files with 886 additions and 23 deletions
+6 -1
View File
@@ -1274,7 +1274,6 @@ namespace Game.Entities
UpdateCriteria(CriteriaTypes.OwnItem, itemId, 1);
item.SetFlag(ItemFields.Flags, ItemFieldFlags.NewItem);
item.SetItemRandomProperties(randomPropertyId);
uint upgradeID = Global.DB2Mgr.GetRulesetItemUpgrade(itemId);
if (upgradeID != 0)
@@ -1289,6 +1288,9 @@ namespace Game.Entities
item = StoreItem(pos, item, update);
item.SetFixedLevel(getLevel());
item.SetItemRandomProperties(randomPropertyId);
if (allowedLooters != null && allowedLooters.Count > 1 && item.GetTemplate().GetMaxStackSize() == 1 && item.IsSoulBound())
{
item.SetSoulboundTradeable(allowedLooters);
@@ -1414,6 +1416,9 @@ namespace Game.Entities
if (pItem.IsBindedNotWith(this))
return InventoryResult.NotOwner;
if (getLevel() < pItem.GetRequiredLevel())
return InventoryResult.CantEquipLevelI;
InventoryResult res = CanUseItem(pProto);
if (res != InventoryResult.Ok)
return res;