Guest User

Untitled

a guest
Jan 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.70 KB | None | 0 0
  1. /*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  2. Scripted By: Michaeldev $$$$
  3. Purpose: For AA, Donors$
  4. Completion: 100% $$$$$$$$$$
  5. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
  6.  
  7. #include "ScriptPCH.h"
  8.  
  9. enum NECC
  10. {
  11. NPC_TEXT = 44444,// text for npc in npc_text
  12. GOSSIP_ICON = 6, // self explan
  13. DONOR_TOKEN = 67890,// token id
  14. DONOR_TOKEN_COUNT = 5, // how many it requires
  15. MAX_SKILL_LEVEL = 225 // Max skill level for professions.
  16. };
  17.  
  18. class Pro_Max : public CreatureScript
  19. {
  20. public: Pro_Max() : CreatureScript("Pro_Max") {}
  21.  
  22. void SendMessage(Player* player)
  23. {
  24. ChatHandler(player).PSendSysMessage("You do not have the required amount of donor tokens. You need at least five!");
  25. }
  26.  
  27. bool OnGossipHello(Player* player, Creature* creature)
  28. {
  29. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Engineering(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 1);
  30. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Blacksmithing(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 2);
  31. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Alchemy(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 3);
  32. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Leatherworking(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 4);
  33. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Tailoring(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 5);
  34. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Skinning(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 6);
  35. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Mining(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 7);
  36. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Jewelcrafting(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 8);
  37. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Inscriptions(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 9);
  38. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Herbalism(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 10);
  39. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Cooking(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 11);
  40. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my First Aid(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 12);
  41. player->ADD_GOSSIP_ITEM(GOSSIP_ICON, "Max my Fishing(5 Donor Tokens)", GOSSIP_SENDER_MAIN, 13);
  42. player->ADD_GOSSIP_ITEM(5, "Nevermind!", GOSSIP_SENDER_MAIN, 1000);
  43. player->SEND_GOSSIP_MENU(NPC_TEXT, creature->GetGUID());
  44. return true;
  45. }
  46.  
  47. bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
  48. {
  49. switch(action)
  50. {
  51. case 1000:
  52. player->CLOSE_GOSSIP_MENU();
  53. break;
  54. case 1:
  55. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  56. {
  57. SendMessage(player);
  58. }
  59. else
  60. {
  61. if (player->GetSkillValue(SKILL_ENGINEERING) == MAX_SKILL_LEVEL)
  62. {
  63. player->GetSession()->SendNotification("This profession is already maxed out!");
  64. }
  65. if (player->HasSkill(SKILL_ENGINEERING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  66. {
  67. player->SetSkill(SKILL_ENGINEERING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  68. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  69. }
  70. else
  71. {
  72. player->GetSession()->SendNotification("You must not know this profession.");
  73. }
  74. }
  75. player->CLOSE_GOSSIP_MENU();
  76. break;
  77. case 2:
  78. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  79. {
  80. SendMessage(player);
  81. }
  82. else
  83. {
  84. if (player->GetSkillValue(SKILL_BLACKSMITHING) == MAX_SKILL_LEVEL)
  85. {
  86. player->GetSession()->SendNotification("This profession is already maxed out!");
  87. }
  88. if (player->HasSkill(SKILL_BLACKSMITHING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  89. {
  90. player->SetSkill(SKILL_BLACKSMITHING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  91. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  92. }
  93. else
  94. {
  95. player->GetSession()->SendNotification("You must not know this profession.");
  96. }
  97. }
  98. player->CLOSE_GOSSIP_MENU();
  99. break;
  100. case 3:
  101. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  102. {
  103. SendMessage(player);
  104. }
  105. else
  106. {
  107. if (player->GetSkillValue(SKILL_ALCHEMY) == MAX_SKILL_LEVEL)
  108. {
  109. player->GetSession()->SendNotification("This profession is already maxed out!");
  110. }
  111. if (player->HasSkill(SKILL_ALCHEMY) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  112. {
  113. player->SetSkill(SKILL_ALCHEMY, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  114. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  115. }
  116. else
  117. {
  118. player->GetSession()->SendNotification("You must not know this profession.");
  119. }
  120. }
  121. player->CLOSE_GOSSIP_MENU();
  122. break;
  123. case 4:
  124. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  125. {
  126. SendMessage(player);
  127. }
  128. else
  129. {
  130. if (player->GetSkillValue(SKILL_LEATHERWORKING) == MAX_SKILL_LEVEL)
  131. {
  132. player->GetSession()->SendNotification("This profession is already maxed out!");
  133. }
  134. if (player->HasSkill(SKILL_LEATHERWORKING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  135. {
  136. player->SetSkill(SKILL_LEATHERWORKING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  137. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  138. }
  139. else
  140. {
  141. player->GetSession()->SendNotification("You must not know this profession.");
  142. }
  143. }
  144. player->CLOSE_GOSSIP_MENU();
  145. break;
  146. case 5:
  147. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  148. {
  149. SendMessage(player);
  150. }
  151. else
  152. {
  153. if (player->GetSkillValue(SKILL_TAILORING) == MAX_SKILL_LEVEL)
  154. {
  155. player->GetSession()->SendNotification("This profession is already maxed out!");
  156. }
  157. if (player->HasSkill(SKILL_TAILORING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  158. {
  159. player->SetSkill(SKILL_TAILORING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  160. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  161. }
  162. else
  163. {
  164. player->GetSession()->SendNotification("You must not know this profession.");
  165. }
  166. }
  167. player->CLOSE_GOSSIP_MENU();
  168. break;
  169. case 6:
  170. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  171. {
  172. SendMessage(player);
  173. }
  174. else
  175. {
  176. if (player->GetSkillValue(SKILL_SKINNING) == MAX_SKILL_LEVEL)
  177. {
  178. player->GetSession()->SendNotification("This profession is already maxed out!");
  179. }
  180. if (player->HasSkill(SKILL_SKINNING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  181. {
  182. player->SetSkill(SKILL_SKINNING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  183. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  184. }
  185. else
  186. {
  187. player->GetSession()->SendNotification("You must not know this profession.");
  188. }
  189. }
  190. player->CLOSE_GOSSIP_MENU();
  191. break;
  192. case 8:
  193. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  194. {
  195. SendMessage(player);
  196. }
  197. else
  198. {
  199. if (player->GetSkillValue(SKILL_MINING) == MAX_SKILL_LEVEL)
  200. {
  201. player->GetSession()->SendNotification("This profession is already maxed out!");
  202. }
  203. if (player->HasSkill(SKILL_MINING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  204. {
  205. player->SetSkill(SKILL_MINING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  206. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  207. }
  208. else
  209. {
  210. player->GetSession()->SendNotification("You must not know this profession.");
  211. }
  212. }
  213. player->CLOSE_GOSSIP_MENU();
  214. break;
  215. case 7:
  216. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  217. {
  218. SendMessage(player);
  219. }
  220. else
  221. {
  222. if (player->GetSkillValue(SKILL_JEWELCRAFTING) == MAX_SKILL_LEVEL)
  223. {
  224. player->GetSession()->SendNotification("This profession is already maxed out!");
  225. }
  226. if (player->HasSkill(SKILL_JEWELCRAFTING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  227. {
  228. player->SetSkill(SKILL_JEWELCRAFTING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  229. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  230. }
  231. else
  232. {
  233. player->GetSession()->SendNotification("You must not know this profession.");
  234. }
  235. }
  236. player->CLOSE_GOSSIP_MENU();
  237. break;
  238. case 10:
  239. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  240. {
  241. SendMessage(player);
  242. }
  243. else
  244. {
  245. if (player->GetSkillValue(SKILL_INSCRIPTION) == MAX_SKILL_LEVEL)
  246. {
  247. player->GetSession()->SendNotification("This profession is already maxed out!");
  248. }
  249. if (player->HasSkill(SKILL_INSCRIPTION) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  250. {
  251. player->SetSkill(SKILL_INSCRIPTION, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  252. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  253. }
  254. else
  255. {
  256. player->GetSession()->SendNotification("You must not know this profession.");
  257. }
  258. }
  259. player->CLOSE_GOSSIP_MENU();
  260. break;
  261. case 9:
  262. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  263. {
  264. SendMessage(player);
  265. }
  266. else
  267. {
  268. if (player->GetSkillValue(SKILL_HERBALISM) == MAX_SKILL_LEVEL)
  269. {
  270. player->GetSession()->SendNotification("This profession is already maxed out!");
  271. }
  272. if (player->HasSkill(SKILL_HERBALISM) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  273. {
  274. player->SetSkill(SKILL_HERBALISM, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  275. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  276. }
  277. else
  278. {
  279. player->GetSession()->SendNotification("You must not know this profession.");
  280. }
  281. }
  282. player->CLOSE_GOSSIP_MENU();
  283. break;
  284. case 11:
  285. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  286. {
  287. SendMessage(player);
  288. }
  289. else
  290. {
  291. if (player->GetSkillValue(SKILL_COOKING) == MAX_SKILL_LEVEL)
  292. {
  293. player->GetSession()->SendNotification("This profession is already maxed out!");
  294. }
  295. if (player->HasSkill(SKILL_COOKING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  296. {
  297. player->SetSkill(SKILL_COOKING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  298. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  299. }
  300. else
  301. {
  302. player->GetSession()->SendNotification("You must not know this profession.");
  303. }
  304. }
  305. player->CLOSE_GOSSIP_MENU();
  306. break;
  307. case 12:
  308. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  309. {
  310. SendMessage(player);
  311. }
  312. else
  313. {
  314. if (player->GetSkillValue(SKILL_FIRST_AID) == MAX_SKILL_LEVEL)
  315. {
  316. player->GetSession()->SendNotification("This profession is already maxed out!");
  317. }
  318. if (player->HasSkill(SKILL_FIRST_AID) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  319. {
  320. player->SetSkill(SKILL_FIRST_AID, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  321. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  322. }
  323. else
  324. {
  325. player->GetSession()->SendNotification("You must not know this profession.");
  326. }
  327. }
  328. player->CLOSE_GOSSIP_MENU();
  329. break;
  330. case 13:
  331. if (!player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  332. {
  333. SendMessage(player);
  334. }
  335. else
  336. {
  337. if (player->GetSkillValue(SKILL_FISHING) == MAX_SKILL_LEVEL)
  338. {
  339. player->GetSession()->SendNotification("This profession is already maxed out!");
  340. }
  341. if (player->HasSkill(SKILL_FISHING) && player->HasItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, false))
  342. {
  343. player->SetSkill(SKILL_FISHING, 0, MAX_SKILL_LEVEL, MAX_SKILL_LEVEL);
  344. player->DestroyItemCount(DONOR_TOKEN, DONOR_TOKEN_COUNT, true);
  345. }
  346. else
  347. {
  348. player->GetSession()->SendNotification("You must not know this profession.");
  349. }
  350. }
  351. player->CLOSE_GOSSIP_MENU();
  352. break;
  353. }
  354. return true;
  355. }
  356.  
  357. };
  358.  
  359. void AddSC_Pro_Max()
  360. {
  361. new Pro_Max();
  362. }
Add Comment
Please, Sign In to add comment