diff options
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r-- | src/game/SpellMgr.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 7134dbb4dba..af8a04740f8 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -230,7 +230,7 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo) return (du->Duration[2] == -1) ? -1 : abs(du->Duration[2]); } -bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId) +bool GetDispelChance(Unit* caster, uint32 spellId) { // we assume that aura dispel chance is 100% on start // need formula for level difference based chance @@ -239,7 +239,7 @@ bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId) if (caster) { if ( Player* modOwner = caster->GetSpellModOwner() ) - modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, spell); + modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance); } // Try dispel return !roll_chance_i(miss_chance); @@ -676,7 +676,23 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) { case SPELLMOD_COST: // dependent from bas point sign (negative -> positive) if(spellproto->CalculateSimpleValue(effIndex) > 0) - return false; + { + if (!deep) + { + bool negative = true; + for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) + { + if (i != effIndex) + if (IsPositiveEffect(spellId, i, true)) + { + negative = false; + break; + } + } + if (negative) + return false; + } + } break; default: break; @@ -1158,7 +1174,7 @@ void SpellMgr::LoadSpellBonusess() sLog.outString( ">> Loaded %u extra spell bonus data", count); } -bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active) +bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active) { // No extra req need uint32 procEvent_procEx = PROC_EX_NONE; @@ -1195,7 +1211,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP // spellFamilyName is Ok need check for spellFamilyMask if present if(spellProcEvent->spellFamilyMask) { - if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0) + if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0) return false; active = true; // Spell added manualy -> so its active spell } |