-
Notifications
You must be signed in to change notification settings - Fork 31
/
arenavendor.cpp
53 lines (42 loc) · 1.28 KB
/
arenavendor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "ScriptPCH.h"
#include <cstring>
#include "CharacterDatabaseCleaner.h"
#include "DatabaseEnv.h"
#include "ObjectMgr.h"
class arenavendor : public CreatureScript
{
public:
arenavendor()
: CreatureScript("arenavendor")
{
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if(pPlayer->HasItemCount(50111, 1))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Buy some items!", GOSSIP_SENDER_MAIN, 1000);
pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
} else {
char str[200];
sprintf(str,"You must complete Vault of Achavon to buy Arena Rewards!");
pPlayer->MonsterWhisper(str,pPlayer->GetGUID(),true);
pPlayer->PlayerTalkClass->SendCloseGossip();
}
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case 1000:
pPlayer->GetSession()->SendListInventory(pCreature->GetGUID());
break;
}
return true;
}
};
void AddSC_arenavendor()
{
new arenavendor();
}