Jump to content

Question: Positive delayed spells and immune checks


Guest Revils

Recommended Posts

On Unit::SpellHitResult

    // Check for immune
   if (pVictim->IsImmunedToSpell(spell))
       return SPELL_MISS_IMMUNE;

   // All positive spells can`t miss
   // TODO: client not show miss log for this spells - so need find info for this in dbc and use it!
   if (IsPositiveSpell(spell->Id))
       return SPELL_MISS_NONE;

   // Check for immune
   if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell)))
       return SPELL_MISS_IMMUNE;

so in case of a positive spell there's a check if the victim IsImmunedToSpell but not if ImmunedToDamage while later in DoSpellHitOnUnit, if the same spell is a delayed spell, there are checks for both cases

  // Recheck immune (only for delayed spells)
   if (m_spellInfo->speed && (
       unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) ||
       unit->IsImmunedToSpell(m_spellInfo)))
   {
       if (realCaster)
           realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE);

there's a reason for this different approach or just an exception for !isPositive is missing on recheck immune?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use