Guest User

Untitled

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