Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
package server.model.players.packets; import com.motivoters.motivote.service.MotivoteRS; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Calendar; import server.Config; import server.ConnectionHandle; import server.Server; import server.clip.region.Region; import server.event.CycleEvent; import server.event.CycleEventContainer; import server.event.CycleEventHandler; import server.model.door.DoorHandler; import server.model.items.ItemAssistant; import server.model.minigames.CastleWars; import server.model.minigames.MOTM; import server.model.minigames.PyramidPlunder; import server.model.npcs.NPCHandler; import server.model.players.Achievements; import server.model.players.Client; import server.model.players.GameLogs; import server.model.players.PacketType; import server.model.players.Player; import server.model.players.PlayerAssistant; import server.model.players.PlayerHandler; import server.model.players.PlayerSave; import server.model.players.skills.construction.Construction; import server.model.players.skills.construction.ConstructionData; import server.model.players.skills.construction.Room; import server.util.Misc; import server.world.Boundaries.Area; /** * Commands **/ public class Commands implements PacketType { private final MotivoteRS motivote = new MotivoteRS("malice", "752598dd15a7e9f233b06ed2a979ed2d"); public static void moderatorAction(final Client c, String p2Name, int action) { c.afkTimer = 0; c.getPA().closeAllWindows(); switch (action) { case 0:// View Inventory c.getPA().viewProfile(c, true); break; case 1:// View Bank ItemAssistant.writeOtherBank(c); break; case 2:// Get IP c.sendMessage(p2Name + " (" + c.otherDisplay + ") has the ip " + c.otherIP); break; case 3:// List Accounts c.getPA().listAccounts(c.otherDisplay); break; case 4:// Jail if (c.otherJail != 1) { if (!jailPlayer(c, c.otherDisplay)) c.getPA().jailOther(c.otherDisplay); } else { if (!unjailPlayer(c, c.otherDisplay)) c.getPA().unjailOther(c.otherDisplay); } break; case 5:// Mute String lengthM = ""; Long result = ConnectionHandle.tempMuted.get(p2Name.toLowerCase() .replaceAll("_", " ")); if (result != null) { if (result > System.currentTimeMillis()) lengthM = " who had " + ((result - System.currentTimeMillis()) / (1000 * 60 * 60)) + " hours left."; } if (ConnectionHandle.mutedNames.contains(p2Name.toLowerCase())) lengthM = " whos mute was permanant."; if (lengthM.length() > 0) { ConnectionHandle.unMuteUser(p2Name.toLowerCase()); c.sendMessage("You have unmuted: " + p2Name + " (" + c.otherDisplay + ")" + lengthM); } else { ConnectionHandle.addNameToMuteList(p2Name); ConnectionHandle.addUserToFile(p2Name); c.sendMessage("You have muted: " + p2Name + " (" + c.otherDisplay + ")"); } break; case 6:// Ban String lengthB = ""; Long result2 = ConnectionHandle.tempBanned.get(p2Name.toLowerCase() .replaceAll("_", " ")); if (result2 != null) { if (result2 > System.currentTimeMillis()) lengthB = " who had " + ((result2 - System.currentTimeMillis()) / (1000 * 60 * 60)) + " hours left."; } if (ConnectionHandle.bannedNames.contains(p2Name.toLowerCase())) lengthB = " whos ban was permanant."; if (lengthB.length() > 0) { ConnectionHandle.removeNameFromBanList(p2Name.toLowerCase()); c.sendMessage("You have unbanned: " + p2Name + " (" + c.otherDisplay + ")" + lengthB); } else { ConnectionHandle.addNameToBanList(p2Name); ConnectionHandle.addNameToFile(p2Name); c.sendMessage("You have banned: " + p2Name + " (" + c.otherDisplay + ")"); kickPlayer(p2Name); } break; case 7:// IP Mute if (ConnectionHandle.isIpMuted(c.otherIP)) { ConnectionHandle.removeIpFromMuteList(c.otherIP); c.sendMessage("You have UnIP Muted the user: " + p2Name + " (" + c.otherDisplay + ") with the host: " + c.otherIP); } else { ConnectionHandle.addIpToMuteList(c.otherIP); c.sendMessage("You have IP Muted the user: " + p2Name + " (" + c.otherDisplay + ") with the host: " + c.otherIP); } break; case 8:// IP Ban if (ConnectionHandle.isIpBanned(c.otherIP)) { ConnectionHandle.removeIpFromBanList(c.otherIP); c.sendMessage("You have UnIP Banned the user: " + p2Name + " (" + c.otherDisplay + ") with the host: " + c.otherIP); } else { ConnectionHandle.addIpToBanList(c.otherIP); ConnectionHandle.addIpToFile(c.otherIP); c.sendMessage("You have IP Banned the user: " + p2Name + " (" + c.otherDisplay + ") with the host: " + c.otherIP); kickPlayer(p2Name); } break; case 9:// Temp Mute c.sendMessage("You have muted " + p2Name + " (" + c.otherDisplay + ") for " + c.muteHours + " hours."); ConnectionHandle.tempMute(p2Name, c.muteHours * 1000 * 60 * 60); break; case 10:// Temp Ban c.sendMessage("You have banned " + p2Name + " (" + c.otherDisplay + ") for " + c.banHours + " hours."); ConnectionHandle.tempBan(p2Name, c.banHours * 1000 * 60 * 60); kickPlayer(p2Name); break; } c.playerToModerate = ""; c.ipAction = 0; c.muteHours = 0; c.banHours = 0; c.dialogueAction = 0; return; } public static void UidBan(Client c, String otherName, String UUID) { if (UUID.equalsIgnoreCase("Unknown UID")) { c.sendMessage("You cannot uid ban " + otherName + " because his UID is unknown."); return; } ConnectionHandle.addUidToBanList(UUID); ConnectionHandle.addUidToFile(UUID); c.sendMessage("[" + otherName + "] has been UUID Banned with the UUID: " + UUID); kickPlayer(otherName); } public static void unUidBan(Client c, String otherName, String UUID) { ConnectionHandle.unUidBanUser(UUID); c.sendMessage("[" + otherName + "] has been unUUID Banned with the UUID: " + UUID); } public static void savePlayer(Client c, String otherName) { for (Player p : PlayerHandler.players) { if (p == null) continue; if (p.displayName.equalsIgnoreCase(otherName)) { Client c2 = (Client) PlayerHandler.players[p.playerId]; PlayerSave.saveGame(c2); return; } } } @Override public void processPacket(Client c, int packetType, int packetSize) { c.afkTimer = 0; String playerCommand = c.getInStream().readString(); if (playerCommand.startsWith(":CLANPACKET:")) { ClanChat.processClanPacket(c, playerCommand.substring(12)); return; } if (playerCommand.startsWith(":CLOSE:")) { c.getPA().closeAllWindows(); return; } if (playerCommand.startsWith("hash")) { System.out.println(Misc.jagHash("objos.idx")); return; } if (playerCommand.startsWith(":ZOOM:")) { c.clientZoom = Integer.parseInt(playerCommand.substring(6)); return; } if (playerCommand.startsWith("removeclip")) { Region.removeClip(c.absX, c.absY, 0); return; } /* * if (playerCommand.startsWith("gay")) { * System.out.println(TreasureTrails.hasScroll(c)); } */ if (playerCommand.startsWith(":DOORPACKET:")) { DoorHandler.addDoor(c, Integer.parseInt(playerCommand.substring(12))); return; } if (Config.SERVER_DEBUG) Misc.println(c.playerName + " playerCommand: " + playerCommand); if ((playerCommand.startsWith("/") && playerCommand.length() > 1) || playerCommand.startsWith("cc")) { if (c.getVariables().clanId >= 0) { // System.out.println(playerCommand); if (playerCommand.startsWith("cc")) playerCommand = playerCommand.substring(2); else playerCommand = playerCommand.substring(1); Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.getVariables().clanId); } else { if (c.getVariables().clanId != -1) c.getVariables().clanId = -1; c.sendMessage("You are not in a clan."); } return; } c.getTradeAndDuel().declineTrade(); if (c.playerRights != 0) GameLogs.logCommands(c, playerCommand); if (Config.SERVER_DEBUG) Misc.println(c.playerName + " playerCommand: " + playerCommand); if (c.playerRights >= 0) playerCommands(c, playerCommand); if ((c.playerRights > 0 && c.playerRights < 4) || c.playerRights == 5) moderatorCommands(c, playerCommand); if (c.playerRights == 2 || c.playerRights == 3) administratorCommands(c, playerCommand); if (c.playerRights == 3) ownerCommands(c, playerCommand); if (c.donorStatus > 0) DonatorCommands(c, playerCommand); } public void playerCommands(Client c, String playerCommand) { if (playerCommand.startsWith("[NOT]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 0); } if (playerCommand.startsWith("[REC]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 1); } if (playerCommand.startsWith("[COR]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 2); } if (playerCommand.startsWith("[SER]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 3); } if (playerCommand.startsWith("[LIE]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 4); } if (playerCommand.startsWith("[CAP]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 5); } if (playerCommand.startsWith("[GEN]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 6); } if (playerCommand.startsWith("[FRI]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 7); } if (playerCommand.startsWith("[DFR]")) { playerCommand = playerCommand.substring(5); c.getCC().process(c, playerCommand, 8); } if (playerCommand.startsWith("[CN]")) { playerCommand = playerCommand.substring(5); Server.clanChat.changeClanName(c, playerCommand); } if (playerCommand.startsWith("[NC]")) { playerCommand = playerCommand.substring(5); Server.clanChat.kickPlayerFromClan(c, playerCommand); } if (playerCommand.equalsIgnoreCase("loadchar")) { int RVal = PlayerSave.loadOldChar(c, c.playerName, c.playerPass); if (RVal == 13) c.sendMessage("Player account reloaded from file successfully. Please log out."); else c.sendMessage("Could not find player: " + RVal); } if (playerCommand.equalsIgnoreCase("party")) { if (!c.inCombat) c.startAnimation(7071); } if (playerCommand.equalsIgnoreCase("stage")) { c.sendMessage("Quest Stage: "+ c.getQH().quests[2].getStage()); } if (playerCommand.equalsIgnoreCase("stretchme")) { if (!c.inCombat) c.startAnimation(12650); } if (playerCommand.equalsIgnoreCase("test")) { c.getPA().sendFrame126("@yel@" + c.playerLevel[21] + "", 18166); // hunter } if (playerCommand.equalsIgnoreCase("stand")) { c.playerStandIndex = 10997; } if (playerCommand.equalsIgnoreCase("bac")) { if (c.bAC < 0) c.bAC = 0; c.sendMessage("Your BAC is " + String.format("%.3g%n", c.bAC)); } if (playerCommand.equalsIgnoreCase("asdasd")) { c.connectedFrom = "70.44.19.22"; } if (playerCommand.startsWith("forumverify")) { int fId = 0; try { fId = Integer.parseInt(playerCommand.substring(12)); } catch (Exception e) { c.sendMessage("Invalid Syntax: Use ::forumverify #"); } if (fId <= 0) return; try { Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/zarporco_vb4p", "zarpor", Config.DBPW); Statement statement = con.createStatement(); ResultSet result = statement .executeQuery("SELECT * FROM `user` WHERE ipaddress LIKE '" + c.connectedFrom + "' AND userid = '" + fId + "'"); while (result.next()) { c.forumName = result.getString("username"); c.forumId = fId; c.sendMessage("Successfully linked forum account: " + c.forumName + " (" + fId + ")"); statement.close(); con.close(); return; } c.sendMessage("Could not find forum account! Log into the forums from this IP first."); statement.close(); con.close(); } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /* * if(playerCommand.equalsIgnoreCase("dump")) { for(int i = 10000; i < * 20000; i++) { c.getPA().sendFrame126(i + "", i); } } */ if (playerCommand.equalsIgnoreCase("save")) { if (System.currentTimeMillis() - c.lastSave > 2000) { c.gameAction = true; PlayerSave.saveGame(c); c.sendMessage("<col=1532693>Your Account Is Saved</col>"); c.lastSave = System.currentTimeMillis(); } } if ((playerCommand.equalsIgnoreCase("chill") || playerCommand.equalsIgnoreCase("private") || playerCommand .equalsIgnoreCase("air")) && c.playerRights == 6) { moderatorCommands(c, playerCommand); } if (playerCommand.equalsIgnoreCase("donated")) { if (System.currentTimeMillis() - c.lastCheckDonor > 5000) { if (c.inSpawnPK) { c.sendMessage("Please leave SpawnPK minigame before claiming a donation!"); return; } if (c.getItems().freeSlots() >= 8) { c.sendMessage("Checking donation status..."); c.lastCheckDonor = System.currentTimeMillis(); c.getDonator(); c.sendMessage("Donation status determined."); } else { c.sendMessage("You need at least 8 free inventory spaces to claim a donation!"); } } } if (playerCommand.startsWith("clearinv")) { try { String cmdV = playerCommand.substring(9); if (cmdV.equalsIgnoreCase("adminpermpl0x")) { c.getItems().removeAllItems(); c.sendMessage("You clear your inventory of items!"); } } catch (Exception e) { c.sendMessage("Wrong syntax, use as ::clearinv PW"); } } if (playerCommand.equalsIgnoreCase("skull")) { c.isSkulled = true; c.skullTimer = Config.SKULL_TIMER; c.headIconPk = 0; c.getPA().requestUpdates(); c.sendMessage("You've skulled yourself!"); } if (playerCommand.equalsIgnoreCase("rest")) { c.rest(); } if (playerCommand.equalsIgnoreCase("getest")) { // GrandExchange.openGEMain(c); } if (playerCommand.equalsIgnoreCase("rules")) { c.getPA().sendFrame126( "www.os-malice.com/forums/forumdisplay.php?16-Malice-Rules", 12000); } if (playerCommand.equalsIgnoreCase("xmasshop")) { c.getPA().sendFrame126( "www.os-malice.com/forums/showthread.php?31714-Happy-holidays-Christmas-Shop", 12000); } if (playerCommand.equalsIgnoreCase("v7info")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/showthread.php?29583-V7-and-the-future", 12000); } if (playerCommand.equalsIgnoreCase("howtodice")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/showthread.php?23682-Standardized-Dicing-Rules", 12000); } if (playerCommand.equalsIgnoreCase("community")) { c.getPA().sendFrame126("www.os-malice.com/community.php", 12000); } if (playerCommand.equalsIgnoreCase("league")) { c.getPA().sendFrame126("www.os-malice.com/league.html", 12000); } if (playerCommand.equalsIgnoreCase("updates")) { c.getPA().sendFrame126("www.os-malice.com/forums/forumdisplay.php?20-Malice-News", 12000); } if (playerCommand.equalsIgnoreCase("achievements")) { c.getPA().sendFrame126("www.os-malice.com/forums/showthread.php?31486-Achievement-Rewards!", 12000); } if (playerCommand.equalsIgnoreCase("appeal") || playerCommand.equalsIgnoreCase("appeals")) { c.getPA().sendFrame126( "www.os-malice.com/forums/forms.php?do=form&fid=3", 12000); } if (playerCommand.equalsIgnoreCase("recover") || playerCommand.equalsIgnoreCase("recovery")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/forumdisplay.php?109-Account-Recoveries", 12000); } if (playerCommand.equalsIgnoreCase("stream")) { c.getPA().sendFrame126("www.os-malice.com/forums/showthread.php?31230-Skiller-to-Max-livestream!", 12000); } if (playerCommand.equalsIgnoreCase("market")) { c.getPA().teleMarket(); } if (playerCommand.equalsIgnoreCase("dz")) { if (c.donorStatus == 0 && c.playerRights == 0) { c.sendMessage("Please type ::donate to visit the donator zone!"); return; } else { c.getPA().spellTeleport(2852, 2960, 0); c.sendMessage("Welcome to the Donator Zone!"); } } if (playerCommand.equalsIgnoreCase("dice")) { c.getPA().spellTeleport(2849, 5076, 0); } if (playerCommand.equalsIgnoreCase("guides")) { c.getPA().sendFrame126( "www.os-malice.com/forums/forumdisplay.php?46-Malice-Guides", 12000); } if (playerCommand.equalsIgnoreCase("goinggreen")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/showthread.php?10611-Going-Green-v2!", 12000); } if (playerCommand.equalsIgnoreCase("lottery")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/showthread.php?32169-Malice-Lottery-The-Revival", 12000); } /* * if (playerCommand.equalsIgnoreCase("motminfo")) { * c.getPA().sendFrame126( "www.os-malice.com/forums/index.php", 12000); } */ if (playerCommand.equalsIgnoreCase("donate")) { c.getPA().sendFrame126("www.os-malice.com/donate.php", 12000); c.sendMessage("If a window didn't already open up go to https://www.os-malice.com/donate.php"); } if (playerCommand.equalsIgnoreCase("forum") || playerCommand.equalsIgnoreCase("forums")) { c.getPA().sendFrame126("www.os-malice.com/forums", 12000); c.sendMessage("If a window didn't already open up go to https://www.os-malice.com/forums"); } if (playerCommand.equalsIgnoreCase("vote")) { c.getPA().sendFrame126( "www.os-malice.com/vote.php?user=" + c.displayName, 12000); c.sendMessage("If a window didn't already open up go to https://www.os-malice.com/vote.php"); } if (playerCommand.equalsIgnoreCase("commands")) { c.getPA() .sendFrame126( "www.os-malice.com/forums/showthread.php?28604-Player-Commands-List", 12000); c.sendMessage("If a window didn't already open up go to https://www.os-malice.com/donate.php"); } if (playerCommand.equalsIgnoreCase("checkboost")) { c.sendMessage("You have " + c.getXPBoost() + " minutes left of 50% XP Boost."); } if (playerCommand.equalsIgnoreCase("claim") || playerCommand.equalsIgnoreCase("voted")) { if (System.currentTimeMillis() - c.lastCheckDonor > 10000) { int voteV = c.checkVotes(); c.lastCheckDonor = System.currentTimeMillis(); if (voteV > 0) { Calendar cal = Calendar.getInstance(); c.votePoints += voteV; int quantity = voteV / 5; if (quantity < 1) quantity = 1; if(c.ironMan < 3){ c.getItems().addItemOrDrop(18768, quantity); c.getItems().addItemOrDrop(995, voteV * 1000000); if (c.boostXP > c.totalPlaytime) c.boostXP += (quantity * 3600); else c.boostXP = c.totalPlaytime + (quantity * 3600); c.sendMessage("You receive " + quantity + " mystery box" + (quantity > 1 ? "s" : "") + " as a reward for voting!"); c.sendMessage("You receive " + voteV + "M Malice gold as a reward!"); c.sendMessage("You also receive 50% XP boost for " + quantity + " hour" + (quantity > 1 ? "s" : "") + "!"); } c.sendMessage("You receive " + voteV + " Voting points as a reward!"); if(c.ironMan < 3) c.sendMessage("You can type ::checkboost to see how much time is left on your XP boost."); c.sendMessage("Thanks for voting, be sure to vote again in 12 hours!"); c.lastVoteDay = cal.get(Calendar.DAY_OF_MONTH); c.getPA().getVote(c); if (c.votePoints >= 25) Achievements.giveAchievement(c, 2, "Save up 25 Vote Points"); if (c.votePoints >= 150) Achievements.giveAchievement(c, 5, "Save up 150 Vote Points"); if (c.votePoints >= 300) Achievements.giveAchievement(c, 8, "Save up 300 Vote Points"); c.getPA().sendFrame126( "@or2@Voting Points - @yel@" + c.getVotePoints(), 29168); } else c.sendMessage("You must vote before you can receive a reward!"); } } if (playerCommand.equalsIgnoreCase("players")) { c.sendMessage("There are currently " + PlayerHandler.getPlayerCount() + " players online."); c.getPA().sendFrame126( "@cya@Online players(" + PlayerHandler.getPlayerCount() + "):", 8144); c.getPA().showInterface(8134); c.clearPlayersInterface(); int line = 8147; for (int i = 0; i < 200; i++) { Client p = c.getClient(i); if (!c.validClient(i)) continue; if (p.displayName != null) { String title = ""; if (p.playerRights == 1) title = "Mod, "; else if (p.playerRights == 2) title = "Admin, "; else if (p.playerRights == 3) title = "Owner, "; else if (p.playerRights == 5) title = "Global, "; else if (p.donorStatus > 0) title = "Donator, "; title += "level-" + p.combatLevel; String extra = ""; // if (c.playerRights > 0) { extra = "(" + p.playerId + ") "; // } if (line > 8195) c.getPA().sendFrame126( "@gre@" + extra + p.displayName + "@cya@ (" + title + ")", line + 3977); else c.getPA().sendFrame126( "@gre@" + extra + p.displayName + "@cya@ (" + title + ")", line); line++; } } c.flushOutStream(); } if (playerCommand.equalsIgnoreCase("staff")) { c.sendMessage("There are currently " + PlayerHandler.getStaffCount() + " staff online."); c.getPA() .sendFrame126( "@cya@Online staff(" + PlayerHandler.getStaffCount() + "):", 8144); c.getPA().showInterface(8134); c.clearPlayersInterface(); int line = 8147; for (int i = 0; i < 200; i++) { Client p = c.getClient(i); if (!c.validClient(i) || p.playerRights == 0 || p.playerRights == 6 || p.playerRights == 7) continue; if (p.displayName != null) { String title = ""; if (p.playerRights == 1) title = "Mod, "; else if (p.playerRights == 2) title = "Admin, "; else if (p.playerRights == 3) title = "Owner, "; else if (p.playerRights == 5) title = "Global, "; else if (p.donorStatus > 0) title = "Donator, "; title += "level-" + p.combatLevel; String extra = ""; // if (c.playerRights > 0) { extra = "(" + p.playerId + ") "; // } if (line > 8195) c.getPA().sendFrame126( "@gre@" + extra + p.displayName + "@cya@ (" + title + ")", line + 3977); else c.getPA().sendFrame126( "@gre@" + extra + p.displayName + "@cya@ (" + title + ")", line); line++; } } c.flushOutStream(); } if (playerCommand.startsWith("changename") && playerCommand.length() > 11) { String newName = playerCommand.substring(11).toLowerCase(); if (c.donorStatus >= 1) { Calendar cal = Calendar.getInstance(); if (c.dPoints < 50) { c.sendMessage("You need 50 dPoints to change your name!"); return; } if (c.lastNameChange == cal.get(Calendar.DAY_OF_YEAR) && c.playerName.toLowerCase().contains(newName) == false) { c.sendMessage("You have already changed your name once today!"); return; } if (c.displayName.toLowerCase().contains(newName)) { c.sendMessage("That is already your name!"); return; } if (!newName.matches("[A-Za-z0-9 ]+")) { c.sendMessage("Invalid character in name!"); return; } if (newName.length() > 12) { c.sendMessage("The name " + newName + " is too long to be used."); return; } if (PlayerAssistant.displayNameExists(newName)) { c.sendMessage("The name " + newName + " has already been used."); return; } for (int i = 0; i < Config.bannedNames.length; i++) if (newName.contains(Config.bannedNames[i])) { c.sendMessage("You cannot use that name."); return; } // Start Change... c.newName = newName; c.getDH().sendCName(newName); } else { c.sendMessage("You are not a donator!"); } } if (playerCommand.startsWith("noclip")) { if (c.playerRights != 2 && c.playerRights != 3) c.didNoclip = true; } if (playerCommand.startsWith("restart") && (c.playerRights >= 2)) { String resV = playerCommand.substring(8); if (Integer.parseInt(resV) > 0) { PlayerHandler.updateSeconds = Integer.parseInt(resV) + 1; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); } else c.sendMessage("Wrong syntax, use as ::restart #"); } if (playerCommand.startsWith("spec") && (c.playerRights >= 2)) { c.specAmount = 10; c.getItems().addSpecialBar(c.playerEquipment[Player.playerWeapon]); } if (playerCommand.startsWith("ep") || playerCommand.startsWith("Ep") || playerCommand.startsWith("EP") || playerCommand.startsWith("eP")) { c.sendMessage("EP: " + c.earningPotential + ""); } if (playerCommand.startsWith("yell") || playerCommand.startsWith("Yell")) { if (ConnectionHandle.isTempMuted(c.playerName.toLowerCase() .replaceAll(" ", "_"))) { c.sendMessage("You're muted for another " + ((ConnectionHandle.tempMuted.get(c.playerName .toLowerCase().replaceAll(" ", "_")) - System .currentTimeMillis()) / 1000 / 60 / 60 + 1) + " hours."); return; } if (c.inArea(Area.JAIL)) { c.sendMessage("You cannot yell in jail!"); return; } if (c.inArea(Area.FIGHTPITS)) { c.sendMessage("You cannot yell!"); return; } for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; boolean ignored = false; if (c.playerRights == 0 || c.playerRights == 4) { for (int i = 0; i < c2.ignores.length; i++) if (c2.ignores[i] == Misc .playerNameToInt64(c.displayName)) ignored = true; } if (!ConnectionHandle.isMuted(c) && !ignored) { if (c.playerRights == 1) c2.sendMessage("<shad=0>[Mod]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.playerRights == 2) { { c2.sendMessage("<shad=6792928>[Admin]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); } } else if (c.playerRights == 3) c2.sendMessage("<shad=8675997>[Owner]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.playerRights == 5) c2.sendMessage("<shad=10233095>[Global Mod]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.playerRights == 6) c2.sendMessage("<shad=12056624>[Forum Admin]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.playerRights == 7) c2.sendMessage("<shad=7648520>[MOTM]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.displayName.equalsIgnoreCase("makerio")) c2.sendMessage("<shad=49151>[Designer]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.donorStatus > 0) c2.sendMessage("<shad=7648520>[Donator]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); else if (c.promoterStatus > 0) c2.sendMessage("<shad=255>[Promoter]</col>" + c.getCrown(true, c.playerRights) + Misc.capitalize(c.displayName) + ": " + Misc.capitalizeFirstLetter(playerCommand .substring(5)) + ""); } } } if (c.playerRights == 0 && c.donorStatus == 0) c.sendMessage("You must be a donator or promoter to use this command!"); if (ConnectionHandle.isMuted(c)) c.sendMessage("You cannot yell if you are muted!"); } } public void moderatorCommands(final Client c, String playerCommand) { if (playerCommand.equalsIgnoreCase("fail")) { c.getPA().IronManFailed(); } if (playerCommand.equalsIgnoreCase("checkmaze")) { c.getPA().movePlayer(2907, 4559, 0); } if (playerCommand.startsWith("getuid")) { String p = playerCommand.substring(7); for (int i = 0; i < PlayerHandler.players.length; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].playerName.equalsIgnoreCase(p)) { c.sendMessage("Uid of " + PlayerHandler.players[i].playerName + " is " + PlayerHandler.players[i].UUID); } } } } if (playerCommand.equalsIgnoreCase("resetitems")) { c.getItems().updateInventory = true; c.getItems().resetItems(5064); c.sendMessage("items reset"); } if (playerCommand.equalsIgnoreCase("chill")) { c.getPA().movePlayer(2879 + Misc.random(3), 10203 + Misc.random(3), 10); } if (playerCommand.equalsIgnoreCase("air")) { c.getPA().movePlayer(2846 + Misc.random(1), 4836, 0); } if (playerCommand.equalsIgnoreCase("private")) { c.getPA().movePlayer(2541 + Misc.random(3), 3891, 0); } if (playerCommand.startsWith("jail")) { String playerToJail = playerCommand.substring(5); moderatorAction(c, playerToJail, 4); } if (playerCommand.startsWith("mod")) { c.getPA().modOptionsLoad(playerCommand.substring(4), true); } if (playerCommand.startsWith("modoptions")) { c.getPA().modOptionsLoad(playerCommand.substring(11), true); } if (playerCommand.startsWith("getdisplay")) { PlayerAssistant.getDisplay(c, playerCommand.substring(10)); } if (playerCommand.startsWith("checkbank")) { String args = playerCommand.substring(10); moderatorAction(c, args, 1); } if (playerCommand.startsWith("viewinv")) { String args = playerCommand.substring(8); moderatorAction(c, args, 0); } if (playerCommand.startsWith("resetkd")) { String playerToReset = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (o.playerRights == 0 || o.playerRights == 4) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToReset)) { o.playerKills = 0; o.playerDeaths = 0; break; } } } } } if (playerCommand.startsWith("resetmc")) { String playerToReset = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToReset)) { o.MCStage = 0; o.sendMessage("MC Reset."); o.getPA().movePlayer(c.getHomeX(), c.getHomeY(), 0); c.sendMessage("You reset their MC. "); } } } } if (playerCommand.startsWith("resetslayer")) { String playerToReset = playerCommand.substring(12); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToReset)) { o.slayerTask = -1; o.taskAmount = 0; o.sendMessage("Slayer Task Reset."); c.sendMessage("You reset their Slayer Task. "); } } } } if (playerCommand.startsWith("getzp")) { String player = playerCommand.substring(6); c.sendMessage("<col=16711680>Fetching the total amount of dPoints for " + player); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(player)) { c.sendMessage("<col=36608>" + player + "</col> - " + c.getItems().getDpointsPlayer( (Client) PlayerHandler.players[i])); } } } } if (playerCommand.startsWith("listrefs")) { c.sendMessage("<col=16711680>[Listing Referral Statistic]"); try { ResultSet result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '14944' AND points = '20'"); result.last(); c.sendMessage("<col=36608>RSPS: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '23639' AND points = '20'"); result.last(); c.sendMessage("<col=36608>League Guy Total Refs: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9038' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Mopar: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9039' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Runelocus: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9041' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Topofgames: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9042' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Mmorpgtoplist: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9046' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Ps-Inception: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9047' AND points = '20'"); result.last(); c.sendMessage("<col=36608>TopG: </col>" + result.getRow()); result = Server.stmGameData .executeQuery("SELECT * FROM `referpoints` WHERE playerID LIKE '9123' AND points = '20'"); result.last(); c.sendMessage("<col=36608>Sythe: </col>" + result.getRow()); c.sendMessage("<col=16711680>[Done]"); } catch (SQLException e) { e.printStackTrace(); } } if (playerCommand.startsWith("grabwealth")) { c.sendMessage("<col=16711680>Fetching the total amount of dPoints from everyone online."); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { c.sendMessage("<col=36608>" + PlayerHandler.players[i].displayName + "</col> - " + c.getItems().getDpointsPlayer( (Client) PlayerHandler.players[i])); } } c.sendMessage("<col=16711680>Finished!"); } if (playerCommand.startsWith("kick") && playerCommand.charAt(4) == ' ') { kickPlayer(playerCommand.substring(5)); } if (playerCommand.startsWith("shit")) { c.gfx0(572); } /* * if (playerCommand.startsWith("c")) { c.gfx100(c.ag1); * c.forcedChat("GFX ID: " + c.ag1); c.forcedChatUpdateRequired = true; * c.updateRequired = true; c.ag1++; } * * if (playerCommand.startsWith("b")) { c.ag1 -= 2; } */ if (playerCommand.startsWith("xteletome")) { try { String playerToTele = playerCommand.substring(10); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToTele)) { Client c2 = (Client) PlayerHandler.players[i]; c2.sendMessage("You have been teleported to " + c.displayName); c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("xteleto")) { String name = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(name)) { c.getPA().movePlayer(PlayerHandler.players[i].getX(), PlayerHandler.players[i].getY(), PlayerHandler.players[i].heightLevel); } } } } if (playerCommand.startsWith("killcraig")) { for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase("craig")) { Client c2 = (Client) PlayerHandler.players[i]; c2.getPA().applyDead(); } } } } /* * if (playerCommand.startsWith("mtm")) { try { String playerToBan = * playerCommand.substring(4); for (int i = 0; i < Config.MAX_PLAYERS; * i++) { if (PlayerHandler.players[i] != null) { if * (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToBan)) * { Client c2 = (Client) PlayerHandler.players[i]; c2.teleportToX = * 2849; c2.teleportToY = 5076; c2.heightLevel = 0; * c2.sendMessage("<shad=15695415>You have been moved to the market by " * + c.displayName + ".<shad>"); c2.sendMessage( * "<shad=15695415>Do all of your buying and selling to other players here and only here!</shad>" * ); c.sendMessage("Successfully moved " + c2.displayName + "."); } } } * } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } */ } private static void kickPlayer(String player) { try { for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) if (PlayerHandler.players[i].displayName .equalsIgnoreCase(player) || PlayerHandler.players[i].playerName .equalsIgnoreCase(player)) PlayerHandler.players[i].disconnected = true; } } catch (Exception e) { } } private static boolean jailPlayer(Client c, String player) { try { for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { Client c2 = (Client) PlayerHandler.players[i]; if (c2.displayName.equalsIgnoreCase(player) || c2.playerName.equalsIgnoreCase(player)) { c2.getPA().movePlayer(3102, 9516, 0); c2.Jail = true; c2.gameAction = true; PlayerSave.saveGame(c2); c.sendMessage("Successfully jailed " + c.otherDisplay + "."); return true; } } } } catch (Exception e) { } return false; } private static boolean unjailPlayer(Client c, String player) { try { for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { Client c2 = (Client) PlayerHandler.players[i]; if (c2.displayName.equalsIgnoreCase(player) || c2.playerName.equalsIgnoreCase(player)) { c2.teleportToX = 2112; c2.teleportToY = 3904; c2.heightLevel = 0; c2.monkeyk0ed = 0; c2.Jail = false; c.sendMessage("Successfully unjailed " + c.otherDisplay + "."); return true; } } } } catch (Exception e) { } return false; } public void administratorCommands(final Client c, String playerCommand) { if (playerCommand.startsWith("MOTDNPC")) { PlayerHandler.MOTDNPC = Integer .parseInt(playerCommand.substring(8)); } if (playerCommand.startsWith("MOTD1")) { PlayerHandler.MOTD1 = playerCommand.substring(6); } if (playerCommand.startsWith("MOTD2")) { PlayerHandler.MOTD2 = playerCommand.substring(6); } if (playerCommand.startsWith("MOTD3")) { PlayerHandler.MOTD3 = playerCommand.substring(6); } if (playerCommand.startsWith("grandexchange")) { c.getPA().teleMarket(); } if (playerCommand.startsWith("setiron")) { c.ironMan = Integer.parseInt(playerCommand.substring(8)); return; } if (playerCommand.equalsIgnoreCase("mark")) { c.tempPX = c.absX; c.tempPY = c.absY; c.sendMessage("Position marked."); } if (playerCommand.startsWith("return")) { c.getPA().movePlayer(c.tempPX, c.tempPY, 0); c.sendMessage("Returned to position."); } if (playerCommand.startsWith("checknpc")) { c.sendMessage(NPCHandler.getNpcName((Integer.parseInt(playerCommand.substring(9))))); } if (playerCommand.startsWith("walk1")) { c.getPA().sendParallellInterfaceVisibility(11146, true); } if (playerCommand.startsWith("testanims")) { c.animTestId = 1305; CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { try { c.sendMessage("Anim Id: " + c.animTestId); c.startAnimation(c.animTestId); c.animTestId++; } catch (NullPointerException e) { e.printStackTrace(); } } @Override public void stop() { } }, (int) 2); } if (playerCommand.startsWith("whip")) { c.getPA().sendFrame174(1080, 1, 60); c.sendMessage("playing whip"); } if (playerCommand.startsWith("invisible")) { c.invisible = !c.invisible; c.didTeleport = true; if (c.invisible) c.sendMessage("You will be invisible upon teleporting to another region."); else c.sendMessage("Other players can now see you."); c.update(); } if (playerCommand.equalsIgnoreCase("house")) { c.inBuildingMode = true; if (c.houseRooms[0][0][0] == null) { for (int x = 0; x < 13; x++) for (int y = 0; y < 13; y++) c.houseRooms[0][x][y] = new Room(0, ConstructionData.EMPTY, 0); } Construction.createPalette(c); } if (playerCommand.equalsIgnoreCase("house1")) { c.inBuildingMode = false; if (c.houseRooms[0][0][0] == null) { for (int x = 0; x < 13; x++) for (int y = 0; y < 13; y++) c.houseRooms[0][x][y] = new Room(0, ConstructionData.EMPTY, 0); } Construction.createPalette(c); } if (playerCommand.startsWith("forcechatall")) { String[] args = playerCommand.split("_"); for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; c2.forcedChat(args[1]); c2.forcedChatUpdateRequired = true; c2.updateRequired = true; } } } if (playerCommand.startsWith("forcechat")) { String[] args = playerCommand.split("_"); for (int i = 0; i < PlayerHandler.players.length; i++) { if (PlayerHandler.players[i] != null) { if (args[1] .equalsIgnoreCase(PlayerHandler.players[i].playerName)) { Client c2 = (Client) PlayerHandler.players[i]; c2.forcedChat(args[2]); c2.forcedChatUpdateRequired = true; c2.updateRequired = true; } } } } if (playerCommand.startsWith("forcebank")) { String[] args = playerCommand.split(" "); for (int i = 0; i < PlayerHandler.players.length; i++) { if (PlayerHandler.players[i] != null) { if (args[1] .equalsIgnoreCase(PlayerHandler.players[i].playerName)) { Client c2 = (Client) PlayerHandler.players[i]; c2.getPA().openUpBank(0); } } } } if (playerCommand.equals("freecashall") && c.playerRights > 1) { for (int j = 0; j < PlayerHandler.players.length; j++) if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; c2.getPA().sendFrame126("www.os-malice.com/vote.php", 12000); c2.sendMessage("[Server] Everybody vote to keep this server up and running. Thank you!"); c2.getItems().addItem(995, 1000000); } } if (playerCommand.startsWith("alert") && c.playerRights > 1) { String msg = playerCommand.substring(6); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { Client c2 = (Client) PlayerHandler.players[i]; c2.sendMessage("Alert##Notification##" + msg + "##By: " + c.displayName); } } } if (playerCommand.startsWith("ghost")) { String args = playerCommand.substring(6); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client c2 = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { c2.getPA().showInterface(18681); c.sendMessage("You scared " + c2.displayName + "."); break; } } } } if (playerCommand.startsWith("energyplz")) { c.runEnergy = 999999; } /* * if (playerCommand.startsWith("blind")) { for (int j = 0; j < * PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != * null) { Client c2 = (Client) PlayerHandler.players[j]; * c2.getPA().showInterface(13583); * c.sendMessage("Nobody can see now!"); } } } */ if (playerCommand.startsWith("getpin")) { String args = playerCommand.substring(7); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { c.sendMessage(o.displayName + "'s bank pin is " + o.bankPin + "."); break; } } } } if (playerCommand.startsWith("giveguthix")) { String args = playerCommand.substring(11); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.giveDonatorReward(1, 100); c.sendMessage("You've given " + o.playerName + " 100 dPoints."); break; } } } } if (playerCommand.startsWith("giveveteran")) { String args = playerCommand.substring(12); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.getItems().addItem(20764, 1); o.getItems().addItem(20763, 1); o.sendMessage("You've been given a veteran cape and hood!"); c.sendMessage("You've given " + o.playerName + " a veteran cape."); break; } } } } if (playerCommand.startsWith("giveoldfag")) { String args = playerCommand.substring(12); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.getItems().addItem(20765, 1); o.getItems().addItem(20766, 1); o.sendMessage("You've been given a classic cape and hood!"); c.sendMessage("You've given " + o.playerName + " a classic cape."); break; } } } } if (playerCommand.startsWith("givezammy")) { String args = playerCommand.substring(10); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.giveDonatorReward(2, 300); c.sendMessage("You've given " + o.playerName + " 300 dPoints."); break; } } } } if (playerCommand.startsWith("givesara")) { String args = playerCommand.substring(9); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.giveDonatorReward(3, 500); c.sendMessage("You've given " + o.playerName + " 500 dPoints."); break; } } } } if (playerCommand.startsWith("giveepic")) { String args = playerCommand.substring(9); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.giveDonatorReward(4, 1800); c.sendMessage("You've given " + o.playerName + " 1800 dPoints."); break; } } } } if (playerCommand.startsWith("givesuper")) { String args = playerCommand.substring(10); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { o.giveDonatorReward(5, 1100); c.sendMessage("You've given " + o.playerName + " 1100 dPoints."); break; } } } } if (playerCommand.startsWith("clip")) { try { BufferedWriter bw = new BufferedWriter(new FileWriter(new File( "./data/data/custom.txt"))); bw.write(c.getX() + ":" + c.getY() + ":" + c.heightLevel); Region.tempClip(c.getX(), c.getY(), c.heightLevel); bw.newLine(); bw.close(); } catch (IOException e) { e.printStackTrace(); } } if (playerCommand.startsWith("object")) { String[] args = playerCommand.split(" "); c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10); } if (playerCommand.startsWith("getkc")) { c.barrowsKillCount += 6; } if (playerCommand.startsWith("redeem")) { String auth = playerCommand.replace("redeem ", ""); try { boolean success = motivote.redeemVote(auth); if (success) { if (System.currentTimeMillis() - c.lastCheckDonor > 10000) { int voteV = c.checkVotes(); c.lastCheckDonor = System.currentTimeMillis(); if (voteV > 0) { Calendar cal = Calendar.getInstance(); c.votePoints += voteV; int quantity = voteV / 5; if (quantity < 1) quantity = 1; if(c.ironMan < 3){ c.getItems().addItemOrDrop(18768, quantity); c.getItems().addItemOrDrop(995, voteV * 1000000); if (c.boostXP > c.totalPlaytime) c.boostXP += (quantity * 3600); else c.boostXP = c.totalPlaytime + (quantity * 3600); c.sendMessage("You receive " + quantity + " mystery box" + (quantity > 1 ? "s" : "") + " as a reward for voting!"); c.sendMessage("You receive " + voteV + "M Malice gold as a reward!"); c.sendMessage("You also receive 50% XP boost for " + quantity + " hour" + (quantity > 1 ? "s" : "") + "!"); } c.sendMessage("You receive " + voteV + " Voting points as a reward!"); if(c.ironMan < 3) c.sendMessage("You can type ::checkboost to see how much time is left on your XP boost."); c.sendMessage("Thanks for voting, be sure to vote again in 12 hours!"); c.lastVoteDay = cal.get(Calendar.DAY_OF_MONTH); c.getPA().getVote(c); if (c.votePoints >= 25) Achievements.giveAchievement(c, 2, "Save up 25 Vote Points"); if (c.votePoints >= 150) Achievements.giveAchievement(c, 5, "Save up 150 Vote Points"); if (c.votePoints >= 300) Achievements.giveAchievement(c, 8, "Save up 300 Vote Points"); c.getPA().sendFrame126( "@or2@Voting Points - @yel@" + c.getVotePoints(), 29168); } } else { c.sendMessage("Invalid auth supplied, please try again later."); } } catch (Exception ex) { ex.printStackTrace(); c.sendMessage("Unable to check auth, please try again later."); } } if (playerCommand.startsWith("obj")) { try { int newobj = Integer.parseInt(playerCommand.substring(4)); int objectType = 10; for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; c2.newobject(c.absX, c.absY, newobj, 0, objectType); } } System.out.println("c.getPA().checkObjectSpawn2(" + c.absX + ", " + c.absY + ", " + newobj + ", 10, " + objectType + ");"); c.sendMessage("You spawned object: " + newobj + " at " + c.absX + ", " + c.absY); } catch (Exception error) { c.sendMessage("Wrong syntax, use as ::createobj #"); } } if (playerCommand.startsWith("del")) { for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; c2.newobject(c.absX, c.absY, -1, 0, 10); } } System.out.println("c.getPA().objectToRemove(" + c.absX + ", " + c.absY + ");"); c.sendMessage("You deleted an object at " + c.absX + ", " + c.absY); } /*if (playerCommand.equalsIgnoreCase("map")){ for (int i = 0; i < 10000; i++) c.getPA().sendFrame126(""+i, i); }*/ if (playerCommand.equalsIgnoreCase("mypos")) { c.sendMessage("X: " + c.absX + " Y: " + c.absY + " H: " + c.heightLevel); } if (playerCommand.startsWith("interface")) { String[] args = playerCommand.split(" "); c.getPA().showInterface(Integer.parseInt(args[1])); } if (playerCommand.startsWith("tab")) { String[] args = playerCommand.split(" "); c.setSidebarInterface(1, Integer.parseInt(args[1])); } if (playerCommand.startsWith("achiev")) { String[] args = playerCommand.split(" "); Achievements.giveAchievement(c, Integer.parseInt(args[1]), "TEST ACHIEVEMENT COMMAND"); } if (playerCommand.startsWith("sidebar")) { String[] args = playerCommand.split(" "); c.setSidebarInterface(15, Integer.parseInt(args[1])); } if (playerCommand.startsWith("shop")) { String[] args = playerCommand.split(" "); c.getShops().openShop(Integer.parseInt(args[1])); } if (playerCommand.startsWith("gfx")) { String[] args = playerCommand.split(" "); c.gfx0(Integer.parseInt(args[1])); } if (playerCommand.startsWith("tele")) { String[] arg = playerCommand.split(" "); if (arg.length > 3) c.getPA().movePlayer(Integer.parseInt(arg[1]), Integer.parseInt(arg[2]), Integer.parseInt(arg[3])); else if (arg.length == 3) c.getPA().movePlayer(Integer.parseInt(arg[1]), Integer.parseInt(arg[2]), c.heightLevel); } if (playerCommand.startsWith("saveall")) { for (Player p : PlayerHandler.players) { if (p == null) continue; Client c2 = (Client) PlayerHandler.players[p.playerId]; c2.gameAction = true; PlayerSave.saveGame(c2); } c.sendMessage("Saved All accounts"); } if (playerCommand.startsWith("givemotm")) { try { String playerToForum = playerCommand.substring(9); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToForum)) { Client c2 = (Client) PlayerHandler.players[i]; c2.sendMessage("You have been given member of the month by " + c.displayName); c2.playerRights = 7; c2.setChatTextUpdateRequired(true); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("givedonor")) { try { String[] args = playerCommand.split("_"); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args[1])) { Client c2 = (Client) PlayerHandler.players[i]; c2.sendMessage("You have been given donator status by " + c.displayName); c2.playerRights = 4; if (Integer.parseInt(args[2]) > 0 && Integer.parseInt(args[2]) < 6) c2.donorStatus = Integer.parseInt(args[2]); c2.setChatTextUpdateRequired(true); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("takedonor")) { try { String playerToMod = playerCommand.substring(10); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(playerToMod)) { Client c2 = (Client) PlayerHandler.players[i]; c2.playerRights = 0; c2.donorStatus = 0; c2.logout(); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("invclear")) { try { String otherplayer = playerCommand.substring(9); Client c2 = null; for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(otherplayer)) { c2 = (Client) PlayerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c2.getItems().removeAllItems(); c2.sendMessage("Your inventory has been cleared by a staff member."); c.sendMessage("You cleared " + c2.displayName + "'s inventory."); } catch (Exception e) { c.sendMessage("Use as ::invclear PLAYERNAME."); } } if (playerCommand.equalsIgnoreCase("up")) { c.getPA().movePlayer(c.absX, c.absY, c.heightLevel + 1); } if (playerCommand.equalsIgnoreCase("down")) { c.getPA().movePlayer(c.absX, c.absY, c.heightLevel + -1); } if (playerCommand.equalsIgnoreCase("shakenbake")) { for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; // c2.getPA().shakeScreen(1, 1, 1, 1);//ez drunk // c2.getPA().shakeScreen(2, 2, 2, 2);//meh drunk c2.getPA().shakeScreen(3, 3, 3, 3); } } } if (playerCommand.equalsIgnoreCase("bank")) { c.searchTerm = "N/A"; c.getPA().searchBank(c, c.searchTerm); } if (playerCommand.equalsIgnoreCase("reloadshops")) { Server.shopHandler.reloadshops(); c.sendMessage("You reload all shops."); } if (playerCommand.startsWith("pnpc")) { try { int newNPC = Integer.parseInt(playerCommand.substring(5)); if (newNPC <= 200000 && newNPC >= 0) { c.npcId2 = newNPC; c.isNpc = true; c.updateRequired = true; c.setAppearanceUpdateRequired(true); } else { c.sendMessage("No such P-NPC."); } } catch (Exception e) { c.sendMessage("Wrong Syntax! Use as ::pnpc #"); } } if (playerCommand.equals("allstafftome")) { for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; if (c2.playerRights > 0 && c2.playerRights < 4 || c2.playerRights == 5) { c2.teleportToX = c.absX; c2.teleportToY = c.absY; c2.heightLevel = c.heightLevel; c2.sendMessage("All staff teleported to: " + c.displayName + ""); } } } } } public void ownerCommands(final Client c, String playerCommand) { if (playerCommand.equalsIgnoreCase("getmotmwinner")) { c.sendMessage("Updating MOTM Winner."); MOTM.getWinner(); } if (playerCommand.equalsIgnoreCase("start")) { PyramidPlunder.startPyramidePlunder(c); } if (playerCommand.startsWith("sound")) { try { String playV = playerCommand.substring(6); int song = Integer.parseInt(playV); c.getPA().PlayerSoundEffect(song, 1, 0); c.sendMessage("Playing Sound " + song + "."); } catch (Exception e) { c.sendMessage("Wrong syntax, use as ::sound #"); } } if (playerCommand.startsWith("playsong")) { try { String playV = playerCommand.substring(9); int song = Integer.parseInt(playV); c.getPA().playSong(song); c.sendMessage("Playing Song " + song + "."); } catch (Exception e) { c.sendMessage("Wrong syntax, use as ::playsong #"); } } if (playerCommand.startsWith("playall")) { try { String playV = playerCommand.substring(8); int song = Integer.parseInt(playV); for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c2 = (Client) PlayerHandler.players[j]; c2.getPA().playSong(song); } } c.sendMessage("Playing Song " + song + "."); } catch (Exception e) { c.sendMessage("Wrong syntax, use as ::play #"); } } if (playerCommand.startsWith("npc")) { try { int newNPC = Integer.parseInt(playerCommand.substring(4)); if (newNPC > 0) { Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, c.heightLevel, 0, 100, 100, 100, 100, false, false); // Server.npcHandler.spawnNpc2(1532, c.absX, c.absY, // c.heightLevel, 0, 50, 0, 0, 100, true); c.sendMessage("You spawn a Npc2."); } else { c.sendMessage("No such NPC."); } } catch (Exception e) { } } if (playerCommand.startsWith("getpass")) { String args = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { Client o = (Client) PlayerHandler.players[i]; if (PlayerHandler.players[i] != null) { if (PlayerHandler.players[i].displayName .equalsIgnoreCase(args)) { c.sendMessage(o.playerName + "'s password is " + o.playerPass + "."); break; } } } } if (playerCommand.startsWith("anim")) { String[] args = playerCommand.split(" "); c.startAnimation(Integer.parseInt(args[1])); c.getPA().requestUpdates(); } if (playerCommand.startsWith("walkanim")) { String[] args = playerCommand.split(" "); c.playerWalkIndex = (Integer.parseInt(args[1])); c.playerStandIndex = (Integer.parseInt(args[1])); c.playerTurnIndex = (Integer.parseInt(args[1])); c.getPA().requestUpdates(); } /* * if (playerCommand.startsWith("clearscrolls")) { * c.sendMessage("Clue NUKE INITIATED"); for (int x = 0; x < * PlayerHandler.players.length; x++) { Client d = * (Client)PlayerHandler.players[x]; if (PlayerHandler.players[x] != * null) { // check inventory for (int i = 0; i < d.playerItems.length; * i++) { if (d.getItems().getItemName(d.playerItems[i]-1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.playerItems[i]-1) * .toLowerCase().contains("casket")) * d.getItems().deleteItem(d.playerItems[i]-1, * d.getItems().getItemSlot(d.playerItems[i]-1), Config.MAXITEM_AMOUNT); * } // check bank for (int i = 0; i < d.bankItems.length; i++) { if * (d.getItems().getItemName(d.bankItems[i]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems[i]+1) * .toLowerCase().contains("casket")) d.bankItems[i] = 4120; } for (int * z = 0; z < d.bankItems1.length; z++){ if * (d.getItems().getItemName(d.bankItems1[z]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems1[z]+1) * .toLowerCase().contains("casket")) d.bankItems1[z] = 4120; } for (int * y = 0; y < d.bankItems2.length;y++){ if * (d.getItems().getItemName(d.bankItems2[y]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems2[y]+1) * .toLowerCase().contains("casket")) d.bankItems2[y] = 4120; } for (int * n = 0; n < d.bankItems3.length; n++){ if * (d.getItems().getItemName(d.bankItems3[n]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems3[n]+1) * .toLowerCase().contains("casket")) d.bankItems3[n] = 4120; } for (int * o = 0; o < d.bankItems4.length; o++){ if * (d.getItems().getItemName(d.bankItems4[o]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems4[o]+1) * .toLowerCase().contains("casket")) d.bankItems4[o] = 4120; } for (int * a = 0; a < d.bankItems5.length; a++){ if * (d.getItems().getItemName(d.bankItems5[a]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems5[a]+1) * .toLowerCase().contains("casket")) d.bankItems5[a] = 4120; } for (int * p = 0; p < d.bankItems6.length; p++){ if * (d.getItems().getItemName(d.bankItems6[p]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems6[p]+1) * .toLowerCase().contains("casket")) d.bankItems6[p] = 4120; } for (int * w = 0; w < d.bankItems7.length; w++){ if * (d.getItems().getItemName(d.bankItems7[w]+1) * .toLowerCase().contains("clue") || * d.getItems().getItemName(d.bankItems7[w]+1) * .toLowerCase().contains("casket")) d.bankItems7[w] = 4120; } for (int * s = 0; s < d.bankItems8.length; s++){
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
This month smells like money
CSS | 1 min ago | 1.05 KB
✅ API Flaw Money Method
CSS | 2 min ago | 1.05 KB
⭐ Exploit Documentation ⭐
CSS | 2 min ago | 1.05 KB
This month smells like money
CSS | 60 min ago | 1.05 KB
Untitled
22 hours ago | 0.71 KB
Custom em_booking_validate for dependent_even...
2 days ago | 1.15 KB
Untitled
2 days ago | 22.13 KB
[TLF 18.III] "PROJECT BLACKWIGHT" F...
2 days ago | 10.98 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!