First, character " is restricted for use in chat (it sends a command "chat \"Something\n\"").
If you'll read the "Creating plugins for JAZZ tutorial", you'll see an example of printing chat:
Code
int sv_maxclients = JASS_GETINTCVAR("sv_maxclients");
char *chat = JASS_VARARGS("chat \"%s\n\"", "What_you_want_to_print");
g_syscall(G_SEND_SERVER_COMMAND, PlayerNum, chat );
}
So, replacing name in chat is very simple. Hook a G_SEND_SERVER_COMMAND (it is described in the tutorial), then, replace @myname in string (be careful with length, it's may be unsafe), or block this chat string and generate new one like:
Code
if(cmd == G_SEND_SERVER_COMMAND){
...searching for @myname...
char *chat = JASS_VARARGS("chat \"%s\n\"", generatedString);
g_syscall(G_SEND_SERVER_COMMAND, -1, chat );
JASS_RET_SUPERCEDE (1);
}
I'm not sure about target_print. If it's going through server, it could be hooked via JASS the same way, but I haven't checked it out.