mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
*Fix knockback effect.
--HG-- branch : trunk
This commit is contained in:
@@ -665,7 +665,7 @@ enum SpellEffects
|
||||
SPELL_EFFECT_141 = 141,
|
||||
SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142,
|
||||
SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143,
|
||||
SPELL_EFFECT_144 = 144,
|
||||
SPELL_EFFECT_KNOCK_BACK_2 = 144,
|
||||
SPELL_EFFECT_145 = 145,
|
||||
SPELL_EFFECT_146 = 146,
|
||||
SPELL_EFFECT_QUEST_FAIL = 147,
|
||||
|
||||
@@ -207,7 +207,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::EffectKnockBack, //144 SPELL_EFFECT_KNOCK_BACK_2 Spectral Blast
|
||||
&Spell::EffectNULL, //145 SPELL_EFFECT_145 Black Hole Effect
|
||||
&Spell::EffectUnused, //146 SPELL_EFFECT_146 unused
|
||||
&Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail
|
||||
@@ -5856,15 +5856,31 @@ void Spell::EffectSummonCritter(uint32 i)
|
||||
|
||||
void Spell::EffectKnockBack(uint32 i)
|
||||
{
|
||||
if(!unitTarget || !m_caster)
|
||||
if(!unitTarget)
|
||||
return;
|
||||
|
||||
// Effect only works on players
|
||||
if(unitTarget->GetTypeId()!=TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
float vsin = sin(m_caster->GetAngle(unitTarget));
|
||||
float vcos = cos(m_caster->GetAngle(unitTarget));
|
||||
float x, y;
|
||||
if(m_targets.HasDest())
|
||||
{
|
||||
x = m_targets.m_destX;
|
||||
y = m_targets.m_destY;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = m_caster->GetPositionX();
|
||||
y = m_caster->GetPositionX();
|
||||
}
|
||||
|
||||
float dx = unitTarget->GetPositionX() - x;
|
||||
float dy = unitTarget->GetPositionY() - y;
|
||||
float dist = sqrt((dx*dx) + (dy*dy));
|
||||
|
||||
float vsin = dx / dist;
|
||||
float vcos = dy / dist;
|
||||
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
|
||||
data.append(unitTarget->GetPackGUID());
|
||||
|
||||
Reference in New Issue
Block a user