#include "precompiled.h"
bool GossipHello_resetnpc(Player *player, Creature *_Creature)
{
player->ADD_GOSSIP_ITEM(7,"Want to reset (lvl-170 only)",GOSSIP_SENDER_MAIN,1201);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
return true;
}
void SendDefaultMenu_resetnpc(Player *player, Creature *_Creature,uint32 action)
{
if (player->getLevel() < 170)
{
player->CLOSE_GOSSIP_MENU();
player->Say("I must be level 170 to reset",LANG_UNIVERSAL);
return;
}
switch(action) {
case 1201:
if (player->GetMoney() < 2500000) {
player->CLOSE_GOSSIP_MENU();
player->Say("I must have 250 gold to reset",LANG_UNIVERSAL);
}else{
player->ModifyMoney(-2500000);
player->GiveLevel(1);
player->CLOSE_GOSSIP_MENU();
}
break;
}
}
bool GossipSelect_resetnpc(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if (sender == GOSSIP_SENDER_MAIN) {
SendDefaultMenu_resetnpc(player,_Creature,action);
}
return true;
}
void AddSC_resetnpc()
{
Script *newscript;
newscript = new Script;
newscript->Name = "resetnpc";
newscript->pGossipHello = &GossipHello_resetnpc;
newscript->pGossipSelect = &GossipSelect_resetnpc;
newscript->RegisterSelf();
}
Now no compile errors.
// Edit: Script works correctly now