Core/Spells: Named and implemented most of SpellAttr8

This commit is contained in:
Shauren
2023-10-22 18:39:59 +02:00
parent b2393d6ade
commit dc9361fcc2
13 changed files with 325 additions and 166 deletions
+8 -3
View File
@@ -2479,7 +2479,9 @@ void WorldObject::ModSpellDurationTime(SpellInfo const* spellInfo, int32& durati
if (!spellInfo || duration < 0)
return;
if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC))
if (spellInfo->IsChanneled()
&& !spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC)
&& !spellInfo->HasAttribute(SPELL_ATTR8_MELEE_HASTE_AFFECTS_PERIODIC))
return;
// called from caster
@@ -3103,7 +3105,10 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const
// PvP case - can't attack when attacker or target are in sanctuary
// however, 13850 client doesn't allow to attack when one of the unit's has sanctuary flag and is pvp
if (unitTarget && unitTarget->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && unitOrOwner && unitOrOwner->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && (unitTarget->IsInSanctuary() || unitOrOwner->IsInSanctuary()))
if (unitTarget && unitTarget->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)
&& unitOrOwner && unitOrOwner->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)
&& (unitTarget->IsInSanctuary() || unitOrOwner->IsInSanctuary())
&& (!bySpell || bySpell->HasAttribute(SPELL_ATTR8_IGNORE_SANCTUARY)))
return false;
// additional checks - only PvP case
@@ -3210,7 +3215,7 @@ bool WorldObject::IsValidAssistTarget(WorldObject const* target, SpellInfo const
return false;
// can't assist player out of sanctuary from sanctuary if has pvp enabled
if (unitTarget->IsPvP())
if (unitTarget->IsPvP() && (!bySpell || bySpell->HasAttribute(SPELL_ATTR8_IGNORE_SANCTUARY)))
if (unit->IsInSanctuary() && !unitTarget->IsInSanctuary())
return false;
}