Guest User

Untitled

a guest
Sep 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.05 KB | None | 0 0
  1. package server.model.players.packets;
  2.  
  3. import server.Config;
  4. import server.Connection;
  5. import server.Server;
  6. import server.model.players.Client;
  7. import server.model.players.PacketType;
  8. import server.model.players.PlayerHandler;
  9. import server.model.items.ItemAssistant;
  10. import server.util.Misc;
  11.  
  12.  
  13. import java.io.*;
  14.  
  15. /**
  16. * Commands
  17. **/
  18. public class Commands implements PacketType {
  19.  
  20. @Override
  21. public void processPacket(Client c, int packetType, int packetSize) {
  22. String playerCommand = c.getInStream().readString();
  23. if (!playerCommand.startsWith("/")) {
  24. c.getPA().writeCommandLog(playerCommand);
  25. }
  26. if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  27. if (c.clanId >= 0) {
  28. System.out.println(playerCommand);
  29. playerCommand = playerCommand.substring(1);
  30. Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  31. } else {
  32. if (c.clanId != -1) {
  33. c.clanId = -1;
  34. }
  35. c.sendMessage("You are not in a clan.");
  36. }
  37. return;
  38. }
  39. if (Config.SERVER_DEBUG) {
  40. Misc.println(c.playerName + " playerCommand: " + playerCommand);
  41. }
  42.  
  43. if (c.playerRights >= 0) {
  44. playerCommands(c, playerCommand);
  45. }
  46. if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3) {
  47. moderatorCommands(c, playerCommand);
  48. }
  49. if (c.playerRights == 2 || c.playerRights == 3) {
  50. administratorCommands(c, playerCommand);
  51. }
  52. if (c.playerRights == 3) {
  53. ownerCommands(c, playerCommand);
  54. }
  55. if (c.playerRights == 4 || c.playerRights == 5 || c.playerRights == 6) {
  56. DonatorCommands(c, playerCommand);
  57. }
  58.  
  59. }
  60.  
  61. public void playerCommands(Client c, String playerCommand) {
  62. if (playerCommand.equalsIgnoreCase("players")) {
  63. c.sendMessage("There are currently " + PlayerHandler.getPlayerCount() + " players online.");
  64. }
  65. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  66. c.playerPass = playerCommand.substring(15);
  67. c.sendMessage("Your password is now: " + c.playerPass);
  68. }
  69. /*if (playerCommand.equals("funpk")) {
  70. c.getPA().startTeleport(3504, 3575, 0, "modern");
  71. }*/
  72.  
  73. if (playerCommand.startsWith("sit") && c.sit == false) {
  74. if (c.inWild()) {
  75. c.sendMessage("You cannot do this in wildy");
  76. return;
  77. }
  78. c.sit = true;
  79. if (c.playerRights == 1) {
  80. c.startAnimation(4116);
  81. }
  82. if (c.playerRights == 2) {
  83. c.startAnimation(4113);
  84. }
  85. if (c.isDonator == 1) {
  86. c.startAnimation(4115);
  87. }
  88. if (c.playerRights == 0) {
  89. c.startAnimation(4115);
  90. }
  91. if (c.playerRights == 3) {
  92. c.startAnimation(4117);
  93. }
  94. }
  95.  
  96.  
  97. if (playerCommand.startsWith("unsit") && c.sit == true) {
  98. if (c.inWild()) {
  99. c.sendMessage("You cannot do this in wildy");
  100. return;
  101. }
  102. c.sit = false;
  103. c.startAnimation(4191);
  104. }
  105.  
  106. if (playerCommand.startsWith("qpsk")) {
  107. c.startAnimation(4945);
  108. c.gfx0(816);
  109. }
  110. if (playerCommand.equals("empty")) {
  111. if (c.inWild()) {
  112. return;
  113. }
  114. c.getPA().removeAllItems();
  115. }
  116.  
  117.  
  118. if (playerCommand.equalsIgnoreCase("FXP")) {
  119. c.sendMessage("You have " + c.pcPoints + " FXP..");
  120. c.sendMessage("And " + c.magePoints + " Agility Points!");
  121. }
  122.  
  123. if (playerCommand.equalsIgnoreCase("agility points")) {
  124. c.sendMessage("You currently have " + c.magePoints + " Agility Points! Buy items at ::agility for the points!");
  125. }
  126.  
  127. if (playerCommand.startsWith("death")) {
  128. c.getPA().showInterface(17100);
  129. }
  130.  
  131. if (playerCommand.equalsIgnoreCase("save")) {
  132. c.SaveGame();
  133. c.sendMessage("Your acc has been saved nub.");
  134. }
  135.  
  136. if (playerCommand.startsWith("pure") && c.pure == 0) {
  137. int i = 0;
  138. if (c.inWild()) {
  139. return;
  140. }
  141. c.getPA().addSkillXP((140333), 0);
  142. c.getPA().addSkillXP((403332), 2);
  143. c.getPA().addSkillXP((403332), 3);
  144. c.getPA().addSkillXP((403332), 4);
  145. c.getPA().addSkillXP((403332), 6);
  146. c.pure = 1;
  147. }
  148. if (playerCommand.startsWith("pure") && c.pure == 1) {
  149. c.sendMessage("You have already used the pure command.");
  150. }
  151. if (playerCommand.startsWith("report") && playerCommand.length() > 7) {
  152. try {
  153. BufferedWriter report = new BufferedWriter(new FileWriter("./Data/Reports/Reports.txt", true));
  154. String Report = playerCommand.substring(7);
  155. try {
  156. report.newLine();
  157. report.write(c.playerName + ": " + Report);
  158. c.sendMessage("You have successfully submitted your report.");
  159. } finally {
  160. report.close();
  161. }
  162. } catch (IOException e) {
  163. e.printStackTrace();
  164. }
  165. }
  166. if (playerCommand.startsWith("resetdef")) {
  167. if (c.inWild()) {
  168. return;
  169. }
  170. for (int j = 0; j < c.playerEquipment.length; j++) {
  171. if (c.playerEquipment[j] > 0) {
  172. c.sendMessage("Please take all your armour and weapons off before using this command.");
  173. return;
  174. }
  175. }
  176. try {
  177. int skill = 1;
  178. int level = 1;
  179. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  180. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  181. c.getPA().refreshSkill(skill);
  182. } catch (Exception e) {
  183. }
  184. }
  185. if (playerCommand.startsWith("resetrange")) {
  186. if (c.inWild()) {
  187. return;
  188. }
  189. for (int j = 0; j < c.playerEquipment.length; j++) {
  190. if (c.playerEquipment[j] > 0) {
  191. c.sendMessage("Please take all your armour and weapons off before using this command.");
  192. return;
  193. }
  194. }
  195. try {
  196. int skill = 4;
  197. int level = 1;
  198. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  199. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  200. c.getPA().refreshSkill(skill);
  201. } catch (Exception e) {
  202. }
  203. }
  204. if (playerCommand.startsWith("resetmage")) {
  205. if (c.inWild()) {
  206. return;
  207. }
  208. for (int j = 0; j < c.playerEquipment.length; j++) {
  209. if (c.playerEquipment[j] > 0) {
  210. c.sendMessage("Please take all your armour and weapons off before using this command.");
  211. return;
  212. }
  213. }
  214. try {
  215. int skill = 6;
  216. int level = 1;
  217. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  218. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  219. c.getPA().refreshSkill(skill);
  220. } catch (Exception e) {
  221. }
  222. }
  223. if (playerCommand.startsWith("resetattack")) {
  224. if (c.inWild()) {
  225. return;
  226. }
  227. for (int j = 0; j < c.playerEquipment.length; j++) {
  228. if (c.playerEquipment[j] > 0) {
  229. c.sendMessage("Please take all your armour and weapons off before using this command.");
  230. return;
  231. }
  232. }
  233. try {
  234. int skill = 0;
  235. int level = 1;
  236. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  237. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  238. c.getPA().refreshSkill(skill);
  239. } catch (Exception e) {
  240. }
  241. }
  242. if (playerCommand.startsWith("resetstrength")) {
  243. if (c.inWild()) {
  244. return;
  245. }
  246. for (int j = 0; j < c.playerEquipment.length; j++) {
  247. if (c.playerEquipment[j] > 0) {
  248. c.sendMessage("Please take all your armour and weapons off before using this command.");
  249. return;
  250. }
  251. }
  252. try {
  253. int skill = 2;
  254. int level = 1;
  255. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  256. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  257. c.getPA().refreshSkill(skill);
  258. } catch (Exception e) {
  259. }
  260. }
  261. if (playerCommand.startsWith("resetprayer")) {
  262. if (c.inWild()) {
  263. return;
  264. }
  265. for (int j = 0; j < c.playerEquipment.length; j++) {
  266. if (c.playerEquipment[j] > 0) {
  267. c.sendMessage("Please take all your armour and weapons off before using this command.");
  268. return;
  269. }
  270. }
  271. try {
  272. int skill = 5;
  273. int level = 1;
  274. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  275. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  276. c.getPA().refreshSkill(skill);
  277. } catch (Exception e) {
  278. }
  279. }
  280. if (playerCommand.equals("agility")) {
  281. c.getPA().startTeleport(2480, 3437, 0, "modern");
  282. }
  283. if (playerCommand.equals("queen")) {
  284. c.getPA().startTeleport(3222, 3221, 0, "modern");
  285. }
  286. if (playerCommand.equals("nomad")) {
  287. c.getPA().startTeleport(2404, 3080, 0, "modern");
  288. c.sendMessage("<shad=15369497>HE HAS 500 HP AND HITS EXTREMELY HIGH BE CAREFUL!!!");
  289. c.sendMessage("<shad=15369497>IT IS MULTI HERE");
  290. c.sendMessage("<shad=15369497>Nomad currently drops new infinity armour and cloaks!");
  291. }
  292. if (playerCommand.equals("hunter")) {
  293. c.getPA().startTeleport(2604, 4772, 0, "modern");
  294. c.sendMessage("<shad=6081134>Sell the impling Jar's to the general shop!");
  295. c.sendMessage("<shad=6081134>Buy a Butterfly Net at Bob store in bank if you dont have one");
  296. }
  297. if (playerCommand.startsWith("rules")) {
  298.  
  299. c.sendMessage("THANK YOU FOR READING RULES.");
  300. c.sendMessage("1. Do not ask staff for items/ranks.");
  301. c.sendMessage("2. No rules in PvP EXCEPT FOR TB GLITCHING, don't be sad though by teaming");
  302. c.sendMessage(" - Giveback fights are at your own risk! NO REFUND!");
  303. c.sendMessage("3. Do not use offensive language = MUTE AFTER 3 WARNINGS.");
  304. c.sendMessage("4. Do not scam items/accounts = RESET OF ACCOUNT.");
  305. c.sendMessage("5. Auto clickers ARE NOT ALOWED.");
  306. c.sendMessage("6. Auto typers ARE ONLY ALOWED IF YOU PUT SECONDS AT 5+");
  307. c.sendMessage("7. Trading RS related things such as Items, RSGP, RSAcc's = INSTANT BAN!");
  308. }
  309. if (playerCommand.startsWith("kdr")) {
  310. double KDR = ((double) c.KC) / ((double) c.DC);
  311. c.forcedChat("I've killed " + c.KC + " And i've died " + c.DC + "; - " + KDR + ".");
  312. }
  313. if (playerCommand.startsWith("staffrules")) {
  314.  
  315. c.sendMessage("1.Staff are not alowed to use powers UNLESS they post report on forums (Report Player Section)");
  316. c.sendMessage("2.MODS are alowed to PK, Admins aren't.");
  317. c.sendMessage("3.Staff members have to follow the normal rules + the staffrules!");
  318. c.sendMessage("4. Staff members with spawn rights ARE NOT ALOWED TO USE P-RING");
  319. }
  320. if (playerCommand.startsWith("gwd")) {
  321.  
  322. c.sendMessage("For Armadyl GWD do ::armadyl");
  323. c.sendMessage("For Bandos GWD do ::bandos");
  324. c.sendMessage("For Saradomin GWD do ::saradomin");
  325. c.sendMessage("For Zamorak GWD do ::zamorak");
  326. }
  327. if (playerCommand.startsWith("strykeworms")) {
  328.  
  329. c.sendMessage("For Ice Strykeworm do ::icestrykeworm");
  330. c.sendMessage("For Jungle Strykeworm do ::junglestrykeworm");
  331. c.sendMessage("For Desert Strykeworm do ::desertstrykeworm");
  332. }
  333. if (playerCommand.equals("train")) {
  334. c.getPA().startTeleport(2672, 3718, 0, "modern");
  335. }
  336. if (playerCommand.equals("icestrykeworm")) {
  337. c.getPA().startTeleport(3052, 9576, 0, "modern");
  338. }
  339. if (playerCommand.equals("junglestrykeworm")) {
  340. c.getPA().startTeleport(2785, 2700, 0, "modern");
  341. }
  342. if (playerCommand.equals("desertstrykeworm")) {
  343. c.getPA().startTeleport(3336, 3065, 0, "modern");
  344. }
  345. if (playerCommand.equals("armadyl")) {
  346. c.getPA().startTeleport(2839, 5292, 2, "modern");
  347. }
  348. if (playerCommand.equals("saradomin")) {
  349. c.getPA().startTeleport(2911, 5299, 2, "modern");
  350. }
  351. if (playerCommand.equals("bandos")) {
  352. c.getPA().startTeleport(2860, 5354, 2, "modern");
  353. }
  354. if (playerCommand.equals("zamorak")) {
  355. c.getPA().startTeleport(2925, 5339, 2, "modern");
  356. }
  357. if (playerCommand.equals("drags")) {
  358. c.getPA().startTeleport(2894, 9799, 0, "modern");
  359. c.sendMessage("Run easts for Green Drags And Baby blue drags.");
  360. }
  361. if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
  362. c.sendMessage("EP: " + c.earningPotential + "");
  363. }
  364.  
  365. if (playerCommand.startsWith("yell")) {
  366. /*
  367. *This is the sensor for the yell command
  368. */
  369. String text = playerCommand.substring(5);
  370. String[] bad = {"<img=1>", "<img=2>", "<img=0>"};
  371. for (int i = 0; i < bad.length; i++) {
  372. if (text.indexOf(bad[i]) >= 0) {
  373. return;
  374. }
  375. }
  376. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  377. if (Server.playerHandler.players[j] != null) {
  378. Client c2 = (Client) Server.playerHandler.players[j];
  379.  
  380.  
  381. if (c.playerName.equalsIgnoreCase("")) {
  382. c2.sendMessage("<shad=15369497>[Extreme Donator]" + Misc.optimizeText(c.playerName) + ": "
  383. + Misc.optimizeText(playerCommand.substring(5)) + "");
  384. } else if (c.playerName.equalsIgnoreCase("moment")) {
  385. c2.sendMessage("<shad=15369497>[Extreme Donator]" + Misc.optimizeText(c.playerName) + ": "
  386. + Misc.optimizeText(playerCommand.substring(5)) + "");
  387. } else if (c.isDonator == 1 && (c.playerRights == 4)) {
  388. c2.sendMessage("<shad=6081134>[Donator]" + Misc.optimizeText(c.playerName) + ": "
  389. + Misc.optimizeText(playerCommand.substring(5)) + "");
  390. } else if (c.playerRights == 1) {
  391. c2.sendMessage("<shad=3781373>[Moderator]" + Misc.optimizeText(c.playerName) + ": "
  392. + Misc.optimizeText(playerCommand.substring(5)) + "");
  393. } else if (c.playerRights == 2) {
  394. c2.sendMessage("<shad=16112652>[Administrator]" + Misc.optimizeText(c.playerName) + ": "
  395. + Misc.optimizeText(playerCommand.substring(5)) + "");
  396. } else if (c.playerName.equalsIgnoreCase("")) {
  397. c2.sendMessage("<shad=15369497>[Extreme Donator]" + Misc.optimizeText(c.playerName) + ": "
  398. + Misc.optimizeText(playerCommand.substring(5)) + "");
  399. } else if (c.playerName.equalsIgnoreCase("")) {
  400. c2.sendMessage("<shad=12595455>[Server Developer]" + Misc.optimizeText(c.playerName) + ": "
  401. + Misc.optimizeText(playerCommand.substring(5)) + "");
  402. } else if (c.playerName.equalsIgnoreCase("xivivx")) {
  403. c2.sendMessage("<shad=15695415>[Owner]" + Misc.optimizeText(c.playerName) + ": "
  404. + Misc.optimizeText(playerCommand.substring(5)) + "");
  405. } else if (c.playerName.equalsIgnoreCase("leroy")) {
  406. c2.sendMessage("<shad=15695415>[Co-Owner]" + Misc.optimizeText(c.playerName) + ": "
  407. + Misc.optimizeText(playerCommand.substring(5)) + "");
  408. } else if (c.playerName.equalsIgnoreCase("sixtonmelon")) {
  409. c2.sendMessage("<shad=15695415>[Sexy Administraotr]" + Misc.optimizeText(c.playerName) + ": "
  410. + Misc.optimizeText(playerCommand.substring(5)) + "");
  411. } else if (c.playerName.equalsIgnoreCase("tijs")) {
  412. c2.sendMessage("<shad=15695415>[Extreme Donator]" + Misc.optimizeText(c.playerName) + ": "
  413. + Misc.optimizeText(playerCommand.substring(5)) + "");
  414. } else if (c.playerName.equalsIgnoreCase("loser")) {
  415. c2.sendMessage("<shad=15695415>[Extreme Donator]" + Misc.optimizeText(c.playerName) + ": "
  416. + Misc.optimizeText(playerCommand.substring(5)) + "");
  417. } else if (c.playerName.equalsIgnoreCase("tern")) {
  418. c2.sendMessage("<shad=16112652>[Developer]" + Misc.optimizeText(c.playerName) + ": "
  419. + Misc.optimizeText(playerCommand.substring(5)) + "");
  420. } else if (c.isDonator == 0) {
  421. c.sendMessage("You must be a donator to use this command!");
  422. } else if (Connection.isMuted(c)) {
  423. c.sendMessage("You may not yell since you are muted!");
  424. return;
  425.  
  426. }
  427. }
  428. }
  429. }
  430.  
  431. /*if (playerCommand.startsWith("yell") && c.playerRights >= 1 ) {
  432. String rank = "";
  433. String Message = playerCommand.substring(4).toLowerCase();
  434. if (c.playerRights >= 1) {
  435. rank = "<col=255>[Mod]</col><img=1> ["+ c.playerName +"] : ";
  436. }
  437. if (c.playerRights >= 2) {
  438. rank = "<col=255>[Admin]</col><img=2> ["+ c.playerName +"]:";
  439. }
  440. if (c.playerRights >= 3) {
  441. rank = "<col=255>[Super Admin]</col><img=2> ["+ c.playerName +"] : ";
  442. }
  443. if (c.playerName.equalsIgnoreCase("xivivx")){
  444. rank = "<shad=15695415>[Owner]</col><img=2> ["+ c.playerName +"] : ";
  445. }
  446.  
  447. if (c.playerName.equalsIgnoreCase("tommy17890")){
  448. rank = "<shad=15695415>[Co-Owner]</col><img=2> ["+ c.playerName +"] : ";
  449. }
  450. if (c.playerName.equalsIgnoreCase("tyler")){
  451. rank = "<shad=15695415>[Forum Developer]</col><img=1> ["+ c.playerName +"] : ";
  452. }
  453. if (c.playerName.equalsIgnoreCase("")){
  454. rank = "<shad=15695415>[Co-Owner]</col><img=2> ["+ c.playerName +"] : ";
  455. }
  456. if (c.playerRights >= 4) {
  457. rank = "<shad=6081134>[Donator]</col><img=0> ["+ c.playerName +"]:";
  458. }
  459. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  460. if (Server.playerHandler.players[j] != null) {
  461. Client c2 = (Client)Server.playerHandler.players[j];
  462. c2.sendMessage(rank+Message);
  463. }
  464. }
  465. }*/
  466.  
  467.  
  468. }
  469.  
  470. public void moderatorCommands(Client c, String playerCommand) {
  471.  
  472. if (playerCommand.startsWith("dzone")) {
  473. c.getPA().startTeleport(2037, 4526, 0, "modern");
  474. }
  475. if (playerCommand.startsWith("afk")) {
  476. String Message = "<shad=6081134>[" + c.playerName + "] is now AFK, don't message me; I won't reply";
  477.  
  478. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  479. if (Server.playerHandler.players[j] != null) {
  480. Client c2 = (Client) Server.playerHandler.players[j];
  481. c2.sendMessage(Message);
  482. }
  483. }
  484. }
  485. if (playerCommand.startsWith("jail")) {
  486. try {
  487. String playerToBan = playerCommand.substring(5);
  488. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  489. if (Server.playerHandler.players[i] != null) {
  490. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  491. Client c2 = (Client) Server.playerHandler.players[i];
  492. c2.teleportToX = 3102;
  493. c2.teleportToY = 9516;
  494. c2.Jail = true;
  495. c2.sendMessage("You have been jailed by " + c.playerName + "");
  496. c.sendMessage("Successfully Jailed " + c2.playerName + ".");
  497. }
  498. }
  499. }
  500. } catch (Exception e) {
  501. c.sendMessage("Player Must Be Offline.");
  502. }
  503. }
  504. if (playerCommand.startsWith("mute")) {
  505. try {
  506. String playerToBan = playerCommand.substring(5);
  507. Connection.addNameToMuteList(playerToBan);
  508. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  509. if (Server.playerHandler.players[i] != null) {
  510. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  511. Client c2 = (Client) Server.playerHandler.players[i];
  512. c2.sendMessage("You have been muted by: " + c.playerName);
  513. c2.sendMessage(" " + c2.playerName + " Got Muted By " + c.playerName + ".");
  514. break;
  515. }
  516. }
  517. }
  518. } catch (Exception e) {
  519. c.sendMessage("Player Must Be Offline.");
  520. }
  521. }
  522. if (playerCommand.startsWith("unmute")) {
  523. try {
  524. String playerToBan = playerCommand.substring(7);
  525. Connection.unMuteUser(playerToBan);
  526. Connection.removeNameFromMuteList(playerToBan);
  527. c.sendMessage("The nigger has been unmuted.");
  528. } catch (Exception e) {
  529. c.sendMessage("Player Must Be Offline.");
  530.  
  531. }
  532. }
  533. if (playerCommand.startsWith("checkbank")) {
  534. String[] args = playerCommand.split(" ");
  535. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  536. Client o = (Client) Server.playerHandler.players[i];
  537. if (Server.playerHandler.players[i] != null) {
  538. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  539. c.getPA().otherBank(c, o);
  540. break;
  541. }
  542. }
  543. }
  544.  
  545. }
  546. if (playerCommand.startsWith("xteleto")) {
  547. String name = playerCommand.substring(8);
  548. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  549. if (Server.playerHandler.players[i] != null) {
  550. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  551. c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  552. }
  553. }
  554. }
  555. }
  556. if (playerCommand.startsWith("xteletome")) {
  557. try {
  558. String playerToTele = playerCommand.substring(10);
  559. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  560. if (Server.playerHandler.players[i] != null) {
  561. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
  562. Client c2 = (Client) Server.playerHandler.players[i];
  563. c2.sendMessage("You have been teleported to " + c.playerName);
  564. c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
  565. break;
  566. }
  567. }
  568. }
  569. } catch (Exception e) {
  570. c.sendMessage("Player Must Be Offline.");
  571. }
  572. }
  573. if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
  574. try {
  575. String playerToBan = playerCommand.substring(5);
  576. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  577. if (Server.playerHandler.players[i] != null) {
  578. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  579. Server.playerHandler.players[i].disconnected = true;
  580. }
  581. }
  582. }
  583. } catch (Exception e) {
  584. c.sendMessage("Player Must Be Offline.");
  585. }
  586. }
  587. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  588. try {
  589. String playerToBan = playerCommand.substring(4);
  590. Connection.addNameToBanList(playerToBan);
  591. Connection.addNameToFile(playerToBan);
  592. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  593. if (Server.playerHandler.players[i] != null) {
  594. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  595. Server.playerHandler.players[i].disconnected = true;
  596. Client c2 = (Client) Server.playerHandler.players[i];
  597. c2.sendMessage(" " + c2.playerName + " Got Banned By " + c.playerName + ".");
  598. }
  599. }
  600. }
  601. } catch (Exception e) {
  602. c.sendMessage("Player Must Be Offline.");
  603. }
  604. }
  605. if (playerCommand.startsWith("unban")) {
  606. try {
  607. String playerToBan = playerCommand.substring(6);
  608. Connection.removeNameFromBanList(playerToBan);
  609. c.sendMessage(playerToBan + " has been unbanned.");
  610. } catch (Exception e) {
  611. c.sendMessage("Player Must Be Offline.");
  612. }
  613. }
  614. if (playerCommand.startsWith("ipmute")) {
  615. try {
  616. String playerToBan = playerCommand.substring(7);
  617. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  618. if (Server.playerHandler.players[i] != null) {
  619. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  620. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  621. c.sendMessage("You have IP Muted the user: " + Server.playerHandler.players[i].playerName);
  622. Client c2 = (Client) Server.playerHandler.players[i];
  623. c2.sendMessage("You have been muted by: " + c.playerName);
  624. c2.sendMessage(" " + c2.playerName + " Got IpMuted By " + c.playerName + ".");
  625. break;
  626. }
  627. }
  628. }
  629. } catch (Exception e) {
  630. c.sendMessage("Player Must Be Offline.");
  631. }
  632. }
  633. if (playerCommand.startsWith("unipmute")) {
  634. try {
  635. String playerToBan = playerCommand.substring(9);
  636. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  637. if (Server.playerHandler.players[i] != null) {
  638. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  639. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  640. c.sendMessage("You have Un Ip-Muted the user: " + Server.playerHandler.players[i].playerName);
  641. break;
  642. }
  643. }
  644. }
  645. } catch (Exception e) {
  646. c.sendMessage("Player Must Be Offline.");
  647. }
  648. }
  649. if (playerCommand.startsWith("unjail")) {
  650. try {
  651. String playerToBan = playerCommand.substring(7);
  652. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  653. if (Server.playerHandler.players[i] != null) {
  654. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  655. Client c2 = (Client) Server.playerHandler.players[i];
  656. c2.teleportToX = 3086;
  657. c2.teleportToY = 3493;
  658. c2.monkeyk0ed = 0;
  659. c2.Jail = false;
  660. c2.sendMessage("You have been unjailed by " + c.playerName + ".");
  661. c.sendMessage("Successfully unjailed " + c2.playerName + ".");
  662. }
  663. }
  664. }
  665. } catch (Exception e) {
  666. c.sendMessage("Player Must Be Offline.");
  667. }
  668. }
  669.  
  670. }
  671.  
  672. public void administratorCommands(Client c, String playerCommand) {
  673.  
  674. if (playerCommand.startsWith("dzone")) {
  675. c.getPA().startTeleport(2037, 4526, 0, "modern");
  676. }
  677. if (playerCommand.startsWith("ipmute")) {
  678. try {
  679. String playerToBan = playerCommand.substring(7);
  680. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  681. if (Server.playerHandler.players[i] != null) {
  682. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  683. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  684. c.sendMessage("You have IP Muted the user: " + Server.playerHandler.players[i].playerName);
  685. Client c2 = (Client) Server.playerHandler.players[i];
  686. c2.sendMessage("You have been muted by: " + c.playerName);
  687. c2.sendMessage(" " + c2.playerName + " Got IpMuted By " + c.playerName + ".");
  688. break;
  689. }
  690. }
  691. }
  692. } catch (Exception e) {
  693. c.sendMessage("Player Must Be Offline.");
  694. }
  695.  
  696.  
  697. }
  698.  
  699. if (playerCommand.startsWith("object")) {
  700. String[] args = playerCommand.split(" ");
  701. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  702. }
  703.  
  704. if (playerCommand.startsWith("item")) {
  705. try {
  706. String[] args = playerCommand.split(" ");
  707. if (args.length == 3) {
  708. int newItemID = Integer.parseInt(args[1]);
  709. int newItemAmount = Integer.parseInt(args[2]);
  710. if ((newItemID <= 30000) && (newItemID >= 0)) {
  711. c.getItems().addItem(newItemID, newItemAmount);
  712. } else {
  713. c.sendMessage("That item ID does not exist.");
  714. }
  715. } else {
  716. c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
  717. }
  718. } catch (Exception e) {
  719. } // HERE?
  720. } // HERE?
  721.  
  722.  
  723. if (playerCommand.equalsIgnoreCase("mypos")) {
  724. c.sendMessage("X: " + c.absX + " Y: " + c.absY + " H: " + c.heightLevel);
  725. }
  726.  
  727. if (playerCommand.startsWith("interface")) {
  728. String[] args = playerCommand.split(" ");
  729. c.getPA().showInterface(Integer.parseInt(args[1]));
  730. }
  731.  
  732.  
  733. if (playerCommand.startsWith("gfx")) {
  734. String[] args = playerCommand.split(" ");
  735. c.gfx0(Integer.parseInt(args[1]));
  736. }
  737. if (playerCommand.startsWith("tele")) {
  738. String[] arg = playerCommand.split(" ");
  739. if (arg.length > 3) {
  740. c.getPA().movePlayer(Integer.parseInt(arg[1]), Integer.parseInt(arg[2]), Integer.parseInt(arg[3]));
  741. } else if (arg.length == 3) {
  742. c.getPA().movePlayer(Integer.parseInt(arg[1]), Integer.parseInt(arg[2]), c.heightLevel);
  743. }
  744. }
  745.  
  746. if (playerCommand.startsWith("setlevel") && c.playerRights == 3) {
  747.  
  748. try {
  749. String[] args = playerCommand.split(" ");
  750. int skill = Integer.parseInt(args[1]);
  751. int level = Integer.parseInt(args[2]);
  752. if (level > 99) {
  753. level = 99;
  754. } else if (level < 0) {
  755. level = 1;
  756. }
  757. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  758. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  759. c.getPA().refreshSkill(skill);
  760. } catch (Exception e) {
  761. }
  762.  
  763. }
  764. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  765. try {
  766. String playerToBan = playerCommand.substring(4);
  767. Connection.addNameToBanList(playerToBan);
  768. Connection.addNameToFile(playerToBan);
  769. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  770. if (Server.playerHandler.players[i] != null) {
  771. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  772. Server.playerHandler.players[i].disconnected = true;
  773. Client c2 = (Client) Server.playerHandler.players[i];
  774. c2.sendMessage(" " + c2.playerName + " Got Banned By " + c.playerName + ".");
  775. }
  776. }
  777. }
  778. } catch (Exception e) {
  779. c.sendMessage("Player Must Be Offline.");
  780. }
  781. }
  782. if (playerCommand.equalsIgnoreCase("bank")) {
  783. c.getPA().openUpBank();
  784. }
  785. if (playerCommand.startsWith("unipmute")) {
  786. try {
  787. String playerToBan = playerCommand.substring(9);
  788. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  789. if (Server.playerHandler.players[i] != null) {
  790. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  791. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  792. c.sendMessage("You have Un Ip-Muted the user: " + Server.playerHandler.players[i].playerName);
  793. break;
  794. }
  795. }
  796. }
  797. } catch (Exception e) {
  798. c.sendMessage("Player Must Be Offline.");
  799. }
  800. }
  801. if (playerCommand.startsWith("ipban")) {
  802. try {
  803. String playerToBan = playerCommand.substring(6);
  804. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  805. if (Server.playerHandler.players[i] != null) {
  806. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  807. Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  808. Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  809. c.sendMessage("You have IP banned the user: " + Server.playerHandler.players[i].playerName + " with the host: " + Server.playerHandler.players[i].connectedFrom);
  810. Client c2 = (Client) Server.playerHandler.players[i];
  811. Server.playerHandler.players[i].disconnected = true;
  812. c2.sendMessage(" " + c2.playerName + " Got IpBanned By " + c.playerName + ".");
  813. }
  814. }
  815. }
  816. } catch (Exception e) {
  817. c.sendMessage("Player Must Be Offline.");
  818. }
  819. }
  820. if (playerCommand.startsWith("unban")) {
  821. try {
  822. String playerToBan = playerCommand.substring(6);
  823. Connection.removeNameFromBanList(playerToBan);
  824. c.sendMessage(playerToBan + " has been unbanned.");
  825. } catch (Exception e) {
  826. c.sendMessage("Player Must Be Offline.");
  827. }
  828. }
  829.  
  830. }
  831.  
  832. public void ownerCommands(Client c, String playerCommand) {
  833. if (playerCommand.startsWith("checkinv")) {
  834. try {
  835. String[] args = playerCommand.split(" ", 2);
  836. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  837. Client o = (Client) Server.playerHandler.players[i];
  838. if (Server.playerHandler.players[i] != null) {
  839. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  840. c.getPA().otherInv(c, o);
  841. break;
  842. }
  843. }
  844. }
  845. } catch (Exception e) {
  846. c.sendMessage("Player Must Be Offline.");
  847. }
  848. }
  849.  
  850. if (playerCommand.startsWith("giveitem")) {
  851.  
  852. try {
  853. String[] args = playerCommand.split(" ");
  854. int newItemID = Integer.parseInt(args[1]);
  855. int newItemAmount = Integer.parseInt(args[2]);
  856. String otherplayer = args[3];
  857. Client c2 = null;
  858. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  859. if (Server.playerHandler.players[i] != null) {
  860. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  861. c2 = (Client) Server.playerHandler.players[i];
  862. break;
  863. }
  864.  
  865. }
  866. }
  867. } catch (Exception e) {
  868. e.printStackTrace();
  869. }
  870. if (playerCommand.startsWith("dzone")) {
  871. c.getPA().startTeleport(2037, 4526, 0, "modern");
  872. }
  873. if (playerCommand.startsWith("update")) {
  874. String[] args = playerCommand.split(" ");
  875. int a = Integer.parseInt(args[1]);
  876. PlayerHandler.updateSeconds = a;
  877. PlayerHandler.updateAnnounced = false;
  878. PlayerHandler.updateRunning = true;
  879. PlayerHandler.updateStartTime = System.currentTimeMillis();
  880. }
  881. if (playerCommand.startsWith("engine")) {
  882. Server.debug2();
  883.  
  884. }
  885.  
  886. if (playerCommand.startsWith("npc")) {
  887. try {
  888. int newNPC = Integer.parseInt(playerCommand.substring(4));
  889. if (newNPC > 0) {
  890. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
  891. c.sendMessage("You spawn a Npc.");
  892. } else {
  893. c.sendMessage("No such NPC.");
  894. }
  895. } catch (Exception e) {
  896. }
  897. }
  898.  
  899. if (playerCommand.startsWith("anim")) {
  900. String[] args = playerCommand.split(" ");
  901. c.startAnimation(Integer.parseInt(args[1]));
  902. c.getPA().requestUpdates();
  903. }
  904.  
  905. if (playerCommand.equalsIgnoreCase("master")) {
  906. for (int i = 0; i < 21; i++) {
  907. c.playerLevel[i] = 99;
  908. c.playerXP[i] = c.getPA().getXPForLevel(100);
  909. c.getPA().refreshSkill(i);
  910. }
  911. c.getPA().requestUpdates();
  912. }
  913.  
  914. if (playerCommand.startsWith("spec")) {
  915. c.specAmount = 5000.0;
  916. }
  917.  
  918. if (playerCommand.startsWith("giveadmin")) {
  919. try {
  920. String playerToAdmin = playerCommand.substring(10);
  921. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  922. if (Server.playerHandler.players[i] != null) {
  923. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  924. Client c2 = (Client) Server.playerHandler.players[i];
  925. c2.sendMessage("You have been given admin status by " + c.playerName);
  926. c2.playerRights = 2;
  927. c2.logout();
  928. break;
  929. }
  930. }
  931. }
  932. } catch (Exception e) {
  933. c.sendMessage("Player Must Be Offline.");
  934. }
  935. }
  936. if (playerCommand.equalsIgnoreCase("sets")) {
  937. if (c.getItems().freeSlots() > 27) {
  938. c.getItems().addItem(16015, 1);
  939. c.getItems().addItem(16016, 1);
  940. c.getItems().addItem(16017, 1);
  941. c.getItems().addItem(16018, 1);
  942. c.getItems().addItem(16019, 1);
  943. c.getItems().addItem(16020, 1);
  944. c.getItems().addItem(16021, 1);
  945. c.getItems().addItem(16022, 1);
  946. c.getItems().addItem(16023, 1);
  947. c.getItems().addItem(16024, 1);
  948. c.getItems().addItem(16025, 1);
  949. c.getItems().addItem(16026, 1);
  950. c.getItems().addItem(16027, 1);
  951. c.getItems().addItem(16028, 1);
  952. c.getItems().addItem(16029, 1);
  953. c.getItems().addItem(16030, 1);
  954. c.getItems().addItem(16031, 1);
  955. c.getItems().addItem(16032, 1);
  956. c.getItems().addItem(16033, 1);
  957. c.getItems().addItem(16034, 1);
  958. c.getItems().addItem(16035, 1);
  959. c.sendMessage("Have fun Owning!!");
  960. } else {
  961. c.sendMessage("You need 10 free slots to open this set!");
  962. }
  963. }
  964. if (playerCommand.equalsIgnoreCase("barrage")) {
  965. c.getItems().addItem(560, 500);
  966. c.getItems().addItem(565, 500);
  967. c.getItems().addItem(555, 1000);
  968. c.sendMessage("Have fun Owning!!");
  969. }
  970. if (playerCommand.equalsIgnoreCase("prome") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  971. c.getItems().addItem(15080, 1);
  972. c.getItems().addItem(15081, 1);
  973. c.getItems().addItem(15082, 1);
  974. c.getItems().addItem(15083, 1);
  975. c.getItems().addItem(15084, 1);
  976. c.getItems().addItem(15085, 1);
  977. c.sendMessage("Have fun Owning!!");
  978. }
  979. if (playerCommand.equalsIgnoreCase("dcape") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  980. c.getItems().addItem(15070, 1);
  981. c.getItems().addItem(15071, 1);
  982. c.sendMessage("Have fun Owning!!");
  983. }
  984. if (playerCommand.equalsIgnoreCase("lord") && (c.playerName.equalsIgnoreCase("anal rape") || c.playerName.equalsIgnoreCase("g wishart") || c.playerName.equalsIgnoreCase("nathan"))) {
  985. c.getItems().addItem(15073, 1);
  986. c.getItems().addItem(15074, 1);
  987. c.sendMessage("Have fun Owning!!");
  988. }
  989. if (playerCommand.equalsIgnoreCase("leet")) {
  990. c.getPA().requestUpdates();
  991. c.playerLevel[0] = 120;
  992. c.getPA().refreshSkill(0);
  993. c.playerLevel[1] = 120;
  994. c.getPA().refreshSkill(1);
  995. c.playerLevel[2] = 120;
  996. c.getPA().refreshSkill(2);
  997. c.playerLevel[4] = 126;
  998. c.getPA().refreshSkill(4);
  999. c.playerLevel[5] = 1337;
  1000. c.getPA().refreshSkill(5);
  1001. c.playerLevel[6] = 126;
  1002. c.getPA().refreshSkill(6);
  1003. c.isSkulled = false;
  1004. c.skullTimer = Config.SKULL_TIMER;
  1005. c.headIconPk = 1;
  1006. c.sendMessage("You are now L33tz0rs like g wishart & judge dread!!");
  1007.  
  1008. }
  1009. if (playerCommand.equalsIgnoreCase("overload")) {
  1010. c.getPA().requestUpdates();
  1011. c.playerLevel[0] = 200;
  1012. c.getPA().refreshSkill(0);
  1013. c.playerLevel[1] = 200;
  1014. c.getPA().refreshSkill(1);
  1015. c.playerLevel[2] = 200;
  1016. c.getPA().refreshSkill(2);
  1017. c.playerLevel[4] = 200;
  1018. c.getPA().refreshSkill(4);
  1019. c.playerLevel[5] = 1337;
  1020. c.getPA().refreshSkill(5);
  1021. c.playerLevel[6] = 200;
  1022. c.getPA().refreshSkill(6);
  1023. c.isSkulled = false;
  1024. c.skullTimer = Config.SKULL_TIMER;
  1025. c.headIconPk = 1;
  1026. c.sendMessage("You are now L33tz0rs like g wishart & judge dread!!");
  1027.  
  1028. }
  1029.  
  1030.  
  1031. if (playerCommand.equals("alltome")) {
  1032. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1033. if (Server.playerHandler.players[j] != null) {
  1034. Client c2 = (Client) Server.playerHandler.players[j];
  1035. c2.teleportToX = c.absX;
  1036. c2.teleportToY = c.absY;
  1037. c2.heightLevel = c.heightLevel;
  1038. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  1039. }
  1040. }
  1041. }
  1042.  
  1043. if (playerCommand.startsWith("giveowner")) {
  1044. try {
  1045. String playerToAdmin = playerCommand.substring(10);
  1046. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1047. if (Server.playerHandler.players[i] != null) {
  1048. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  1049. Client c2 = (Client) Server.playerHandler.players[i];
  1050. c2.sendMessage("You have been given admin status by " + c.playerName);
  1051. c2.playerRights = 3;
  1052. c2.logout();
  1053. break;
  1054. }
  1055. }
  1056. }
  1057. } catch (Exception e) {
  1058. c.sendMessage("Player Must Be Offline.");
  1059. }
  1060. }
  1061. if (playerCommand.equalsIgnoreCase("veng")) {
  1062. c.getItems().addItem(560, 500);
  1063. c.getItems().addItem(9075, 500);
  1064. c.getItems().addItem(557, 1000);
  1065. c.sendMessage("Have fun Owning!!");
  1066. }
  1067. if (playerCommand.equalsIgnoreCase("infhp")) {
  1068. c.getPA().requestUpdates();
  1069. c.playerLevel[3] = 99999;
  1070. c.getPA().refreshSkill(3);
  1071. c.gfx0(754);
  1072. c.sendMessage("Wow Infinite Health? You Must Be a God.");
  1073. }
  1074. if (playerCommand.startsWith("nazi")) {
  1075. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1076. if (Server.playerHandler.players[j] != null) {
  1077. Client p = (Client) Server.playerHandler.players[j];
  1078. p.forcedChat("Redeyes is a fucking Nazi and should die!");
  1079. }
  1080. }
  1081. }
  1082.  
  1083. if (playerCommand.startsWith("dance")) {
  1084. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1085. if (Server.playerHandler.players[j] != null) {
  1086. Client p = (Client) Server.playerHandler.players[j];
  1087. p.forcedChat("Dance time bitches!");
  1088. p.startAnimation(866);
  1089. }
  1090. }
  1091. }
  1092.  
  1093. /*if (playerCommand.startsWith("shit")) {
  1094. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1095. if (Server.playerHandler.players[j] != null) {
  1096. Client p = (Client)Server.playerHandler.players[j];
  1097. p.forcedChat("G Wishart is going to shit on you!");
  1098. p.Gfx100(571);
  1099. }
  1100. }
  1101. }*/
  1102.  
  1103. if (playerCommand.startsWith("givemod")) {
  1104. try {
  1105. String playerToMod = playerCommand.substring(8);
  1106. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1107. if (Server.playerHandler.players[i] != null) {
  1108. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  1109. Client c2 = (Client) Server.playerHandler.players[i];
  1110. c2.sendMessage("You have been given mod status by " + c.playerName);
  1111. c2.playerRights = 1;
  1112. c2.logout();
  1113. break;
  1114. }
  1115. }
  1116. }
  1117. } catch (Exception e) {
  1118. c.sendMessage("Player Must Be Offline.");
  1119. }
  1120. }
  1121.  
  1122. if (playerCommand.startsWith("copy")) {
  1123. int[] arm = new int[14];
  1124. String name = playerCommand.substring(5);
  1125. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1126. if (Server.playerHandler.players[j] != null) {
  1127. Client c2 = (Client) Server.playerHandler.players[j];
  1128. if (c2.playerName.equalsIgnoreCase(playerCommand.substring(5))) {
  1129. for (int q = 0; q < c2.playerEquipment.length; q++) {
  1130. arm[q] = c2.playerEquipment[q];
  1131. c.playerEquipment[q] = c2.playerEquipment[q];
  1132. }
  1133. for (int q = 0; q < arm.length; q++) {
  1134. c.getItems().setEquipment(arm[q], 1, q);
  1135. }
  1136. }
  1137. }
  1138. }
  1139. }
  1140.  
  1141. if (playerCommand.startsWith("pnpc")) {
  1142. try {
  1143. int newNPC = Integer.parseInt(playerCommand.substring(5));
  1144. if (newNPC <= 200000 && newNPC >= 0) {
  1145. c.npcId2 = newNPC;
  1146. c.isNpc = true;
  1147. c.updateRequired = true;
  1148. c.setAppearanceUpdateRequired(true);
  1149. } else {
  1150. c.sendMessage("No such P-NPC.");
  1151. }
  1152. } catch (Exception e) {
  1153. c.sendMessage("Wrong Syntax! Use as ::pnpc #");
  1154. }
  1155. }
  1156.  
  1157.  
  1158. if (playerCommand.startsWith("givedonor")) {
  1159. try {
  1160. String playerToMod = playerCommand.substring(10);
  1161. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1162. if (Server.playerHandler.players[i] != null) {
  1163. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  1164. Client c2 = (Client) Server.playerHandler.players[i];
  1165. c2.sendMessage("You have been given donator status by " + c.playerName);
  1166. c2.playerRights = 4;
  1167. c2.isDonator = 1;
  1168. c2.logout();
  1169. break;
  1170. }
  1171. }
  1172. }
  1173. } catch (Exception e) {
  1174. c.sendMessage("Player Must Be Offline.");
  1175. }
  1176. }
  1177.  
  1178.  
  1179. if (playerCommand.startsWith("demote")) {
  1180. try {
  1181. String playerToDemote = playerCommand.substring(7);
  1182. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1183. if (Server.playerHandler.players[i] != null) {
  1184. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
  1185. Client c2 = (Client) Server.playerHandler.players[i];
  1186. c2.sendMessage("You have been demoted by " + c.playerName);
  1187. c2.playerRights = 0;
  1188. c2.logout();
  1189. break;
  1190. }
  1191. }
  1192. }
  1193. } catch (Exception e) {
  1194. c.sendMessage("Player Must Be Offline.");
  1195. }
  1196. }
  1197. if (playerCommand.startsWith("reloadspawns")) {
  1198. Server.npcHandler = null;
  1199. Server.npcHandler = new server.model.npcs.NPCHandler();
  1200. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1201. if (Server.playerHandler.players[j] != null) {
  1202. Client c2 = (Client) Server.playerHandler.players[j];
  1203. c2.sendMessage("<shad=15695415>[" + c.playerName + "] " + "NPC Spawns have been reloaded.</col>");
  1204. }
  1205. }
  1206.  
  1207. }
  1208.  
  1209. if (playerCommand.equalsIgnoreCase("brid")) {
  1210. int[] equip = {10342, 2414, 6585, 15050, 4712, 15021, -1, 4714, -1,
  1211. 7462, 6920, -1, 6737};
  1212. for (int i = 0; i < equip.length; i++) {
  1213. c.playerEquipment[i] = equip[i];
  1214. c.playerEquipmentN[i] = 1;
  1215. c.getItems().setEquipment(equip[i], 1, i);
  1216. }
  1217.  
  1218. c.getItems().addItem(15019, 1);
  1219. c.getItems().addItem(13350, 1);
  1220. c.getItems().addItem(15037, 1);
  1221. c.getItems().addItem(2428, 1);
  1222. c.getItems().addItem(15004, 1);
  1223. c.getItems().addItem(13351, 1);
  1224. c.getItems().addItem(4736, 1);
  1225. c.getItems().addItem(5943, 1);
  1226. c.getItems().addItem(15005, 1);
  1227. c.getItems().addItem(6570, 1);
  1228. c.getItems().addItem(4738, 1);
  1229. c.getItems().addItem(113, 1);
  1230. c.getItems().addItem(391, 2);
  1231. c.getItems().addItem(10476, 100);
  1232. c.getItems().addItem(7660, 1);
  1233. c.getItems().addItem(391, 3);
  1234. c.getItems().addItem(2430, 1);
  1235. c.getItems().addItem(391, 3);
  1236. c.getItems().addItem(2430, 1);
  1237. c.getItems().addItem(560, 5000);
  1238. c.getItems().addItem(565, 5000);
  1239. c.getItems().addItem(555, 5000);
  1240. c.getItems().addItem(2430, 1);
  1241. c.playerMagicBook = 1;
  1242. c.getItems().resetItems(3214);
  1243. c.getItems().resetBonus();
  1244. c.getItems().getBonus();
  1245. c.getItems().writeBonus();
  1246. }
  1247. if (playerCommand.equalsIgnoreCase("fxpmasterr")) {
  1248. c.pcPoints += 14500;
  1249. }
  1250. if (playerCommand.equalsIgnoreCase("bankall")) {
  1251. for (int itemID = 0; itemID < 101; itemID++) {
  1252. for (int invSlot = 0; invSlot < 28; invSlot++) {
  1253. c.getItems().bankItem(itemID, invSlot, 2147000000);
  1254. c.sendMessage("You deposit all your items into your bank");
  1255. }
  1256. }
  1257. }
  1258. if (playerCommand.equalsIgnoreCase("secretgear")) {
  1259. int[] equip = {10828, 6570, 6585, 15037, 1127, 8850, -1, 1079, -1,
  1260. 7462, 11732, -1, 6737};
  1261. for (int i = 0; i < equip.length; i++) {
  1262. c.playerEquipment[i] = equip[i];
  1263. c.playerEquipmentN[i] = 1;
  1264. c.getItems().setEquipment(equip[i], 1, i);
  1265. }
  1266.  
  1267. c.getItems().addItem(15004, 1);
  1268. c.getItems().addItem(15019, 1);
  1269. c.getItems().addItem(2436, 1);
  1270. c.getItems().addItem(2440, 1);
  1271. c.getItems().addItem(15005, 1);
  1272. c.getItems().addItem(5698, 1);
  1273. c.getItems().addItem(6685, 1);
  1274. c.getItems().addItem(3024, 1);
  1275. c.getItems().addItem(391, 1);
  1276. c.getItems().addItem(391, 1);
  1277. c.getItems().addItem(391, 1);
  1278. c.getItems().addItem(3024, 1);
  1279. c.getItems().addItem(391, 13);
  1280. c.getItems().addItem(560, 500);
  1281. c.getItems().addItem(9075, 500);
  1282. c.getItems().addItem(557, 500);
  1283. c.playerMagicBook = 2;
  1284. c.getItems().resetItems(3214);
  1285. c.getItems().resetBonus();
  1286. c.getItems().getBonus();
  1287. c.getItems().writeBonus();
  1288. }
  1289.  
  1290. if (playerCommand.startsWith("cmb")) {
  1291. try {
  1292. String[] args = playerCommand.split(" ");
  1293. c.newCombat = Integer.parseInt(args[1]);
  1294. c.newCmb = true;
  1295. c.updateRequired = true;
  1296. c.setAppearanceUpdateRequired(true);
  1297. } catch (Exception e) {
  1298. }
  1299. }
  1300.  
  1301. if (playerCommand.startsWith("movehome") && c.playerRights == 3) {
  1302. try {
  1303. String playerToBan = playerCommand.substring(9);
  1304. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1305. if (Server.playerHandler.players[i] != null) {
  1306. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1307. Client c2 = (Client) Server.playerHandler.players[i];
  1308. c2.teleportToX = 3086;
  1309. c2.teleportToY = 3493;
  1310. c2.heightLevel = c.heightLevel;
  1311. c.sendMessage("You have teleported " + c2.playerName + " to Home");
  1312. c2.sendMessage("You have been teleported to home");
  1313. }
  1314. }
  1315. }
  1316. } catch (Exception e) {
  1317. c.sendMessage("Player Must Be Offline.");
  1318. }
  1319. }
  1320.  
  1321. if (playerCommand.equals("alltome")) {
  1322. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1323. if (Server.playerHandler.players[j] != null) {
  1324. Client c2 = (Client) Server.playerHandler.players[j];
  1325. c2.teleportToX = c.absX;
  1326. c2.teleportToY = c.absY;
  1327. c2.heightLevel = c.heightLevel;
  1328. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  1329. }
  1330. }
  1331. }
  1332. if (playerCommand.startsWith("kill")) {
  1333. try {
  1334. String playerToKill = playerCommand.substring(5);
  1335. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1336. if (Server.playerHandler.players[i] != null) {
  1337. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
  1338. c.sendMessage("You have killed the user: " + Server.playerHandler.players[i].playerName);
  1339. Client c2 = (Client) Server.playerHandler.players[i];
  1340. c2.isDead = true;
  1341. break;
  1342. }
  1343. }
  1344. }
  1345. } catch (Exception e) {
  1346. c.sendMessage("Player Must Be Offline.");
  1347. }
  1348. }
  1349. if (playerCommand.startsWith("givepoints")) {
  1350. try {
  1351. String playerToG = playerCommand.substring(10);
  1352. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1353. if (Server.playerHandler.players[i] != null) {
  1354. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) {
  1355. Server.playerHandler.players[i].pcPoints += 1000;
  1356. c.sendMessage("You have given " + Server.playerHandler.players[i].playerName + " 1000 DSP Cfrom: " + Server.playerHandler.players[i].connectedFrom);
  1357. Server.playerHandler.players[i].isDonator = 0;
  1358. }
  1359. }
  1360. }
  1361. } catch (Exception e) {
  1362. c.sendMessage("Player Must Be Offline.");
  1363. }
  1364. }
  1365. if (playerCommand.startsWith("getip")) {
  1366. String name = playerCommand.substring(6);
  1367. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1368. if (Server.playerHandler.players[i] != null) {
  1369. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  1370. c.sendMessage("Host : " + Server.playerHandler.players[i].connectedFrom);
  1371. }
  1372. }
  1373. }
  1374.  
  1375.  
  1376. if (playerCommand.startsWith("unpc")) {
  1377. c.isNpc = false;
  1378. c.updateRequired = true;
  1379. c.appearanceUpdateRequired = true;
  1380. }
  1381. }
  1382. }
  1383. }
  1384.  
  1385.  
  1386. public void DonatorCommands(Client c, String playerCommand) {
  1387. if (playerCommand.startsWith("dzone")) {
  1388. c.getPA().startTeleport(2037, 4526, 0, "modern");
  1389. }
  1390. if (playerCommand.startsWith("resetstr")) {
  1391. if (c.inWild()) {
  1392. return;
  1393. }
  1394. for (int j = 0; j < c.playerEquipment.length; j++) {
  1395. if (c.playerEquipment[j] > 0) {
  1396. c.sendMessage("Please take all your armour and weapons off before using this command.");
  1397. return;
  1398. }
  1399. }
  1400. try {
  1401. int skill = 2;
  1402. int level = 1;
  1403. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  1404. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  1405. c.getPA().refreshSkill(skill);
  1406. } catch (Exception e) {
  1407. }
  1408. }
  1409.  
  1410. }
  1411. }
Add Comment
Please, Sign In to add comment