Lesson # 1
Introduction :
This is simply , modifying the core to change how the global announcement looks like.I will show you here mostly every single way I know how to modify it , and this are one of my favorite modification's.
Step 1 :
First lets get Level1.cpp thats included ( scr/game/level1.cpp )
#right click it and click on edit.
# first you will see Announce , which in this case is .announce , and what you see is this.
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;
}
Alright let me explain a little bit how this works.
# Whats in LIGHT BLUE is the color code for C++ , you can change this to any color code you want.
#Whats in YELLOW are the symbols that appear and after GM for example <GM> , you may also take that out for no symbol to appear , or change it to any symbol.
#Whats in ORANGE is just a notice to let member know, you may delet this or change it. For example lets say i decide to change it to (NOTICE) , instead of broadcats , (NOTICE) will appear.
#Whats in PINK you may or delete them depending on what you want.
#If you delet
Code:
if(m_session->CanUseCommand('z')) input2+="Admin";
#If your an ADMIN of the server , ADMIN before your name wont appear.
# If you delete
Code:
else if(m_session->GetPermissionCount()) input2+="GM";
#And your a GM of the server , GM wont appear before your name in the message
#Lets say you also decide to take out
Code:
input2+=m_session->GetPlayer()->GetName();
#Your name wont appeare at all in the message.
==========================================
#Lets get to a solution , lets say you delet everything that can be deleted , and change to what you want , but the example bellow will be how i like it to be.
The message will appear like this in the CHATBOX
Code:
(NOTICE) Hi this is just testing
===========================================
.Wannounce is the same way of editing. If you get stuck somewhere you may ask here and I will help.
Also there is a cool way on just modifying 1 command , so both wannounce and announce appears at same time , so you dont have to do both of them ( saves time )
If you would like to know about that , than ask I will release it with a guide in this thread.
Thats all folks , Enjoy