You might of seen a server were when the GM did an announcement it said something like "<Superman>Bob broadcast:Hi i own batman" or something like that . Well today ill show you how to do just that on your server.
example of what im talking about .
Example 1
Example 2
Ok first things first you will need to download the ascent source .There are plenty of guides out there on how to download the ascent source and Ascentemu.com is down or i would link to there wiki page.
Now after you got the ascent source your going to have to navigate to
Code:
foldername/trunk(orXXX stable/src/ascentworld/level1.cpp
Now open up level1.cpp with your favorite text editor .
inside you will need to find
Code:
bool ChatHandler::HandleAnnounceCommand(const char* args, WorldSession *m_session)
{
if(!*args)
return false;
char pAnnounce[1024];
string input2;
input2 = "|cffff6060<";
//if (m_session->GetPermissionCount()) input2+="GM";
if(m_session->CanUseCommand('z')) input2+="Admin";
else if(m_session->GetPermissionCount()) input2+="GM";
input2+=">|r|c1f40af20";
input2+=m_session->GetPlayer()->GetName();
input2+="|r|cffffffff broadcasts: |r";
snprintf((char*)pAnnounce, 1024, "%s%s", input2.c_str(), args); // Adds BROADCAST:
sWorld.SendWorldText(pAnnounce); // send message
sGMLog.writefromsession(m_session, "used announce command, [%s]", args);
//sWorld.SendForcedIRCMessage(pAnnounce);
return true;
}
bool ChatHandler::HandleWAnnounceCommand(const char* args, WorldSession *m_session)
{
if(!*args)
return false;
char pAnnounce[1024];
string input2;
input2 = "|cffff6060<";
if(m_session->CanUseCommand('z')) input2+="Admin";
else if(m_session->GetPermissionCount()) input2+="GM";
input2+=">|r|c1f40af20";
input2+=m_session->GetPlayer()->GetName();
input2+=":|r ";
snprintf((char*)pAnnounce, 1024, "%s%s", input2.c_str(), args);
sWorld.SendWorldWideScreenText(pAnnounce); // send message
sGMLog.writefromsession(m_session, "used wannounce command [%s]", args);
//sWorld.SendForcedIRCMessage(pAnnounce);
return true;
these control what when an announcement is being made.Ok now to change when an announcement is being made jest modify
Code:
//if (m_session->GetPermissionCount()) input2+="GM";
if(m_session->CanUseCommand('z')) input2+="Admin";
else if(m_session->GetPermissionCount()) input2+="GM";
to
Code:
//if (m_session->GetPermissionCount()) input2+="GM";
if(m_session->CanUseCommand('z')) input2+="XXXXX";
else if(m_session->GetPermissionCount()) input2+="XXXX";
You could even change
Code:
if(m_session->CanUseCommand('z'))
to allow GM with ' a' command to use the <Admin> title or what ever title you want.
Code:
if(m_session->CanUseCommand('a'))
after you edited the fields to what you desire save it and compile ascent normally .At the moment im also working on how to change what title it gives when talking in chant channels .