aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShocker <shocker@freakz.ro>2011-03-01 17:47:53 +0200
committerShocker <shocker@freakz.ro>2011-03-01 17:47:53 +0200
commit43240f8c3d723d8ae6a05b50baf0793819713954 (patch)
tree88fda004c5ed1eba2044be87e560b41327ab7dc6 /src
parent1618afc5d17745d82314f975bc5b96497e2d7ac7 (diff)
Core/Spells: Correctly give skill bonus provided by spells on cast, fixes Mining/Herbalism (and similar) exploits that allowed players to mine/gather anything with any skill
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 4d6459bc66d..b89e1167f2c 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -6967,16 +6967,16 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
if (skillId != SKILL_NONE)
{
- // skill bonus provided by casting spell (mostly item spells)
- // add the damage modifier from the spell casted (cheat lock / skeleton key etc.)
- uint32 spellSkillBonus = uint32(CalculateDamage(effIndex, NULL));
reqSkillValue = lockInfo->Skill[j];
// castitem check: rogue using skeleton keys. the skill values should not be added in this case.
skillValue = m_CastItem || m_caster->GetTypeId()!= TYPEID_PLAYER ?
0 : m_caster->ToPlayer()->GetSkillValue(skillId);
- skillValue += spellSkillBonus;
+ // skill bonus provided by casting spell (mostly item spells)
+ // add the damage modifier from the spell casted (cheat lock / skeleton key etc.)
+ if (m_spellInfo->EffectImplicitTargetA[effIndex] == TARGET_GAMEOBJECT_ITEM || m_spellInfo->EffectImplicitTargetB[effIndex] == TARGET_GAMEOBJECT_ITEM)
+ skillValue += uint32(CalculateDamage(effIndex, NULL));
if (skillValue < reqSkillValue)
return SPELL_FAILED_LOW_CASTLEVEL;