Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include <cstring>
- class example_gossip_codebox : public CreatureScript
- {
- public:
- example_gossip_codebox()
- : CreatureScript("example_gossip_codebox")
- {
- }
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to GM Island" , GOSSIP_SENDER_MAIN, 1001);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to Nagrand Arena" , GOSSIP_SENDER_MAIN, 1002);
- player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- if(player->IsInCombat())
- return;
- switch(uiAction)
- {
- case 1001:
- player->TeleportTo(571, 5769.364544, 2034.640015, -345.756989, 5.276150, 0);
- break;
- case 1002:
- player->TeleportTo(530, -2044.446289, 6652.702148, 13.053578, 2.011447, 0);
- break;
- }
- return true;
- }
- };
- void AddSC_example_gossip_codebox()
- {
- new example_gossip_codebox();
- }
Add Comment
Please, Sign In to add comment