+Rep also fixed it to include Death Knight Creation, Haven't Tested CODE:
Code:
/*
Author: insanesk8123
Date: 9/25/08
Edited by Karyuudo/Dante
Date:11/21/08
Purpose: make a greeting for new characters
todo: nothing right now
*/
#include "StdAfx.h"
#include "Setup.h"
#include <ScriptSetup.h>
#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
void NewCharacter(Player* Plr)
{
char welcomeStr[255]; //final string to be displayed
plrInfo classInfo;
plrInfo raceInfo;
/* Getting integer info for class and race */
classInfo.intForm = Plr->getClass();
raceInfo.intForm = Plr->getRace();
//turning the int class id into a string
switch(classInfo.intForm)
{
case 1:
classInfo.strForm = "Warrior";
break;
case 2:
classInfo.strForm = "Paladin";
break;
case 3:
classInfo.strForm = "Hunter";
break;
case 4:
classInfo.strForm = "Rogue";
break;
case 5:
classInfo.strForm = "Priest";
break;
case 6:
classInfo.strForm = "Death Knight";
break;
case 7:
classInfo.strForm = "Shaman";
break;
case 8:
classInfo.strForm = "Mage";
break;
case 9:
classInfo.strForm = "Warlock";
break;
case 11:
classInfo.strForm = "Druid";
break;
default:
classInfo.strForm = "";
break;
}
//turning the int race id into a string
switch(raceInfo.intForm)
{
case 1:
raceInfo.strForm = "Human";
break;
case 2:
raceInfo.strForm = "Orc";
break;
case 3:
raceInfo.strForm = "Dwarf";
break;
case 4:
raceInfo.strForm = "Night Elf";
break;
case 5:
raceInfo.strForm = "Undead";
break;
case 6:
raceInfo.strForm = "Tauren";
break;
case 7:
raceInfo.strForm = "Gnome";
break;
case 8:
raceInfo.strForm = "Troll";
break;
case 10:
raceInfo.strForm = "Blood Elf";
break;
case 11:
raceInfo.strForm = "Draenei";
break;
default:
raceInfo.strForm = "";
break;
}
//combines all the strings into one message
sprintf(welcomeStr,"[|cff00ff00News!|r]Give a warm welcome to |cff00ccff%s|r the |cffff0000%s|r |cffff00ff%s|r.",Plr->GetName(), raceInfo.strForm, classInfo.strForm);
//displays the message to the world
sWorld.SendWorldText(welcomeStr);
}
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD, &NewCharacter);
}
btw i fail at compiling .dll's i just fixed the script, my dev is going to compile it when i get back on, reason i fail is cause most of the guides make my brain explode.