Playerbot helper

This commit is contained in:
antony
2024-07-31 17:24:20 +02:00
parent e6fa5732dc
commit bba6c86364
4 changed files with 91 additions and 10 deletions

View File

@@ -34,6 +34,17 @@ class WorldObject;
struct GameTele;
enum PlayerChatTag
{
CHAT_TAG_NONE = 0x00,
CHAT_TAG_AFK = 0x01,
CHAT_TAG_DND = 0x02,
CHAT_TAG_GM = 0x04,
CHAT_TAG_COM = 0x08, // Commentator
CHAT_TAG_DEV = 0x10, // Developer
};
typedef uint32 ChatTagFlags;
class AC_GAME_API ChatHandler
{
public:
@@ -48,6 +59,13 @@ public:
// Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string_view message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE);
// All in one chat message builder
static void BuildChatPacket(
WorldPacket& data, ChatMsg msgtype, std::string_view message, Language language = LANG_UNIVERSAL, PlayerChatTag chatTag = CHAT_TAG_NONE,
ObjectGuid const& senderGuid = ObjectGuid(), std::string_view senderName = nullptr,
ObjectGuid const& targetGuid = ObjectGuid(), std::string_view targetName = nullptr,
std::string_view channelName = nullptr, uint32 achievementId = 0);
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
// function with different implementation for chat/console