SHOW:
|
|
- or go back to the newest paste.
| 1 | #include "ScriptPCH.h" | |
| 2 | ||
| 3 | class npc_reset : public CreatureScript | |
| 4 | {
| |
| 5 | public: | |
| 6 | npc_reset() : CreatureScript("npc_reset"){}
| |
| 7 | ||
| 8 | bool OnGossipHello(Player* player, Creature* creature) | |
| 9 | {
| |
| 10 | - | player->ADD_GOSSIP_ITEM(4, "|TInterface\\icons\\INV_Misc_Wrench_01:30:30:-18:0|tRepair Items", GOSSIP_SENDER_MAIN, 2); |
| 10 | + | player->ADD_GOSSIP_ITEM(4, "|TInterface\\icons\\INV_Misc_Wrench_01:30:30:-18:0|tRepair Items", GOSSIP_SENDER_MAIN, 1); |
| 11 | - | 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); |
| 11 | + | player->ADD_GOSSIP_ITEM_EXTENDED(4, "|TInterface\\icons\\INV_Misc_Head_ClockworkGnome_01:30:30:-18:0|tReset Saves.", GOSSIP_SENDER_MAIN, 2, "¿Are you sure you want to reset saves?", 0, false); |
| 12 | player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); | |
| 13 | return true; | |
| 14 | } | |
| 15 | bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 actions) | |
| 16 | {
| |
| 17 | ||
| 18 | switch (actions) | |
| 19 | {
| |
| 20 | - | case 0: |
| 20 | + | |
| 21 | - | player->TeleportTo(1, -8531.564f, 2010.638f, 100.7205f, 0.380013f); |
| 21 | + | |
| 22 | creature->MonsterWhisper("Your items was repaired.", player);
| |
| 23 | - | return true; |
| 23 | + | |
| 24 | break; | |
| 25 | ||
| 26 | - | player->TeleportTo(530, -2472.7460f, 8613.0058f, 195.9158f, 2.391120f); |
| 26 | + | |
| 27 | for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) | |
| 28 | - | return true; |
| 28 | + | |
| 29 | Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); | |
| 30 | for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) | |
| 31 | {
| |
| 32 | player->UnbindInstance(itr, Difficulty(i)); | |
| 33 | creature->MonsterWhisper("Reset sucessful.", player);
| |
| 34 | player->PlayerTalkClass->SendCloseGossip(); | |
| 35 | return true; | |
| 36 | - | case 3: |
| 36 | + | |
| 37 | } | |
| 38 | return true; | |
| 39 | break; | |
| 40 | ||
| 41 | default: // Close | |
| 42 | player->CLOSE_GOSSIP_MENU(); | |
| 43 | return true; | |
| 44 | } | |
| 45 | OnGossipHello(player, creature); | |
| 46 | return true; | |
| 47 | } | |
| 48 | }; | |
| 49 | ||
| 50 | void AddSC_npc_reset() | |
| 51 | {
| |
| 52 | new npc_reset; | |
| 53 | } |