Advertisement
Darkdeamont

morpher

May 24th, 2011
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. class npc_morph : public CreatureScript
  4. {
  5. public:
  6. npc_morph() : CreatureScript("npc_morph") { }
  7.  
  8. bool OnGossipHello(Player *player, Creature *_creature)
  9. {
  10. if (player->isInCombat())
  11. {
  12. player->CLOSE_GOSSIP_MENU();
  13. _creature->MonsterWhisper("Combat!", player->GetGUID());
  14. return true;
  15. }
  16. else
  17. {
  18. player->ADD_GOSSIP_ITEM( 3, "Gnome" , GOSSIP_SENDER_MAIN, 1);
  19. player->ADD_GOSSIP_ITEM( 3, "Human" , GOSSIP_SENDER_MAIN, 2);
  20. player->ADD_GOSSIP_ITEM( 3, "Tauren" , GOSSIP_SENDER_MAIN, 3);
  21. player->ADD_GOSSIP_ITEM( 3, "Goblin" , GOSSIP_SENDER_MAIN, 4);
  22. player->ADD_GOSSIP_ITEM( 3, "Blood Elf" , GOSSIP_SENDER_MAIN, 5);
  23. player->ADD_GOSSIP_ITEM( 3, "Broken" , GOSSIP_SENDER_MAIN, 6);
  24. player->ADD_GOSSIP_ITEM( 3, "Other" , GOSSIP_SENDER_MAIN, 7);
  25. player->ADD_GOSSIP_ITEM( 9, "Demorph" , GOSSIP_SENDER_MAIN, 8);
  26.  
  27. }
  28.  
  29. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  30. return true;
  31. }
  32.  
  33. bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 uiAction)
  34. {
  35. if (sender == GOSSIP_SENDER_MAIN)
  36. {
  37. player->PlayerTalkClass->ClearMenus();
  38. switch(uiAction)
  39. {
  40. case 1://Gnome
  41. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 9);
  42. player->ADD_GOSSIP_ITEM( 3, "Female" , GOSSIP_SENDER_MAIN, 10);
  43.  
  44. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  45. break;
  46.  
  47. case 2://Human
  48. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 11);
  49.  
  50. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  51. break;
  52.  
  53. case 3://Tauren
  54. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 12);
  55. player->ADD_GOSSIP_ITEM( 3, "Female" , GOSSIP_SENDER_MAIN, 13);
  56.  
  57. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  58. break;
  59.  
  60. case 4://Goblin
  61. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 14);
  62. player->ADD_GOSSIP_ITEM( 3, "Female" , GOSSIP_SENDER_MAIN, 15);
  63.  
  64. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  65. break;
  66.  
  67. case 5://Blood Elf
  68. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 16);
  69. player->ADD_GOSSIP_ITEM( 3, "Female" , GOSSIP_SENDER_MAIN, 17);
  70.  
  71. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  72. break;
  73.  
  74. case 6://Broken
  75. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 18);
  76.  
  77. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  78. break;
  79.  
  80. case 7://Other
  81. player->ADD_GOSSIP_ITEM( 3, "Champion" , GOSSIP_SENDER_MAIN, 20);
  82. player->ADD_GOSSIP_ITEM( 3, "Pirate" , GOSSIP_SENDER_MAIN, 21);
  83. player->ADD_GOSSIP_ITEM( 3, "Arthas" , GOSSIP_SENDER_MAIN, 22);
  84. player->ADD_GOSSIP_ITEM( 3, "Ghost" , GOSSIP_SENDER_MAIN, 23);
  85. player->ADD_GOSSIP_ITEM( 3, "Wolf" , GOSSIP_SENDER_MAIN, 24);
  86.  
  87. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  88. break;
  89. case 20://Champion
  90. player->ADD_GOSSIP_ITEM( 3, "Darnassus" , GOSSIP_SENDER_MAIN, 25);
  91. player->ADD_GOSSIP_ITEM( 3, "Gnomeregan" , GOSSIP_SENDER_MAIN, 26);
  92. player->ADD_GOSSIP_ITEM( 3, "Ironforge" , GOSSIP_SENDER_MAIN, 27);
  93. player->ADD_GOSSIP_ITEM( 3, "Orgrimmar" , GOSSIP_SENDER_MAIN, 28);
  94. player->ADD_GOSSIP_ITEM( 3, "Silvermoon" , GOSSIP_SENDER_MAIN, 29);
  95. player->ADD_GOSSIP_ITEM( 3, "Stormwind" , GOSSIP_SENDER_MAIN, 30);
  96. player->ADD_GOSSIP_ITEM( 3, "Exodar" , GOSSIP_SENDER_MAIN, 31);
  97. player->ADD_GOSSIP_ITEM( 3, "Undercity" , GOSSIP_SENDER_MAIN, 32);
  98. player->ADD_GOSSIP_ITEM( 3, "Thunder Bluff" , GOSSIP_SENDER_MAIN, 33);
  99. player->ADD_GOSSIP_ITEM( 3, "Ebon" , GOSSIP_SENDER_MAIN, 34);
  100.  
  101. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  102. break;
  103. case 21://Pirate
  104. player->ADD_GOSSIP_ITEM( 3, "Male" , GOSSIP_SENDER_MAIN, 35);
  105. player->ADD_GOSSIP_ITEM( 3, "Female" , GOSSIP_SENDER_MAIN, 36);
  106.  
  107. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  108. break;
  109.  
  110. case 9://Gnome - Male
  111. player->CLOSE_GOSSIP_MENU();
  112. player->SetDisplayId(20580);
  113. break;
  114.  
  115. case 10://Gnome - Female
  116. player->CLOSE_GOSSIP_MENU();
  117. player->SetDisplayId(20581);
  118. break;
  119.  
  120. case 11://Human - Male
  121. player->CLOSE_GOSSIP_MENU();
  122. player->SetDisplayId(19723);
  123. break;
  124.  
  125. case 12://Tauren - Male
  126. player->CLOSE_GOSSIP_MENU();
  127. player->SetDisplayId(20585);
  128. break;
  129.  
  130. case 13://Tauren - Female
  131. player->CLOSE_GOSSIP_MENU();
  132. player->SetDisplayId(20584);
  133. break;
  134.  
  135. case 14://Goblin - Male
  136. player->CLOSE_GOSSIP_MENU();
  137. player->SetDisplayId(20581);
  138. break;
  139.  
  140. case 15://Goblin - Female
  141. player->CLOSE_GOSSIP_MENU();
  142. player->SetDisplayId(20583);
  143. break;
  144.  
  145. case 16://Blood Elf - Male
  146. player->CLOSE_GOSSIP_MENU();
  147. player->SetDisplayId(20578);
  148. break;
  149.  
  150. case 17://Blood Elf - Female
  151. player->CLOSE_GOSSIP_MENU();
  152. player->SetDisplayId(20579);
  153. break;
  154.  
  155. case 18://Broken - Male
  156. player->CLOSE_GOSSIP_MENU();
  157. player->SetDisplayId(21105);
  158. break;
  159.  
  160. case 22://Arthas
  161. player->CLOSE_GOSSIP_MENU();
  162. player->SetDisplayId(22234);
  163. break;
  164.  
  165. case 23://Ghost
  166. player->CLOSE_GOSSIP_MENU();
  167. player->SetDisplayId(14560);
  168. break;
  169.  
  170. case 24://Wolf
  171. player->CLOSE_GOSSIP_MENU();
  172. player->SetDisplayId(741);
  173. break;
  174.  
  175. case 35://Pirate - Male
  176. player->CLOSE_GOSSIP_MENU();
  177. player->SetDisplayId(4620);
  178. break;
  179.  
  180. case 36://Pirate - Female
  181. player->CLOSE_GOSSIP_MENU();
  182. player->SetDisplayId(4619);
  183. break;
  184.  
  185. case 25://Darnassus
  186. player->CLOSE_GOSSIP_MENU();
  187. player->SetDisplayId(29007);
  188. break;
  189.  
  190. case 26://Gnomeregan
  191. player->CLOSE_GOSSIP_MENU();
  192. player->SetDisplayId(28859);
  193. break;
  194.  
  195. case 27://Ironforge
  196. player->CLOSE_GOSSIP_MENU();
  197. player->SetDisplayId(28860);
  198. break;
  199.  
  200. case 28://Orgrimmar
  201. player->CLOSE_GOSSIP_MENU();
  202. player->SetDisplayId(29053);
  203. break;
  204.  
  205. case 29://Silvermoon
  206. player->CLOSE_GOSSIP_MENU();
  207. player->SetDisplayId(28862);
  208. break;
  209.  
  210. case 30://Stormwind
  211. player->CLOSE_GOSSIP_MENU();
  212. player->SetDisplayId(28863);
  213. break;
  214.  
  215. case 31://Exodar
  216. player->CLOSE_GOSSIP_MENU();
  217. player->SetDisplayId(30810);
  218. break;
  219.  
  220. case 32://Undercity
  221. player->CLOSE_GOSSIP_MENU();
  222. player->SetDisplayId(28858);
  223. break;
  224.  
  225. case 33://Thunder Bluff
  226. player->CLOSE_GOSSIP_MENU();
  227. player->SetDisplayId(28597);
  228. break;
  229.  
  230. case 34://Ebon
  231. player->CLOSE_GOSSIP_MENU();
  232. player->SetDisplayId(30862);
  233. break;
  234.  
  235. case 8://Demorph
  236. player->CLOSE_GOSSIP_MENU();
  237. player->DeMorph();
  238. break;
  239. default:
  240. break;
  241. }
  242. }
  243. return true;
  244. }
  245. };
  246.  
  247. void AddSC_npc_morph()
  248. {
  249. new npc_morph();
  250. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement