Core/Items: Implemented ITEM_BONUS_DISENCHANT_LOOT_ID

This commit is contained in:
Shauren
2024-09-24 14:40:23 +02:00
parent d3985a0460
commit 3238175a62
7 changed files with 101 additions and 23 deletions

View File

@@ -7882,10 +7882,10 @@ SpellCastResult Spell::CheckItems(int32* param1 /*= nullptr*/, int32* param2 /*=
if (!itemProto)
return SPELL_FAILED_CANT_BE_SALVAGED;
ItemDisenchantLootEntry const* itemDisenchantLoot = item->GetDisenchantLoot(m_caster->ToPlayer());
if (!itemDisenchantLoot)
Optional<uint16> disenchantSkillRequired = item->GetDisenchantSkillRequired();
if (!disenchantSkillRequired)
return SPELL_FAILED_CANT_BE_SALVAGED;
if (itemDisenchantLoot->SkillRequired > player->GetSkillValue(SKILL_ENCHANTING))
if (disenchantSkillRequired > player->GetSkillValue(SKILL_ENCHANTING))
return SPELL_FAILED_CANT_BE_SALVAGED_SKILL;
break;
}