diff options
author | QAston <none@none> | 2009-06-06 15:58:50 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-06-06 15:58:50 +0200 |
commit | cd98b1eeca41e6df7746c870538061c943f3b829 (patch) | |
tree | 867bb22b4bc85a4d4d13fe20943e39925ea7672f /src | |
parent | 373867b56b4cb870bd6648397631b64665f4b9b5 (diff) |
*Fix scourge strike damage- original patch by Roland.
*Remove duplicate code for judgement of wisdom
*Correctly count diseases for death strike
*Fix a crash.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuras.cpp | 4 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 15 | ||||
-rw-r--r-- | src/game/Unit.cpp | 39 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
4 files changed, 36 insertions, 23 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f086175987e..c87fc9b89fc 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -677,9 +677,11 @@ void Aura::Update(uint32 diff) if (IS_PLAYER_GUID(GetCasterGUID())) { caster = GetCaster(); - modSpell = ((Player*)caster)->FindCurrentSpellBySpellId(GetId()); if (caster) + { + modSpell = ((Player*)caster)->FindCurrentSpellBySpellId(GetId()); ((Player*)caster)->SetSpellModTakingSpell(modSpell, true); + } } for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_partAuras[i]) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4ec6a30ae3d..661eef708ea 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1875,6 +1875,12 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster,spell_id,true); return; } + // Scourge Strike + else if(m_spellInfo->SpellFamilyFlags[1] & 0x8000000) + { + m_damage += int32(m_spellInfo->CalculateSimpleValue(0)*m_spellInfo->CalculateSimpleValue(1) * damage * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 10000); + return; + } // Death Coil else if(m_spellInfo->SpellFamilyFlags[0] & 0x002000) { @@ -2848,15 +2854,6 @@ void Spell::EffectEnergize(uint32 i) if (level_diff > 0) damage -= multiplier * level_diff; - //Judgement of wisdom energize effect - if(m_spellInfo->Id == 20268) - { - if(unitTarget->GetTypeId() == TYPEID_PLAYER) - { - damage = unitTarget->GetCreateMana() * damage / 100; - } - } - if(damage < 0) return; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index da2b53aec72..1546ccdb927 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4353,6 +4353,30 @@ AuraEffect* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint return NULL; } +uint32 Unit::GetDiseasesByCaster(uint64 casterGUID) const +{ + static const AuraType diseaseAuraTypes[] = + { + SPELL_AURA_PERIODIC_DAMAGE, // Frost Fever and Blood Plague + SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, // Crypt Fever and Ebon Plague + SPELL_AURA_NONE + }; + + uint32 diseases=0; + for(AuraType const* itr = &diseaseAuraTypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr) + { + Unit::AuraEffectList const& auras = GetAurasByType(*itr); + for(AuraEffectList::const_iterator i = auras.begin();i != auras.end(); ++i) + { + // Get auras with disease dispel type by caster + if ((*i)->GetSpellProto()->Dispel == DISPEL_DISEASE + && (*i)->GetCasterGUID()==casterGUID) + ++diseases; + } + } + return diseases; +} + void Unit::AddDynObject(DynamicObject* dynObj) { m_dynObjGUIDs.push_back(dynObj->GetGUID()); @@ -6065,7 +6089,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (pVictim->getPowerType() == POWER_MANA) { // 2% of maximum mana - basepoints0 = int32(pVictim->GetMaxPower(POWER_MANA) * 2 / 100); + basepoints0 = int32(pVictim->GetCreateMana() * 2 / 100); pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, 0, triggeredByAura); } return true; @@ -6613,18 +6637,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Death Strike healing effect if (dummySpell->Id == 45469) { - uint8 n=0; - Unit::AuraEffectList const& decSpeedList = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - for(Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter) - { - if((*iter)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DEATHKNIGHT - && (*iter)->GetCasterGUID() == GetGUID() - && (*iter)->GetSpellProto()->Dispel == DISPEL_DISEASE) - { - n++; - } - } - int32 heal=0.5f*n*damage+damage; + int32 heal=0.5f * pVictim->GetDiseasesByCaster(GetGUID()) * damage+damage; CastCustomSpell(this,45470,&heal,NULL,NULL,true); return true; } diff --git a/src/game/Unit.h b/src/game/Unit.h index febb4040213..fa32a235d3e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1549,6 +1549,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool HasAura(Aura * aur) const; bool HasAuraType(AuraType auraType) const; bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const; + uint32 GetDiseasesByCaster(uint64 casterGUID) const; int32 GetTotalAuraModifier(AuraType auratype) const; float GetTotalAuraMultiplier(AuraType auratype) const; |