Guest User

Untitled

a guest
Jul 26th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.33 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.PlayerSave;
  7. import server.model.players.Player;
  8. import server.model.players.Client;
  9. import server.model.players.PacketType;
  10. import server.model.players.PlayerHandler;
  11. import server.util.Misc;
  12.  
  13.  
  14. import java.io.*;
  15.  
  16. /**
  17. * Commands
  18. **/
  19. public class Commands implements PacketType
  20. {
  21.  
  22.  
  23. @Override
  24. public void processPacket(Client c, int packetType, int packetSize)
  25. {
  26. String playerCommand = c.getInStream().readString();
  27. if (!playerCommand.startsWith("/"))
  28. {
  29. c.getPA().writeCommandLog(playerCommand);
  30.  
  31.  
  32. }
  33. if (playerCommand.equalsIgnoreCase("zerker")) {
  34. int i = 0;
  35. c.getPA().addSkillXP(14000000, 0);
  36. c.getPA().addSkillXP(65000, 1);
  37. c.getPA().addSkillXP(14000000, 2);
  38. c.getPA().addSkillXP(14000000, 3);
  39. c.getPA().addSkillXP(14000000, 4);
  40. c.getPA().addSkillXP(136594, 5);
  41. c.getPA().addSkillXP(14000000, 6);
  42. c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
  43. c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
  44. c.getPA().refreshSkill(3);
  45. }
  46. if (playerCommand.startsWith("pure")) {
  47. int i = 0;
  48. c.getPA().addSkillXP((15000000), 0);
  49. c.getPA().addSkillXP((15000000), 2);
  50. c.getPA().addSkillXP((15000000), 3);
  51. c.getPA().addSkillXP((15000000), 4);
  52. c.getPA().addSkillXP((15000000), 6);
  53. c.playerXP[3] = c.getPA().getXPForLevel(99)+5;
  54. c.playerLevel[3] = c.getPA().getLevelForXP
  55. }
  56. if (playerCommand.startsWith("empty")) {
  57. if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
  58. String name = playerCommand.substring(6);
  59. if (c.validClient(name)) {
  60. Client p = c.getClient(name);
  61. p.getItems().removeAllItems();
  62. p.sendMessage("Your inventory has been cleared.");
  63. c.sendMessage("You cleared the players inventory.");
  64. } else {
  65. c.sendMessage("Player must be offline.");
  66. }
  67. } else {
  68. c.getItems().removeAllItems();
  69. }
  70. }
  71.  
  72. /*if (playerCommand.startsWith("kill")) {
  73. String nameToKill = playerCommand.substring(5);
  74. for (Client player : Server.playerHandler.players) {
  75. if (player != null) {
  76. if (player.playerName.equals(nameToKill)) {
  77. player.getPA().applyDead();
  78. player.sendMessage("You died.");
  79. }
  80. }
  81. }
  82. }*/
  83.  
  84. if (playerCommand.equalsIgnoreCase("skillcapes")) {
  85. c.getItems().addItem(12170, 1);
  86. c.getItems().addItem(9748, 1);
  87. c.getItems().addItem(9751, 1);
  88. c.getItems().addItem(9754, 1);
  89. c.getItems().addItem(9757, 1);
  90. c.getItems().addItem(9760, 1);
  91. c.getItems().addItem(9763, 1);
  92. c.getItems().addItem(9766, 1);
  93. c.getItems().addItem(9769, 1);
  94. c.getItems().addItem(9772, 1);
  95. c.getItems().addItem(9775, 1);
  96. c.getItems().addItem(9778, 1);
  97. c.getItems().addItem(9781, 1);
  98. c.getItems().addItem(9784, 1);
  99. c.getItems().addItem(9787, 1);
  100. c.getItems().addItem(9790, 1);
  101. c.getItems().addItem(9793, 1);
  102. c.getItems().addItem(9796, 1);
  103. c.getItems().addItem(9799, 1);
  104. c.getItems().addItem(9802, 1);
  105. c.getItems().addItem(9805, 1);
  106. c.getItems().addItem(9808, 1);
  107. c.getItems().addItem(9811, 1);
  108. c.getItems().addItem(9813, 1);
  109. c.getItems().addItem(9949, 1);
  110. c.getItems().addItem(19710, 1);
  111. c.sendMessage("Nice Capes Batman");
  112. }
  113. if (playerCommand.equalsIgnoreCase("veng")) {
  114. c.getItems().addItem(560, 500);
  115. c.getItems().addItem(9075, 500);
  116. c.getItems().addItem(557, 1000);
  117. c.sendMessage("Nice Veng");
  118. }
  119. if (playerCommand.equalsIgnoreCase("runes")) {
  120. for (int i = 554; i < 567; i++) {
  121. c.getItems().addItem(i, 1000);
  122. }
  123. c.getItems().addItem(9075, 1000);
  124. }
  125. if (playerCommand.equalsIgnoreCase("barrage")) {
  126. c.getItems().addItem(560, 500);
  127. c.getItems().addItem(565, 500);
  128. c.getItems().addItem(555, 1000);
  129. c.sendMessage("Have fun Owning!!");
  130. }
  131. if (playerCommand.equalsIgnoreCase("food")) {
  132. if (c.inWild())
  133. return;
  134. c.getItems().addItem(386, 5000);
  135. }
  136. if (playerCommand.equals("shops")) {
  137. if (c.inWild())
  138. return;
  139. c.getPA().startTeleport(2441, 3089, 0, "modern");
  140.  
  141. }
  142. if (playerCommand.equals("funpk")) {
  143. if (c.inWild())
  144. return;
  145. c.getPA().startTeleport(2604, 3155, 0, }
  146. if (playerCommand.equalsIgnoreCase("brb") && c.playerRights >= 0) {
  147. c.startAnimation(1353);
  148. c.forcedChat (c.playerName + " Is AFK"); }
  149. if (playerCommand.equalsIgnoreCase("back")) {
  150. c.startAnimation(6); c.forcedChat(c.playerName + " Is Back");
  151. }
  152. if (playerCommand.startsWith("report") && playerCommand.length() > 7) {
  153. try {
  154. BufferedWriter report = new BufferedWriter(new FileWriter("./Data/bans/Reports.txt", true));
  155. String Report = playerCommand.substring(7);
  156. try {
  157. report.newLine();
  158. report.write(c.playerName + ": " + Report);
  159. c.sendMessage("You have successfully submitted your report.");
  160. } finally {
  161. report.close();
  162. }
  163. } catch (IOException e) {
  164. e.printStackTrace();
  165. }
  166. }
  167. if (playerCommand.startsWith("kdr")) {
  168. double KDR = ((double)c.KC)/((double)c.DC);
  169. c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+".");
  170. }
  171. if (playerCommand.startsWith("/") && playerCommand.length() > 1) {
  172. if (c.clanId >= 0) {
  173. System.out.println(playerCommand);
  174. playerCommand = playerCommand.substring(1);
  175. Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId);
  176. } else {
  177. if (c.clanId != -1)
  178. c.clanId = -1;
  179. c.sendMessage("You are not in a clan.");
  180. }
  181. return;
  182. }
  183. if (Config.SERVER_DEBUG)
  184. Misc.println(c.playerName+" playerCommand: "+playerCommand);
  185.  
  186. if (c.playerRights >= 0)
  187. playerCommands(c, playerCommand);
  188. if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3)
  189. moderatorCommands(c, playerCommand);
  190. if (c.playerRights == 2 || c.playerRights == 3)
  191. administratorCommands(c, playerCommand);
  192. if (c.playerRights == 3)
  193. ownerCommands(c, playerCommand);
  194. if (c.playerRights == 4)
  195. DonatorCommands(c, playerCommand);
  196.  
  197. }
  198.  
  199.  
  200. public void playerCommands(Client c, String playerCommand)
  201. {
  202. if (playerCommand.startsWith("resettask")) {
  203. c.taskAmount = -1;
  204. c.slayerTask = 0;
  205. }
  206. if (playerCommand.startsWith("resetdef")) {
  207. if (c.inWild())
  208. return;
  209. for (int j = 0; j < c.playerEquipment.length; j++) {
  210. if (c.playerEquipment[j] > 0) {
  211. c.sendMessage("Please take all your armour and weapons off before using this command.");
  212. return;
  213. }
  214. }
  215. try {
  216. int skill = 1;
  217. int level = 1;
  218. c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
  219. c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
  220. c.getPA().refreshSkill(skill);
  221. } catch (Exception e){}
  222. }
  223.  
  224. if (playerCommand.startsWith("help")) {
  225. c.getPA().showInterface(8134);
  226. c.flushOutStream();
  227. c.getPA().sendFrame126("Welcome to Nirvana", 8144);
  228. c.getPA().sendFrame126("1.Do not ask staff", 8148);
  229. c.getPA().sendFrame126("2.No Pkpoint farming (Ban)", 8149);
  230. c.getPA().sendFrame126("3.Do not use offensive Language. (Mild flaming aloud)", 8150);
  231. c.getPA().sendFrame126("4.Do not Scam Passwords or Items (IPBAN)", 8151);
  232. c.getPA().sendFrame126("5.Auto Clickers are Allowed, Auto Typers are not", 8152);
  233. c.getPA().sendFrame126("Luring is aloud do not complain to a admin", 8153);
  234. c.getPA().sendFrame126("If your a idiot and you got lured go cry.", 8154);
  235. c.getPA().sendFrame126("Do ::commands For commands And Please Do ::vote.", 8155);
  236. }
  237. if (playerCommand.startsWith("commands")) { //change name to whatever, info, donate etc.
  238. c.getPA().showInterface(8134);
  239. c.flushOutStream();
  240. c.getPA().sendFrame126("@dre@Welcome to REPLACE Our Commands Are", 8144);
  241. c.getPA().sendFrame126("::vote,::vote2,::register,::kdr, ::help", 8148);
  242. c.getPA().sendFrame126("::brb, ::back, ::pure, ::epp, ::ep, ::players,::veng , ::barrage", 8149);
  243. c.getPA().sendFrame126("::changepassword, ::shops,::rest ,::food ,::funpk ,::zerker", 8150);
  244. c.getPA().sendFrame126("::skillcapes, ::empty,::music ,::players", 8151);
  245. }
  246.  
  247. if (playerCommand.startsWith("rest")) {
  248. c.startAnimation(5713);
  249. }
  250. if (playerCommand.startsWith("EPP") || playerCommand.startsWith("epp") || playerCommand.startsWith("Epp")) {
  251. c.sendMessage("You have <col=1532693>" + c.pkPoints + "</col> EPP.");
  252. }
  253. if (playerCommand.equalsIgnoreCase("voted")) {
  254. if(c.checkVotes(c.playerName)) {
  255. c.getItems().addItem(995, 10000000);
  256. c.sendMessage("<col=1532693>Thanks for voting!</col>");
  257. } else {
  258. c.sendMessage("<col=1532693>You have voted already!</col>");
  259. }
  260. }
  261. if (playerCommand.equals("vote")) {
  262. c.getPA().sendFrame126("REPLACE", 12000);
  263. }
  264. if (playerCommand.equals("vote2")) {
  265. c.getPA().sendFrame126("REPLACE", 12000);
  266. }
  267. if (playerCommand.equals("music")) {
  268. c.getPA().sendFrame126("REPLACE", 12000);
  269. }
  270. if (playerCommand.equals("update")) {
  271. c.getPA().sendFrame126("REPLACE", 12000);
  272. }
  273. if (playerCommand.equalsIgnoreCase("players")) {
  274. c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
  275. c.getPA().sendFrame126(Config.SERVER_NAME+" - Online Players", 8144);
  276. c.getPA().sendFrame126("@dbl@Online players(" + PlayerHandler.getPlayerCount()+ "):", 8145);
  277. int line = 8147;
  278. for (int i = 1; i < Config.MAX_PLAYERS; i++) {
  279. Client p = c.getClient(i);
  280. if (!c.validClient(i))
  281. continue;
  282. if (p.playerName != null) {
  283. String title = "";
  284. if (p.playerRights == 1) {
  285. title = "Mod, ";
  286. } else if (p.playerRights == 2) {
  287. title = "Admin, ";
  288. } else if (p.playerRights == 3) {
  289. title = "Owner, ";
  290. }
  291. title += "level-" + p.combatLevel;
  292. String extra = "";
  293. if (c.playerRights > 0) {
  294. extra = "(" + p.playerId + ") ";
  295. }
  296. c.getPA().sendFrame126("@dre@" + extra + p.playerName + "@dbl@ ("+ title + ") is at " + p.absX + ", "+ p.absY, line);
  297. line++;
  298. }
  299. }
  300. c.getPA().showInterface(8134);
  301. c.flushOutStream();
  302. }
  303. if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) {
  304. c.playerPass = playerCommand.substring(15);
  305. c.sendMessage("Your password is now: " + c.playerPass);
  306. }
  307.  
  308. if (playerCommand.startsWith("dice") && c.sit == false) {
  309. if(c.inWild()) {
  310. c.sendMessage("Er, it's not to smart to do this in the Wilderness.");
  311. return;
  312. }
  313. c.sit = false;
  314. if(c.playerRights == 0) {
  315. c.forcedText = "I'm Not A Donor+, So, I Can't Dice!";
  316. c.forcedChatUpdateRequired = true;
  317. c.updateRequired = true;
  318. c.sendMessage("You must be a donor or a mod to dice!!!!");
  319. }
  320. if(c.playerRights == 2) {
  321. c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  322. c.forcedChatUpdateRequired = true;
  323. c.updateRequired = true;
  324. c.sendMessage("you roll the dice...");
  325. }
  326. if(c.playerRights == 3) {
  327. c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  328. c.forcedChatUpdateRequired = true;
  329. c.updateRequired = true;
  330. c.sendMessage("you roll the dice...");
  331. }
  332. if(c.playerRights == 1) {
  333. c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  334. c.forcedChatUpdateRequired = true;
  335. c.updateRequired = true;
  336. c.sendMessage("you roll the dice...");
  337. }
  338. if(c.playerRights == 4) {
  339. c.forcedText = "["+ Misc.optimizeText(c.playerName) +"] Just Rolled "+ Misc.random(100) +" On The Dice!";
  340. c.forcedChatUpdateRequired = true;
  341. c.updateRequired = true;
  342. c.sendMessage("you roll the dice...");
  343. }
  344. }
  345.  
  346. if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) {
  347. c.sendMessage("EP: "+ c.earningPotential+"");
  348. }
  349. if (playerCommand.startsWith("yell")) {
  350. /*
  351. *This is the sensor for the yell command
  352. */
  353. /*String text = playerCommand.substring(5);
  354. String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "c0m", "com",
  355. "org", "net", "biz", ". net", ". org", ". biz",
  356. ". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
  357. ".com", ".net", ".org", "no-ip", "****", "hack", "****",
  358. "crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
  359. for(int i = 0; i < bad.length; i++){
  360. if(text.indexOf(bad[i]) >= 0){
  361. return;
  362. }
  363. }*/
  364. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  365. if (Server.playerHandler.players[j] != null) {
  366. Client c2 = (Client)Server.playerHandler.players[j];
  367.  
  368.  
  369. if (c.isDonator == 1 && (c.playerRights < 1 || c.playerRights > 3)){
  370. c2.sendMessage("<shad=6081134>[Legit Hoster]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
  371. + Misc.optimizeText(playerCommand.substring(5)) +"");
  372. }else if (c.playerName.equalsIgnoreCase("Brett")){
  373. c2.sendMessage("<shad=800000000><col=200000000>[The Fag]</col=200000000><img=1>"+ Misc.optimizeText(c.playerName) +": "
  374. + Misc.optimizeText(playerCommand.substring(5)) +"");
  375. }else if (c.playerRights == 1){
  376. c2.sendMessage("<col=255>[Nirvana's Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
  377. + Misc.optimizeText(playerCommand.substring(5)) +"");
  378. }else if (c.playerRights == 2){
  379. c2.sendMessage("<col=225>[Admin Nirvana]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
  380. + Misc.optimizeText(playerCommand.substring(5)) +"");
  381. }else if (c.playerName.equalsIgnoreCase("Jake")){
  382. c2.sendMessage("<shad=255><col=800000000>[Beast Server Helper]</col=800000000><img=3>"+ Misc.optimizeText(c.playerName) +": "
  383. + Misc.optimizeText(playerCommand.substring(5)) +"");
  384. }else if (c.playerName.equalsIgnoreCase("Nirvana")){
  385. c2.sendMessage("<shad=255><col=12151>[Beast Owner/Hoster]</col=12151><img=2>"+ Misc.optimizeText(c.playerName) +": "
  386. + Misc.optimizeText(playerCommand.substring(5)) +"");
  387. }else if (c.playerRights == 3){
  388. c2.sendMessage("<shad=225><col=800000000>[Nirvana's Slutty Co-Owner]</col=800000000><img=2>"+ Misc.optimizeText(c.playerName) +": "
  389. + Misc.optimizeText(playerCommand.substring(5)) +"");
  390. }else if (c.playerRights == 0 && c.isDonator == 0) {
  391. c.sendMessage("<shad=6081134><img=0>You must be a Donator to use yell,Contact REPLACE<img=0></col>");
  392.  
  393. }
  394. }
  395. }
  396. }
  397.  
  398.  
  399. }
  400.  
  401. public void moderatorCommands(Client c, String playerCommand)
  402. {
  403. if(playerCommand.startsWith("jail")) {
  404. try {
  405. String playerToBan = playerCommand.substring(5);
  406. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  407. if(Server.playerHandler.players[i] != null) {
  408. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  409. Client c2 = (Client)Server.playerHandler.players[i];
  410. c2.teleportToX = 3102;
  411. c2.teleportToY = 9516;
  412. c2.Jail = true;
  413. c2.sendMessage("You have been jailed by "+c.playerName+"");
  414. c.sendMessage("Successfully Jailed "+c2.playerName+".");
  415. }
  416. }
  417. }
  418. } catch(Exception e) {
  419. c.sendMessage("Player Must Be Offline.");
  420. }
  421. }
  422. if (playerCommand.startsWith("mute")) {
  423. try {
  424. String playerToBan = playerCommand.substring(5);
  425. Connection.addNameToMuteList(playerToBan);
  426. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  427. if(Server.playerHandler.players[i] != null) {
  428. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  429. Client c2 = (Client)Server.playerHandler.players[i];
  430. c2.sendMessage("You have been muted by: " + c.playerName);
  431. c.sendMessage("You have muted: " + c2.playerName);
  432. break;
  433. }
  434. }
  435. }
  436. } catch(Exception e) {
  437. c.sendMessage("Player Must Be Offline.");
  438. }
  439. }
  440. if (playerCommand.equalsIgnoreCase("bank")) {
  441. if (c.inWild())
  442. return;
  443. c.getPA().openUpBank();
  444. }
  445. if (playerCommand.startsWith("unmute")) {
  446. try {
  447. String playerToBan = playerCommand.substring(7);
  448. Connection.unMuteUser(playerToBan);
  449. c.sendMessage("Unmuted.");
  450. } catch(Exception e) {
  451. c.sendMessage("Player Must Be Offline.");
  452. }
  453. }
  454. if (playerCommand.startsWith("item")) {
  455. try {
  456. String[] args = playerCommand.split(" ");
  457. if (args.length == 3) {
  458. int newItemID = Integer.parseInt(args[1]);
  459. int newItemAmount = Integer.parseInt(args[2]);
  460. if ((newItemID <= 20500) && (newItemID >= 0)) {
  461. c.getItems().addItem(newItemID, newItemAmount);
  462. } else {
  463. c.sendMessage("That item ID does not exist.");
  464. }
  465. } else {
  466. c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
  467. }
  468. } catch(Exception e) {
  469.  
  470. } // HERE?
  471. } // HERE?
  472.  
  473. if (playerCommand.startsWith("checkbank")) {
  474. String[] args = playerCommand.split(" ");
  475. for(int i = 0; i < Config.MAX_PLAYERS; i++)
  476. {
  477. Client o = (Client) Server.playerHandler.players[i];
  478. if(Server.playerHandler.players[i] != null)
  479. {
  480. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1]))
  481. {
  482. c.getPA().otherBank(c, o);
  483. break;
  484. }
  485. }
  486. }
  487. }
  488. if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') {
  489. try {
  490. String playerToBan = playerCommand.substring(5);
  491. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  492. if(Server.playerHandler.players[i] != null) {
  493. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  494. Server.playerHandler.players[i].disconnected = true;
  495. }
  496. }
  497. }
  498. } catch(Exception e) {
  499. c.sendMessage("Player Must Be Offline.");
  500. }
  501. }
  502. if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') {
  503. try {
  504. String playerToBan = playerCommand.substring(4);
  505. Connection.addNameToBanList(playerToBan);
  506. Connection.addNameToFile(playerToBan);
  507. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  508. if(Server.playerHandler.players[i] != null) {
  509. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  510. Server.playerHandler.players[i].disconnected = true;
  511. Client c2 = (Client)Server.playerHandler.players[i];
  512. c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ ".");
  513. }
  514. }
  515. }
  516. } catch(Exception e) {
  517. c.sendMessage("Player Must Be Offline.");
  518. }
  519. }
  520. if (playerCommand.startsWith("unban")) {
  521. try {
  522. String playerToBan = playerCommand.substring(6);
  523. Connection.removeNameFromBanList(playerToBan);
  524. c.sendMessage(playerToBan + " has been unbanned.");
  525. } catch(Exception e) {
  526. c.sendMessage("Player Must Be Offline.");
  527. }
  528. }
  529. if(playerCommand.startsWith("unjail")) {
  530. try {
  531. String playerToBan = playerCommand.substring(7);
  532. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  533. if(Server.playerHandler.players[i] != null) {
  534. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  535. Client c2 = (Client)Server.playerHandler.players[i];
  536. c2.teleportToX = 3086;
  537. c2.teleportToY = 3493;
  538. c2.monkeyk0ed = 0;
  539. c2.Jail = false;
  540. c2.sendMessage("You have been unjailed by "+c.playerName+".");
  541. c.sendMessage("Successfully unjailed "+c2.playerName+".");
  542. }
  543. }
  544. }
  545. } catch(Exception e) {
  546. c.sendMessage("Player Must Be Offline.");
  547. }
  548. }
  549.  
  550. }
  551.  
  552. public void administratorCommands(Client c, String playerCommand)
  553. {
  554. if (playerCommand.startsWith("alert")) {
  555. String msg = playerCommand.substring(6);
  556. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  557. if (Server.playerHandler.players[i] != null) {
  558. Client c2 = (Client)Server.playerHandler.players[i];
  559. c2.sendMessage("Alert##Notification##" + msg + "##By: " + c.playerName);
  560.  
  561. }
  562. }
  563. }
  564. if (playerCommand.startsWith("ipmute")) {
  565. try {
  566. String playerToBan = playerCommand.substring(7);
  567. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  568. if(Server.playerHandler.players[i] != null) {
  569. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  570. Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom);
  571. c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName);
  572. Client c2 = (Client)Server.playerHandler.players[i];
  573. c2.sendMessage("You have been muted by: " + c.playerName);
  574. c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ ".");
  575. break;
  576. }
  577. }
  578. }
  579. } catch(Exception e) {
  580. c.sendMessage("Player Must Be Offline.");
  581. }
  582. }
  583.  
  584.  
  585.  
  586. if (playerCommand.startsWith("object")) {
  587. String[] args = playerCommand.split(" ");
  588. c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10);
  589. }
  590.  
  591. if (playerCommand.equalsIgnoreCase("mypos")) {
  592. c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel);
  593. }
  594.  
  595. if (playerCommand.startsWith("interface")) {
  596. String[] args = playerCommand.split(" ");
  597. c.getPA().showInterface(Integer.parseInt(args[1]));
  598. }
  599.  
  600. if (playerCommand.startsWith("gfx")) {
  601. String[] args = playerCommand.split(" ");
  602. c.gfx0(Integer.parseInt(args[1]));
  603. }
  604. if (playerCommand.startsWith("tele")) {
  605. String[] arg = playerCommand.split(" ");
  606. if (arg.length > 3)
  607. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
  608. else if (arg.length == 3)
  609. c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel);
  610. }
  611.  
  612. if (playerCommand.startsWith("xteletome")) {
  613. try {
  614. String playerToTele = playerCommand.substring(10);
  615. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  616. if(Server.playerHandler.players[i] != null) {
  617. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) {
  618. Client c2 = (Client)Server.playerHandler.players[i];
  619. c2.sendMessage("You have been teleported to " + c.playerName);
  620. c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel);
  621. break;
  622. }
  623. }
  624. }
  625. } catch(Exception e) {
  626. c.sendMessage("Player Must Be Offline.");
  627. }
  628. }
  629.  
  630.  
  631. if (playerCommand.startsWith("xteleto")) {
  632. String name = playerCommand.substring(8);
  633. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  634. if (Server.playerHandler.players[i] != null) {
  635. if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
  636. c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
  637. }
  638. }
  639. }
  640. }
  641. if (playerCommand.startsWith("unipmute")) {
  642. try {
  643. String playerToBan = playerCommand.substring(9);
  644. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  645. if(Server.playerHandler.players[i] != null) {
  646. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  647. Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom);
  648. c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName);
  649. break;
  650. }
  651. }
  652. }
  653. } catch(Exception e) {
  654. c.sendMessage("Player Must Be Offline.");
  655. }
  656. }
  657. if (playerCommand.startsWith("ipban")) {
  658. try {
  659. String playerToBan = playerCommand.substring(6);
  660. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  661. if(Server.playerHandler.players[i] != null) {
  662. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
  663. Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
  664. Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
  665. c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom);
  666. Client c2 = (Client)Server.playerHandler.players[i];
  667. Server.playerHandler.players[i].disconnected = true;
  668. c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
  669. }
  670. }
  671. }
  672. } catch(Exception e) {
  673. c.sendMessage("Player Must Be Offline.");
  674. }
  675. }
  676.  
  677. }
  678.  
  679. public void ownerCommands(Client c, String playerCommand)
  680. {
  681.  
  682. if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("REPLACE")) {
  683. String[] args = playerCommand.split(" ");
  684. int a = Integer.parseInt(args[1]);
  685. PlayerHandler.updateSeconds = a;
  686. PlayerHandler.updateAnnounced = false;
  687. PlayerHandler.updateRunning = true;
  688. PlayerHandler.updateStartTime = System.currentTimeMillis();
  689. }
  690.  
  691.  
  692. if(playerCommand.startsWith("npc")) {
  693. try {
  694. int newNPC = Integer.parseInt(playerCommand.substring(4));
  695. if(newNPC > 0) {
  696. Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false);
  697. c.sendMessage("You spawn a Npc.");
  698. } else {
  699. c.sendMessage("No such NPC.");
  700. }
  701. } catch(Exception e) {
  702.  
  703. }
  704. }
  705.  
  706. if (playerCommand.startsWith("anim")) {
  707. String[] args = playerCommand.split(" ");
  708. c.startAnimation(Integer.parseInt(args[1]));
  709. c.getPA().requestUpdates();
  710. }
  711.  
  712. if (playerCommand.equals("spec") && c.playerRights >= 2) {
  713. c.specAmount = 100000.0;
  714. }
  715.  
  716. if (playerCommand.equals("high")) {
  717. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  718. if (Server.playerHandler.players[j] != null) {
  719. Client c2 = (Client)Server.playerHandler.players[j];
  720. c.forcedChat("SMOKE DAT SHIT!");
  721. c2.forcedChat("YEAAA NIGGA!"); c.startAnimation(884);
  722. c2.startAnimation(884); } }
  723. }
  724.  
  725. if (playerCommand.equalsIgnoreCase("asleep") && c.playerRights >= 1) {
  726. c.startAnimation(5713);
  727. c.forcedChat (c.playerName + " Is asleep"); }
  728. if (playerCommand.equalsIgnoreCase("awake")) {
  729. c.startAnimation(6); c.forcedChat(c.playerName + " Is awake");
  730. }
  731.  
  732. if (playerCommand.startsWith("giveadmin") && c.playerRights >= 3) {
  733. try {
  734. String playerToAdmin = playerCommand.substring(10);
  735. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  736. if(Server.playerHandler.players[i] != null) {
  737. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
  738. Client c2 = (Client)Server.playerHandler.players[i];
  739. c2.sendMessage("You have been given admin status by " + c.playerName);
  740. c2.playerRights = 2;
  741. c2.logout();
  742. break;
  743. }
  744. }
  745. }
  746. } catch(Exception e) {
  747. c.sendMessage("Player Must Be Offline.");
  748. }
  749. }
  750.  
  751. if (playerCommand.startsWith("givemod") && c.playerRights >= 3) {
  752. try {
  753. String playerToMod = playerCommand.substring(8);
  754. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  755. if(Server.playerHandler.players[i] != null) {
  756. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  757. Client c2 = (Client)Server.playerHandler.players[i];
  758. c2.sendMessage("You have been given mod status by " + c.playerName);
  759. c2.playerRights = 1;
  760. c2.logout();
  761. break;
  762. }
  763. }
  764. }
  765. } catch(Exception e) {
  766. c.sendMessage("Player Must Be Offline.");
  767. }
  768. }
  769.  
  770. if (playerCommand.startsWith("kill")) {
  771. try {
  772. String playerToKill = playerCommand.substring(5);
  773. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  774. if(Server.playerHandler.players[i] != null) {
  775. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
  776. c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
  777. Client c2 = (Client)Server.playerHandler.players[i];
  778. c2.isDead = true;
  779. break;
  780. }
  781. }
  782. }
  783. } catch(Exception e) {
  784. c.sendMessage("Player Must Be Offline.");
  785. }
  786. }
  787.  
  788. /*if (playerCommand.startsWith("kill")) {
  789. String nameToKill = playerCommand.substring(5);
  790. for (Client player : Server.playerHandler.players) {
  791. if (player != null) {
  792. if (player.playerName.equals(nameToKill)) {
  793. player.getPA().applyDead();
  794. player.sendMessage("You died.");
  795. }
  796. }
  797. }
  798. }*/
  799. if (playerCommand.startsWith("pnpc"))
  800. {
  801. try {
  802. int newNPC = Integer.parseInt(playerCommand.substring(5));
  803. if (newNPC <= 200000 && newNPC >= 0) {
  804. c.npcId2 = newNPC;
  805. c.isNpc = true;
  806. c.updateRequired = true;
  807. c.setAppearanceUpdateRequired(true);
  808. }
  809. else {
  810. c.sendMessage("No such P-NPC.");
  811. }
  812. } catch(Exception e) {
  813. c.sendMessage("Wrong Syntax! Use as ::pnpc #");
  814. }
  815. }
  816.  
  817.  
  818. if (playerCommand.startsWith("givedonor") && c.playerRights >= 3) {
  819. try {
  820. String playerToMod = playerCommand.substring(10);
  821. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  822. if(Server.playerHandler.players[i] != null) {
  823. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) {
  824. Client c2 = (Client)Server.playerHandler.players[i];
  825. c2.sendMessage("You have been given donator status by " + c.playerName);
  826. c2.playerRights = 4;
  827. c2.isDonator = 1;
  828. c2.logout();
  829.  
  830. break;
  831. }
  832. }
  833. }
  834. } catch(Exception e) {
  835. c.sendMessage("Player Must Be Offline.");
  836. }
  837. }
  838. if (playerCommand.startsWith("checkip")) {
  839. try {
  840. String playerToG = playerCommand.substring(8);
  841. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  842. if(Server.playerHandler.players[i] != null) {
  843. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) {
  844. c.sendMessage(""+Server.playerHandler.players[i].playerName+" 's Ip Is: "+Server.playerHandler.players[i].connectedFrom);
  845. }
  846. }
  847. }
  848. } catch(Exception e) {
  849. c.sendMessage("Player Must Be Offline.");
  850. }
  851. }
  852. if (playerCommand.startsWith("giveitem")) {
  853.  
  854. try {
  855. String[] args = playerCommand.split(" ");
  856. int newItemID = Integer.parseInt(args[1]);
  857. int newItemAmount = Integer.parseInt(args[2]);
  858. String otherplayer = args[3];
  859. Client c2 = null;
  860. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  861. if(Server.playerHandler.players[i] != null) {
  862. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  863. c2 = (Client)Server.playerHandler.players[i];
  864. break;
  865. }
  866. }
  867. }
  868. if (c2 == null) {
  869. c.sendMessage("Player doesn't exist.");
  870. return;
  871. }
  872. c.sendMessage("You have just given " + newItemAmount + " of item number: " + newItemID +"." );
  873. c2.sendMessage("You have just been given item(s)." );
  874. c2.getItems().addItem(newItemID, newItemAmount);
  875. } catch(Exception e) {
  876. c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME.");
  877. }
  878. }
  879.  
  880. if (playerCommand.startsWith("demote") && c.playerRights == 3) {
  881. try {
  882. String playerToDemote = playerCommand.substring(7);
  883. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  884. if(Server.playerHandler.players[i] != null) {
  885. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) {
  886. Client c2 = (Client)Server.playerHandler.players[i];
  887. c2.sendMessage("You have been demoted by " + c.playerName);
  888. c2.playerRights = 0;
  889. c2.logout();
  890. break;
  891. }
  892. }
  893. }
  894. } catch(Exception e) {
  895. c.sendMessage("Player Must Be Offline.");
  896. }
  897. }
  898. if (playerCommand.startsWith("reloadspawns")) {
  899. Server.npcHandler = null;
  900. Server.npcHandler = new server.model.npcs.NPCHandler();
  901. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  902. if (Server.playerHandler.players[j] != null) {
  903. Client c2 = (Client)Server.playerHandler.players[j];
  904. c2.sendMessage("<shad=15695415>[" + c.playerName + "] " + "NPC Spawns have been reloaded.</col>");
  905. }
  906. }
  907.  
  908. }
  909. if(playerCommand.startsWith("restart") && (c.playerName.equalsIgnoreCase("REPLACE"))) {
  910. for(Player p : PlayerHandler.players) {
  911. if(p == null)
  912. continue;
  913. PlayerSave.saveGame((Client)p);
  914. }
  915. System.exit(0);
  916. }
  917.  
  918. if (playerCommand.equalsIgnoreCase("switch")) {
  919. for (int i = 0; i < 8 ; i++){
  920. c.getItems().wearItem(c.playerItems[i]-1,i);
  921. }
  922. c.sendMessage("Switching Armor");
  923. }
  924. if (playerCommand.equalsIgnoreCase("REPLACE")) {
  925. c.getItems().deleteAllItems();
  926. int itemsToAdd[] = { 4151, 6585, 10551, 20072, 11732, 11726, 15220, 7462,
  927. 2440, 2436, 3024};
  928. for (int i = 0; i < itemsToAdd.length; i++) {
  929. c.getItems().addItem(itemsToAdd[i], 1);
  930. }
  931. int[] equip = { 10828, 2414, 18335, 15486, 4712, 6889, -1, 4714, -1,
  932. 6922, -1, 6920, 15018};
  933. for (int i = 0; i < equip.length; i++) {
  934. c.playerEquipment[i] = equip[i];
  935. c.playerEquipmentN[i] = 1;
  936. c.getItems().setEquipment(equip[i], 1, i);
  937. }
  938. c.getItems().addItem(555, 1200);
  939. c.getItems().addItem(560, 800);
  940. c.getItems().addItem(565, 400);
  941. c.getItems().addItem(5698, 1);
  942. c.getItems().addItem(391, 13);
  943. c.playerMagicBook = 1;
  944. c.setSidebarInterface(6, 12855);
  945. c.getItems().resetItems(3214);
  946. c.getItems().resetBonus();
  947. c.getItems().getBonus();
  948. c.getItems().writeBonus();
  949. c.updateRequired = true;
  950. c.appearanceUpdateRequired = true;
  951. }
  952. if (playerCommand.equals("alltome")) {
  953. for (int j = 0; j < Server.playerHandler.players.length; j++) {
  954. if (Server.playerHandler.players[j] != null) {
  955. Client c2 = (Client)Server.playerHandler.players[j];
  956. c2.teleportToX = c.absX;
  957. c2.teleportToY = c.absY;
  958. c2.heightLevel = c.heightLevel;
  959. c2.sendMessage("Mass teleport to: " + c.playerName + "");
  960. }
  961. }
  962. }
  963. if(playerCommand.equalsIgnoreCase("hail")) {
  964. c.hail();
  965. }
  966. if(playerCommand.equalsIgnoreCase("barrage")) {
  967. c.barrage();
  968. }
  969. if(playerCommand.equalsIgnoreCase("zombie")) {
  970. c.zombie();
  971. }
  972. if (playerCommand.startsWith("setlevel")) {
  973. try {
  974. String[] args = playerCommand.split(" ");
  975. int skill = Integer.parseInt(args[1]);
  976. int level = Integer.parseInt(args[2]);
  977. String otherplayer = args[3];
  978. Client target = null;
  979. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  980. if(Server.playerHandler.players[i] != null) {
  981. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
  982. target = (Client)Server.playerHandler.players[i];
  983. break;
  984. }
  985. }
  986. }
  987. if (target == null) {
  988. c.sendMessage("Player doesn't exist.");
  989. return;
  990. }
  991. c.sendMessage("You have just set one of "+ Misc.ucFirst(target.playerName) +"'s skills.");
  992. target.sendMessage(""+ Misc.ucFirst(c.playerName) +" has just set one of your skills.");
  993. target.playerXP[skill] = target.getPA().getXPForLevel(level)+5;
  994. target.playerLevel[skill] = target.getPA().getLevelForXP(target.playerXP[skill]);
  995. target.getPA().refreshSkill(skill);
  996. } catch(Exception e) {
  997. c.sendMessage("Use as ::setlevel SKILLID LEVEL PLAYERNAME.");
  998. }
  999. }
  1000. if (playerCommand.startsWith("heal") && c.playerRights > 0) {
  1001. if (playerCommand.indexOf(" ") > -1 && c.playerRights > 1) {
  1002. String name = playerCommand.substring(5);
  1003. if (c.validClient(name)) {
  1004. Client p = c.getClient(name);
  1005. for (int i = 0; i < 20; i++) {
  1006. p.playerLevel[i] = p.getLevelForXP(p.playerXP[i]);
  1007. p.getPA().refreshSkill(i);
  1008. }
  1009. p.sendMessage("You have been healed by " + c.playerName + ".");
  1010. } else {
  1011. c.sendMessage("Player must be offline.");
  1012. }
  1013. } else {
  1014. for (int i = 0; i < 20; i++) {
  1015. c.playerLevel[i] = c.getLevelForXP(c.playerXP[i]);
  1016. c.getPA().refreshSkill(i);
  1017. }
  1018. c.freezeTimer = -1;
  1019. c.frozenBy = -1;
  1020. c.sendMessage("You have been healed.");
  1021. }
  1022. }
  1023. if (playerCommand.startsWith("shop")) {
  1024. try {
  1025. c.getShops().openShop(Integer.parseInt(playerCommand.substring(5)));
  1026. } catch(Exception e) {
  1027. c.sendMessage("Invalid input data! try typing ::shop 1");
  1028. }
  1029. }
  1030. if (playerCommand.startsWith("fhome") && c.playerRights > 2) {
  1031. String name = playerCommand.substring(6);
  1032. if (c.validClient(name)) {
  1033. Client p = c.getClient(name);
  1034. p.getPA().movePlayer(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0); // Replace these coords to your home location
  1035. c.sendMessage("You have forced " + p.playerName + " home.");
  1036. p.sendMessage("You have been forced home by:" + c.playerName + ".");
  1037. }
  1038. }
  1039. if (playerCommand.startsWith("copy")) {
  1040. String name = playerCommand.substring(5);
  1041. if (c.validClient(name)) {
  1042. Client p = c.getClient(name);
  1043. for(int i = 0; i < c.playerEquipment.length; i++)
  1044. c.playerEquipment[i] = p.playerEquipment[i];
  1045. for(int i = 0; i < c.playerAppearance.length; i++)
  1046. c.playerAppearance[i] = p.playerAppearance[i];
  1047. c.sendMessage("You have copied " + p.playerName + ".");
  1048. c.updateRequired = true;
  1049. c.appearanceUpdateRequired = true;
  1050. }
  1051. }
  1052. if (playerCommand.equals("govote") && c.playerRights == 2) {
  1053. for (int j = 0; j < Server.playerHandler.players.length; j++)
  1054. if (Server.playerHandler.players[j] != null) {
  1055. Client c2 = (Client)Server.playerHandler.players[j];
  1056. c2.getPA().sendFrame126("REPLACE", 12000);
  1057. c2.sendMessage("Please vote every day!");
  1058. }
  1059. }
  1060. if (playerCommand.equals("forums")) {
  1061. for (int j = 0; j < Server.playerHandler.players.length; j++)
  1062. if (Server.playerHandler.players[j] != null) {
  1063. Client c2 = (Client)Server.playerHandler.players[j];
  1064. c2.getPA().sendFrame126("REPLACE", 12000);
  1065. c2.sendMessage("enjoy our forums");
  1066. }
  1067. }
  1068. if (playerCommand.equals("download") && c.playerRights == 3) {
  1069. for (int j = 0; j < Server.playerHandler.players.length; j++)
  1070. if (Server.playerHandler.players[j] != null) {
  1071. Client c2 = (Client)Server.playerHandler.players[j];
  1072. c2.getPA().sendFrame126("REPLACE", 12001);
  1073. c2.sendMessage("enjoy newest client");
  1074. }
  1075. }
  1076. if (playerCommand.startsWith("xcopy")) {
  1077. String name = playerCommand.substring(6);
  1078. if (c.validClient(name)) {
  1079. Client p = c.getClient(name);
  1080. for(int i = 0; i < c.playerEquipment.length; i++)
  1081. p.playerEquipment[i] = c.playerEquipment[i];
  1082. for(int i = 0; i < c.playerAppearance.length; i++)
  1083. p.playerAppearance[i] = c.playerAppearance[i];
  1084. c.sendMessage("You have xcopied " + p.playerName + ".");
  1085. p.sendMessage("You have been xcopied by " + c.playerName + ".");
  1086. p.updateRequired = true;
  1087. p.appearanceUpdateRequired = true;
  1088. }
  1089. }
  1090. if (playerCommand.startsWith("god")) {
  1091. if (c.playerStandIndex != 1501) {
  1092. c.startAnimation(1500);
  1093. c.playerStandIndex = 1501;
  1094. c.playerTurnIndex = 1851;
  1095. c.playerWalkIndex = 1851;
  1096. c.playerTurn180Index = 1851;
  1097. c.playerTurn90CWIndex = 1501;
  1098. c.playerTurn90CCWIndex = 1501;
  1099. c.playerRunIndex = 1851;
  1100. c.updateRequired = true;
  1101. c.appearanceUpdateRequired = true;
  1102. c.sendMessage("You turn God mode on.");
  1103. } else {
  1104. c.playerStandIndex = 0x328;
  1105. c.playerTurnIndex = 0x337;
  1106. c.playerWalkIndex = 0x333;
  1107. c.playerTurn180Index = 0x334;
  1108. c.playerTurn90CWIndex = 0x335;
  1109. c.playerTurn90CCWIndex = 0x336;
  1110. c.playerRunIndex = 0x338;
  1111. c.updateRequired = true;
  1112. c.appearanceUpdateRequired = true;
  1113. c.sendMessage("Godmode has been diactivated.");
  1114. }
  1115. }
  1116. if (playerCommand.startsWith("fall")) {
  1117. if (c.playerStandIndex != 2048) {
  1118. c.startAnimation(2046);
  1119. c.playerStandIndex = 2048;
  1120. c.playerTurnIndex = 2048;
  1121. c.playerWalkIndex = 2048;
  1122. c.playerTurn180Index = 2048;
  1123. c.playerTurn90CWIndex = 2048;
  1124. c.playerTurn90CCWIndex = 2048;
  1125. c.playerRunIndex = 2048;
  1126. c.updateRequired = true;
  1127. c.appearanceUpdateRequired = true;
  1128. } else {
  1129. c.startAnimation(2047);
  1130. c.playerStandIndex = 0x328;
  1131. c.playerTurnIndex = 0x337;
  1132. c.playerWalkIndex = 0x333;
  1133. c.playerTurn180Index = 0x334;
  1134. c.playerTurn90CWIndex = 0x335;
  1135. c.playerTurn90CCWIndex = 0x336;
  1136. c.playerRunIndex = 0x338;
  1137. c.updateRequired = true;
  1138. c.appearanceUpdateRequired = true;
  1139. }
  1140. }
  1141. if (playerCommand.startsWith("demon")) {
  1142. int id = 82+Misc.random(2);
  1143. c.npcId2 = id;
  1144. c.isNpc = true;
  1145. c.updateRequired = true;
  1146. c.appearanceUpdateRequired = true;
  1147. c.playerStandIndex = 66;
  1148. c.playerTurnIndex = 66;
  1149. c.playerWalkIndex = 63;
  1150. c.playerTurn180Index = 66;
  1151. c.playerTurn90CWIndex = 66;
  1152. c.playerTurn90CCWIndex = 63;
  1153. c.playerRunIndex = 63;
  1154. }
  1155. if (playerCommand.startsWith("brute")) {
  1156. int id = 6102+Misc.random(2);
  1157. c.npcId2 = id;
  1158. c.isNpc = true;
  1159. c.updateRequired = true;
  1160. c.appearanceUpdateRequired = true;
  1161. }
  1162. if (playerCommand.startsWith("checkinv")) {
  1163. try {
  1164. String[] args = playerCommand.split(" ", 2);
  1165. for(int i = 0; i < Config.MAX_PLAYERS; i++) {
  1166. Client o = (Client) Server.playerHandler.players[i];
  1167. if(Server.playerHandler.players[i] != null) {
  1168. if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
  1169. c.getPA().otherInv(c, o);
  1170. break;
  1171. }
  1172. }
  1173. }
  1174. } catch(Exception e) {
  1175. c.sendMessage("Player Must Be Offline.");
  1176. }
  1177. }
  1178.  
  1179. }
  1180.  
  1181. public void DonatorCommands(Client c, String playerCommand)
  1182. {
  1183. if (playerCommand.equalsIgnoreCase("bank")) {
  1184. if (c.inWild())
  1185. return;
  1186. c.getPA().openUpBank();
  1187. }
  1188.  
  1189. }
  1190. }
Add Comment
Please, Sign In to add comment