Simple Level Up NPC

I’ve made a very simple levelup gossip script.

Features: Levels you to 60 (change XP as you seem fit, I did this so it updated stats immediately.)

Levels GMs to a direct level, which you can change.

[CODE]#include “ScriptPCH.h”
class Level_up_Mob : public CreatureScript
{
public:
Level_up_Mob() : CreatureScript(“Level_up_Mob”){ }
bool OnGossipHello(Player * player, Creature * creature){
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, “Level me up, Scotty!”, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, “Nevermind.”, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
if (player->IsGameMaster()){
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, “Surely you’ll let ME, a GAME MASTER, be a higher level than those guys?”, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
}
player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
return true;
}
bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 action){
player->PlayerTalkClass->ClearMenus();

if (sender != GOSSIP_SENDER_MAIN)
return false;
switch (action){
case GOSSIP_ACTION_INFO_DEF + 1:
player->GiveXP(3630600, player);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
player->PlayerTalkClass->SendCloseGossip();
case GOSSIP_ACTION_INFO_DEF + 2:
//chathandler->SendSysMessage("You don't want to be level 60? I'm sorry to hear.");
player->PlayerTalkClass->SendCloseGossip();
case GOSSIP_ACTION_INFO_DEF + 3:
	player->SetLevel(63);
	player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
}
return true;
}

};
void AddSC_Level_up_Mob()
{
new Level_up_Mob();
}[/CODE]
Oh, and if you want more xp to be gained, remove the no_xp_gain flag.

your cases are missing breaks.

Additionally I would like to note that it is better to always return true in custom gossip script

You know you can change config for start levels of players and separate for start level of gms?

QFT

You can also set the starting money, if that hasn’t been removed since I last checked.

This is incase you decide you don’t want to have the level cap automatically set in the config. It’ll also correctly remove the experience bar (which glitches) if you have the cap below 80.

FOR ANY MORE QUESTIONS YOU MAY HAVE, YOU MAY EMAIL ME @ [email protected]