a7mad3ayya6

npcbuff.cpp

Jul 14th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.68 KB | None | 0 0
  1. #include "ScriptedPch.h"
  2. #include "../../shared/Config/Config.h"
  3. #ifndef _TRINITY_CORE_CONFIG
  4. # define _TRINITY_CORE_CONFIG "trinitycore.conf"
  5. #endif _TRINITY_CORE_CONFIG
  6.  
  7. bool GossipHello_Npc_Buff(Player* pPlayer, Creature* pCreature)
  8. {
  9. Config TScriptConfig;
  10. if(!TScriptConfig.SetSource(_TRINITY_CORE_CONFIG,true))
  11. error_log("TScript: Unable to open configuration file");
  12.  
  13. if(TScriptConfig.GetBoolDefault("Npc_Buff.OnlyGMs", false)) // If Npc_Buff.OnlyGMs is enabled in trinitycore.conf
  14. if (pPlayer->GetSession()->GetSecurity() == SEC_PLAYER)
  15. {
  16. pCreature->MonsterWhisper("Sorry, I can only Buff game masters.", pPlayer->GetGUID());
  17. return true;
  18. }
  19.  
  20. bool EnableSmallBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableSmallBuff", true);
  21. bool EnableGreatBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGreatBuff", true);
  22. bool EnableGMBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGMBuff", true);
  23. bool EnablePlayerTools = TScriptConfig.GetBoolDefault("Npc_Buff.EnablePlayerTools", true);
  24. bool EnableResSickness = TScriptConfig.GetBoolDefault("Npc_Buff.EnableRemoveResSickness", true);
  25. bool EnableGivemeGold = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGivemeGold", false);
  26.  
  27. // Main Menu for Alliance
  28. if (pPlayer->GetTeam() == ALLIANCE)
  29. {
  30. // Check config if "Small Buff " is enabled or not
  31. if(EnableSmallBuff)
  32. pPlayer->ADD_GOSSIP_ITEM( 7, "Small Buff ->" , GOSSIP_SENDER_MAIN, 1000);
  33. // Check config if "Great Buff" is enabled or not
  34. if(EnableGreatBuff)
  35. pPlayer->ADD_GOSSIP_ITEM( 7, "Great Buff ->" , GOSSIP_SENDER_MAIN, 2000);
  36. // Check config if "GM Buff" is enabled or not
  37. if(EnableGMBuff)
  38. pPlayer->ADD_GOSSIP_ITEM( 7, "GM Buff ->" , GOSSIP_SENDER_MAIN, 3000);
  39. // Check config if "Player Tools" is enabled or not
  40. if(EnablePlayerTools)
  41. pPlayer->ADD_GOSSIP_ITEM( 7, "Player Tools ->" , GOSSIP_SENDER_MAIN, 4000);
  42. }
  43. else // Main Menu for Horde
  44. {
  45. // Check config if "Small Buff " is enabled or not
  46. if(EnableSmallBuff)
  47. pPlayer->ADD_GOSSIP_ITEM( 7, "Small Buff ->" , GOSSIP_SENDER_MAIN, 1000);
  48. // Check config if "Great Buff" is enabled or not
  49. if(EnableGreatBuff)
  50. pPlayer->ADD_GOSSIP_ITEM( 7, "Great Buff ->" , GOSSIP_SENDER_MAIN, 2000);
  51. // Check config if "GM Buff" is enabled or not
  52. if(EnableGMBuff)
  53. pPlayer->ADD_GOSSIP_ITEM( 7, "GM Buff ->" , GOSSIP_SENDER_MAIN, 3000);
  54. // Check config if "Player Tools" is enabled or not
  55. if(EnablePlayerTools)
  56. pPlayer->ADD_GOSSIP_ITEM( 7, "Player Tools ->" , GOSSIP_SENDER_MAIN, 4000);
  57. }
  58.  
  59. // Check config file if "Remove res sickness" option is enabled or not
  60. if(EnableResSickness)
  61. pPlayer->ADD_GOSSIP_ITEM( 10, "Remove Resurrect Sickness" , GOSSIP_SENDER_MAIN, 5000);
  62.  
  63. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  64.  
  65. return true;
  66. }
  67.  
  68. void SendDefaultMenu_Npc_Buff(Player* pPlayer, Creature* pCreature, uint32 uiAction)
  69. {
  70.  
  71. // Not allow in combat
  72. if (pPlayer->isInCombat())
  73. {
  74. pPlayer->CLOSE_GOSSIP_MENU();
  75. pCreature->MonsterSay("You are in combat!", LANG_UNIVERSAL, NULL);
  76. return;
  77. }
  78.  
  79. Config TScriptConfig;
  80. if(!TScriptConfig.SetSource(_TRINITY_CORE_CONFIG,true))
  81. error_log("TScript: Unable to open configuration file");
  82. bool EnableSmallBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableSmallBuff", true);
  83. bool EnableGreatBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGreatBuff", true);
  84. bool EnableGMBuff = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGMBuff", true);
  85. bool EnablePlayerTools = TScriptConfig.GetBoolDefault("Npc_Buff.EnablePlayerTools", true);
  86. bool EnableResSickness = TScriptConfig.GetBoolDefault("Npc_Buff.EnableRemoveResSickness", true);
  87. bool EnableGivemeGold = TScriptConfig.GetBoolDefault("Npc_Buff.EnableGivemeGold", false);
  88.  
  89. //Money Check
  90. if (pPlayer->GetMoney() < (TScriptConfig.GetFloatDefault("BuffGoldCost",0)))
  91. {
  92. pPlayer->CLOSE_GOSSIP_MENU();
  93. pCreature->MonsterWhisper("You don't have enough money.", pPlayer->GetGUID());
  94. return;
  95. }
  96.  
  97. switch(uiAction)
  98. {
  99.  
  100. case 1000: //Small Buff
  101. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Mark of the Wild" , GOSSIP_SENDER_MAIN, 1001);
  102. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Thorns" , GOSSIP_SENDER_MAIN, 1005);
  103. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Amplify Magic" , GOSSIP_SENDER_MAIN, 1010);
  104. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Arcane Intellect" , GOSSIP_SENDER_MAIN, 1015);
  105. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Dalaran Intellect" , GOSSIP_SENDER_MAIN, 1020);
  106. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Dampen Magic" , GOSSIP_SENDER_MAIN, 1025);
  107. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Blessing of Kings" , GOSSIP_SENDER_MAIN, 1030);
  108. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Blessing of Might" , GOSSIP_SENDER_MAIN, 1035);
  109. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Blessing of Wisdom" , GOSSIP_SENDER_MAIN, 1040);
  110. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Divine Spirit" , GOSSIP_SENDER_MAIN, 1045);
  111. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Power Word: Fortitude" , GOSSIP_SENDER_MAIN, 1050);
  112. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Shadow Protection" , GOSSIP_SENDER_MAIN, 1055);
  113. pPlayer->ADD_GOSSIP_ITEM( 7, "<- Main Menu" , GOSSIP_SENDER_MAIN, 5005);
  114.  
  115. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  116. break;
  117.  
  118. case 2000: //Great Buff
  119. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Gift of the Wild" , GOSSIP_SENDER_MAIN, 2001);
  120. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Arcane Brilliance" , GOSSIP_SENDER_MAIN, 2005);
  121. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Dalaran Brilliance" , GOSSIP_SENDER_MAIN, 2010);
  122. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Greater Blessing of Kings" , GOSSIP_SENDER_MAIN, 2015);
  123. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Greater Blessing of Might" , GOSSIP_SENDER_MAIN, 2020);
  124. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Greater Blessing of Sanctuary" , GOSSIP_SENDER_MAIN, 2025);
  125. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Greater Blessing of Wisdom" , GOSSIP_SENDER_MAIN, 2030);
  126. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Prayer of Fortitude" , GOSSIP_SENDER_MAIN, 2035);
  127. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Prayer of Shadow Protection" , GOSSIP_SENDER_MAIN, 2040);
  128. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Prayer of Spirit" , GOSSIP_SENDER_MAIN, 2045);
  129. pPlayer->ADD_GOSSIP_ITEM( 7, "<- Main Menu" , GOSSIP_SENDER_MAIN, 5005);
  130.  
  131. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  132. break;
  133.  
  134. case 3000: //GM Buff
  135. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Agamaggan's Agility" , GOSSIP_SENDER_MAIN, 3001);
  136. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Agamaggan's Strength" , GOSSIP_SENDER_MAIN, 3005);
  137. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Armor Magic" , GOSSIP_SENDER_MAIN, 3010);
  138. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Armor Penetration" , GOSSIP_SENDER_MAIN, 3015);
  139. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Increased Stamina" , GOSSIP_SENDER_MAIN, 3020);
  140. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Razorhide" , GOSSIP_SENDER_MAIN, 3025);
  141. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Rising Spirit" , GOSSIP_SENDER_MAIN, 3030);
  142. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Spirit of the Wind" , GOSSIP_SENDER_MAIN, 3035);
  143. pPlayer->ADD_GOSSIP_ITEM( 5, "Buff me Wisdom of Agamaggan" , GOSSIP_SENDER_MAIN, 3040);
  144. pPlayer->ADD_GOSSIP_ITEM( 7, "<- Main Menu" , GOSSIP_SENDER_MAIN, 5005);
  145.  
  146. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  147. break;
  148.  
  149. case 4000: //Player Tools
  150. // Check config if "Give me Gold" is enabled or not
  151. if(EnableGivemeGold)
  152. pPlayer->ADD_GOSSIP_ITEM( 5, "Give me Gold" , GOSSIP_SENDER_MAIN, 4001);
  153. pPlayer->ADD_GOSSIP_ITEM( 5, "Give me Soul Shards" , GOSSIP_SENDER_MAIN, 4005);
  154. pPlayer->ADD_GOSSIP_ITEM( 5, "Heal me Please" , GOSSIP_SENDER_MAIN, 4010);
  155. pPlayer->ADD_GOSSIP_ITEM( 5, "Heal me and party members Please" , GOSSIP_SENDER_MAIN, 4015);
  156. pPlayer->ADD_GOSSIP_ITEM( 5, "Conjure Refreshment" , GOSSIP_SENDER_MAIN, 4020);
  157. pPlayer->ADD_GOSSIP_ITEM( 5, "Conjure Mana Gem" , GOSSIP_SENDER_MAIN, 4025);
  158. pPlayer->ADD_GOSSIP_ITEM( 7, "<- Main Menu" , GOSSIP_SENDER_MAIN, 5005);
  159.  
  160. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  161. break;
  162.  
  163. case 5005: //Back To Main Menu
  164. // Main Menu for Alliance
  165. if (pPlayer->GetTeam() == ALLIANCE)
  166. {
  167. // Check config if "Small Buff " is enabled or not
  168. if(EnableSmallBuff)
  169. pPlayer->ADD_GOSSIP_ITEM( 7, "Small Buff ->" , GOSSIP_SENDER_MAIN, 1000);
  170. // Check config if "Great Buff" is enabled or not
  171. if(EnableGreatBuff)
  172. pPlayer->ADD_GOSSIP_ITEM( 7, "Great Buff ->" , GOSSIP_SENDER_MAIN, 2000);
  173. // Check config if "GM Buff" is enabled or not
  174. if(EnableGMBuff)
  175. pPlayer->ADD_GOSSIP_ITEM( 7, "GM Buff ->" , GOSSIP_SENDER_MAIN, 3000);
  176. // Check config if "Player Tools" is enabled or not
  177. if(EnablePlayerTools)
  178. pPlayer->ADD_GOSSIP_ITEM( 7, "Player Tools ->" , GOSSIP_SENDER_MAIN, 4000);
  179. }
  180. else // Main Menu for Horde
  181. {
  182. // Check config if "Small Buff " is enabled or not
  183. if(EnableSmallBuff)
  184. pPlayer->ADD_GOSSIP_ITEM( 7, "Small Buff ->" , GOSSIP_SENDER_MAIN, 1000);
  185. // Check config if "Great Buff" is enabled or not
  186. if(EnableGreatBuff)
  187. pPlayer->ADD_GOSSIP_ITEM( 7, "Great Buff ->" , GOSSIP_SENDER_MAIN, 2000);
  188. // Check config if "GM Buff" is enabled or not
  189. if(EnableGMBuff)
  190. pPlayer->ADD_GOSSIP_ITEM( 7, "GM Buff ->" , GOSSIP_SENDER_MAIN, 3000);
  191. // Check config if "Player Tools" is enabled or not
  192. if(EnablePlayerTools)
  193. pPlayer->ADD_GOSSIP_ITEM( 7, "Player Tools ->" , GOSSIP_SENDER_MAIN, 4000);
  194. }
  195.  
  196. // Check if Ress Sickness option is enabled in scriptdev2.conf
  197. if(EnableResSickness)
  198. pPlayer->ADD_GOSSIP_ITEM( 10, "Remove Resurrect Sickness" , GOSSIP_SENDER_MAIN, 5000);
  199.  
  200. pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
  201. break;
  202.  
  203. //////////////////////////////////////////////////Small Buff///////////////////////////////////////////////////////////////
  204.  
  205. case 1001: // Buff me Mark of the Wild
  206. pPlayer->CLOSE_GOSSIP_MENU();
  207. pCreature->CastSpell(pPlayer,48469,false);
  208. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  209. break;
  210.  
  211. case 1005: // Buff me Thorns
  212. pPlayer->CLOSE_GOSSIP_MENU();
  213. pCreature->CastSpell(pPlayer,53307,false);
  214. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  215. break;
  216.  
  217. case 1010: // Buff me Amplify Magic
  218. pPlayer->CLOSE_GOSSIP_MENU();
  219. pCreature->CastSpell(pPlayer,43017,false);
  220. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  221. break;
  222.  
  223. case 1015: // Buff me Arcane Intellect
  224. pPlayer->CLOSE_GOSSIP_MENU();
  225. pCreature->CastSpell(pPlayer,42995,false);
  226. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  227. break;
  228.  
  229. case 1020: // Buff me Dalaran Intellect
  230. pPlayer->CLOSE_GOSSIP_MENU();
  231. pCreature->CastSpell(pPlayer,61024,false);
  232. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  233. break;
  234.  
  235. case 1025: // Buff me Dampen Magic
  236. pPlayer->CLOSE_GOSSIP_MENU();
  237. pCreature->CastSpell(pPlayer,43015,false);
  238. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  239. break;
  240.  
  241. case 1030: // Buff me Blessing of Kings
  242. pPlayer->CLOSE_GOSSIP_MENU();
  243. pCreature->CastSpell(pPlayer,20217,false);
  244. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  245. break;
  246.  
  247. case 1035: // Buff me Blessing of Might
  248. pPlayer->CLOSE_GOSSIP_MENU();
  249. pCreature->CastSpell(pPlayer,48932,false);
  250. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  251. break;
  252.  
  253. case 1040: // Buff me Blessing of Wisdom
  254. pPlayer->CLOSE_GOSSIP_MENU();
  255. pCreature->CastSpell(pPlayer,48936,false);
  256. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  257. break;
  258.  
  259. case 1045: // Buff me Divine Spirit
  260. pPlayer->CLOSE_GOSSIP_MENU();
  261. pCreature->CastSpell(pPlayer,48073,false);
  262. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  263. break;
  264.  
  265. case 1050: // Buff me Power Word: Fortitude
  266. pPlayer->CLOSE_GOSSIP_MENU();
  267. pCreature->CastSpell(pPlayer,48161,false);
  268. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  269. break;
  270.  
  271. case 1055: // Buff me Shadow Protection
  272. pPlayer->CLOSE_GOSSIP_MENU();
  273. pCreature->CastSpell(pPlayer,48169,false);
  274. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  275. break;
  276.  
  277. //////////////////////////////////////////////////Great Buff///////////////////////////////////////////////////////////////
  278.  
  279. case 2001: // Buff me Gift of the Wild
  280. pPlayer->CLOSE_GOSSIP_MENU();
  281. pPlayer->CastSpell(pPlayer,48470,true);
  282. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  283. break;
  284.  
  285. case 2005: // Buff me Arcane Brilliance
  286. pPlayer->CLOSE_GOSSIP_MENU();
  287. pPlayer->CastSpell(pPlayer,43002,true);
  288. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  289. break;
  290.  
  291. case 2010: // Buff me Dalaran Brilliance
  292. pPlayer->CLOSE_GOSSIP_MENU();
  293. pPlayer->CastSpell(pPlayer,61316,true);
  294. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  295. break;
  296.  
  297. case 2015: // Buff me Greater Blessing of Kings
  298. pPlayer->CLOSE_GOSSIP_MENU();
  299. pCreature->CastSpell(pPlayer,25898,false);
  300. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  301. break;
  302.  
  303. case 2020: // Buff me Greater Blessing of Might
  304. pPlayer->CLOSE_GOSSIP_MENU();
  305. pCreature->CastSpell(pPlayer,48934,false);
  306. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  307. break;
  308.  
  309. case 2025: // Buff me Greater Blessing of Sanctuary
  310. pPlayer->CLOSE_GOSSIP_MENU();
  311. pCreature->CastSpell(pPlayer,25899,false);
  312. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  313. break;
  314.  
  315. case 2030: // Buff me Greater Blessing of Wisdom
  316. pPlayer->CLOSE_GOSSIP_MENU();
  317. pCreature->CastSpell(pPlayer,48938,false);
  318. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  319. break;
  320.  
  321. case 2035: // Buff me Prayer of Fortitude
  322. pPlayer->CLOSE_GOSSIP_MENU();
  323. pPlayer->CastSpell(pPlayer,48162,true);
  324. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  325. break;
  326.  
  327. case 2040: // Buff me Prayer of Shadow Protection
  328. pPlayer->CLOSE_GOSSIP_MENU();
  329. pPlayer->CastSpell(pPlayer,48170,true);
  330. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  331. break;
  332.  
  333. case 2045: // Buff me Prayer of Spirit
  334. pPlayer->CLOSE_GOSSIP_MENU();
  335. pPlayer->CastSpell(pPlayer,48074,true);
  336. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  337. break;
  338.  
  339. //////////////////////////////////////////////////GM Buff///////////////////////////////////////////////////////////////
  340.  
  341. case 3001: // Buff me Agamaggan's Agility
  342. pPlayer->CLOSE_GOSSIP_MENU();
  343. pCreature->CastSpell(pPlayer,17013,false);
  344. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  345. break;
  346.  
  347. case 3005: // Buff me Agamaggan's Strength
  348. pPlayer->CLOSE_GOSSIP_MENU();
  349. pCreature->CastSpell(pPlayer,16612,false);
  350. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  351. break;
  352.  
  353. case 3010: // Buff me Armor Magic
  354. pPlayer->CLOSE_GOSSIP_MENU();
  355. pCreature->CastSpell(pPlayer,58453,false);
  356. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  357. break;
  358.  
  359. case 3015: // Buff me Armor Penetration
  360. pPlayer->CLOSE_GOSSIP_MENU();
  361. pPlayer->CastSpell(pPlayer,34106,false);
  362. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  363. break;
  364.  
  365. case 3020: // Buff me Increased Stamina
  366. pPlayer->CLOSE_GOSSIP_MENU();
  367. pPlayer->CastSpell(pPlayer,25661,false);
  368. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  369. break;
  370.  
  371. case 3025: // Buff me Razorhide
  372. pPlayer->CLOSE_GOSSIP_MENU();
  373. pCreature->CastSpell(pPlayer,16610,false);
  374. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  375. break;
  376.  
  377. case 3030: // Buff me Rising Spirit
  378. pPlayer->CLOSE_GOSSIP_MENU();
  379. pCreature->CastSpell(pPlayer,10767,false);
  380. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  381. break;
  382.  
  383. case 3035: // Buff me Spirit of the Wind
  384. pPlayer->CLOSE_GOSSIP_MENU();
  385. pCreature->CastSpell(pPlayer,16618,false);
  386. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  387. break;
  388.  
  389. case 3040: // Buff me Wisdom of Agamaggan
  390. pPlayer->CLOSE_GOSSIP_MENU();
  391. pCreature->CastSpell(pPlayer,7764,false);
  392. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  393. break;
  394.  
  395. //////////////////////////////////////////////////Player Tools///////////////////////////////////////////////////////////////
  396.  
  397. case 4001://Give me Gold
  398. pPlayer->CLOSE_GOSSIP_MENU();
  399. pCreature->CastSpell(pPlayer,46642,false); // 5000 gold
  400. break;
  401.  
  402. case 4005://Give me Soul Shards
  403. pPlayer->CLOSE_GOSSIP_MENU();
  404. pPlayer->CastSpell(pPlayer,24827,false);
  405. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  406. break;
  407.  
  408. case 4010: // Heal me please
  409. pPlayer->CLOSE_GOSSIP_MENU();
  410. pCreature->CastSpell(pPlayer,38588,false);
  411. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  412. break;
  413.  
  414. case 4015: // Heal me and party members Please
  415. pPlayer->CLOSE_GOSSIP_MENU();
  416. pPlayer->CastSpell(pPlayer,53251,false);
  417. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  418. break;
  419.  
  420. case 4020: // Conjure Refreshment
  421. pPlayer->CLOSE_GOSSIP_MENU();
  422. pPlayer->CastSpell(pPlayer,42956,false);
  423. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  424. break;
  425.  
  426. case 4025: // Conjure Mana Gem
  427. pPlayer->CLOSE_GOSSIP_MENU();
  428. pPlayer->CastSpell(pPlayer,42985,false);
  429. pPlayer->ModifyMoney(-(TScriptConfig.GetFloatDefault("BuffGoldCost",0)));
  430. break;
  431.  
  432. //case 5000://Remove Res Sickness
  433. // if(!pPlayer->HasAura(SPELL_RESURRECTION_SICKNESS_15007,0))
  434. // {
  435. // pCreature->MonsterWhisper("You don't have resurrection sickness.", pPlayer->GetGUID());
  436. // GossipHello_Npc_Buff(pPlayer, pCreature);
  437. // return;
  438. // }
  439. //
  440. // pCreature->CastSpell(pPlayer,38588,false); // Healing effect
  441. // pPlayer->RemoveAurasDueToSpell(SPELL_RESURRECTION_SICKNESS_15007,0);
  442. // pPlayer->CLOSE_GOSSIP_MENU();
  443. //break;
  444.  
  445. pPlayer->CLOSE_GOSSIP_MENU();
  446.  
  447. } // end of switch
  448. } //end of function
  449.  
  450.  
  451.  
  452. bool GossipSelect_Npc_Buff(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
  453. {
  454. // Main menu
  455. if (uiSender == GOSSIP_SENDER_MAIN)
  456. SendDefaultMenu_Npc_Buff(pPlayer, pCreature, uiAction);
  457.  
  458. return true;
  459. }
  460.  
  461. void AddSC_Npc_Buff()
  462. {
  463. Script *newscript;
  464.  
  465. newscript = new Script;
  466. newscript->Name = "npc_buff";
  467. newscript->pGossipHello = &GossipHello_Npc_Buff;
  468. newscript->pGossipSelect = &GossipSelect_Npc_Buff;
  469. newscript->pItemHello = NULL;
  470. newscript->pGOHello = NULL;
  471. newscript->pAreaTrigger = NULL;
  472. newscript->pItemQuestAccept = NULL;
  473. newscript->pGOQuestAccept = NULL;
  474. newscript->pGOChooseReward = NULL;
  475. newscript->RegisterSelf();
  476. }
Add Comment
Please, Sign In to add comment