Core/PacketIO: Implemented CMSG_CHECK_IS_ADVENTURE_MAP_POI_VALID and SMSG_PLAYER_IS_ADVENTURE_MAP_POI_VALID

Port From (https://github.com/TrinityCore/TrinityCore/commit/f6646739908215311f110842ed41055a54dae1f0)
This commit is contained in:
hondacrx
2024-02-24 16:13:14 -05:00
parent fa5e0f0c14
commit 03253f0d28
2 changed files with 63 additions and 2 deletions
@@ -5,12 +5,44 @@ using Framework.Constants;
using Game.DataStorage;
using Game.Networking;
using Game.Networking.Packets;
using System.Collections.Generic;
using System.Linq;
namespace Game
{
public partial class WorldSession
{
[WorldPacketHandler(ClientOpcodes.CheckIsAdventureMapPoiValid)]
void HandleCheckIsAdventureMapPoiValid(CheckIsAdventureMapPoiValid checkIsAdventureMapPoiValid)
{
AdventureMapPOIRecord entry = CliDB.AdventureMapPOIStorage.LookupByKey(checkIsAdventureMapPoiValid.AdventureMapPoiID);
if (entry == null)
return;
void sendIsPoiValid(uint adventureMapPoiId, bool isVisible)
{
PlayerIsAdventureMapPoiValid isMapPoiValid = new();
isMapPoiValid.AdventureMapPoiID = adventureMapPoiId;
isMapPoiValid.IsVisible = isVisible;
SendPacket(isMapPoiValid);
};
Quest quest = Global.ObjectMgr.GetQuestTemplate(entry.QuestID);
if (quest == null)
{
sendIsPoiValid(entry.Id, false);
return;
}
if (!_player.MeetPlayerCondition(entry.PlayerConditionID))
{
sendIsPoiValid(entry.Id, false);
return;
}
sendIsPoiValid(entry.Id, true);
}
[WorldPacketHandler(ClientOpcodes.AdventureMapStartQuest)]
void HandleAdventureMapStartQuest(AdventureMapStartQuest startQuest)
{