Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. #include "Define.h"
  2. #include "ScriptMgr.h"
  3. #include "SharedDefines.h"
  4. #include "Unit.h"
  5. #include "ConditionMgr.h"
  6. #include "GossipDef.h"
  7. #include "ScriptedGossip.h"
  8. #include "Common.h"
  9. #include "ObjectGuid.h"
  10. #include "Player.h"
  11. #include "ScriptedCreature.h"
  12. #include "Creature.h"
  13. #include "WorldSession.h"
  14.  
  15. #define CHANGE_RACE "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Race"
  16. #define CHANGE_FACTION "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Faction"
  17. #define CHANGE_APPEARANCE "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Appearance"
  18. #define CHANGE_NAME "|TInterface/ICONS/VAS_RaceChange:35:35|tChange My Name"
  19.  
  20. class changer : public CreatureScript
  21. {
  22. public:
  23. changer() : CreatureScript("changer") { }
  24.  
  25. bool OnGossipHello(Player* player, Creature* creature)
  26. {
  27. AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_RACE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  28. AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_FACTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
  29. AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_APPEARANCE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
  30. AddGossipItemFor(player, GOSSIP_OPTION_NONE, CHANGE_NAME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
  31. return true;
  32. }
  33.  
  34. bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
  35. {
  36. player->PlayerTalkClass->ClearMenus();
  37.  
  38. switch (action)
  39. {
  40. case GOSSIP_ACTION_INFO_DEF + 1:
  41. player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
  42. player->GetSession()->SendNotification("Relog to change your Race.");
  43. CloseGossipMenuFor(player);
  44. break;
  45. case GOSSIP_ACTION_INFO_DEF + 2:
  46. player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
  47. player->GetSession()->SendNotification("Relog to change your Faction.");
  48. CloseGossipMenuFor(player);
  49. break;
  50. case GOSSIP_ACTION_INFO_DEF + 3:
  51. player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
  52. player->GetSession()->SendNotification("Relog to change your Appearance.");
  53. CloseGossipMenuFor(player);
  54. break;
  55. case GOSSIP_ACTION_INFO_DEF + 4:
  56. player->SetAtLoginFlag(AT_LOGIN_RENAME);
  57. player->GetSession()->SendNotification("Relog to change your Name.");
  58. CloseGossipMenuFor(player);
  59. break;
  60. }
  61. return true;
  62. };
  63.  
  64. void AddSC_changer()
  65. {
  66. new changer();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement