Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- class npc_reset : public CreatureScript
- {
- public:
- npc_reset() : CreatureScript("npc_reset"){}
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM(4, "|TInterface\\icons\\INV_Misc_Wrench_01:30:30:-18:0|tRepair Items", GOSSIP_SENDER_MAIN, 2);
- player->ADD_GOSSIP_ITEM_EXTENDED(4, "|TInterface\\icons\\INV_Misc_Head_ClockworkGnome_01:30:30:-18:0|tReset Saves.", GOSSIP_SENDER_MAIN, 3, "ΒΏAre you sure you want to reset saves?", 0, false);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 actions)
- {
- switch (actions)
- {
- case 0:
- player->TeleportTo(1, -8531.564f, 2010.638f, 100.7205f, 0.380013f);
- player->PlayerTalkClass->SendCloseGossip();
- return true;
- case 1:
- player->TeleportTo(530, -2472.7460f, 8613.0058f, 195.9158f, 2.391120f);
- player->PlayerTalkClass->SendCloseGossip();
- return true;
- case 2:
- player->DurabilityRepairAll(false, 0, false);
- creature->MonsterWhisper("Your items was repaired.", player);
- player->PlayerTalkClass->SendCloseGossip();
- break;
- case 3:
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
- for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
- {
- player->UnbindInstance(itr, Difficulty(i));
- creature->MonsterWhisper("Reset sucessful.", player);
- player->PlayerTalkClass->SendCloseGossip();
- return true;
- }
- }
- return true;
- break;
- default: // Close
- player->CLOSE_GOSSIP_MENU();
- return true;
- }
- OnGossipHello(player, creature);
- return true;
- }
- };
- void AddSC_npc_reset()
- {
- new npc_reset;
- }
Add Comment
Please, Sign In to add comment