mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 22:37:04 +00:00
[12126] Implement SPELL_EFFECT_KNOCKBACK_FROM_POSITION (144)
Also fix a missing break in db-script engine Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
6fa6eb24a5
commit
147a1b04fe
5 changed files with 27 additions and 3 deletions
|
|
@ -204,7 +204,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS] =
|
|||
&Spell::EffectNULL, //141 SPELL_EFFECT_141 damage and reduce speed?
|
||||
&Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
|
||||
&Spell::EffectApplyAreaAura, //143 SPELL_EFFECT_APPLY_AREA_AURA_OWNER
|
||||
&Spell::EffectNULL, //144 SPELL_EFFECT_144 Spectral Blast
|
||||
&Spell::EffectKnockBackFromPosition, //144 SPELL_EFFECT_KNOCKBACK_FROM_POSITION
|
||||
&Spell::EffectNULL, //145 SPELL_EFFECT_145 Black Hole Effect
|
||||
&Spell::EffectActivateRune, //146 SPELL_EFFECT_ACTIVATE_RUNE
|
||||
&Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail
|
||||
|
|
@ -9958,3 +9958,24 @@ void Spell::EffectCancelAura(SpellEffectEntry const* effect)
|
|||
|
||||
unitTarget->RemoveAurasDueToSpell(spellId);
|
||||
}
|
||||
|
||||
void Spell::EffectKnockBackFromPosition(SpellEffectIndex eff_idx)
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
||||
{
|
||||
x = m_targets.m_destX;
|
||||
y = m_targets.m_destY;
|
||||
z = m_targets.m_destZ;
|
||||
}
|
||||
else
|
||||
m_caster->GetPosition(x, y, z);
|
||||
|
||||
float angle = unitTarget->GetAngle(x,y) + M_PI_F;
|
||||
float horizontalSpeed = m_spellInfo->EffectMiscValue[eff_idx] * 0.1f;
|
||||
float verticalSpeed = damage * 0.1f;
|
||||
unitTarget->KnockBackWithAngle(angle, horizontalSpeed, verticalSpeed);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue