mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10021] Move item disenchanting static req. checks to server start.
This commit is contained in:
parent
d6c5207867
commit
e823b30f4f
5 changed files with 53 additions and 20 deletions
|
|
@ -5871,19 +5871,14 @@ SpellCastResult Spell::CheckItems()
|
|||
if(!itemProto)
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
|
||||
uint32 item_quality = itemProto->Quality;
|
||||
// 2.0.x addon: Check player enchanting level against the item disenchanting requirements
|
||||
uint32 item_disenchantskilllevel = itemProto->RequiredDisenchantSkill;
|
||||
if (item_disenchantskilllevel == uint32(-1))
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
if (item_disenchantskilllevel > p_caster->GetSkillValue(SKILL_ENCHANTING))
|
||||
return SPELL_FAILED_LOW_CASTLEVEL;
|
||||
if(item_quality > 4 || item_quality < 2)
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
if(itemProto->Class != ITEM_CLASS_WEAPON && itemProto->Class != ITEM_CLASS_ARMOR)
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
// must have disenchant loot (other static req. checked at item prototype loading)
|
||||
if (!itemProto->DisenchantID)
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
|
||||
// 2.0.x addon: Check player enchanting level against the item disenchanting requirements
|
||||
int32 item_disenchantskilllevel = itemProto->RequiredDisenchantSkill;
|
||||
if (item_disenchantskilllevel > int32(p_caster->GetSkillValue(SKILL_ENCHANTING)))
|
||||
return SPELL_FAILED_LOW_CASTLEVEL;
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_PROSPECTING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue