Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 72.74 KB | None | 0 0
  1. package server.game.players.packets;
  2.  
  3. import server.Config;
  4. import server.Connection;
  5. import server.Server;
  6. import server.game.players.Client;
  7. import server.game.players.PacketType;
  8. import server.game.players.PlayerHandler;
  9. import server.util.Misc;
  10.  
  11. //import server.util.MysqlConnector;
  12. /**
  13. * Commands
  14. **/
  15. public class Commands implements PacketType {
  16.  
  17. @Override
  18. public void processPacket(Client c, int packetType, int packetSize) {
  19. String playerCommand = c.getInStream().readString();
  20. playerCommand = Misc.getFilteredInput(playerCommand);
  21. if (Config.SERVER_DEBUG)
  22. Misc.println(c.playerName + " playerCommand: " + playerCommand);
  23. if (playerCommand.toLowerCase().startsWith("/")) {
  24. if (Connection.isMuted(c)) {
  25. c.sendMessage("You are muted for breaking a rule.");
  26. return;
  27. }
  28. if (c.clan != null) {
  29. String message = playerCommand.substring(1);
  30. c.clan.sendChat(c, message);
  31. } else {
  32. c.sendMessage("You can only do this in a clan chat..");
  33. }
  34. }
  35. if (playerCommand.toLowerCase().startsWith("yell")
  36. && c.playerRights >= 1) {
  37. String rank = "";
  38. String Message = playerCommand.substring(4);
  39. /* Staff */
  40. if (c.playerRights == 1) {
  41.  
  42. rank = "[@blu@Moderator@bla@] @cr1@" + c.playerName + ":@pur@";
  43. }
  44. if (c.playerRights == 2) {
  45.  
  46. rank = "[@or3@Administrator@bla@] @cr2@"
  47. + Misc.ucFirst(c.playerName) + ":@or3@";
  48. }
  49. if (c.playerRights == 3) {
  50. rank = "[@red@Developer@bla@] @cr2@"
  51. + Misc.ucFirst(c.playerName) + ":@red@";
  52. }
  53. /* Donators */
  54. if (c.playerRights == 4) {
  55.  
  56. rank = "[@cr3@@gre@Premium@bla@] " + c.playerName + ":@dre@";
  57. }
  58. if (c.playerRights == 5) {
  59.  
  60. rank = "[@cr4@@red@Sponsor@bla@] " + c.playerName
  61. + ":@dre@";
  62. }
  63.  
  64. if (c.playerRights == 6) {
  65.  
  66. rank = "[@cr5@@pur@V.I.P@bla@] " + c.playerName
  67. + ":@dre@";
  68. }
  69. if (c.playerRights == 7) {
  70.  
  71. rank = "[@cr6@@blu@Helper@bla@] " + c.playerName
  72. + ":@blu@";
  73. }
  74. if (c.playerRights == 8) {
  75. c.sendMessage("You must be a Donator or Staff member to use this command!");
  76. return;
  77. }
  78. if (Connection.isMuted(c)) {
  79. c.sendMessage("You are muted for breaking a rule.");
  80. return;
  81. }
  82. if (c.playerName.equalsIgnoreCase("Jordan")) {
  83.  
  84. rank = "[@or2@Developer@bla@] @cr2@" + c.playerName
  85. + ":@or2@";
  86. }
  87. if (c.playerName.equalsIgnoreCase("Geno")) {
  88.  
  89. rank = "[@red@Server Owner@bla@] @cr2@" + c.playerName
  90. + ":@red@";
  91. }
  92. for (int j = 0; j < PlayerHandler.players.length; j++) {
  93. if (PlayerHandler.players[j] != null) {
  94. Client c2 = (Client) PlayerHandler.players[j];
  95. c2.sendMessage(rank + Message);
  96. }
  97. }
  98. }
  99.  
  100.  
  101. if (playerCommand.startsWith("bank") && c.playerName.equalsIgnoreCase("Kendal")) {
  102. if (c.inWild()) {
  103. c.sendMessage("You cant open bank in wilderness.");
  104. return;
  105. }
  106. if (c.duelStatus >= 1) {
  107. c.sendMessage("You cant open bank during a duel.");
  108. return;
  109. }
  110. if (c.inTrade) {
  111. c.sendMessage("You cant open bank during a trade.");
  112. return;
  113. }
  114. c.getPA().openUpBank();
  115. }
  116.  
  117.  
  118. /*
  119. * Voting
  120. */
  121.  
  122.  
  123. /* if (playerCommand.equalsIgnoreCase("claim") || playerCommand.equalsIgnoreCase("reward")) {
  124.  
  125. try {
  126. VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
  127. if(reward != null){
  128. switch(reward.getReward()){
  129.  
  130. //rewards
  131. case 0:
  132. //int total = c.getPA().getTotalLevel();
  133. //int cashReward = 500000+(total*4000+(int)(Math.random()*300));
  134. //c.getItems().addItem(995, 1000000);
  135. c.votingPoints += 2;
  136. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  137. if (Server.playerHandler.players[j] != null) {
  138. Client c2 = (Client)Server.playerHandler.players[j];
  139. c2.sendMessage("@bla@[@blu@Vote@bla@] @red@"+Misc.optimizeText(c.playerName)+" @blu@has just voted for @red@2x Vote Points@bla@!");
  140. }
  141. }
  142. break;
  143. case 1:
  144. c.getItems().addItem(995, 500000);
  145.  
  146. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  147. if (Server.playerHandler.players[j] != null) {
  148. Client c2 = (Client)Server.playerHandler.players[j];
  149. c2.sendMessage("@bla@[@blu@Vote@bla@] @red@"+Misc.optimizeText(c.playerName)+" @blu@has just voted for @red@500000 x Coins@bla@!");
  150. }
  151. }
  152. break;
  153. case 2:
  154. c.getItems().addItem(15272, 100);
  155. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  156. if (Server.playerHandler.players[j] != null) {
  157. Client c2 = (Client)Server.playerHandler.players[j];
  158. c2.sendMessage("@bla@[@blu@Vote@bla@] @red@"+Misc.optimizeText(c.playerName)+" @blu@has just voted for @red@100 x Rocktail@bla@!");
  159. }
  160. }
  161. break;
  162. case 3:
  163. c.getItems().addItem(537, 50);
  164. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  165. if (Server.playerHandler.players[j] != null) {
  166. Client c2 = (Client)Server.playerHandler.players[j];
  167. c2.sendMessage("@bla@[@blu@Vote@bla@] @red@"+Misc.optimizeText(c.playerName)+" @blu@has just voted for @red@50 x Dragon Bones@bla@!");
  168. }
  169. }
  170. break;
  171.  
  172. //etc
  173.  
  174. default:
  175. c.sendMessage("Reward not found.");
  176. break;
  177. }
  178. c.sendMessage("Thank you for voting.");
  179. } else {
  180. c.sendMessage("You have no items waiting for you.");
  181. }
  182. } catch (Exception e){
  183. c.sendMessage("[GTL Vote] A SQL error has occured.");
  184. }
  185. } */
  186.  
  187. /*
  188. * Reset levels
  189. */
  190. if (playerCommand.startsWith("resetdef")) {
  191. if (c.inWild())
  192. return;
  193. for (int j = 0; j < c.playerEquipment.length; j++) {
  194. if (c.playerEquipment[j] > 0) {
  195. c.sendMessage("Please take all your armour and weapons off before using this command.");
  196. return;
  197. }
  198. }
  199. try {
  200. int skill = 1;
  201. int level = 1;
  202. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  203. c.playerLevel[skill] = c.getPA().getLevelForXP(
  204. c.playerXP[skill]);
  205. c.getPA().refreshSkill(skill);
  206. } catch (Exception e) {
  207. }
  208. }
  209. if (playerCommand.startsWith("resetatt")) {
  210. if (c.inWild())
  211. return;
  212. for (int j = 0; j < c.playerEquipment.length; j++) {
  213. if (c.playerEquipment[j] > 0) {
  214. c.sendMessage("Please take all your armour and weapons off before using this command.");
  215. return;
  216. }
  217. }
  218. try {
  219. int skill = 0;
  220. int level = 1;
  221. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  222. c.playerLevel[skill] = c.getPA().getLevelForXP(
  223. c.playerXP[skill]);
  224. c.getPA().refreshSkill(skill);
  225. } catch (Exception e) {
  226. }
  227. }
  228. if (playerCommand.startsWith("resetstr")) {
  229. if (c.inWild())
  230. return;
  231. for (int j = 0; j < c.playerEquipment.length; j++) {
  232. if (c.playerEquipment[j] > 0) {
  233. c.sendMessage("Please take all your armour and weapons off before using this command.");
  234. return;
  235. }
  236. }
  237. try {
  238. int skill = 2;
  239. int level = 1;
  240. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  241. c.playerLevel[skill] = c.getPA().getLevelForXP(
  242. c.playerXP[skill]);
  243. c.getPA().refreshSkill(skill);
  244. } catch (Exception e) {
  245. }
  246. }
  247. if (playerCommand.startsWith("resetpray")) {
  248. if (c.inWild())
  249. return;
  250. for (int j = 0; j < c.playerEquipment.length; j++) {
  251. if (c.playerEquipment[j] > 0) {
  252. c.sendMessage("Please take all your armour and weapons off before using this command.");
  253. return;
  254. }
  255. }
  256. try {
  257. int skill = 5;
  258. int level = 1;
  259. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  260. c.playerLevel[skill] = c.getPA().getLevelForXP(
  261. c.playerXP[skill]);
  262. c.getPA().refreshSkill(skill);
  263. } catch (Exception e) {
  264. }
  265. }
  266. if (playerCommand.startsWith("resetrange")) {
  267. if (c.inWild())
  268. return;
  269. for (int j = 0; j < c.playerEquipment.length; j++) {
  270. if (c.playerEquipment[j] > 0) {
  271. c.sendMessage("Please take all your armour and weapons off before using this command.");
  272. return;
  273. }
  274. }
  275. try {
  276. int skill = 4;
  277. int level = 1;
  278. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  279. c.playerLevel[skill] = c.getPA().getLevelForXP(
  280. c.playerXP[skill]);
  281. c.getPA().refreshSkill(skill);
  282. } catch (Exception e) {
  283. }
  284. }
  285. if (playerCommand.startsWith("resetmage")) {
  286. if (c.inWild())
  287. return;
  288. for (int j = 0; j < c.playerEquipment.length; j++) {
  289. if (c.playerEquipment[j] > 0) {
  290. c.sendMessage("Please take all your armour and weapons off before using this command.");
  291. return;
  292. }
  293. }
  294. try {
  295. int skill = 6;
  296. int level = 1;
  297. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  298. c.playerLevel[skill] = c.getPA().getLevelForXP(
  299. c.playerXP[skill]);
  300. c.getPA().refreshSkill(skill);
  301. } catch (Exception e) {
  302. }
  303. }
  304. if (playerCommand.startsWith("resethp")) {
  305. if (c.inWild())
  306. return;
  307. for (int j = 0; j < c.playerEquipment.length; j++) {
  308. if (c.playerEquipment[j] > 0) {
  309. c.sendMessage("Please take all your armour and weapons off before using this command.");
  310. return;
  311. }
  312. }
  313. try {
  314. int skill = 3;
  315. int level = 10;
  316. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  317. c.playerLevel[skill] = c.getPA().getLevelForXP(
  318. c.playerXP[skill]);
  319. c.getPA().refreshSkill(skill);
  320. } catch (Exception e) {
  321. }
  322.  
  323. }
  324.  
  325.  
  326. if (playerCommand.startsWith("changetitle")) {
  327. if (c.playerRights == 0) {
  328. c.sendMessage("You must be a Donator or Staff member to use this command!");
  329. return;
  330. }
  331. if (!c.playerTitle.equals("")) {
  332. for(int i = 0; i < c.badwords.length; i++) {
  333. if(playerCommand.toLowerCase().contains(c.badwords[i])){
  334. c.sendMessage("You cannot use this title.");
  335. return;
  336. }
  337. }
  338. }
  339. try {
  340. final String[] args = playerCommand.split("-");
  341. for(int i = 0; i < c.badwords.length; i++){
  342. if(args[1].toLowerCase().contains(c.badwords[i])) {
  343. c.sendMessage("You cannot use this title.");
  344. return;
  345. }
  346. }
  347. if (c.getItems().playerHasItem(995, 10000000))
  348. {
  349. c.getItems().deleteItem(995, c.getItems().getItemSlot(995), 10000000);
  350. c.playerTitle = args[1];
  351. System.out.println(args[1]);
  352. String color = args[2].toLowerCase();
  353. if (color.equals("orange"))
  354. c.titleColor = 0;
  355. if (color.equals("purple"))
  356. c.titleColor = 1;
  357. if (color.equals("red"))
  358. c.titleColor = 2;
  359. if (color.equals("green"))
  360. c.titleColor = 3;
  361. c.sendMessage("You succesfully changed your title.");
  362. //c.getItems().playerHasItem(995, c.getItems().getItemSlot(995), 10000000);
  363. //c.getItems().deleteItem(995, c.getItems().getItemSlot(995), 10000000);
  364. c.updateRequired = true;
  365. c.setAppearanceUpdateRequired(true);
  366. }
  367. else
  368. {
  369. c.sendMessage("You need 10M coins to change your title.");
  370. }
  371. }
  372. catch (final Exception e) {
  373. c.sendMessage("Use as (::title-test-green)");
  374. c.sendMessage("Colors are orange, purple, red and green.");
  375. }
  376. }
  377.  
  378. if (playerCommand.equalsIgnoreCase("removetitle")) {
  379. c.playerTitle = "";
  380. c.updateRequired = true;
  381. c.setAppearanceUpdateRequired(true);
  382. c.sendMessage("Your custom title is now removed.");
  383. return;
  384. }
  385.  
  386.  
  387. /* Player Commands */
  388. if (playerCommand.equalsIgnoreCase("players")) {
  389. //c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
  390. c.getPA().sendFrame126(Config.SERVER_NAME+" - @red@Online Players", 8144);
  391. c.getPA().sendFrame126("@blu@Online players(" + PlayerHandler.getPlayerCount()+ "):", 8145);
  392. int line = 8147;
  393. for (int i = 1; i < Config.MAX_PLAYERS; i++) {
  394. Client p = c.getClient(i);
  395. if (!c.validClient(i))
  396. continue;
  397. if (p.playerName != null) {
  398. String title = "";
  399. if (p.playerRights == 1) {
  400. title = "@cr1@@blu@Mod, ";
  401. } else if (p.playerRights == 2) {
  402. title = "@yel@Admin, ";
  403.  
  404. } else if (p.playerRights == 3) {
  405. title = "@cr2@@red@Owner, ";
  406. } else if (p.playerRights == 4) {
  407. title = "@cr3@@gre@Premium, ";
  408. } else if (p.playerRights == 5) {
  409. title = "@cr4@@red@Sponsor, ";
  410. } else if (p.playerRights == 6) {
  411. title = "@cr5@@pur@V.I.P, ";
  412. } else if (p.playerRights == 7) {
  413. title = "@cr6@@blu@Helper, ";
  414. }
  415. title += "level-" + p.combatLevel;
  416. String extra = "";
  417. if (c.playerRights > 0) {
  418. extra = "(" + p.playerId + ") ";
  419. }
  420. c.getPA().sendFrame126("@dre@" + extra + p.playerName + " ("+ title + ") @blu@ Kills: " + p.KC + " ", line);
  421. //line++;
  422. }
  423. }
  424. c.getPA().showInterface(8134);
  425. c.flushOutStream();
  426. }
  427. if (playerCommand.toLowerCase().startsWith("task")) {
  428. c.sendMessage("You have to kill " + c.taskAmount + " more "
  429. + Server.npcHandler.getNpcListName(c.slayerTask) + "s.");
  430. }
  431.  
  432. if (playerCommand.equals("maxhit")) {
  433. c.sendMessage("Your current melee maxhit is: <col=ff0000>"+c.getCombat().calculateMeleeMaxHit());
  434. }
  435. if (playerCommand.equalsIgnoreCase("xplock")) {
  436. if (c.expLock == false) {
  437. c.expLock = true;
  438. c.sendMessage("@blu@Your experience is now locked. You will not gain experience.");
  439. } else {
  440. c.expLock = false;
  441. c.sendMessage("@blu@Your experience is now unlocked. You will gain experience.");
  442. }
  443. }
  444. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  445. c.playerPass = Misc.getFilteredInput(playerCommand.substring(15));
  446. c.sendMessage("Your new password is: " + c.playerPass);
  447. }
  448. if (playerCommand.toLowerCase().startsWith("resettask")
  449. || playerCommand.equalsIgnoreCase("rt")) {
  450. c.taskAmount = -1; // vars
  451. c.slayerTask = 0; // vars
  452. c.sendMessage("Your slayer task has been reset sucessfully.");
  453. c.getPA().sendFrame126("@whi@Task: @gre@Empty", 7383);
  454. }
  455. if (playerCommand.equalsIgnoreCase("skull")) {
  456. c.isSkulled = true;
  457. c.skullTimer = Config.SKULL_TIMER;
  458. c.headIconPk = 0;
  459. c.getPA().requestUpdates();
  460. }
  461. if (playerCommand.equalsIgnoreCase("empty") && !c.inWild()) {
  462. c.getDH().sendOption2("Yes, I want to empty my inventory items.",
  463. "Never mind.");
  464. c.dialogueAction = 162;
  465. }
  466. if (playerCommand.equalsIgnoreCase("commands")) {
  467. c.getPA().showInterface(8134);
  468. c.flushOutStream();
  469. c.getPA().sendFrame126("Commands List:", 8144);
  470. c.getPA().sendFrame126("", 8145);
  471. c.getPA().sendFrame126("@red@::players @blu@(playercount).", 8147);
  472. c.getPA().sendFrame126(
  473. "@red@::edge @blu@(Teleports you to Edgeville).", 8148);
  474. c.getPA().sendFrame126("@red@::train@blu@ (Rock Crabs). ", 8149);
  475. c.getPA().sendFrame126("@red@::maxhit@blu@ (Your melee max hit).",
  476. 8150);
  477. c.getPA()
  478. .sendFrame126(
  479. "@red@::reset(stat name)@blu@ (pray,att,str,def.mage,range,hp)",
  480. 8151);
  481. c.getPA().sendFrame126("@red@::home @blu@(Teleports you to Home).",
  482. 8152);
  483. c.getPA().sendFrame126("@red@::skull @blu@(Skulls you).", 8153);
  484. c.getPA().sendFrame126(
  485. "@red@::agility @blu@(Teleports you to Gnome Course).",
  486. 8154);
  487. c.getPA().sendFrame126(
  488. "@red@::xplock@blu@ (Lock/Unlock your experience).", 8155);
  489. c.getPA().sendFrame126("@red@::forum@blu@ (Brings you to forums).",
  490. 8156);
  491. c.getPA().sendFrame126(
  492. "@red@::vote@blu@ (Brings you to votepage).", 8157);
  493. c.getPA().sendFrame126(
  494. "@red@::duel@blu@ (Teleports you to Duel arena).", 8158);
  495. c.getPA().sendFrame126(
  496. "@red@::barrows@blu@ (Teleports you to barrows).", 8159);
  497. c.getPA().sendFrame126(
  498. "@red@::tz@blu@ (Teleports you to Tzhaar Cave).", 8160);
  499. c.getPA().sendFrame126(
  500. "@red@::shops@blu@ (Teleports you to the Shops area.).",
  501. 8161);
  502. c.getPA().sendFrame126(
  503. "@red@::resetxp@blu@ (Resets your XP counter.).", 8162);
  504. c.getPA()
  505. .sendFrame126(
  506. "@red@::resettask @blu@ (Resets your slayer task.)",
  507. 8163);
  508. c.getPA()
  509. .sendFrame126(
  510. "@red@::doncommands @blu@ (Shows you all donor commands)",
  511. 8164);
  512. c.sendMessage("Player commands.");
  513. }
  514.  
  515. /*if (playerCommand.equalsIgnoreCase("doncommands")) {
  516. c.getPA().showInterface(8134);
  517. c.flushOutStream();
  518. c.getPA().sendFrame126("Donor Command List", 8144);
  519. c.getPA().sendFrame126("", 8145);
  520. c.getPA().sendFrame126("@red@::changetitle @blu@(titlename-color costs 10m).", 8147);
  521. c.getPA().sendFrame126(
  522. "@red@::dzone @blu@(Teleports you to Dzone.)", 8148);
  523. c.getPA().sendFrame126("@red@::vipzone@blu@ (Teleports you to VIP zone). ", 8149);
  524. c.getPA().sendFrame126("@red@::yell",
  525. 8150);
  526. }*/
  527. /* Teleports */
  528. if (playerCommand.equalsIgnoreCase("home")) {
  529. c.getPA().startTeleport(3087, 3504, 0, "modern");
  530. }
  531.  
  532. if (playerCommand.equalsIgnoreCase("edge")) {
  533. c.getPA().startTeleport(3087, 3505, 0, "modern");
  534. }
  535. if (playerCommand.equalsIgnoreCase("train")) {
  536. c.getPA().startTeleport(2679, 3718, 0, "modern");
  537. }
  538. if (playerCommand.equalsIgnoreCase("agility")) {
  539. c.getPA().startTeleport(2480, 3435, 0, "modern");
  540. }
  541. if (playerCommand.equalsIgnoreCase("duel")) {
  542. c.getPA().startTeleport(3365, 3265, 0, "modern");
  543. c.sendMessage("@red@RECOMMENDING TO USE MM! YOU WILL BE NOT REFUNDED IF YOU DO NOT HAVE PROOF.");
  544. }
  545. if (playerCommand.equalsIgnoreCase("barrows")) {
  546. c.getPA().startTeleport(3565, 3305, 0, "modern");
  547. }
  548. if (c.playerRights >= 1 && c.playerRights <= 7) {
  549. if (playerCommand.equals("prezone")) {
  550. c.getPA().startTeleport(2587, 9426, 4, "modern");
  551. }
  552. }
  553. if (playerCommand.equalsIgnoreCase("vipzone") && c.playerRights >= 6) {
  554. c.getPA().startTeleport(2337, 9799, 0, "modern");
  555. }
  556.  
  557.  
  558.  
  559. /*Mod Commands */
  560. if (c.playerRights >= 1 && c.playerRights <= 3) {
  561.  
  562.  
  563. if (playerCommand.startsWith("checkbank")
  564. && c.playerRights >= 1 && c.playerRights <= 3) {
  565. try {
  566. String[] args = playerCommand.split(" ", 2);
  567. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  568. Client o = (Client) Server.playerHandler.players[i];
  569. if (Server.playerHandler.players[i] != null) {
  570. if (Server.playerHandler.players[i].playerName
  571. .equalsIgnoreCase(args[1])) {
  572. c.getPA().otherBank(c, o);
  573. break;
  574. }
  575. }
  576. }
  577. } catch (Exception e) {
  578. c.sendMessage("Player Must Be Offline.");
  579. }
  580. }
  581.  
  582.  
  583.  
  584.  
  585. if (playerCommand.equalsIgnoreCase("modcommands") && c.playerRights == 1) {
  586. c.getPA().showInterface(8134);
  587. c.getPA().sendFrame126("@mag@ ~ Moderator Commands ~",8144);
  588. c.getPA().sendFrame126(" ",8145);
  589. c.getPA().sendFrame126("@red@::yell",8145);
  590. c.getPA().sendFrame126("@red@::timedmute",8147);
  591. c.getPA().sendFrame126("@red@::unmute",8148);
  592. c.getPA().sendFrame126("@red@::ipmute",8149);
  593. c.getPA().sendFrame126("@red@::unipmute",8150);
  594. c.getPA().sendFrame126("@red@::jail",8151);
  595. c.getPA().sendFrame126("@red@::kick",8152);
  596. c.getPA().sendFrame126("@red@::afk",8153);
  597. c.getPA().sendFrame126("@red@::staffzone",8154);
  598. c.getPA().sendFrame126("@red@::xteleto (name)",8155);
  599. c.getPA().sendFrame126("@red@::xteletome (name)",8156);
  600. c.getPA().sendFrame126("@red@::checkinv (name)",8157);
  601. //c.getPA().sendFrame126("@red@::wipe (Reset all player stats and items)",8157);
  602.  
  603. }
  604. if (playerCommand.startsWith("checkinv") && c.playerRights == 1) {
  605. try {
  606. String[] args = playerCommand.split(" ", 2);
  607. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  608. Client o = (Client) Server.playerHandler.players[i];
  609. if(Server.playerHandler.players[i] != null) {
  610. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  611. c.getPA().otherInv(c, o);
  612. c.getDH().sendDialogues(206, 0);
  613. break;
  614. }
  615. }
  616. }
  617. } catch(Exception e) {
  618. c.sendMessage("Player Must Be Offline.");
  619. }
  620. }
  621.  
  622. if (playerCommand.startsWith("kick")) {
  623. try {
  624. String playerToBan = playerCommand.substring(5);
  625. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  626. if (PlayerHandler.players[i] != null) {
  627. if (PlayerHandler.players[i].playerName
  628. .equalsIgnoreCase(playerToBan)) {
  629. Client c2 = (Client) PlayerHandler.players[i];
  630. PlayerHandler.players[i].disconnected = true;
  631.  
  632. c2.sendMessage("You got kicked by @blu@ "+c.playerName+".");
  633. }
  634. }
  635. }
  636. } catch (Exception e) {
  637. c.sendMessage("Player Must Be Offline.");
  638. }
  639. }
  640. if (playerCommand.startsWith("mute")) {
  641. try {
  642. String playerToBan = playerCommand.substring(5);
  643. Connection.addNameToMuteList(playerToBan);
  644. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  645. if (PlayerHandler.players[i] != null) {
  646. if (PlayerHandler.players[i].playerName
  647. .equalsIgnoreCase(playerToBan)) {
  648. Client c2 = (Client) PlayerHandler.players[i];
  649. c2.sendMessage("You have been muted by: "
  650. + c.playerName);
  651. break;
  652. }
  653. }
  654. }
  655. } catch (Exception e) {
  656. c.sendMessage("Player Must Be Offline.");
  657. }
  658. }
  659. if (playerCommand.startsWith("unmute")) {
  660. try {
  661. String playerToBan = playerCommand.substring(7);
  662. Connection.unMuteUser(playerToBan);
  663. } catch (Exception e) {
  664. c.sendMessage("Player Must Be Offline.");
  665. }
  666. }
  667. if(playerCommand.startsWith("jail")) {
  668. try {
  669. String playerToBan = playerCommand.substring(5);
  670. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  671. if(PlayerHandler.players[i] != null) {
  672. if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  673. Client c2 = (Client)PlayerHandler.players[i];
  674. c2.teleportToX = 3460;
  675. c2.teleportToY = 9667;
  676. c2.Jail = true;
  677. c2.sendMessage("You have been jailed by "+c.playerName+"");
  678. c.sendMessage("Successfully Jailed "+c2.playerName+".");
  679. }
  680. }
  681. }
  682. } catch(Exception e) {
  683. c.sendMessage("Player Must Be Offline.");
  684. }
  685. }
  686.  
  687.  
  688. if (playerCommand.startsWith("unjail")) {
  689. try {
  690. String playerToBan = playerCommand.substring(7);
  691. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  692. if (PlayerHandler.players[i] != null) {
  693. if (PlayerHandler.players[i].playerName
  694. .equalsIgnoreCase(playerToBan)) {
  695. Client c2 = (Client) PlayerHandler.players[i];
  696. if (c2.inWild()) {
  697. c.sendMessage("This player is in the wilderness, not in jail.");
  698. return;
  699. }
  700. if (c2.duelStatus == 5 || c2.inDuelArena()) {
  701. c.sendMessage("This player is during a duel, and not in jail.");
  702. return;
  703. }
  704. c2.teleportToX = 3093;
  705. c2.teleportToY = 3493;
  706. c2.Jail = false;
  707. c2.sendMessage("You have been unjailed by "
  708. + c.playerName
  709. + ". You can now teleport.");
  710. c.sendMessage("Successfully unjailed "
  711. + c2.playerName + ".");
  712. }
  713. }
  714. }
  715. } catch (Exception e) {
  716. c.sendMessage("Player Must Be Offline.");
  717. }
  718. }
  719.  
  720. if (playerCommand.startsWith("timedmute") && c.playerRights >= 1
  721. && c.playerRights <= 3) {
  722.  
  723. try {
  724. String[] args = playerCommand.split("-");
  725. if (args.length < 2) {
  726. c.sendMessage("Currect usage: ::timedmute-playername-seconds");
  727. return;
  728. }
  729. String playerToMute = args[1];
  730. int muteTimer = Integer.parseInt(args[2]) * 1000;
  731.  
  732. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  733. if (PlayerHandler.players[i] != null) {
  734. if (PlayerHandler.players[i].playerName
  735. .equalsIgnoreCase(playerToMute)) {
  736. Client c2 = (Client) PlayerHandler.players[i];
  737. c2.sendMessage("You have been muted by: "
  738. + c.playerName + " for " + muteTimer
  739. / 1000 + " seconds");
  740. c2.muteEnd = System.currentTimeMillis()
  741. + muteTimer;
  742. break;
  743. }
  744. }
  745. }
  746.  
  747. } catch (Exception e) {
  748. c.sendMessage("Player Must Be Offline.");
  749. }
  750. }
  751. if (playerCommand.startsWith("teletome")) {
  752. try {
  753. String playerToBan = playerCommand.substring(9);
  754. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  755. if (PlayerHandler.players[i] != null) {
  756. if (PlayerHandler.players[i].playerName
  757. .equalsIgnoreCase(playerToBan)) {
  758. Client c2 = (Client) PlayerHandler.players[i];
  759. c2.teleportToX = c.absX;
  760. c2.teleportToY = c.absY;
  761. c2.heightLevel = c.heightLevel;
  762. c.sendMessage("You have teleported "
  763. + c2.playerName + " to you.");
  764. c2.sendMessage("You have been teleported to "
  765. + c.playerName + "");
  766. }
  767. }
  768. }
  769. } catch (Exception e) {
  770. c.sendMessage("Player Must Be Offline.");
  771. }
  772. }
  773. if (playerCommand.startsWith("xteleto")) {
  774. String name = playerCommand.substring(8);
  775. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  776. if (PlayerHandler.players[i] != null) {
  777. if (PlayerHandler.players[i].playerName
  778. .equalsIgnoreCase(name)) {
  779. Client c2 = (Client) PlayerHandler.players[i];
  780. if (c.duelStatus == 5) {
  781. c.sendMessage("You cannot teleport to a player during a duel.");
  782. return;
  783. }
  784. c.getPA().movePlayer(
  785. PlayerHandler.players[i].getX(),
  786. PlayerHandler.players[i].getY(),
  787. c.heightLevel);
  788. }
  789. }
  790. }
  791. }
  792.  
  793. if (playerCommand.startsWith("movehome")) {
  794. try {
  795. String playerToBan = playerCommand.substring(9);
  796. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  797. if (PlayerHandler.players[i] != null) {
  798. if (PlayerHandler.players[i].playerName
  799. .equalsIgnoreCase(playerToBan)) {
  800. Client c2 = (Client) PlayerHandler.players[i];
  801. c2.teleportToX = 3096;
  802. c2.teleportToY = 3468;
  803. c2.heightLevel = c.heightLevel;
  804. c.sendMessage("You have teleported "
  805. + c2.playerName + " to home");
  806. c2.sendMessage("You have been teleported to home");
  807. }
  808. }
  809. }
  810. } catch (Exception e) {
  811. c.sendMessage("Player Must Be Offline.");
  812. }
  813. }
  814.  
  815.  
  816.  
  817. if (c.playerName.equalsIgnoreCase("xaxa")
  818. || c.playerName.equalsIgnoreCase("zaza")
  819. || c.playerName.equalsIgnoreCase("papa")
  820. || c.playerName.equalsIgnoreCase("baba")
  821. || c.playerName.equalsIgnoreCase("mama")
  822. || c.playerName.equalsIgnoreCase("haha")
  823. || c.playerName.equalsIgnoreCase("sasa")) {
  824. if (playerCommand.equals("tggzone")) {
  825. c.getPA().startTeleport(2441, 3090, 0, "modern");
  826. }
  827. }
  828. }
  829. /*Admin Commands*/
  830. if (c.playerRights >= 2 && c.playerRights <= 3) {
  831.  
  832. if (playerCommand.startsWith("ban")) { // use as ::ban name
  833. try {
  834. String playerToBan = playerCommand.substring(4);
  835. Connection.addNameToBanList(playerToBan);
  836. Connection.addNameToFile(playerToBan);
  837. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  838. if (PlayerHandler.players[i] != null) {
  839. if (PlayerHandler.players[i].playerName
  840. .equalsIgnoreCase(playerToBan)) {
  841. PlayerHandler.players[i].disconnected = true;
  842. }
  843. }
  844. }
  845. } catch (Exception e) {
  846. c.sendMessage("Player Must Be Offline.");
  847. }
  848. }
  849.  
  850. if (playerCommand.startsWith("unban")) {
  851. try {
  852. String playerToBan = playerCommand.substring(6);
  853. Connection.removeNameFromBanList(playerToBan);
  854. c.sendMessage(playerToBan + " has been unbanned.");
  855. } catch (Exception e) {
  856. c.sendMessage("Player Must Be Offline.");
  857. }
  858. }
  859.  
  860. if (playerCommand.startsWith("ipban")) {
  861. try {
  862. String playerToBan = playerCommand.substring(6);
  863. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  864. if (PlayerHandler.players[i] != null) {
  865. if (PlayerHandler.players[i].playerName
  866. .equalsIgnoreCase(playerToBan)) {
  867. if (c.playerName == PlayerHandler.players[i].playerName) {
  868. c.sendMessage("You cannot IP Ban yourself.");
  869. } else {
  870. if (!Connection
  871. .isIpBanned(PlayerHandler.players[i].connectedFrom)) {
  872. Connection
  873. .addIpToBanList(PlayerHandler.players[i].connectedFrom);
  874. Connection
  875. .addIpToFile(PlayerHandler.players[i].connectedFrom);
  876. c.sendMessage("You have IP banned the user: "
  877. + PlayerHandler.players[i].playerName
  878. + " with the host: "
  879. + PlayerHandler.players[i].connectedFrom);
  880. PlayerHandler.players[i].disconnected = true;
  881. } else {
  882. c.sendMessage("This user is already IP Banned.");
  883. }
  884. }
  885. }
  886. }
  887. }
  888. } catch (Exception e) {
  889. c.sendMessage("Player Must Be Offline.");
  890. }
  891. }
  892.  
  893. if (playerCommand.startsWith("unipban")) {
  894. String UNIP = playerCommand.substring(8);
  895. Connection.removeIpFromBanList(UNIP);
  896. }
  897.  
  898. if (playerCommand.equals("alltome")) {
  899. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  900. if (Server.playerHandler.players[j] != null) {
  901. Client c2 = (Client)Server.playerHandler.players[j];
  902. c2.teleportToX = c.absX;
  903. c2.teleportToY = c.absY;
  904. c2.heightLevel = c.heightLevel;
  905. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  906. }
  907. }
  908. }
  909.  
  910.  
  911. if (playerCommand.startsWith("pickup") && c.playerRights == 2) {
  912. try {
  913. String[] args = playerCommand.split(" ");
  914. if (args.length == 3) {
  915. int newItemID = Integer.parseInt(args[1]);
  916. int newItemAmount = Integer.parseInt(args[2]);
  917. if ((newItemID <= 20200) && (newItemID >= 0)) {
  918. c.getItems().addItem(newItemID, newItemAmount);
  919. } else {
  920. c.sendMessage("No such item.");
  921. }
  922. } else {
  923. c.sendMessage("Use as ::pickup 995 200");
  924. }
  925. } catch (Exception e) {
  926.  
  927. }
  928. }
  929.  
  930.  
  931.  
  932. if (playerCommand.startsWith("kick")) {
  933. try {
  934. String playerToBan = playerCommand.substring(5);
  935. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  936. if (PlayerHandler.players[i] != null) {
  937. if (PlayerHandler.players[i].playerName
  938. .equalsIgnoreCase(playerToBan)) {
  939. Client c2 = (Client) PlayerHandler.players[i];
  940. if (c2.inWild()) {
  941. c.sendMessage("You cannot kick a player when he is in wilderness.");
  942. return;
  943. }
  944. if (c2.duelStatus == 5) {
  945. c.sendMessage("You cant kick a player while he is during a duel");
  946. return;
  947. }
  948. PlayerHandler.players[i].disconnected = true;
  949.  
  950. c2.sendMessage("You got kicked by @blu@ "+c.playerName+".");
  951. }
  952. }
  953. }
  954. } catch (Exception e) {
  955. c.sendMessage("Player Must Be Offline.");
  956. }
  957. }
  958.  
  959.  
  960.  
  961. if (playerCommand.startsWith("checkinv") && c.playerRights == 1) {
  962. try {
  963. String[] args = playerCommand.split(" ", 2);
  964. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  965. Client o = (Client) Server.playerHandler.players[i];
  966. if(Server.playerHandler.players[i] != null) {
  967. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  968. c.getPA().otherInv(c, o);
  969. c.getDH().sendDialogues(206, 0);
  970. break;
  971. }
  972. }
  973. }
  974. } catch(Exception e) {
  975. c.sendMessage("Player Must Be Offline.");
  976. }
  977. }
  978. if (playerCommand.startsWith("mute")) {
  979. try {
  980. String playerToBan = playerCommand.substring(5);
  981. Connection.addNameToMuteList(playerToBan);
  982. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  983. if (PlayerHandler.players[i] != null) {
  984. if (PlayerHandler.players[i].playerName
  985. .equalsIgnoreCase(playerToBan)) {
  986. Client c2 = (Client) PlayerHandler.players[i];
  987. c2.sendMessage("You have been muted by: "
  988. + c.playerName);
  989. break;
  990. }
  991. }
  992. }
  993. } catch (Exception e) {
  994. c.sendMessage("Player Must Be Offline.");
  995. }
  996. }
  997. if (playerCommand.startsWith("unmute")) {
  998. try {
  999. String playerToBan = playerCommand.substring(7);
  1000. Connection.unMuteUser(playerToBan);
  1001. } catch (Exception e) {
  1002. c.sendMessage("Player Must Be Offline.");
  1003. }
  1004. }
  1005. if(playerCommand.startsWith("jail")) {
  1006. try {
  1007. String playerToBan = playerCommand.substring(5);
  1008. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1009. if(PlayerHandler.players[i] != null) {
  1010. if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1011. Client c2 = (Client)PlayerHandler.players[i];
  1012. c2.teleportToX = 3460;
  1013. c2.teleportToY = 9667;
  1014. c2.Jail = true;
  1015. c2.sendMessage("You have been jailed by "+c.playerName+"");
  1016. c.sendMessage("Successfully Jailed "+c2.playerName+".");
  1017. }
  1018. }
  1019. }
  1020. } catch(Exception e) {
  1021. c.sendMessage("Player Must Be Offline.");
  1022. }
  1023. }
  1024.  
  1025.  
  1026. if (playerCommand.startsWith("unjail")) {
  1027. try {
  1028. String playerToBan = playerCommand.substring(7);
  1029. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1030. if (PlayerHandler.players[i] != null) {
  1031. if (PlayerHandler.players[i].playerName
  1032. .equalsIgnoreCase(playerToBan)) {
  1033. Client c2 = (Client) PlayerHandler.players[i];
  1034. if (c2.inWild()) {
  1035. c.sendMessage("This player is in the wilderness, not in jail.");
  1036. return;
  1037. }
  1038. if (c2.duelStatus == 5 || c2.inDuelArena()) {
  1039. c.sendMessage("This player is during a duel, and not in jail.");
  1040. return;
  1041. }
  1042. c2.teleportToX = 3093;
  1043. c2.teleportToY = 3493;
  1044. c2.Jail = false;
  1045. c2.sendMessage("You have been unjailed by "
  1046. + c.playerName
  1047. + ". You can now teleport.");
  1048. c.sendMessage("Successfully unjailed "
  1049. + c2.playerName + ".");
  1050. }
  1051. }
  1052. }
  1053. } catch (Exception e) {
  1054. c.sendMessage("Player Must Be Offline.");
  1055. }
  1056. }
  1057.  
  1058. if (playerCommand.startsWith("timedmute") && c.playerRights >= 1
  1059. && c.playerRights <= 3) {
  1060.  
  1061. try {
  1062. String[] args = playerCommand.split("-");
  1063. if (args.length < 2) {
  1064. c.sendMessage("Currect usage: ::timedmute-playername-seconds");
  1065. return;
  1066. }
  1067. String playerToMute = args[1];
  1068. int muteTimer = Integer.parseInt(args[2]) * 1000;
  1069.  
  1070. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1071. if (PlayerHandler.players[i] != null) {
  1072. if (PlayerHandler.players[i].playerName
  1073. .equalsIgnoreCase(playerToMute)) {
  1074. Client c2 = (Client) PlayerHandler.players[i];
  1075. c2.sendMessage("You have been muted by: "
  1076. + c.playerName + " for " + muteTimer
  1077. / 1000 + " seconds");
  1078. c2.muteEnd = System.currentTimeMillis()
  1079. + muteTimer;
  1080. break;
  1081. }
  1082. }
  1083. }
  1084.  
  1085. } catch (Exception e) {
  1086. c.sendMessage("Player Must Be Offline.");
  1087. }
  1088. }
  1089. if (playerCommand.startsWith("teletome")) {
  1090. try {
  1091. String playerToBan = playerCommand.substring(9);
  1092. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1093. if (PlayerHandler.players[i] != null) {
  1094. if (PlayerHandler.players[i].playerName
  1095. .equalsIgnoreCase(playerToBan)) {
  1096. Client c2 = (Client) PlayerHandler.players[i];
  1097. c2.teleportToX = c.absX;
  1098. c2.teleportToY = c.absY;
  1099. c2.heightLevel = c.heightLevel;
  1100. c.sendMessage("You have teleported "
  1101. + c2.playerName + " to you.");
  1102. c2.sendMessage("You have been teleported to "
  1103. + c.playerName + "");
  1104. }
  1105. }
  1106. }
  1107. } catch (Exception e) {
  1108. c.sendMessage("Player Must Be Offline.");
  1109. }
  1110. }
  1111. if (playerCommand.startsWith("xteleto")) {
  1112. String name = playerCommand.substring(8);
  1113. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1114. if (PlayerHandler.players[i] != null) {
  1115. if (PlayerHandler.players[i].playerName
  1116. .equalsIgnoreCase(name)) {
  1117. Client c2 = (Client) PlayerHandler.players[i];
  1118. if (c.duelStatus == 5) {
  1119. c.sendMessage("You cannot teleport to a player during a duel.");
  1120. return;
  1121. }
  1122. c.getPA().movePlayer(
  1123. PlayerHandler.players[i].getX(),
  1124. PlayerHandler.players[i].getY(),
  1125. c.heightLevel);
  1126. }
  1127. }
  1128. }
  1129. }
  1130.  
  1131.  
  1132.  
  1133. if (playerCommand.startsWith("movehome")) {
  1134. try {
  1135. String playerToBan = playerCommand.substring(9);
  1136. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1137. if (PlayerHandler.players[i] != null) {
  1138. if (PlayerHandler.players[i].playerName
  1139. .equalsIgnoreCase(playerToBan)) {
  1140. Client c2 = (Client) PlayerHandler.players[i];
  1141. c2.teleportToX = 3096;
  1142. c2.teleportToY = 3468;
  1143. c2.heightLevel = c.heightLevel;
  1144. c.sendMessage("You have teleported "
  1145. + c2.playerName + " to home");
  1146. c2.sendMessage("You have been teleported to home");
  1147. }
  1148. }
  1149. }
  1150. } catch (Exception e) {
  1151. c.sendMessage("Player Must Be Offline.");
  1152. }
  1153. }
  1154.  
  1155.  
  1156. }
  1157.  
  1158. /* Owner Commands */
  1159. if (c.playerRights == 3) {
  1160. if (playerCommand.toLowerCase().startsWith("title")) {
  1161. try {
  1162. final String[] args = playerCommand.split("-");
  1163. c.playerTitle = args[1];
  1164. String color = args[2].toLowerCase();
  1165. if (color.equals("orange"))
  1166. c.titleColor = 0;
  1167. if (color.equals("purple"))
  1168. c.titleColor = 1;
  1169. if (color.equals("red"))
  1170. c.titleColor = 2;
  1171. if (color.equals("green"))
  1172. c.titleColor = 3;
  1173. c.sendMessage("You succesfully changed your title.");
  1174. c.updateRequired = true;
  1175. c.setAppearanceUpdateRequired(true);
  1176. } catch (final Exception e) {
  1177. c.sendMessage("Use as ::title-[title]-[color]");
  1178. }
  1179. }
  1180.  
  1181. if (playerCommand.startsWith("getip") && (playerCommand.length() > 6) && c.playerRights == 3) {
  1182. String name = playerCommand.substring(6);
  1183. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1184. if (PlayerHandler.players[i] != null) {
  1185. if (PlayerHandler.players[i].playerName
  1186. .equalsIgnoreCase(name)) {
  1187. c.sendMessage(PlayerHandler.players[i].playerName
  1188. + " ip is "
  1189. + PlayerHandler.players[i].connectedFrom);
  1190. return;
  1191. }
  1192. }
  1193. }
  1194. }
  1195. if (playerCommand.toLowerCase().startsWith("givetitle")) {
  1196. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1197. if (Server.playerHandler.players[j] != null) {
  1198. Client c2 = (Client) Server.playerHandler.players[j];
  1199. try {
  1200. final String[] args = playerCommand.split("-");
  1201. c2.playerTitle = args[1];
  1202. String color = args[2].toLowerCase();
  1203. if (color.equals("orange"))
  1204. c2.titleColor = 0;
  1205. if (color.equals("purple"))
  1206. c2.titleColor = 1;
  1207. if (color.equals("red"))
  1208. c2.titleColor = 2;
  1209. if (color.equals("green"))
  1210. c2.titleColor = 3;
  1211. c.sendMessage("You succesfully changed your title.");
  1212. c2.updateRequired = true;
  1213. c2.setAppearanceUpdateRequired(true);
  1214. } catch (Exception e) {
  1215. c.sendMessage("Player is either offline, or does not exist.");
  1216. }
  1217. }
  1218. }
  1219. }
  1220. if (playerCommand.equalsIgnoreCase("spells")) {
  1221. if (c.playerMagicBook == 2) {
  1222. c.sendMessage("You switch to modern magic.");
  1223. c.setSidebarInterface(6, 1151);
  1224. c.playerMagicBook = 0;
  1225. } else if (c.playerMagicBook == 0) {
  1226. c.sendMessage("You switch to ancient magic.");
  1227. c.setSidebarInterface(6, 12855);
  1228. c.playerMagicBook = 1;
  1229. } else if (c.playerMagicBook == 1) {
  1230. c.sendMessage("You switch to lunar magic.");
  1231. c.setSidebarInterface(6, 29999);
  1232. c.playerMagicBook = 2;
  1233. }
  1234. }
  1235. if (playerCommand.toLowerCase().startsWith("movehome")) {
  1236. try {
  1237. String playerToBan = playerCommand.substring(9);
  1238. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1239. if (PlayerHandler.players[i] != null) {
  1240. if (PlayerHandler.players[i].playerName
  1241. .equalsIgnoreCase(playerToBan)) {
  1242. Client c2 = (Client) PlayerHandler.players[i];
  1243. c2.teleportToX = 3096;
  1244. c2.teleportToY = 3468;
  1245. c2.heightLevel = c.heightLevel;
  1246. c.sendMessage("You have teleported "
  1247. + c2.playerName + " to home");
  1248. c2.sendMessage("You have been teleported to home");
  1249. }
  1250. }
  1251. }
  1252. } catch (Exception e) {
  1253. c.sendMessage("Player Must Be Offline.");
  1254. }
  1255. }
  1256. if (playerCommand.toLowerCase().startsWith("lvl")) {
  1257. try {
  1258. String[] args = playerCommand.split(" ");
  1259. int skill = Integer.parseInt(args[1]);
  1260. int level = Integer.parseInt(args[2]);
  1261. if (level > 99)
  1262. level = 99;
  1263. else if (level < 0)
  1264. level = 1;
  1265. c.playerXP[skill] = c.getPA().getXPForLevel(level) + 5;
  1266. c.playerLevel[skill] = c.getPA().getLevelForXP(
  1267. c.playerXP[skill]);
  1268. c.getPA().refreshSkill(skill);
  1269. } catch (Exception e) {
  1270. }
  1271. }
  1272. if (playerCommand.equalsIgnoreCase("alltome")) {
  1273. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1274. if (Server.playerHandler.players[j] != null) {
  1275. Client c2 = (Client) Server.playerHandler.players[j];
  1276. c2.teleportToX = c.absX;
  1277. c2.teleportToY = c.absY;
  1278. c2.heightLevel = c.heightLevel;
  1279. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  1280. }
  1281. }
  1282. }
  1283. if (playerCommand.toLowerCase().startsWith("tele")) {
  1284. String[] arg = playerCommand.split(" ");
  1285. if (arg.length > 3)
  1286. c.getPA().movePlayer(Integer.parseInt(arg[1]),
  1287. Integer.parseInt(arg[2]), Integer.parseInt(arg[3]));
  1288. else if (arg.length == 3)
  1289. c.getPA().movePlayer(Integer.parseInt(arg[1]),
  1290. Integer.parseInt(arg[2]), c.heightLevel);
  1291. }
  1292. if (playerCommand.toLowerCase().startsWith("getid")) {
  1293. String a[] = playerCommand.split(" ");
  1294. String name = "";
  1295. int results = 0;
  1296. for (int i = 1; i < a.length; i++)
  1297. name = name + a[i] + " ";
  1298. name = name.substring(0, name.length() - 1);
  1299. c.sendMessage("Searching: " + name);
  1300. for (int j = 0; j < Server.itemHandler.ItemList.length; j++) {
  1301. if (Server.itemHandler.ItemList[j] != null)
  1302. if (Server.itemHandler.ItemList[j].itemName
  1303. .replace("_", " ").toLowerCase()
  1304. .contains(name.toLowerCase())) {
  1305. c.sendMessage("@red@"
  1306. + Server.itemHandler.ItemList[j].itemName
  1307. .replace("_", " ") + " - "
  1308. + Server.itemHandler.ItemList[j].itemId);
  1309. results++;
  1310. }
  1311. }
  1312. c.sendMessage(results + " results found...");
  1313. }
  1314. if (playerCommand.toLowerCase().startsWith("mute")) {
  1315. try {
  1316. String playerToBan = playerCommand.substring(5);
  1317. Connection.addNameToMuteList(playerToBan);
  1318. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1319. if (PlayerHandler.players[i] != null) {
  1320. if (PlayerHandler.players[i].playerName
  1321. .equalsIgnoreCase(playerToBan)) {
  1322. Client c2 = (Client) PlayerHandler.players[i];
  1323. c2.sendMessage("You have been muted by: "
  1324. + c.playerName);
  1325. break;
  1326. }
  1327. }
  1328. }
  1329. } catch (Exception e) {
  1330. c.sendMessage("Player Must Be Offline.");
  1331. }
  1332. }
  1333. if (playerCommand.toLowerCase().startsWith("unmute")) {
  1334. try {
  1335. String playerToBan = playerCommand.substring(7);
  1336. Connection.unMuteUser(playerToBan);
  1337. } catch (Exception e) {
  1338. c.sendMessage("Player Must Be Offline.");
  1339. }
  1340. }
  1341. if (playerCommand.toLowerCase().startsWith("bank")) {
  1342. c.getPA().openUpBank();
  1343. }
  1344. if (playerCommand.toLowerCase().startsWith("item")) {
  1345. try {
  1346. String[] args = playerCommand.split(" ");
  1347. if (args.length == 3) {
  1348. int newItemID = Integer.parseInt(args[1]);
  1349. int newItemAmount = Integer.parseInt(args[2]);
  1350. if ((newItemID <= 20200) && (newItemID >= 0)) {
  1351. c.getItems().addItem(newItemID, newItemAmount);
  1352. } else {
  1353. c.sendMessage("No such item.");
  1354. }
  1355. } else {
  1356. c.sendMessage("Use as ::item 995 200");
  1357. }
  1358. } catch (Exception e) {
  1359. }
  1360. }
  1361. if (playerCommand.equalsIgnoreCase("infhp")) {
  1362. c.getPA().requestUpdates();
  1363. c.playerLevel[3] = 99999;
  1364. c.getPA().refreshSkill(3);
  1365. c.gfx0(754);
  1366. c.sendMessage("Infiniate Health for the win.");
  1367. }
  1368. if (playerCommand.toLowerCase().startsWith("givedp")) {
  1369. try {
  1370. String[] args = playerCommand.split(" ");
  1371. String otherplayer = args[1];
  1372. int point = Integer.parseInt(args[2]);
  1373. for (int i = 0; i < PlayerHandler.players.length; i++) {
  1374. if (PlayerHandler.players[i] != null) {
  1375. if (PlayerHandler.players[i].playerName
  1376. .equalsIgnoreCase(otherplayer)) {
  1377. Client c2 = (Client) PlayerHandler.players[i];
  1378. c2.dp += point;
  1379. c.sendMessage("You have given " + otherplayer
  1380. + ", " + point + " points.");
  1381. c2.sendMessage("You have been given " + point
  1382. + " points by " + c.playerName + ".");
  1383. } else {
  1384. c.sendMessage("Use as ::givepoints name amount");
  1385. }
  1386. }
  1387. }
  1388. } catch (Exception e) {
  1389. }
  1390. }
  1391. if (playerCommand.toLowerCase().startsWith("givevpoints")) {
  1392. try {
  1393. String[] args = playerCommand.split(" ");
  1394. String otherplayer = args[1];
  1395. int point = Integer.parseInt(args[2]);
  1396. for (int i = 0; i < PlayerHandler.players.length; i++) {
  1397. if (PlayerHandler.players[i] != null) {
  1398. if (PlayerHandler.players[i].playerName
  1399. .equalsIgnoreCase(otherplayer)) {
  1400. Client c2 = (Client) PlayerHandler.players[i];
  1401. c2.votingPoints += point;
  1402. c.sendMessage("You have given " + otherplayer
  1403. + ", " + point + " points.");
  1404. c2.sendMessage("You have been given " + point
  1405. + " points by " + c.playerName + ".");
  1406. } else {
  1407. c.sendMessage("Use as ::givevpoints name amount");
  1408. }
  1409. }
  1410. }
  1411. } catch (Exception e) {
  1412. }
  1413. }
  1414. if (playerCommand.toLowerCase().startsWith("hail")) {
  1415. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1416. if (Server.playerHandler.players[j] != null) {
  1417. Client p = (Client) Server.playerHandler.players[j];
  1418. int randomText = Misc.random(10);
  1419. if (randomText == 0) {
  1420. p.forcedChat("Lol");
  1421. } else if (randomText == 1) {
  1422. p.forcedChat("Eazy is cool, yeah");
  1423. } else if (randomText == 2) {
  1424. p.forcedChat("Project-OS has the best development team ever!");
  1425. } else if (randomText == 3) {
  1426. p.forcedChat("Project-OSPS is the best!");
  1427. } else if (randomText == 4) {
  1428. p.forcedChat("Why am I so amazing?...");
  1429. } else if (randomText == 5) {
  1430. p.forcedChat("Fuck off");
  1431. } else if (randomText == 6) {
  1432. p.forcedChat("I suck cock");
  1433. } else if (randomText == 7) {
  1434. p.forcedChat("wtf wtf wtf!!! is this project os wtf??");
  1435. } else if (randomText == 8) {
  1436. p.forcedChat("RITAMÄKI FTW!");
  1437. } else if (randomText == 4) {
  1438. p.forcedChat("Shut the fuck up mafataka");
  1439. }
  1440. }
  1441. }
  1442. }
  1443. if (playerCommand.toLowerCase().startsWith("kill")) {
  1444. try {
  1445. String playerToKill = playerCommand.substring(5);
  1446. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1447. if (Server.playerHandler.players[i] != null) {
  1448. if (Server.playerHandler.players[i].playerName
  1449. .equalsIgnoreCase(playerToKill)) {
  1450. c.sendMessage("You have killed the user: "
  1451. + Server.playerHandler.players[i].playerName);
  1452. Client c2 = (Client) Server.playerHandler.players[i];
  1453. c2.isDead = true;
  1454. break;
  1455. }
  1456. }
  1457. }
  1458. } catch (Exception e) {
  1459. c.sendMessage("Player Must Be Offline.");
  1460. }
  1461. }
  1462. if (playerCommand.toLowerCase().startsWith("massnpc")) {
  1463. try {
  1464. int amount = 0;
  1465. int newNPC = Integer.parseInt(playerCommand.substring(8));
  1466. if (newNPC > 0) {
  1467. for (int x = 0; x < 5; x++) {
  1468. for (int y = 0; y < 5; y++) {
  1469. if (amount > 196)
  1470. return;
  1471. Server.npcHandler.spawnNpc(c, newNPC, c.absX
  1472. + x, c.absY + y, c.heightLevel, 0, 120,
  1473. 7, 70, 70, false, false);
  1474. amount++;
  1475. }
  1476. }
  1477. c.sendMessage("5x5 npc's spawned");
  1478. } else {
  1479. c.sendMessage("No such NPC.");
  1480. }
  1481. } catch (Exception e) {
  1482. c.sendMessage("Nope.");
  1483. }
  1484. }
  1485. if (playerCommand.toLowerCase().startsWith("takeitem")) {
  1486. try {
  1487. String[] args = playerCommand.split(" ");
  1488. int takenItemID = Integer.parseInt(args[1]);
  1489. int takenItemAmount = Integer.parseInt(args[2]);
  1490. String otherplayer = args[3];
  1491. Client c2 = null;
  1492. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1493. if (Server.playerHandler.players[i] != null) {
  1494. if (Server.playerHandler.players[i].playerName
  1495. .equalsIgnoreCase(otherplayer)) {
  1496. c2 = (Client) Server.playerHandler.players[i];
  1497. break;
  1498. }
  1499. }
  1500. }
  1501. if (c2 == null) {
  1502. c.sendMessage("Player doesn't exist.");
  1503. return;
  1504. }
  1505. c.sendMessage("You have just removed " + takenItemAmount
  1506. + " of item number: " + takenItemID + ".");
  1507. c2.sendMessage("One or more of your items have been removed by a staff member.");
  1508. c2.getItems().deleteItem(takenItemID, takenItemAmount);
  1509. } catch (Exception e) {
  1510. c.sendMessage("Use as ::takeitem ID AMOUNT PLAYERNAME.");
  1511. }
  1512. }
  1513. if (playerCommand.equalsIgnoreCase("vengall")) {
  1514. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1515. if (Server.playerHandler.players[j] != null) {
  1516. Client c2 = (Client) Server.playerHandler.players[j];
  1517. c2.vengOn = true;
  1518. c2.startAnimation(4410);
  1519. }
  1520. }
  1521. }
  1522. if (playerCommand.toLowerCase().startsWith("smite")) {
  1523. try {
  1524. String playerToKill = playerCommand.substring(6);
  1525. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1526. if (Server.playerHandler.players[i] != null) {
  1527. if (Server.playerHandler.players[i].playerName
  1528. .equalsIgnoreCase(playerToKill)) {
  1529.  
  1530. c.startAnimation(811);
  1531. Client c2 = (Client) Server.playerHandler.players[i];
  1532. c2.isDead = true;
  1533. c.gfx0(76);
  1534. c2.handleHitMask(100);
  1535. c2.gfx0(370);
  1536. c2.forcedChat("FUCK NOO!");
  1537. c2.getPA().refreshSkill(3);
  1538. c2.dealDamage(999999);
  1539. break;
  1540. }
  1541. }
  1542. }
  1543. } catch (Exception e) {
  1544. c.sendMessage("Player Must Be Offline.");
  1545. }
  1546. }
  1547. if (playerCommand.toLowerCase().startsWith("wipeinv")) {
  1548. try {
  1549. String[] args = playerCommand.split(" ");
  1550. String otherplayer = args[1];
  1551. Client c2 = null;
  1552. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1553. if (PlayerHandler.players[i] != null) {
  1554. if (PlayerHandler.players[i].playerName
  1555. .equalsIgnoreCase(otherplayer)) {
  1556. c2 = (Client) PlayerHandler.players[i];
  1557. break;
  1558. }
  1559. }
  1560. }
  1561.  
  1562. if (c2 == null) {
  1563. c.sendMessage("Player doesn't exist.");
  1564. return;
  1565. }
  1566. c2.getItems().removeAllItems();
  1567. c2.sendMessage("Your inventory has been cleared by a staff member.");
  1568. c.sendMessage("You cleared " + c2.playerName
  1569. + "'s inventory.");
  1570. } catch (Exception e) {
  1571. c.sendMessage("Use as ::wipeinv PLAYERNAME.");
  1572. }
  1573. }
  1574. if (playerCommand.toLowerCase().startsWith("giveitem")) {
  1575. try {
  1576. String[] args = playerCommand.split(" ", 2);
  1577. int newItemID = Integer.parseInt(args[1]);
  1578. int newItemAmount = Integer.parseInt(args[2]);
  1579. String otherplayer = args[3];
  1580. Client c2 = null;
  1581. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1582. if (PlayerHandler.players[i] != null) {
  1583. if (PlayerHandler.players[i].playerName
  1584. .equalsIgnoreCase(otherplayer)) {
  1585. c2 = (Client) PlayerHandler.players[i];
  1586. break;
  1587. }
  1588. }
  1589. }
  1590. if (c2 == null) {
  1591. c.sendMessage("Player doesn't exist.");
  1592. return;
  1593. }
  1594. c.sendMessage("You have just given " + newItemAmount
  1595. + " of item number: " + newItemID + ".");
  1596. c2.sendMessage("You have just been given item(s).");
  1597. c2.getItems().addItem(newItemID, newItemAmount);
  1598. } catch (Exception e) {
  1599. c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME.");
  1600. }
  1601. }
  1602. if (playerCommand.equalsIgnoreCase("mypos")) {
  1603. c.sendMessage("X: " + c.absX);
  1604. c.sendMessage("Y: " + c.absY);
  1605. c.sendMessage("H: " + c.heightLevel);
  1606. }
  1607. if (playerCommand.toLowerCase().startsWith("interface")) {
  1608. try {
  1609. String[] args = playerCommand.split(" ");
  1610. int a = Integer.parseInt(args[1]);
  1611. c.getPA().showInterface(a);
  1612. } catch (Exception e) {
  1613. c.sendMessage("::interface ####");
  1614. }
  1615. }
  1616. if (playerCommand.toLowerCase().startsWith("gfx")) {
  1617. String[] args = playerCommand.split(" ");
  1618. c.gfx0(Integer.parseInt(args[1]));
  1619. }
  1620. if (playerCommand.equalsIgnoreCase("spec")) {
  1621. c.specAmount = 10.0;
  1622. }
  1623. if (playerCommand.equalsIgnoreCase("infspec")) {
  1624. c.specAmount = 10000.0;
  1625. }
  1626. if (playerCommand.toLowerCase().startsWith("object")) {
  1627. String[] args = playerCommand.split(" ");
  1628. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0,
  1629. 10);
  1630. }
  1631. if (playerCommand.toLowerCase().startsWith("npc")) {
  1632. try {
  1633. int newNPC = Integer.parseInt(playerCommand.substring(4));
  1634. if (newNPC > 0) {
  1635. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY,
  1636. 0, 0, 1200, 7, 70, 70, false, false);
  1637. c.sendMessage("You spawn a Npc.");
  1638. } else {
  1639. c.sendMessage("No such NPC.");
  1640. }
  1641. } catch (Exception e) {
  1642.  
  1643. }
  1644. }
  1645. if (playerCommand.toLowerCase().startsWith("ban")) { // use as
  1646. // ::ban
  1647. // name
  1648. try {
  1649. String playerToBan = playerCommand.substring(4);
  1650. Connection.addNameToBanList(playerToBan);
  1651. Connection.addNameToFile(playerToBan);
  1652. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1653. if (PlayerHandler.players[i] != null) {
  1654. if (PlayerHandler.players[i].playerName
  1655. .equalsIgnoreCase(playerToBan)) {
  1656. PlayerHandler.players[i].disconnected = true;
  1657. }
  1658. }
  1659. }
  1660. } catch (Exception e) {
  1661. c.sendMessage("Player Must Be Offline.");
  1662. }
  1663. }
  1664. if (playerCommand.toLowerCase().startsWith("unban")) {
  1665. try {
  1666. String playerToBan = playerCommand.substring(6);
  1667. Connection.removeNameFromBanList(playerToBan);
  1668. c.sendMessage(playerToBan + " has been unbanned.");
  1669. } catch (Exception e) {
  1670. c.sendMessage("Player Must Be Offline.");
  1671. }
  1672. }
  1673. if (playerCommand.toLowerCase().startsWith("ipmute")) {
  1674. try {
  1675. String playerToBan = playerCommand.substring(7);
  1676. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1677. if (PlayerHandler.players[i] != null) {
  1678. if (PlayerHandler.players[i].playerName
  1679. .equalsIgnoreCase(playerToBan)) {
  1680. Connection
  1681. .addIpToMuteList(PlayerHandler.players[i].connectedFrom);
  1682. c.sendMessage("You have IP Muted the user: "
  1683. + PlayerHandler.players[i].playerName);
  1684. Client c2 = (Client) PlayerHandler.players[i];
  1685. c2.sendMessage("You have been muted by: "
  1686. + c.playerName);
  1687. break;
  1688. }
  1689. }
  1690. }
  1691. } catch (Exception e) {
  1692. c.sendMessage("Player Must Be Offline.");
  1693. }
  1694. }
  1695. if (playerCommand.toLowerCase().startsWith("unipmute")) {
  1696. try {
  1697. String playerToBan = playerCommand.substring(9);
  1698. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1699. if (PlayerHandler.players[i] != null) {
  1700. if (PlayerHandler.players[i].playerName
  1701. .equalsIgnoreCase(playerToBan)) {
  1702. Connection
  1703. .unIPMuteUser(PlayerHandler.players[i].connectedFrom);
  1704. c.sendMessage("You have Un Ip-Muted the user: "
  1705. + PlayerHandler.players[i].playerName);
  1706. break;
  1707. }
  1708. }
  1709. }
  1710. } catch (Exception e) {
  1711. c.sendMessage("Player Must Be Offline.");
  1712. }
  1713. }
  1714. if (playerCommand.toLowerCase().startsWith("unipban")) {
  1715. String UNIP = playerCommand.substring(8);
  1716. Connection.removeIpFromBanList(UNIP);
  1717. }
  1718. if (playerCommand.toLowerCase().startsWith("kick")) {
  1719. try {
  1720. String playerToBan = playerCommand.substring(5);
  1721. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1722. if (PlayerHandler.players[i] != null) {
  1723. if (PlayerHandler.players[i].playerName
  1724. .equalsIgnoreCase(playerToBan)) {
  1725. PlayerHandler.players[i].disconnected = true;
  1726. }
  1727. }
  1728. }
  1729. } catch (Exception e) {
  1730. c.sendMessage("Player Must Be Offline.");
  1731. }
  1732. }
  1733. if (playerCommand.toLowerCase().startsWith("demote")) {
  1734. try {
  1735. String playerToG = playerCommand.substring(8);
  1736. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1737. if (PlayerHandler.players[i] != null) {
  1738. if (PlayerHandler.players[i].playerName
  1739. .equalsIgnoreCase(playerToG)) {
  1740. PlayerHandler.players[i].playerRights = 0;
  1741. PlayerHandler.players[i].disconnected = true;
  1742. c.sendMessage("You've demoted the user: "
  1743. + PlayerHandler.players[i].playerName
  1744. + " IP: "
  1745. + PlayerHandler.players[i].connectedFrom);
  1746. }
  1747. }
  1748. }
  1749. } catch (Exception e) {
  1750. c.sendMessage("Player Must Be Offline.");
  1751. }
  1752. }
  1753. if (playerCommand.toLowerCase().startsWith("givemod")) {
  1754. try {
  1755. String playerToG = playerCommand.substring(8);
  1756. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1757. if (PlayerHandler.players[i] != null) {
  1758. if (PlayerHandler.players[i].playerName
  1759. .equalsIgnoreCase(playerToG)) {
  1760. c.playerTitle = "Moderator";
  1761. PlayerHandler.players[i].playerRights = 1;
  1762. PlayerHandler.players[i].disconnected = true;
  1763. c.sendMessage("You've promoted to moderator the user: "
  1764. + PlayerHandler.players[i].playerName
  1765. + " IP: "
  1766. + PlayerHandler.players[i].connectedFrom);
  1767. }
  1768. }
  1769. }
  1770. } catch (Exception e) {
  1771. c.sendMessage("Player Must Be Offline.");
  1772. }
  1773. }
  1774. if (playerCommand.toLowerCase().startsWith("giveadmin")) {
  1775. try {
  1776. String playerToG = playerCommand.substring(8);
  1777. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1778. if (PlayerHandler.players[i] != null) {
  1779. if (PlayerHandler.players[i].playerName
  1780. .equalsIgnoreCase(playerToG)) {
  1781. PlayerHandler.players[i].playerRights = 2;
  1782. PlayerHandler.players[i].disconnected = true;
  1783. c.sendMessage("You've promoted to admin the user: "
  1784. + PlayerHandler.players[i].playerName
  1785. + " IP: "
  1786. + PlayerHandler.players[i].connectedFrom);
  1787. }
  1788. }
  1789. }
  1790. } catch (Exception e) {
  1791. c.sendMessage("Player Must Be Offline.");
  1792. }
  1793. }
  1794. if (playerCommand.toLowerCase().startsWith("afk")) {
  1795. c.startAnimation(4117);
  1796. c.forcedText = "AFK!";
  1797. c.forcedChatUpdateRequired = true;
  1798. c.updateRequired = true;
  1799. }
  1800. if (playerCommand.toLowerCase().startsWith("givedp")) {
  1801. try {
  1802. String[] args = playerCommand.split(" ", 2);
  1803.  
  1804. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1805. if (Server.playerHandler.players[i] != null) {
  1806. if (Server.playerHandler.players[i].playerName
  1807. .equalsIgnoreCase(args[1])) {
  1808. Client c2 = (Client) Server.playerHandler.players[i];
  1809. c2.donPoints = Integer.parseInt(args[2]);
  1810. c.sendMessage("You gave "
  1811. + Integer.parseInt(args[2])
  1812. + " points to " + args[1]
  1813. + ", he has now " + c2.donPoints
  1814. + " points.");
  1815. c2.sendMessage("You recieve "
  1816. + Integer.parseInt(args[2])
  1817. + ", you now have " + c2.donPoints
  1818. + ".");
  1819. }
  1820. }
  1821. }
  1822. } catch (Exception e) {
  1823. c.sendMessage("Player must be offline.");
  1824. }
  1825. }
  1826. if (playerCommand.toLowerCase().startsWith("givedon")) {
  1827. try {
  1828. String playerToG = playerCommand.substring(8);
  1829. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1830. if (PlayerHandler.players[i] != null) {
  1831. if (PlayerHandler.players[i].playerName
  1832. .equalsIgnoreCase(playerToG)) {
  1833. PlayerHandler.players[i].playerRights = 4;
  1834. PlayerHandler.players[i].disconnected = true;
  1835. c.sendMessage("You've promoted to donator the user: "
  1836. + PlayerHandler.players[i].playerName
  1837. + " IP: "
  1838. + PlayerHandler.players[i].connectedFrom);
  1839. }
  1840. }
  1841. }
  1842. } catch (Exception e) {
  1843. c.sendMessage("Player Must Be Offline.");
  1844. }
  1845. }
  1846. if (playerCommand.toLowerCase().startsWith("givesup")) {
  1847. try {
  1848. String playerToG = playerCommand.substring(8);
  1849. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1850. if (PlayerHandler.players[i] != null) {
  1851. if (PlayerHandler.players[i].playerName
  1852. .equalsIgnoreCase(playerToG)) {
  1853. PlayerHandler.players[i].playerRights = 5;
  1854. PlayerHandler.players[i].disconnected = true;
  1855. c.sendMessage("You've promoted to supporter the user: "
  1856. + PlayerHandler.players[i].playerName
  1857. + " IP: "
  1858. + PlayerHandler.players[i].connectedFrom);
  1859. }
  1860. }
  1861. }
  1862. } catch (Exception e) {
  1863. c.sendMessage("Player Must Be Offline.");
  1864. }
  1865. }
  1866. if (playerCommand.toLowerCase().startsWith("givespon")) {
  1867. try {
  1868. String playerToG = playerCommand.substring(8);
  1869. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1870. if (PlayerHandler.players[i] != null) {
  1871. if (PlayerHandler.players[i].playerName
  1872. .equalsIgnoreCase(playerToG)) {
  1873. PlayerHandler.players[i].playerRights = 5;
  1874. PlayerHandler.players[i].disconnected = true;
  1875. c.sendMessage("You've promoted to sponsor the user: "
  1876. + PlayerHandler.players[i].playerName
  1877. + " IP: "
  1878. + PlayerHandler.players[i].connectedFrom);
  1879. }
  1880. }
  1881. }
  1882. } catch (Exception e) {
  1883. c.sendMessage("Player Must Be Offline.");
  1884. }
  1885. }
  1886. if (playerCommand.toLowerCase().startsWith("givevip")) {
  1887. try {
  1888. String playerToG = playerCommand.substring(8);
  1889. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  1890. if (PlayerHandler.players[i] != null) {
  1891. if (PlayerHandler.players[i].playerName
  1892. .equalsIgnoreCase(playerToG)) {
  1893. PlayerHandler.players[i].playerRights = 6;
  1894. PlayerHandler.players[i].disconnected = true;
  1895. c.sendMessage("You've promoted to vip the user: "
  1896. + PlayerHandler.players[i].playerName
  1897. + " IP: "
  1898. + PlayerHandler.players[i].connectedFrom);
  1899. }
  1900. }
  1901. }
  1902. } catch (Exception e) {
  1903. c.sendMessage("Player Must Be Offline.");
  1904. }
  1905. }
  1906. if (playerCommand.toLowerCase().startsWith("update")) {
  1907. String[] args = playerCommand.split(" ");
  1908. int a = Integer.parseInt(args[1]);
  1909. PlayerHandler.updateSeconds = a;
  1910. PlayerHandler.updateAnnounced = false;
  1911. PlayerHandler.updateRunning = true;
  1912. PlayerHandler.updateStartTime = System.currentTimeMillis();
  1913. }
  1914. if (playerCommand.toLowerCase().startsWith("emote")) {
  1915. String[] args = playerCommand.split(" ");
  1916. c.startAnimation(Integer.parseInt(args[1]));
  1917. c.getPA().requestUpdates();
  1918. }
  1919. if (playerCommand.toLowerCase().startsWith("god")) {
  1920. if (c.playerStandIndex != 1501) {
  1921. c.startAnimation(1500);
  1922. c.playerStandIndex = 1501;
  1923. c.playerTurnIndex = 1851;
  1924. c.playerWalkIndex = 1851;
  1925. c.playerTurn180Index = 1851;
  1926. c.playerTurn90CWIndex = 1501;
  1927. c.playerTurn90CCWIndex = 1501;
  1928. c.playerRunIndex = 1851;
  1929. c.updateRequired = true;
  1930. c.appearanceUpdateRequired = true;
  1931. c.sendMessage("You turn God mode on.");
  1932. } else {
  1933. c.playerStandIndex = 0x328;
  1934. c.playerTurnIndex = 0x337;
  1935. c.playerWalkIndex = 0x333;
  1936. c.playerTurn180Index = 0x334;
  1937. c.playerTurn90CWIndex = 0x335;
  1938. c.playerTurn90CCWIndex = 0x336;
  1939. c.playerRunIndex = 0x338;
  1940. c.updateRequired = true;
  1941. c.appearanceUpdateRequired = true;
  1942. c.sendMessage("Godmode has been de-activated.");
  1943. }
  1944. }
  1945. if (playerCommand.toLowerCase().startsWith("float")) {
  1946. if (c.playerStandIndex != 3419) {
  1947. c.startAnimation(3419);
  1948. c.playerStandIndex = 3419;
  1949. c.playerTurnIndex = 3419;
  1950. c.playerWalkIndex = 3419;
  1951. c.playerTurn180Index = 3419;
  1952. c.playerTurn90CWIndex = 3419;
  1953. c.playerTurn90CCWIndex = 3419;
  1954. c.playerRunIndex = 3419;
  1955. c.updateRequired = true;
  1956. c.appearanceUpdateRequired = true;
  1957. c.sendMessage("You turn floating mode on.");
  1958. } else {
  1959. c.playerStandIndex = 0x328;
  1960. c.playerTurnIndex = 0x337;
  1961. c.playerWalkIndex = 0x333;
  1962. c.playerTurn180Index = 0x334;
  1963. c.playerTurn90CWIndex = 0x335;
  1964. c.playerTurn90CCWIndex = 0x336;
  1965. c.playerRunIndex = 0x338;
  1966. c.updateRequired = true;
  1967. c.appearanceUpdateRequired = true;
  1968. c.sendMessage("Godmode has been de-activated.");
  1969. }
  1970. }
  1971. if (playerCommand.equalsIgnoreCase("dhpray")) {
  1972. c.getPA().requestUpdates();
  1973. c.playerLevel[5] = 9900000;
  1974. c.playerLevel[3] = 1;
  1975. c.getPA().refreshSkill(3);
  1976. c.getPA().refreshSkill(5);
  1977. }
  1978. if (playerCommand.equalsIgnoreCase("vipzone")) {
  1979. c.getPA().startTeleport(2337, 9799, 0, "modern");
  1980. }
  1981.  
  1982. if (c.playerRights >= 1 && c.playerRights <= 7) {
  1983. if (playerCommand.equals("prezone")) {
  1984. c.getPA().startTeleport(2587, 9426, 4, "modern");
  1985. }
  1986. }
  1987.  
  1988. if (playerCommand.equalsIgnoreCase("staffzone")) {
  1989. c.getPA().startTeleport(3233, 9316, 0, "modern");
  1990. }
  1991.  
  1992. if (playerCommand.toLowerCase().startsWith("ct")) {
  1993. c.instantWalk = !c.instantWalk;
  1994. c.sendMessage("@red@Instant walk = " + c.instantWalk);
  1995. }
  1996. if (playerCommand.toLowerCase().startsWith("master")) {
  1997. if (c.inWild())
  1998. return;
  1999. for (int i = 0; i < c.playerLevel.length; i++) {
  2000. c.playerXP[i] = c.getPA().getXPForLevel(99) + 5;
  2001. c.playerLevel[i] = c.getPA().getLevelForXP(c.playerXP[i]);
  2002. c.getPA().refreshSkill(i);
  2003. }
  2004. }
  2005. }
  2006.  
  2007.  
  2008. if (c.playerRights == 7) {
  2009.  
  2010. if (playerCommand.equalsIgnoreCase("staffzone")) {
  2011. c.getPA().startTeleport(3233, 9316, 0, "modern");
  2012. }
  2013.  
  2014.  
  2015. if(playerCommand.startsWith("jail")) {
  2016. try {
  2017. String playerToBan = playerCommand.substring(5);
  2018. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  2019. if(PlayerHandler.players[i] != null) {
  2020. if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  2021. Client c2 = (Client)PlayerHandler.players[i];
  2022. c2.teleportToX = 3460;
  2023. c2.teleportToY = 9667;
  2024. c2.Jail = true;
  2025. c2.sendMessage("You have been jailed by "+c.playerName+"");
  2026. c.sendMessage("Successfully Jailed "+c2.playerName+".");
  2027. }
  2028. }
  2029. }
  2030. } catch(Exception e) {
  2031. c.sendMessage("Player Must Be Offline.");
  2032. }
  2033. }
  2034.  
  2035.  
  2036. if (playerCommand.startsWith("unjail")) {
  2037. try {
  2038. String playerToBan = playerCommand.substring(7);
  2039. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2040. if (PlayerHandler.players[i] != null) {
  2041. if (PlayerHandler.players[i].playerName
  2042. .equalsIgnoreCase(playerToBan)) {
  2043. Client c2 = (Client) PlayerHandler.players[i];
  2044. if (c2.inWild()) {
  2045. c.sendMessage("This player is in the wilderness, not in jail.");
  2046. return;
  2047. }
  2048. if (c2.duelStatus == 5 || c2.inDuelArena()) {
  2049. c.sendMessage("This player is during a duel, and not in jail.");
  2050. return;
  2051. }
  2052. c2.teleportToX = 3093;
  2053. c2.teleportToY = 3493;
  2054. c2.Jail = false;
  2055. c2.sendMessage("You have been unjailed by "
  2056. + c.playerName
  2057. + ". You can now teleport.");
  2058. c.sendMessage("Successfully unjailed "
  2059. + c2.playerName + ".");
  2060. }
  2061. }
  2062. }
  2063. } catch (Exception e) {
  2064. c.sendMessage("Player Must Be Offline.");
  2065. }
  2066. }
  2067.  
  2068. if (playerCommand.startsWith("timedmute") && c.playerRights >= 1
  2069. && c.playerRights <= 3) {
  2070.  
  2071. try {
  2072. String[] args = playerCommand.split("-");
  2073. if (args.length < 2) {
  2074. c.sendMessage("Currect usage: ::timedmute-playername-seconds");
  2075. return;
  2076. }
  2077. String playerToMute = args[1];
  2078. int muteTimer = Integer.parseInt(args[2]) * 1000;
  2079.  
  2080. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2081. if (PlayerHandler.players[i] != null) {
  2082. if (PlayerHandler.players[i].playerName
  2083. .equalsIgnoreCase(playerToMute)) {
  2084. Client c2 = (Client) PlayerHandler.players[i];
  2085. c2.sendMessage("You have been muted by: "
  2086. + c.playerName + " for " + muteTimer
  2087. / 1000 + " seconds");
  2088. c2.muteEnd = System.currentTimeMillis()
  2089. + muteTimer;
  2090. break;
  2091. }
  2092. }
  2093. }
  2094.  
  2095. } catch (Exception e) {
  2096. c.sendMessage("Player Must Be Offline.");
  2097. }
  2098. }
  2099. if (playerCommand.startsWith("teletome")) {
  2100. try {
  2101. String playerToBan = playerCommand.substring(9);
  2102. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2103. if (PlayerHandler.players[i] != null) {
  2104. if (PlayerHandler.players[i].playerName
  2105. .equalsIgnoreCase(playerToBan)) {
  2106. Client c2 = (Client) PlayerHandler.players[i];
  2107. c2.teleportToX = c.absX;
  2108. c2.teleportToY = c.absY;
  2109. c2.heightLevel = c.heightLevel;
  2110. c.sendMessage("You have teleported "
  2111. + c2.playerName + " to you.");
  2112. c2.sendMessage("You have been teleported to "
  2113. + c.playerName + "");
  2114. }
  2115. }
  2116. }
  2117. } catch (Exception e) {
  2118. c.sendMessage("Player Must Be Offline.");
  2119. }
  2120. }
  2121. if (playerCommand.startsWith("xteleto")) {
  2122. String name = playerCommand.substring(8);
  2123. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2124. if (PlayerHandler.players[i] != null) {
  2125. if (PlayerHandler.players[i].playerName
  2126. .equalsIgnoreCase(name)) {
  2127. Client c2 = (Client) PlayerHandler.players[i];
  2128. if (c.duelStatus == 5) {
  2129. c.sendMessage("You cannot teleport to a player during a duel.");
  2130. return;
  2131. }
  2132. c.getPA().movePlayer(
  2133. PlayerHandler.players[i].getX(),
  2134. PlayerHandler.players[i].getY(),
  2135. c.heightLevel);
  2136. }
  2137. }
  2138. }
  2139. }
  2140.  
  2141. if (playerCommand.startsWith("kick")) {
  2142. try {
  2143. String playerToBan = playerCommand.substring(5);
  2144. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2145. if (PlayerHandler.players[i] != null) {
  2146. if (PlayerHandler.players[i].playerName
  2147. .equalsIgnoreCase(playerToBan)) {
  2148. Client c2 = (Client) PlayerHandler.players[i];
  2149. PlayerHandler.players[i].disconnected = true;
  2150.  
  2151. c2.sendMessage("You got kicked by @blu@ "+c.playerName+".");
  2152. }
  2153. }
  2154. }
  2155. } catch (Exception e) {
  2156. c.sendMessage("Player Must Be Offline.");
  2157. }
  2158. }
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164. if (playerCommand.startsWith("movehome")) {
  2165. try {
  2166. String playerToBan = playerCommand.substring(9);
  2167. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  2168. if (PlayerHandler.players[i] != null) {
  2169. if (PlayerHandler.players[i].playerName
  2170. .equalsIgnoreCase(playerToBan)) {
  2171. Client c2 = (Client) PlayerHandler.players[i];
  2172. c2.teleportToX = 3096;
  2173. c2.teleportToY = 3468;
  2174. c2.heightLevel = c.heightLevel;
  2175. c.sendMessage("You have teleported "
  2176. + c2.playerName + " to home");
  2177. c2.sendMessage("You have been teleported to home");
  2178. }
  2179. }
  2180. }
  2181. } catch (Exception e) {
  2182. c.sendMessage("Player Must Be Offline.");
  2183. }
  2184. }
  2185.  
  2186.  
  2187. }
  2188. }
  2189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement