mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
[7445] Implement SPELL_EFFECT_JUMP2 used in some jump to target (unit/go/coordinates) spells.
This commit is contained in:
parent
1ed2f1e65d
commit
b71759d204
3 changed files with 50 additions and 2 deletions
|
|
@ -249,6 +249,7 @@ class Spell
|
||||||
void EffectSummonWild(uint32 i);
|
void EffectSummonWild(uint32 i);
|
||||||
void EffectSummonGuardian(uint32 i);
|
void EffectSummonGuardian(uint32 i);
|
||||||
void EffectHealMechanical(uint32 i);
|
void EffectHealMechanical(uint32 i);
|
||||||
|
void EffectJump(uint32 i);
|
||||||
void EffectTeleUnitsFaceCaster(uint32 i);
|
void EffectTeleUnitsFaceCaster(uint32 i);
|
||||||
void EffectLearnSkill(uint32 i);
|
void EffectLearnSkill(uint32 i);
|
||||||
void EffectAddHonor(uint32 i);
|
void EffectAddHonor(uint32 i);
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||||
&Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE
|
&Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE
|
||||||
&Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD
|
&Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD
|
||||||
&Spell::EffectUnused, // 41 SPELL_EFFECT_JUMP
|
&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::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
|
||||||
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
|
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
|
||||||
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
|
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
|
||||||
|
|
@ -1997,6 +1997,53 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx)
|
||||||
m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, 0, m_originalCasterGUID);
|
m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, 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)
|
void Spell::EffectTeleportUnits(uint32 i)
|
||||||
{
|
{
|
||||||
if(!unitTarget || unitTarget->isInFlight())
|
if(!unitTarget || unitTarget->isInFlight())
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7444"
|
#define REVISION_NR "7445"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue