Advertisement
Guest User

Untitled

a guest
Jan 5th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.35 KB | None | 0 0
  1. package mysql.impl;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.ResultSet;
  6. import java.sql.SQLException;
  7. import java.sql.Statement;
  8.  
  9. import com.rs.game.World;
  10. import com.rs.game.player.Player;
  11. import com.rs.utils.Colors;
  12.  
  13. /**
  14. * Using this class: To call this class, it's best to make a new thread. You can
  15. * do it below like so: new Thread(new Donation(player)).start();
  16. */
  17. public class Donation implements Runnable {
  18.  
  19. public static final String HOST = "166.62.28.140";
  20. public static final String USER = "helwyrstore";
  21. public static final String PASS = "grepolis515";
  22. public static final String DATABASE = "helwyrstore";
  23.  
  24. private Player player;
  25. private Connection conn;
  26. private Statement stmt;
  27.  
  28. /**
  29. * The constructor
  30. *
  31. * @param player
  32. */
  33. public Donation(Player player) {
  34. this.player = player;
  35. }
  36.  
  37. @Override
  38. public void run() {
  39. try {
  40. if (!connect(HOST, DATABASE, USER, PASS)) {
  41. return;
  42. }
  43.  
  44. String name = player.getUsername().replace("_", " ");
  45. ResultSet rs = executeQuery(
  46. "SELECT * FROM payments WHERE player_name='" + name + "' AND status='Completed' AND claimed=0");
  47.  
  48. while (rs.next()) {
  49. int item_number = rs.getInt("item_number");
  50. double paid = rs.getDouble("amount");
  51. int quantity = rs.getInt("quantity");
  52.  
  53. switch (item_number) {// add products according to their ID in the ACP
  54.  
  55. case 22: // example
  56. player.getAchManager().addKeyAmount("donator", 1);
  57. player.handleDonation(1 * quantity, "Store Credit");
  58. player.getInventory().addItem(34896, 1 * quantity);
  59. player.sendMessage("You've purchased: [" + Colors.red + "1usd Store credit.</col>] "
  60. + "Open the Store credit to claim the credit!.");
  61. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  62. + " </col> Donated </col>" + Colors.red + "x" + quantity
  63. + "</col> 1 usd Store Credit! and has now a total of " + Colors.red + "$"
  64. + player.getMoneySpent() + " Donation.", false);
  65. break;
  66. case 23: // example
  67. player.getAchManager().addKeyAmount("donator", 1);
  68. player.handleDonation(5 * quantity, "Store Credit");
  69. player.getInventory().addItem(34896, 5 * quantity);
  70. player.sendMessage("You've purchased: [" + Colors.red + "5 usd Store credit.</col>] "
  71. + "Open the Store credit to claim the credit!.");
  72. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  73. + " </col> Donated </col>" + Colors.red + "x" + quantity
  74. + "</col> 5 usd Store Credit! and has now a total of " + Colors.red + "$"
  75. + player.getMoneySpent() + " Donation.", false);
  76. break;
  77. case 24: // example
  78. player.getAchManager().addKeyAmount("donator", 1);
  79. player.handleDonation(10 * quantity, "Store Credit");
  80. player.getInventory().addItem(34896, 10 * quantity);
  81. player.sendMessage("You've purchased: [" + Colors.red + "10 usd Store credit.</col>] "
  82. + "Open the Store credit to claim the credit!.");
  83. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  84. + " </col> Donated </col>" + Colors.red + "x" + quantity
  85. + "</col> 10 usd Store Credit! and has now a total of " + Colors.red + "$"
  86. + player.getMoneySpent() + " Donation.", false);
  87. break;
  88. case 25: // example
  89. player.getAchManager().addKeyAmount("donator", 1);
  90. player.handleDonation(20 * quantity, "Store Credit");
  91. player.getInventory().addItem(34896, 20 * quantity);
  92. player.sendMessage("You've purchased: [" + Colors.red + "20 usd Store credit.</col>] "
  93. + "Open the Store credit to claim the credit!.");
  94. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  95. + " </col> Donated </col>" + Colors.red + "x" + quantity
  96. + "</col> 20 usd Store Credit! and has now a total of " + Colors.red + "$"
  97. + player.getMoneySpent() + " Donation.", false);
  98. break;
  99.  
  100. case 26: // example
  101. player.getAchManager().addKeyAmount("donator", 1);
  102. player.handleDonation(50 * quantity, "Store Credit");
  103. player.getInventory().addItem(34896, 50 * quantity);
  104. player.sendMessage("You've purchased: [" + Colors.red + "50 usd Store credit.</col>] "
  105. + "Open the Store credit to claim the credit!.");
  106. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  107. + " </col> Donated </col>" + Colors.red + "x" + quantity
  108. + "</col> 50 usd Store Credit! and has now a total of " + Colors.red + "$"
  109. + player.getMoneySpent() + " Donation.", false);
  110. break;
  111.  
  112. case 27:
  113. player.getAchManager().addKeyAmount("donator", 1);
  114. player.handleDonation(100 * quantity, "Store Credit");
  115. player.getInventory().addItem(34896, 100 * quantity);
  116. player.sendMessage("You've purchased: [" + Colors.red + "100 usd Store credit.</col>] "
  117. + "Open the Store credit to claim the credit!.");
  118. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  119. + " </col> Donated </col>" + Colors.red + "x" + quantity
  120. + "</col> 100 usd Store Credit! and has now a total of " + Colors.red + "$"
  121. + player.getMoneySpent() + " Donation.", false);
  122. break;
  123.  
  124. case 28:
  125. player.getAchManager().addKeyAmount("donator", 1);
  126. player.getPerkManager().familiarExpert = true;
  127. player.handleDonation(5 * quantity, "Familiar Expert");
  128. player.sendMessage("You've purchased: [" + Colors.red + "Familiar Expert</col>]. "
  129. + "Type ;;perks to see all your game perks.");
  130. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  131. + " </col> Donated for [" + Colors.yellow + "Familiar Expert"
  132. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  133. + " Donation.", false);
  134. break;
  135.  
  136. case 29:
  137. player.getAchManager().addKeyAmount("donator", 1);
  138. player.getPerkManager().chargeBefriender = true;
  139. player.handleDonation(15 * quantity, "Charge Befriender");
  140. player.sendMessage("You've purchased: [" + Colors.red + "Charge Befriender</col>]. "
  141. + "Type ;;perks to see all your game perks.");
  142. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  143. + " </col> Donated for [" + Colors.yellow + "Charge Befriender"
  144. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  145. + " Donation.", false);
  146. break;
  147.  
  148. case 30:
  149. player.getAchManager().addKeyAmount("donator", 1);
  150. player.getPerkManager().charmCollector = true;
  151. player.handleDonation(3 * quantity, "Charm Collector");
  152. player.sendMessage("You've purchased: [" + Colors.red + "Charm Collector</col>]. "
  153. + "Type ;;perks to see all your game perks.");
  154. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  155. + " </col> Donated for [" + Colors.yellow + "Charm Collector"
  156. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  157. + " Donation.", false);
  158. break;
  159.  
  160. case 31:
  161. player.getAchManager().addKeyAmount("donator", 1);
  162. player.getPerkManager().coinCollector = true;
  163. player.handleDonation(3 * quantity, "Coin Collector");
  164. player.sendMessage("You've purchased: [" + Colors.red + "Coin Collector</col>]. "
  165. + "Type ;;perks to see all your game perks.");
  166. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  167. + " </col> Donated for [" + Colors.yellow + "Coin Collector"
  168. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  169. + " Donation.", false);
  170. break;
  171.  
  172. case 32:
  173. player.getAchManager().addKeyAmount("donator", 1);
  174. player.getPerkManager().prayerBetrayer = true;
  175. player.handleDonation(10 * quantity, "Prayer Betrayer");
  176. player.sendMessage("You've purchased: [" + Colors.red + "Prayer Betrayer</col>]. "
  177. + "Type ;;perks to see all your game perks.");
  178. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  179. + " </col> Donated for [" + Colors.yellow + "Prayer Betrayer"
  180. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  181. + " Donation.", false);
  182. break;
  183.  
  184. case 33:
  185. player.getAchManager().addKeyAmount("donator", 1);
  186. player.getPerkManager().avasSecret = true;
  187. player.handleDonation(5 * quantity, "Avas Secret");
  188. player.sendMessage("You've purchased: [" + Colors.red + "Avas Secret</col>]. "
  189. + "Type ;;perks to see all your game perks.");
  190. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  191. + " </col> Donated for [" + Colors.yellow + "Avas Secret"
  192. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  193. + " Donation.", false);
  194. break;
  195.  
  196. case 34:
  197. player.getAchManager().addKeyAmount("donator", 1);
  198. player.getPerkManager().keyExpert = true;
  199. player.handleDonation(6 * quantity, "Key Expert");
  200. player.sendMessage("You've purchased: [" + Colors.red + "Key Expert</col>]. "
  201. + "Type ;;perks to see all your game perks.");
  202. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  203. + " </col> Donated for [" + Colors.yellow + "Key Expert" + "</col>] and has now a total of "
  204. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  205. break;
  206.  
  207. case 35:
  208. player.getAchManager().addKeyAmount("donator", 1);
  209. player.getPerkManager().dragonTrainer = true;
  210. player.handleDonation(5 * quantity, "Dragon Trainer");
  211. player.sendMessage("You've purchased: [" + Colors.red + "Dragon Trainer</col>]. "
  212. + "Type ;;perks to see all your game perks.");
  213.  
  214. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  215. + " </col> Donated for [" + Colors.yellow + "Dragon Trainer"
  216. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  217. + " Donation.", false);
  218. break;
  219.  
  220. case 36:
  221. player.getAchManager().addKeyAmount("donator", 1);
  222. player.getPerkManager().gwdSpecialist = true;
  223. player.handleDonation(3 * quantity, "GWD Specialist");
  224. player.sendMessage("You've purchased: [" + Colors.red + "GWD Specialist</col>]. "
  225. + "Type ;;perks to see all your game perks.");
  226.  
  227. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  228. + " </col> Donated for [" + Colors.yellow + "GWD Specialist"
  229. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  230. + " Donation.", false);
  231. break;
  232.  
  233. case 37:
  234. player.getAchManager().addKeyAmount("donator", 1);
  235. player.getPerkManager().dungeon = true;
  236. player.handleDonation(10 * quantity, "Dungeons Master");
  237. player.sendMessage("You've purchased: [" + Colors.red + "Dungeons Master</col>]. "
  238. + "Type ;;perks to see all your game perks.");
  239. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  240. + " </col> Donated for [" + Colors.yellow + "Dungeons Master"
  241. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  242. + " Donation.", false);
  243. break;
  244.  
  245. case 38:
  246. player.getAchManager().addKeyAmount("donator", 1);
  247. player.getPerkManager().petChanter = true;
  248. player.handleDonation(3 * quantity, "Petchanter");
  249. player.sendMessage("You've purchased: [" + Colors.red + "Petchanter</col>]. "
  250. + "Type ;;perks to see all your game perks.");
  251. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  252. + " </col> Donated for [" + Colors.yellow + "Petchanter" + "</col>] and has now a total of "
  253. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  254. break;
  255.  
  256. case 39:
  257. player.getAchManager().addKeyAmount("donator", 1);
  258. player.getPerkManager().perslaysion = true;
  259. player.handleDonation(10 * quantity, "Perslaysion");
  260. player.sendMessage("You've purchased: [" + Colors.red + "Per'slay'sion</col>]. "
  261. + "Type ;;perks to see all your game perks.");
  262. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  263. + " </col> Donated for [" + Colors.yellow + "Per'slay'sion"
  264. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  265. + " Donation.", false);
  266. break;
  267.  
  268. case 40:
  269. player.getAchManager().addKeyAmount("donator", 1);
  270. player.getPerkManager().portsMaster = true;
  271. player.handleDonation(4 * quantity, "Ports Master");
  272. player.sendMessage("You've purchased: [" + Colors.red + "Ports Master</col>]. "
  273. + "Type ;;perks to see all your game perks.");
  274. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  275. + " </col> Donated for [" + Colors.yellow + "Ports Master"
  276. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  277. + " Donation.", false);
  278. break;
  279.  
  280. case 41:
  281. player.getAchManager().addKeyAmount("donator", 1);
  282. player.getPerkManager().thePiromaniac = true;
  283. player.handleDonation(5 * quantity, "Huntsman");
  284. player.sendMessage("You've purchased: [" + Colors.red + "The Pyromaniac</col>]. "
  285. + "Type ;;perks to see all your game perks.");
  286. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  287. + " </col> Donated for [" + Colors.yellow + "The Pyromaniac"
  288. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  289. + " Donation.", false);
  290. break;
  291.  
  292. case 42:
  293. player.getAchManager().addKeyAmount("donator", 1);
  294. player.getPerkManager().greenThumb = true;
  295. player.handleDonation(3 * quantity, "Green Thumb");
  296. player.sendMessage("You've purchased: [" + Colors.red + "Green Thumb</col>]. "
  297. + "Type ;;perks to see all your game perks.");
  298. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  299. + " </col> Donated for [" + Colors.yellow + "Green Thumb"
  300. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  301. + " Donation.", false);
  302. break;
  303.  
  304. case 43:
  305. player.getAchManager().addKeyAmount("donator", 1);
  306. player.getPerkManager().birdMan = true;
  307. player.handleDonation(1 * quantity, "Bird Man");
  308. player.sendMessage("You've purchased: [" + Colors.red + "Bird Man</col>]. "
  309. + "Type ;;perks to see all your game perks.");
  310. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  311. + " </col> Donated for [" + Colors.yellow + "Bird Man" + "</col>] and has now a total of "
  312. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  313. break;
  314.  
  315. case 44:
  316. player.getAchManager().addKeyAmount("donator", 1);
  317. player.getPerkManager().sleightOfHand = true;
  318. player.handleDonation(4 * quantity, "Sleight of Hand");
  319. player.sendMessage("You've purchased: [" + Colors.red + "Sleight of Hand</col>]. "
  320. + "Type ;;perks to see all your game perks.");
  321. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  322. + " </col> Donated for [" + Colors.yellow + "Sleight of Hand"
  323. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  324. + " Donation.", false);
  325. break;
  326.  
  327. case 45:
  328. player.getAchManager().addKeyAmount("donator", 1);
  329. player.getPerkManager().herbivore = true;
  330. player.handleDonation(8 * quantity, "Herbivore");
  331. player.sendMessage("You've purchased: [" + Colors.red + "Herbivore</col>]. "
  332. + "Type ;;perks to see all your game perks.");
  333. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  334. + " </col> Donated for [" + Colors.yellow + "Herbivore" + "</col>] and has now a total of "
  335. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  336. break;
  337.  
  338. case 46:
  339. player.getAchManager().addKeyAmount("donator", 1);
  340. player.getPerkManager().masterFisherman = true;
  341. player.handleDonation(5 * quantity, "Master Fisherman");
  342. player.sendMessage("You've purchased: [" + Colors.red + "Master Fisherman</col>]. "
  343. + "Type ;;perks to see all your game perks.");
  344. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  345. + " </col> Donated for [" + Colors.yellow + "Master Fisherman"
  346. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  347. + " Donation.", false);
  348. break;
  349.  
  350. case 47:
  351. player.getAchManager().addKeyAmount("donator", 1);
  352. player.getPerkManager().delicateCraftsman = true;
  353. player.handleDonation(3 * quantity, "Delicate Craftsman");
  354. player.sendMessage("You've purchased: [" + Colors.red + "Delicate Craftsman</col>]. "
  355. + "Type ;;perks to see all your game perks.");
  356. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  357. + " </col> Donated for [" + Colors.yellow + "Delicate Craftsman"
  358. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  359. + " Donation.", false);
  360. break;
  361.  
  362. case 48:
  363. player.getAchManager().addKeyAmount("donator", 1);
  364. player.getPerkManager().elfFiend = true;
  365. player.handleDonation(4 * quantity, "Elf Fiend");
  366. player.sendMessage("You've purchased: [" + Colors.red + "Elf Fiend</col>]. "
  367. + "Type ;;perks to see all your game perks.");
  368. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  369. + " </col> Donated for [" + Colors.yellow + "Elf Fiend" + "</col>] and has now a total of "
  370. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  371. break;
  372.  
  373. case 49:
  374. player.getAchManager().addKeyAmount("donator", 1);
  375. player.getPerkManager().masterChef = true;
  376. player.handleDonation(3 * quantity, "Master Chefs Man");
  377. player.sendMessage("You've purchased: [" + Colors.red + "Master Chefs Man</col>]. "
  378. + "Type ;;perks to see all your game perks.");
  379. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  380. + " </col> Donated for [" + Colors.yellow + "Elf Fiend" + "</col>] and has now a total of "
  381. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  382. break;
  383.  
  384. case 50:
  385. player.getAchManager().addKeyAmount("donator", 1);
  386. player.getPerkManager().masterDiviner = true;
  387. player.handleDonation(10 * quantity, "Master Diviner");
  388. player.sendMessage("You've purchased: [" + Colors.red + "Master Diviner</col>]. "
  389. + "Type ;;perks to see all your game perks.");
  390. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  391. + " </col> Donated for [" + Colors.yellow + "Master Diviner"
  392. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  393. + " Donation.", false);
  394. break;
  395.  
  396. case 51:
  397. player.getAchManager().addKeyAmount("donator", 1);
  398. player.getPerkManager().quarryMaster = true;
  399. player.handleDonation(5 * quantity, "Quarrymaster");
  400. player.sendMessage("You've purchased: [" + Colors.red + "Quarrymaster</col>]. "
  401. + "Type ;;perks to see all your game perks.");
  402. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  403. + " </col> Donated for [" + Colors.yellow + "Quarrymaster"
  404. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  405. + " Donation.", false);
  406. break;
  407.  
  408. case 52:
  409. player.getAchManager().addKeyAmount("donator", 1);
  410. player.getPerkManager().huntsman = true;
  411. player.handleDonation(6 * quantity, "Huntsman");
  412. player.sendMessage("You've purchased: [" + Colors.red + "Huntsman</col>]. "
  413. + "Type ;;perks to see all your game perks.");
  414. ;
  415. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  416. + " </col> Donated for [" + Colors.yellow + "Huntsman" + "</col>] and has now a total of "
  417. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  418. break;
  419.  
  420. case 53:
  421. player.getAchManager().addKeyAmount("donator", 1);
  422. player.getPerkManager().masterFledger = true;
  423. player.handleDonation(6 * quantity, "masterFledger");
  424. player.sendMessage("You've purchased: [" + Colors.red + "Master Fledger</col>]. "
  425. + "Type ;;perks to see all your game perks.");
  426. ;
  427. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  428. + " </col> Donated for [" + Colors.yellow + "Master Fledger"
  429. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  430. + " Donation.", false);
  431. break;
  432.  
  433. case 54:
  434. player.getAchManager().addKeyAmount("donator", 1);
  435. player.getPerkManager().divineDoubler = true;
  436. player.handleDonation(10 * quantity, "Divine Doubler");
  437. player.sendMessage("You've purchased: [" + Colors.red + "Divine Doubler</col>]. ");
  438. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  439. + " </col> Donated for [" + Colors.yellow + "Divine Doubler"
  440. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  441. + " Donation.", false);
  442. break;
  443.  
  444. case 55:
  445. player.getAchManager().addKeyAmount("donator", 1);
  446. player.getPerkManager().imbuedFocus = true;
  447. player.handleDonation(5 * quantity, "Imbued Focus");
  448. player.sendMessage("You've purchased: [" + Colors.red + "Imbued Focus</col>]. "
  449. + "Type ;;perks to see all your game perks.");
  450. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  451. + " </col> Donated for [" + Colors.yellow + "Imbued Focus"
  452. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  453. + " Donation.", false);
  454. break;
  455.  
  456. case 56:
  457. player.getAchManager().addKeyAmount("donator", 1);
  458. player.getPerkManager().alchemicSmith = true;
  459. player.handleDonation(7 * quantity, "Alchemic Smithing");
  460. player.sendMessage("You've purchased: [" + Colors.red + "Alchemic Smithing</col>]. "
  461. + "Type ;;perks to see all your game perks.");
  462. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  463. + " </col> Donated for [" + Colors.yellow + "Alchemic Smithing"
  464. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  465. + " Donation.", false);
  466. break;
  467.  
  468. case 57:
  469. player.getAchManager().addKeyAmount("donator", 1);
  470. player.getPerkManager().bankCommand = true;
  471. player.handleDonation(25 * quantity, "Bank Command");
  472. player.sendMessage("You've purchased: [" + Colors.red + "Bank Command</col>]. "
  473. + "Type ;;perks to see all your game perks.");
  474. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  475. + " </col> Donated for [" + Colors.yellow + "Bank Command"
  476. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  477. + " Donation.", false);
  478. break;
  479.  
  480. case 58:
  481. player.getAchManager().addKeyAmount("donator", 1);
  482. player.getPerkManager().staminaBoost = true;
  483. player.handleDonation(10 * quantity, "Stamina Boost");
  484. player.sendMessage("You've purchased: [" + Colors.red + "Stamina Boost</col>]. "
  485. + "Type ;;perks to see all your game perks.");
  486. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  487. + " </col> Donated for [" + Colors.yellow + "Stamina Boost"
  488. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  489. + " Donation.", false);
  490. break;
  491.  
  492. case 59:
  493. player.getAchManager().addKeyAmount("donator", 1);
  494. player.getPerkManager().overclocked = true;
  495. player.handleDonation(6 * quantity, "Overclocked");
  496. player.sendMessage("You've purchased: [" + Colors.red + "Overclocked</col>]. "
  497. + "Type ;;perks to see all your game perks.");
  498. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  499. + " </col> Donated for [" + Colors.yellow + "Stamina Boost"
  500. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  501. + " Donation.", false);
  502. break;
  503.  
  504. case 60:
  505. player.getAchManager().addKeyAmount("donator", 1);
  506. player.getPerkManager().miniGamer = true;
  507. player.handleDonation(5 * quantity, "The Mini-Gamer");
  508. player.sendMessage("You've purchased: [" + Colors.red + "The Mini-Gamer</col>]. "
  509. + "Type ;;perks to see all your game perks.");
  510.  
  511. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  512. + " </col> Donated for [" + Colors.yellow + "The Mini-Gamer"
  513. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  514. + " Donation.", false);
  515. break;
  516.  
  517. case 61:
  518. player.getAchManager().addKeyAmount("donator", 1);
  519. player.getPerkManager().investigator = true;
  520. player.handleDonation(15 * quantity, "Investigator");
  521. player.sendMessage("You've purchased: [" + Colors.red + "Investigator</col>]. "
  522. + "Type ;;perks to see all your game perks.");
  523.  
  524. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  525. + " </col> Donated for [" + Colors.yellow + "Investigator"
  526. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  527. + " Donation.", false);
  528. break;
  529.  
  530. case 62:
  531. player.getAchManager().addKeyAmount("donator", 1);
  532. player.getPerkManager().greenThumb = true;
  533. player.getPerkManager().unbreakableForge = true;
  534. player.getPerkManager().sleightOfHand = true;
  535. player.getPerkManager().herbivore = true;
  536. player.getPerkManager().masterFisherman = true;
  537. player.getPerkManager().delicateCraftsman = true;
  538. player.getPerkManager().masterChef = true;
  539. player.getPerkManager().masterDiviner = true;
  540. player.getPerkManager().quarryMaster = true;
  541. player.getPerkManager().masterFledger = true;
  542. player.getPerkManager().thePiromaniac = true;
  543. player.getPerkManager().huntsman = true;
  544. player.getPerkManager().divineDoubler = true;
  545. player.getPerkManager().imbuedFocus = true;
  546. player.getPerkManager().alchemicSmith = true;
  547. player.handleDonation(75 * quantity, "Skillers perk pack");
  548. player.sendMessage("You've purchased: [" + Colors.red + "Skillers perk pack</col>]. "
  549. + "Type ;;perks to see all your game perks.");
  550. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  551. + " </col> Donated for [" + Colors.yellow + "Skillers perk pack"
  552. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  553. + " Donation.", false);
  554. break;
  555.  
  556. case 63:
  557. player.getAchManager().addKeyAmount("donator", 1);
  558. player.getPerkManager().bankCommand = true;
  559. player.getPerkManager().staminaBoost = true;
  560. player.getPerkManager().overclocked = true;
  561. player.getPerkManager().elfFiend = true;
  562. player.getPerkManager().miniGamer = true;
  563. player.getPerkManager().portsMaster = true;
  564. player.getPerkManager().investigator = true;
  565. player.handleDonation(50 * quantity, "Utility perk pack");
  566. player.sendMessage("You've purchased: [" + Colors.red + "Utility perk pack</col>]. "
  567. + "Type ;;perks to see all your game perks.");
  568. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  569. + " </col> Donated for [" + Colors.yellow + "Utility perk pack"
  570. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  571. + " Donation.", false);
  572. break;
  573.  
  574. case 64:
  575. player.getAchManager().addKeyAmount("donator", 1);
  576. player.getPerkManager().familiarExpert = true;
  577. player.getPerkManager().chargeBefriender = true;
  578. player.getPerkManager().prayerBetrayer = true;
  579. player.getPerkManager().avasSecret = true;
  580. player.getPerkManager().dragonTrainer = true;
  581. player.getPerkManager().gwdSpecialist = true;
  582. player.getPerkManager().dungeon = true;
  583. player.getPerkManager().perslaysion = true;
  584. player.handleDonation(87 * quantity, "Combatants perk pack");
  585. player.sendMessage("You've purchased: [" + Colors.red + "Combatants perk pack</col>]. "
  586. + "Type ;;perks to see all your game perks.");
  587. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  588. + " </col> Donated for [" + Colors.yellow + "Combatants perk pack"
  589. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  590. + " Donation.", false);
  591. break;
  592.  
  593. case 65:
  594. player.getAchManager().addKeyAmount("donator", 1);
  595. player.getPerkManager().birdMan = true;
  596. player.getPerkManager().charmCollector = true;
  597. player.getPerkManager().coinCollector = true;
  598. player.getPerkManager().keyExpert = true;
  599. player.getPerkManager().petChanter = true;
  600. player.getPerkManager().petLoot = true;
  601. player.getPerkManager().greenThumb = true;
  602. player.getPerkManager().unbreakableForge = true;
  603. player.getPerkManager().sleightOfHand = true;
  604. player.getPerkManager().herbivore = true;
  605. player.getPerkManager().masterFisherman = true;
  606. player.getPerkManager().delicateCraftsman = true;
  607. player.getPerkManager().masterChef = true;
  608. player.getPerkManager().masterDiviner = true;
  609. player.getPerkManager().quarryMaster = true;
  610. player.getPerkManager().masterFledger = true;
  611. player.getPerkManager().thePiromaniac = true;
  612. player.getPerkManager().huntsman = true;
  613. player.getPerkManager().divineDoubler = true;
  614. player.getPerkManager().imbuedFocus = true;
  615. player.getPerkManager().alchemicSmith = true;
  616. player.getPerkManager().birdMan = true;
  617. player.getPerkManager().bankCommand = true;
  618. player.getPerkManager().staminaBoost = true;
  619. player.getPerkManager().overclocked = true;
  620. player.getPerkManager().elfFiend = true;
  621. player.getPerkManager().miniGamer = true;
  622. player.getPerkManager().portsMaster = true;
  623. player.getPerkManager().investigator = true;
  624. player.getPerkManager().familiarExpert = true;
  625. player.getPerkManager().chargeBefriender = true;
  626. player.getPerkManager().prayerBetrayer = true;
  627. player.getPerkManager().avasSecret = true;
  628. player.getPerkManager().dragonTrainer = true;
  629. player.getPerkManager().gwdSpecialist = true;
  630. player.getPerkManager().dungeon = true;
  631. player.getPerkManager().perslaysion = true;
  632. player.handleDonation(213 * quantity, "Complete perk pack");
  633. player.sendMessage(" You've purchased: [" + Colors.red + "Complete perk pack</col>]. "
  634. + "Type ;;perks to see all your game perks!");
  635. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  636. + " </col> Donated for [" + Colors.yellow + "Complete perk pack"
  637. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  638. + " Donation.", false);
  639. break;
  640.  
  641. case 66:
  642. player.getAchManager().addKeyAmount("donator", 1);
  643. player.getSquealOfFortune().giveBoughtSpins(5 * quantity);
  644. player.handleDonation(2 * quantity, "x5 SoF spins");
  645. player.sendMessage("You've purchased: [" + Colors.red + "x5 SoF spins</col>]. "
  646. + "Open the Squeal of Fortune tab to use them.");
  647. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  648. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  649. + "x5 SoF spins" + "</col>] and has now a total of " + Colors.red + "$"
  650. + player.getMoneySpent() + " Donation.", false);
  651. break;
  652.  
  653. case 67:
  654. player.getAchManager().addKeyAmount("donator", 1);
  655. player.getSquealOfFortune().giveBoughtSpins(27 * quantity);
  656. player.handleDonation(10 * quantity, "x25 SoF spins");
  657. player.sendMessage("You've purchased: [" + Colors.red + "x27 SoF spins</col>]. "
  658. + "Open the Squeal of Fortune tab to use them.");
  659. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  660. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  661. + "x27 SoF spins" + "</col>] and has now a total of " + Colors.red + "$"
  662. + player.getMoneySpent() + " Donation.", false);
  663. break;
  664.  
  665. case 68:
  666. player.getAchManager().addKeyAmount("donator", 1);
  667. player.getSquealOfFortune().giveBoughtSpins(55 * quantity);
  668. player.handleDonation(20 * quantity, "x50 SoF spins");
  669. player.sendMessage("You've purchased: [" + Colors.red + "x55 SoF spins</col>]. "
  670. + "Open the Squeal of Fortune tab to use them.");
  671. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  672. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  673. + "x55 SoF spins" + "</col>] and has now a total of " + Colors.red + "$"
  674. + player.getMoneySpent() + " Donation.", false);
  675. break;
  676.  
  677. case 69:
  678. player.getAchManager().addKeyAmount("donator", 1);
  679. player.getSquealOfFortune().giveBoughtSpins(175 * quantity);
  680. player.handleDonation(50 * quantity, "x150 SoF spins");
  681. player.sendMessage("You've purchased: [" + Colors.red + "x175 SoF spins</col>]. "
  682. + "Open the Squeal of Fortune tab to use them.");
  683. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  684. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  685. + "x175 SoF spins" + "</col>] and has now a total of " + Colors.red + "$"
  686. + player.getMoneySpent() + " Donation.", false);
  687. break;
  688.  
  689. case 70:
  690. player.getAchManager().addKeyAmount("donator", 1);
  691. player.getInventory().addItem(41397, 5 * quantity);
  692. player.handleDonation(5 * quantity, "x5 Pot of Gold");
  693. player.sendMessage("You've purchased: [" + Colors.red + "5 Pot of Gold</col>]. "
  694. + "Go to Members Area to Check the Shop.");
  695. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  696. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  697. + "5 Pot of Gold" + "</col>] and has now a total of " + Colors.red + "$"
  698. + player.getMoneySpent() + " Donation.", false);
  699. break;
  700.  
  701. case 71:
  702. player.getAchManager().addKeyAmount("donator", 1);
  703. player.getInventory().addItem(41397, 10 * quantity);
  704. player.handleDonation(10 * quantity, "x10 Pot of Gold");
  705. player.sendMessage("You've purchased: [" + Colors.red + "10 Pot of Gold</col>]. "
  706. + "Go to Members Area to Check the Shop.");
  707. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  708. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  709. + "10 Pot of Gold" + "</col>] and has now a total of " + Colors.red + "$"
  710. + player.getMoneySpent() + " Donation.", false);
  711. break;
  712.  
  713. case 72:
  714. player.getAchManager().addKeyAmount("donator", 1);
  715. player.getInventory().addItem(41397, 22 * quantity);
  716. player.handleDonation(20 * quantity, "x20 Pot of Gold");
  717. player.sendMessage("You've purchased: [" + Colors.red + "20 + 2[FREE] Pot of Gold</col>]. "
  718. + "Go to Members Area to Check the Shop.");
  719. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  720. + " </col> Donated for </col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  721. + "20 + 2[FREE] Pot of Gold" + "</col>] and has now a total of " + Colors.red + "$"
  722. + player.getMoneySpent() + " Donation.", false);
  723. break;
  724.  
  725. case 73:
  726. player.getAchManager().addKeyAmount("donator", 1);
  727. player.getInventory().addItem(41397, 55 * quantity);
  728. player.handleDonation(50 * quantity, "x50 Pot of Gold");
  729. player.sendMessage("You've purchased: [" + Colors.red + "50 +5[FREE] Pot of Gold</col>]. "
  730. + "Go to Members Area to Check the Shop.");
  731. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  732. + " </col> Donated for</col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  733. + "50 +5[FREE] Pot of Gold" + "</col>] and has now a total of " + Colors.red + "$"
  734. + player.getMoneySpent() + " Donation.", false);
  735. break;
  736.  
  737. case 74:
  738. player.getAchManager().addKeyAmount("donator", 1);
  739. player.getInventory().addItem(41397, 110 * quantity);
  740. player.handleDonation(100 * quantity, "x100 Pot of Gold");
  741. player.sendMessage("You've purchased: [" + Colors.red + "100 +10[FREE] Pot of Gold </col>]. "
  742. + "Go to Members Area to Check the Shop.");
  743. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  744. + " </col> Donated for</col>" + Colors.red + "x" + quantity + "</col> [" + Colors.yellow
  745. + "100 +10[FREE] Pot of Gold" + "</col>] and has now a total of " + Colors.red + "$"
  746. + player.getMoneySpent() + " Donation.", false);
  747. break;
  748.  
  749. case 75:
  750. player.getAchManager().addKeyAmount("donator", 1);
  751. player.getPerkManager().petmaster = true;
  752. player.handleDonation(20 * quantity, "D'Companion");
  753. player.sendMessage("You've purchased: [" + Colors.red + "D'Companion</col>]. "
  754. + "Type ;;perks to see all your game perks.");
  755. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  756. + " </col> Donated for [" + Colors.yellow + "D'Companion"
  757. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  758. + " Donation.", false);
  759. break;
  760.  
  761. case 76:
  762. player.getAchManager().addKeyAmount("donator", 1);
  763. player.getPerkManager().basher = true;
  764. player.handleDonation(20 * quantity, "Stag·ger");
  765. player.sendMessage("You've purchased: [" + Colors.red + "Stag·ger</col>]. "
  766. + "Type ;;perks to see all your game perks.");
  767. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  768. + " </col> Donated for [" + Colors.yellow + "Stag·ger" + "</col>] and has now a total of "
  769. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  770. break;
  771.  
  772. case 77:
  773. player.getAchManager().addKeyAmount("donator", 1);
  774. player.getPerkManager().butcher = true;
  775. player.handleDonation(20 * quantity, "Annihilator");
  776. player.sendMessage("You've purchased: [" + Colors.red + "Annihilator</col>]. "
  777. + "Type ;;perks to see all your game perks.");
  778. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  779. + " </col> Donated for [" + Colors.yellow + "Annihilator"
  780. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  781. + " Donation.", false);
  782. break;
  783.  
  784. case 78:
  785. player.getAchManager().addKeyAmount("donator", 1);
  786. player.getPerkManager().lifeSteal = true;
  787. player.handleDonation(10 * quantity, "Dominator");
  788. player.sendMessage("You've purchased: [" + Colors.red + "Dominator</col>]. "
  789. + "Type ;;perks to see all your game perks.");
  790. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  791. + " </col> Donated for [" + Colors.yellow + "Dominator" + "</col>] and has now a total of "
  792. + Colors.red + "$" + player.getMoneySpent() + " Donation.", false);
  793. break;
  794.  
  795. case 79:
  796. player.getAchManager().addKeyAmount("donator", 1);
  797. player.getPerkManager().regenerator = true;
  798. player.handleDonation(10 * quantity, "Heart of tarrasque");
  799. player.sendMessage("You've purchased: [" + Colors.red + "Heart of tarrasque</col>]. "
  800. + "Type ;;perks to see all your game perks.");
  801. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  802. + " </col> Donated for [" + Colors.yellow + "Heart of tarrasque"
  803. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  804. + " Donation.", false);
  805. break;
  806.  
  807. case 80:
  808. player.getAchManager().addKeyAmount("donator", 1);
  809. player.getInventory().addItem(41397, 1);
  810. player.getPerkManager().unbreakableForge = true;
  811. player.handleDonation(1 * quantity, "Unbreakable Forge");
  812. player.sendMessage("You've purchased: [" + Colors.red + "Unbreakable Forge</col>]. "
  813. + "Type ;;perks to see all your game perks.");
  814. World.sendWorldMessage(Colors.green + "[Donation] </col>" + Colors.red + player.getUsername()
  815. + " </col> Donated for [" + Colors.yellow + "Unbreakable Forge"
  816. + "</col>] and has now a total of " + Colors.red + "$" + player.getMoneySpent()
  817. + " Donation.", false);
  818. break;
  819. }
  820.  
  821. rs.updateInt("claimed", 1); // do not delete otherwise they can reclaim!
  822. rs.updateRow();
  823. }
  824.  
  825. destroy();
  826. } catch (Exception e) {
  827. e.printStackTrace();
  828. }
  829. }
  830.  
  831. /**
  832. *
  833. * @param host
  834. * the host ip address or url
  835. * @param database
  836. * the name of the database
  837. * @param user
  838. * the user attached to the database
  839. * @param pass
  840. * the users password
  841. * @return true if connected
  842. */
  843. public boolean connect(String host, String database, String user, String pass) {
  844. try {
  845. this.conn = DriverManager.getConnection("jdbc:mysql://" + host + ":3306/" + database, user, pass);
  846. return true;
  847. } catch (SQLException e) {
  848. System.out.println("Failing connecting to database!");
  849. return false;
  850. }
  851. }
  852.  
  853. /**
  854. * Disconnects from the MySQL server and destroy the connection and statement
  855. * instances
  856. */
  857. public void destroy() {
  858. try {
  859. conn.close();
  860. conn = null;
  861. if (stmt != null) {
  862. stmt.close();
  863. stmt = null;
  864. }
  865. } catch (Exception e) {
  866. e.printStackTrace();
  867. }
  868. }
  869.  
  870. /**
  871. * Executes an update query on the database
  872. *
  873. * @param query
  874. * @see {@link Statement#executeUpdate}
  875. */
  876. public int executeUpdate(String query) {
  877. try {
  878. this.stmt = this.conn.createStatement(1005, 1008);
  879. int results = stmt.executeUpdate(query);
  880. return results;
  881. } catch (SQLException ex) {
  882. ex.printStackTrace();
  883. }
  884. return -1;
  885. }
  886.  
  887. /**
  888. * Executres a query on the database
  889. *
  890. * @param query
  891. * @see {@link Statement#executeQuery(String)}
  892. * @return the results, never null
  893. */
  894. public ResultSet executeQuery(String query) {
  895. try {
  896. this.stmt = this.conn.createStatement(1005, 1008);
  897. ResultSet results = stmt.executeQuery(query);
  898. return results;
  899. } catch (SQLException ex) {
  900. ex.printStackTrace();
  901. }
  902. return null;
  903. }
  904. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement