diff options
author | QAston <none@none> | 2009-08-02 02:18:14 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-02 02:18:14 +0200 |
commit | fbcf4097965a2b0ec6a9d6f3a66ce42029df5156 (patch) | |
tree | 5bdf9432126e80b677e0a21375f565349bb092de /src | |
parent | f0258275e6d2e3918ab3dd887741b431ae8fda37 (diff) |
*Fix ppm handling for victim auras - by pasdVn.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 1 | ||||
-rw-r--r-- | src/game/Unit.cpp | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6cb586b506a..efebca11abe 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -485,7 +485,6 @@ Player::~Player () if (FindMap()) ResetMap(); - // Note: buy back item already deleted from DB when player was saved for(uint8 i = 0; i < PLAYER_SLOTS_COUNT; ++i) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 58237a092dd..5df313e4455 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6889,6 +6889,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Death Strike healing effect if (dummySpell->Id == 45469) { + if (!pVictim) + return false; basepoints0=pVictim->GetDiseasesByCaster(GetGUID()) * GetMaxHealth()* procSpell->DmgMultiplier[0] / 100.0f; // Do not heal when no diseases on target if (!basepoints0) @@ -13720,10 +13722,18 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co if(spellProcEvent && spellProcEvent->customChance) chance = spellProcEvent->customChance; // If PPM exist calculate chance from PPM - if(!isVictim && spellProcEvent && spellProcEvent->ppmRate != 0) + if(spellProcEvent && spellProcEvent->ppmRate != 0) { - uint32 WeaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto); + if(!isVictim) + { + uint32 WeaponSpeed = GetAttackTime(attType); + chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto); + } + else + { + uint32 WeaponSpeed = pVictim->GetAttackTime(attType); + chance = pVictim->GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto); + } } // Apply chance modifer aura if(Player* modOwner = GetSpellModOwner()) |