Core/Unit: damage immune improvements (9f5df023b7 follow up)

- Handling checked in sniffs: Spell 63710 Void Barrier vs 49143 Frost Strike
  * Send spell miss immune only if spell consists of damage effects
- Checked with 348 Immolate:
  * No packets sent if damage immune, aura is applied normally

Also... who the fuck uses 0 to compare against pointers

(cherry picked from commit ca1c4525c7)

Core/Unit: fix build

Ctrl-S failure
(cherry picked from commit f3bdd705c0)
This commit is contained in:
ariel-
2016-11-16 02:39:15 +01:00
committed by joschiwald
parent 9d0dfeb425
commit 5bcf14cdb8
7 changed files with 94 additions and 38 deletions

View File

@@ -2421,10 +2421,11 @@ public:
char* spellStr = strtok((char*)NULL, " ");
Player* attacker = handler->GetSession()->GetPlayer();
// melee damage by specific school
if (!spellStr)
{
Player* attacker = handler->GetSession()->GetPlayer();
DamageInfo dmgInfo(attacker, target, damage, nullptr, schoolmask, SPELL_DIRECT_DAMAGE, BASE_ATTACK);
attacker->CalcAbsorbResist(dmgInfo);
@@ -2445,13 +2446,16 @@ public:
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellid = handler->extractSpellIdFromLink((char*)args);
if (!spellid)
return false;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
return false;
SpellNonMeleeDamage damageInfo(handler->GetSession()->GetPlayer(), target, spellid, spellInfo->GetSpellXSpellVisualId(handler->GetSession()->GetPlayer()), spellInfo->SchoolMask);
SpellNonMeleeDamage damageInfo(attacker, target, spellid, spellInfo->GetSpellXSpellVisualId(handler->GetSession()->GetPlayer()), spellInfo->SchoolMask);
damageInfo.damage = damage;
handler->GetSession()->GetPlayer()->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
attacker->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
target->DealSpellDamage(&damageInfo, true);
target->SendSpellNonMeleeDamageLog(&damageInfo);
return true;

View File

@@ -1103,6 +1103,12 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
if (!GetHitUnit()->IsAlive() || !_targetCount)
return;
if (GetHitUnit()->IsImmunedToDamage(GetSpellInfo()))
{
GetCaster()->SendSpellDamageImmune(GetHitUnit(), GetSpellInfo()->Id, false);
return;
}
float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2;
uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor;