Core/Players: Allow damaging spells to complete their damage-ticks/hits even if target runs to a sanctuary zone

This commit is contained in:
tobmaps
2011-05-30 05:27:41 +07:00
parent 00da67740d
commit 76413ae661
-32
View File
@@ -561,19 +561,6 @@ void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
return; return;
} }
//You don't lose health from damage taken from another player while in a sanctuary
//You still see it in the combat log though
if (pVictim != this && IsControlledByPlayer() && pVictim->IsControlledByPlayer())
{
const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
if (area && area->IsSanctuary()) //sanctuary
{
if (absorb)
*absorb += damage;
damage = 0;
}
}
uint32 originalDamage = damage; uint32 originalDamage = damage;
if (absorb && originalDamage > damage) if (absorb && originalDamage > damage)
@@ -1122,16 +1109,6 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
return; return;
} }
//You don't lose health from damage taken from another player while in a sanctuary
//You still see it in the combat log though
if (pVictim != this && IsControlledByPlayer() && pVictim->IsControlledByPlayer())
{
const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
if (area && area->IsSanctuary()) // sanctuary
return;
}
// Call default DealDamage // Call default DealDamage
CleanDamage cleanDamage(damageInfo->cleanDamage, damageInfo->absorb, BASE_ATTACK, MELEE_HIT_NORMAL); CleanDamage cleanDamage(damageInfo->cleanDamage, damageInfo->absorb, BASE_ATTACK, MELEE_HIT_NORMAL);
DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, SpellSchoolMask(damageInfo->schoolMask), spellProto, durabilityLoss); DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, SpellSchoolMask(damageInfo->schoolMask), spellProto, durabilityLoss);
@@ -1352,15 +1329,6 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()))
return; return;
//You don't lose health from damage taken from another player while in a sanctuary
//You still see it in the combat log though
if (pVictim != this && IsControlledByPlayer() && pVictim->IsControlledByPlayer())
{
const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
if (area && area->IsSanctuary()) // sanctuary
return;
}
// Hmmmm dont like this emotes client must by self do all animations // Hmmmm dont like this emotes client must by self do all animations
if (damageInfo->HitInfo&HITINFO_CRITICALHIT) if (damageInfo->HitInfo&HITINFO_CRITICALHIT)
pVictim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL); pVictim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL);