Updated: Now dispel chances are properly taken for caster/target. thx for pointing out as I didnt test at diff targets, now everything is fine.
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 40c9709..ee7d6bc 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -9041,9 +9041,34 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
{
// Random select buff for dispel
SpellAuraHolder *holder = steal_list[urand(0, list_size-1)];
- // Not use chance for steal
- // TODO possible need do it
- success_list.push_back(SuccessList::value_type(holder->GetId(),holder->GetCasterGuid()));
+
+ int32 miss_chance = 0;
+ // Apply dispel mod from aura caster
+
+ Unit * caster = holder->GetCaster();
+ Unit * target = holder->GetTarget();
+ if(!caster || !target)
+ continue;
+
+ if (Player* modOwner = caster->GetSpellModOwner())
+ {
+ modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
+ }
+
+ if (caster != target)
+ {
+ if (Player* modOwner = target->GetSpellModOwner())
+ {
+ modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
+ }
+ }
+
+ // Try dispel
+ if (!roll_chance_i(miss_chance))
+ success_list.push_back(SuccessList::value_type(holder->GetId(),holder->GetCasterGuid()));
+ else m_caster->SendSpellMiss(unitTarget, holder->GetSpellProto()->Id, SPELL_MISS_RESIST);
// Remove buff from list for prevent doubles
for (StealList::iterator j = steal_list.begin(); j != steal_list.end(); )