/ *
* Fabriqué par - Ghostcrawler336 De ac-web.org
* /
 

# Include "ScriptPCH.h"
# Define TOKEN_ID 51494 / / 51494 à remplacer YOUR_TOKEN_ID

 
Level_NPC classe: public CreatureScript
{
public:
Level_NPC (): CreatureScript ("Level_NPC") {}
bool OnGossipHello (Player * pPlayer, Creature * _creature)
{
  pPlayer-> ADD_GOSSIP_ITEM (7, "Bienvenue sur le PNJ de niveau!", GOSSIP_SENDER_MAIN, 111212);
  pPlayer-> ADD_GOSSIP_ITEM (10 ", 10 Level", GOSSIP_SENDER_MAIN, 1);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 20 (1 Token)", GOSSIP_SENDER_MAIN, 2);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 30 (2 Token)", GOSSIP_SENDER_MAIN, 3);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 40 (3 Token)", GOSSIP_SENDER_MAIN, 4);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 50 (4 Token)", GOSSIP_SENDER_MAIN, 5);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 60 (5 Token)", GOSSIP_SENDER_MAIN, 6);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 70 (6 Token)", GOSSIP_SENDER_MAIN, 7);
  pPlayer-> ADD_GOSSIP_ITEM (10, "Level 80 (7 Token)", GOSSIP_SENDER_MAIN, 8);
 
                pPlayer-> PlayerTalkClass-> SendGossipMenu (907, _creature-> DonneGUID ());
                return true;
}
bool OnGossipSelect (Player * pPlayer, Creature * _creature, uint32 uiSender, uint32 uiAction)
{
                 pPlayer-> PlayerTalkClass-> ClearMenus ();
                       
                                switch (uiAction)
                                {                                                                    
                         case 1: / / Niveau 10 - 1 jeton requis
                           if (pPlayer-> HasItemCount (TOKEN_ID, 1, true))
                           {
                               pPlayer-> GiveLevel (10);
                          pPlayer-> DestroyItemCount (TOKEN_ID, 1, true);
                                       _creature-> MonsterWhisper ("Votre désormais niveau 10!", pPlayer-> DonneGUID ());
                                        pPlayer-> PlayerTalkClass-> SendCloseGossip ();
                                }
                                d'autre
                                {
                                  pPlayer-> PlayerTalkClass-> SendCloseGossip ();
                                  _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
                                      return false;
                                }
                                break;

                                                               
                                                               
                     case 2: / / Niveau 20 - jetons t requis
              if (pPlayer-> HasItemCount (TOKEN_ID, 2, true))
                   {
                    pPlayer-> GiveLevel (20);
             pPlayer-> DestroyItemCount (TOKEN_ID, 2, true);
              _creature-> MonsterWhisper ("Votre niveau 20 maintenant!", pPlayer-> DonneGUID ());
             pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         }
           d'autre
              {
             pPlayer-> PlayerTalkClass-> SendCloseGossip ();
           _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
                return false;
             }
               break;
 
                                                               


                                 
                         case 3: / / Niveau 30 - 3 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 3, true))
             {
        pPlayer-> GiveLevel (30);
        pPlayer-> DestroyItemCount (TOKEN_ID, 3, true);
         _creature-> MonsterWhisper ("Votre niveau 30 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;
		

		
 
        case 4: / / Niveau 40 - 4 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 4, true))
        {
         pPlayer-> GiveLevel (40);
         pPlayer-> DestroyItemCount (TOKEN_ID, 4, true);
         _creature-> MonsterWhisper ("Votre niveau 40 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;
                              
               
                   case 5: / / Niveau 50 - 5 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 5, true))
        {
         pPlayer-> GiveLevel (50);
         pPlayer-> DestroyItemCount (TOKEN_ID, 5, true);
         _creature-> MonsterWhisper ("Votre niveau 50 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;
                              
               
                                   cas 6: / / Niveau 60 - 6 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 6, true))
        {
         pPlayer-> GiveLevel (60);
         pPlayer-> DestroyItemCount (TOKEN_ID, 6, true);
         _creature-> MonsterWhisper ("Votre niveau 60 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;
                                  
               
                cas 7: / / Niveau 70 - 7 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 7, true))
        {
         pPlayer-> GiveLevel (70);
         pPlayer-> DestroyItemCount (TOKEN_ID, 7, true);
         _creature-> MonsterWhisper ("Votre niveau 70 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;              
               
                                cas 8: / / Niveau 80 - 8 jetons requis
        if (pPlayer-> HasItemCount (TOKEN_ID, 8, true))
        {
         pPlayer-> GiveLevel (80);
         pPlayer-> DestroyItemCount (TOKEN_ID, 8, true);
         _creature-> MonsterWhisper ("Votre niveau 80 maintenant!", pPlayer-> DonneGUID ());
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
        }
        d'autre
        {
         pPlayer-> PlayerTalkClass-> SendCloseGossip ();
         _creature-> MonsterWhisper ("Vous n'avez pas le jeton requis.", pPlayer-> DonneGUID ());
         return false;
        }
        break;
}
}
};
AddSC_Level_NPC vide ()
{
        nouvelle Level_NPC ();
}