From 34496c49b48488a629bd251b827acd7c50eee827 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 24 Sep 2014 13:14:20 -0400 Subject: [PATCH] Add Client::SendColoredText(uint32 color, std::string message) This will send a message (arbitrary size limit of 512) to the client of the provided color. The MT colors should work here. --- zone/client.cpp | 15 +++++++++++++++ zone/client.h | 1 + 2 files changed, 16 insertions(+) diff --git a/zone/client.cpp b/zone/client.cpp index 62b903802..964f228d1 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -8313,3 +8313,18 @@ float Client::GetQuiverHaste() quiver_haste = 1.0f / (1.0f + static_cast(quiver_haste) / 100.0f); return quiver_haste; } + +void Client::SendColoredText(uint32 color, std::string message) +{ + // arbitrary size limit + if (message.size() > 512) // live does send this with empty strings sometimes ... + return; + EQApplicationPacket *outapp = new EQApplicationPacket(OP_ColoredText, + sizeof(ColoredText_Struct) + message.size()); + ColoredText_Struct *cts = (ColoredText_Struct *)outapp->pBuffer; + cts->color = color; + strcpy(cts->msg, message.c_str()); + QueuePacket(outapp); + safe_delete(outapp); +} + diff --git a/zone/client.h b/zone/client.h index 0ad8b043a..235861396 100644 --- a/zone/client.h +++ b/zone/client.h @@ -255,6 +255,7 @@ public: const char *message7 = nullptr, const char *message8 = nullptr, const char *message9 = nullptr); void Tell_StringID(uint32 string_id, const char *who, const char *message); + void SendColoredText(uint32 color, std::string message); void SendBazaarResults(uint32 trader_id,uint32 class_,uint32 race,uint32 stat,uint32 slot,uint32 type,char name[64],uint32 minprice,uint32 maxprice); void SendTraderItem(uint32 item_id,uint16 quantity); uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity);