Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Define.h"
- #include "GossipDef.h"
- #include "Item.h"
- #include "Player.h"
- #include "ScriptedGossip.h"
- #include "ScriptMgr.h"
- #include "Spell.h"
- class charstone_ItemGossip : public ItemScript
- {
- public:
- charstone_ItemGossip() : ItemScript("charstone_ItemGossip") { }
- bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override // Any hook here
- {
- sLog->outDebug(LOG_FILTER_SQL, "charstone_ItemGossip message ... HELLO");
- player->PlayerTalkClass->ClearMenus(); // Clears old options
- player->ADD_GOSSIP_ITEM(0, "Goto Mall", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM(0, "Goto Dummy Area", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(0, "Goto Duel Zone", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM(0, "Reset Cooldowns", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM(0, "Repair Items", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM(0, "Reset Talents", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
- return true; // Cast the spell on use normally
- }
- void OnGossipSelect(Player* player, Item* /*item*/, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->TeleportTo(870, 3795.498535, 533.554199, 639.007446, 3.034940);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->TeleportTo(870, -77.167274, -5399.377441, 150.105423, 6.150439);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->TeleportTo(870, -192.235474, -5372.152344, 123.077499, 2.898886);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->CombatStop();
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->ResetTalents();
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- player->CLOSE_GOSSIP_MENU();
- }
- };
- void AddSC_charstone_ItemGossip() // Add to scriptloader normally
- {
- new charstone_ItemGossip();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement