Core/PacketIO: Implemented SMSG_BROADCAST_SUMMON_CAST and SMSG_BROADCAST_SUMMON_RESPONSE

Port From (https://github.com/TrinityCore/TrinityCore/commit/a12f93907083c1c7a8e6a33a3c1724625395af7e)
This commit is contained in:
hondacrx
2022-06-02 20:19:55 -04:00
parent 30a287503f
commit 69970e6acd
2 changed files with 62 additions and 3 deletions
+27
View File
@@ -2082,7 +2082,16 @@ namespace Game.Entities
summonRequest.SummonerVirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
summonRequest.AreaID = (int)summoner.GetZoneId();
SendPacket(summonRequest);
Group group = GetGroup();
if (group != null)
{
BroadcastSummonCast summonCast = new();
summonCast.Target = GetGUID();
group.BroadcastPacket(summonCast, false, -1, GetGUID());
}
}
public bool IsInAreaTriggerRadius(AreaTriggerRecord trigger)
{
if (trigger == null)
@@ -2114,15 +2123,31 @@ namespace Game.Entities
public void SummonIfPossible(bool agree)
{
void broadcastSummonResponse(bool accepted)
{
Group group = GetGroup();
if (group != null)
{
BroadcastSummonResponse summonResponse = new();
summonResponse.Target = GetGUID();
summonResponse.Accepted = accepted;
group.BroadcastPacket(summonResponse, false, -1, GetGUID());
}
}
if (!agree)
{
m_summon_expire = 0;
broadcastSummonResponse(false);
return;
}
// expire and auto declined
if (m_summon_expire < GameTime.GetGameTime())
{
broadcastSummonResponse(false);
return;
}
// stop taxi flight at summon
FinishTaxiFlight();
@@ -2140,6 +2165,8 @@ namespace Game.Entities
m_summon_location.SetOrientation(GetOrientation());
TeleportTo(m_summon_location);
broadcastSummonResponse(true);
}
public override void OnPhaseChange()