Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include <cstring>
- //This function is called when the player logs in (every login)
- void OnLogin(Player* pPlayer)
- {
- std::string ClassNameString = "";
- switch (pPlayer->getClass())
- {
- case CLASS_WARRIOR:
- ClassNameString = "|cffC79C6E";
- break;
- case CLASS_PALADIN:
- ClassNameString = "|cffF58CBA";
- break;
- case CLASS_HUNTER:
- ClassNameString = "|cffABD473";
- break;
- case CLASS_ROGUE:
- ClassNameString = "|cffFFF569";
- break;
- case CLASS_PRIEST:
- ClassNameString = "|cffFFFFFF";
- break;
- case CLASS_SHAMAN:
- ClassNameString = "|cff0070DE";
- break;
- case CLASS_MAGE:
- ClassNameString = "|cff69CCF0";
- break;
- case CLASS_WARLOCK:
- ClassNameString = "|cff9482C9";
- break;
- case CLASS_DRUID:
- ClassNameString = "|cffFF7D0A";
- break;
- }
- if(pPlayer->GetTotalPlayedTime() <= 5)
- {
- if (pPlayer->GetTeam() == HORDE)
- {
- std:: string pname;
- pname = pPlayer->GetName();
- char ragezone[250];
- snprintf(ragezone, 250, "|TInterface\\ICONS\\INV_BannerPVP_01:15|t |CFFFE8A0EWelCome New Player%s %s|r |CFFFE8A0ETo |CFFE55BB0CruSader-WoW", ClassNameString.c_str(), pname.c_str());
- sWorld.SendGlobalText(ragezone,0);
- pPlayer->CastSpell(pPlayer,45153,false);
- return;
- }
- else
- {
- std:: string pname;
- pname = pPlayer->GetName();
- char ragezone[250];
- snprintf(ragezone, 250, "|TInterface\\ICONS\\INV_BannerPVP_02:15|t |CFFFE8A0EWelCome New Player%s %s|r |CFFFE8A0ETo |CFFE55BB0CruSader-WoW", ClassNameString.c_str(), pname.c_str());
- sWorld.SendGlobalText(ragezone,0);
- pPlayer->CastSpell(pPlayer,45153,false);
- return;
- }
- }
- else
- {
- }
- }
- //This function is called when the player logs out
- void OnLogout(Player* player)
- {
- // player->RemoveAllAuras();
- }
- //This function is called when the player kills another player
- void OnPVPKill(Player* killer, Player* killed)
- {
- }
- void AddSC_onevents()
- {
- Script *newscript;
- newscript = new Script;
- newscript->Name = "scripted_on_events";
- newscript->pOnLogin = &OnLogin;
- newscript->pOnLogout = &OnLogout;
- newscript->pOnPVPKill = &OnPVPKill;
- newscript->RegisterSelf();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement