View difference between Paste ID: bjYLxgLQ and 9sRfGXzq
SHOW: | | - or go back to the newest paste.
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") {}
12+
    solo_instance_teleport(): PlayerScript("solo_instance_teleport") {}
13
14
15-
	void OnLevelChanged(Player* player, uint8 newLevel)
15+
    void OnLevelChanged(Player* player, uint8 newLevel)
16-
	{
16+
    {
17-
		if (newLevel == 80)
17+
        if (newLevel == 80)
18-
		{
18+
        {
19-
			WorldPacket data(SMSG_GOSSIP_MESSAGE, 100);         // guess size
19+
            player->PlayerTalkClass->ClearMenus();
20-
			data << uint64(player->GetGUID());
20+
            player->PlayerTalkClass->GetGossipMenu().SetMenuId(MENU_ID);
21-
			data << uint32(1);            // new 2.4.0
21+
            WorldPacket data(SMSG_GOSSIP_MESSAGE, 100);         // guess size
22-
			data << uint32(1);
22+
            data << uint64(player->GetGUID());
23-
			data << uint32(1);     // max count 0x10
23+
            data << uint32(MENU_ID); // menu_id
24-
			data << uint32(1);
24+
            data << uint32(1); // npc_text
25-
			data << uint8(1);
25+
            data << uint32(1); // max count 0x10
26-
			data << uint8(0);                    // makes pop up box password
26+
            data << uint32(1);
27-
			data << uint32(1);                  // money required to open menu, 2.0.3
27+
            data << uint8(1);
28-
			data << "HI";                           // text for gossip item
28+
            data << uint8(0);                    // makes pop up box password
29-
			data << "HI";                        // accept text (related to money) pop up box, 2.0.3
29+
            data << uint32(1);                  // money required to open menu, 2.0.3
30
            data << "HI";                           // text for gossip item
31-
			player->GetSession()->SendPacket(&data);
31+
            data << "HI";                        // accept text (related to money) pop up box, 2.0.3
32-
		}
32+
            player->GetSession()->SendPacket(&data);
33-
	}
33+
        }
34
    }
35-
	void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action)
35+
36-
	{
36+
    void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action)
37-
		player->PlayerTalkClass->ClearMenus();
37+
    {
38-
		if (action == 1 || sender == 1 || menu_id == 1)
38+
        player->PlayerTalkClass->ClearMenus();
39-
		{
39+
        if (menu_id != MENU_ID)
40-
			player->AddItem(100001, 10);
40+
            return;
41-
		}
41+
42-
		player->AddItem(100001, 11);
42+
        if (sender == GOSSIP_SENDER_MAIN && action == GOSSIP_ACTION_INFO_DEF + 1)
43-
		player->CLOSE_GOSSIP_MENU();
43+
        {
44-
	}
44+
            player->AddItem(100001, 10);
45
        }
46
        player->AddItem(100001, 11);
47
        player->CLOSE_GOSSIP_MENU();
48
    }
49
50
};
51
52-
	new solo_instance_teleport();
52+
53
{
54
    new solo_instance_teleport();
55
}