diff options
author | Brian <runningnak3d@gmail.com> | 2010-02-14 19:13:14 -0700 |
---|---|---|
committer | Brian <runningnak3d@gmail.com> | 2010-02-14 19:13:14 -0700 |
commit | 486c00891ba34884e5b2cdd8d44b4d8496f11283 (patch) | |
tree | 7df304b9020ed21b87bd66978d2dc6e6683edce7 /src/game/Item.cpp | |
parent | 7799ade4da0da17034039439d692122e976c0138 (diff) |
* Core switch to client 3.3.2 (11403)
* Credits (in no particular order) to:
* n0n4m3, raczman, manuel, Spp, Malcrom, Teacher, QAston, Tartalo,
* thenecromancer, Xanadu, Trazom, Zor, kiper
* Additional credits to:
* TOM_RUS and NoFantasy from MaNGOS
* Thanks for testing Aokromes and XTElite1
* SoTA still needs some work, but is very playable (huge thanks to raczman and
* kiper)
* To upgrade, you need to apply all SQL from sql/updates/3.2.2a_old from the
* last rev you are on
* and then apply all SQL from sql/updates/3.3.2_old to char / realmd / world
* DBs
* Known problem with guild banks.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Item.cpp')
-rw-r--r-- | src/game/Item.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp index d1a5612b95c..00f271ca89e 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -726,6 +726,36 @@ bool Item::CanBeTraded(bool mail) const return true; } + +bool Item::HasEnchantRequiredSkill(const Player *pPlayer) const +{ + + // Check all enchants for required skill + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredSkill && pPlayer->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) + return false; + + return true; +} + + +uint32 Item::GetEnchantRequiredLevel() const +{ + + uint32 level = 0; + + // Check all enchants for required level + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredLevel > level) + level = enchantEntry->requiredLevel; + + return level; +} + bool Item::IsBoundByEnchant() const { // Check all enchants for soulbound @@ -741,6 +771,10 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const { ItemPrototype const* proto = GetProto(); + //Lava Lash + if (spellInfo->Id==60103 && spellInfo->EquippedItemClass==ITEM_CLASS_WEAPON) + return true; + if (spellInfo->EquippedItemClass != -1) // -1 == any item class { // Special case - accept vellum for armor/weapon requirements |