kusanagy

New Player Announce

Jan 23rd, 2017
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.82 KB | None | 0 0
  1. /*
  2. Project Maintained by Ak47sigh known as Alexe & Midoking.
  3. You can redistribute it and/or modify but not to sell.
  4. Actions against the Copyright will support consequences!
  5. Copyright (C) 2012-2013 AkMi Project <http://www.wow-like.info/>
  6. */
  7.  
  8. #include "ScriptPCH.h"
  9.  
  10. class welcome_new_login : public PlayerScript
  11. {
  12. public:
  13.     welcome_new_login() : PlayerScript("welcome_new_login") { }
  14.  
  15.     void OnLogin(Player* player)
  16.     {
  17.         if (player->GetTotalPlayedTime() < 2) // Time in Millisecond means if played time less than 2 seconds it will welcome the player //
  18.         {
  19.             std::string ClassNameString = ""; // this is for the string
  20.  
  21.             switch (player->getClass()) // now defining class names in string lines
  22.             {
  23.             case CLASS_WARRIOR:
  24.             ClassNameString = "Warrior";
  25.             break;
  26.             case CLASS_PALADIN:        
  27.             ClassNameString = "Paladin";
  28.             break;
  29.             case CLASS_HUNTER:         
  30.             ClassNameString = "Hunter";
  31.             break;
  32.             case CLASS_ROGUE:          
  33.             ClassNameString = "Rogue";
  34.             break;
  35.             case CLASS_PRIEST:         
  36.             ClassNameString = "Priest";
  37.             break;
  38.             case CLASS_DEATH_KNIGHT:   
  39.             ClassNameString = "Death Knight";
  40.             break;
  41.             case CLASS_SHAMAN:         
  42.             ClassNameString = "Shaman";
  43.             break;
  44.             case CLASS_MAGE:           
  45.             ClassNameString = "Mage";
  46.             break;
  47.             case CLASS_WARLOCK:        
  48.             ClassNameString = "Warlock";
  49.             break;
  50.             case CLASS_DRUID:          
  51.             ClassNameString = "Druid";
  52.             break;
  53.             }
  54.             char msg[500];
  55.             sprintf(msg, "Welcome new Brother %s [|Hplayer:%s|h%s|h].", ClassNameString.c_str(), player->GetName(), player->GetName());
  56.             sWorld->SendServerMessage(SERVER_MSG_STRING, msg);
  57.         }
  58.     }
  59. };
  60.  
  61. void AddSC_welcome_new_login()
  62. {
  63.     new welcome_new_login;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment