mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
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
This commit is contained in:
@@ -2289,10 +2289,22 @@ 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 || !sSpellMgr->GetSpellInfo(spellid))
|
||||
if (!spellid)
|
||||
return false;
|
||||
|
||||
handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
Player* attacker = handler->GetSession()->GetPlayer();
|
||||
SpellNonMeleeDamage dmgInfo(attacker, target, spellid, spellInfo->GetSchoolMask());
|
||||
damage = attacker->SpellDamageBonusDone(target, spellInfo, damage, SPELL_DIRECT_DAMAGE);
|
||||
damage = target->SpellDamageBonusTaken(attacker, spellInfo, damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
attacker->CalculateSpellDamageTaken(&dmgInfo, damage, spellInfo);
|
||||
attacker->DealDamageMods(dmgInfo.target, dmgInfo.damage, &dmgInfo.absorb);
|
||||
attacker->SendSpellNonMeleeDamageLog(&dmgInfo);
|
||||
attacker->DealSpellDamage(&dmgInfo, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1099,6 +1099,12 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
|
||||
if (!GetHitUnit()->IsAlive() || !_targetCount)
|
||||
return;
|
||||
|
||||
if (GetHitUnit()->IsImmunedToDamage(GetSpellInfo()))
|
||||
{
|
||||
GetCaster()->SendSpellDamageImmune(GetHitUnit(), GetSpellInfo()->Id);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user