*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
This commit is contained in:
QAston
2009-06-06 15:58:50 +02:00
parent 373867b56b
commit cd98b1eeca
4 changed files with 36 additions and 23 deletions
+3 -1
View File
@@ -677,9 +677,11 @@ void Aura::Update(uint32 diff)
if (IS_PLAYER_GUID(GetCasterGUID())) if (IS_PLAYER_GUID(GetCasterGUID()))
{ {
caster = GetCaster(); caster = GetCaster();
modSpell = ((Player*)caster)->FindCurrentSpellBySpellId(GetId());
if (caster) if (caster)
{
modSpell = ((Player*)caster)->FindCurrentSpellBySpellId(GetId());
((Player*)caster)->SetSpellModTakingSpell(modSpell, true); ((Player*)caster)->SetSpellModTakingSpell(modSpell, true);
}
} }
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (m_partAuras[i]) if (m_partAuras[i])
+6 -9
View File
@@ -1875,6 +1875,12 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster,spell_id,true); m_caster->CastSpell(m_caster,spell_id,true);
return; 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 // Death Coil
else if(m_spellInfo->SpellFamilyFlags[0] & 0x002000) else if(m_spellInfo->SpellFamilyFlags[0] & 0x002000)
{ {
@@ -2848,15 +2854,6 @@ void Spell::EffectEnergize(uint32 i)
if (level_diff > 0) if (level_diff > 0)
damage -= multiplier * level_diff; 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) if(damage < 0)
return; return;
+26 -13
View File
@@ -4353,6 +4353,30 @@ AuraEffect* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint
return NULL; 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) void Unit::AddDynObject(DynamicObject* dynObj)
{ {
m_dynObjGUIDs.push_back(dynObj->GetGUID()); m_dynObjGUIDs.push_back(dynObj->GetGUID());
@@ -6065,7 +6089,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (pVictim->getPowerType() == POWER_MANA) if (pVictim->getPowerType() == POWER_MANA)
{ {
// 2% of maximum 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); pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, 0, triggeredByAura);
} }
return true; return true;
@@ -6613,18 +6637,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// Death Strike healing effect // Death Strike healing effect
if (dummySpell->Id == 45469) if (dummySpell->Id == 45469)
{ {
uint8 n=0; int32 heal=0.5f * pVictim->GetDiseasesByCaster(GetGUID()) * damage+damage;
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;
CastCustomSpell(this,45470,&heal,NULL,NULL,true); CastCustomSpell(this,45470,&heal,NULL,NULL,true);
return true; return true;
} }
+1
View File
@@ -1549,6 +1549,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool HasAura(Aura * aur) const; bool HasAura(Aura * aur) const;
bool HasAuraType(AuraType auraType) const; bool HasAuraType(AuraType auraType) const;
bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const; bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
uint32 GetDiseasesByCaster(uint64 casterGUID) const;
int32 GetTotalAuraModifier(AuraType auratype) const; int32 GetTotalAuraModifier(AuraType auratype) const;
float GetTotalAuraMultiplier(AuraType auratype) const; float GetTotalAuraMultiplier(AuraType auratype) const;