Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
- *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
- *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
- *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
- * EmuDevs - (http://emudevs.com)
- */
- class npc_gossip_extended : public CreatureScript
- {
- public:
- npc_gossip_extended() : CreatureScript("npc_gossip_extended") { }
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_BATTLE, "Battle", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "Write a name", 0, true);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Nevermind..", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+99);
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* Creature, uint32 /* sender */, uint32 actions)
- {
- player->PlayerTalkClass->ClearMenus();
- if (actions == GOSSIP_ACTION_INFO_DEF+99)
- player->CLOSE_GOSSIP_MENU();
- return true;
- }
- bool OnGossipSelectCode(Player* player, Creature* creature, uint32 /* sender */, uint32 actions, const char* code)
- {
- player->PlayerTalkClass->ClearMenus();
- if (actions == GOSSIP_ACTION_INFO_DEF+1)
- {
- std::string name = code;
- if (name.empty)
- {
- player->GetSession()->SendNotification("The name cannot be empty!");
- return false;
- }
- Player* _player = sObjectAccessor->FindPlayerByName(name.c_str());
- if (!_player)
- {
- player->GetSession()->SendNotification("Player not found");
- return false;
- }
- // DO ANYTHING BELOW HERE TO THE PLAYER THAT WAS WRITTEN IN TIME
- }
- return true;
- }
- };
- void AddSC_gossip_extension()
- {
- new npc_gossip_extended();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement