Don't like ads? PRO users don't see any ads ;-)
Guest

ArenaTitle NPC for OregonCore

By: a guest on Jul 3rd, 2012  |  syntax: C++  |  size: 1.62 KB  |  hits: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #define MSG_ERR_ARENA_POINT "You haven't enough TR!"
  2. #define MSG_ERR_TITLE "Your character already have this title!"
  3. #define MSG_ERR_INCOMBAT "You are in combat."
  4.  
  5.  
  6. #define MSG_GOSSIP_TEXT_42 "Gladiator"
  7.  
  8. #define reqpersonalarenarating 1700
  9.  
  10. bool AddTitle(Player* player , Creature* creature, CharTitlesEntry const* titleInfo)
  11. {
  12.      if (player->HasTitle(titleInfo)) {
  13.          creature->MonsterWhisper(MSG_ERR_TITLE, player->GetGUID());
  14.          player->CLOSE_GOSSIP_MENU();
  15.          return false;
  16.      }
  17.  
  18.      if (player->GetMaxPersonalArenaRatingRequirement() < reqpersonalarenarating) {
  19.          creature->MonsterWhisper(MSG_ERR_ARENA_POINT, player->GetGUID());
  20.          player->CLOSE_GOSSIP_MENU();
  21.          
  22.          } else{
  23.  
  24.      player->SetTitle(titleInfo);
  25.      player->CLOSE_GOSSIP_MENU();
  26.          }
  27.          return true;
  28. }
  29.  
  30.         bool GossipHello_npc_title(Player *player, Creature *creature)
  31.                 {
  32.                           player->PlayerTalkClass->ClearMenus();
  33.                           player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, MSG_GOSSIP_TEXT_42, GOSSIP_SENDER_MAIN, 2);
  34.                           player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
  35.                           return true;
  36.  
  37. }
  38.  
  39.         bool GossipSelect_npc_title(Player *player, Creature *creature, uint32 sender, uint32 action )
  40.                 {
  41.                   if (!player->getAttackers().empty())
  42.         {
  43.                 creature->MonsterWhisper(MSG_ERR_INCOMBAT, player->GetGUID());
  44.                 player->CLOSE_GOSSIP_MENU();
  45.         return false;
  46.                   }
  47.  
  48.                   switch (action)
  49.         {
  50.                  case 2:
  51.                            {CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(144);
  52.                            AddTitle(player, creature, titleInfo);
  53.                            }
  54.                            break;
  55. }
  56.        
  57.                   return true;
  58.         }