diff options
| author | leak <none@none> | 2010-12-18 15:56:55 +0100 |
|---|---|---|
| committer | leak <none@none> | 2010-12-18 15:56:55 +0100 |
| commit | 525a1e0ff04196651ad4eb0b5a7891bead62f945 (patch) | |
| tree | 06cbf7b29da568fd0e4c193a7f2dd73892c57408 /src | |
| parent | 04e4561134a6ce0e93c96ed97df77f6b45f8b44f (diff) | |
Core/Entities: Remove gem bonuses if requirements of prismatic sockets are not met
Closes issue 4949.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bb41e068345..f2419957699 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13182,6 +13182,17 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill)) return; + // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements + // rather than the gem requirements itself. If the socket has no color it is a prismatic socket. + if((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3) + && !item->GetProto()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color) + { + // Check if the requirements for the prismatic socket are met before applying the gem stats + SpellItemEnchantmentEntry const *pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)); + if(pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill)) + return; + } + if (!item->IsBroken()) { for (int s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) @@ -13542,6 +13553,22 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 else if (new_value < Enchant->requiredSkillValue && curr_value >= Enchant->requiredSkillValue) ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false); } + + // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements + // rather than the gem requirements itself. If the socket has no color it is a prismatic socket. + if ((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3) + && !m_items[i]->GetProto()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color) + { + SpellItemEnchantmentEntry const *pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)); + + if (pPrismaticEnchant->requiredSkill == skill_id) + { + if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue) + ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true); + else if (new_value < pPrismaticEnchant->requiredSkillValue && curr_value >= pPrismaticEnchant->requiredSkillValue) + ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false); + } + } } } } |
