Advertisement
Rochet2

Untitled

Feb 25th, 2018
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include "Common.h"
  2. #include "ScriptMgr.h"
  3. #include "Player.h"
  4. #include "Chat.h"
  5. #include "World.h"
  6. #include "Language.h"
  7.  
  8. class Announce_NewPlayer : public PlayerScript
  9. {
  10. public:
  11.     Announce_NewPlayer() : PlayerScript("Announce_NewPlayer") {}
  12.  
  13.     void OnLogin(Player * player, bool firstLogin) override
  14.     {
  15.         if (firstLogin)
  16.         {
  17.             std::string msg;
  18.             msg += "|cff54b5ffWelcome New player:|r ";
  19.             msg += ChatHandler(player->GetSession()).GetNameLink();
  20.             msg += "|cff54b5ff!|r";
  21.             sWorld->SendServerMessage(SERVER_MSG_STRING, msg.c_str(), 0);
  22.             player->CastSpell(player, 55420);
  23.         }
  24.     }
  25. };
  26.  
  27. void AddSC_Announce_NewPlayer() //this is a delaration
  28. {
  29.     new Announce_NewPlayer(); //this is a call
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement