fix(Scripts/BlackiwingLair): Rogues should be teleported in front of Nefarian during Class Call event. (#11513)
This commit is contained in:
+6
-13
@@ -1033,31 +1033,24 @@ class spell_class_call_handler : public SpellScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleOnHitRogue()
|
void HandleOnHitRogue(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
Unit* target = GetHitUnit();
|
Unit* target = GetHitUnit();
|
||||||
|
|
||||||
if (!caster || !target)
|
if (!caster || !target)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float angle = rand_norm() * 2 * M_PI;
|
Position tp = caster->GetFirstCollisionPosition(5.f, 0.f);
|
||||||
Position tp = caster->GetPosition();
|
target->NearTeleportTo(tp.GetPositionX(), tp.GetPositionY(), tp.GetPositionZ(), tp.GetOrientation());
|
||||||
tp.m_positionX += std::cos(angle) * 5.f;
|
|
||||||
tp.m_positionY += std::sin(angle) * 5.f;
|
|
||||||
float z = tp.m_positionZ + 0.5f;
|
|
||||||
caster->UpdateAllowedPositionZ(tp.GetPositionX(), tp.GetPositionY(), z);
|
|
||||||
target->NearTeleportTo(tp.GetPositionX(), tp.GetPositionY(), z, angle - M_PI);
|
|
||||||
target->UpdatePositionData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleOnHitWarlock()
|
void HandleOnHitWarlock()
|
||||||
{
|
{
|
||||||
if (GetHitUnit())
|
if (Unit* target = GetHitUnit())
|
||||||
{
|
{
|
||||||
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUMMON_INFERNALS, true);
|
target->CastSpell(target, SPELL_SUMMON_INFERNALS, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,7 +1060,7 @@ class spell_class_call_handler : public SpellScript
|
|||||||
|
|
||||||
if (m_scriptSpellId == SPELL_ROGUE)
|
if (m_scriptSpellId == SPELL_ROGUE)
|
||||||
{
|
{
|
||||||
OnHit += SpellHitFn(spell_class_call_handler::HandleOnHitRogue);
|
OnEffectLaunchTarget += SpellEffectFn(spell_class_call_handler::HandleOnHitRogue, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||||
}
|
}
|
||||||
else if (m_scriptSpellId == SPELL_WARLOCK)
|
else if (m_scriptSpellId == SPELL_WARLOCK)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user