--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-07 12:00:37 -06:00
4 changed files with 43 additions and 33 deletions

View File

@@ -208,7 +208,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::EffectActivateRune, //146 SPELL_EFFECT_ACTIVATE_RUNE
&Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail
@@ -6190,17 +6190,33 @@ 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;
float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
float speedz = float(damage/-10);
float speedz = float(damage/-10);
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
data.append(unitTarget->GetPackGUID());