Core/Spells: implement CREATURE_STATIC_FLAG_5_240_DEGREE_BACK_ARC
This commit is contained in:
1 parent
71ecd754ce
commit
94a37eeaa0
1 file changed
+9
-2
@@ -5817,8 +5817,15 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
|||||||
if (target != m_caster)
|
if (target != m_caster)
|
||||||
{
|
{
|
||||||
// Must be behind the target
|
// Must be behind the target
|
||||||
if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET) && target->HasInArc(static_cast<float>(M_PI), m_caster))
|
if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET))
|
||||||
return SPELL_FAILED_NOT_BEHIND;
|
{
|
||||||
|
float arcAngle = static_cast<float>(M_PI);
|
||||||
|
if (target->IsCreature() && target->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_5_240_DEGREE_BACK_ARC))
|
||||||
|
arcAngle -= static_cast<float>(M_PI / 3);
|
||||||
|
|
||||||
|
if (target->HasInArc(arcAngle, m_caster))
|
||||||
|
return SPELL_FAILED_NOT_BEHIND;
|
||||||
|
}
|
||||||
|
|
||||||
// Target must be facing you
|
// Target must be facing you
|
||||||
if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
|
if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
|
||||||
|
|||||||
Reference in new issue
Block a user