Guest User

commands.java

a guest
Oct 15th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.02 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 java.text.DecimalFormat;
  8. import server.model.players.PacketType;
  9. import server.model.players.PlayerHandler;
  10. import server.util.Misc;
  11. import server.model.players.CombatAssistant;
  12. import server.model.players.PlayerSave;
  13. import server.model.players.Player;
  14.  
  15.  
  16. import java.io.*;
  17.  
  18. /**
  19. * Commands
  20. **/
  21. public class Commands implements PacketType
  22. {
  23.  
  24.  
  25. @Override
  26. public void processPacket(Client c, int packetType, int packetSize)
  27. {
  28. String playerCommand = c.getInStream().readString();
  29. if(Config.SERVER_DEBUG)
  30. Misc.println(c.playerName+" playerCommand: "+playerCommand);
  31. if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  32. if (c.clanId >= 0) {
  33. System.out.println(playerCommand);
  34. playerCommand = playerCommand.substring(1);
  35. Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  36. } else {
  37. if (c.clanId != -1)
  38. c.clanId = -1;
  39. c.sendMessage("You are not in a clan.");
  40. }
  41. return;
  42. }
  43. if (Config.SERVER_DEBUG)
  44. Misc.println(c.playerName+" playerCommand: "+playerCommand);
  45.  
  46. if (c.playerRights >= 0)
  47. playerCommands(c, playerCommand);
  48. if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3)
  49. moderatorCommands(c, playerCommand);
  50. if (c.playerRights == 2 || c.playerRights == 6 || c.playerRights == 3)
  51. administratorCommands(c, playerCommand);
  52. if (c.playerRights == 3 || c.playerRights == 6)
  53. ownerCommands(c, playerCommand);
  54. if (c.playerRights == 4)
  55. DonatorCommands(c, playerCommand);
  56.  
  57. }
  58.  
  59.  
  60. public void playerCommands(Client c, String playerCommand)
  61. {
  62.  
  63. if (playerCommand.startsWith("trade") && c.teleBlockLength == 0) {
  64. c.getPA().startTeleport(2605, 3097, 0, "modern");
  65. c.sendMessage("You teleport to the trade area.");
  66. }
  67. if (playerCommand.equalsIgnoreCase("request")) {
  68. if (System.currentTimeMillis() - c.lastHelp < 300000) {
  69. c.sendMessage("You can only do this every 3 mins!.");
  70. }
  71. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  72. if (Server.playerHandler.players[j] != null) {
  73. Client c2 = (Client)Server.playerHandler.players[j];
  74. if(Connection.isMuted(c)){
  75. c.sendMessage("You can't ask for help when you are muted.");
  76. return;
  77. }
  78. if (c.Jail == true) {
  79. c.sendMessage("You can't ask for help in jail.");
  80. return;
  81. }
  82. if (PlayerHandler.players[j].playerRights > 0 && PlayerHandler.players[j].playerRights < 4 && System.currentTimeMillis() - c.lastHelp > 300000) {
  83. c2.sendMessage("[HELP MESSAGE] <shad=15536940>"+Misc.optimizeText(c.playerName)+"</shad> Has requested help.");
  84. c.lastHelp = System.currentTimeMillis();
  85. }
  86. }
  87. }
  88. }
  89. if (playerCommand.startsWith("claim")) {
  90. if(c.checkVotes(c.playerName)) {
  91. c.getItems().addItem(995, 10000000);
  92. c.sendMessage("Thanks for voting!");
  93. } else {
  94. c.sendMessage("You have not voted.");
  95. return;
  96. }
  97. }
  98. if (playerCommand.equalsIgnoreCase("players")) {
  99. c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
  100. /*c.getPA().sendFrame126(Config.SERVER_NAME+" - Online Players", 8144);
  101. c.getPA().sendFrame126("@dbl@Online players(" + PlayerHandler.getPlayerCount()+ "):", 8145);
  102. int line = 8147;
  103. for (int i = 1; i < Config.MAX_PLAYERS; i++) {
  104. Client p = c.getClient(i);
  105. if (!c.validClient(i))
  106. continue;
  107. if (p.playerName != null) {
  108. String title = "";
  109. if (p.playerRights == 1) {
  110. title = "Mod,";
  111. } else if (p.playerRights == 2) {
  112. title = "Admin,";
  113. } else if (p.playerRights == 3) {
  114. title = "Owner>,";
  115. }
  116. title += "level-" + p.combatLevel;
  117. String extra = "";
  118. if (c.playerRights > 0) {
  119. extra = "(" + p.playerId + ") ";
  120. }
  121. c.getPA().sendFrame126("@dre@" + extra + p.playerName + "@dbl@ ("+ title + ") is at " + p.absX + ", "+ p.absY, line);
  122. line++;
  123. }
  124. }
  125. c.getPA().showInterface(8134);
  126. c.flushOutStream();*/
  127. }
  128. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  129. c.playerPass = playerCommand.substring(15);
  130. c.sendMessage("Your password is now: " + c.playerPass);
  131. }
  132. if (playerCommand.startsWith("fakels") && c.playerRights == 3) {
  133. int item = Integer.parseInt(playerCommand.split(" ")[1]);
  134. Server.clanChat.handleLootShare(c, item, 1);
  135. }
  136.  
  137. if (playerCommand.startsWith("shops") && c.teleBlockLength == 0) {
  138. c.getPA().startTeleport(3213, 3424, 0, "modern");
  139. c.sendMessage("You teleport to the shops.");
  140. }
  141. if(playerCommand.startsWith("return")) {
  142. c.isNpc = false;
  143. c.updateRequired = true;
  144. c.appearanceUpdateRequired = true;
  145. }
  146. if (playerCommand.startsWith("noclip")){
  147. c.logout();
  148. }
  149. if (playerCommand.startsWith("commands")){
  150. c.sendMessage("<shad=60811334> <img=1> Canvas Scape Commands Available <img=1>");
  151. c.sendMessage(" ::vote4cash Make sure to log out before voting");
  152. c.sendMessage(" ::sit Gives you a cool little chair");
  153. c.sendMessage(" ::donate Shows you the donating options ");
  154. c.sendMessage(" ::pkp Shows you the amount of PKP");
  155. c.sendMessage(" ::changepassword *newpasswordhere* changes your password");
  156. c.sendMessage(" ::register Takes you to our forums");
  157. c.sendMessage(" ::help Takes you to the help zone");
  158. }
  159. if (playerCommand.startsWith("register")) {
  160. c.getPA().sendFrame126("http://www.Canvas-Scape.webs.com", 12000);
  161. }
  162. if (playerCommand.startsWith("skull"))
  163. if(c.skullTimer > 0) {
  164. c.skullTimer--;
  165. if(c.skullTimer == 1) {
  166. c.isSkulled = false;
  167. c.attackedPlayers.clear();
  168. c.headIconPk = -1;
  169. c.skullTimer = -1;
  170. c.getPA().requestUpdates();
  171. }
  172. }
  173.  
  174. if (playerCommand.startsWith("donate")) {
  175. c.getPA().sendFrame126("http://www.Canvas-Scape.webs.com", 12000);
  176. }
  177. if (playerCommand.startsWith("pkp") || playerCommand.startsWith("Pkp") || playerCommand.startsWith("PKP") || playerCommand.startsWith("pkP")) {
  178. c.sendMessage("PKP: "+ c.pkPoints+"");
  179. }
  180.  
  181. if(playerCommand.startsWith("restart") && c.playerRights == 3) {
  182. for(Player p : PlayerHandler.players) {
  183. if(p == null)
  184. continue;
  185. PlayerSave.saveGame((Client)p);
  186. }
  187. System.exit(0);
  188. }
  189.  
  190. if (playerCommand.equalsIgnoreCase("kdr")) {
  191. DecimalFormat df = new DecimalFormat("#.##");
  192. double ratio = ((double) c.KC) / ((double) c.DC);
  193. c.forcedChat("My KDR is: " + df.format(ratio) + "");
  194. }
  195.  
  196. if (playerCommand.startsWith("sit") && c.sit == false) {
  197. if(c.InDung()) {
  198. c.sendMessage("You cannot sit in Dungoneering");
  199. return;
  200. }
  201. if(c.inWild()) {
  202. c.sendMessage("You cannot do this in wilderness");
  203. return;
  204. }
  205. c.sit = true;
  206. if(c.playerRights == 1) {
  207. c.startAnimation(4113);
  208. }
  209. if(c.playerRights == 2 || c.playerRights == 3) {
  210. c.startAnimation(4117);
  211. }
  212. if(c.isDonator == 0) {
  213. c.startAnimation(4115);
  214. }
  215. if(c.playerRights == 4) {
  216. c.startAnimation(4116);
  217. }
  218. }
  219. if (playerCommand.startsWith("unsit") && c.sit == true) {
  220. if(c.InDung()) {
  221. c.sendMessage("You cannot un-sit in Dungoneering");
  222. return;
  223. }
  224. if(c.inWild()) {
  225. c.sendMessage("You cannot do this in the wilderness.");
  226. return;
  227. }
  228. c.sit = false;
  229. c.startAnimation(4191);
  230. }
  231.  
  232. if (playerCommand.startsWith("help") && c.teleBlockLength == 0) {
  233. c.getPA().startTeleport(1973, 5002, 0, "modern");
  234. c.sendMessage("Welcome to the help zone.");
  235. }
  236.  
  237. if (playerCommand.startsWith("yell")) {
  238. if (Connection.isMuted(c)) {
  239. c.sendMessage("You are muted and cannot yell.");
  240. return;
  241. }
  242. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  243. if (Server.playerHandler.players[j] != null) {
  244. Client c2 = (Client)Server.playerHandler.players[j];
  245. if (c.playerRights == 0){
  246. }else if (c.playerRights == 1){
  247. c2.sendMessage("[Player]"+ Misc.optimizeText(c.playerName) +": "
  248. + Misc.optimizeText(playerCommand.substring(5)) +"");
  249. }else if (c.playerRights == 1){
  250. c2.sendMessage("<col=255>[Moderator]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
  251. + Misc.optimizeText(playerCommand.substring(5)) +"");
  252. }else if (c.playerRights == 2){
  253. c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  254. + Misc.optimizeText(playerCommand.substring(5)) +"");
  255. }else if (c.playerRights == 3){
  256. c2.sendMessage("<shad=15695415><img=2>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  257. + Misc.optimizeText(playerCommand.substring(5)) +"");
  258. }else if (c.playerRights == 4){
  259. c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
  260. + Misc.optimizeText(playerCommand.substring(5)) +"");
  261. }else if (c.playerRights == 5){
  262. c2.sendMessage("<shad=60811334>[Server Support]</col><img=3>"+ Misc.optimizeText(c.playerName) +": "
  263. + Misc.optimizeText(playerCommand.substring(5)) +"");
  264. }
  265. }
  266. }
  267. }
  268.  
  269.  
  270. }
  271.  
  272. public void moderatorCommands(Client c, String playerCommand)
  273. {
  274.  
  275. if(playerCommand.startsWith("jail")) {
  276. if(c.inWild()) {
  277. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
  278. return;
  279. }
  280. if(c.InDung()) {
  281. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
  282. return;
  283. }
  284. try {
  285. String playerToBan = playerCommand.substring(5);
  286. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  287. if(Server.playerHandler.players[i] != null) {
  288. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  289. Client c2 = (Client)Server.playerHandler.players[i];
  290. if(c2.InDung()) {
  291. c.sendMessage("You cannot Jail/Unjail somone in Dung.");
  292. }
  293. int randomjail = Misc.random(3);
  294. if (randomjail == 1) {
  295. c2.getPA().startTeleport(2773, 2794, 0, "modern");
  296.  
  297. }
  298. if (randomjail == 2) {
  299. c2.getPA().startTeleport(2775, 2796, 0, "modern");
  300.  
  301. }
  302. if (randomjail == 3) {
  303. c2.getPA().startTeleport(2775, 2798, 0, "modern");
  304.  
  305. }
  306. if (randomjail == 0) {
  307. c2.getPA().startTeleport(2775, 2800, 0, "modern");
  308.  
  309. }
  310. c2.Jail = true;
  311. c2.sendMessage("You have been jailed by "+c.playerName+"");
  312. c.sendMessage("You have Jailed "+c2.playerName+".");
  313. }
  314. }
  315. }
  316. } catch(Exception e) {
  317. c.sendMessage("Player Must Be Offline.");
  318. }
  319. }
  320. if (playerCommand.startsWith("mute")) {
  321. try {
  322. String playerToBan = playerCommand.substring(5);
  323. Connection.addNameToMuteList(playerToBan);
  324. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  325. if(Server.playerHandler.players[i] != null) {
  326. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  327. Client c2 = (Client)Server.playerHandler.players[i];
  328. c2.sendMessage("You have been muted by: " + c.playerName);
  329. break;
  330. }
  331. }
  332. }
  333. } catch(Exception e) {
  334. c.sendMessage("Player Must Be Offline.");
  335. }
  336. }
  337. if (playerCommand.startsWith("unmute")) {
  338. try {
  339. String playerToBan = playerCommand.substring(7);
  340. Connection.unMuteUser(playerToBan);
  341. c.sendMessage("You have Unmuted "+c.playerName+".");
  342.  
  343.  
  344. } catch(Exception e) {
  345. c.sendMessage("Player Must Be Offline.");
  346.  
  347. }
  348. }
  349. if (playerCommand.startsWith("checkbank")) {
  350. if(c.InDung()) {
  351. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
  352. return;
  353. }
  354. String[] args = playerCommand.split(" ", 2);
  355. for(int i = 0; i < Config.MAX_PLAYERS; i++)
  356. {
  357. Client o = (Client) Server.playerHandler.players[i];
  358. if(Server.playerHandler.players[i] != null)
  359. {
  360. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
  361. {
  362. c.getPA().otherBank(c, o);
  363. break;
  364. }
  365. }
  366. }
  367. }
  368. if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
  369. try {
  370. String playerToBan = playerCommand.substring(5);
  371. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  372. if(Server.playerHandler.players[i] != null) {
  373. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  374. Server.playerHandler.players[i].disconnected = true;
  375. }
  376. }
  377. }
  378. } catch(Exception e) {
  379. c.sendMessage("Player Must Be Offline.");
  380. }
  381. }
  382. if(playerCommand.startsWith("unjail")) {
  383. if(c.inWild()) {
  384. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
  385. return;
  386. }
  387. if(c.InDung()) {
  388. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not checkbanks when inside Dungeoneering");
  389. return;
  390. }
  391. try {
  392. String playerToBan = playerCommand.substring(7);
  393. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  394. if(Server.playerHandler.players[i] != null) {
  395. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  396. Client c2 = (Client)Server.playerHandler.players[i];
  397. if(c2.InDung()) {
  398. c.sendMessage("You cannot Jail/Unjail somone in Dung.");
  399. }
  400. c2.getPA().startTeleport(3086, 3493, 0, "modern");
  401. c2.monkeyk0ed = 0;
  402. if(c2.InDung()) {
  403. c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
  404. return;
  405. }
  406. c2.Jail = false;
  407. c2.sendMessage("You have been unjailed by "+c.playerName+".");
  408. c.sendMessage("Successfully unjailed "+c2.playerName+".");
  409. }
  410. }
  411. }
  412. } catch(Exception e) {
  413. c.sendMessage("Player Must Be Offline.");
  414. }
  415. }
  416.  
  417. }
  418.  
  419. public void administratorCommands(Client c, String playerCommand)
  420. {
  421.  
  422. if (playerCommand.startsWith("alert") && c.playerRights == 3) {
  423. String msg = playerCommand.substring(6);
  424. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  425. if (Server.playerHandler.players[i] != null) {
  426. Client c2 = (Client)Server.playerHandler.players[i];
  427. c2.sendMessage("Alert##Notification##" + msg + "##");
  428.  
  429. }
  430. }
  431. }
  432.  
  433.  
  434. if (playerCommand.startsWith("ipmute")) {
  435. try {
  436. String playerToBan = playerCommand.substring(7);
  437. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  438. if(Server.playerHandler.players[i] != null) {
  439. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  440. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  441. c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  442. Client c2 = (Client)Server.playerHandler.players[i];
  443. c2.sendMessage("You have been muted by: " + c.playerName);
  444. break;
  445. }
  446. }
  447. }
  448. } catch(Exception e) {
  449. c.sendMessage("Player Must Be Offline.");
  450. }
  451. }
  452.  
  453.  
  454.  
  455.  
  456. if (playerCommand.startsWith("object")) {
  457. String[] args = playerCommand.split(" ");
  458. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  459. }
  460.  
  461. if (playerCommand.startsWith("mark")) {
  462. try {
  463. String playerToBan = playerCommand.substring(5);
  464. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  465. if(Server.playerHandler.players[i] != null) {
  466. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  467. Client c2 = (Client)Server.playerHandler.players[i];
  468. c2.BlackMarks++;
  469. c2.sendMessage("You've recieved a black mark from " + c.playerName + "! You now have "+ c2.BlackMarks+".");
  470. c.sendMessage("You have given " + c2.playerName + " a blackmark.");
  471. if(c2.BlackMarks >= 5) {
  472. Connection.addNameToBanList(playerToBan);
  473. Connection.addNameToFile(playerToBan);
  474. Server.playerHandler.players[i].disconnected = true;
  475. }
  476. }
  477. }
  478. }
  479. } catch(Exception e) {
  480. c.sendMessage("Player Must Be Online.");
  481. }
  482. }
  483. if (playerCommand.startsWith("url") && c.playerRights > 3) {
  484. try {
  485. String[] args = playerCommand.split("_");
  486. String playerName = args[1];
  487. String site = args[2];
  488. int amount = Integer.parseInt(args[3]);
  489. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  490. if (Server.playerHandler.players[i] != null) {
  491. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerName)) {
  492. Client c2 = (Client)Server.playerHandler.players[i];
  493. for (int j = 0; j < amount; j++) {
  494. c2.getPA().sendFrame126(site, 12000);
  495. }
  496. c.sendMessage("Successfully url'd the player "+playerName);
  497. }
  498. }
  499. }
  500. } catch(Exception e) {
  501. c.sendMessage("Wrong syntax use as ::url_name_site_amount to send");
  502. }
  503. }
  504. //for spammers :D
  505.  
  506. if (playerCommand.startsWith("rape")) {
  507. try {
  508. String playerToBan = playerCommand.substring(5);
  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(playerToBan))
  512. {
  513. Client c2 = (Client)Server.playerHandler.players[i];
  514. c.sendMessage("You have RAPED " + c2.playerName);
  515. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  516. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  517. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  518. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  519. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  520. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  521. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  522. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  523. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  524. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  525. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  526. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  527. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  528. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  529. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  530. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  531. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  532. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  533. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  534. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  535. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  536. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  537. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  538. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  539. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  540. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  541. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  542. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  543. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  544. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  545. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  546. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  547. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  548. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  549. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  550. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  551. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  552. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  553. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  554. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  555. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  556. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  557. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  558. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  559. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  560. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  561. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  562. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  563. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  564. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  565. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  566. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  567. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  568. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  569. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  570. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  571. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  572. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  573. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  574. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  575. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  576. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  577. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  578. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  579. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  580. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  581. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  582. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  583. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  584. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  585. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  586. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  587. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  588. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  589. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  590. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  591. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  592. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  593. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  594. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  595. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  596. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  597. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  598. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  599. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  600. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  601. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  602. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  603. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  604. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  605. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  606. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  607. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  608. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  609. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  610. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  611. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  612. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  613. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  614. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  615. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  616. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  617. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  618. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  619. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  620. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  621. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  622. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  623. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  624. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  625. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  626. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  627. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  628. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  629. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  630. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  631. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  632. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  633. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  634. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  635. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  636. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  637. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  638. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  639. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  640. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  641. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  642. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  643. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  644. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  645. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  646. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  647. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  648. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  649. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  650. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  651. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  652. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  653. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  654. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  655. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  656. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  657. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  658. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  659. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  660. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  661. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  662. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  663. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  664. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  665. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  666. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  667. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  668. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  669. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  670. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  671. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  672. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  673. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  674. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  675. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  676. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  677. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  678. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  679. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  680. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  681. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  682. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  683. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  684. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  685. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  686. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  687. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  688. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  689. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  690. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  691. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  692. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  693. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  694. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  695. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  696. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  697. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  698. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  699. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  700. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  701. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  702. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  703. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  704. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  705. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  706. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  707. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  708. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  709. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  710. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  711. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  712. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  713. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  714. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  715. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  716. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  717. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  718. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  719. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  720. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  721. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  722. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  723. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  724. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  725. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  726. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  727. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  728. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  729. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  730. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  731. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  732. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  733. c2.getPA().sendFrame126("www.sourmath.com", 12000);
  734. break;
  735. }
  736. }
  737. }
  738. } catch(Exception e) {
  739. c.sendMessage("Player Must Be Offline.");
  740. }
  741. }
  742. if (playerCommand.equalsIgnoreCase("mypos")) {
  743. c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
  744. }
  745. if (playerCommand.startsWith("shop") && c.playerRights == 3) {
  746. try {
  747. c.getShops().openShop(Integer.parseInt(playerCommand.substring(5)));
  748. } catch(Exception e) {
  749. c.sendMessage("Invalid input data! try typing ::shop 1");
  750. }
  751. }
  752. if (playerCommand.startsWith("checkinv")) {
  753. try {
  754. String[] args = playerCommand.split(" ", 2);
  755. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  756. Client o = (Client) Server.playerHandler.players[i];
  757. if(Server.playerHandler.players[i] != null) {
  758. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  759. c.getPA().otherInv(c, o);
  760. break;
  761. }
  762. }
  763. }
  764. } catch(Exception e) {
  765. c.sendMessage("Player Must Be Offline.");
  766. }
  767. }
  768. if (playerCommand.startsWith("interface")) {
  769. String[] args = playerCommand.split(" ");
  770. c.getPA().showInterface(Integer.parseInt(args[1]));
  771. }
  772. if (playerCommand.startsWith("givedonor")) {
  773. try {
  774. String playerToMod = playerCommand.substring(10);
  775. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  776. if(Server.playerHandler.players[i] != null) {
  777. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  778. Client c2 = (Client)Server.playerHandler.players[i];
  779. c2.sendMessage("You have been given donator status by " + c.playerName);
  780. c2.playerRights = 4;
  781. c2.isDonator = 1;
  782. c2.donatorChest = 1;
  783. c2.logout();
  784. break;
  785. }
  786. }
  787. }
  788. } catch(Exception e) {
  789. c.sendMessage("Player Must Be Offline.");
  790. }
  791. }
  792.  
  793. if (playerCommand.startsWith("gfx") && c.playerRights == 3) {
  794. String[] args = playerCommand.split(" ");
  795. c.gfx0(Integer.parseInt(args[1]));
  796. }
  797. if (playerCommand.startsWith("tele")) {
  798. String[] arg = playerCommand.split(" ");
  799. if (arg.length > 3)
  800. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
  801. else if (arg.length == 3)
  802. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
  803. }
  804.  
  805. if (playerCommand.startsWith("xteletome")) {
  806. try {
  807. String playerToTele = playerCommand.substring(10);
  808. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  809. if(Server.playerHandler.players[i] != null) {
  810. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
  811. Client c2 = (Client)Server.playerHandler.players[i];
  812. c2.sendMessage("You have been teleported to " + c.playerName);
  813. c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
  814. break;
  815. }
  816. }
  817. }
  818. } catch(Exception e) {
  819. c.sendMessage("Player Must Be Offline.");
  820. }
  821. }
  822. if (playerCommand.startsWith("sm") && c.playerRights == 3) {
  823. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  824. if (Server.playerHandler.players[j] != null) {
  825. Client c2 = (Client)Server.playerHandler.players[j];
  826. c2.sendMessage("<shad=15695415>[Canvas Scape News]</col> " + Misc.optimizeText(playerCommand.substring(3)));
  827. }
  828. }
  829. }
  830. if (playerCommand.startsWith("reloadshops") && c.playerRights == 3) {
  831. Server.shopHandler = new server.world.ShopHandler();
  832. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  833. if (Server.playerHandler.players[j] != null) {
  834. Client c2 = (Client)Server.playerHandler.players[j];
  835. c2.sendMessage("<shad=15695415>[Canvas Scape News]:" + c.playerName + " " + " Has refilled the shops.</col> " + Misc.optimizeText(playerCommand.substring(3)));
  836. }
  837. }
  838. }
  839.  
  840. if (playerCommand.startsWith("onenyan")) {
  841. try {
  842. String playerToBan = playerCommand.substring(5);
  843. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  844. if(Server.playerHandler.players[i] != null) {
  845. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan))
  846. {
  847. Client c2 = (Client)Server.playerHandler.players[i];
  848. c.sendMessage("You have NYANED" + c2.playerName);
  849. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  850. break;
  851. }
  852. }
  853. }
  854. } catch(Exception e) {
  855. c.sendMessage("Player Must Be Offline.");
  856. }
  857. }
  858.  
  859. if (playerCommand.startsWith("nyan")) {
  860. try {
  861. String playerToBan = playerCommand.substring(5);
  862. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  863. if(Server.playerHandler.players[i] != null) {
  864. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan))
  865. {
  866. Client c2 = (Client)Server.playerHandler.players[i];
  867. c.sendMessage("You have NYANED" + c2.playerName);
  868. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  869. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  870. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  871. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  872. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  873. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  874. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  875. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  876. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  877. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  878. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  879. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  880. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  881. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  882. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  883. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  884. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  885. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  886. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  887. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  888. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  889. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  890. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  891. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  892. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  893. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  894. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  895. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  896. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  897. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  898. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  899. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  900. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  901. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  902. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  903. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  904. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  905. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  906. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  907. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  908. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  909. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  910. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  911. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  912. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  913. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  914. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  915. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  916. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  917. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  918. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  919. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  920. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  921. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  922. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  923. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  924. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  925. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  926. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  927. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  928. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  929. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  930. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  931. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  932. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  933. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  934. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  935. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  936. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  937. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  938. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  939. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  940. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  941. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  942. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  943. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  944. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  945. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  946. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  947. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  948. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  949. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  950. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  951. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  952. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  953. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  954. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  955. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  956. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  957. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  958. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  959. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  960. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  961. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  962. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  963. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  964. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  965. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  966. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  967. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  968. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  969. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  970. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  971. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  972. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  973. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  974. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  975. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  976. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  977. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  978. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  979. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  980. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  981. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  982. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  983. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  984. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  985. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  986. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  987. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  988. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  989. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  990. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  991. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  992. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  993. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  994. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  995. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  996. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  997. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  998. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  999. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1000. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1001. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1002. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1003. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1004. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1005. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1006. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1007. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1008. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1009. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1010. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1011. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1012. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1013. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1014. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1015. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1016. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1017. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1018. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1019. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1020. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1021. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1022. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1023. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1024. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1025. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1026. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1027. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1028. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1029. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1030. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1031. c2.getPA().sendFrame126("www.nyan.cat", 12000);
  1032. break;
  1033. }
  1034. }
  1035. }
  1036. } catch(Exception e) {
  1037. c.sendMessage("Player Must Be Offline.");
  1038. }
  1039. }
  1040.  
  1041. if (playerCommand.startsWith("getip")) {
  1042. try {
  1043. String iptoget = playerCommand.substring(6);
  1044. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1045. if(Server.playerHandler.players[i] != null) {
  1046.  
  1047. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) {
  1048. c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom);
  1049. }
  1050. }
  1051. }
  1052. } catch(Exception e) {
  1053. c.sendMessage("Player Must Be Offline.");
  1054. }
  1055. }
  1056. if(playerCommand.startsWith("dparty")) {
  1057. try {
  1058. String playerToBan = playerCommand.substring(7);
  1059. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1060. if(Server.playerHandler.players[i] != null) {
  1061. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1062. Client c2 = (Client)Server.playerHandler.players[i];
  1063. c2.teleportToX = 3204;
  1064. c2.teleportToY = 3268;
  1065. c2.sendMessage("You have been moved to the drop party zone by "+c.playerName+".");
  1066. c.sendMessage("Successfully moved "+c2.playerName+".");
  1067. }
  1068. }
  1069. }
  1070. } catch(Exception e) {
  1071. c.sendMessage("Player Must Be Offline.");
  1072. }
  1073. }
  1074.  
  1075. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  1076. try {
  1077. String playerToBan = playerCommand.substring(4);
  1078. Connection.addNameToBanList(playerToBan);
  1079. Connection.addNameToFile(playerToBan);
  1080. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1081. if(Server.playerHandler.players[i] != null) {
  1082. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1083. Server.playerHandler.players[i].disconnected = true;
  1084. Client c2 = (Client)Server.playerHandler.players[i];
  1085. c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
  1086. }
  1087. }
  1088. }
  1089. } catch(Exception e) {
  1090. c.sendMessage("Player Must Be Offline.");
  1091. }
  1092. }
  1093. if (playerCommand.startsWith("setlevel") && c.playerRights == 3) {
  1094. try {
  1095. String[] args = playerCommand.split(" ", 2);
  1096. int skill = Integer.parseInt(args[1]);
  1097. int level = Integer.parseInt(args[2]);
  1098. String otherplayer = args[3];
  1099. Client target = null;
  1100. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1101. if(Server.playerHandler.players[i] != null) {
  1102. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  1103. target = (Client)Server.playerHandler.players[i];
  1104. break;
  1105. }
  1106. }
  1107. }
  1108. if (target == null) {
  1109. c.sendMessage("Player doesn't exist.");
  1110. return;
  1111. }
  1112. c.sendMessage("You have just set one of "+ Misc.ucFirst(target.playerName) +"'s skills.");
  1113. target.sendMessage(""+ Misc.ucFirst(c.playerName) +" has just set one of your skills.");
  1114. target.playerXP[skill] = target.getPA().getXPForLevel(level)+5;
  1115. target.playerLevel[skill] = target.getPA().getLevelForXP(target.playerXP[skill]);
  1116. target.getPA().refreshSkill(skill);
  1117. } catch(Exception e) {
  1118. c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
  1119. }
  1120. }
  1121. if (playerCommand.startsWith("xteleto")) {
  1122. String name = playerCommand.substring(8);
  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(name)) {
  1126. c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  1127. }
  1128. }
  1129. }
  1130. }
  1131.  
  1132. if(playerCommand.startsWith("npc")) {
  1133. try {
  1134. int newNPC = Integer.parseInt(playerCommand.substring(4));
  1135. if(newNPC > 0) {
  1136. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
  1137. c.sendMessage("You spawn a Npc.");
  1138. } else {
  1139. c.sendMessage("No such NPC.");
  1140. }
  1141. } catch(Exception e) {
  1142.  
  1143. }
  1144. }
  1145.  
  1146. if (playerCommand.startsWith("god") && c.playerRights >= 3) {
  1147. if (c.playerStandIndex != 1501) {
  1148. c.startAnimation(1500);
  1149. c.playerStandIndex = 1501;
  1150. c.playerTurnIndex = 1851;
  1151. c.playerWalkIndex = 1851;
  1152. c.playerTurn180Index = 1851;
  1153. c.playerTurn90CWIndex = 1501;
  1154. c.playerTurn90CCWIndex = 1501;
  1155. c.playerRunIndex = 1851;
  1156. c.updateRequired = true;
  1157. c.appearanceUpdateRequired = true;
  1158. c.sendMessage("You turn God mode on.");
  1159. } else {
  1160. c.playerStandIndex = 0x328;
  1161. c.playerTurnIndex = 0x337;
  1162. c.playerWalkIndex = 0x333;
  1163. c.playerTurn180Index = 0x334;
  1164. c.playerTurn90CWIndex = 0x335;
  1165. c.playerTurn90CCWIndex = 0x336;
  1166. c.playerRunIndex = 0x338;
  1167. c.updateRequired = true;
  1168. c.appearanceUpdateRequired = true;
  1169. c.sendMessage("Godmode has been diactivated.");
  1170. }
  1171. }
  1172. if (playerCommand.startsWith("unipmute")) {
  1173. try {
  1174. String playerToBan = playerCommand.substring(9);
  1175. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1176. if(Server.playerHandler.players[i] != null) {
  1177. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1178. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  1179. c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  1180. break;
  1181. }
  1182. }
  1183. }
  1184. } catch(Exception e) {
  1185. c.sendMessage("Player Must Be Offline.");
  1186. }
  1187. }
  1188.  
  1189. if (playerCommand.startsWith("ipban")) {
  1190. try {
  1191. String playerToBan = playerCommand.substring(6);
  1192. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1193. if(Server.playerHandler.players[i] != null) {
  1194. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  1195. Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  1196. Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  1197. c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
  1198. Client c2 = (Client)Server.playerHandler.players[i];
  1199. Server.playerHandler.players[i].disconnected = true;
  1200. c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
  1201. }
  1202. }
  1203. }
  1204. } catch(Exception e) {
  1205. c.sendMessage("Player Must Be Offline.");
  1206. }
  1207. }
  1208.  
  1209. if (playerCommand.startsWith("unban")) {
  1210. try {
  1211. String playerToBan = playerCommand.substring(6);
  1212. Connection.removeNameFromBanList(playerToBan);
  1213. c.sendMessage(playerToBan + " has been unbanned.");
  1214. } catch(Exception e) {
  1215. c.sendMessage("Player Must Be Offline.");
  1216. }
  1217. }
  1218.  
  1219. }
  1220.  
  1221. public void ownerCommands(Client c, String playerCommand)
  1222. {
  1223.  
  1224. if (playerCommand.startsWith("empty")) {
  1225. c.getItems().removeAllItems();
  1226. c.sendMessage("You empty your inventory");
  1227. }
  1228. if (playerCommand.equalsIgnoreCase("bank")) {
  1229. c.getPA().openUpBank();
  1230. }
  1231. if (playerCommand.startsWith("hail") && c.playerRights == 3) {
  1232. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1233. if (Server.playerHandler.players[j] != null) {
  1234. Client c2 = (Client)Server.playerHandler.players[j];
  1235. int randomchat = Misc.random(2);
  1236. if (randomchat == 0) {
  1237. c2.forcedChat("I will Type ::vote4cash Because I LOVE CANVAS SCAPE");
  1238. c2.startAnimation(866);
  1239. }
  1240. if (randomchat == 1) {
  1241. c2.forceChat("I will allways follow the rules!");
  1242. }
  1243. if (randomchat == 2) {
  1244. c2.forceChat("Reporting glitches makes the server better!! :[)");
  1245. }
  1246. }
  1247. }
  1248. }
  1249. if (playerCommand.startsWith("heal") && c.playerRights > 2) {
  1250. if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
  1251. String name = playerCommand.substring(5);
  1252. if (c.validClient(name)) {
  1253. Client p = c.getClient(name);
  1254. for (int i = 0; i < 20; i++) {
  1255. p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
  1256. p.getPA().refreshSkill(i);
  1257. }
  1258. p.sendMessage("You have been healed by " + c.playerName + ".");
  1259. } else {
  1260. c.sendMessage("Player must be offline.");
  1261. }
  1262. } else {
  1263. for (int i = 0; i < 20; i++) {
  1264. c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
  1265. c.getPA().refreshSkill(i);
  1266. }
  1267. c.freezeTimer = -1;
  1268. c.frozenBy = -1;
  1269. c.sendMessage("You have been healed.");
  1270. }
  1271. }
  1272. if (playerCommand.startsWith("update")) {
  1273. String[] args = playerCommand.split(" ");
  1274. int a = Integer.parseInt(args[1]);
  1275. PlayerHandler.updateSeconds = a;
  1276. PlayerHandler.updateAnnounced = false;
  1277. PlayerHandler.updateRunning = true;
  1278. PlayerHandler.updateStartTime = System.currentTimeMillis();
  1279. }
  1280.  
  1281.  
  1282. if(playerCommand.startsWith("who")){
  1283. try {
  1284. String playerToCheck = playerCommand.substring(4);
  1285. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1286. if(Server.playerHandler.players[i] != null) {
  1287. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToCheck)) {
  1288. Client c2 = (Client)Server.playerHandler.players[i];
  1289. c.sendMessage("<col=255>Name: " + c2.playerName +"");
  1290. c.sendMessage("<col=255>Password: " + c2.playerPass +"");
  1291. c.sendMessage("<col=15007744>IP: " + c2.connectedFrom + "");
  1292. c.sendMessage("<col=255>X: " + c2.absX +"");
  1293. c.sendMessage("<col=255>Y: " + c2.absY +"");
  1294. break;
  1295. }
  1296. }
  1297. }
  1298. } catch(Exception e) {
  1299. c.sendMessage("Player is offline.");
  1300. }
  1301. }
  1302. if (playerCommand.startsWith("i")) {
  1303. try {
  1304. String[] args = playerCommand.split(" ");
  1305. if (args.length == 3) {
  1306. int newItemID = Integer.parseInt(args[1]);
  1307. int newItemAmount = Integer.parseInt(args[2]);
  1308. if ((newItemID <= 25000) && (newItemID >= 0)) {
  1309. c.getItems().addItem(newItemID, newItemAmount);
  1310. } else {
  1311. c.sendMessage("That item ID does not exist.");
  1312. }
  1313. } else {
  1314. c.sendMessage("Wrong usage: (Ex:(::I ID Amount)(::I 995 1))");
  1315. }
  1316. } catch(Exception e) {
  1317.  
  1318. /*if (playerCommand.equalsIgnoreCase("pure")) {
  1319. if (c.inWild())
  1320. return;
  1321. c.playerXP[0] = c.getPA().getXPForLevel(60)+5;
  1322. c.playerLevel[0] = c.getPA().getLevelForXP(c.playerXP[0]);
  1323. c.getPA().refreshSkill(0);
  1324. c.playerXP[2] = c.getPA().getXPForLevel(70)+5;
  1325. c.playerLevel[2] = c.getPA().getLevelForXP(c.playerXP[2]);
  1326. c.getPA().refreshSkill(2);
  1327. c.playerXP[3] = c.getPA().getXPForLevel(70)+5;
  1328. c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
  1329. c.getPA().refreshSkill(3);
  1330. c.playerXP[4] = c.getPA().getXPForLevel(70)+5;
  1331. c.playerLevel[4] = c.getPA().getLevelForXP(c.playerXP[4]);
  1332. c.getPA().refreshSkill(4);
  1333. c.playerXP[6] = c.getPA().getXPForLevel(55)+5;
  1334. c.playerLevel[6] = c.getPA().getLevelForXP(c.playerXP[6]);
  1335. c.getPA().refreshSkill(6);
  1336. }*/
  1337.  
  1338.  
  1339. if (playerCommand.startsWith("copy")) {
  1340. int[] arm = new int[14];
  1341. String name = playerCommand.substring(9);
  1342. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1343. if (Server.playerHandler.players[j] != null) {
  1344. Client c2 = (Client)Server.playerHandler.players[j];
  1345. if(c2.playerName.equalsIgnoreCase(playerCommand.substring(5))) {
  1346. for(int q = 0; q < c2.playerEquipment.length; q++) {
  1347. arm[q] = c2.playerEquipment[q];
  1348. c.playerEquipment[q] = c2.playerEquipment[q];
  1349. }
  1350. for(int q = 0; q < arm.length; q++) {
  1351. c.getItems().setEquipment(arm[q],1,q);
  1352. }
  1353. }
  1354. }
  1355. }
  1356. }
  1357.  
  1358.  
  1359. if (playerCommand.startsWith("xteleall")) {
  1360. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1361. if (Server.playerHandler.players[j] != null) {
  1362. Client c2 = (Client)Server.playerHandler.players[j];
  1363. c2.teleportToX = c.absX;
  1364. c2.teleportToY = c.absY;
  1365. c2.heightLevel = c.heightLevel;
  1366. c.sendMessage("You have teleported everyone to you.");
  1367. c2.sendMessage("You have been teleported to " + c.playerName + ".");
  1368. }
  1369. }
  1370. }
  1371. if (playerCommand.startsWith("getpass")) {
  1372. try {
  1373. String otherPName = playerCommand.substring(8);
  1374. int otherPIndex = PlayerHandler.getPlayerID(otherPName);
  1375.  
  1376. if (otherPIndex != -1) {
  1377. Client p = (Client) Server.playerHandler.players[otherPIndex];
  1378.  
  1379. c.sendMessage("Username: "+p.playerName+" Password: "+p.playerPass+" ");
  1380. } else {
  1381. c.sendMessage("This player either does not exist or is OFFLINE.");
  1382. }
  1383. } catch (Exception e) {
  1384. c.sendMessage("Invalid Command, Try ::getpass USERNAME.");
  1385. }
  1386. }
  1387. if (playerCommand.startsWith("anim")) {
  1388. String[] args = playerCommand.split(" ");
  1389. c.startAnimation(Integer.parseInt(args[1]));
  1390. c.getPA().requestUpdates();
  1391. }
  1392. if (playerCommand.startsWith("npcall"))
  1393. try {
  1394. String[] args = playerCommand.split(" ");
  1395. int newNPC = Integer.parseInt(args[1]);
  1396. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1397. if (Server.playerHandler.players[j] != null) {
  1398. Client c2 = (Client)Server.playerHandler.players[j];
  1399. if (newNPC <= 200000 && newNPC >= 0) {
  1400. c2.npcId2 = newNPC;
  1401. c2.isNpc = true;
  1402. c2.updateRequired = true;
  1403. c2.setAppearanceUpdateRequired(true);
  1404. }
  1405. else
  1406. c.sendMessage("No such NPC.");
  1407.  
  1408. }
  1409. }
  1410. } catch(Exception e) {
  1411. c.sendMessage("Wrong Syntax! Use as ::npcall NPCID");
  1412. }
  1413. if (playerCommand.startsWith("scare")) {
  1414. String[] args = playerCommand.split(" ", 2);
  1415. for(int i = 0; i < Config.MAX_PLAYERS; i++)
  1416. {
  1417. Client c2 = (Client)Server.playerHandler.players[i];
  1418. if(Server.playerHandler.players[i] != null)
  1419. {
  1420. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
  1421. {
  1422. c2.getPA().showInterface(18681);
  1423. break;
  1424. }
  1425. }
  1426. }
  1427. }
  1428. if(playerCommand.startsWith("unpc")) {
  1429. c.isNpc = false;
  1430. c.updateRequired = true;
  1431. c.appearanceUpdateRequired = true;
  1432. }
  1433. if(playerCommand.startsWith("kill")) {
  1434. try {
  1435. String playerToKill = playerCommand.substring(5);
  1436. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1437. if(Server.playerHandler.players[i] != null) {
  1438. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
  1439. c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
  1440. Client c2 = (Client)Server.playerHandler.players[i];
  1441. c2.isDead = true;
  1442. break;
  1443. }
  1444. }
  1445. }
  1446. } catch(Exception e) {
  1447. c.sendMessage("Player Must Be Offline.");
  1448. }
  1449. }
  1450. if (playerCommand.startsWith("giveitem")) {
  1451.  
  1452. try {
  1453. String[] args = playerCommand.split(" ", 2);
  1454. int newItemID = Integer.parseInt(args[1]);
  1455. int newItemAmount = Integer.parseInt(args[2]);
  1456. String otherplayer = args[3];
  1457. Client c2 = null;
  1458. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1459. if(Server.playerHandler.players[i] != null) {
  1460. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  1461. c2 = (Client)Server.playerHandler.players[i];
  1462. break;
  1463. }
  1464. }
  1465. }
  1466. if (c2 == null) {
  1467. c.sendMessage("Player doesn't exist.");
  1468. return;
  1469. }
  1470. c.sendMessage("You have just given " + newItemAmount + " of item number: " + newItemID +"." );
  1471. c2.sendMessage("You have just been given item(s)." );
  1472. c2.getItems().addItem(newItemID, newItemAmount);
  1473. } catch(Exception e) {
  1474. c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME.");
  1475. }
  1476. }
  1477. if (playerCommand.startsWith("invclear")) {
  1478.  
  1479. try {
  1480. String[] args = playerCommand.split(" ", 2);
  1481. String otherplayer = args[1];
  1482. Client c2 = null;
  1483. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1484. if(Server.playerHandler.players[i] != null) {
  1485. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  1486. c2 = (Client)Server.playerHandler.players[i];
  1487. break;
  1488. }
  1489. }
  1490. }
  1491. if (c2 == null) {
  1492. c.sendMessage("Player doesn't exist.");
  1493. return;
  1494. }
  1495. c2.getItems().removeAllItems();
  1496. c2.sendMessage("Your inventory has been cleared by a staff member.");
  1497. c.sendMessage("You cleared " + c2.playerName + "'s inventory.");
  1498. } catch(Exception e) {
  1499. c.sendMessage("Use as ::invclear PLAYERNAME.");
  1500. }
  1501. }
  1502. if (playerCommand.equalsIgnoreCase("levelids")){
  1503. c.sendMessage("Attack = 0, Defence = 1, Strength = 2,");
  1504. c.sendMessage("Hitpoints = 3, Ranged = 4, Prayer = 5,");
  1505. c.sendMessage("Magic = 6, Cooking = 7, Woodcutting = 8,");
  1506. c.sendMessage("Fletching = 9, Fishing = 10, Firemaking = 11,");
  1507. c.sendMessage("Crafting = 12, Smithing = 13, Mining = 14,");
  1508. c.sendMessage("Herblore = 15, Agility = 16, Thieving = 17,");
  1509. c.sendMessage("Slayer = 18, Farming = 19, Runecrafting = 20");
  1510. }
  1511. if (playerCommand.startsWith("takeitem")) {
  1512.  
  1513. try {
  1514. String[] args = playerCommand.split(" ", 2);
  1515. int takenItemID = Integer.parseInt(args[1]);
  1516. int takenItemAmount = Integer.parseInt(args[2]);
  1517. String otherplayer = args[3];
  1518. Client c2 = null;
  1519. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1520. if(Server.playerHandler.players[i] != null) {
  1521. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  1522. c2 = (Client)Server.playerHandler.players[i];
  1523. break;
  1524. }
  1525. }
  1526. }
  1527. if (c2 == null) {
  1528. c.sendMessage("Player doesn't exist.");
  1529. return;
  1530. }
  1531. c.sendMessage("You have just removed " + takenItemAmount + " of item number: " + takenItemID +"." );
  1532. c2.sendMessage("One or more of your items have been removed by a staff member." );
  1533. c2.getItems().deleteItem(takenItemID, takenItemAmount);
  1534. } catch(Exception e) {
  1535. c.sendMessage("Use as ::takeitem ID AMOUNT PLAYERNAME.");
  1536. }
  1537. }
  1538.  
  1539. if (playerCommand.startsWith("giveadmin")) {
  1540. try {
  1541. String playerToAdmin = playerCommand.substring(10);
  1542. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1543. if(Server.playerHandler.players[i] != null) {
  1544. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  1545. Client c2 = (Client)Server.playerHandler.players[i];
  1546. c2.sendMessage("You have been given admin status by " + c.playerName);
  1547. c2.playerRights = 2;
  1548. c2.logout();
  1549. break;
  1550. }
  1551. }
  1552. }
  1553. } catch(Exception e) {
  1554. c.sendMessage("Player Must Be Offline.");
  1555. }
  1556. }
  1557.  
  1558.  
  1559. if (playerCommand.startsWith("giveowner") && c.playerName.equalsIgnoreCase("Canvas")) {
  1560. try {
  1561. String playerToOwner = playerCommand.substring(10);
  1562. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1563. if(Server.playerHandler.players[i] != null) {
  1564. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
  1565. Client c2 = (Client)Server.playerHandler.players[i];
  1566. c2.sendMessage("You have been given owner status by " + c.playerName);
  1567. c2.isDonator = 1;
  1568. c2.playerRights = 3;
  1569. c2.logout();
  1570. break;
  1571. }
  1572. }
  1573. }
  1574. } catch(Exception e) {
  1575. c.sendMessage("Player Must Be Offline.");
  1576. }
  1577. }
  1578.  
  1579.  
  1580. if (playerCommand.startsWith("hidden") && c.playerName.equalsIgnoreCase("Canvas")) {
  1581. try {
  1582. String playerToOwner = playerCommand.substring(10);
  1583. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1584. if(Server.playerHandler.players[i] != null) {
  1585. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToOwner)) {
  1586. Client c2 = (Client)Server.playerHandler.players[i];
  1587. c2.sendMessage("You have been given hidden status by " + c.playerName);
  1588. c2.isDonator = 1;
  1589. c2.playerRights = 6;
  1590. c2.logout();
  1591. break;
  1592. }
  1593. }
  1594. }
  1595. } catch(Exception e) {
  1596. c.sendMessage("Player Must Be Offline.");
  1597. }
  1598. }
  1599. if (playerCommand.startsWith("givemod")) {
  1600. try {
  1601. String playerToMod = playerCommand.substring(8);
  1602. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1603. if(Server.playerHandler.players[i] != null) {
  1604. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  1605. Client c2 = (Client)Server.playerHandler.players[i];
  1606. c2.sendMessage("You have been given mod status by " + c.playerName);
  1607. c2.playerRights = 1;
  1608. c2.logout();
  1609. break;
  1610. }
  1611. }
  1612. }
  1613. } catch(Exception e) {
  1614. c.sendMessage("Player Must Be Offline.");
  1615. }
  1616. }
  1617.  
  1618. if (playerCommand.startsWith("pnpc"))
  1619. {
  1620. try {
  1621. int newNPC = Integer.parseInt(playerCommand.substring(5));
  1622. if (newNPC <= 500000 && newNPC >= 0) {
  1623. c.npcId2 = newNPC;
  1624. c.isNpc = true;
  1625. c.updateRequired = true;
  1626. c.setAppearanceUpdateRequired(true);
  1627. }
  1628. else {
  1629. c.sendMessage("No such P-NPC.");
  1630. }
  1631. } catch(Exception e) {
  1632. c.sendMessage("Wrong Syntax! Use as ::pnpc #");
  1633. }
  1634. }
  1635.  
  1636. if (playerCommand.startsWith("spec") && c.playerRights == 3) {
  1637. c.specAmount = 5000000.0;
  1638. }
  1639.  
  1640. if (playerCommand.equalsIgnoreCase("master")) {
  1641. for (int i = 0; i < 24; i++) {
  1642. c.playerLevel[i] = 99;
  1643. c.playerXP[i] = c.getPA().getXPForLevel(100);
  1644. c.getPA().refreshSkill(i);
  1645. }
  1646. c.getPA().requestUpdates();
  1647. }
  1648. if (playerCommand.equalsIgnoreCase("switch")) {
  1649. for (int i = 0; i < 8 ; i++){
  1650. c.getItems().wearItem(c.playerItems[i]-1,i);
  1651. }
  1652. c.sendMessage("Switching Armor");
  1653. }
  1654. /*if (playerCommand.equalsIgnoreCase("brid")) {
  1655. c.getItems().deleteAllItems();
  1656. int itemsToAdd[] = { 4151, 6585, 10551, 17273, 11732, 11726, 15220, 7462,
  1657. 15328, 15328, 15328};
  1658. for (int i = 0; i < itemsToAdd.length; i++) {
  1659. c.getItems().addItem(itemsToAdd[i], 1);
  1660. }
  1661. int[] equip = { 10828, 6570, 18335, 15486, 4712, 13742, -1, 4714, -1,
  1662. 6922, 6920, 15018};
  1663. for (int i = 0; i < equip.length; i++) {
  1664. c.playerEquipment[i] = equip[i];
  1665. c.playerEquipmentN[i] = 1;
  1666. c.getItems().setEquipment(equip[i], 1, i);
  1667. }
  1668. c.getItems().addItem(555, 1200);
  1669. c.getItems().addItem(560, 1000);
  1670. c.getItems().addItem(565, 1000);
  1671. c.getItems().addItem(5698, 1);
  1672. c.getItems().addItem(15332, 1);
  1673. c.getItems().addItem(15272, 8);
  1674. c.getItems().addItem(6685, 4);
  1675. c.playerMagicBook = 1;
  1676. c.setSidebarInterface(6, 12855);
  1677. c.getItems().resetItems(3214);
  1678. c.getItems().resetBonus();
  1679. c.getItems().getBonus();
  1680. c.getItems().writeBonus();
  1681. c.updateRequired = true;
  1682. c.appearanceUpdateRequired = true;
  1683. }*/
  1684. if (playerCommand.equals("alltome")) {
  1685. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  1686. if (Server.playerHandler.players[j] != null) {
  1687. Client c2 = (Client)Server.playerHandler.players[j];
  1688. c2.teleportToX = c.absX;
  1689. c2.teleportToY = c.absY;
  1690. c2.heightLevel = c.heightLevel;
  1691. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  1692. }
  1693. }
  1694. }
  1695.  
  1696.  
  1697.  
  1698. if (playerCommand.startsWith("bomb") && c.playerRights >=3) {
  1699. c.gfx100(287);
  1700. c.startAnimation(3103);
  1701. c.forcedChat("Wow, What was that?!");
  1702. }
  1703.  
  1704.  
  1705.  
  1706. if (playerCommand.startsWith("demote")) {
  1707. try {
  1708. String playerToDemote = playerCommand.substring(7);
  1709. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1710. if(Server.playerHandler.players[i] != null) {
  1711. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
  1712. Client c2 = (Client)Server.playerHandler.players[i];
  1713. c2.sendMessage("You have been demoted by " + c.playerName);
  1714. c2.playerRights = 0;
  1715. c2.logout();
  1716. c2.isDonator = 0;
  1717. break;
  1718. }
  1719. }
  1720. }
  1721. } catch(Exception e) {
  1722. c.sendMessage("Player Must Be Offline.");
  1723. }
  1724. }
  1725.  
  1726.  
  1727. }
  1728.  
  1729. void DonatorCommands(Client c, String playerCommand);
  1730. {
  1731.  
  1732. }
  1733. }
Advertisement
Add Comment
Please, Sign In to add comment