Advertisement
Rochet2

Untitled

May 14th, 2014
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* _____  _       _     _  _____ ______ _____  ___ */
  2. /*| ____|| |     | |   | ||        |   |      |   |*/
  3. /*| |    | |     | |   | ||_____   |   |_____ |___|*/
  4. /*| |___ | |___  | |___| |      |  |   |      |    */
  5. /*|_____||_____| |_______| _____|  |   |_____ | __ */
  6. #include "ScriptPCH.h"
  7. #define MENU_ID 123
  8.  
  9. class solo_instance_teleport : public PlayerScript
  10. {
  11. public:
  12.     solo_instance_teleport(): PlayerScript("solo_instance_teleport") {}
  13.  
  14.  
  15.     void OnLevelChanged(Player* player, uint8 newLevel)
  16.     {
  17.         if (newLevel == 80)
  18.         {
  19.             player->PlayerTalkClass->ClearMenus();
  20.             player->PlayerTalkClass->GetGossipMenu().SetMenuId(MENU_ID);
  21.             WorldPacket data(SMSG_GOSSIP_MESSAGE, 100);         // guess size
  22.             data << uint64(player->GetGUID());
  23.             data << uint32(MENU_ID); // menu_id
  24.             data << uint32(1); // npc_text
  25.             data << uint32(1); // max count 0x10
  26.             data << uint32(1);
  27.             data << uint8(1);
  28.             data << uint8(0);                    // makes pop up box password
  29.             data << uint32(1);                  // money required to open menu, 2.0.3
  30.             data << "HI";                           // text for gossip item
  31.             data << "HI";                        // accept text (related to money) pop up box, 2.0.3
  32.             player->GetSession()->SendPacket(&data);
  33.         }
  34.     }
  35.  
  36.     void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action)
  37.     {
  38.         player->PlayerTalkClass->ClearMenus();
  39.         if (menu_id != MENU_ID)
  40.             return;
  41.  
  42.         if (sender == GOSSIP_SENDER_MAIN && action == GOSSIP_ACTION_INFO_DEF + 1)
  43.         {
  44.             player->AddItem(100001, 10);
  45.         }
  46.         player->AddItem(100001, 11);
  47.         player->CLOSE_GOSSIP_MENU();
  48.     }
  49.  
  50. };
  51.  
  52. void AddSC_solo_instance_teleport()
  53. {
  54.     new solo_instance_teleport();
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement