Guest User

Untitled

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