Advertisement
Guest User

Enchant c++ Trinity

a guest
Jul 12th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 92.44 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. #include "ScriptedEscortAI.h"
  3. #include "ObjectMgr.h"
  4. #include "ScriptMgr.h"
  5.  
  6. enum NpcText
  7. {
  8. E_MAIN = 930004,
  9. E_ENCHANTLIST = 930005,
  10. E_CATLIST = 930006
  11. };
  12.  
  13. enum ClassItem
  14. {
  15. CLASS_ITEM_WEAPON = 2,
  16. CLASS_ITEM_ARMOR = 4
  17. };
  18. enum SubClassItem
  19. {
  20. SUBCLASS_ITEM_TWOHAND_MACE = 5,
  21. SUBCLASS_ITEM_TWOHAND_ACE = 1,
  22. SUBCLASS_ITEM_TWOHAND_SWORD = 8,
  23. SUBCLASS_ITEM_TWOHAND_STAFF = 10,
  24. SUBCLASS_ITEM_TWOHAND_POLEARN = 6,
  25.  
  26. SUBCLASS_ITEM_RANGED_BOW = 2,
  27. SUBCLASS_ITEM_RANGED_CROSSBOW = 18,
  28. SUBCLASS_ITEM_RANGED_GUN = 3,
  29.  
  30. SUBCLASS_ITEM_ARMOR_SHIELD = 6
  31. };
  32.  
  33. enum MenuTabs
  34. {
  35. TAB_MAIN = 0,
  36.  
  37. TAB_HEAD = 1,
  38. TAB_SHOULDERS = 2,
  39. TAB_CHEST = 3,
  40. TAB_WAIST = 4,
  41. TAB_LEGS = 5,
  42. TAB_FEET = 6,
  43. TAB_WRISTS = 7,
  44. TAB_HANDS = 8,
  45. TAB_FINGER = 9,
  46. TAB_FINGER_FIRST = 10,
  47. TAB_FINGER_SECOND = 11,
  48. TAB_BACK = 12,
  49. TAB_WEAPON = 13,
  50.  
  51. TAB_WEAPON_TWO_HAND = 14,
  52. TAB_WEAPON_TWO_HAND_MAIN = 15,
  53. TAB_WEAPON_TWO_HAND_OFF = 16,
  54.  
  55. TAB_WEAPON_ONE_HAND = 17,
  56. TAB_WEAPON_ONE_HAND_MAIN = 18,
  57. TAB_WEAPON_ONE_HAND_OFF = 19,
  58.  
  59. TAB_WEAPON_SHIELD = 20,
  60. TAB_WEAPON_RANGED = 21
  61. };
  62. enum StartAction
  63. {
  64. ACTION_START_HEAD = 100,
  65. ACTION_START_SHOULDERS = 200,
  66. ACTION_START_CHEST = 300,
  67. ACTION_START_WAIST = 400,
  68. ACTION_START_LEGS = 500,
  69. ACTION_START_FEET = 600,
  70. ACTION_START_WRISTS = 700,
  71. ACTION_START_HAND = 800,
  72. ACTION_START_FINGER_FIRST = 900,
  73. ACTION_START_FINGER_SECOND = 1000,
  74. ACTION_START_WEAPON_TWO_MAIN = 1100,
  75. ACTION_START_WEAPON_TWO_OFF = 1200,
  76. ACTION_START_WEAPON_ONE_MAIN = 1300,
  77. ACTION_START_WEAPON_ONE_OFF = 1400,
  78. ACTION_START_WEAPON_SHIELD = 1500,
  79. ACTION_START_WEAPON_RANGED = 1600,
  80. ACTION_START_BACK = 1700
  81. };
  82. enum EndAction
  83. {
  84. ACTION_END_HEAD = 199,
  85. ACTION_END_SHOULDERS = 299,
  86. ACTION_END_CHEST = 399,
  87. ACTION_END_WAIST = 499,
  88. ACTION_END_LEGS = 599,
  89. ACTION_END_FEET = 699,
  90. ACTION_END_WRISTS = 799,
  91. ACTION_END_HAND = 899,
  92. ACTION_END_FINGER_FIRST = 999,
  93. ACTION_END_FINGER_SECOND = 1099,
  94. ACTION_END_WEAPON_TWO_MAIN = 1199,
  95. ACTION_END_WEAPON_TWO_OFF = 1299,
  96. ACTION_END_WEAPON_ONE_MAIN = 1399,
  97. ACTION_END_WEAPON_ONE_OFF = 1499,
  98. ACTION_END_WEAPON_SHIELD = 1599,
  99. ACTION_END_WEAPON_RANGED = 1699,
  100. ACTION_END_BACK = 1799
  101. };
  102.  
  103. enum Head
  104. {
  105. HEAD_ARCANUM_OF_TRIUMPH = 3795,
  106. HEAD_ARCANUM_OF_TORMENT = 3817,
  107. HEAD_ARCANUM_OF_DOMINANCE = 3797,
  108. HEAD_ARCANUM_OF_BURNING_MYSTERIES = 3820,
  109. HEAD_ARCANUM_OF_THE_SAVAGE_GLADIATOR = 3842,
  110. HEAD_ARCANUM_OF_OF_BLISSFUL_MENDING = 3819
  111. };
  112. enum Shoulders
  113. {
  114. SHOULDERS_GREATER_INSCRIPTION_OF_THE_AXE = 3808,
  115. SHOULDERS_GREATER_INSCRIPTION_OF_THE_CRAG = 3809,
  116. SHOULDERS_GREATER_INSCRIPTION_OF_THE_PINNACLE = 3811,
  117. SHOULDERS_GREATER_INSCRIPTION_OF_THE_STORM = 3810,
  118. SHOULDERS_MASTERS_INSCRIPTION_OF_THE_AXE = 3835,
  119. SHOULDERS_MASTERS_INSCRIPTION_OF_THE_CRAG = 3836,
  120. SHOULDERS_MASTERS_INSCRIPTION_OF_THE_PINNACLE = 3837,
  121. SHOULDERS_MASTERS_INSCRIPTION_OF_THE_STORM = 3838
  122. };
  123. enum Chest
  124. {
  125. CHEST_EXCEPTIONAL_MANA = 3233,
  126. CHEST_EXCEPTIONAL_RESILIENCE = 3245,
  127. CHEST_GREATER_DEFENSE = 1953,
  128. CHEST_GREATER_MANA_RESTORATION = 2381,
  129. CHEST_POWERFUL_STATS = 3832,
  130. CHEST_SUPER_HEALTH = 3297
  131. };
  132. enum Waist
  133. {
  134. WAIST_ETERNAL_BELT_BUCKLE = 3729,
  135. WAIST_FRAG_BELT = 3601
  136. };
  137. enum Legs
  138. {
  139. LEGS_BRILLIANT_SPELLTHREAD = 3719,
  140. LEGS_SAPPHIRE_SPELLTHREAD = 3721,
  141. LEGS_ICESCALE_LEG_ARMOR = 3823,
  142. LEGS_FROSTHIDE_LEG_ARMOR = 3822,
  143. LEGS_EARTHEN_LEG_ARMOR = 3853
  144. };
  145. enum Feet
  146. {
  147. FEET_GREATER_ASSAULT = 1597,
  148. FEET_GREATER_FORTITUDE = 1075,
  149. FEET_GREATER_SPIRIT = 1147,
  150. FEET_ICEWALKER = 3826,
  151. FEET_NITRO_BOOTS = 3606,
  152. FEET_SUPERIOR_AGILITY = 983,
  153. FEET_TUSKARS_VITALITY = 3232
  154. };
  155. enum Wrists
  156. {
  157. WRITS_EXCEPTIONAL_INTELLECT = 1119,
  158. WRITS_EXPERTISE = 3231,
  159. WRITS_GREATER_ASSAULT = 3845,
  160. WRITS_MAJOR_SPIRIT = 1147,
  161. WRITS_MAJOR_STAMINA = 3850,
  162. WRITS_SUPERIOR_SPELLPOWER = 2332,
  163. WRITS_SOCKET_BRACER = 3717
  164. };
  165. enum Hands
  166. {
  167. HANDS_ARMSMAN = 3253,
  168. HANDS_CRUSHER = 1603,
  169. HANDS_EXCEPTIONAL_SPELLPOWER = 3246,
  170. HANDS_GREATER_BLASTING = 3249,
  171. HANDS_MAJOR_AGILITY = 3222,
  172. HANDS_PRECISION = 3234,
  173. HANDS_HANDMOUNTED_PYRO_ROCKET = 3723,
  174. HANDS_HYPERSPEED_ACCELERATORS = 3603,
  175. HANDS_SOCKET_GLOVES = 3723
  176. };
  177. enum Finger
  178. {
  179. FINGER_GREATER_SPPED = 3831,
  180. FINGER_MAJOR_AGILITY = 1099,
  181. FINGER_MIGHTY_ARMOR = 3294,
  182. FINGER_SHADOW_ARMOR = 3256,
  183. FINGER_SPELL_PIERCING = 3243,
  184. FINGER_TITANWEAVE = 1951,
  185. FINGER_WISDOM = 3296,
  186. FINGER_DARKGLOW_EMBROIDERY = 3728,
  187. FINGER_LIGHTWEAVE_EMBROIDERY = 3722,
  188. FINGER_SWORDGUARD_EMBROIDERY = 3730,
  189. FINGER_FLEXWEAVE_UNDERLAY = 3605,
  190. FINGER_SPRINGY_ARACHNOWEAVE = 3859
  191. };
  192.  
  193. enum Profession
  194. {
  195. SKILL_BLACKS = 164,
  196. SKILL_JEWELC = 755,
  197. SKILL_ENCHA = 333,
  198. SKILL_ALCH = 171,
  199. SKILL_ENG = 202,
  200. SKILL_INSC = 773,
  201. SKILL_TAIL = 197,
  202. SKILL_MIN = 186,
  203. SKILL_HERB = 182,
  204. SKILL_LEATHERW = 165,
  205. SKILL_SKIN = 393,
  206.  
  207. SKILL_FISH = 356,
  208. SKILL_COOK = 185,
  209. SKILL_FIRST = 129
  210. };
  211. enum Text
  212. {
  213. TEXT_INVALID_BLACKSMITHING = 1,
  214. TEXT_INVALID_JEWELCRAFTING = 2,
  215. TEXT_INVALID_ENCHANTING = 3,
  216. TEXT_INVALID_ALCHEMY = 4,
  217. TEXT_INVALID_ENGINEERING = 5,
  218. TEXT_INVALID_INSCRIPTION = 6,
  219. TEXT_INVALID_TAILORING = 7,
  220. TEXT_INVALID_MINING = 8,
  221. TEXT_INVALID_HERBALISM = 9,
  222. TEXT_INVALID_LEATHERWORKING = 10,
  223. TEXT_INVALID_SKINING = 11,
  224. TEXT_INVALID_COOKING = 12,
  225. TEXT_INVALID_FISHING = 13,
  226. TEXT_INVALID_FIRST_AID = 14,
  227.  
  228. TEXT_ENCHANTING_SUCCES = 15,
  229. TEXT_ENCHANTING_DONT_FIND_ITEM = 16,
  230. TEXT_ENCHANTING_BAD_ITEM = 17
  231. };
  232.  
  233. Player* pPlayer = NULL;
  234. uint32 GMWeapon = 48519;
  235.  
  236. class npc_enchant : CreatureScript
  237. {
  238. public:
  239. npc_enchant() : CreatureScript("npc_enchant") { }
  240.  
  241. void SendEmote(Player* player, Creature* creature, const char* text)
  242. {
  243. creature->MonsterWhisper(text, player->GetGUID(), true);
  244. }
  245. const char* GetText(Text text)
  246. {
  247. const char* result = "...";
  248.  
  249. switch(text)
  250. {
  251. case TEXT_INVALID_BLACKSMITHING:
  252. result = "You have to learn Blacksmithing!";
  253. break;
  254. case TEXT_INVALID_JEWELCRAFTING:
  255. result = "You have to learn Jewelcrafting!";
  256. break;
  257. case TEXT_INVALID_ENCHANTING:
  258. result = "You have to learn Enchanting!";
  259. break;
  260. case TEXT_INVALID_ALCHEMY:
  261. result = "You have to learn Alchemy!";
  262. break;
  263. case TEXT_INVALID_ENGINEERING:
  264. result = "You have to learn Engineering!";
  265. break;
  266. case TEXT_INVALID_INSCRIPTION:
  267. result = "You have to learn Inscription!";
  268. break;
  269. case TEXT_INVALID_TAILORING:
  270. result = "You have to learn Tailoring!";
  271. break;
  272. case TEXT_INVALID_MINING:
  273. result = "You have to learn Mining!";
  274. break;
  275. case TEXT_INVALID_HERBALISM:
  276. result = "You have to learn Herbalism!";
  277. break;
  278. case TEXT_INVALID_LEATHERWORKING:
  279. result = "You have to learn Leatherworking!";
  280. break;
  281. case TEXT_INVALID_SKINING:
  282. result = "You have to learn Skining!";
  283. break;
  284. case TEXT_INVALID_COOKING:
  285. result = "You have to learn Cooking!";
  286. break;
  287. case TEXT_INVALID_FISHING:
  288. result = "You have to learn Fishing!";
  289. break;
  290. case TEXT_ENCHANTING_SUCCES:
  291. result = "Enchantment added succesfully!";
  292. break;
  293. case TEXT_ENCHANTING_DONT_FIND_ITEM:
  294. result = "You don't have the Item Equipped!";
  295. break;
  296. case TEXT_ENCHANTING_BAD_ITEM:
  297. result = "Your Item is not combatible with this Enchant!";
  298. break;
  299. }
  300. return result;
  301. }
  302.  
  303. bool OnGossipHello(Player* player, Creature* creature)
  304. {
  305. GossipHelloMenu(player, creature);
  306.  
  307. player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
  308. return true;
  309. }
  310. bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
  311. {
  312. if(GossipSelectMenu(player, creature, sender, action) == false)
  313. if(GossipSelectHead(player, creature, sender, action) == false)
  314. if(GossipSelectShoulders(player, creature, sender, action) == false)
  315. if(GossipSelectChest(player, creature, sender, action) == false)
  316. if(GossipSelectWaist(player, creature, sender, action) == false)//
  317. if(GossipSelectLegs(player, creature, sender, action) == false)
  318. if(GossipSelectFeet(player, creature, sender, action) == false)
  319. if(GossipSelectWrists(player, creature, sender, action) == false)
  320. if(GossipSelectHands(player, creature, sender, action) == false)
  321. if(GossipSelectFingerFirst(player, creature, sender, action) == false)
  322. if(GossipSelectFingerSecond(player, creature, sender, action) == false)
  323. if(GossipSelectBack(player, creature, sender, action) == false)
  324. if(GossipSelectTwoHandMain(player, creature, sender, action) == false)
  325. if(GossipSelectTwoHandOff(player, creature, sender, action) == false)
  326. if(GossipSelectOneHandMain(player, creature, sender, action) == false)
  327. if(GossipSelectOneHandOff(player, creature, sender, action) == false)
  328. if(GossipSelectShield(player, creature, sender, action) == false)
  329. if(GossipSelectRanged(player, creature, sender, action) == false) { }
  330.  
  331. return true;
  332. }
  333.  
  334. void GossipHelloMenu(Player* player, Creature* creature)
  335. {
  336. player->PlayerTalkClass->ClearMenus();
  337.  
  338. player->ADD_GOSSIP_ITEM(4, "Head", GOSSIP_SENDER_MAIN, TAB_HEAD);
  339. player->ADD_GOSSIP_ITEM(4, "Shoulders", GOSSIP_SENDER_MAIN, TAB_SHOULDERS);
  340. player->ADD_GOSSIP_ITEM(4, "Chest", GOSSIP_SENDER_MAIN, TAB_CHEST);
  341. player->ADD_GOSSIP_ITEM(4, "Waist", GOSSIP_SENDER_MAIN, TAB_WAIST);
  342. player->ADD_GOSSIP_ITEM(4, "Legs", GOSSIP_SENDER_MAIN, TAB_LEGS);
  343. player->ADD_GOSSIP_ITEM(4, "Feet", GOSSIP_SENDER_MAIN, TAB_FEET);
  344. player->ADD_GOSSIP_ITEM(4, "Wrists", GOSSIP_SENDER_MAIN, TAB_WRISTS);
  345. player->ADD_GOSSIP_ITEM(4, "Hands", GOSSIP_SENDER_MAIN, TAB_HANDS);
  346. player->ADD_GOSSIP_ITEM(4, "Finger", GOSSIP_SENDER_MAIN, TAB_FINGER);
  347. player->ADD_GOSSIP_ITEM(4, "Back", GOSSIP_SENDER_MAIN, TAB_BACK);
  348. player->ADD_GOSSIP_ITEM(4, "Weapon", GOSSIP_SENDER_MAIN, TAB_WEAPON);
  349.  
  350. player->PlayerTalkClass->SendGossipMenu(E_MAIN, creature->GetGUID());
  351. }
  352. bool GossipSelectMenu(Player* player, Creature* creature, uint32 sender, uint32 action)
  353. {
  354. switch(action)
  355. {
  356. case TAB_BACK:
  357. GossipHelloBack(player, creature);
  358. return true;
  359. case TAB_MAIN:
  360. GossipHelloMenu(player, creature);
  361. return true;
  362. case TAB_FINGER:
  363. GossipHelloFinger(player, creature);
  364. return true;
  365. case TAB_FINGER_FIRST:
  366. GossipHelloFingerFirst(player, creature);
  367. return true;
  368. case TAB_FINGER_SECOND:
  369. GossipHelloFingerSecond(player, creature);
  370. return true;
  371. case TAB_WEAPON:
  372. GossipHelloWeapon(player, creature);
  373. return true;
  374. case TAB_WEAPON_SHIELD:
  375. GossipHelloShield(player, creature);
  376. return true;
  377. case TAB_WEAPON_RANGED:
  378. GossipHelloRanged(player, creature);
  379. return true;
  380. case TAB_WEAPON_ONE_HAND:
  381. GossipHelloOneHand(player, creature);
  382. return true;
  383. case TAB_WEAPON_ONE_HAND_MAIN:
  384. GossipHelloOneHandMain(player, creature);
  385. return true;
  386. case TAB_WEAPON_ONE_HAND_OFF:
  387. GossipHelloOneHandOff(player, creature);
  388. return true;
  389. case TAB_WEAPON_TWO_HAND:
  390. GossipHelloTwoHand(player, creature);
  391. return true;
  392. case TAB_WEAPON_TWO_HAND_MAIN:
  393. GossipHelloTwoHandMain(player, creature);
  394. return true;
  395. case TAB_WEAPON_TWO_HAND_OFF:
  396. GossipHelloTwoHandOff(player, creature);
  397. return true;
  398. case TAB_HEAD:
  399. GossipHelloHead(player, creature);
  400. return true;
  401. case TAB_SHOULDERS:
  402. GossipHelloShoulders(player, creature);
  403. return true;
  404. case TAB_CHEST:
  405. GossipHelloChest(player, creature);
  406. return true;
  407. case TAB_WAIST:
  408. GossipHelloWaist(player, creature);
  409. return true;
  410. case TAB_LEGS:
  411. GossipHelloLegs(player, creature);
  412. return true;
  413. case TAB_FEET:
  414. GossipHelloFeet(player, creature);
  415. return true;
  416. case TAB_WRISTS:
  417. GossipHelloWrists(player, creature);
  418. return true;
  419. case TAB_HANDS:
  420. GossipHelloHands(player, creature);
  421. return true;
  422. }
  423. return false;
  424. }
  425.  
  426. void GossipHelloHead(Player* player, Creature* creature)
  427. {
  428. player->PlayerTalkClass->ClearMenus();
  429.  
  430. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  431. player->ADD_GOSSIP_ITEM(3, "Arcanum of Triumph", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 1);
  432. player->ADD_GOSSIP_ITEM(3, "Arcanum of Torment", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 2);
  433. player->ADD_GOSSIP_ITEM(3, "Arcanum of Dominance", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 3);
  434. player->ADD_GOSSIP_ITEM(3, "Arcanum of Burning Mysteries", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 4);
  435. player->ADD_GOSSIP_ITEM(3, "Arcanum of the Savage Gladiator", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 5);
  436. player->ADD_GOSSIP_ITEM(3, "Arcanum of Blissful Mending", GOSSIP_SENDER_MAIN, ACTION_START_HEAD + 6);
  437.  
  438. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  439. }
  440. bool GossipSelectHead(Player* player, Creature* creature, uint32 sender, uint32 action)
  441. {
  442. switch(action)
  443. {
  444. case ACTION_START_HEAD + 1:
  445. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_TRIUMPH, PERM_ENCHANTMENT_SLOT);
  446. break;
  447. case ACTION_START_HEAD + 2:
  448. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_TORMENT, PERM_ENCHANTMENT_SLOT);
  449. break;
  450. case ACTION_START_HEAD + 3:
  451. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_DOMINANCE, PERM_ENCHANTMENT_SLOT);
  452. break;
  453. case ACTION_START_HEAD + 4:
  454. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_BURNING_MYSTERIES, PERM_ENCHANTMENT_SLOT);
  455. break;
  456. case ACTION_START_HEAD + 5:
  457. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_THE_SAVAGE_GLADIATOR, PERM_ENCHANTMENT_SLOT);
  458. break;
  459. case ACTION_START_HEAD + 6:
  460. EnchantItem(creature, player, EQUIPMENT_SLOT_HEAD, HEAD_ARCANUM_OF_OF_BLISSFUL_MENDING, PERM_ENCHANTMENT_SLOT);
  461. break;
  462. }
  463.  
  464. if(action >= ACTION_START_HEAD && action <= ACTION_END_HEAD)
  465. {
  466. GossipHelloHead(player, creature);
  467. return true;
  468. }
  469.  
  470. return false;
  471. }
  472.  
  473. void GossipHelloShoulders(Player* player, Creature* creature)
  474. {
  475. player->PlayerTalkClass->ClearMenus();
  476.  
  477. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  478. player->ADD_GOSSIP_ITEM(3, "Inscription of Triumph", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 11);
  479. player->ADD_GOSSIP_ITEM(3, "Inscription of Dominance", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 10);
  480. player->ADD_GOSSIP_ITEM(3, "Greater Inscription of the Gladiator", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 9);
  481. player->ADD_GOSSIP_ITEM(3, "Greater Inscription of the Axe", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 1);
  482. player->ADD_GOSSIP_ITEM(3, "Greater Inscription of the Crag", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 2);
  483. player->ADD_GOSSIP_ITEM(3, "Greater Inscription of the Pinnacle", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 3);
  484. player->ADD_GOSSIP_ITEM(3, "Greater Inscription of the Storm", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 4);
  485. player->ADD_GOSSIP_ITEM(3, "Master's Inscription of the Axe", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 5);
  486. player->ADD_GOSSIP_ITEM(3, "Master's Inscription of the Crag", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 6);
  487. player->ADD_GOSSIP_ITEM(3, "Master's Inscription of the Pinnacle", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 7);
  488. player->ADD_GOSSIP_ITEM(3, "Master's Inscription of the Storm", GOSSIP_SENDER_MAIN, ACTION_START_SHOULDERS + 8);
  489.  
  490. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  491. }
  492. bool GossipSelectShoulders(Player* player, Creature* creature, uint32 sender, uint32 action)
  493. {
  494. switch(action)
  495. {
  496. case ACTION_START_SHOULDERS + 10:
  497. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, 3794, PERM_ENCHANTMENT_SLOT);
  498. break;
  499. case ACTION_START_SHOULDERS + 11:
  500. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, 3793, PERM_ENCHANTMENT_SLOT);
  501. break;
  502. case ACTION_START_SHOULDERS + 9:
  503. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, 3852, PERM_ENCHANTMENT_SLOT);
  504. break;
  505. case ACTION_START_SHOULDERS + 1:
  506. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_GREATER_INSCRIPTION_OF_THE_AXE, PERM_ENCHANTMENT_SLOT);
  507. break;
  508. case ACTION_START_SHOULDERS + 2:
  509. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_GREATER_INSCRIPTION_OF_THE_CRAG, PERM_ENCHANTMENT_SLOT);
  510. break;
  511. case ACTION_START_SHOULDERS + 3:
  512. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_GREATER_INSCRIPTION_OF_THE_PINNACLE, PERM_ENCHANTMENT_SLOT);
  513. break;
  514. case ACTION_START_SHOULDERS + 4:
  515. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_GREATER_INSCRIPTION_OF_THE_STORM, PERM_ENCHANTMENT_SLOT);
  516. break;
  517. case ACTION_START_SHOULDERS + 5:
  518. if (player->HasSkill(SKILL_INSC))
  519. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_MASTERS_INSCRIPTION_OF_THE_AXE, PERM_ENCHANTMENT_SLOT);
  520. else
  521. SendEmote(player, creature, GetText(TEXT_INVALID_INSCRIPTION));
  522. break;
  523. case ACTION_START_SHOULDERS + 6:
  524. if (player->HasSkill(SKILL_INSC))
  525. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_MASTERS_INSCRIPTION_OF_THE_CRAG, PERM_ENCHANTMENT_SLOT);
  526. else
  527. SendEmote(player, creature, GetText(TEXT_INVALID_INSCRIPTION));
  528. break;
  529. case ACTION_START_SHOULDERS + 7:
  530. if (player->HasSkill(SKILL_INSC))
  531. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_MASTERS_INSCRIPTION_OF_THE_PINNACLE, PERM_ENCHANTMENT_SLOT);
  532. else
  533. SendEmote(player, creature, GetText(TEXT_INVALID_INSCRIPTION));
  534. break;
  535. case ACTION_START_SHOULDERS + 8:
  536. if (player->HasSkill(SKILL_INSC))
  537. EnchantItem(creature, player, EQUIPMENT_SLOT_SHOULDERS, SHOULDERS_MASTERS_INSCRIPTION_OF_THE_STORM, PERM_ENCHANTMENT_SLOT);
  538. else
  539. SendEmote(player, creature, GetText(TEXT_INVALID_INSCRIPTION));
  540. break;
  541. }
  542.  
  543. if(action >= ACTION_START_SHOULDERS && action <= ACTION_END_SHOULDERS)
  544. {
  545. GossipHelloShoulders(player, creature);
  546. return true;
  547. }
  548.  
  549. return false;
  550. }
  551.  
  552. void GossipHelloChest(Player* player, Creature* creature)
  553. {
  554. player->PlayerTalkClass->ClearMenus();
  555.  
  556. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  557. player->ADD_GOSSIP_ITEM(3, "Exceptional Mana", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 1);
  558. player->ADD_GOSSIP_ITEM(3, "Exceptional Resilience", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 2);
  559. player->ADD_GOSSIP_ITEM(3, "Greater Defense", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 3);
  560. player->ADD_GOSSIP_ITEM(3, "Greater Mana Restoration", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 4);
  561. player->ADD_GOSSIP_ITEM(3, "Powerful Stats", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 5);
  562. player->ADD_GOSSIP_ITEM(3, "Super Health", GOSSIP_SENDER_MAIN, ACTION_START_CHEST + 6);
  563.  
  564. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  565. }
  566. bool GossipSelectChest(Player* player, Creature* creature, uint32 sender, uint32 action)
  567. {
  568. switch(action)
  569. {
  570. case ACTION_START_CHEST + 1:
  571. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_EXCEPTIONAL_MANA, PERM_ENCHANTMENT_SLOT);
  572. break;
  573. case ACTION_START_CHEST + 2:
  574. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_EXCEPTIONAL_RESILIENCE, PERM_ENCHANTMENT_SLOT);
  575. break;
  576. case ACTION_START_CHEST + 3:
  577. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_GREATER_DEFENSE, PERM_ENCHANTMENT_SLOT);
  578. break;
  579. case ACTION_START_CHEST + 4:
  580. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_GREATER_MANA_RESTORATION, PERM_ENCHANTMENT_SLOT);
  581. break;
  582. case ACTION_START_CHEST + 5:
  583. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_POWERFUL_STATS, PERM_ENCHANTMENT_SLOT);
  584. break;
  585. case ACTION_START_CHEST + 6:
  586. EnchantItem(creature, player, EQUIPMENT_SLOT_CHEST, CHEST_SUPER_HEALTH, PERM_ENCHANTMENT_SLOT);
  587. break;
  588. }
  589.  
  590. if(action >= ACTION_START_CHEST && action <= ACTION_END_CHEST)
  591. {
  592. GossipHelloChest(player, creature);
  593. return true;
  594. }
  595.  
  596. return false;
  597. }
  598.  
  599. void GossipHelloWaist(Player* player, Creature* creature)
  600. {
  601. player->PlayerTalkClass->ClearMenus();
  602.  
  603. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  604. player->ADD_GOSSIP_ITEM(3, "Eternal Belt Buckle", GOSSIP_SENDER_MAIN, ACTION_START_WAIST + 1);
  605. player->ADD_GOSSIP_ITEM(3, "Frag Belt", GOSSIP_SENDER_MAIN, ACTION_START_WAIST + 2);
  606.  
  607. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  608. }
  609. bool GossipSelectWaist(Player* player, Creature* creature, uint32 sender, uint32 action)
  610. {
  611. switch(action)
  612. {
  613. case ACTION_START_WAIST + 1:
  614. EnchantItem(creature, player, EQUIPMENT_SLOT_WAIST, WAIST_ETERNAL_BELT_BUCKLE, PRISMATIC_ENCHANTMENT_SLOT);
  615. break;
  616. case ACTION_START_WAIST + 2:
  617. if (player->HasSkill(SKILL_ENG))
  618. EnchantItem(creature, player, EQUIPMENT_SLOT_WAIST, WAIST_FRAG_BELT, PERM_ENCHANTMENT_SLOT);
  619. else
  620. SendEmote(player, creature, GetText(TEXT_INVALID_ENGINEERING));
  621. break;
  622. }
  623.  
  624. if(action >= ACTION_START_WAIST && action <= ACTION_END_WAIST)
  625. {
  626. GossipHelloWaist(player, creature);
  627. return true;
  628. }
  629.  
  630. return false;
  631. }
  632.  
  633. void GossipHelloLegs(Player* player, Creature* creature)
  634. {
  635. player->PlayerTalkClass->ClearMenus();
  636.  
  637. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  638. player->ADD_GOSSIP_ITEM(3, "Brilliant Spellthread", GOSSIP_SENDER_MAIN, ACTION_START_LEGS + 1);
  639. player->ADD_GOSSIP_ITEM(3, "Sapphire Spellthread", GOSSIP_SENDER_MAIN, ACTION_START_LEGS + 2);
  640. player->ADD_GOSSIP_ITEM(3, "Icescale Leg Armor", GOSSIP_SENDER_MAIN, ACTION_START_LEGS + 3);
  641. player->ADD_GOSSIP_ITEM(3, "Frosthide Leg Armor", GOSSIP_SENDER_MAIN, ACTION_START_LEGS + 4);
  642. player->ADD_GOSSIP_ITEM(3, "Earthen Leg Armor", GOSSIP_SENDER_MAIN, ACTION_START_LEGS + 5);
  643.  
  644. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  645. }
  646. bool GossipSelectLegs(Player* player, Creature* creature, uint32 sender, uint32 action)
  647. {
  648. switch(action)
  649. {
  650. case ACTION_START_LEGS + 1:
  651. EnchantItem(creature, player, EQUIPMENT_SLOT_LEGS, LEGS_BRILLIANT_SPELLTHREAD, PERM_ENCHANTMENT_SLOT);
  652. break;
  653. case ACTION_START_LEGS + 2:
  654. EnchantItem(creature, player, EQUIPMENT_SLOT_LEGS, LEGS_SAPPHIRE_SPELLTHREAD, PERM_ENCHANTMENT_SLOT);
  655. break;
  656. case ACTION_START_LEGS + 3:
  657. EnchantItem(creature, player, EQUIPMENT_SLOT_LEGS, LEGS_ICESCALE_LEG_ARMOR, PERM_ENCHANTMENT_SLOT);
  658. break;
  659. case ACTION_START_LEGS + 4:
  660. EnchantItem(creature, player, EQUIPMENT_SLOT_LEGS, LEGS_FROSTHIDE_LEG_ARMOR, PERM_ENCHANTMENT_SLOT);
  661. break;
  662. case ACTION_START_LEGS + 5:
  663. EnchantItem(creature, player, EQUIPMENT_SLOT_LEGS, LEGS_EARTHEN_LEG_ARMOR, PERM_ENCHANTMENT_SLOT);
  664. break;
  665. }
  666.  
  667. if(action >= ACTION_START_LEGS && action <= ACTION_END_LEGS)
  668. {
  669. GossipHelloLegs(player, creature);
  670. return true;
  671. }
  672.  
  673. return false;
  674. }
  675.  
  676. void GossipHelloFeet(Player* player, Creature* creature)
  677. {
  678. player->PlayerTalkClass->ClearMenus();
  679.  
  680. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  681. player->ADD_GOSSIP_ITEM(3, "Greater Assault", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 1);
  682. player->ADD_GOSSIP_ITEM(3, "Greater Fortitude", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 2);
  683. player->ADD_GOSSIP_ITEM(3, "Greater Spirit", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 3);
  684. player->ADD_GOSSIP_ITEM(3, "Icewalker", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 4);
  685. player->ADD_GOSSIP_ITEM(3, "Nitro Boots", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 5);
  686. player->ADD_GOSSIP_ITEM(3, "Superior Agility", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 6);
  687. player->ADD_GOSSIP_ITEM(3, "Tuskar's Vitality", GOSSIP_SENDER_MAIN, ACTION_START_FEET + 7);
  688.  
  689. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  690. }
  691. bool GossipSelectFeet(Player* player, Creature* creature, uint32 sender, uint32 action)
  692. {
  693. switch(action)
  694. {
  695. case ACTION_START_FEET + 1:
  696. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 1597, PERM_ENCHANTMENT_SLOT);
  697. break;
  698. case ACTION_START_FEET + 2:
  699. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 1075, PERM_ENCHANTMENT_SLOT);
  700. break;
  701. case ACTION_START_FEET + 3:
  702. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 1147, PERM_ENCHANTMENT_SLOT);
  703. break;
  704. case ACTION_START_FEET + 4:
  705. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 3826, PERM_ENCHANTMENT_SLOT);
  706. break;
  707. case ACTION_START_FEET + 5:
  708. if (player->HasSkill(SKILL_ENG))
  709. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 3606, PERM_ENCHANTMENT_SLOT);
  710. else
  711. SendEmote(player, creature, GetText(TEXT_INVALID_ENGINEERING));
  712. break;
  713. case ACTION_START_FEET + 6:
  714. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 983, PERM_ENCHANTMENT_SLOT);
  715. break;
  716. case ACTION_START_FEET + 7:
  717. EnchantItem(creature, player, EQUIPMENT_SLOT_FEET, 3232, PERM_ENCHANTMENT_SLOT);
  718. break;
  719. }
  720.  
  721. if(action >= ACTION_START_FEET && action <= ACTION_END_FEET)
  722. {
  723. GossipHelloFeet(player, creature);
  724. return true;
  725. }
  726.  
  727. return false;
  728. }
  729.  
  730. void GossipHelloWrists(Player* player, Creature* creature)
  731. {
  732. player->PlayerTalkClass->ClearMenus();
  733.  
  734. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  735. player->ADD_GOSSIP_ITEM(3, "Exceptional Intellect", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 1);
  736. player->ADD_GOSSIP_ITEM(3, "Expertise", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 2);
  737. player->ADD_GOSSIP_ITEM(3, "Greater Assault", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 3);
  738. player->ADD_GOSSIP_ITEM(3, "Major Spirit", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 4);
  739. player->ADD_GOSSIP_ITEM(3, "Major Stamina", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 5);
  740. player->ADD_GOSSIP_ITEM(3, "Superior Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 6);
  741. player->ADD_GOSSIP_ITEM(3, "Socket Bracer", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 7);
  742. player->ADD_GOSSIP_ITEM(3, "Fur Lining Attack Power", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 8);
  743. player->ADD_GOSSIP_ITEM(3, "Fur Lining Stamina", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 9);
  744. player->ADD_GOSSIP_ITEM(3, "Fur Lining Spell Power", GOSSIP_SENDER_MAIN, ACTION_START_WRISTS + 10);
  745.  
  746. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  747. }
  748. bool GossipSelectWrists(Player* player, Creature* creature, uint32 sender, uint32 action)
  749. {
  750. switch(action)
  751. {
  752. case ACTION_START_WRISTS + 1:
  753. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 1119, PERM_ENCHANTMENT_SLOT);
  754. break;
  755. case ACTION_START_WRISTS + 2:
  756. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3231, PERM_ENCHANTMENT_SLOT);
  757. break;
  758. case ACTION_START_WRISTS + 3:
  759. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3845, PERM_ENCHANTMENT_SLOT);
  760. break;
  761. case ACTION_START_WRISTS + 4:
  762. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 1147, PERM_ENCHANTMENT_SLOT);
  763. break;
  764. case ACTION_START_WRISTS + 5:
  765. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3850, PERM_ENCHANTMENT_SLOT);
  766. break;
  767. case ACTION_START_WRISTS + 6:
  768. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 2332, PERM_ENCHANTMENT_SLOT);
  769. break;
  770. case ACTION_START_WRISTS + 7:
  771. if (player->HasSkill(SKILL_BLACKS))
  772. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3717, PRISMATIC_ENCHANTMENT_SLOT);
  773. else
  774. SendEmote(player, creature, GetText(TEXT_INVALID_BLACKSMITHING));
  775. break;
  776. case ACTION_START_WRISTS + 8:
  777. if (player->HasSkill(SKILL_LEATHERW))
  778. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3756, PERM_ENCHANTMENT_SLOT);
  779. else
  780. SendEmote(player, creature, GetText(TEXT_INVALID_LEATHERWORKING));
  781. break;
  782. case ACTION_START_WRISTS + 9:
  783. if (player->HasSkill(SKILL_LEATHERW))
  784. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3757, PERM_ENCHANTMENT_SLOT);
  785. else
  786. SendEmote(player, creature, GetText(TEXT_INVALID_LEATHERWORKING));
  787. break;
  788. case ACTION_START_WRISTS + 10:
  789. if (player->HasSkill(SKILL_LEATHERW))
  790. EnchantItem(creature, player, EQUIPMENT_SLOT_WRISTS, 3758, PERM_ENCHANTMENT_SLOT);
  791. else
  792. SendEmote(player, creature, GetText(TEXT_INVALID_LEATHERWORKING));
  793. break;
  794. }
  795.  
  796. if(action >= ACTION_START_WRISTS && action <= ACTION_END_WRISTS)
  797. {
  798. GossipHelloWrists(player, creature);
  799. return true;
  800. }
  801.  
  802. return false;
  803. }
  804.  
  805. void GossipHelloHands(Player* player, Creature* creature)
  806. {
  807. player->PlayerTalkClass->ClearMenus();
  808.  
  809. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  810. player->ADD_GOSSIP_ITEM(3, "Armsman", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 1);
  811. player->ADD_GOSSIP_ITEM(3, "Crusher", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 2);
  812. player->ADD_GOSSIP_ITEM(3, "Exceptional Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 3);
  813. player->ADD_GOSSIP_ITEM(3, "Greater Blasting", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 4);
  814. player->ADD_GOSSIP_ITEM(3, "Major Agility", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 5);
  815. player->ADD_GOSSIP_ITEM(3, "Precision", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 6);
  816. player->ADD_GOSSIP_ITEM(3, "Hand-Mounted Pyro Rocket", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 7);
  817. player->ADD_GOSSIP_ITEM(3, "Hyperspeed Accelerators", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 8);
  818. player->ADD_GOSSIP_ITEM(3, "Socket Gloves", GOSSIP_SENDER_MAIN, ACTION_START_HAND + 9);
  819.  
  820. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  821. }
  822. bool GossipSelectHands(Player* player, Creature* creature, uint32 sender, uint32 action)
  823. {
  824. switch(action)
  825. {
  826. case ACTION_START_HAND + 1:
  827. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3253, PERM_ENCHANTMENT_SLOT);
  828. break;
  829. case ACTION_START_HAND + 2:
  830. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 1603, PERM_ENCHANTMENT_SLOT);
  831. break;
  832. case ACTION_START_HAND + 3:
  833. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3246, PERM_ENCHANTMENT_SLOT);
  834. break;
  835. case ACTION_START_HAND + 4:
  836. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3249, PERM_ENCHANTMENT_SLOT);
  837. break;
  838. case ACTION_START_HAND + 5:
  839. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3222, PERM_ENCHANTMENT_SLOT);
  840. break;
  841. case ACTION_START_HAND + 6:
  842. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3234, PERM_ENCHANTMENT_SLOT);
  843. break;
  844. case ACTION_START_HAND + 7:
  845. if (player->HasSkill(SKILL_ENG))
  846. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3603, PERM_ENCHANTMENT_SLOT);
  847. else
  848. SendEmote(player, creature, GetText(TEXT_INVALID_ENGINEERING));
  849. break;
  850. case ACTION_START_HAND + 8:
  851. if (player->HasSkill(SKILL_ENG))
  852. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3604, PERM_ENCHANTMENT_SLOT);
  853. else
  854. SendEmote(player, creature, GetText(TEXT_INVALID_ENGINEERING));
  855. break;
  856. case ACTION_START_HAND + 9:
  857. if (player->HasSkill(SKILL_BLACKS))
  858. EnchantItem(creature, player, EQUIPMENT_SLOT_HANDS, 3723, PRISMATIC_ENCHANTMENT_SLOT);
  859. else
  860. SendEmote(player, creature, GetText(TEXT_INVALID_BLACKSMITHING));
  861. break;
  862. }
  863.  
  864. if(action >= ACTION_START_HAND && action <= ACTION_END_HAND)
  865. {
  866. GossipHelloHands(player, creature);
  867. return true;
  868. }
  869.  
  870. return false;
  871. }
  872.  
  873. void GossipHelloBack(Player* player, Creature* creature)
  874. {
  875. player->PlayerTalkClass->ClearMenus();
  876.  
  877. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  878. player->ADD_GOSSIP_ITEM(3, "Greater Speed", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 1);
  879. player->ADD_GOSSIP_ITEM(3, "Major Agility", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 2);
  880. player->ADD_GOSSIP_ITEM(3, "Mighty Armor", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 3);
  881. player->ADD_GOSSIP_ITEM(3, "Shadow Armor", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 4);
  882. player->ADD_GOSSIP_ITEM(3, "Spell Piercing", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 5);
  883. player->ADD_GOSSIP_ITEM(3, "Titanweave", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 6);
  884. player->ADD_GOSSIP_ITEM(3, "Wisdom", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 7);
  885. player->ADD_GOSSIP_ITEM(3, "Darkglow Embroidery", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 8);
  886. player->ADD_GOSSIP_ITEM(3, "Lightweave Embroidery", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 9);
  887. player->ADD_GOSSIP_ITEM(3, "Swordguard Embroidery", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 10);
  888. player->ADD_GOSSIP_ITEM(3, "Flexweave Underlay", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 11);
  889. player->ADD_GOSSIP_ITEM(3, "Springy Arachnoweave", GOSSIP_SENDER_MAIN, ACTION_START_BACK + 12);
  890.  
  891. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  892. }
  893. bool GossipSelectBack(Player* player, Creature* creature, uint32 sender, uint32 action)
  894. {
  895. switch(action)
  896. {
  897. case ACTION_START_BACK + 1:
  898. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3831, PERM_ENCHANTMENT_SLOT);
  899. break;
  900. case ACTION_START_BACK + 2:
  901. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 1099, PERM_ENCHANTMENT_SLOT);
  902. break;
  903. case ACTION_START_BACK + 3:
  904. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3294, PERM_ENCHANTMENT_SLOT);
  905. break;
  906. case ACTION_START_BACK + 4:
  907. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3256, PERM_ENCHANTMENT_SLOT);
  908. break;
  909. case ACTION_START_BACK + 5:
  910. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3243, PERM_ENCHANTMENT_SLOT);
  911. break;
  912. case ACTION_START_BACK + 6:
  913. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 1951, PERM_ENCHANTMENT_SLOT);
  914. break;
  915. case ACTION_START_BACK + 7:
  916. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3296, PERM_ENCHANTMENT_SLOT);
  917. break;
  918. case ACTION_START_BACK + 8:
  919. if (player->HasSkill(SKILL_TAIL))
  920. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3728, PERM_ENCHANTMENT_SLOT);
  921. else
  922. SendEmote(player, creature, GetText(TEXT_INVALID_TAILORING));
  923. break;
  924. case ACTION_START_BACK + 9:
  925. if (player->HasSkill(SKILL_TAIL))
  926. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3722, PERM_ENCHANTMENT_SLOT);
  927. else
  928. SendEmote(player, creature, GetText(TEXT_INVALID_TAILORING));
  929. break;
  930. case ACTION_START_BACK + 10:
  931. if (player->HasSkill(SKILL_TAIL))
  932. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3730, PERM_ENCHANTMENT_SLOT);
  933. else
  934. SendEmote(player, creature, GetText(TEXT_INVALID_TAILORING));
  935. break;
  936. case ACTION_START_BACK + 11:
  937. if (player->HasSkill(SKILL_ENG))
  938. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3605, PERM_ENCHANTMENT_SLOT);
  939. else
  940. SendEmote(player, creature, GetText(TEXT_INVALID_TAILORING));
  941. break;
  942. case ACTION_START_BACK + 12:
  943. if (player->HasSkill(SKILL_ENG))
  944. EnchantItem(creature, player, EQUIPMENT_SLOT_BACK, 3859, PERM_ENCHANTMENT_SLOT);
  945. else
  946. SendEmote(player, creature, GetText(TEXT_INVALID_ENGINEERING));
  947. break;
  948. }
  949.  
  950. if(action >= ACTION_START_BACK && action <= ACTION_END_BACK)
  951. {
  952. GossipHelloBack(player, creature);
  953. return true;
  954. }
  955.  
  956. return false;
  957. }
  958.  
  959. void GossipHelloTwoHandMain(Player* player, Creature* creature)
  960. {
  961. player->PlayerTalkClass->ClearMenus();
  962.  
  963. player->ADD_GOSSIP_ITEM(4, "<< Two Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_TWO_HAND);
  964. player->ADD_GOSSIP_ITEM(3, "Massacre", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_MAIN + 1);
  965. player->ADD_GOSSIP_ITEM(3, "Greater Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_MAIN + 2);
  966.  
  967. if(player->getClass() == CLASS_DEATH_KNIGHT)
  968. {
  969. player->ADD_GOSSIP_ITEM(3, "Rune of Spellshattering", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_MAIN + 3);
  970. player->ADD_GOSSIP_ITEM(3, "Rune of Swordshattering", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_MAIN + 4);
  971. player->ADD_GOSSIP_ITEM(3, "Rune of the Stonesking Gargoyle", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_MAIN + 5);
  972. }
  973.  
  974. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  975. }
  976. bool GossipSelectTwoHandMain(Player* player, Creature* creature, uint32 sender, uint32 action)
  977. {
  978. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
  979.  
  980. if(action == ACTION_START_WEAPON_TWO_MAIN + 1
  981. ||action == ACTION_START_WEAPON_TWO_MAIN + 2
  982. ||action == ACTION_START_WEAPON_TWO_MAIN + 3
  983. ||action == ACTION_START_WEAPON_TWO_MAIN + 4
  984. ||action == ACTION_START_WEAPON_TWO_MAIN + 5)
  985. {
  986. GossipHelloTwoHandMain(player, creature);
  987.  
  988. if(!item)
  989. {
  990. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  991. return true;
  992. }
  993.  
  994. if(CanEnchantTwoHand(item))
  995. {
  996. switch(action)
  997. {
  998. case ACTION_START_WEAPON_TWO_MAIN + 1:
  999. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3827, PERM_ENCHANTMENT_SLOT);
  1000. break;
  1001. case ACTION_START_WEAPON_TWO_MAIN + 2:
  1002. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3854, PERM_ENCHANTMENT_SLOT);
  1003. break;
  1004. case ACTION_START_WEAPON_TWO_MAIN + 3:
  1005. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3367, PERM_ENCHANTMENT_SLOT);
  1006. break;
  1007. case ACTION_START_WEAPON_TWO_MAIN + 4:
  1008. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3365, PERM_ENCHANTMENT_SLOT);
  1009. break;
  1010. case ACTION_START_WEAPON_TWO_MAIN + 5:
  1011. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3847, PERM_ENCHANTMENT_SLOT);
  1012. break;
  1013. }
  1014. }
  1015.  
  1016. else
  1017. SendEmote(player, creature, GetText(TEXT_ENCHANTING_BAD_ITEM));
  1018.  
  1019. return true;
  1020. }
  1021.  
  1022. return false;
  1023. }
  1024.  
  1025. void GossipHelloTwoHandOff(Player* player, Creature* creature)
  1026. {
  1027. player->PlayerTalkClass->ClearMenus();
  1028.  
  1029. player->ADD_GOSSIP_ITEM(4, "<< Two Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_TWO_HAND);
  1030. player->ADD_GOSSIP_ITEM(3, "Massacre", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_OFF + 1);
  1031. player->ADD_GOSSIP_ITEM(3, "Greater Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_OFF + 2);
  1032.  
  1033. if(player->getClass() == CLASS_DEATH_KNIGHT)
  1034. {
  1035. player->ADD_GOSSIP_ITEM(3, "Rune of Spellshattering", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_OFF + 3);
  1036. player->ADD_GOSSIP_ITEM(3, "Rune of Swordshattering", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_OFF + 4);
  1037. player->ADD_GOSSIP_ITEM(3, "Rune of the Stonesking Gargoyle", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_TWO_OFF + 5);
  1038. }
  1039.  
  1040. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1041. }
  1042. bool GossipSelectTwoHandOff(Player* player, Creature* creature, uint32 sender, uint32 action)
  1043. {
  1044. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
  1045.  
  1046. if(action == ACTION_START_WEAPON_TWO_OFF + 1
  1047. ||action == ACTION_START_WEAPON_TWO_OFF + 2
  1048. ||action == ACTION_START_WEAPON_TWO_OFF + 3
  1049. ||action == ACTION_START_WEAPON_TWO_OFF + 4
  1050. ||action == ACTION_START_WEAPON_TWO_OFF + 5)
  1051. {
  1052. GossipHelloTwoHandOff(player, creature);
  1053.  
  1054. if(!item)
  1055. {
  1056. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  1057. return true;
  1058. }
  1059.  
  1060. if(CanEnchantTwoHand(item))
  1061. {
  1062. switch(action)
  1063. {
  1064. case ACTION_START_WEAPON_TWO_OFF + 1:
  1065. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3827, PERM_ENCHANTMENT_SLOT);
  1066. break;
  1067. case ACTION_START_WEAPON_TWO_OFF + 2:
  1068. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3854, PERM_ENCHANTMENT_SLOT);
  1069. break;
  1070. case ACTION_START_WEAPON_TWO_OFF + 3:
  1071. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3367, PERM_ENCHANTMENT_SLOT);
  1072. break;
  1073. case ACTION_START_WEAPON_TWO_OFF + 4:
  1074. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3365, PERM_ENCHANTMENT_SLOT);
  1075. break;
  1076. case ACTION_START_WEAPON_TWO_OFF + 5:
  1077. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3847, PERM_ENCHANTMENT_SLOT);
  1078. break;
  1079. }
  1080. }
  1081.  
  1082. else
  1083. SendEmote(player, creature, GetText(TEXT_ENCHANTING_BAD_ITEM));
  1084.  
  1085. return true;
  1086. }
  1087.  
  1088. return false;
  1089. }
  1090.  
  1091. void GossipHelloOneHandMain(Player* player, Creature* creature)
  1092. {
  1093. player->PlayerTalkClass->ClearMenus();
  1094.  
  1095. player->ADD_GOSSIP_ITEM(4, "<< One Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_ONE_HAND);
  1096. player->ADD_GOSSIP_ITEM(3, "Greater Intellect", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 1);
  1097. player->ADD_GOSSIP_ITEM(3, "Exceptional Agility", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 2);
  1098. player->ADD_GOSSIP_ITEM(3, "Exceptional Spirit", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 3);
  1099. player->ADD_GOSSIP_ITEM(3, "Executioner", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 4);
  1100. player->ADD_GOSSIP_ITEM(3, "Mongoose", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 5);
  1101. player->ADD_GOSSIP_ITEM(3, "Berserking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 6);
  1102. player->ADD_GOSSIP_ITEM(3, "Blood Draining", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 7);
  1103. player->ADD_GOSSIP_ITEM(3, "Blade Ward", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 8);
  1104. player->ADD_GOSSIP_ITEM(3, "Black Magic", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 9);
  1105. player->ADD_GOSSIP_ITEM(3, "Mighty Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 10);
  1106. player->ADD_GOSSIP_ITEM(3, "Titanium Weapon Chain", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 18);
  1107. player->ADD_GOSSIP_ITEM(3, "Superior Potency", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 19);
  1108.  
  1109. if(player->getClass() == CLASS_DEATH_KNIGHT)
  1110. {
  1111. player->ADD_GOSSIP_ITEM(3, "Rune of the Fallen Crusader", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 11);
  1112. player->ADD_GOSSIP_ITEM(3, "Rune of Cinderglacier", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 12);
  1113. player->ADD_GOSSIP_ITEM(3, "Rune of Razorice", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 13);
  1114. player->ADD_GOSSIP_ITEM(3, "Rune of Lichbane", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 14);
  1115. player->ADD_GOSSIP_ITEM(3, "Rune of Spellbreaking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 15);
  1116. player->ADD_GOSSIP_ITEM(3, "Rune of Swordbreaking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 16);
  1117. player->ADD_GOSSIP_ITEM(3, "Rune of the Nerubian Carapace", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_MAIN + 17);
  1118. }
  1119.  
  1120. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1121. }
  1122. bool GossipSelectOneHandMain(Player* player, Creature* creature, uint32 sender, uint32 action)
  1123. {
  1124. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
  1125.  
  1126. switch(action)
  1127. {
  1128. case ACTION_START_WEAPON_ONE_MAIN + 1:
  1129. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 2666, PERM_ENCHANTMENT_SLOT);
  1130. break;
  1131. case ACTION_START_WEAPON_ONE_MAIN + 2:
  1132. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 1103, PERM_ENCHANTMENT_SLOT);
  1133. break;
  1134. case ACTION_START_WEAPON_ONE_MAIN + 3:
  1135. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3844, PERM_ENCHANTMENT_SLOT);
  1136. break;
  1137. case ACTION_START_WEAPON_ONE_MAIN + 4:
  1138. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3225, PERM_ENCHANTMENT_SLOT);
  1139. break;
  1140. case ACTION_START_WEAPON_ONE_MAIN + 5:
  1141. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 2673, PERM_ENCHANTMENT_SLOT);
  1142. break;
  1143. case ACTION_START_WEAPON_ONE_MAIN + 6:
  1144. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3789, PERM_ENCHANTMENT_SLOT);
  1145. break;
  1146. case ACTION_START_WEAPON_ONE_MAIN + 7:
  1147. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3870, PERM_ENCHANTMENT_SLOT);
  1148. break;
  1149. case ACTION_START_WEAPON_ONE_MAIN + 8:
  1150. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3869, PERM_ENCHANTMENT_SLOT);
  1151. break;
  1152. case ACTION_START_WEAPON_ONE_MAIN + 9:
  1153. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3790, PERM_ENCHANTMENT_SLOT);
  1154. break;
  1155. case ACTION_START_WEAPON_ONE_MAIN + 10:
  1156. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3834, PERM_ENCHANTMENT_SLOT);
  1157. break;
  1158. case ACTION_START_WEAPON_ONE_MAIN + 11:
  1159. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3368, PERM_ENCHANTMENT_SLOT);
  1160. break;
  1161. case ACTION_START_WEAPON_ONE_MAIN + 12:
  1162. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3369, PERM_ENCHANTMENT_SLOT);
  1163. break;
  1164. case ACTION_START_WEAPON_ONE_MAIN + 13:
  1165. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3370, PERM_ENCHANTMENT_SLOT);
  1166. break;
  1167. case ACTION_START_WEAPON_ONE_MAIN + 14:
  1168. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3366, PERM_ENCHANTMENT_SLOT);
  1169. break;
  1170. case ACTION_START_WEAPON_ONE_MAIN + 15:
  1171. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3595, PERM_ENCHANTMENT_SLOT);
  1172. break;
  1173. case ACTION_START_WEAPON_ONE_MAIN + 16:
  1174. if(item)
  1175. if(item->GetEntry() == GMWeapon)
  1176. EnchantItem(creature, pPlayer, EQUIPMENT_SLOT_MAINHAND, 3594, PERM_ENCHANTMENT_SLOT);
  1177. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3594, PERM_ENCHANTMENT_SLOT);
  1178. break;
  1179. case ACTION_START_WEAPON_ONE_MAIN + 17:
  1180. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3883, PERM_ENCHANTMENT_SLOT);
  1181. break;
  1182. case ACTION_START_WEAPON_ONE_MAIN + 18:
  1183. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3731, PERM_ENCHANTMENT_SLOT);
  1184. break;
  1185. case ACTION_START_WEAPON_ONE_MAIN + 19:
  1186. EnchantItem(creature, player, EQUIPMENT_SLOT_MAINHAND, 3833, PERM_ENCHANTMENT_SLOT);
  1187. break;
  1188. }
  1189.  
  1190. if(action >= ACTION_START_WEAPON_ONE_MAIN && action <= ACTION_END_WEAPON_ONE_MAIN)
  1191. {
  1192. GossipHelloOneHandMain(player, creature);
  1193. return true;
  1194. }
  1195.  
  1196. return false;
  1197. }
  1198.  
  1199. void GossipHelloOneHandOff(Player* player, Creature* creature)
  1200. {
  1201. player->PlayerTalkClass->ClearMenus();
  1202.  
  1203. player->ADD_GOSSIP_ITEM(4, "<< One Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_ONE_HAND);
  1204. player->ADD_GOSSIP_ITEM(3, "Greater Intellect", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 1);
  1205. player->ADD_GOSSIP_ITEM(3, "Exceptional Agility", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 2);
  1206. player->ADD_GOSSIP_ITEM(3, "Exceptional Spirit", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 3);
  1207. player->ADD_GOSSIP_ITEM(3, "Executioner", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 4);
  1208. player->ADD_GOSSIP_ITEM(3, "Mongoose", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 5);
  1209. player->ADD_GOSSIP_ITEM(3, "Berserking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 6);
  1210. player->ADD_GOSSIP_ITEM(3, "Blood Draining", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 7);
  1211. player->ADD_GOSSIP_ITEM(3, "Blade Ward", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 8);
  1212. player->ADD_GOSSIP_ITEM(3, "Black Magic", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 9);
  1213. player->ADD_GOSSIP_ITEM(3, "Mighty Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 10);
  1214. player->ADD_GOSSIP_ITEM(3, "Titanium Weapon Chain", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 18);
  1215. player->ADD_GOSSIP_ITEM(3, "Superior Potency", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 19);
  1216.  
  1217. if(player->getClass() == CLASS_DEATH_KNIGHT)
  1218. {
  1219. player->ADD_GOSSIP_ITEM(3, "Rune of the Fallen Crusader", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 11);
  1220. player->ADD_GOSSIP_ITEM(3, "Rune of Cinderglacier", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 12);
  1221. player->ADD_GOSSIP_ITEM(3, "Rune of Razorice", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 13);
  1222. player->ADD_GOSSIP_ITEM(3, "Rune of Lichbane", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 14);
  1223. player->ADD_GOSSIP_ITEM(3, "Rune of Spellbreaking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 15);
  1224. player->ADD_GOSSIP_ITEM(3, "Rune of Swordbreaking", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 16);
  1225. player->ADD_GOSSIP_ITEM(3, "Rune of the Nerubian Carapace", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_ONE_OFF + 17);
  1226. }
  1227.  
  1228. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1229. }
  1230. bool GossipSelectOneHandOff(Player* player, Creature* creature, uint32 sender, uint32 action)
  1231. {
  1232. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
  1233.  
  1234. if(action == ACTION_START_WEAPON_ONE_OFF + 1
  1235. ||action == ACTION_START_WEAPON_ONE_OFF + 2
  1236. ||action == ACTION_START_WEAPON_ONE_OFF + 3
  1237. ||action == ACTION_START_WEAPON_ONE_OFF + 4
  1238. ||action == ACTION_START_WEAPON_ONE_OFF + 5
  1239. ||action == ACTION_START_WEAPON_ONE_OFF + 6
  1240. ||action == ACTION_START_WEAPON_ONE_OFF + 7
  1241. ||action == ACTION_START_WEAPON_ONE_OFF + 8
  1242. ||action == ACTION_START_WEAPON_ONE_OFF + 9
  1243. ||action == ACTION_START_WEAPON_ONE_OFF + 10
  1244. ||action == ACTION_START_WEAPON_ONE_OFF + 11
  1245. ||action == ACTION_START_WEAPON_ONE_OFF + 12
  1246. ||action == ACTION_START_WEAPON_ONE_OFF + 13
  1247. ||action == ACTION_START_WEAPON_ONE_OFF + 14
  1248. ||action == ACTION_START_WEAPON_ONE_OFF + 15
  1249. ||action == ACTION_START_WEAPON_ONE_OFF + 16
  1250. ||action == ACTION_START_WEAPON_ONE_OFF + 17
  1251. ||action == ACTION_START_WEAPON_ONE_OFF + 18
  1252. ||action == ACTION_START_WEAPON_ONE_OFF + 19)
  1253. {
  1254. GossipHelloOneHandOff(player, creature);
  1255.  
  1256. if(!item)
  1257. {
  1258. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  1259. return false;
  1260. }
  1261.  
  1262. if(CanEnchantOneOffHand(item))
  1263. {
  1264. switch(action)
  1265. {
  1266. case ACTION_START_WEAPON_ONE_OFF + 1:
  1267. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 2666, PERM_ENCHANTMENT_SLOT);
  1268. break;
  1269. case ACTION_START_WEAPON_ONE_OFF + 2:
  1270. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 1103, PERM_ENCHANTMENT_SLOT);
  1271. break;
  1272. case ACTION_START_WEAPON_ONE_OFF + 3:
  1273. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3844, PERM_ENCHANTMENT_SLOT);
  1274. break;
  1275. case ACTION_START_WEAPON_ONE_OFF + 4:
  1276. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3225, PERM_ENCHANTMENT_SLOT);
  1277. break;
  1278. case ACTION_START_WEAPON_ONE_OFF + 5:
  1279. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 2673, PERM_ENCHANTMENT_SLOT);
  1280. break;
  1281. case ACTION_START_WEAPON_ONE_OFF + 6:
  1282. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3789, PERM_ENCHANTMENT_SLOT);
  1283. break;
  1284. case ACTION_START_WEAPON_ONE_OFF + 7:
  1285. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3870, PERM_ENCHANTMENT_SLOT);
  1286. break;
  1287. case ACTION_START_WEAPON_ONE_OFF + 8:
  1288. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3869, PERM_ENCHANTMENT_SLOT);
  1289. break;
  1290. case ACTION_START_WEAPON_ONE_OFF + 9:
  1291. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3790, PERM_ENCHANTMENT_SLOT);
  1292. break;
  1293. case ACTION_START_WEAPON_ONE_OFF + 10:
  1294. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3834, PERM_ENCHANTMENT_SLOT);
  1295. break;
  1296. case ACTION_START_WEAPON_ONE_OFF + 11:
  1297. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3368, PERM_ENCHANTMENT_SLOT);
  1298. break;
  1299. case ACTION_START_WEAPON_ONE_OFF + 12:
  1300. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3369, PERM_ENCHANTMENT_SLOT);
  1301. break;
  1302. case ACTION_START_WEAPON_ONE_OFF + 13:
  1303. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3370, PERM_ENCHANTMENT_SLOT);
  1304. break;
  1305. case ACTION_START_WEAPON_ONE_OFF + 14:
  1306. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3366, PERM_ENCHANTMENT_SLOT);
  1307. break;
  1308. case ACTION_START_WEAPON_ONE_OFF + 15:
  1309. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3595, PERM_ENCHANTMENT_SLOT);
  1310. break;
  1311. case ACTION_START_WEAPON_ONE_OFF + 16:
  1312. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3594, PERM_ENCHANTMENT_SLOT);
  1313. break;
  1314. case ACTION_START_WEAPON_ONE_OFF + 17:
  1315. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3883, PERM_ENCHANTMENT_SLOT);
  1316. break;
  1317. case ACTION_START_WEAPON_ONE_OFF + 18:
  1318. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3731, PERM_ENCHANTMENT_SLOT);
  1319. break;
  1320. case ACTION_START_WEAPON_ONE_OFF + 19:
  1321. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3833, PERM_ENCHANTMENT_SLOT);
  1322. break;
  1323. }
  1324. }
  1325. else
  1326. SendEmote(player, creature, GetText(TEXT_ENCHANTING_BAD_ITEM));
  1327.  
  1328. return true;
  1329. }
  1330.  
  1331. return false;
  1332. }
  1333.  
  1334. void GossipHelloRanged(Player* player, Creature* creature)
  1335. {
  1336. player->PlayerTalkClass->ClearMenus();
  1337.  
  1338. player->ADD_GOSSIP_ITEM(4, "<< Weapon", GOSSIP_SENDER_MAIN, TAB_WEAPON);
  1339. player->ADD_GOSSIP_ITEM(3, "Hearthseeker Scope", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_RANGED + 1);
  1340. player->ADD_GOSSIP_ITEM(3, "Sun Scope", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_RANGED + 2);
  1341.  
  1342. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1343. }
  1344. bool GossipSelectRanged(Player* player, Creature* creature, uint32 sender, uint32 action)
  1345. {
  1346. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
  1347.  
  1348. if(action == ACTION_START_WEAPON_RANGED + 1
  1349. ||action == ACTION_START_WEAPON_RANGED + 2)
  1350. {
  1351. GossipHelloRanged(player, creature);
  1352.  
  1353. if(!item)
  1354. {
  1355. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  1356. return false;
  1357. }
  1358.  
  1359. if(CanEnchantRanged(item))
  1360. {
  1361. switch(action)
  1362. {
  1363. case ACTION_START_WEAPON_RANGED + 1:
  1364. EnchantItem(creature, player, EQUIPMENT_SLOT_RANGED, 3608, PERM_ENCHANTMENT_SLOT);
  1365. break;
  1366. case ACTION_START_WEAPON_RANGED + 2:
  1367. EnchantItem(creature, player, EQUIPMENT_SLOT_RANGED, 3607, PERM_ENCHANTMENT_SLOT);
  1368. break;
  1369. }
  1370. }
  1371.  
  1372. else
  1373. SendEmote(player, creature, GetText(TEXT_ENCHANTING_BAD_ITEM));
  1374.  
  1375. return true;
  1376. }
  1377.  
  1378. return false;
  1379. }
  1380.  
  1381. void GossipHelloShield(Player* player, Creature* creature)
  1382. {
  1383. player->PlayerTalkClass->ClearMenus();
  1384.  
  1385. player->ADD_GOSSIP_ITEM(4, "<< Weapon", GOSSIP_SENDER_MAIN, TAB_WEAPON);
  1386. player->ADD_GOSSIP_ITEM(3, "Defense", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_SHIELD + 1);
  1387. player->ADD_GOSSIP_ITEM(3, "Greater Intellect", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_SHIELD + 2);
  1388. player->ADD_GOSSIP_ITEM(3, "Resilience", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_SHIELD + 3);
  1389. player->ADD_GOSSIP_ITEM(3, "Titanium Plating", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_SHIELD + 4);
  1390. player->ADD_GOSSIP_ITEM(3, "Titanium Shield Spike", GOSSIP_SENDER_MAIN, ACTION_START_WEAPON_SHIELD + 5);
  1391.  
  1392. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1393. }
  1394. bool GossipSelectShield(Player* player, Creature* creature, uint32 sender, uint32 action)
  1395. {
  1396. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
  1397.  
  1398. if(action == ACTION_START_WEAPON_SHIELD + 1
  1399. ||action == ACTION_START_WEAPON_SHIELD + 2
  1400. ||action == ACTION_START_WEAPON_SHIELD + 3
  1401. ||action == ACTION_START_WEAPON_SHIELD + 4
  1402. ||action == ACTION_START_WEAPON_SHIELD + 5)
  1403. {
  1404. GossipHelloShield(player, creature);
  1405.  
  1406. if(!item)
  1407. {
  1408. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  1409. return false;
  1410. }
  1411.  
  1412. if(CanEnchantShield(item))
  1413. {
  1414. switch(action)
  1415. {
  1416. case ACTION_START_WEAPON_SHIELD + 1:
  1417. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 1952, PERM_ENCHANTMENT_SLOT);
  1418. break;
  1419. case ACTION_START_WEAPON_SHIELD + 2:
  1420. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 1128, PERM_ENCHANTMENT_SLOT);
  1421. break;
  1422. case ACTION_START_WEAPON_SHIELD + 3:
  1423. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3229, PERM_ENCHANTMENT_SLOT);
  1424. break;
  1425. case ACTION_START_WEAPON_SHIELD + 4:
  1426. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3849, PERM_ENCHANTMENT_SLOT);
  1427. break;
  1428. case ACTION_START_WEAPON_SHIELD + 5:
  1429. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3748, PERM_ENCHANTMENT_SLOT);
  1430. break;
  1431. }
  1432. }
  1433.  
  1434. else
  1435. SendEmote(player, creature, GetText(TEXT_ENCHANTING_BAD_ITEM));
  1436.  
  1437. return true;
  1438. }
  1439.  
  1440. switch(action)
  1441. {
  1442. case 1801:
  1443. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 1952, PERM_ENCHANTMENT_SLOT);
  1444. GossipHelloShield(player, creature);
  1445. return true;
  1446.  
  1447. case 1802:
  1448. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 1128, PERM_ENCHANTMENT_SLOT);
  1449. GossipHelloShield(player, creature);
  1450. return true;
  1451.  
  1452. case 1803:
  1453. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3229, PERM_ENCHANTMENT_SLOT);
  1454. GossipHelloShield(player, creature);
  1455. return true;
  1456.  
  1457. case 1804:
  1458. EnchantItem(creature, player, EQUIPMENT_SLOT_OFFHAND, 3849, PERM_ENCHANTMENT_SLOT);
  1459. GossipHelloShield(player, creature);
  1460. return true;
  1461. }
  1462. return false;
  1463. }
  1464.  
  1465. void GossipHelloFingerFirst(Player* player, Creature* creature)
  1466. {
  1467. player->PlayerTalkClass->ClearMenus();
  1468.  
  1469. player->ADD_GOSSIP_ITEM(4, "<< Finger", GOSSIP_SENDER_MAIN, TAB_FINGER);
  1470. player->ADD_GOSSIP_ITEM(3, "Assault", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_FIRST + 1);
  1471. player->ADD_GOSSIP_ITEM(3, "Stamina", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_FIRST + 2);
  1472. player->ADD_GOSSIP_ITEM(3, "Greater Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_FIRST + 3);
  1473.  
  1474. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1475. }
  1476. bool GossipSelectFingerFirst(Player* player, Creature* creature, uint32 sender, uint32 action)
  1477. {
  1478. if(action == ACTION_START_FINGER_FIRST + 1
  1479. ||action == ACTION_START_FINGER_FIRST + 2
  1480. ||action == ACTION_START_FINGER_FIRST + 3)
  1481. {
  1482. GossipHelloFingerFirst(player, creature);
  1483.  
  1484. if (player->HasSkill(SKILL_ENCHA))
  1485. switch(action)
  1486. {
  1487. case ACTION_START_FINGER_FIRST + 1:
  1488. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER1, 3839, PERM_ENCHANTMENT_SLOT);
  1489. break;
  1490. case ACTION_START_FINGER_FIRST + 2:
  1491. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER1, 3791, PERM_ENCHANTMENT_SLOT);
  1492. break;
  1493. case ACTION_START_FINGER_FIRST + 3:
  1494. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER1, 3840, PERM_ENCHANTMENT_SLOT);
  1495. break;
  1496. }
  1497.  
  1498. else
  1499. SendEmote(player, creature, GetText(TEXT_INVALID_ENCHANTING));
  1500.  
  1501. return true;
  1502. }
  1503.  
  1504. return false;
  1505. }
  1506.  
  1507. void GossipHelloFingerSecond(Player* player, Creature* creature)
  1508. {
  1509. player->PlayerTalkClass->ClearMenus();
  1510.  
  1511. player->ADD_GOSSIP_ITEM(4, "<< Finger", GOSSIP_SENDER_MAIN, TAB_FINGER);
  1512. player->ADD_GOSSIP_ITEM(3, "Assault", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_SECOND + 1);
  1513. player->ADD_GOSSIP_ITEM(3, "Stamina", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_SECOND + 2);
  1514. player->ADD_GOSSIP_ITEM(3, "Greater Spellpower", GOSSIP_SENDER_MAIN, ACTION_START_FINGER_SECOND + 3);
  1515.  
  1516. player->PlayerTalkClass->SendGossipMenu(E_ENCHANTLIST, creature->GetGUID());
  1517. }
  1518. bool GossipSelectFingerSecond(Player* player, Creature* creature, uint32 sender, uint32 action)
  1519. {
  1520. if(action == ACTION_START_FINGER_SECOND + 1
  1521. ||action == ACTION_START_FINGER_SECOND + 2
  1522. ||action == ACTION_START_FINGER_SECOND + 3)
  1523. {
  1524. GossipHelloFingerSecond(player, creature);
  1525.  
  1526. if (player->HasSkill(SKILL_ENCHA))
  1527. switch(action)
  1528. {
  1529. case ACTION_START_FINGER_SECOND + 1:
  1530. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER2, 3839, PERM_ENCHANTMENT_SLOT);
  1531. break;
  1532. case ACTION_START_FINGER_SECOND + 2:
  1533. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER2, 3791, PERM_ENCHANTMENT_SLOT);
  1534. break;
  1535. case ACTION_START_FINGER_SECOND + 3:
  1536. EnchantItem(creature, player, EQUIPMENT_SLOT_FINGER2, 3840, PERM_ENCHANTMENT_SLOT);
  1537. break;
  1538. }
  1539.  
  1540. else
  1541. SendEmote(player, creature, GetText(TEXT_INVALID_ENCHANTING));
  1542.  
  1543. return true;
  1544. }
  1545.  
  1546. return false;
  1547. }
  1548.  
  1549. void GossipHelloWeapon(Player* player, Creature* creature)
  1550. {
  1551. player->PlayerTalkClass->ClearMenus();
  1552.  
  1553. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  1554. player->ADD_GOSSIP_ITEM(4, "Two Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_TWO_HAND);
  1555. player->ADD_GOSSIP_ITEM(4, "One Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_ONE_HAND);
  1556. player->ADD_GOSSIP_ITEM(4, "Ranged", GOSSIP_SENDER_MAIN, TAB_WEAPON_RANGED);
  1557. player->ADD_GOSSIP_ITEM(4, "Shield", GOSSIP_SENDER_MAIN, TAB_WEAPON_SHIELD);
  1558.  
  1559. player->PlayerTalkClass->SendGossipMenu(E_CATLIST, creature->GetGUID());
  1560. }
  1561. void GossipHelloTwoHand(Player* player, Creature* creature)
  1562. {
  1563. player->PlayerTalkClass->ClearMenus();
  1564.  
  1565. player->ADD_GOSSIP_ITEM(4, "<< Weapon", GOSSIP_SENDER_MAIN, TAB_WEAPON);
  1566. player->ADD_GOSSIP_ITEM(4, "Main Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_TWO_HAND_MAIN);
  1567. player->ADD_GOSSIP_ITEM(4, "Off Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_TWO_HAND_OFF);
  1568.  
  1569. player->PlayerTalkClass->SendGossipMenu(E_CATLIST, creature->GetGUID());
  1570. }
  1571. void GossipHelloOneHand(Player* player, Creature* creature)
  1572. {
  1573. player->PlayerTalkClass->ClearMenus();
  1574.  
  1575. player->ADD_GOSSIP_ITEM(4, "<< Weapon", GOSSIP_SENDER_MAIN, TAB_WEAPON);
  1576. player->ADD_GOSSIP_ITEM(4, "Main Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_ONE_HAND_MAIN);
  1577. player->ADD_GOSSIP_ITEM(4, "Off Hand", GOSSIP_SENDER_MAIN, TAB_WEAPON_ONE_HAND_OFF);
  1578.  
  1579. player->PlayerTalkClass->SendGossipMenu(E_CATLIST, creature->GetGUID());
  1580. }
  1581. void GossipHelloFinger(Player* player, Creature* creature)
  1582. {
  1583. player->PlayerTalkClass->ClearMenus();
  1584.  
  1585. player->ADD_GOSSIP_ITEM(4, "<< Menu", GOSSIP_SENDER_MAIN, TAB_MAIN);
  1586. player->ADD_GOSSIP_ITEM(4, "1. Finger", GOSSIP_SENDER_MAIN, TAB_FINGER_FIRST);
  1587. player->ADD_GOSSIP_ITEM(4, "2. Finger", GOSSIP_SENDER_MAIN, TAB_FINGER_SECOND);
  1588.  
  1589. player->PlayerTalkClass->SendGossipMenu(E_CATLIST, creature->GetGUID());
  1590. }
  1591.  
  1592. bool CanEnchantTwoHand(Item* item)
  1593. {
  1594. if(!item)
  1595. return false;
  1596.  
  1597. ItemTemplate const* proto = item->GetTemplate();
  1598. if(!proto)
  1599. return false;
  1600.  
  1601. uint32 itemSubClass = proto->SubClass;
  1602. uint32 itemClass = proto->Class;
  1603.  
  1604. if(itemSubClass == SUBCLASS_ITEM_TWOHAND_MACE
  1605. ||itemSubClass == SUBCLASS_ITEM_TWOHAND_ACE
  1606. ||itemSubClass == SUBCLASS_ITEM_TWOHAND_SWORD
  1607. ||itemSubClass == SUBCLASS_ITEM_TWOHAND_STAFF
  1608. ||itemSubClass == SUBCLASS_ITEM_TWOHAND_POLEARN
  1609. &&itemClass == CLASS_ITEM_WEAPON)
  1610. return true;
  1611.  
  1612. return false;
  1613. }
  1614. bool CanEnchantOneOffHand(Item* item)
  1615. {
  1616. if(!item)
  1617. return false;
  1618.  
  1619. ItemTemplate const* proto = item->GetTemplate();
  1620. if(!proto)
  1621. return false;
  1622.  
  1623. uint32 itemClass = proto->Class;
  1624.  
  1625. if(itemClass == CLASS_ITEM_WEAPON)
  1626. return true;
  1627.  
  1628. return false;
  1629. }
  1630. bool CanEnchantRanged(Item* item)
  1631. {
  1632. if(!item)
  1633. return false;
  1634.  
  1635. ItemTemplate const* proto = item->GetTemplate();
  1636. if(!proto)
  1637. return false;
  1638.  
  1639. uint32 itemSubClass = proto->SubClass;
  1640.  
  1641. if(itemSubClass == SUBCLASS_ITEM_RANGED_BOW
  1642. ||itemSubClass == SUBCLASS_ITEM_RANGED_CROSSBOW
  1643. ||itemSubClass == SUBCLASS_ITEM_RANGED_GUN)
  1644. return true;
  1645.  
  1646. return false;
  1647. }
  1648. bool CanEnchantShield(Item* item)
  1649. {
  1650. if(!item)
  1651. return false;
  1652.  
  1653. ItemTemplate const* proto = item->GetTemplate();
  1654. if(!proto)
  1655. return false;
  1656.  
  1657. uint32 itemSubClass = proto->SubClass;
  1658.  
  1659. if(itemSubClass == SUBCLASS_ITEM_ARMOR_SHIELD)
  1660. return true;
  1661.  
  1662. return false;
  1663. }
  1664.  
  1665. bool EnchantItem(Creature* creature, Player* player, EquipmentSlots EquipS, int32 ID, EnchantmentSlot EnchS)
  1666. {
  1667. Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EquipS);
  1668. if(!item)
  1669. {
  1670. SendEmote(player, creature, GetText(TEXT_ENCHANTING_DONT_FIND_ITEM));
  1671. return false;
  1672. }
  1673.  
  1674. player->ApplyEnchantment(item, EnchS, false);
  1675. item->SetEnchantment(EnchS, ID, 0, 0);
  1676. player->ApplyEnchantment(item, EnchS, true);
  1677.  
  1678. SendEmote(player, creature, GetText(TEXT_ENCHANTING_SUCCES));
  1679. return true;
  1680. }
  1681. };
  1682.  
  1683. void AddSC_npc_enchant()
  1684. {
  1685. new npc_enchant();
  1686. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement