diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-12-04 15:13:20 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-12-04 15:13:20 +0100 |
commit | e98e1283ea0034baf6be9aa2ffb386eb5582801b (patch) | |
tree | b1dd854d88e6e049d26b208bb259cdc7d31f29f8 /src/server/game/Handlers/NPCHandler.cpp | |
parent | de7c03c8385780f05530c2b3cf952a712d5f8f00 (diff) |
Core: Updated to 10.0.2
Diffstat (limited to 'src/server/game/Handlers/NPCHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/NPCHandler.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index d19a83da7a7..644ae8e9881 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -29,7 +29,6 @@ #include "Item.h" #include "ItemPackets.h" #include "Log.h" -#include "MailPackets.h" #include "Map.h" #include "NPCPackets.h" #include "ObjectMgr.h" @@ -39,7 +38,6 @@ #include "ReputationMgr.h" #include "SpellInfo.h" #include "Trainer.h" -#include "World.h" #include "WorldPacket.h" enum class StableResult : uint8 @@ -71,16 +69,20 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPackets::NPC::Hello& pa void WorldSession::SendTabardVendorActivate(ObjectGuid guid) { - WorldPackets::NPC::PlayerTabardVendorActivate packet; - packet.Vendor = guid; - SendPacket(packet.Write()); + WorldPackets::NPC::NPCInteractionOpenResult npcInteraction; + npcInteraction.Npc = guid; + npcInteraction.InteractionType = PlayerInteractionType::TabardVendor; + npcInteraction.Success = true; + SendPacket(npcInteraction.Write()); } void WorldSession::SendShowMailBox(ObjectGuid guid) { - WorldPackets::Mail::ShowMailbox packet; - packet.PostmasterGUID = guid; - SendPacket(packet.Write()); + WorldPackets::NPC::NPCInteractionOpenResult npcInteraction; + npcInteraction.Npc = guid; + npcInteraction.InteractionType = PlayerInteractionType::MailInfo; + npcInteraction.Success = true; + SendPacket(npcInteraction.Write()); } void WorldSession::HandleTrainerListOpcode(WorldPackets::NPC::Hello& packet) @@ -188,7 +190,8 @@ void WorldSession::HandleGossipHelloOpcode(WorldPackets::NPC::Hello& packet) void WorldSession::HandleGossipSelectOptionOpcode(WorldPackets::NPC::GossipSelectOption& packet) { - if (!_player->PlayerTalkClass->GetGossipMenu().GetItem(packet.GossipIndex)) + GossipMenuItem const* gossipMenuItem = _player->PlayerTalkClass->GetGossipMenu().GetItem(packet.GossipOptionID); + if (!gossipMenuItem) return; // Prevent cheating on C++ scripted menus @@ -242,26 +245,26 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPackets::NPC::GossipSelec { if (unit) { - if (!unit->AI()->OnGossipSelectCode(_player, packet.GossipID, packet.GossipIndex, packet.PromotionCode.c_str())) - _player->OnGossipSelect(unit, packet.GossipIndex, packet.GossipID); + if (!unit->AI()->OnGossipSelectCode(_player, packet.GossipID, gossipMenuItem->OrderIndex, packet.PromotionCode.c_str())) + _player->OnGossipSelect(unit, packet.GossipOptionID, packet.GossipID); } else { - if (!go->AI()->OnGossipSelectCode(_player, packet.GossipID, packet.GossipIndex, packet.PromotionCode.c_str())) - _player->OnGossipSelect(go, packet.GossipIndex, packet.GossipID); + if (!go->AI()->OnGossipSelectCode(_player, packet.GossipID, gossipMenuItem->OrderIndex, packet.PromotionCode.c_str())) + _player->OnGossipSelect(go, packet.GossipOptionID, packet.GossipID); } } else { if (unit) { - if (!unit->AI()->OnGossipSelect(_player, packet.GossipID, packet.GossipIndex)) - _player->OnGossipSelect(unit, packet.GossipIndex, packet.GossipID); + if (!unit->AI()->OnGossipSelect(_player, packet.GossipID, gossipMenuItem->OrderIndex)) + _player->OnGossipSelect(unit, packet.GossipOptionID, packet.GossipID); } else { - if (!go->AI()->OnGossipSelect(_player, packet.GossipID, packet.GossipIndex)) - _player->OnGossipSelect(go, packet.GossipIndex, packet.GossipID); + if (!go->AI()->OnGossipSelect(_player, packet.GossipID, gossipMenuItem->OrderIndex)) + _player->OnGossipSelect(go, packet.GossipOptionID, packet.GossipID); } } } |