mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Spells: Fixed extra charge effect visuals
This commit is contained in:
@@ -4337,15 +4337,22 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
|
||||
{
|
||||
float speed = G3D::fuzzyGt(m_spellInfo->Speed, 0.0f) ? m_spellInfo->Speed : SPEED_CHARGE;
|
||||
Optional<Movement::SpellEffectExtraData> spellEffectExtraData;
|
||||
if (effectInfo->MiscValueB)
|
||||
{
|
||||
spellEffectExtraData = boost::in_place();
|
||||
spellEffectExtraData->Target = unitTarget->GetGUID();
|
||||
spellEffectExtraData->SpellVisualId = effectInfo->MiscValueB;
|
||||
}
|
||||
// Spell is not using explicit target - no generated path
|
||||
if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK)
|
||||
{
|
||||
//unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster));
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed);
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed, EVENT_CHARGE, false, unitTarget, spellEffectExtraData.get_ptr());
|
||||
}
|
||||
else
|
||||
m_caster->GetMotionMaster()->MoveCharge(m_preGeneratedPath, speed);
|
||||
m_caster->GetMotionMaster()->MoveCharge(m_preGeneratedPath, speed, unitTarget, spellEffectExtraData.get_ptr());
|
||||
}
|
||||
|
||||
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
@@ -4361,10 +4368,10 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
|
||||
void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH)
|
||||
if (!destTarget)
|
||||
return;
|
||||
|
||||
if (m_targets.HasDst())
|
||||
if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH)
|
||||
{
|
||||
Position pos = destTarget->GetPosition();
|
||||
float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
|
||||
@@ -4373,6 +4380,11 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
}
|
||||
else if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT)
|
||||
{
|
||||
if (effectInfo->TriggerSpell)
|
||||
m_caster->CastSpell(unitTarget, effectInfo->TriggerSpell, true, nullptr, nullptr, m_originalCasterGUID);
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectKnockBack(SpellEffIndex /*effIndex*/)
|
||||
|
||||
Reference in New Issue
Block a user