Advertisement
Parranoia

PvP Titles

May 12th, 2013
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.25 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. enum Ranks
  4. {
  5.     RANK_1  = 50,
  6.     RANK_2  = 100,
  7.     RANK_3  = 500,
  8.     RANK_4  = 1000,
  9.     RANK_5  = 2000,
  10.     RANK_6  = 4000,
  11.     RANK_7  = 5000,
  12.     RANK_8  = 6000,
  13.     RANK_9  = 8000,
  14.     RANK_10 = 10000,
  15.     RANK_11 = 12500,
  16.     RANK_12 = 15000,
  17.     RANK_13 = 20000,
  18.     RANK_14 = 25000,
  19. };
  20.  
  21. class PVPTitles : public PlayerScript
  22. {
  23. public:
  24.     PVPTitles() : PlayerScript("PVPTitles") { }
  25.  
  26.     void OnPVPKill(Player *Killer, Player *Killed)
  27.     {
  28.         if (Killer->GetGUID() == Killed->GetGUID())
  29.             return;
  30.            
  31.         uint32 team = Killer->GetTeam();
  32.  
  33.         switch(Killer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS))
  34.         {
  35.             case RANK_1:
  36.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(1 + (team == ALLIANCE ? 0 : 14)));
  37.                 break;
  38.             case RANK_2:
  39.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(2 + (team == ALLIANCE ? 0 : 14)));
  40.                 break;
  41.             case RANK_3:
  42.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(3 + (team == ALLIANCE ? 0 : 14)));
  43.                 break;
  44.             case RANK_4:
  45.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(4 + (team == ALLIANCE ? 0 : 14)));
  46.                 break;
  47.             case RANK_5:
  48.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(5 + (team == ALLIANCE ? 0 : 14)));
  49.                 break;
  50.             case RANK_6:
  51.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(6 + (team == ALLIANCE ? 0 : 14)));
  52.                 break;
  53.             case RANK_7:
  54.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(7 + (team == ALLIANCE ? 0 : 14)));
  55.                 break;
  56.             case RANK_8:
  57.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(8 + (team == ALLIANCE ? 0 : 14)));
  58.                 break;
  59.             case RANK_9:
  60.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(9 + (team == ALLIANCE ? 0 : 14)));
  61.                 break;
  62.             case RANK_10:
  63.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(10 + (team == ALLIANCE ? 0 : 14)));
  64.                 break;
  65.             case RANK_11:
  66.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(11 + (team == ALLIANCE ? 0 : 14)));
  67.                 break;
  68.             case RANK_12:
  69.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(12 + (team == ALLIANCE ? 0 : 14)));
  70.                 break;
  71.             case RANK_13:
  72.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(13 + (team == ALLIANCE ? 0 : 14)));
  73.                 break;
  74.             case RANK_14:
  75.                 Killer->SetTitle(sCharTitlesStore.LookupEntry(14 + (team == ALLIANCE ? 0 : 14)));
  76.                 break;
  77.         }
  78.     }
  79. };
  80.  
  81. void AddSC_PVPTitles()
  82. {
  83.     new PVPTitles();
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement