From efbc71746f7f038c453279b1929d4ef76bcbfe2e Mon Sep 17 00:00:00 2001 From: thenecromancer Date: Wed, 13 Jan 2010 11:47:50 +0100 Subject: Fix pickpocket - reveal rogue only if spell is resisted --HG-- branch : trunk --- src/game/Spell.cpp | 10 ++++++++++ src/game/SpellEffects.cpp | 17 +---------------- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 14d6f7ba812..f1c31d6434c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1208,6 +1208,16 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell); + + // Failed Pickpocket, reveal rogue + if (missInfo == SPELL_MISS_RESIST + && m_customAttr & SPELL_ATTR_CU_PICKPOCKET + && unitTarget->GetTypeId() == TYPEID_UNIT) + { + m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); + if (((Creature*)unitTarget)->IsAIEnabled) + ((Creature*)unitTarget)->AI()->AttackStart(m_caster); + } } if(m_caster && !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id)) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3d68aa113f4..79abeac66cb 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3880,22 +3880,7 @@ void Spell::EffectPickPocket(uint32 /*i*/) // victim have to be alive and humanoid or undead if (unitTarget->isAlive() && (unitTarget->GetCreatureTypeMask() &CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0) - { - int32 chance = 10 + int32(m_caster->getLevel()) - int32(unitTarget->getLevel()); - - if (chance > irand(0, 19)) - { - // Stealing successful - //sLog.outDebug("Sending loot from pickpocket"); - ((Player*)m_caster)->SendLoot(unitTarget->GetGUID(),LOOT_PICKPOCKETING); - } - else - { - // Reveal action + get attack - m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); - m_caster->CombatStart(unitTarget); - } - } + ((Player*)m_caster)->SendLoot(unitTarget->GetGUID(),LOOT_PICKPOCKETING); } void Spell::EffectAddFarsight(uint32 i) -- cgit v1.2.3