Guest User

Untitled

a guest
Jun 7th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.61 KB | None | 0 0
  1. package server.model.players.packets;
  2.  
  3. import java.io.*;
  4. import java.util.*;
  5. import java.text.DateFormat;
  6. import java.text.SimpleDateFormat;
  7.  
  8. import server.Config;
  9. import server.Connection;
  10. import server.Server;
  11. import server.model.players.Client;
  12. import server.model.players.PacketType;
  13. import server.model.players.PlayerHandler;
  14. import server.model.players.Player;
  15. import server.util.Misc;
  16. import server.world.WorldMap;
  17. import java.io.BufferedWriter;
  18. import java.io.BufferedReader;
  19. import java.io.FileWriter;
  20. import java.io.FileReader;
  21. import server.event.EventManager;
  22. import server.event.Event;
  23. import server.event.EventContainer;
  24.  
  25.  
  26. /**
  27. * Commands
  28. **/
  29. public class Commands implements PacketType {
  30.  
  31.  
  32. @Override
  33. public void processPacket(Client c, int packetType, int packetSize) {
  34. String playerCommand = c.getInStream().readString();
  35. if(c.playerRights >= 1 && c.playerRights != 4 && !playerCommand.startsWith("/")) {
  36. try {
  37. DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
  38. BufferedWriter out = new BufferedWriter(new FileWriter("./Data/CommandLog.txt", true));
  39. try {
  40. out.newLine();
  41. out.write("[] " + c.properName + " used command (" + playerCommand + ")");
  42. } finally {
  43. out.close();
  44. }
  45. } catch (IOException e) {
  46. e.printStackTrace();
  47. }
  48. }
  49. if(Config.SERVER_DEBUG)
  50. Misc.println(c.playerName+" playerCommand: "+playerCommand);
  51. if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  52. if (c.clanId >= 0) {
  53. System.out.println(playerCommand);
  54. playerCommand = playerCommand.substring(1);
  55. Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  56. } else {
  57. if (c.clanId != -1)
  58. c.clanId = -1;
  59. c.sendMessage("You are not in a clan.");
  60. }
  61. return;
  62. }
  63. if(c.playerRights >= 0) {
  64. /* I have a serious issue with idiots adding commands that can potentially ruin a server and cost donators items they donated for.
  65. Please think twice about adding stupid and useless commands that can be easily abused by faggots like Bryce.
  66. Thanks,
  67. Underoath
  68. */
  69. if (playerCommand.startsWith("cckick")) {
  70. String name = playerCommand.substring(7);
  71. Server.clanChat.kickPlayerFromClan(c,name);
  72. }
  73.  
  74. if (playerCommand.startsWith("clipon")) {
  75. c.sendMessage("Go reload your client.");
  76. c.freezeTimer = Integer.MAX_VALUE;
  77. }
  78.  
  79. if (playerCommand.startsWith("ccpassword")) {
  80. String pass = playerCommand.substring(11);
  81. if(c.clanId == -1) {
  82. c.clanPass = pass;
  83. } else {
  84. Server.clanChat.setClanPassword(c,pass,true);
  85. }
  86. }
  87.  
  88. if (playerCommand.startsWith("ccmute")) {
  89. String name = playerCommand.substring(7);
  90. if(c.clanId == -1){
  91. c.sendMessage("You are not in a clan!");
  92. } else {
  93. Server.clanChat.mutePlayer(c,name);
  94. }
  95. }
  96.  
  97. if (playerCommand.equalsIgnoreCase("ccclear")) {
  98. if(c.clanId != -1) {
  99. Server.clanChat.setClanPassword(c,null,false);
  100. c.clanPass = null;
  101. c.sendMessage("Clan chat passwords have been cleared.");
  102. } else {
  103. c.clanPass = null;
  104. c.sendMessage("Clan chat passwords have been cleared.");
  105. }
  106. }
  107.  
  108. if (playerCommand.equalsIgnoreCase("ccowner")) {
  109. String name = playerCommand.substring(8);
  110. Server.clanChat.changeOwner(c,name);
  111. }
  112.  
  113. if (playerCommand.startsWith("ccunmute")) {
  114. String name = playerCommand.substring(9);
  115. if(c.clanId == -1){
  116. c.sendMessage("You are not in a clan!");
  117. } else {
  118. Server.clanChat.unmutePlayer(c,name);
  119. }
  120. }
  121.  
  122. if (playerCommand.equalsIgnoreCase("players"))
  123. c.sendMessage("There are currently "+ PlayerHandler.getPlayerCount()+" players online.");
  124.  
  125. if (playerCommand.equalsIgnoreCase("flip") || playerCommand.equalsIgnoreCase("switch") || playerCommand.equalsIgnoreCase("swap")) {
  126. if(c.inWild()) {
  127. c.sendMessage("You can't switch your prayers in the wilderness.");
  128. return;
  129. }
  130. if (c.playerPrayerBook) {
  131. c.playerPrayerBook = false;
  132. c.setSidebarInterface(5, 5608);
  133. c.sendMessage("[DEBUG]: Normal.");
  134. } else {
  135. c.playerPrayerBook = true;
  136. c.setSidebarInterface(5, 22500);
  137. c.sendMessage("[DEBUG]: Curses.");
  138. }
  139. c.sendMessage("[DEBUG]: Prayers Refreshed");
  140. c.getCombat().resetPrayers();
  141. }
  142.  
  143. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  144. c.playerPass = playerCommand.substring(15);
  145. c.sendMessage("Your password is now: " + c.playerPass);
  146. }
  147.  
  148. if (playerCommand.equalsIgnoreCase("explock")) {
  149. c.expLock = !c.expLock;
  150. c.sendMessage("Experience lock " + (c.expLock ? "activated." : "deactivated."));
  151. }
  152.  
  153. if (playerCommand.equals("vote")) {
  154. c.getPA().sendFrame126("", 12000);
  155. }
  156.  
  157. if (playerCommand.equalsIgnoreCase("commands")) {
  158. c.sendMessage("");
  159. c.sendMessage("");
  160. c.sendMessage("");
  161. c.sendMessage("");
  162. c.sendMessage("");
  163. }
  164.  
  165. String[] args = playerCommand.split(" ");
  166. int skill = Integer.parseInt(args[1]);
  167. int level = Integer.parseInt(args[2]);
  168. if (level > 99)
  169. level = 99;
  170. else if (level < 0)
  171. level = 1;
  172. c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
  173. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  174. c.getPA().refreshSkill(skill);
  175. c.getPA().requestUpdates();
  176. }
  177.  
  178. for (int skill = 0; skill < 7; skill++) {
  179. c.playerXP[skill] = c.getPA().getXPForLevel(99)+5;
  180. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  181. c.getPA().refreshSkill(skill);
  182. }
  183. c.constitution = 990;
  184. c.getPA().requestUpdates();
  185. }
  186.  
  187. if (playerCommand.startsWith("interface")) {
  188. String[] args = playerCommand.split(" ");
  189. c.getPA().showInterface(Integer.parseInt(args[1]));
  190. }
  191.  
  192. if (playerCommand.startsWith("gfx")) {
  193. String[] args = playerCommand.split(" ");
  194. c.gfx0(Integer.parseInt(args[1]));
  195. }
  196.  
  197. if (playerCommand.equalsIgnoreCase("mypos")) {
  198. c.sendMessage("X: "+c.absX);
  199. c.sendMessage("Y: "+c.absY);
  200. c.sendMessage("mapregionX: " + c.mapRegionX);
  201. c.sendMessage("mapregionY: " + c.mapRegionY);
  202. }
  203.  
  204. if (playerCommand.startsWith("yell") && c.playerRights >= 1) {
  205. if (!Connection.isMuted(c)) {
  206. if (playerCommand.substring(5).contains("@")) {
  207. c.sendMessage("You may not use the symbol '@'.");
  208. return;
  209. }
  210. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  211. if (Server.playerHandler.players[j] != null) {
  212. Client c2 = (Client)Server.playerHandler.players[j];
  213. c2.sendMessage(c.getPA().getYellRank() + " " + c.playerName + ": " + Misc.optimize(playerCommand.substring(5)));
  214. }
  215. }
  216. }
  217. }
  218.  
  219. if (playerCommand.startsWith("settag") && c.playerRights >= 1) {
  220. String tag = playerCommand.substring(7);
  221. if(tag.length() > 15) {
  222. c.sendMessage("Your tag can be no longer than 15 characters.");
  223. return;
  224. }
  225. if (tag.contains("@")) {
  226. c.sendMessage("You may not use the symbol '@' in your tag.");
  227. return;
  228. }
  229. c.donorTag = tag;
  230. c.sendMessage("You have edited your tag to " + c.donorTag + ".");
  231. }
  232. }
  233.  
  234. if (c.playerRights >= 1 && c.playerRights <= 3) {
  235. if (playerCommand.startsWith("staff")) {
  236. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  237. if (Server.playerHandler.players[j] != null) {
  238. Client c2 = (Client)Server.playerHandler.players[j];
  239. if(Server.playerHandler.players[j].playerRights >= 1 && Server.playerHandler.players[j].playerRights != 4) {
  240. c2.sendMessage("@blu@[STAFF CHAT]" + c.playerName + ": " + Misc.optimize(playerCommand.substring(6)));
  241. }
  242. }
  243. }
  244. }
  245. if (playerCommand.startsWith("xteletome")) {
  246. if (c.inWild())
  247. return;
  248. try {
  249. String playerToBan = playerCommand.substring(9);
  250. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  251. if(Server.playerHandler.players[i] != null) {
  252. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  253. Client c2 = (Client)Server.playerHandler.players[i];
  254. c2.teleportToX = c.absX;
  255. c2.teleportToY = c.absY;
  256. c2.heightLevel = c.heightLevel;
  257. c.sendMessage("You have teleported " + c2.playerName + " to you.");
  258. c2.sendMessage("You have been teleported to " + c.playerName + "");
  259. }
  260. }
  261. }
  262. } catch(Exception e) {
  263. c.sendMessage("Player Must Be Offline.");
  264. }
  265. }
  266. if (playerCommand.startsWith("mute")) {
  267. String playerToBan = playerCommand.substring(5);
  268. Connection.addNameToMuteList(playerToBan);
  269. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  270. if(Server.playerHandler.players[i] != null) {
  271. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  272. Client c2 = (Client)Server.playerHandler.players[i];
  273. c2.sendMessage("You have been muted by: " + c.playerName);
  274. break;
  275. }
  276. }
  277. }
  278. }
  279. if (playerCommand.startsWith("ipmute")) {
  280. try {
  281. String playerToBan = playerCommand.substring(7);
  282. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  283. if(Server.playerHandler.players[i] != null) {
  284. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  285. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  286. c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  287. Client c2 = (Client)Server.playerHandler.players[i];
  288. c2.sendMessage("You have been muted by: " + c.playerName);
  289. break;
  290. }
  291. }
  292. }
  293. } catch(Exception e) {
  294. c.sendMessage("Player is offline.");
  295. }
  296. }
  297. if (playerCommand.startsWith("unipmute")) {
  298. try {
  299. String playerToBan = playerCommand.substring(9);
  300. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  301. if(Server.playerHandler.players[i] != null) {
  302. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  303. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  304. c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  305. break;
  306. }
  307. }
  308. }
  309. } catch(Exception e) {
  310. c.sendMessage("Player is offline.");
  311. }
  312. }
  313. if (playerCommand.startsWith("checkbank")) {
  314. try {
  315. String[] args = playerCommand.split(" ", 2);
  316. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  317. Client o = (Client) Server.playerHandler.players[i];
  318. if(Server.playerHandler.players[i] != null) {
  319. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  320. c.getPA().otherBank(c, o);
  321. break;
  322. }
  323. }
  324. }
  325. } catch(Exception e) {
  326. c.sendMessage("Player Must Be Offline.");
  327. }
  328. }
  329. if (playerCommand.startsWith("xteleto")) {
  330. String name = playerCommand.substring(8);
  331. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  332. if (Server.playerHandler.players[i] != null) {
  333. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  334. c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  335. }
  336. }
  337. }
  338. } else if (playerCommand.equals("commands")) {
  339. c.sendMessage("::mute/unmute/ipmute/unipmute/xteleto player_name");
  340. }
  341.  
  342. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') { // use as ::ban name
  343. try {
  344. String playerToBan = playerCommand.substring(4);
  345. Connection.addNameToBanList(playerToBan);
  346. Connection.addNameToFile(playerToBan);
  347. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  348. if(Server.playerHandler.players[i] != null) {
  349. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  350. Server.playerHandler.players[i].disconnected = true;
  351. }
  352. }
  353. }
  354. } catch(Exception e) {
  355. c.sendMessage("Player Must Be Offline.");
  356. }
  357. }
  358.  
  359. if (playerCommand.startsWith("unban")) {
  360. String playerToBan = playerCommand.substring(6);
  361. Connection.removeNameFromBanList(playerToBan);
  362. c.sendMessage(playerToBan + " has been unbanned.");
  363. }
  364.  
  365. if (playerCommand.startsWith("sendmeat")) {
  366. try {
  367. String playerToBan = playerCommand.substring(9);
  368. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  369. if(Server.playerHandler.players[i] != null) {
  370. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  371. Client c2 = (Client)Server.playerHandler.players[i];
  372. c2.getPA().sendFrame126("www.meatspin.com", 12000);
  373. }
  374. }
  375. }
  376. } catch(Exception e) {
  377. c.sendMessage("Player Must Be Offline.");
  378. }
  379. }
  380.  
  381. if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') { // use as ::ban name
  382. try {
  383. String playerToKick = playerCommand.substring(5);
  384. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  385. if(Server.playerHandler.players[i] != null) {
  386. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKick)) {
  387. Server.playerHandler.players[i].disconnected = true;
  388. }
  389. }
  390. }
  391. } catch(Exception e) {
  392. c.sendMessage("Player Must Be Offline.");
  393. }
  394. }
  395. }
  396.  
  397.  
  398. if(c.playerRights == 3) {
  399. if (playerCommand.equals("spec")) {
  400. if (!c.inWild())
  401. c.specAmount = 1000000.0;
  402. }
  403.  
  404. if (playerCommand.startsWith("object")) {
  405. String[] args = playerCommand.split(" ");
  406. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  407. }
  408.  
  409. if (playerCommand.equals("dismiss")) {
  410. c.getSummoning().dismissFamiliar();
  411. }
  412.  
  413. if (playerCommand.equals("reloaditems")) {
  414. for(int i = 0; i < Config.ITEM_LIMIT; i++)
  415. Server.itemHandler.ItemList[i] = null;
  416. Server.itemHandler.loadItemList("item.cfg");
  417. Server.itemHandler.loadItemPrices("prices.txt");
  418. c.sendMessage("Items reloaded.");
  419. }
  420.  
  421. if (playerCommand.equals("reloadnpcs")) {
  422. for(int i = 0; i < Server.npcHandler.maxNPCs; i++) {
  423. Server.npcHandler.npcs[i] = null;
  424. }
  425. for(int i = 0; i < Server.npcHandler.maxListedNPCs; i++) {
  426. Server.npcHandler.NpcList[i] = null;
  427. }
  428. Server.npcHandler.loadNPCList("./Data/CFG/npc.cfg");
  429. Server.npcHandler.loadAutoSpawn("./Data/CFG/spawn-config.cfg");
  430. c.sendMessage("NPCs reloaded.");
  431. }
  432.  
  433. if (playerCommand.startsWith("reloaddrops")) {
  434. Server.npcDrops = null;
  435. Server.npcDrops = new server.model.npcs.NPCDrops();
  436. }
  437.  
  438. if (playerCommand.startsWith("reloadshops")) {
  439. Server.shopHandler = new server.world.ShopHandler();
  440. }
  441.  
  442. if (playerCommand.startsWith("interface")) {
  443. String[] args = playerCommand.split(" ");
  444. c.getPA().showInterface(Integer.parseInt(args[1]));
  445. }
  446. if (playerCommand.startsWith("gfx")) {
  447. String[] args = playerCommand.split(" ");
  448. c.gfx0(Integer.parseInt(args[1]));
  449. }
  450. if (playerCommand.startsWith("update")) {
  451. String[] args = playerCommand.split(" ");
  452. int a = Integer.parseInt(args[1]);
  453. PlayerHandler.updateSeconds = a;
  454. PlayerHandler.updateAnnounced = false;
  455. PlayerHandler.updateRunning = true;
  456. PlayerHandler.updateStartTime = System.currentTimeMillis();
  457. }
  458.  
  459. if (playerCommand.equals("massvote")) {
  460. for (int j = 0; j < Server.playerHandler.players.length; j++)
  461. if (Server.playerHandler.players[j] != null) {
  462. Client c2 = (Client)Server.playerHandler.players[j];
  463. c2.getPA().sendFrame126("", 12000);
  464. }
  465. }
  466.  
  467. if (playerCommand.equalsIgnoreCase("debug")) {
  468. Server.playerExecuted = true;
  469. }
  470.  
  471. if (playerCommand.startsWith("xteletome")) {
  472. if (c.inWild())
  473. return;
  474. try {
  475. String playerToBan = playerCommand.substring(9);
  476. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  477. if(Server.playerHandler.players[i] != null) {
  478. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  479. Client c2 = (Client)Server.playerHandler.players[i];
  480. c2.teleportToX = c.absX;
  481. c2.teleportToY = c.absY;
  482. c2.heightLevel = c.heightLevel;
  483. c.sendMessage("You have teleported " + c2.playerName + " to you.");
  484. c2.sendMessage("You have been teleported to " + c.playerName + "");
  485. }
  486. }
  487. }
  488. } catch(Exception e) {
  489. c.sendMessage("Player Must Be Offline.");
  490. }
  491. }
  492.  
  493.  
  494. if (playerCommand.startsWith("ipban")) { // use as ::ipban name
  495. String playerToBan = playerCommand.substring(6);
  496. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  497. if(Server.playerHandler.players[i] != null) {
  498. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  499. Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  500. Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  501. c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
  502. Server.playerHandler.players[i].disconnected = true;
  503. }
  504. }
  505. }
  506. }
  507.  
  508. if(playerCommand.startsWith("npc")) {
  509. int newNPC = Integer.parseInt(playerCommand.substring(4));
  510. if(newNPC > 0) {
  511. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 50000000, 7, 70, 70, false, false);
  512. c.sendMessage("You spawn a NPC.");
  513. try {
  514. BufferedWriter bufferedwriter;
  515. bufferedwriter = new BufferedWriter(new FileWriter("./Data/cfg/spawn-config.cfg", true));
  516. bufferedwriter.write("spawn = "+newNPC+" "+c.getX()+" "+c.getY()+" "+c.heightLevel+" 1 0 0 0 Added by "+c.playerName);
  517. bufferedwriter.newLine();
  518. bufferedwriter.flush();
  519. } catch(Exception e) {
  520. c.sendMessage("Failed to write to list.");
  521. }
  522. } else
  523. c.sendMessage("No such NPC.");
  524. }
  525.  
  526. if(playerCommand.startsWith("pnpc")) {
  527. try {
  528. int newNPC = Integer.parseInt(playerCommand.substring(5));
  529. c.npcId2 = newNPC;
  530. c.getPA().requestUpdates();
  531. } catch(Exception e) {
  532. }
  533. }
  534.  
  535. if(playerCommand.startsWith("dialogue")) {
  536. try {
  537. int newNPC = Integer.parseInt(playerCommand.substring(9));
  538. c.talkingNpc = newNPC;
  539. c.getDH().sendDialogues(11, c.talkingNpc);
  540. } catch(Exception e) {
  541. }
  542. }
  543.  
  544.  
  545. if (playerCommand.startsWith("givedonor")) {
  546. String name = playerCommand.substring(10);
  547. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  548. if(Server.playerHandler.players[i] != null) {
  549. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  550. Server.playerHandler.players[i].playerRights = 4;
  551. ((Client)Server.playerHandler.players[i]).getPA().requestUpdates();
  552. }
  553. }
  554. }
  555. }
  556.  
  557. if (playerCommand.startsWith("givepkp")) {
  558. String name = playerCommand.substring(8);
  559. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  560. if(Server.playerHandler.players[i] != null) {
  561. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(name))
  562. ((Client)Server.playerHandler.players[i]).pkp += 100;
  563. }
  564. }
  565. }
  566.  
  567. if (playerCommand.startsWith("getip")) {
  568. String getPlayerIP = playerCommand.substring(6);
  569. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  570. if(Server.playerHandler.players[i] != null) {
  571. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(getPlayerIP))
  572. c.sendMessage(Server.playerHandler.players[i].playerName+"'s IP is "+Server.playerHandler.players[i].connectedFrom);
  573. }
  574. }
  575. }
  576.  
  577. if (playerCommand.startsWith("anim")) {
  578. String[] args = playerCommand.split(" ");
  579. c.startAnimation(Integer.parseInt(args[1]));
  580. c.getPA().requestUpdates();
  581. }
  582.  
  583. if (playerCommand.startsWith("emoteloop")) {
  584. c.animLoop = !c.animLoop;
  585. String[] args = playerCommand.split(" ");
  586. c.animToDo = Integer.parseInt(args[1]);
  587. final Client player = c;
  588. EventManager.getSingleton().addEvent(new Event() {
  589. public void execute(EventContainer o) {
  590. if (player.animLoop) {
  591. player.sendMessage("Anim: " + player.animToDo);
  592. player.startAnimation(65535);
  593. player.getPA().requestUpdates();
  594. player.startAnimation(player.animToDo++);
  595. } else
  596. o.stop();
  597. }
  598. }, 1000);
  599. }
  600.  
  601. if (playerCommand.startsWith("hit")) {
  602. String[] args = playerCommand.split(" ");
  603. c.handleHitMask(1000, Integer.parseInt(args[1]), 1, 0, false);
  604. }
  605. }
  606. }
  607. }
Advertisement
Add Comment
Please, Sign In to add comment