[Core/Threat] SpellThreat-Calculation revamped

short:
  - Threat is now distributed blizzlike (almost)

long:
  - Percent- and AP-Modifieres got add
  - Threat is now propperly distributed through multiple enemies
  - Most spells will cause initial threat in an amount equal to their SpellLevel
  - Energize-Effects will now be treated like healing (threat-wise)
  - Tanks got their missing +43% passive threat tacked on
  - Paladins are still missing 'Salvation' and will not only cause half threat with healing (essentially 25% of the amount healed)
This commit is contained in:
sarjuuk
2011-09-03 17:42:44 +02:00
committed by QAston
parent dc01541111
commit b40bf69319
9 changed files with 245 additions and 59 deletions
+3 -29
View File
@@ -791,12 +791,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
if (victim->GetTypeId() != TYPEID_PLAYER)
{
if (spellProto && IsDamageToThreatSpell(spellProto))
victim->AddThreat(this, damage * 2.0f, damageSchoolMask, spellProto);
else
victim->AddThreat(this, (float)damage, damageSchoolMask, spellProto);
}
else // victim is a player
{
// random durability for items (HIT TAKEN)
@@ -10334,6 +10329,9 @@ void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers p
SendEnergizeSpellLog(victim, spellID, damage, powerType);
// needs to be called after sending spell log
victim->ModifyPower(powerType, damage);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
victim->getHostileRefManager().threatAssist(this, float(damage) * 0.5f, spellInfo);
}
uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack)
@@ -11622,30 +11620,6 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons
return false;
}
bool Unit::IsDamageToThreatSpell(SpellInfo const* spellInfo) const
{
if (!spellInfo)
return false;
switch(spellInfo->SpellFamilyName)
{
case SPELLFAMILY_WARLOCK:
if (spellInfo->SpellFamilyFlags[0] == 0x100) // Searing Pain
return true;
break;
case SPELLFAMILY_SHAMAN:
if (spellInfo->SpellFamilyFlags[0] == SPELLFAMILYFLAG_SHAMAN_FROST_SHOCK)
return true;
break;
case SPELLFAMILY_DEATHKNIGHT:
if (spellInfo->SpellFamilyFlags[1] == 0x20000000) // Rune Strike
return true;
break;
}
return false;
}
void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attType, SpellInfo const* spellProto)
{
if (!victim)
-2
View File
@@ -1572,8 +1572,6 @@ class Unit : public WorldObject
void SendPlaySpellVisual(uint32 id);
void SendPlaySpellImpact(uint64 guid, uint32 id);
bool IsDamageToThreatSpell(SpellInfo const* spellInfo) const;
void DeMorph();
void SendAttackStateUpdate(CalcDamageInfo *damageInfo);