diff options
author | QAston <none@none> | 2009-03-20 19:53:26 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-03-20 19:53:26 +0100 |
commit | ad06f05ddbbe1ddd9cde94abf7f47f0e7c17dc13 (patch) | |
tree | b539918f367a81c2fa7fae924c5488df8f5e9515 /src/game/Unit.cpp | |
parent | 4317751930e97bcb01d93cc92db18942d61a964d (diff) |
*Fix Focused Magic.
*Make Presence of Mind no longer trigger Arcane Power.
*Apply correct calculation for SPELLMOD_PROC_PER_MINUTE.
*Fix divine shield positivity.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e745aec5d6f..5c27d51c4aa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5620,7 +5620,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return true; } // Seed of Corruption (Mobs cast) - no die req - if (dummySpell->SpellFamilyFlags == 0x00LL && dummySpell->SpellIconID == 1932) + if (dummySpell->SpellFamilyFlags.IsEqual(0,0,0) && dummySpell->SpellIconID == 1932) { Modifier* mod = triggeredByAura->GetModifier(); // if damage is more than need deal finish spell @@ -9820,10 +9820,15 @@ float Unit::GetWeaponProcChance() const return 0; } -float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const +float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * spellProto) const { // proc per minute chance calculation if (PPM <= 0) return 0.0f; + // Apply chance modifer aura + if (spellProto) + if(Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,PPM); + uint32 result = uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) return result; } @@ -12694,13 +12699,12 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con if(!isVictim && spellProcEvent && spellProcEvent->ppmRate != 0) { uint32 WeaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate); + chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto); } // Apply chance modifer aura if(Player* modOwner = GetSpellModOwner()) { modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance); - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,chance); } return roll_chance_f(chance); |