summaryrefslogtreecommitdiff
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.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d8dcba2d5b..7e44054907 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2429,8 +2429,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
}
break;
}
- case SUMMON_TYPE_JEEVES:
case SUMMON_TYPE_MINIPET:
+ // For companions, recalculate the position to ensure they spawn at the intended π/4 angle.
+ destTarget->Relocate(m_originalCaster->GetNearPosition(
+ m_originalCaster->GetDistance2d(destTarget->GetPositionX(), destTarget->GetPositionY()),
+ MINI_PET_SUMMON_ANGLE
+ ));
+ [[fallthrough]];
+ case SUMMON_TYPE_JEEVES:
{
summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn);
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
@@ -2446,8 +2452,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
//summon->AI()->EnterEvadeMode();
if (properties->Type != SUMMON_TYPE_JEEVES)
{
+ summon->SetFacingToObject(m_originalCaster);
summon->GetMotionMaster()->Clear(false);
- summon->GetMotionMaster()->MoveFollow(m_originalCaster, PET_FOLLOW_DIST, summon->GetFollowAngle(), MOTION_SLOT_ACTIVE);
+ summon->GetMotionMaster()->MoveFollow(m_originalCaster, PET_FOLLOW_DIST, MINI_PET_FOLLOW_ANGLE, MOTION_SLOT_ACTIVE);
}
break;
}
@@ -4155,8 +4162,8 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8);
data << pGameObj->GetGUID();
data << caster->GetGUID();
- caster->GetSession()->SendPacket(&data);
- target->GetSession()->SendPacket(&data);
+ caster->SendDirectMessage(&data);
+ target->SendDirectMessage(&data);
// create duel-info
bool isMounted = (GetSpellInfo()->Id == 62875);
@@ -4238,7 +4245,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/)
data << m_caster->GetGUID(); // summoner guid
data << uint32(m_caster->GetZoneId()); // summoner zone
data << uint32(MAX_PLAYER_SUMMON_DELAY * IN_MILLISECONDS); // auto decline after msecs
- player->GetSession()->SendPacket(&data);
+ player->SendDirectMessage(&data);
}
void Spell::EffectActivateObject(SpellEffIndex effIndex)
@@ -5206,7 +5213,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
{
// Position passed to SummonPet is irrelevant with current implementation,
// pet will be relocated without using these coords in Pet::LoadPetFromDB
- player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0s, damage);
+ player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0ms, damage);
return;
}
@@ -6338,5 +6345,5 @@ void Spell::EffectSummonRaFFriend(SpellEffIndex /*effIndex*/)
data << m_caster->GetGUID();
data << uint32(m_caster->GetZoneId());
data << uint32(MAX_PLAYER_SUMMON_DELAY * IN_MILLISECONDS); // auto decline after msecs
- player->GetSession()->SendPacket(&data);
+ player->SendDirectMessage(&data);
}