Core/Chat: Fix BuildChatPacket calls so scripts that use OnPlayerChat can actually change the text

Closes #11625