Refactor and improve vendor items
This commit is contained in:
@@ -2517,7 +2517,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
Item it = bStore ? StoreNewItem(vDest, item, true, ItemEnchantment.GenerateItemRandomPropertyId(item), null, 0, null, false) : EquipNewItem(uiDest, item, true);
|
||||
Item it = bStore ? StoreNewItem(vDest, item, true, ItemEnchantment.GenerateItemRandomPropertyId(item), null, 0, crItem.BonusListIDs, false) : EquipNewItem(uiDest, item, true);
|
||||
if (it != null)
|
||||
{
|
||||
uint new_count = pVendor.UpdateVendorItemCurrentCount(crItem, count);
|
||||
@@ -3630,6 +3630,16 @@ namespace Game.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(crItem.PlayerConditionId);
|
||||
if (playerCondition != null)
|
||||
{
|
||||
if (!ConditionManager.IsPlayerMeetingCondition(this, playerCondition))
|
||||
{
|
||||
SendEquipError(InventoryResult.ItemLocked);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check current item amount if it limited
|
||||
if (crItem.maxcount != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user