mangosArchives / Mangos-One-server-old

This repo has been moved to https://githubs.com/mangosone/server
http://getmangos.eu/
GNU General Public License v2.0
95 stars 54 forks source link

[BUG] Spell Crit from gear #37

Closed fr1nge closed 12 years ago

fr1nge commented 12 years ago

Currently players get spell crit rating from gear which adds melee crit rating. I think this is related to a missed backport from master, in 3.0.1 if i'm not mistaken the spell and melee crit rating got unified into a single crit rating stat.

Method to Reproduce: Get some decent melee gear on a warrior, rogue, shaman,etc and check the spell crit rating for the character.

It's really gamebreaking cause it affects the hybrid classes the most, enhancement shamans especially get insane amount of crit for their spells.

Morenn commented 12 years ago

It's same with hit and haste. You can delete 6 lines in code in Player.cpp and it will be OK.

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 79807a6..cb6ad59 100644
-- a/src/game/Player.cpp
++ b/src/game/Player.cpp
@@ -6679,12 +6679,12 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
            case ITEM_MOD_HIT_RATING:
                ApplyRatingMod(CR_HIT_MELEE, int32(val), apply);
                ApplyRatingMod(CR_HIT_RANGED, int32(val), apply);
 --               ApplyRatingMod(CR_HIT_SPELL, int32(val), apply);
++                //ApplyRatingMod(CR_HIT_SPELL, int32(val), apply);
                break;
            case ITEM_MOD_CRIT_RATING:
                ApplyRatingMod(CR_CRIT_MELEE, int32(val), apply);
                ApplyRatingMod(CR_CRIT_RANGED, int32(val), apply);
--                ApplyRatingMod(CR_CRIT_SPELL, int32(val), apply);
++                //ApplyRatingMod(CR_CRIT_SPELL, int32(val), apply);
                break;
            case ITEM_MOD_HIT_TAKEN_RATING:
                ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val), apply);
@@ -6704,7 +6704,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
            case ITEM_MOD_HASTE_RATING:
                ApplyRatingMod(CR_HASTE_MELEE, int32(val), apply);
                ApplyRatingMod(CR_HASTE_RANGED, int32(val), apply);
 --               ApplyRatingMod(CR_HASTE_SPELL, int32(val), apply);
++                //ApplyRatingMod(CR_HASTE_SPELL, int32(val), apply);
                break;
            case ITEM_MOD_EXPERTISE_RATING:
                ApplyRatingMod(CR_EXPERTISE, int32(val), apply);
@@ -11946,13 +11946,13 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
                        case ITEM_MOD_HIT_RATING:
                            ((Player*)this)->ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply);
                            ((Player*)this)->ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply);
--                            ((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
++                            //((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
                            DEBUG_LOG("+ %u HIT", enchant_amount);
                            break;
                        case ITEM_MOD_CRIT_RATING:
                            ((Player*)this)->ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply);
                            ((Player*)this)->ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply);
 --                           ((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
++                            //((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
                            DEBUG_LOG("+ %u CRITICAL", enchant_amount);
                            break;
//                        Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment
@@ -11975,7 +11975,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
                        case ITEM_MOD_HASTE_RATING:
                            ((Player*)this)->ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply);
                            ((Player*)this)->ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply);
--                           ((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
++                            //((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
                            DEBUG_LOG("+ %u HASTE", enchant_amount);
                            break;
                        case ITEM_MOD_EXPERTISE_RATING:
Nighoo commented 12 years ago

fully correct fr1nge (and good catch)! thanks Morenn.