Code:
/* Scripted by Kreegoth*/
#include "precompiled.h"
long long int cash;
int price;
bool GossipHello_mob_ResetNPC(Player* player, Creature* _Creature)
{
player->ADD_GOSSIP_ITEM( 5, "What can you help me with?" , GOSSIP_SENDER_MAIN, 8888);
player->ADD_GOSSIP_ITEM( 5, "Can I reset my characters name?" , GOSSIP_SENDER_MAIN, 6666);
player->ADD_GOSSIP_ITEM( 5, "Can I change my Faction?" , GOSSIP_SENDER_MAIN, 7777);
player->ADD_GOSSIP_ITEM( 5, "Can I change my Race?" , GOSSIP_SENDER_MAIN, 1212);
player->ADD_GOSSIP_ITEM( 5, "Can I re-customize my character?" , GOSSIP_SENDER_MAIN, 9999);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
return true;
}
void SendDefaultMenu_mob_ResetNPC(Player* player, Creature* _Creature, uint32 action)
{
if (player->IsFlying() || player->isDead() || player->isInCombat())
{
player->CLOSE_GOSSIP_MENU();
_Creature->MonsterSay("You are in combat!", LANG_UNIVERSAL);
return;
}
if (player->getLevel() < 10)
{
player->CLOSE_GOSSIP_MENU();
_Creature->MonsterSay("You must be lvl 10+", LANG_UNIVERSAL);
return;
}
cash = player-> GetMoney();
price = 500000;
if (cash < price)
{
player->CLOSE_GOSSIP_MENU();
_Creature->MonsterSay("You haven't enough money", LANG_UNIVERSAL);
return;
}
switch(action)
{
case 8888: // What Can you help me With?
{
player->CLOSE_GOSSIP_MENU();
_Creature->MonsterSay("I can assist you with changing your Characters Name, or With re-customizing your character. For a Fee of course...", LANG_UNIVERSAL);
}
break;
case 1212: // RACE
{
player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Change my Race. <500 Gold>. 500 Gold" , GOSSIP_SENDER_MAIN, 4442);
player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
}
break;
case 7777: // FACTION
{
player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Change my Faction. I Understand that this will reset my reputations.<1000 Gold>. 1000 Gold" , GOSSIP_SENDER_MAIN, 4012);
player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
}
break;
case 9999: // RACE
{
player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Re-Customize my character <100 Gold>. 100 Gold" , GOSSIP_SENDER_MAIN, 4020);
player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
}
break;
case 6666: // Character
{
player->ADD_GOSSIP_ITEM( 5, "Yes I would like to rename my character <50 Gold>. 50 Gold" , GOSSIP_SENDER_MAIN, 4024);
player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
}
break;
case 4012: // Faction Change
{
player->CLOSE_GOSSIP_MENU();
player->ModifyMoney(-20*price);
player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
_Creature->MonsterSay("Relog to Change your faction", LANG_UNIVERSAL);
}
break;
case 4442: // Recustomize Race
{
player->CLOSE_GOSSIP_MENU();
player->ModifyMoney(-10*price);
player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
_Creature->MonsterSay("Relog to Change your race", LANG_UNIVERSAL);
}
break;
case 4020: // Recustomize Reset
{
player->CLOSE_GOSSIP_MENU();
player->ModifyMoney(-2*price);
player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
_Creature->MonsterSay("Relog to re-customize your character", LANG_UNIVERSAL);
}
break;
case 4024: // Rename
{
player->CLOSE_GOSSIP_MENU();
player->ModifyMoney(-1*price);
player->SetAtLoginFlag(AT_LOGIN_RENAME);
_Creature->MonsterSay("Relog to rename your character", LANG_UNIVERSAL);
}
break;
case 2222: // Nevermind
{
_Creature->MonsterSay("Another time perhaps...", LANG_UNIVERSAL);
player->CLOSE_GOSSIP_MENU();
}
break;
}
}
bool GossipSelect_mob_ResetNPC(Player* player, Creature* _Creature, uint32 sender, uint32 action)
{
// Main menu
if (sender == GOSSIP_SENDER_MAIN)
{
player->PlayerTalkClass->ClearMenus();
SendDefaultMenu_mob_ResetNPC(player, _Creature, action);
}
return true;
}
void AddSC_mob_ResetNPC()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "mob_ResetNPC";
pNewScript->pGossipHello = &GossipHello_mob_ResetNPC;
pNewScript->pGossipSelect = &GossipSelect_mob_ResetNPC;
pNewScript->RegisterSelf();
}