Core/Spells: Named and implemented most of SpellAttr8

This commit is contained in:
Shauren authored and Ovahlord committed 2023-10-23 18:07:05 +02:00
1 parent 1dfe0f0974
commit 388c504047
14 files changed
+248 -153

No files matched your search

+14 -5
View File
@@ -2305,7 +2305,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
bool canDodge = !spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_DODGE);
bool canParry = !spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_PARRY);
bool canBlock = !spellInfo->HasAttribute(SPELL_ATTR8_CANT_BLOCK);
bool canBlock = !spellInfo->HasAttribute(SPELL_ATTR8_NO_ATTACK_BLOCK);
// if victim is casting or cc'd it can't avoid attacks
bool canUseDefenseWhileChanneling = victim->GetCurrentSpell(CURRENT_CHANNELED_SPELL) ? victim->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->GetSpellInfo()->HasAttribute(SPELL_ATTR10_ALLOW_DEFENSE_WHILE_CHANNELING) : false;
@@ -14277,7 +14277,7 @@ float Unit::GetCollisionHeight() const
return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight;
}
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo) const
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo, TriggerCastFlags& triggerFlag) const
{
Unit::AuraEffectList swaps = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);
Unit::AuraEffectList const& swaps2 = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED);
@@ -14287,8 +14287,15 @@ SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo) const
for (AuraEffect const* auraEffect : swaps)
{
if (uint32(auraEffect->GetMiscValue()) == spellInfo->Id || auraEffect->IsAffectingSpell(spellInfo))
{
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo(auraEffect->GetAmount()))
{
if (auraEffect->GetSpellInfo()->HasAttribute(SPELL_ATTR8_IGNORE_SPELLCAST_OVERRIDE_COST))
triggerFlag |= TRIGGERED_IGNORE_POWER_AND_REAGENT_COST;
return newInfo;
}
}
}
return spellInfo;
@@ -14403,7 +14410,9 @@ void Unit::ProcessPendingSpellCastRequest()
}
}
if (caster->GetTypeId() == TYPEID_PLAYER && !caster->ToPlayer()->HasActiveSpell(spellInfo->Id) && !spellInfo->IsRaidMarker() &&
TriggerCastFlags triggerFlag = TRIGGERED_NONE;
if (caster->GetTypeId() == TYPEID_PLAYER && !caster->ToPlayer()->HasActiveSpell(spellInfo->Id) && !spellInfo->HasAttribute(SPELL_ATTR8_SKIP_IS_KNOWN_CHECK) &&
!caster->ToPlayer()->HasArchProject(static_cast<uint16>(spellInfo->ResearchProjectId)))
{
bool allow = false;
@@ -14431,7 +14440,7 @@ void Unit::ProcessPendingSpellCastRequest()
}
// Check possible spell cast overrides
spellInfo = caster->GetCastSpellInfo(spellInfo);
spellInfo = caster->GetCastSpellInfo(spellInfo, triggerFlag);
// can't use our own spells when we're in possession of another unit,
if (caster->isPossessing())
@@ -14493,7 +14502,7 @@ void Unit::ProcessPendingSpellCastRequest()
player->SetArchData(archaeologyCastData);
}
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
Spell* spell = new Spell(caster, spellInfo, triggerFlag);
spell->m_cast_count = _pendingSpellCastRequest->CastRequest.CastID; // set count of casts
spell->m_glyphIndex = _pendingSpellCastRequest->CastRequest.Misc;
spell->prepare(targets);