diff options
-rw-r--r-- | src/game/Spell.h | 1 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 49 |
2 files changed, 49 insertions, 1 deletions
diff --git a/src/game/Spell.h b/src/game/Spell.h index 22fbd7bb25f..e8cdc3dc3b2 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -279,6 +279,7 @@ class Spell void EffectSummonWild(uint32 i); void EffectSummonGuardian(uint32 i); void EffectHealMechanical(uint32 i); + void EffectJump(uint32 i); void EffectTeleUnitsFaceCaster(uint32 i); void EffectLearnSkill(uint32 i); void EffectAddHonor(uint32 i); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index b9eb8af9e02..433a5e096e9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -105,7 +105,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE &Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD &Spell::EffectUnused, // 41 SPELL_EFFECT_JUMP - &Spell::EffectUnused, // 42 SPELL_EFFECT_JUMP2 + &Spell::EffectJump, // 42 SPELL_EFFECT_JUMP2 &Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER &Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP &Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related @@ -2166,6 +2166,53 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx) m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo->Id, true, m_CastItem, 0, m_originalCasterGUID); } +void Spell::EffectJump(uint32 i) +{ + if(m_caster->isInFlight()) + return; + + // Init dest coordinates + float x,y,z,o; + if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + { + x = m_targets.m_destX; + y = m_targets.m_destY; + z = m_targets.m_destZ; + o = m_caster->GetOrientation(); + } + else if(unitTarget) + { + x = unitTarget->GetPositionX(); + y = unitTarget->GetPositionY(); + z = unitTarget->GetPositionZ(); + o = m_spellInfo->EffectImplicitTargetA[i] == TARGET_BEHIND_VICTIM + ? unitTarget->GetOrientation() + : m_caster->GetOrientation(); + } + else if(gameObjTarget) + { + x = gameObjTarget->GetPositionX(); + y = gameObjTarget->GetPositionY(); + z = gameObjTarget->GetPositionZ(); + o = m_caster->GetOrientation(); + } + else + return; + + + // Teleport + if(m_caster->GetTypeId() == TYPEID_PLAYER) + ((Player*)m_caster)->TeleportTo(m_caster->GetMapId(), x, y, z, o, + TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0)); + else + { + m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, x, y, z, o); + WorldPacket data; + m_caster->BuildTeleportAckMsg(&data, x, y, z, o); + m_caster->SendMessageToSet(&data, false); + } +} + void Spell::EffectTeleportUnits(uint32 i) { if(!unitTarget || unitTarget->isInFlight()) |