fix(Scripts/BlackiwingLair): Rogues should be teleported in front of Nefarian during Class Call event. (#11513)
This commit is contained in:
+18
-25
@@ -1015,49 +1015,42 @@ class spell_class_call_handler : public SpellScript
|
|||||||
if (SpellInfo const* spellInfo = GetSpellInfo())
|
if (SpellInfo const* spellInfo = GetSpellInfo())
|
||||||
{
|
{
|
||||||
targets.remove_if([spellInfo](WorldObject const* target) -> bool
|
targets.remove_if([spellInfo](WorldObject const* target) -> bool
|
||||||
|
{
|
||||||
|
Player const* player = target->ToPlayer();
|
||||||
|
if (!player || player->getClass() == CLASS_DEATH_KNIGHT) // ignore all death knights from whatever spell, for some reason the condition below is not working x.x
|
||||||
{
|
{
|
||||||
Player const* player = target->ToPlayer();
|
return true;
|
||||||
if (!player || player->getClass() == CLASS_DEATH_KNIGHT) // ignore all death knights from whatever spell, for some reason the condition below is not working x.x
|
}
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto it = classCallSpells.find(spellInfo->Id);
|
auto it = classCallSpells.find(spellInfo->Id);
|
||||||
if (it != classCallSpells.end()) // should never happen but only to be sure.
|
if (it != classCallSpells.end()) // should never happen but only to be sure.
|
||||||
{
|
{
|
||||||
return target->ToPlayer()->getClass() != it->second;
|
return target->ToPlayer()->getClass() != it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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