IF YOU ARE USING A REPACK YOU CANNOT ADD SCRIPTS. LEARN TO COMPILE YOUR OWN CORE.


  • Support for multiple colour choices
  • Takes into account the player's gender
  • Takes into account whether the player is in a group




Here it is: C++ code - 33 lines - codepad
Version 2: C++ code - 33 lines - codepad
Version 3: C++ code - 32 lines - codepad


Changelog:
Code:
3
Moved code around to improve performance
2
Fixed a minor grammatical error in the script

Instructions




1. Download the raw file from http://codepad.org/zzDF4l6y/raw.cpp
2. Move that file to \src\server\scripts\Custom in your TrinityCore folder
3. Rename the file from raw.cpp to custom_bossannounce.cpp (it might just say "raw" instead of "raw.cpp" if you have file extensions hidden, in this case rename it to "custom_bossannounce")
4. Change CMakeLists.txt so that it looks something like:


Code:
set(scripts_STAT_SRCS
  ${scripts_STAT_SRCS}
Custom/custom_bossannounce.cpp
)

5. Go to \src\server\game\Scripting and open ScriptLoader.cpp
6. Scroll to the bottom of the file and change it to look like this:


Code:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
    void AddSC_Boss_Announcer();
#endif


void AddCustomScripts()
{
#ifdef SCRIPTS
    /* This is where custom scripts should be added. */
    AddSC_Boss_Announcer();
#endif
}

7. Re-create your CMake files by running CMake and pressing Configure then Generate


And you're done! Please leave any bugs/feedback in this thread and I'll try to address them when I can.


Peace out~


Evilfairy