Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *+-------------+-+---+
- *¦-¦¦¦¦¦¦¦++¦-¦+-+¦--¦
- *¦-¦¦¦¦¦¦¦-+¦-++¦++--¦
- *+------------++-++--+
- * EmuDevs - (http://emudevs.com)
- */
- class npc_tut : public CreatureScript // npc_tut - Class constructor, name this anything that doesn't conflict with another name
- {
- public:
- npc_tut() : CreatureScript("npc_tut") { } // npc_tut, should be the same as class npc_tut -- CreatureScript("npc_tut") - This is your 'ScriptName' that you will assign in your database.
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE // This will show first when a player clicks on a gossip npc
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "First Menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); // 1. Once the player clicks this menu,
- player->SEND_GOSSIP_MENU(1, creature->GetGUID()); // This sends the menu to the player
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 actions) OVERRIDE
- {
- if (actions == GOSSIP_ACTION_INFO_DEF+1) // 2. the menu will be sent here to finish the action
- {
- player->GetSession()->SendAreaTriggerMessage("GOSSIP_ACTION_INFO_DEF+1");
- player->CLOSE_GOSSIP_MENU();
- }
- return true;
- }
- };
- void AddSC_tutorial() // This is your ScriptLoader.cpp setup function
- {
- new npc_tut(); // Call any new classes here as 'new classname();'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement