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.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d8dcba2d5b..8bb4c793ef 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1,14 +1,14 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published by the
- * Free Software Foundation; either version 3 of the License, or (at your
- * option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
@@ -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);
}