Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "AccountMgr.h"
- class vipnpc : public CreatureScript
- {
- public:
- vipnpc() : CreatureScript("vipnpc") { }
- bool OnGossipHello(Player * player, Creature * creature)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Teleport", GOSSIP_SENDER_MAIN, 101);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Vendors", GOSSIP_SENDER_MAIN, 102);
- player->SEND_GOSSIP_MENU(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch(uiAction)
- {
- case 101:
- player->ADD_GOSSIP_ITEM(11, "Premium Mall", GOSSIP_SENDER_MAIN, 901);
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- break;
- case 102:
- player->ADD_GOSSIP_ITEM(11, "Gems", GOSSIP_SENDER_MAIN, 901);
- player->ADD_GOSSIP_ITEM(11, "Glyphs", GOSSIP_SENDER_MAIN, 901);
- player->ADD_GOSSIP_ITEM(11, "Profession Materials", GOSSIP_SENDER_MAIN, 901);
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- break;
- case 901:
- player->PlayerTalkClass->SendCloseGossip();
- player->CastSpell(player, 19484, true);
- new TimedTeleport(player, 0, -8855.95f, 599.54f, 92.06f, 0.0f, 10000);
- break;
- case 9:
- OnGossipHello(player, creature);
- break;
- }
- return true;
- }
- class TimedTeleport : public BasicEvent
- {
- public:
- TimedTeleport(Player* player, uint32 map, float x, float y, float z, float o, uint32 delay) : _player(player), _map(map), _x(x), _y(y), _z(z), _o(o)
- {
- player->m_Events.AddEvent(this, player->m_Events.CalculateTime(delay));
- }
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
- {
- _player->TeleportTo(_map, _x, _y, _z, _o);
- return true;
- }
- Player* _player;
- uint32 _map;
- float _x;
- float _y;
- float _z;
- float _o;
- };
- };
- void AddSC_vipnpc()
- {
- new vipnpc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement