Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- EmuDevs - (http://emudevs.com)
- Use this as your template. Make sure to point credits towards ED.
- */
- class go_tut : public GameObjectScript // go_tut - Class constructor, name this anything that doesn't conflict with another name
- {
- public:
- go_tut() : GameObjectScript("go_tut") { } // go_tut, should be the same as class go_tut -- GameObjectScript("go_tut") - This is your 'ScriptName' that you will assign in your database.
- // This will show first when a player clicks on a GameObject (Gossip)
- // override since it is a virtual function
- bool OnGossipHello(Player* player, GameObject* go) override
- {
- AddGossipItemFor(player, GOSSIP_ICON_CHAT, "First Menu", GOSSIP_SENDER_MAIN, 1); // 1. Once the player clicks this menu,
- SendGossipMenuFor(player, 1, go->GetGUID()); // This sends the menu to the player
- return true;
- }
- // This will handle actions based on the menu clicked
- // override since it is a virtual function
- bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 actions) override
- {
- ClearGossipMenuFor(player);
- if (actions == 1) // 2. the menu will be sent here to finish the action
- {
- player->GetSession()->SendAreaTriggerMessage("1");
- CloseGossipMenuFor(player);
- }
- return true;
- }
- };
- void AddSC_tutorial() // This is your ScriptLoader.cpp setup function
- {
- new go_tut(); // Call any new classes here as 'new classname();'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement