Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Define.h"
- #include "ScriptMgr.h"
- #include "SharedDefines.h"
- #include "Unit.h"
- #include "ConditionMgr.h"
- #include "GossipDef.h"
- #include "ScriptedGossip.h"
- #include "Common.h"
- #include "ObjectGuid.h"
- #include "Player.h"
- #include "ScriptedCreature.h"
- #include "Creature.h"
- #include "WorldSession.h"
- #define CHANGE_RACE "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Race"
- #define CHANGE_FACTION "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Faction"
- #define CHANGE_APPEARANCE "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Appearance"
- #define CHANGE_NAME "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Name"
- class changer : public CreatureScript
- {
- public:
- changer() : CreatureScript("changer") { }
- bool OnGossipHello(Player* player, Creature* creature)
- {
- AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_RACE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_FACTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_APPEARANCE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_NAME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
- player->GetSession()->SendNotification("Relog to change your Race.");
- CloseGossipMenuFor(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
- player->GetSession()->SendNotification("Relog to change your Faction.");
- CloseGossipMenuFor(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
- player->GetSession()->SendNotification("Relog to change your Appearance.");
- CloseGossipMenuFor(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->SetAtLoginFlag(AT_LOGIN_RENAME);
- player->GetSession()->SendNotification("Relog to change your Name.");
- CloseGossipMenuFor(player);
- break;
- }
- return true;
- };
- void AddSC_changer()
- {
- new changer();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement