aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp46
1 files changed, 3 insertions, 43 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2a42961df1b..b9c4b6408ac 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -94,7 +94,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectUnused, // 26 SPELL_EFFECT_DEFENSE one spell: Defense
&Spell::EffectPersistentAA, // 27 SPELL_EFFECT_PERSISTENT_AREA_AURA
&Spell::EffectSummonType, // 28 SPELL_EFFECT_SUMMON
- &Spell::EffectLeapForward, // 29 SPELL_EFFECT_LEAP
+ &Spell::EffectLeap, // 29 SPELL_EFFECT_LEAP
&Spell::EffectEnergize, // 30 SPELL_EFFECT_ENERGIZE
&Spell::EffectWeaponDmg, // 31 SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
&Spell::EffectTriggerMissileSpell, // 32 SPELL_EFFECT_TRIGGER_MISSILE
@@ -6995,7 +6995,7 @@ void Spell::EffectBlock(uint32 /*i*/)
unitTarget->ToPlayer()->SetCanBlock(true);
}
-void Spell::EffectLeapForward(uint32 i)
+void Spell::EffectLeap(uint32 i)
{
if (unitTarget->isInFlight())
return;
@@ -7003,47 +7003,7 @@ void Spell::EffectLeapForward(uint32 i)
if (!m_targets.HasDst())
return;
- uint32 mapid = m_caster->GetMapId();
- float dist = m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
- if (Player* modOwner = m_originalCaster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, dist);
-
- float x,y,z;
- float destx,desty,destz,ground,floor;
- float orientation = unitTarget->GetOrientation(), step = dist/10.0f;
-
- unitTarget->GetPosition(x,y,z);
- destx = x + dist * cos(orientation);
- desty = y + dist * sin(orientation);
- ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true);
- floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true);
- destz = fabs(ground - z) <= fabs(floor - z) ? ground : floor;
-
- bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(mapid,x,y,z+0.5f,destx,desty,destz+0.5f,destx,desty,destz,-0.5f);
-
- if (col) // We had a collision!
- {
- destx -= 0.6 * cos(orientation);
- desty -= 0.6 * sin(orientation);
- dist = sqrt((x-destx)*(x-destx) + (y-desty)*(y-desty));
- step = dist/10.0f;
- }
-
- int j = 0;
- for (j; j < 10; j++)
- {
- if (fabs(z - destz) > 6)
- {
- destx -= step * cos(orientation);
- desty -= step * sin(orientation);
- ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true);
- floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true);
- destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor;
- } else break;
- }
-
- if (j < 10)
- unitTarget->NearTeleportTo(destx, desty, destz + 0.07531, orientation, unitTarget == m_caster);
+ unitTarget->NearTeleportTo(m_targets.m_dstPos.GetPositionX(), m_targets.m_dstPos.GetPositionY(), m_targets.m_dstPos.GetPositionZ(), m_targets.m_dstPos.GetOrientation(), unitTarget == m_caster);
}
void Spell::EffectReputation(uint32 i)