Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- For: Criticism
- By: Faded
- */
- #include "ScriptPCH.h"
- class crit_npc : public CreatureScript
- {
- public:
- crit_npc()
- : CreatureScript("crit_npc"){}
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM(9, "Level 1", GOSSIP_SENDER_MAIN, 2);
- player->ADD_GOSSIP_ITEM(9, "Level 10", GOSSIP_SENDER_MAIN, 3);
- player->ADD_GOSSIP_ITEM(9, "Level 19", GOSSIP_SENDER_MAIN, 4);
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Actions)
- {
- player->PlayerTalkClass->ClearMenus();
- if (player->isInCombat())
- {
- creature->MonsterWhisper("You're in combat.", player->GetGUID());
- return false;
- }
- if(Sender == GOSSIP_SENDER_MAIN)
- {
- switch(Actions)
- {
- case 2:
- player->TeleportTo(map, xf, yf, zf, of);
- player->PlayerTalkClass->SendCloseGossip();
- break;
- case 3:
- player->TeleportTo(map, xf, yf, zf, of);
- player->SetLevel(10);
- player->SaveToDB();
- player->PlayerTalkClass->SendCloseGossip();
- break;
- case 4:
- player->TeleportTo(map, xf, yf, zf, of);
- player->SetLevel(19);
- player->SaveToDB();
- player->PlayerTalkClass->SendCloseGossip();
- break;
- }
- }
- return true;
- };
- void AddSC_crit_npc()
- {
- new crit_npc();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement