Guest User

Untitled

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