Advertisement
Rochet2

Roulette

Jul 14th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. class roulette_npc : public CreatureScript
  2. {
  3. public:
  4.     roulette_npc() : CreatureScript("roulette_npc") { }
  5.  
  6.     bool OnGossipHello(Player * pPlayer, Creature * pCreature)
  7.     {
  8.         pPlayer->ADD_GOSSIP_ITEM(3, "I wish to play the game of luck!", GOSSIP_SENDER_MAIN, 0);
  9.         pPlayer->ADD_GOSSIP_ITEM(1, "Nevermind", GOSSIP_SENDER_MAIN, 5);
  10.         return true;
  11.     }
  12.  
  13.     bool OnGossipSelect(Player * pPlayer, Creature * pCreature, uint32 sender, uint32 uiAction)
  14.     {
  15.         pPlayer->PlayerTalkClass->ClearMenus();
  16.         if(uiAction == 0)
  17.         {
  18.             if (!pPlayer->isInCombat())
  19.             {
  20.                 pPlayer->GetSession()->SendNotification("You are in combat");
  21.             }
  22.             else
  23.             {
  24.                 switch (urand(1, 4)) // 5th should do what?
  25.                 {
  26.                 case 1:
  27.                     pPlayer->CastSpell(pPlayer, 31984);
  28.                     pCreature->MonsterSay("Hahahaha!", LANG_UNIVERSAL, NULL);
  29.                     pPlayer->PlayDirectSound(11965);
  30.                     break;
  31.                 case 2:
  32.                     pCreature->MonsterSay("You've won.. for now.", LANG_UNIVERSAL, NULL);
  33.                     pPlayer->PlayDirectSound(7914);
  34.                     break;
  35.                 case 3:
  36.                     pPlayer->CastSpell(pPlayer, 13566);
  37.                     pCreature->MonsterYell("YOU ARE NOT PREPARED!!", LANG_UNIVERSAL, NULL);
  38.                     pPlayer->PlayDirectSound(11466);
  39.                     break;
  40.                 case 4:
  41.                     pCreature->MonsterSay("Lets rock!", LANG_UNIVERSAL, NULL);
  42.                     pPlayer->PlayDirectSound(11803);
  43.                     break;
  44.                 }
  45.             }
  46.             OnGossipHello(pPlayer, pCreature);
  47.         }
  48.         else
  49.         {
  50.             pPlayer->CLOSE_GOSSIP_MENU();
  51.         }
  52.         return true;
  53.     }
  54. };
  55. void AddSC_roulette_npc()
  56. {
  57.     new roulette_npc();
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement