mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +00:00
Add formatted and simple message. npc say should work now; though we should consider moving them to what live uses "OP_SpecialMesg"
This commit is contained in:
parent
11636225b1
commit
e74d4b6e67
@ -2544,47 +2544,32 @@ namespace Laurion
|
||||
|
||||
FormattedMessage_Struct* emu = (FormattedMessage_Struct*)in->pBuffer;
|
||||
|
||||
unsigned char* __emu_buffer = in->pBuffer;
|
||||
|
||||
char* old_message_ptr = (char*)in->pBuffer;
|
||||
old_message_ptr += sizeof(FormattedMessage_Struct);
|
||||
|
||||
|
||||
std::string old_message_array[9];
|
||||
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (*old_message_ptr == 0) { break; }
|
||||
old_message_array[i] = old_message_ptr;
|
||||
old_message_ptr += old_message_array[i].length() + 1;
|
||||
}
|
||||
|
||||
uint32 new_message_size = 0;
|
||||
std::string new_message_array[9];
|
||||
SerializeBuffer buffer;
|
||||
buffer.WriteUInt32(emu->unknown0);
|
||||
buffer.WriteUInt8(0); // Observed
|
||||
buffer.WriteUInt32(emu->string_id);
|
||||
buffer.WriteUInt32(emu->type);
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (old_message_array[i].length() == 0) { break; }
|
||||
new_message_array[i] = old_message_array[i];
|
||||
//ServerToRoF2SayLink(new_message_array[i], old_message_array[i]);
|
||||
new_message_size += new_message_array[i].length() + 1;
|
||||
buffer.WriteLengthString(old_message_array[i]);
|
||||
}
|
||||
|
||||
in->size = sizeof(FormattedMessage_Struct) + new_message_size + 1;
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
auto outapp = new EQApplicationPacket(OP_FormattedMessage, buffer.size());
|
||||
outapp->WriteData(buffer.buffer(), buffer.size());
|
||||
dest->FastQueuePacket(&outapp, ack_req);
|
||||
|
||||
char* OutBuffer = (char*)in->pBuffer;
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->unknown0);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->string_id);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->type);
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (new_message_array[i].length() == 0) { break; }
|
||||
VARSTRUCT_ENCODE_STRING(OutBuffer, new_message_array[i].c_str());
|
||||
}
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, OutBuffer, 0);
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
delete in;
|
||||
}
|
||||
|
||||
// DECODE methods
|
||||
|
||||
@ -181,8 +181,8 @@ OP_LinkedReuse=0x0000
|
||||
OP_SwapSpell=0x0000
|
||||
OP_CastSpell=0x0000
|
||||
OP_Consider=0x0000
|
||||
OP_FormattedMessage=0x0000
|
||||
OP_SimpleMessage=0x0000
|
||||
OP_FormattedMessage=0x7f7f
|
||||
OP_SimpleMessage=0x1943
|
||||
OP_Buff=0x0000
|
||||
OP_Illusion=0x0000
|
||||
OP_MoneyOnCorpse=0x0000
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user