fix(Scripts/ZulGurub): Hakkar's Blood Siphon (#12196)

This commit is contained in:
UltraNix
2022-07-09 16:05:09 +02:00
committed by GitHub
parent 32ba21d029
commit 346150c92a
12 changed files with 90 additions and 44 deletions

View File

@@ -3622,8 +3622,12 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
{
// generic spells always break channeled not delayed spells
if (Spell* s = GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if (s->GetSpellInfo()->Id != 69051) // pussywizard: FoS, boss Devourer of Souls, Mirrored Soul, does not have any special attribute
{
if (!s->GetSpellInfo()->IsActionAllowedChannel())
{
InterruptSpell(CURRENT_CHANNELED_SPELL, false);
}
}
// autorepeat breaking
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL])
@@ -3658,7 +3662,14 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
if (pSpell->m_spellInfo->Id != 75)
{
// generic autorepeats break generic non-delayed and channeled non-delayed spells
InterruptSpell(CURRENT_GENERIC_SPELL, false);
if (Spell* s = GetCurrentSpell(CURRENT_CHANNELED_SPELL))
{
if (!s->GetSpellInfo()->IsActionAllowedChannel())
{
InterruptSpell(CURRENT_CHANNELED_SPELL, false);
}
}
InterruptSpell(CURRENT_CHANNELED_SPELL, false);
}
// special action: set first cast flag
@@ -3793,7 +3804,7 @@ bool Unit::IsMovementPreventedByCasting() const
{
if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive())
{
if (spell->GetSpellInfo()->IsMoveAllowedChannel())
if (spell->GetSpellInfo()->IsActionAllowedChannel())
{
return false;
}
@@ -3804,15 +3815,6 @@ bool Unit::IsMovementPreventedByCasting() const
return true;
}
bool Unit::CanMoveDuringChannel() const
{
if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
if (spell->getState() != SPELL_STATE_FINISHED)
return spell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL) && spell->IsChannelActive();
return false;
}
bool Unit::isInFrontInMap(Unit const* target, float distance, float arc) const
{
return IsWithinDistInMap(target, distance) && HasInArc(arc, target);