Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
- *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
- *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
- *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
- * http://emudevs.com
- */
- class npc_tutorial_gossip : public CreatureScript
- {
- public:
- npc_tutorial_gossip() : CreatureScript("npc_tutorial_gossip") { }
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Do Action", GOSSIP_SENDER_MAIN, 1);
- player->SEND_GOSSIP_MENU(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 actions)
- {
- player->PlayerTalkClass->ClearMenus();
- if (actions == 1)
- {
- float x, y, z;
- if (Creature* target = creature->FindNearestCreature(30000, 30.0f, true))
- {
- target->GetPosition(x, y, z);
- target->GetMotionMaster()->MovePoint(1, x + rand() % 5, y - rand() % 10, z);
- target->SetHealth(300000);
- }
- }
- return true;
- }
- };
- void AddSC_gossip_tut()
- {
- new npc_tutorial_gossip;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement