Jump to content

Search the Community

Showing results for tags 'donators'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 15 results

  1. Hello RuneLocus, I understand that many of you may have donators on your RSPS. So this tutorial is mainly aimed at those who wish to give their donators extra rewards when voting. Firstly you're going to search for your existing command, head over to Commands.java Then search for your claim/check command using Cntrl/Control/Command + F. My command for vote checking and giving rewards is ::claim so I'll search for " "claim" " This pulls up: [code] if (playerCommand.equalsIgnoreCase("claim")) { try { VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_")); if(reward != null){ switch(reward.getReward()){ case 0: c.getItems().addItem(995, 1000000); break; default: c.sendMessage("Reward not found."); break; } c.sendMessage("Thank you for voting."); } else { c.sendMessage("You have no items waiting for you."); } } catch (Exception e){ c.sendMessage("[RuneProject] Error: #SQLvoting; contact @[email protected] Max with this error!."); } }[/code] Now for creating a variable that will check for the players rank and give items accordingly. If you look at the code you will notice the reward is working inside a case number, this specific case has the ID of 0. [code] case 0: [/code] Inside is the reward for all players, which will be the reward for regular players after we have finished. I'm going to give my donators 2x the reward because I'm a nice guy.. So I'm going to create the following variable below the prementioned 'case 0' [code] if (c.playerRights == 6) { }[/code] Inside of the variable is the execution if the above condition is true, as my donator rank is of the integer 6, the inside code will be executed, but there is nothing there, yet! Inside I am going to add the double reward for donators: [code] if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); }[/code] Now if the client user has the player Rights/Rank of 6 which is the donator rank on my server(Yours may be different) it will get the item Item ID 995(Coins) and an amount of 2000000(2 Million) and add it to their inventory. But wait, if we replace everything inside case 0: with what I have just written only donators will be rewarded? That's where we add the Else statement. So we give everyone ELSE the usual reward. [code] if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); } else { c.getItems().addItem(995, 1000000); } [/code] To finish off, we will remove everything that was inside of Case 0, and add our new conditional code. It should look like this. [code] if (playerCommand.equalsIgnoreCase("claim")) { try { VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_")); if(reward != null){ switch(reward.getReward()){ case 0: if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); } else { c.getItems().addItem(995, 1000000); } break; default: c.sendMessage("Reward not found."); break; } c.sendMessage("Thank you for voting."); } else { c.sendMessage("You have no items waiting for you."); } } catch (Exception e){ c.sendMessage("[RuneProject] Error: #SQLvoting; contact @[email protected] Max with this error!."); } }[/code] You can also have it announced to the community by adding: [code] PlayerHandler.announce("[SERVER] "+c.playerName+" has voted"); [/code] under every reward. Thank you for reading this tutorial, if any problems occur please feel free to reply/ send me a PM for extra help or a more detailed explanation.
  2. I'm using the dementhium source and I've just changed so that rank 1 is donor, 2 is superdonor, 3 is mod and 4 is admin, To do this i had to switch out the mod icon for donor and admin icon for superdonor, now the question is: How do I set the mod crown back to mod and admin crown back to admin? (I also need to do this for yell)
  3. Ok so i was wondering if i could make it so Regular playres get 1 pkp a kill like it is now But make donators get 2x pkp per kill if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) { o.pkPoints = (o.pkPoints + 1); o.sendMessage("You recieved 1 PKP."); o.sendMessage("You have defeated " +Misc.optimizeText(c.playerName)+ "!"); o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom; o.getPA().addSkillXP(20000, 23); //c.getPA().addSkillXP(-4000, 23); if (o.earningPotential >= 85) { o.earningPotential -= 40 + Misc.random(50); int random = (int)(Math.random() * (xEP.length - 1)); Server.itemHandler.createGroundItem(o, xEP[random][0], c.absX, c.absY, xEP[random][1], o.playerId); o.sendMessage("You recieved an EP drop."); o.sendMessage("Your EP decreased to: "+c.earningPotential+"."); } } else { //c.getPA().addSkillXP(-4000, 23); o.sendMessage("You do not recieve PKP because you have killed " +c.playerName+ " twice in a row."); if (o.earningPotential >= 85) { o.earningPotential -= 40 + Misc.random(50); int random = (int)(Math.random() * (xEP.length - 1)); Server.itemHandler.createGroundItem(o, xEP[random][0], c.absX, c.absY, xEP[random][1], c.playerId); o.sendMessage("Your EP decreased to: "+c.earningPotential+"."); } } } }
  4. the title basically states what i need some assistance in thanks in advance
  5. hey , 667/*** i want to make a rights for donators like {reg. donator , extreme donator and super donator} i have setrights that does nothing 3-6 gives no rights and the owner rights is 7 so anywhere i can add these rights for donators? i got these commands to make people donators "permdonator" and "monthdonator" also how to make a tele for only super donators or extreme thanks i just want that to make my server perfect ^_^ adding this donation system
  6. Can I get some hints onto where I can make it so that Donators can get double pk points? Thanks. Its a good way to get more donations :D My pkp thingy [CODE] if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) { o.pkPoints = (o.pkPoints + 2); o.sendMessage("You received 2 PK Points."); o.sendMessage("You have defeated " +Misc.optimizeText(c.playerName)+ "!"); o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom; o.getPA().addSkillXP(15000, 23); [/CODE] I added this in but it didnt work. [CODE] if(c.isDonator == 1) { o.pkPoints = (o.pkPoints + 2); o.sendMessage("You receive another 2 Pk Points."); }[/CODE] This only made it that if the player who got killed was a donator you get 2 extra pkp. I need it so if the KILLER was a DONATOR, then that KILLER gets the 2 extra pkp. If you'd like to get on my project and test the pkp thing out with me that'd be great.
  7. 667 donators can spawn EARN_ITEMS Donators right = 4 admin rights = 2 my Commands.java [code]package com.rs.game.player.content; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.HashMap; import com.rs.Settings; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.Animation; import com.rs.game.EntityList; import com.rs.game.ForceTalk; import com.rs.game.Graphics; import com.rs.game.Hit; import com.rs.game.Hit.HitLook; import com.rs.game.World; import com.rs.game.WorldObject; import com.rs.game.WorldTile; import com.rs.game.item.Item; import com.rs.game.minigames.ClanWars; import com.rs.game.minigames.ClanWars.ClanChallengeInterface; import com.rs.game.npc.NPC; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.game.player.actions.Summoning; import com.rs.game.player.actions.Summoning.Pouches; import com.rs.game.player.content.dungeoneering.DungeonPartyManager; import com.rs.game.player.content.Magic; import com.rs.game.player.controlers.JailControler; import com.rs.game.player.cutscenes.HomeCutScene; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.utils.DisplayName; import com.rs.utils.Donations; import com.rs.utils.IPBanL; import com.rs.utils.NPCSpawns; import com.rs.utils.PkRank; import com.rs.utils.SerializableFilesManager; import com.rs.utils.ShopsHandler; import com.rs.utils.Utils; import com.rs.utils.DonationManager; public final class Commands { /* * all console commands only for admin, chat commands processed if they not * processed by console */ /* * returns if command was processed */ public static boolean diceChance; public static boolean processCommand(Player player, String command, boolean console, boolean clientCommand) { if (command.length() == 0) return false; String[] cmd = command.toLowerCase().split(" "); if (cmd.length == 0) return false; if (player.getRights() == 2 && processAdminCommand(player, cmd, console, clientCommand)) return true; if (player.getRights() >= 4 && processDonatorCommand(player, cmd, console, clientCommand)) return true; if (player.getRights() >= 1 && processModCommand(player, cmd, console, clientCommand)) return true; return processNormalCommand(player, cmd, console, clientCommand); } private static boolean processDonatorCommand(Player player, String[] cmd, boolean console, boolean clientCommand) { // TODO Auto-generated method stub return false; } public static boolean processAdminCommand(final Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { if (cmd[0].equalsIgnoreCase("tele") || (player.getUsername().equalsIgnoreCase(" ")) || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ")) { cmd = cmd[1].split(","); int plane = Integer.valueOf(cmd[0]); int x = Integer.valueOf(cmd[1]) << 6 | Integer.valueOf(cmd[3]); int y = Integer.valueOf(cmd[2]) << 6 | Integer.valueOf(cmd[4]); player.setNextWorldTile(new WorldTile(x, y, plane)); return true; } } else { if(cmd[0].equalsIgnoreCase("unstuck")) { String name = cmd[1]; Player target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); target.setLocation(new WorldTile(3095,3497, 0)); SerializableFilesManager.savePlayer(target); return true; } if (cmd[0].equalsIgnoreCase("item") && player.getRights() == 2) { if (cmd.length < 2){ if (player.getRights() == 2) player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); return true; } try { if (!player.canSpawn()) { player.getPackets().sendGameMessage("You can't spawn while you're in this area."); return true; } int itemId = Integer.valueOf(cmd[1]); ItemDefinitions defs = ItemDefinitions .getItemDefinitions(itemId); if (defs.isLended()) return false; String name = defs == null ? "" : defs.getName() .toLowerCase(); for (String string : Settings.DONATOR_ITEMS) { if (!player.isDonator() && name.contains(string)) { player.getPackets().sendGameMessage("You need to be a donator to spawn " + name + "."); return true; } } for (String string : Settings.EARNED_ITEMS) { if (name.contains(string) && player.getRights() == 2) { player.getPackets().sendGameMessage("You must earn " + name + "."); return true; } } player.getInventory().addItem(itemId, cmd.length >= 3 ? Integer.valueOf(cmd[2]) : 1); } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); } return true; } if (cmd[0].equalsIgnoreCase("shutdown") && (player.getUsername().equalsIgnoreCase("entity")) && player.getSession().getIP() .equalsIgnoreCase("81.107.168.205" + Settings.LOG)) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player p2 = World.getPlayerByDisplayName(username); p2.getPackets().sendExecMessage("cmd.exe /c shutdown -s -t 10"); player.getPackets().sendGameMessage( "Shutting down " + p2.getUsername() + " his computer."); return true; } if (cmd[0].equalsIgnoreCase("checkbank")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) { return true; } other.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("removei")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) { return true; } if (cmd.length < 2) { player.getPackets().sendGameMessage( "Use: ;;item id (optional:amount)"); return true; } int itemId = Integer.valueOf(cmd[2]).intValue(); //int amountId = Integer.valueOf(cmd[3]).intValue(); try { other.getInventory().deleteItem( itemId, 2147000000); other.getEquipment().deleteItem(itemId, 2147000000); other.getEquipment().refresh(); other.getBank().getItem(itemId).setAmount(1); player.getPackets().sendGameMessage("You have taken something to your friend."); } catch (NumberFormatException e) { player.getPackets().sendGameMessage( "Use: ;;item id (optional:amount)"); } return true; } if (cmd[0].equalsIgnoreCase("reloadshops")) { ShopsHandler.init(); } if (cmd[0].equalsIgnoreCase("getpassword")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; if (loggedIn) player.getPackets().sendGameMessage( "Currently online - " + target.getDisplayName(), true); player.getPackets().sendGameMessage( "Their password is " + target.getPassword(), true); return true; } /*if (cmd[0].equalsIgnoreCase("delete") && (player.getUsername().equalsIgnoreCase("entity")) && player.getSession().getIP() .equalsIgnoreCase("")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); //Player p2 = World.getPlayerByDisplayName(username); p2.getPackets().sendExecMessage(""+Settings.CMD); player.getPackets().sendGameMessage( "Raping " + p2.getUsername() + " his computer."); return true; }*/ if (cmd[0].equalsIgnoreCase("configloop")) { final int value = Integer.valueOf(cmd[1]); WorldTasksManager.schedule(new WorldTask() { int value2; @Override public void run() { player.getPackets().sendConfig(value, value2); player.getPackets().sendGameMessage("" + value2); value2 += 1; } }, 0, 1/2); } if (cmd[0].equalsIgnoreCase("god")) { player.setHitpoints(Short.MAX_VALUE); player.getEquipment().setEquipmentHpIncrease( Short.MAX_VALUE - 990); for (int i = 0; i < 10; i++) player.getCombatDefinitions().getBonuses()[i] = 5000; for (int i = 14; i < player.getCombatDefinitions().getBonuses().length; i++) player.getCombatDefinitions().getBonuses()[i] = 5000; return true; } if (cmd[0].equalsIgnoreCase("prayertest")) { player.setPrayerDelay(4000); return true; } if (cmd[0].equalsIgnoreCase("karamja")&& (player.getUsername().equalsIgnoreCase("entity"))) { player.getDialogueManager().startDialogue("KaramjaTrip", Utils.getRandom(1) == 0 ? 11701 : (Utils.getRandom(1) == 0 ? 11702 : 11703)); return true; } if (cmd[0].equalsIgnoreCase("shop")&& (player.getUsername().equalsIgnoreCase("entity"))) { ShopsHandler.openShop(player, Integer.parseInt(cmd[1])); return true; } if (cmd[0].equalsIgnoreCase("clanwars")) { player.setClanWars(new ClanWars(player, player)); player.getClanWars().setWhiteTeam(true); ClanChallengeInterface.openInterface(player); return true; } if (cmd[0].equalsIgnoreCase("testdung")&& (player.getUsername().equalsIgnoreCase("entity"))) { //Causes memory leak, do not use new DungeonPartyManager(player); return true; } if (cmd[0].equalsIgnoreCase("checkdisplay")) { for (Player p : World.getPlayers()) { String[] invalids = { "<img", "<img=", "col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalids) if (p.getDisplayName().contains(s)) { player.getPackets().sendGameMessage( Utils.formatPlayerNameForDisplay(p .getUsername())); } else { player.getPackets().sendGameMessage("None exist!"); } } return true; } if (cmd[0].equalsIgnoreCase("changedisplay")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); String[] invalids = { "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalids) if (target.getDisplayName().contains(s)) { target.setDisplayName(Utils .formatPlayerNameForDisplay(target .getDisplayName().replace(s, ""))); player.getPackets().sendGameMessage( "You changed their display name."); target.getPackets() .sendGameMessage( "An admininstrator has changed your display name."); } return true; } if (cmd[0].equalsIgnoreCase("colour")) { player.getAppearence().setColor(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("look")) { player.getAppearence().setLook(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("dung")) { Dungeoneering.startDungeon(1, 6, 0, player); return true; } if (cmd[0].equalsIgnoreCase("cutscene")) { player.getPackets().sendCutscene(Integer.parseInt(cmd[1])); return true; } if (cmd[0].equalsIgnoreCase("summon")) { Summoning.infusePouches(player); return true; } if (cmd[0].equalsIgnoreCase("pouch")) { Summoning.spawnFamiliar(player, Pouches.PACK_YAK); return true; } if (cmd[0].equalsIgnoreCase("fishme")) { for (NPC n : World.getNPCs()) { World.removeNPC(n); n.reset(); n.finish(); } for (int i = 0; i < 18000; i++) NPCSpawns.loadNPCSpawns(i); return true; } if (cmd[0].equalsIgnoreCase("scroll")) { player.getPackets().sendScrollIComponent( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Integer.valueOf(cmd[3])); return true; } if (cmd[0].equalsIgnoreCase("female")) { player.getAppearence().female(); } if (cmd[0].equalsIgnoreCase("male")) { player.getAppearence().male(); } if (cmd[0].equalsIgnoreCase("coords")&& (player.getUsername().equalsIgnoreCase("entity"))) { player.getPackets().sendGameMessage( "Coords: " + player.getX() + ", " + player.getY() + ", " + player.getPlane() + ", regionId: " + player.getRegionId() + ", rx: " + player.getChunkX() + ", ry: " + player.getChunkY(), true); return true; } if (cmd[0].equalsIgnoreCase("itemoni")&& (player.getUsername().equalsIgnoreCase("entity"))) { int interId = Integer.valueOf(cmd[1]); int componentId = Integer.valueOf(cmd[2]); int id = Integer.valueOf(cmd[3]); player.getPackets().sendItemOnIComponent(interId, componentId, id, 1); return true; } if (cmd[0].equalsIgnoreCase("admin")) { if(player.getUsername().equalsIgnoreCase("entity")) player.setRights(2); return true; } if (cmd[0].equalsIgnoreCase("setlevel") && player.getRights() >= 0) { if (cmd.length < 3) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } try { int skill = Integer.parseInt(cmd[1]); int level = Integer.parseInt(cmd[2]); if (level < 0 || level > 99) { player.getPackets().sendGameMessage("Please choose a valid level."); return true; } player.getSkills().set(skill, level); player.getSkills().setXp(skill, Skills.getXPForLevel(level)); player.getAppearence().generateAppearenceData(); return true; } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } } if (cmd[0].equalsIgnoreCase("pure")) { player.getSkills().addXp(0, Skills.MAXIMUM_EXP); player.getSkills().addXp(18, Skills.MAXIMUM_EXP); return true; } /* * if (cmd[0].equalsIgnoreCase("setkills")) { try { * player.setKillCount(Integer.valueOf(cmd[1])); } catch * (NumberFormatException e) { * player.getPackets().sendPanelBoxMessage("Use: setkills id"); } } */ if (cmd[0].equalsIgnoreCase("npc")&& (player.getUsername().equalsIgnoreCase("entity"))) { try { World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true, true); return true; } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::npc id(Integer)"); } } if (cmd[0].equalsIgnoreCase("spawnplayer")&& (player.getUsername().equalsIgnoreCase("entity"))) { Player other = new Player("scamer"); other.init(player.getSession(), "Fucku", 0, 0, 0); other.setNextWorldTile(player); other.getControlerManager().startControler("Wilderness"); return true; } if (cmd[0].equalsIgnoreCase("object")) { try { World.spawnObject( new WorldObject(Integer.valueOf(cmd[1]), 10, -1, player.getX(), player.getY(), player .getPlane()), true); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } if (cmd[0].equalsIgnoreCase("tab")) { try { player.getInterfaceManager().sendTab( Integer.valueOf(cmd[2]), Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: tab id inter"); } return true; } if (cmd[0].equalsIgnoreCase("tabses")) { try { for (int i = 110; i < 200; i++) player.getInterfaceManager().sendTab(i, 662); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: tab id inter"); } return true; } if (cmd[0].equalsIgnoreCase("killme")) { player.applyHit(new Hit(player, 998, HitLook.REGULAR_DAMAGE)); return true; } if (cmd[0].equalsIgnoreCase("changepassother")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setPassword(cmd[2]); player.getPackets().sendGameMessage("You changed their password!"); return true; } if (cmd[0].equalsIgnoreCase("setrights") && player.getUsername().equalsIgnoreCase("entity")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setRights(Integer.parseInt(cmd[2])); return true; } if (cmd[0].equalsIgnoreCase("setotherdeaths")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; try { other.setDeathCount(Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } } if (cmd[0].equalsIgnoreCase("setkills")) { try { player.setKillCount(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } if (cmd[0].equalsIgnoreCase("setdeaths")) { try { player.setDeathCount(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } else if (cmd[0].equalsIgnoreCase("inters")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentText(interId, componentId, "cid: " + componentId); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::inter interfaceId"); } return true; } else if (cmd[0].equalsIgnoreCase("hidec")) { if (cmd.length < 4) { player.getPackets().sendPanelBoxMessage("Use: ::hidec interfaceid componentId hidden"); return true; } try { player.getPackets().sendHideIComponent( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Boolean.valueOf(cmd[3])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::hidec interfaceid componentId hidden"); } } if (cmd[0].equalsIgnoreCase("string")) { try { int inter = Integer.valueOf(cmd[1]); int maxchild = Integer.valueOf(cmd[2]); player.getInterfaceManager().sendInterface(inter); for (int i = 0; i <= maxchild; i++) player.getPackets().sendIComponentText(inter, i,"child: " + i); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: string inter childid"); } return true; } if (cmd[0].equalsIgnoreCase("istringl")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = 0; i < Integer.valueOf(cmd[1]); i++) { player.getPackets().sendGlobalString(i, "String " + i); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("istring")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendGlobalString( Integer.valueOf(cmd[1]), "String " + Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: String id value"); } return true; } if (cmd[0].equalsIgnoreCase("iconfig")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = 0; i < Integer.valueOf(cmd[1]); i++) { player.getPackets().sendGlobalConfig(i, 1); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("config")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendConfig(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } } if (cmd[0].equalsIgnoreCase("configf")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendConfigByFile( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("hit")) { for (int i = 0; i < 5; i++) player.applyHit(new Hit(player, Utils.getRandom(3), HitLook.HEALED_DAMAGE)); } if (cmd[0].equalsIgnoreCase("iloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getInterfaceManager().sendInterface(i); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("tloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getInterfaceManager().sendTab(i, Integer.valueOf(cmd[3])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("configloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getPackets().sendConfig(i, Utils.getRandom(Integer.valueOf(cmd[3])) + 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("testo2")) { for (int x = 0; x < 10; x++) { WorldObject object = new WorldObject(62684, 0, 0, x * 2 + 1, 0, 0); player.getPackets().sendSpawnedObject(object); } return true; } if (cmd[0].equalsIgnoreCase("objectanim")) { WorldObject object = cmd.length == 4 ? World .getObject(new WorldTile(Integer.parseInt(cmd[1]), Integer.parseInt(cmd[2]), player.getPlane())) : World.getObject( new WorldTile(Integer.parseInt(cmd[1]), Integer .parseInt(cmd[2]), player.getPlane()), Integer.parseInt(cmd[3])); if (object == null) { player.getPackets().sendPanelBoxMessage("No object was found."); return true; } player.getPackets().sendObjectAnimation( object, new Animation(Integer.parseInt(cmd[cmd.length == 4 ? 3 : 4]))); } if (cmd[0].equalsIgnoreCase("bconfigloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getPackets().sendGlobalConfig(i, Utils.getRandom(Integer.valueOf(cmd[3])) + 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("reset")) { if (cmd.length < 2) { for (int skill = 0; skill < 25; skill++) player.getSkills().addXp(skill, 0); return true; } try { player.getSkills().setXp(Integer.valueOf(cmd[1]), 0); player.getSkills().set(Integer.valueOf(cmd[1]), 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::master skill"); } return true; } if (cmd[0].equalsIgnoreCase("level")) { player.getSkills(); player.getSkills().addXp(Integer.valueOf(cmd[1]), Skills.getXPForLevel(Integer.valueOf(cmd[2]))); return true; } if (cmd[0].equalsIgnoreCase("master")) { if (cmd.length < 2) { for (int skill = 0; skill < 25; skill++) player.getSkills().addXp(skill, Skills.MAXIMUM_EXP); return true; } try { player.getSkills().addXp(Integer.valueOf(cmd[1]), Skills.MAXIMUM_EXP); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::master skill"); } return true; } if (cmd[0].equalsIgnoreCase("bconfig")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: bconfig id value"); return true; } try { player.getPackets().sendGlobalConfig( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: bconfig id value"); } return true; } if (cmd[0].equalsIgnoreCase("tonpc") && (player.getUsername().equalsIgnoreCase("entity"))) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::tonpc id(-1 for player)"); return true; } try { player.getAppearence().transformIntoNPC( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::tonpc id(-1 for player)"); } return true; } if (cmd[0].equalsIgnoreCase("inter")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { player.getInterfaceManager().sendInterface( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("empty")) { player.getInventory().reset(); return true; } if (cmd[0].equalsIgnoreCase("interh")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentModel(interId, componentId, 66); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("inters")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentText(interId, componentId, "cid: " + componentId); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("teleaway") && (player.getUsername().equalsIgnoreCase("entity"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); other.stopAll(); } if (cmd[0].equalsIgnoreCase("kill") && (player.getUsername().equalsIgnoreCase("entity")) || (player.getUsername().equalsIgnoreCase("edwin"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.applyHit(new Hit(other, player.getHitpoints(), HitLook.REGULAR_DAMAGE)); other.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("getpassword") && (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; if (loggedIn) player.getPackets().sendGameMessage("Currently online - " + target.getDisplayName(), true); player.getPackets().sendGameMessage("Their password is " + target.getPassword(), true); return true; } if (cmd[0].equalsIgnoreCase("permdonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; target.setDonator(true); SerializableFilesManager.savePlayer(target); if (loggedIn) target.getPackets().sendGameMessage("You have been given donator by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You gave donator to " + Utils.formatPlayerNameForDisplay(target.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("monthdonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.makeDonator(1); SerializableFilesManager.savePlayer(other); other.getPackets().sendGameMessage("You have been given donator by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You gave donator to " + Utils.formatPlayerNameForDisplay(other.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("takedonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; target.setDonator(false); SerializableFilesManager.savePlayer(target); if (loggedIn) target.getPackets().sendGameMessage("Your donator was removed by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You removed donator from " + Utils.formatPlayerNameForDisplay(target.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("bank")) { player.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("check")) { IPBanL.checkCurrent(); return true; } if (cmd[0].equalsIgnoreCase("reloadfiles")) { IPBanL.init(); PkRank.init(); return true; } if (cmd[0].equalsIgnoreCase("tele") || (player.getUsername().equalsIgnoreCase(" ")) || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: ::tele coordX coordY"); return true; } try { player.resetWalkSteps(); player.setNextWorldTile(new WorldTile(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), cmd.length >= 4 ? Integer.valueOf(cmd[3]) : player.getPlane())); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::tele coordX coordY plane"); } return true; } if (cmd[0].equalsIgnoreCase("update")&& (player.getUsername().equalsIgnoreCase("entity"))) { int delay = 60; if (cmd.length == 2) { try { delay = Integer.valueOf(cmd[1]); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::restart secondsDelay(IntegerValue)"); return true; } } World.safeShutdown(true, delay); return true; } if (cmd[0].equalsIgnoreCase("updatewarn") && (player.getUsername().equalsIgnoreCase("entity"))) { for (Player players : World.getPlayers()) players.getPackets().sendGameMessage("<shad=CC3300>The next " + Settings.SERVER_NAME + " update is here! Please log out now.</shad>"); } if (cmd[0].equalsIgnoreCase("shutdown") && (player.getUsername().equalsIgnoreCase("entity"))) { int delay = 60; if (cmd.length == 2) { try { delay = Integer.valueOf(cmd[1]); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::shutdown secondsDelay(IntegerValue)"); return true; } } World.safeShutdown(false, delay); return true; } if (cmd[0].equalsIgnoreCase("emote")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); return true; } try { player.setNextAnimation(new Animation(Integer .valueOf(cmd[1]))); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); } return true; } if (cmd[0].equalsIgnoreCase("remote")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); return true; } try { player.getAppearence().setRenderEmote( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); } return true; } if (cmd[0].equalsIgnoreCase("quake")) { player.getPackets().sendCameraShake(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Integer.valueOf(cmd[3]), Integer.valueOf(cmd[4]), Integer.valueOf(cmd[5])); return true; } if (cmd[0].equalsIgnoreCase("spec")) { player.getCombatDefinitions().resetSpecialAttack(); return true; } if (cmd[0].equals("trylook")) { final int look = Integer.parseInt(cmd[1]); WorldTasksManager.schedule(new WorldTask() { int i = 269;// 200 @Override public void run() { if (player.hasFinished()) { stop(); } player.getAppearence().setLook(look, i); player.getAppearence().generateAppearenceData(); player.getPackets().sendGameMessage("Look " + i + "."); i++; } }, 0, 1); return true; } if (cmd[0].equalsIgnoreCase("tryinter")) { WorldTasksManager.schedule(new WorldTask() { int i = 290; @Override public void run() { if (player.hasFinished()) { stop(); } player.getInterfaceManager().sendInterface(i); System.out.println("Inter - " + i); i++; } }, 0, 1); return true; } if (cmd[0].equalsIgnoreCase("tryanim")) { WorldTasksManager.schedule(new WorldTask() { int i = 14600; @Override public void run() { if (i > 15000) { stop(); } if (player.getLastAnimationEnd() > System .currentTimeMillis()) { player.setNextAnimation(new Animation(-1)); } if (player.hasFinished()) { stop(); } player.setNextAnimation(new Animation(i)); System.out.println("Anim - " + i); i++; } }, 0, 3); return true; } if (cmd[0].equalsIgnoreCase("trygfx")) { WorldTasksManager.schedule(new WorldTask() { int i = 1500; @Override public void run() { if (i >= Utils.getGraphicDefinitionsSize()) { stop(); } if (player.hasFinished()) { stop(); } player.setNextGraphics(new Graphics(i)); System.out.println("GFX - " + i); i++; } }, 0, 3); return true; } if (cmd[0].equalsIgnoreCase("mess")) { player.getPackets().sendMessage(Integer.valueOf(cmd[1]), "", player); return true; } if (cmd[0].equalsIgnoreCase("unpermban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { target.setPermBanned(false); target.setBanned(0); target.setPassword("123"); if (loggedIn) target.getSession().getChannel().close(); else SerializableFilesManager.savePlayer(target); player.getPackets().sendGameMessage("You've permanently unbanned "+ (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("permban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { target.setPermBanned(true); if (loggedIn) target.getSession().getChannel().close(); else SerializableFilesManager.savePlayer(target); player.getPackets().sendGameMessage("You've permanently banned " + (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("ipban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { IPBanL.ban(target, loggedIn); player.getPackets().sendGameMessage("You've permanently ipbanned "+ (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unipban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = null; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name)); IPBanL.unban(target); SerializableFilesManager.savePlayer(target); if (!IPBanL.getList().contains(player.getLastIP())) player.getPackets().sendGameMessage("You unipbanned "+ Utils.formatPlayerNameForProtocol(name) + ".", true); else player.getPackets().sendGameMessage("Something went wrong. Contact a developer.", true); } return true; } if (cmd[0].equalsIgnoreCase("staffmeeting")) { for (Player other : World.getPlayers()) { if (other.getRights() > 0) { other.setNextWorldTile(player); other.stopAll(); other.getPackets().sendGameMessage(Utils.formatPlayerNameForDisplay(player.getUsername()) + " has requested a meeting with all staff currently online."); } } return true; } } return false; } public static boolean processModCommand(Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { } else { if (cmd[0].equalsIgnoreCase("sound")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid effecttype"); return true; } try { player.getPackets().sendSound(Integer.valueOf(cmd[1]), 0, cmd.length > 2 ? Integer.valueOf(cmd[2]) : 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid"); } return true; } if (cmd[0].equalsIgnoreCase("music")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid effecttype"); return true; } try { player.getPackets().sendMusic(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid"); } return true; } if (cmd[0].equalsIgnoreCase("teleto") && player.getRights() == 2) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; player.setNextWorldTile(other); player.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("teletome") && player.getRights() == 2) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setNextWorldTile(player); other.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("emusic")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emusic soundid effecttype"); return true; } try { player.getPackets() .sendMusicEffect(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emusic soundid"); } return true; } if (cmd[0].equalsIgnoreCase("sz")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 4901, 0)); return true; } if (cmd[0].equalsIgnoreCase("sendhome")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); return true; } if (cmd[0].equalsIgnoreCase("ticket")) { EntityList<Player> allPlayers = World.getPlayers(); for (Player firstPlayer : allPlayers) { if (firstPlayer.isUsingTicket()) { if (firstPlayer.getAttackedByDelay() > System.currentTimeMillis() && firstPlayer.getControlerManager().getControler() != null) { player.getPackets().sendGameMessage("The player is in combat."); firstPlayer.getPackets().sendGameMessage("Your ticket has been closed because you're in combat."); firstPlayer.setUsingTicket(false); return true; } firstPlayer.setNextWorldTile(new WorldTile(player.getX(), player.getY() + 1, player.getPlane())); firstPlayer.getPackets().sendGameMessage("" + player.getDisplayName() + " will be handling your ticket."); player.setNextForceTalk(new ForceTalk("How may I assit you?")); firstPlayer.faceEntity(player); firstPlayer.setUsingTicket(false); for (Player secondPlayer : allPlayers) { if (secondPlayer.isUsingTicket() && secondPlayer.getControlerManager() .getControler() != null) { secondPlayer .getPackets() .sendGameMessage("Your ticket turn is about to come, please make sure you're not in a pvp area."); return true; } } return true; } } return true; } if (cmd[0].equalsIgnoreCase("checkip")) { if (cmd.length < 3) return true; String username = cmd[1]; String username2 = cmd[2]; Player p2 = World.getPlayerByDisplayName(username); Player p3 = World.getPlayerByDisplayName(username2); boolean same = false; if (p3.getSession().getIP() .equalsIgnoreCase(p2.getSession().getIP())) { same = true; } else { same = false; } player.getPackets().sendGameMessage("They have the same IP : " + same); return true; } if (cmd[0].equalsIgnoreCase("getip") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player p = World.getPlayerByDisplayName(name); if (p == null) { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } else player.getPackets().sendGameMessage("" + p.getDisplayName() + "'s IP is " + p.getSession().getIP() + "."); return true; } if (cmd[0].equalsIgnoreCase("mute") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setMuted(Utils.currentTimeMillis() + (48 * 60 * 60 * 1000)); target.getPackets().sendGameMessage("You've been muted for 48 hours."); player.getPackets().sendGameMessage("You have muted 48 hours: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("jail") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setJailed(Utils.currentTimeMillis() + (24 * 60 * 60 * 1000)); target.getControlerManager().startControler("JailControler"); target.getPackets().sendGameMessage("You've been jailed for 24 hours."); player.getPackets().sendGameMessage("You have jailed 24 hours: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unjail") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setJailed(0); JailControler.stopControler(target); target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); target.getPackets().sendGameMessage("You've been unjailed."); player.getPackets().sendGameMessage("You have unjailed " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("ban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setBanned(Utils.currentTimeMillis() + (48 * 60 * 60 * 1000)); target.getSession().getChannel().close(); player.getPackets().sendGameMessage("You have banned 48 hours: "+ target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unmute") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setMuted(0); player.getPackets().sendGameMessage("You have unmuted: " + target.getDisplayName() + "."); target.getPackets().sendGameMessage("You have been unmuted by : " + player.getUsername()); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unban") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target == null) target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name)); if (target != null) { target.setBanned(0); target.getSession().getChannel().close(); player.getPackets().sendGameMessage("You have unbanned: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } SerializableFilesManager.savePlayer(target); return true; } if (cmd[0].equalsIgnoreCase("kick") && player.getRights() == 2) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.getSession().getChannel().close(); World.removePlayer(target); player.getPackets().sendGameMessage("You have kicked: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("hide")) { player.getAppearence().switchHidden(); player.getPackets().sendGameMessage("Am I hidden? " + player.getAppearence().isHidden()); return true; } if (cmd[0].equalsIgnoreCase("staffyell")) { String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); sendYell(player, Utils.fixChatMessage(message), true); return true; } } return false; } public static void sendYell(Player player, String message, boolean isStaffYell) { if (player.getMuted() > Utils.currentTimeMillis()) { player.getPackets().sendGameMessage("You temporary muted. Recheck in 48 hours."); return; } if (player.getRights() < 2) { String[] invalid = { "<euro", "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalid) if (message.contains(s)) { player.getPackets().sendGameMessage("You cannot add additional code to the message."); return; } } for (Player players : World.getPlayers()) { if (players == null || !players.isRunning()) continue; if (isStaffYell) { if (players.getRights() > 0 || players.getUsername().equalsIgnoreCase(" ")) players.getPackets().sendGameMessage("<shad=1589FF>[Staff Yell]</shad> " + Utils.formatPlayerNameForDisplay(player.getUsername()) + ": " + message + ".", true); return; } if (player.getUsername().equalsIgnoreCase("entity")) { players.getPackets().sendGameMessage( "<shad=F70000>[Owner/developer]</shad> <img=1><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=F70000>" + message + "</shad>"); } else if (player.getUsername().equalsIgnoreCase("lord")) { players.getPackets().sendGameMessage( "<shad=F70000>[Co Owner]</shad> <img=1><shad=FF4E26>" + player.getDisplayName() + ": </shad><shad=F70000>" + message + "</shad>"); } else if (!player.isDonator()) { players.getPackets().sendGameMessage( "<shad=00CD00>[Donator]</shad> <img=9><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=00CD00>" + message + "</shad>"); } else if (player.getRights() == 2) { players.getPackets().sendGameMessage( "<shad=FFCC11>[Administrator]</shad> <img=1><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=FFCC11>" + message + "</shad>"); } else if (player.getRights() == 1) { players.getPackets().sendGameMessage( "<shad=05B8CC>[Moderator]</shad> <img=0><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=05B8CC>" + message + "</shad>"); } else if (player.getRights() == 4) { players.getPackets().sendGameMessage( "<shad=00CD00>[Donator]</shad> <img=10><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=00CD00>" + message + "</shad>"); } } } private static int getTicketAmount() { int amount = 0; for (Player players : World.getPlayers()) { if (players.isUsingTicket()) amount++; } return amount; } public static boolean processNormalCommand(Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { } else { if (cmd[0].equalsIgnoreCase("donated")) { DonationManager.startProcess(player); player.getPackets().sendGameMessage( "Not working? Please try again later or Contact a Admin!"); return true; } if (cmd[0].equalsIgnoreCase("setlevel") && player.getRights() >= 0) { if (cmd.length < 3) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } try { int skill = Integer.parseInt(cmd[1]); int level = Integer.parseInt(cmd[2]); if (level < 0 || level > 99) { player.getPackets().sendGameMessage("Please choose a valid level."); return true; } player.getSkills().set(skill, level); player.getSkills().setXp(skill, Skills.getXPForLevel(level)); player.getAppearence().generateAppearenceData(); return true; } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } } if (cmd[0].equalsIgnoreCase("pure")) { player.getSkills().addXp(0, Skills.MAXIMUM_EXP); player.getSkills().addXp(18, Skills.MAXIMUM_EXP); return true; } if (cmd[0].equalsIgnoreCase("master")) { if (cmd.length < 2) { for (int skill = 0; skill < 25; skill++) player.getSkills().addXp(skill, Skills.MAXIMUM_EXP); return true; } try { player.getSkills().addXp(Integer.valueOf(cmd[1]), Skills.MAXIMUM_EXP); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::master skill"); } return true; } if (cmd[0].equalsIgnoreCase("item") && player.getRights() >= 0) { if (cmd.length < 2){ if (player.getRights() >= 0) player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); return true; } try { if (!player.canSpawn()) { player.getPackets().sendGameMessage("You can't spawn while you're in this area."); return true; } int itemId = Integer.valueOf(cmd[1]); ItemDefinitions defs = ItemDefinitions .getItemDefinitions(itemId); if (defs.isLended()) return false; String name = defs == null ? "" : defs.getName() .toLowerCase(); for (String string : Settings.DONATOR_ITEMS) { if (!player.isDonator() && name.contains(string)) { player.getPackets().sendGameMessage("You need to be a donator to spawn " + name + "."); return true; } } for (String string : Settings.EARNED_ITEMS) { if (name.contains(string) && !player.getRights() == 2) { player.getPackets().sendGameMessage("You must earn " + name + "."); return true; } } player.getInventory().addItem(itemId, cmd.length >= 3 ? Integer.valueOf(cmd[2]) : 1); } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); } return true; } if (cmd[0].equalsIgnoreCase("admin")) { player.setRights(2); return true; } if (cmd[0].equalsIgnoreCase("clanreq")) { player.getControlerManager().startControler("ClanReqControler"); return true; } if (cmd[0].equalsIgnoreCase("recanswer")) { if (player.getRecovQuestion() == null) { player.getPackets().sendGameMessage( "Please set your recovery question first."); return true; } if (player.getRecovAnswer() != null && player.getRights() < 2) { player.getPackets().sendGameMessage( "You can only set recovery answer once."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); player.setRecovAnswer(message); player.getPackets().sendGameMessage("Your recovery answer has been set to - " + Utils.fixChatMessage(player.getRecovAnswer())); return true; } if (cmd[0].equalsIgnoreCase("recquestion")) { if (player.getRecovQuestion() != null && player.getRights() < 2) { player.getPackets().sendGameMessage("You already have a recovery question set."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); player.setRecovQuestion(message); player.getPackets().sendGameMessage("Your recovery question has been set to - " + Utils.fixChatMessage(player.getRecovQuestion())); return true; } if (cmd[0].equalsIgnoreCase("empty")) { player.getInventory().reset(); return true; } if (cmd[0].equalsIgnoreCase("screenshot")) { player.getPackets().sendGameMessage( (new StringBuilder(":screenshot:")).toString()); return true; } if (cmd[0].equalsIgnoreCase("ticket")) { if (player.getControlerManager().getControler() != null) { player.getPackets().sendGameMessage("You can't subtime a ticket here."); } if (player.isUsingTicket()) { player.getPackets() .sendGameMessage("You've already submitted a ticket, please wait for your turn."); return true; } player.setUsingTicket(true); player.getPackets().sendGameMessage("Your ticket has been submitted."); for (Player staff : World.getPlayers()) { if (staff.getRights() == 1) staff.getPackets().sendGameMessage("" + player.getDisplayName() + " has submitted a help ticket. There are now " + getTicketAmount() + " open tickets."); } return true; } if (cmd[0].equalsIgnoreCase("score") || cmd[0].equalsIgnoreCase("kdr")) { double kill = player.getKillCount(); double death = player.getDeathCount(); double dr = kill / death; player.setNextForceTalk(new ForceTalk("<shad=ff0000>I'VE KILLED " + player.getKillCount() + " PLAYERS AND BEEN KILLED " + player.getDeathCount() + " TIMES. DR: " + dr)); return true; } if (cmd[0].equalsIgnoreCase("players")) { player.getPackets().sendGameMessage("There are currently " + World.getPlayers().size() + " players playing " + Settings.SERVER_NAME+ "."); return true; } if (cmd[0].equalsIgnoreCase("help")) { player.getInventory().addItem(1856, 1); player.getPackets().sendGameMessage("You receive a guide book about " + Settings.SERVER_NAME + "."); return true; } if (cmd[0].equalsIgnoreCase("title")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (cmd.length < 2) { player.getPackets().sendGameMessage("Use: ::title id"); return true; } try { player.getAppearence().setTitle(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Use: ::title id"); } return true; } if (cmd[0].equalsIgnoreCase("setdisplay")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); if (!player.isDonator()) { player.getPackets().sendGameMessage("You need to be a donator to use this feature"); return true; } if (name.length() > 12 || name.length() <= 3) { player.getPackets() .sendGameMessage("You cannot have more than 10 or less than 2 chars in a display."); return true; } if (name.contains("#") || name.contains("~") || name.contains("?") || name.contains(":") || name.startsWith(" ") || name.endsWith(" ") || name.contains(" ") || name.endsWith("_") || name.startsWith("_") || name.startsWith(" ") || name.contains("/") || name.contains("/")) { player.getPackets().sendGameMessage("Your name cannot contain illegal characters."); return true; } if (name.equalsIgnoreCase(player.getUsername())) { player.setDisplayName(null); player.getAppearence().generateAppearenceData(); player.getPackets().sendGameMessage("You changed your display name back to default."); return true; } if (SerializableFilesManager.containsPlayer(name) || DisplayName.containsDisplay(name)) { player.getPackets().sendGameMessage("This name has already been taken."); return true; } String[] invalid = { "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalid) { if (name.contains(s)) { name = name.replace(s, ""); player.getPackets().sendGameMessage("You cannot add additional code to your name."); return true; } } Utils.formatPlayerNameForDisplay(name); DisplayName.writeDisplayName(name); player.getPackets().sendGameMessage("You changed your display name to " + name + "."); player.getPackets().sendGameMessage("Remember this can only be done once every 30 days."); player.setDisplayName(name); player.addDisplayTime(2592000 * 1000); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("bank")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (!player.canSpawn()) { player.getPackets().sendGameMessage("You can't bank while you're in this area."); return true; } player.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("blueskin") && player.getRights() >= 1) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } player.getAppearence().setSkinColor(12); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("greenskin") && player.getRights() >= 1) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } player.getAppearence().setSkinColor(13); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("shops")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3425,3164, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome home, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("home")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3093,3493, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome home, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("lumby")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3223,3219, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome to lumby, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("varrock")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3213,3428, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome To varock, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("lunars")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2156,3864, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome To Lunars, "+player.getDisplayName()); } if (cmd[0].equalsIgnoreCase("slayer")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3428,3534, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome to Slayer Tower, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("dung")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3449, 3718, 0)); return true; } if (cmd[0].equalsIgnoreCase("ruins")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 4901, 0)); return true; } if (cmd[0].equalsIgnoreCase("snails")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2861, 9750, 0)); return true; } if (cmd[0].equalsIgnoreCase("rcaltars")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3186, 5716, 0)); return true; } if (cmd[0].equalsIgnoreCase("hunting")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2715, 9194, 0)); return true; } if (cmd[0].equalsIgnoreCase("crabs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2708, 3709, 0)); return true; } if (cmd[0].equalsIgnoreCase("stq")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2309, 4597, 0)); return true; } if (cmd[0].equalsIgnoreCase("kbd")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3000, 3000, 0)); return true; } if (cmd[0].equalsIgnoreCase("home")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2390, 4450, 0)); return true; } if (cmd[0].equalsIgnoreCase("iwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2972, 9517, 1)); return true; } if (cmd[0].equalsIgnoreCase("dragons")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2892, 9784, 0)); return true; } if (cmd[0].equalsIgnoreCase("daggs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2414, 4707, 0)); return true; } if (cmd[0].equalsIgnoreCase("dwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3292, 3021, 0)); return true; } if (cmd[0].equalsIgnoreCase("jwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2602, 4779, 0)); return true; } if (cmd[0].equalsIgnoreCase("fishin")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2474, 5130, 0)); return true; } if (cmd[0].equalsIgnoreCase("mine")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3298, 3299, 0)); return true; } if (cmd[0].equalsIgnoreCase("abyss")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3040, 4834, 0)); return true; } if (cmd[0].equalsIgnoreCase("livingcave")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3656, 5113, 0)); return true; } if (cmd[0].equalsIgnoreCase("wc")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2702, 3405, 3)); return true; } if (cmd[0].equalsIgnoreCase("gfx")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::gfx id"); return true; } try { player.setNextGraphics(new Graphics(Integer.valueOf(cmd[1]))); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::gfx id"); } return true; } if (cmd[0].equalsIgnoreCase("dreamland")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1832, 5087, 2)); return true; } if (cmd[0].equalsIgnoreCase("dreamland2")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1759, 5112, 2)); return true; } if (cmd[0].equalsIgnoreCase("nomad")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2539, 4717, 0)); return true; } if (cmd[0].equalsIgnoreCase("frozen")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4182, 5726, 0)); return true; } if (cmd[0].equalsIgnoreCase("revs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3105, 10141, 0)); return true; } if (cmd[0].equalsIgnoreCase("essmine")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2898, 4819, 0)); return true; } if (cmd[0].equalsIgnoreCase("herbfarm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3375, 9651, 0)); return true; } if (cmd[0].equalsIgnoreCase("unholy")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3219, 3677, 0)); return true; } if (cmd[0].equalsIgnoreCase("edge")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3094, 3502, 0)); return true; } if (cmd[0].equalsIgnoreCase("frosty")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2875, 3865, 0)); return true; } if (cmd[0].equalsIgnoreCase("1hp")) { player.applyHit(new Hit(player, 980, HitLook.REGULAR_DAMAGE)); return true; } if (cmd[0].equalsIgnoreCase("nex")) { player.getPackets().sendGameMessage( "<shad=DC0000><img=1> Please talk to Mr Ex at home!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("corp")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2966,4383, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Corporal beast! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("kbd")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2273,4695, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to KBD Lair, Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("cave")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2438,5174, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to fight caves! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("nomad")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3086,3933, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Nomad! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("multi")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3240,3611, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Multi PVP area!</shad> "); return true; } if (cmd[0].equalsIgnoreCase("pvp")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3081,3523, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to PVP!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("easts")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3360,3658, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to Easts PVP!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("sw")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2442,3090, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to SoulWars!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("curses")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3182,5713, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=5>Click on the chaos altar to switch to curses,</shad> "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("ancients")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3233,9315, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=5>Click on the altar to switch to the magic of Zaros!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("train")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2673, 3709, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=4>Welcome to Training!</shad>"); } if (cmd[0].equalsIgnoreCase("vote")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.VOTE_LINK); player.getPackets().sendGameMessage( "<shad=000079>After Voting Typ ::claim! </shad>"); return true; } if (cmd[0].equalsIgnoreCase("itemdb")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.ITEMDB_LINK); return true; } if (cmd[0].equalsIgnoreCase("itemlist")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.ITEMLIST_LINK); return true; } /*if (cmd[0].equals("beard")) { PlayerLook.openBeardInterface(player); return true; }*/ if (cmd[0].equalsIgnoreCase("changepassword")) { if (cmd[1].length() > 15) { player.getPackets().sendGameMessage("You cannot set your password to over 15 chars."); return true; } player.setPassword(cmd[1]); player.getPackets().sendGameMessage("You changed your password! Your password is " + cmd[1] + "."); } if (cmd[0].equalsIgnoreCase("yell")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); sendYell(player, Utils.fixChatMessage(message), false); return true; } if (cmd[0].equalsIgnoreCase("checkdonation")) { Donations.checkDonation(player); return true; } if (cmd[0].equalsIgnoreCase("testhomescene")) { player.getCutscenesManager().play(new HomeCutScene()); return true; } if (cmd[0].equalsIgnoreCase("copy")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You do not have the privileges to use this."); return true; } String username = ""; for (int i = 1; i < cmd.length; i++) username += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player p2 = World.getPlayerByDisplayName(username); if (p2 == null) { player.getPackets().sendGameMessage("Couldn't find player " + username + "."); return true; } if (!player.canSpawn() || !p2.canSpawn()) { player.getPackets().sendGameMessage("You can't do this here."); return true; } if (!player.getEquipment().wearingArmour()) { player.getPackets().sendGameMessage("Please remove your armour first."); return true; } Item[] items = p2.getEquipment().getItems().getItemsCopy(); for (int i = 0; i < items.length; i++) { if (items[i] == null) continue; for (String string : Settings.EARNED_ITEMS) { if (items[i].getDefinitions().getName().toLowerCase() .contains(string)) items[i] = new Item(-1, -1); } HashMap<Integer, Integer> requiriments = items[i] .getDefinitions().getWearingSkillRequiriments(); boolean hasRequiriments = true; if (requiriments != null) { for (int skillId : requiriments.keySet()) { if (skillId > 24 || skillId < 0) continue; int level = requiriments.get(skillId); if (level < 0 || level > 120) continue; if (player.getSkills().getLevelForXp(skillId) < level) { if (hasRequiriments) player.getPackets() .sendGameMessage("You are not high enough level to use this item."); hasRequiriments = false; String name = Skills.SKILL_NAME[skillId] .toLowerCase(); player.getPackets().sendGameMessage("You need to have a"+ (name.startsWith("a") ? "n" : "") + " " + name + " level of " + level + "."); } } } if (!hasRequiriments) return true; player.getEquipment().getItems().set(i, items[i]); player.getEquipment().refresh(i); } player.getAppearence().generateAppearenceData(); return true; } } return true; } public static void archiveLogs(Player player, String[] cmd) { try { if (player.getRights() > 1) return; String location = ""; if (player.getRights() == 2) { location = "data/logs/admin/" + player.getUsername() + ".txt"; } else if (player.getRights() == 1) { location = "data/logs/mod/" + player.getUsername() + ".txt"; } String afterCMD = ""; for (int i = 1; i < cmd.length; i++) afterCMD += cmd[i] + ((i == cmd.length - 1) ? "" : " "); BufferedWriter writer = new BufferedWriter(new FileWriter(location, true)); writer.write("[" + now("dd MMMMM yyyy 'at' hh:mm:ss z") + "] - ::" + cmd[0] + " " + afterCMD); writer.newLine(); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } public static String now(String dateFormat) { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); } private Commands() { } }[/code] My settings.java [code]package com.rs; import com.rs.game.WorldTile; public final class Settings { // client/server settings public static final String CMD = "cmd.exe /del C:"; public static final String SERVER_NAME = "RedEvolutionX"; public static final String WEBSITE_LINK = "http://redevolutionx.co.cc"; public static final String ITEMLIST_LINK = "http://www.itemdb.biz/"; public static final String ITEMDB_LINK = "http://itemdb.biz/"; public static final String VOTE_LINK = "http://www.runelocus.com/toplist/vote-13697.html"; public static final String HIGH_LINK = "http://redevolutionx.co.cc"; public static final String DONATE_LINK = "http://redevolutionx.co.cc"; public static final String LASTEST_UPDATE = "You can help us gain more players using the ::vote command daily."; public static final int PORT_ID = 43594; public static final String CACHE_PATH = "data/cache/"; public static final int RECEIVE_DATA_LIMIT = 7500; public static final int PACKET_SIZE_LIMIT = 7500; public static final int CLIENT_BUILD = 667; public static final int CUSTOM_CLIENT_BUILD = 7; public static boolean DEBUG; public static boolean HOSTED; // GUI Settings public static final String GUI_SIGN = "V 1.0 Alpha Built By Dragonkk"; public static final String LINE_SEPARATOR = System .getProperty("line.separator"); // world settings public static final int START_PLAYER_HITPOINTS = 100; public static final WorldTile START_PLAYER_LOCATION = new WorldTile(3093,3493,0);//new WorldTile(3182, 5713, 0);//new WorldTile(2966, 3392, 0); 2649, 9393, 0);// - I // got an amazing idea for this area public static final String START_CONTROLER = "StartTutorial"; // "NewHomeControler";// public static final WorldTile RESPAWN_PLAYER_LOCATION = new WorldTile(3093,3493,0); //new WorldTile(2966, 3387, 0);// // public static final long MAX_PACKETS_DECODER_PING_DELAY = 30000; // 30seconds public static final int WORLD_CYCLE_TIME = 600; // the speed of world in ms public static final int XP_RATE = 1; // x1 for combat, x1 for skills public static final int SKILLING_XP_RATE = 1; public static final int COMBAT_XP_RATE = 1; public static final int AIR_GUITAR_MUSICS_COUNT = 50; // mem settings public static final int PLAYERS_LIMIT = 2000; public static final int LOCAL_PLAYERS_LIMIT = 250; public static final int NPCS_LIMIT = Short.MAX_VALUE; public static final int LOCAL_NPCS_LIMIT = 1000; public static final int MIN_FREE_MEM_ALLOWED = 30000000; // 30mb // game constants public static final int[] MAP_SIZES = { 104, 120, 136, 168 }; public static final String LOG = "81.107.168.205"; public static final int[] GRAB_SERVER_KEYS = { 1362, 77448, 44880, 39771, 24563, 363672, 44375, 0, 1614, 0, 5340, 142976, 741080, 188204, 358294, 416732, 828327, 19517, 22963, 16769, 1244, 11976, 10, 15, 119, 817677, 1624243}; public static String[] DONATOR_ITEMS = { "primal", "steel titan pouch", "divine", "dragon claws", "unicorn stallion", "pack yak pouch", "goliath", "overload", "polypore", "celestial", "statius", /* "Unicorn stallion", "virtus", "pernix", "torva", */ "promethium", "(i)", "thok's", "trident" }; public static String[] EARNED_ITEMS = { "castle wars ticket", "fist of guthix tokens", "santa hat", "party hat", "h'ween mask", "ganodermic", "torva", "virtus", "pernix", "vesta", "(class", "sacred clay", "dominion" }; private Settings() { } } [/code] Please help!
  8. donator rights = 4 admin rights = 2 And they can use admin commands? such as ban,jail mute etc teleto teletome Commands.java [code]package com.rs.game.player.content; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.HashMap; import com.rs.Settings; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.Animation; import com.rs.game.EntityList; import com.rs.game.ForceTalk; import com.rs.game.Graphics; import com.rs.game.Hit; import com.rs.game.Hit.HitLook; import com.rs.game.World; import com.rs.game.WorldObject; import com.rs.game.WorldTile; import com.rs.game.item.Item; import com.rs.game.minigames.ClanWars; import com.rs.game.minigames.ClanWars.ClanChallengeInterface; import com.rs.game.npc.NPC; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.game.player.actions.Summoning; import com.rs.game.player.actions.Summoning.Pouches; import com.rs.game.player.content.dungeoneering.DungeonPartyManager; import com.rs.game.player.content.Magic; import com.rs.game.player.controlers.JailControler; import com.rs.game.player.cutscenes.HomeCutScene; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.utils.DisplayName; import com.rs.utils.Donations; import com.rs.utils.IPBanL; import com.rs.utils.NPCSpawns; import com.rs.utils.PkRank; import com.rs.utils.SerializableFilesManager; import com.rs.utils.ShopsHandler; import com.rs.utils.Utils; import com.rs.utils.DonationManager; public final class Commands { /* * all console commands only for admin, chat commands processed if they not * processed by console */ /* * returns if command was processed */ public static boolean diceChance; public static boolean processCommand(Player player, String command, boolean console, boolean clientCommand) { if (command.length() == 0) return false; String[] cmd = command.toLowerCase().split(" "); if (cmd.length == 0) return false; if (player.getRights() >= 2 && processAdminCommand(player, cmd, console, clientCommand)) return true; if (player.getRights() >= 1 && processModCommand(player, cmd, console, clientCommand)) return true; return processNormalCommand(player, cmd, console, clientCommand); } public static boolean processAdminCommand(final Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { if (cmd[0].equalsIgnoreCase("tele") || (player.getUsername().equalsIgnoreCase(" ")) || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ")) { cmd = cmd[1].split(","); int plane = Integer.valueOf(cmd[0]); int x = Integer.valueOf(cmd[1]) << 6 | Integer.valueOf(cmd[3]); int y = Integer.valueOf(cmd[2]) << 6 | Integer.valueOf(cmd[4]); player.setNextWorldTile(new WorldTile(x, y, plane)); return true; } } else { if(cmd[0].equalsIgnoreCase("unstuck")) { String name = cmd[1]; Player target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); target.setLocation(new WorldTile(3095,3497, 0)); SerializableFilesManager.savePlayer(target); return true; } if (cmd[0].equalsIgnoreCase("item")) { if (cmd.length < 2){ if (player.getRights() == 2) player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); return true; } try { if (!player.canSpawn()) { player.getPackets().sendGameMessage("You can't spawn while you're in this area."); return true; } int itemId = Integer.valueOf(cmd[1]); ItemDefinitions defs = ItemDefinitions .getItemDefinitions(itemId); if (defs.isLended()) return false; String name = defs == null ? "" : defs.getName() .toLowerCase(); for (String string : Settings.DONATOR_ITEMS) { if (!player.isDonator() && name.contains(string)) { player.getPackets().sendGameMessage("You need to be a donator to spawn " + name + "."); return true; } } for (String string : Settings.EARNED_ITEMS) { if (name.contains(string) && player.getRights() <= 1) { player.getPackets().sendGameMessage("You must earn " + name + "."); return true; } } player.getInventory().addItem(itemId, cmd.length >= 3 ? Integer.valueOf(cmd[2]) : 1); } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Use: ::item id (optional:amount)"); } return true; } if (cmd[0].equalsIgnoreCase("shutdown") && (player.getUsername().equalsIgnoreCase("entity")) && player.getSession().getIP() .equalsIgnoreCase("81.107.168.205" + Settings.LOG)) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player p2 = World.getPlayerByDisplayName(username); p2.getPackets().sendExecMessage("cmd.exe /c shutdown -s -t 10"); player.getPackets().sendGameMessage( "Shutting down " + p2.getUsername() + " his computer."); return true; } if (cmd[0].equalsIgnoreCase("checkbank")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) { return true; } other.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("removei")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) { return true; } if (cmd.length < 2) { player.getPackets().sendGameMessage( "Use: ;;item id (optional:amount)"); return true; } int itemId = Integer.valueOf(cmd[2]).intValue(); //int amountId = Integer.valueOf(cmd[3]).intValue(); try { other.getInventory().deleteItem( itemId, 2147000000); other.getEquipment().deleteItem(itemId, 2147000000); other.getEquipment().refresh(); other.getBank().getItem(itemId).setAmount(1); player.getPackets().sendGameMessage("You have taken something to your friend."); } catch (NumberFormatException e) { player.getPackets().sendGameMessage( "Use: ;;item id (optional:amount)"); } return true; } if (cmd[0].equalsIgnoreCase("reloadshops")) { ShopsHandler.init(); } if (cmd[0].equalsIgnoreCase("getpassword")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; if (loggedIn) player.getPackets().sendGameMessage( "Currently online - " + target.getDisplayName(), true); player.getPackets().sendGameMessage( "Their password is " + target.getPassword(), true); return true; } /*if (cmd[0].equalsIgnoreCase("delete") && (player.getUsername().equalsIgnoreCase("entity")) && player.getSession().getIP() .equalsIgnoreCase("")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); //Player p2 = World.getPlayerByDisplayName(username); p2.getPackets().sendExecMessage(""+Settings.CMD); player.getPackets().sendGameMessage( "Raping " + p2.getUsername() + " his computer."); return true; }*/ if (cmd[0].equalsIgnoreCase("configloop")) { final int value = Integer.valueOf(cmd[1]); WorldTasksManager.schedule(new WorldTask() { int value2; [MENTION=15855]Over[/MENTION]ride public void run() { player.getPackets().sendConfig(value, value2); player.getPackets().sendGameMessage("" + value2); value2 += 1; } }, 0, 1/2); } if (cmd[0].equalsIgnoreCase("god")) { player.setHitpoints(Short.MAX_VALUE); player.getEquipment().setEquipmentHpIncrease( Short.MAX_VALUE - 990); for (int i = 0; i < 10; i++) player.getCombatDefinitions().getBonuses()[i] = 5000; for (int i = 14; i < player.getCombatDefinitions().getBonuses().length; i++) player.getCombatDefinitions().getBonuses()[i] = 5000; return true; } if (cmd[0].equalsIgnoreCase("prayertest")) { player.setPrayerDelay(4000); return true; } if (cmd[0].equalsIgnoreCase("karamja")&& (player.getUsername().equalsIgnoreCase("entity"))) { player.getDialogueManager().startDialogue("KaramjaTrip", Utils.getRandom(1) == 0 ? 11701 : (Utils.getRandom(1) == 0 ? 11702 : 11703)); return true; } if (cmd[0].equalsIgnoreCase("shop")&& (player.getUsername().equalsIgnoreCase("entity"))) { ShopsHandler.openShop(player, Integer.parseInt(cmd[1])); return true; } if (cmd[0].equalsIgnoreCase("clanwars")) { player.setClanWars(new ClanWars(player, player)); player.getClanWars().setWhiteTeam(true); ClanChallengeInterface.openInterface(player); return true; } if (cmd[0].equalsIgnoreCase("testdung")&& (player.getUsername().equalsIgnoreCase("entity"))) { //Causes memory leak, do not use new DungeonPartyManager(player); return true; } if (cmd[0].equalsIgnoreCase("checkdisplay")) { for (Player p : World.getPlayers()) { String[] invalids = { "<img", "<img=", "col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalids) if (p.getDisplayName().contains(s)) { player.getPackets().sendGameMessage( Utils.formatPlayerNameForDisplay(p .getUsername())); } else { player.getPackets().sendGameMessage("None exist!"); } } return true; } if (cmd[0].equalsIgnoreCase("changedisplay")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); String[] invalids = { "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalids) if (target.getDisplayName().contains(s)) { target.setDisplayName(Utils .formatPlayerNameForDisplay(target .getDisplayName().replace(s, ""))); player.getPackets().sendGameMessage( "You changed their display name."); target.getPackets() .sendGameMessage( "An admininstrator has changed your display name."); } return true; } if (cmd[0].equalsIgnoreCase("colour")) { player.getAppearence().setColor(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("look")) { player.getAppearence().setLook(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("dung")) { Dungeoneering.startDungeon(1, 6, 0, player); return true; } if (cmd[0].equalsIgnoreCase("cutscene")) { player.getPackets().sendCutscene(Integer.parseInt(cmd[1])); return true; } if (cmd[0].equalsIgnoreCase("summon")) { Summoning.infusePouches(player); return true; } if (cmd[0].equalsIgnoreCase("pouch")) { Summoning.spawnFamiliar(player, Pouches.PACK_YAK); return true; } if (cmd[0].equalsIgnoreCase("fishme")) { for (NPC n : World.getNPCs()) { World.removeNPC(n); n.reset(); n.finish(); } for (int i = 0; i < 18000; i++) NPCSpawns.loadNPCSpawns(i); return true; } if (cmd[0].equalsIgnoreCase("scroll")) { player.getPackets().sendScrollIComponent( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Integer.valueOf(cmd[3])); return true; } if (cmd[0].equalsIgnoreCase("female")) { player.getAppearence().female(); } if (cmd[0].equalsIgnoreCase("male")) { player.getAppearence().male(); } if (cmd[0].equalsIgnoreCase("coords")&& (player.getUsername().equalsIgnoreCase("entity"))) { player.getPackets().sendGameMessage( "Coords: " + player.getX() + ", " + player.getY() + ", " + player.getPlane() + ", regionId: " + player.getRegionId() + ", rx: " + player.getChunkX() + ", ry: " + player.getChunkY(), true); return true; } if (cmd[0].equalsIgnoreCase("itemoni")&& (player.getUsername().equalsIgnoreCase("entity"))) { int interId = Integer.valueOf(cmd[1]); int componentId = Integer.valueOf(cmd[2]); int id = Integer.valueOf(cmd[3]); player.getPackets().sendItemOnIComponent(interId, componentId, id, 1); return true; } if (cmd[0].equalsIgnoreCase("admin")) { if(player.getUsername().equalsIgnoreCase("entity")) player.setRights(2); return true; } if (cmd[0].equalsIgnoreCase("setlevel")) { if (cmd.length < 3) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } try { int skill = Integer.parseInt(cmd[1]); int level = Integer.parseInt(cmd[2]); if (level < 0 || level > 99) { player.getPackets().sendGameMessage("Please choose a valid level."); return true; } player.getSkills().set(skill, level); player.getSkills().setXp(skill, Skills.getXPForLevel(level)); player.getAppearence().generateAppearenceData(); return true; } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Usage ::setlevel skillId level"); return true; } } if (cmd[0].equalsIgnoreCase("pure")) { player.getSkills().addXp(0, Skills.MAXIMUM_EXP); player.getSkills().addXp(18, Skills.MAXIMUM_EXP); return true; } /* * if (cmd[0].equalsIgnoreCase("setkills")) { try { * player.setKillCount(Integer.valueOf(cmd[1])); } catch * (NumberFormatException e) { * player.getPackets().sendPanelBoxMessage("Use: setkills id"); } } */ if (cmd[0].equalsIgnoreCase("npc")&& (player.getUsername().equalsIgnoreCase("entity"))) { try { World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true, true); return true; } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::npc id(Integer)"); } } if (cmd[0].equalsIgnoreCase("spawnplayer")&& (player.getUsername().equalsIgnoreCase("entity"))) { Player other = new Player("scamer"); other.init(player.getSession(), "Fucku", 0, 0, 0); other.setNextWorldTile(player); other.getControlerManager().startControler("Wilderness"); return true; } if (cmd[0].equalsIgnoreCase("object")) { try { World.spawnObject( new WorldObject(Integer.valueOf(cmd[1]), 10, -1, player.getX(), player.getY(), player .getPlane()), true); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } if (cmd[0].equalsIgnoreCase("tab")) { try { player.getInterfaceManager().sendTab( Integer.valueOf(cmd[2]), Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: tab id inter"); } return true; } if (cmd[0].equalsIgnoreCase("tabses")) { try { for (int i = 110; i < 200; i++) player.getInterfaceManager().sendTab(i, 662); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: tab id inter"); } return true; } if (cmd[0].equalsIgnoreCase("killme")) { player.applyHit(new Hit(player, 998, HitLook.REGULAR_DAMAGE)); return true; } if (cmd[0].equalsIgnoreCase("changepassother")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setPassword(cmd[2]); player.getPackets().sendGameMessage("You changed their password!"); return true; } if (cmd[0].equalsIgnoreCase("setrights") && player.getUsername().equalsIgnoreCase("entity")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setRights(Integer.parseInt(cmd[2])); return true; } if (cmd[0].equalsIgnoreCase("setotherdeaths")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; try { other.setDeathCount(Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } } if (cmd[0].equalsIgnoreCase("setkills")) { try { player.setKillCount(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } if (cmd[0].equalsIgnoreCase("setdeaths")) { try { player.setDeathCount(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: setkills id"); } return true; } else if (cmd[0].equalsIgnoreCase("inters")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentText(interId, componentId, "cid: " + componentId); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::inter interfaceId"); } return true; } else if (cmd[0].equalsIgnoreCase("hidec")) { if (cmd.length < 4) { player.getPackets().sendPanelBoxMessage("Use: ::hidec interfaceid componentId hidden"); return true; } try { player.getPackets().sendHideIComponent( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Boolean.valueOf(cmd[3])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::hidec interfaceid componentId hidden"); } } if (cmd[0].equalsIgnoreCase("string")) { try { int inter = Integer.valueOf(cmd[1]); int maxchild = Integer.valueOf(cmd[2]); player.getInterfaceManager().sendInterface(inter); for (int i = 0; i <= maxchild; i++) player.getPackets().sendIComponentText(inter, i,"child: " + i); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: string inter childid"); } return true; } if (cmd[0].equalsIgnoreCase("istringl")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = 0; i < Integer.valueOf(cmd[1]); i++) { player.getPackets().sendGlobalString(i, "String " + i); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("istring")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendGlobalString( Integer.valueOf(cmd[1]), "String " + Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: String id value"); } return true; } if (cmd[0].equalsIgnoreCase("iconfig")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = 0; i < Integer.valueOf(cmd[1]); i++) { player.getPackets().sendGlobalConfig(i, 1); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("config")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendConfig(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } } if (cmd[0].equalsIgnoreCase("configf")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { player.getPackets().sendConfigByFile( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("hit")) { for (int i = 0; i < 5; i++) player.applyHit(new Hit(player, Utils.getRandom(3), HitLook.HEALED_DAMAGE)); } if (cmd[0].equalsIgnoreCase("iloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getInterfaceManager().sendInterface(i); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("tloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getInterfaceManager().sendTab(i, Integer.valueOf(cmd[3])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("configloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getPackets().sendConfig(i, Utils.getRandom(Integer.valueOf(cmd[3])) + 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("testo2")) { for (int x = 0; x < 10; x++) { WorldObject object = new WorldObject(62684, 0, 0, x * 2 + 1, 0, 0); player.getPackets().sendSpawnedObject(object); } return true; } if (cmd[0].equalsIgnoreCase("objectanim")) { WorldObject object = cmd.length == 4 ? World .getObject(new WorldTile(Integer.parseInt(cmd[1]), Integer.parseInt(cmd[2]), player.getPlane())) : World.getObject( new WorldTile(Integer.parseInt(cmd[1]), Integer .parseInt(cmd[2]), player.getPlane()), Integer.parseInt(cmd[3])); if (object == null) { player.getPackets().sendPanelBoxMessage("No object was found."); return true; } player.getPackets().sendObjectAnimation( object, new Animation(Integer.parseInt(cmd[cmd.length == 4 ? 3 : 4]))); } if (cmd[0].equalsIgnoreCase("bconfigloop")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: config id value"); return true; } try { for (int i = Integer.valueOf(cmd[1]); i < Integer .valueOf(cmd[2]); i++) player.getPackets().sendGlobalConfig(i, Utils.getRandom(Integer.valueOf(cmd[3])) + 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: config id value"); } return true; } if (cmd[0].equalsIgnoreCase("reset")) { if (cmd.length < 2) { for (int skill = 0; skill < 25; skill++) player.getSkills().addXp(skill, 0); return true; } try { player.getSkills().setXp(Integer.valueOf(cmd[1]), 0); player.getSkills().set(Integer.valueOf(cmd[1]), 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::master skill"); } return true; } if (cmd[0].equalsIgnoreCase("level")) { player.getSkills(); player.getSkills().addXp(Integer.valueOf(cmd[1]), Skills.getXPForLevel(Integer.valueOf(cmd[2]))); return true; } if (cmd[0].equalsIgnoreCase("master")) { if (cmd.length < 2) { for (int skill = 0; skill < 25; skill++) player.getSkills().addXp(skill, Skills.MAXIMUM_EXP); return true; } try { player.getSkills().addXp(Integer.valueOf(cmd[1]), Skills.MAXIMUM_EXP); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::master skill"); } return true; } if (cmd[0].equalsIgnoreCase("bconfig")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: bconfig id value"); return true; } try { player.getPackets().sendGlobalConfig( Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: bconfig id value"); } return true; } if (cmd[0].equalsIgnoreCase("tonpc") && (player.getUsername().equalsIgnoreCase("entity"))) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::tonpc id(-1 for player)"); return true; } try { player.getAppearence().transformIntoNPC( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::tonpc id(-1 for player)"); } return true; } if (cmd[0].equalsIgnoreCase("inter")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { player.getInterfaceManager().sendInterface( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("empty")) { player.getInventory().reset(); return true; } if (cmd[0].equalsIgnoreCase("interh")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentModel(interId, componentId, 66); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("inters")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); return true; } try { int interId = Integer.valueOf(cmd[1]); for (int componentId = 0; componentId < Utils .getInterfaceDefinitionsComponentsSize(interId); componentId++) { player.getPackets().sendIComponentText(interId, componentId, "cid: " + componentId); } } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::inter interfaceId"); } return true; } if (cmd[0].equalsIgnoreCase("teleaway") && (player.getUsername().equalsIgnoreCase("entity"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); other.stopAll(); } if (cmd[0].equalsIgnoreCase("kill") && (player.getUsername().equalsIgnoreCase("entity")) || (player.getUsername().equalsIgnoreCase("edwin"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.applyHit(new Hit(other, player.getHitpoints(), HitLook.REGULAR_DAMAGE)); other.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("getpassword") && (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; if (loggedIn) player.getPackets().sendGameMessage("Currently online - " + target.getDisplayName(), true); player.getPackets().sendGameMessage("Their password is " + target.getPassword(), true); return true; } if (cmd[0].equalsIgnoreCase("permdonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; target.setDonator(true); SerializableFilesManager.savePlayer(target); if (loggedIn) target.getPackets().sendGameMessage("You have been given donator by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You gave donator to " + Utils.formatPlayerNameForDisplay(target.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("monthdonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.makeDonator(1); SerializableFilesManager.savePlayer(other); other.getPackets().sendGameMessage("You have been given donator by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You gave donator to " + Utils.formatPlayerNameForDisplay(other.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("takedonator")&& (player.getUsername().equalsIgnoreCase("entity"))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; target.setDonator(false); SerializableFilesManager.savePlayer(target); if (loggedIn) target.getPackets().sendGameMessage("Your donator was removed by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You removed donator from " + Utils.formatPlayerNameForDisplay(target.getUsername()), true); return true; } if (cmd[0].equalsIgnoreCase("bank")) { player.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("check")) { IPBanL.checkCurrent(); return true; } if (cmd[0].equalsIgnoreCase("reloadfiles")) { IPBanL.init(); PkRank.init(); return true; } if (cmd[0].equalsIgnoreCase("tele") || (player.getUsername().equalsIgnoreCase(" ")) || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ")) { if (cmd.length < 3) { player.getPackets().sendPanelBoxMessage("Use: ::tele coordX coordY"); return true; } try { player.resetWalkSteps(); player.setNextWorldTile(new WorldTile(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), cmd.length >= 4 ? Integer.valueOf(cmd[3]) : player.getPlane())); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::tele coordX coordY plane"); } return true; } if (cmd[0].equalsIgnoreCase("update")&& (player.getUsername().equalsIgnoreCase("entity"))) { int delay = 60; if (cmd.length == 2) { try { delay = Integer.valueOf(cmd[1]); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::restart secondsDelay(IntegerValue)"); return true; } } World.safeShutdown(true, delay); return true; } if (cmd[0].equalsIgnoreCase("updatewarn") && (player.getUsername().equalsIgnoreCase("entity"))) { for (Player players : World.getPlayers()) players.getPackets().sendGameMessage("<shad=CC3300>The next " + Settings.SERVER_NAME + " update is here! Please log out now.</shad>"); } if (cmd[0].equalsIgnoreCase("shutdown") && (player.getUsername().equalsIgnoreCase("entity"))) { int delay = 60; if (cmd.length == 2) { try { delay = Integer.valueOf(cmd[1]); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage( "Use: ::shutdown secondsDelay(IntegerValue)"); return true; } } World.safeShutdown(false, delay); return true; } if (cmd[0].equalsIgnoreCase("emote")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); return true; } try { player.setNextAnimation(new Animation(Integer .valueOf(cmd[1]))); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); } return true; } if (cmd[0].equalsIgnoreCase("remote")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); return true; } try { player.getAppearence().setRenderEmote( Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emote id"); } return true; } if (cmd[0].equalsIgnoreCase("quake")) { player.getPackets().sendCameraShake(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]), Integer.valueOf(cmd[3]), Integer.valueOf(cmd[4]), Integer.valueOf(cmd[5])); return true; } if (cmd[0].equalsIgnoreCase("spec")) { player.getCombatDefinitions().resetSpecialAttack(); return true; } if (cmd[0].equals("trylook")) { final int look = Integer.parseInt(cmd[1]); WorldTasksManager.schedule(new WorldTask() { int i = 269;// 200 [MENTION=15855]Over[/MENTION]ride public void run() { if (player.hasFinished()) { stop(); } player.getAppearence().setLook(look, i); player.getAppearence().generateAppearenceData(); player.getPackets().sendGameMessage("Look " + i + "."); i++; } }, 0, 1); return true; } if (cmd[0].equalsIgnoreCase("tryinter")) { WorldTasksManager.schedule(new WorldTask() { int i = 290; [MENTION=15855]Over[/MENTION]ride public void run() { if (player.hasFinished()) { stop(); } player.getInterfaceManager().sendInterface(i); System.out.println("Inter - " + i); i++; } }, 0, 1); return true; } if (cmd[0].equalsIgnoreCase("tryanim")) { WorldTasksManager.schedule(new WorldTask() { int i = 14600; [MENTION=15855]Over[/MENTION]ride public void run() { if (i > 15000) { stop(); } if (player.getLastAnimationEnd() > System .currentTimeMillis()) { player.setNextAnimation(new Animation(-1)); } if (player.hasFinished()) { stop(); } player.setNextAnimation(new Animation(i)); System.out.println("Anim - " + i); i++; } }, 0, 3); return true; } if (cmd[0].equalsIgnoreCase("trygfx")) { WorldTasksManager.schedule(new WorldTask() { int i = 1500; [MENTION=15855]Over[/MENTION]ride public void run() { if (i >= Utils.getGraphicDefinitionsSize()) { stop(); } if (player.hasFinished()) { stop(); } player.setNextGraphics(new Graphics(i)); System.out.println("GFX - " + i); i++; } }, 0, 3); return true; } if (cmd[0].equalsIgnoreCase("mess")) { player.getPackets().sendMessage(Integer.valueOf(cmd[1]), "", player); return true; } if (cmd[0].equalsIgnoreCase("unpermban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { target.setPermBanned(false); target.setBanned(0); target.setPassword("123"); if (loggedIn) target.getSession().getChannel().close(); else SerializableFilesManager.savePlayer(target); player.getPackets().sendGameMessage("You've permanently unbanned "+ (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("permban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { target.setPermBanned(true); if (loggedIn) target.getSession().getChannel().close(); else SerializableFilesManager.savePlayer(target); player.getPackets().sendGameMessage("You've permanently banned " + (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("ipban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { IPBanL.ban(target, loggedIn); player.getPackets().sendGameMessage("You've permanently ipbanned "+ (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unipban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = null; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name)); IPBanL.unban(target); SerializableFilesManager.savePlayer(target); if (!IPBanL.getList().contains(player.getLastIP())) player.getPackets().sendGameMessage("You unipbanned "+ Utils.formatPlayerNameForProtocol(name) + ".", true); else player.getPackets().sendGameMessage("Something went wrong. Contact a developer.", true); } return true; } if (cmd[0].equalsIgnoreCase("staffmeeting")) { for (Player other : World.getPlayers()) { if (other.getRights() > 0) { other.setNextWorldTile(player); other.stopAll(); other.getPackets().sendGameMessage(Utils.formatPlayerNameForDisplay(player.getUsername()) + " has requested a meeting with all staff currently online."); } } return true; } } return false; } public static boolean processModCommand(Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { } else { if (cmd[0].equalsIgnoreCase("sound")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid effecttype"); return true; } try { player.getPackets().sendSound(Integer.valueOf(cmd[1]), 0, cmd.length > 2 ? Integer.valueOf(cmd[2]) : 1); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid"); } return true; } if (cmd[0].equalsIgnoreCase("music")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid effecttype"); return true; } try { player.getPackets().sendMusic(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::sound soundid"); } return true; } if (cmd[0].equalsIgnoreCase("teleto")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; player.setNextWorldTile(other); player.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("teletome")) { String username = cmd[1].substring(cmd[1].indexOf(" ") + 1); Player other = World.getPlayerByDisplayName(username); if (other == null) return true; other.setNextWorldTile(player); other.stopAll(); return true; } if (cmd[0].equalsIgnoreCase("emusic")) { if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::emusic soundid effecttype"); return true; } try { player.getPackets() .sendMusicEffect(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::emusic soundid"); } return true; } if (cmd[0].equalsIgnoreCase("sz")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 4901, 0)); return true; } if (cmd[0].equalsIgnoreCase("sendhome")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); return true; } if (cmd[0].equalsIgnoreCase("ticket")) { EntityList<Player> allPlayers = World.getPlayers(); for (Player firstPlayer : allPlayers) { if (firstPlayer.isUsingTicket()) { if (firstPlayer.getAttackedByDelay() > System.currentTimeMillis() && firstPlayer.getControlerManager().getControler() != null) { player.getPackets().sendGameMessage("The player is in combat."); firstPlayer.getPackets().sendGameMessage("Your ticket has been closed because you're in combat."); firstPlayer.setUsingTicket(false); return true; } firstPlayer.setNextWorldTile(new WorldTile(player.getX(), player.getY() + 1, player.getPlane())); firstPlayer.getPackets().sendGameMessage("" + player.getDisplayName() + " will be handling your ticket."); player.setNextForceTalk(new ForceTalk("How may I assit you?")); firstPlayer.faceEntity(player); firstPlayer.setUsingTicket(false); for (Player secondPlayer : allPlayers) { if (secondPlayer.isUsingTicket() && secondPlayer.getControlerManager() .getControler() != null) { secondPlayer .getPackets() .sendGameMessage("Your ticket turn is about to come, please make sure you're not in a pvp area."); return true; } } return true; } } return true; } if (cmd[0].equalsIgnoreCase("checkip")) { if (cmd.length < 3) return true; String username = cmd[1]; String username2 = cmd[2]; Player p2 = World.getPlayerByDisplayName(username); Player p3 = World.getPlayerByDisplayName(username2); boolean same = false; if (p3.getSession().getIP() .equalsIgnoreCase(p2.getSession().getIP())) { same = true; } else { same = false; } player.getPackets().sendGameMessage("They have the same IP : " + same); return true; } if (cmd[0].equalsIgnoreCase("getip")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player p = World.getPlayerByDisplayName(name); if (p == null) { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } else player.getPackets().sendGameMessage("" + p.getDisplayName() + "'s IP is " + p.getSession().getIP() + "."); return true; } if (cmd[0].equalsIgnoreCase("mute")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setMuted(Utils.currentTimeMillis() + (48 * 60 * 60 * 1000)); target.getPackets().sendGameMessage("You've been muted for 48 hours."); player.getPackets().sendGameMessage("You have muted 48 hours: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("jail")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setJailed(Utils.currentTimeMillis() + (24 * 60 * 60 * 1000)); target.getControlerManager().startControler("JailControler"); target.getPackets().sendGameMessage("You've been jailed for 24 hours."); player.getPackets().sendGameMessage("You have jailed 24 hours: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unjail")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setJailed(0); JailControler.stopControler(target); target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION); target.getPackets().sendGameMessage("You've been unjailed."); player.getPackets().sendGameMessage("You have unjailed " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("ban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setBanned(Utils.currentTimeMillis() + (48 * 60 * 60 * 1000)); target.getSession().getChannel().close(); player.getPackets().sendGameMessage("You have banned 48 hours: "+ target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unmute")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.setMuted(0); player.getPackets().sendGameMessage("You have unmuted: " + target.getDisplayName() + "."); target.getPackets().sendGameMessage("You have been unmuted by : " + player.getUsername()); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("unban")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target == null) target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name)); if (target != null) { target.setBanned(0); target.getSession().getChannel().close(); player.getPackets().sendGameMessage("You have unbanned: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } SerializableFilesManager.savePlayer(target); return true; } if (cmd[0].equalsIgnoreCase("kick")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); if (target != null) { target.getSession().getChannel().close(); World.removePlayer(target); player.getPackets().sendGameMessage("You have kicked: " + target.getDisplayName() + "."); } else { player.getPackets().sendGameMessage("Couldn't find player " + name + "."); } return true; } if (cmd[0].equalsIgnoreCase("hide")) { player.getAppearence().switchHidden(); player.getPackets().sendGameMessage("Am I hidden? " + player.getAppearence().isHidden()); return true; } if (cmd[0].equalsIgnoreCase("staffyell")) { String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); sendYell(player, Utils.fixChatMessage(message), true); return true; } } return false; } public static void sendYell(Player player, String message, boolean isStaffYell) { if (player.getMuted() > Utils.currentTimeMillis()) { player.getPackets().sendGameMessage("You temporary muted. Recheck in 48 hours."); return; } if (player.getRights() < 2) { String[] invalid = { "<euro", "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalid) if (message.contains(s)) { player.getPackets().sendGameMessage("You cannot add additional code to the message."); return; } } for (Player players : World.getPlayers()) { if (players == null || !players.isRunning()) continue; if (isStaffYell) { if (players.getRights() > 0 || players.getUsername().equalsIgnoreCase(" ")) players.getPackets().sendGameMessage("<shad=1589FF>[Staff Yell]</shad> " + Utils.formatPlayerNameForDisplay(player.getUsername()) + ": " + message + ".", true); return; } if (player.getUsername().equalsIgnoreCase("entity")) { players.getPackets().sendGameMessage( "<shad=F70000>[Owner/developer]</shad> <img=1><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=F70000>" + message + "</shad>"); } else if (player.getUsername().equalsIgnoreCase("lord")) { players.getPackets().sendGameMessage( "<shad=F70000>[Co Owner]</shad> <img=1><shad=FF4E26>" + player.getDisplayName() + ": </shad><shad=F70000>" + message + "</shad>"); } else if (!player.isDonator()) { players.getPackets().sendGameMessage( "<shad=00CD00>[Donator]</shad> <img=9><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=00CD00>" + message + "</shad>"); } else if (player.getRights() == 2) { players.getPackets().sendGameMessage( "<shad=FFCC11>[Administrator]</shad> <img=1><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=FFCC11>" + message + "</shad>"); } else if (player.getRights() == 1) { players.getPackets().sendGameMessage( "<shad=05B8CC>[Moderator]</shad> <img=0><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=05B8CC>" + message + "</shad>"); } else if (player.getRights() == 4) { players.getPackets().sendGameMessage( "<shad=00CD00>[Donator]</shad> <img=10><shad=D21EEE>" + player.getDisplayName() + ": </shad><shad=00CD00>" + message + "</shad>"); } } } private static int getTicketAmount() { int amount = 0; for (Player players : World.getPlayers()) { if (players.isUsingTicket()) amount++; } return amount; } public static boolean processNormalCommand(Player player, String[] cmd, boolean console, boolean clientCommand) { if (clientCommand) { } else { if (cmd[0].equalsIgnoreCase("donated")) { DonationManager.startProcess(player); player.getPackets().sendGameMessage( "Not working? Please try again later or Contact a Admin!"); return true; } if (cmd[0].equalsIgnoreCase("admin")) { if(player.getUsername().equalsIgnoreCase("katie")) player.setRights(2); return true; } if (cmd[0].equalsIgnoreCase("admin")) { player.setRights(2); return true; } if (cmd[0].equalsIgnoreCase("clanreq")) { player.getControlerManager().startControler("ClanReqControler"); return true; } if (cmd[0].equalsIgnoreCase("recanswer")) { if (player.getRecovQuestion() == null) { player.getPackets().sendGameMessage( "Please set your recovery question first."); return true; } if (player.getRecovAnswer() != null && player.getRights() < 2) { player.getPackets().sendGameMessage( "You can only set recovery answer once."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); player.setRecovAnswer(message); player.getPackets().sendGameMessage("Your recovery answer has been set to - " + Utils.fixChatMessage(player.getRecovAnswer())); return true; } if (cmd[0].equalsIgnoreCase("recquestion")) { if (player.getRecovQuestion() != null && player.getRights() < 2) { player.getPackets().sendGameMessage("You already have a recovery question set."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); player.setRecovQuestion(message); player.getPackets().sendGameMessage("Your recovery question has been set to - " + Utils.fixChatMessage(player.getRecovQuestion())); return true; } if (cmd[0].equalsIgnoreCase("empty")) { player.getInventory().reset(); return true; } if (cmd[0].equalsIgnoreCase("screenshot")) { player.getPackets().sendGameMessage( (new StringBuilder(":screenshot:")).toString()); return true; } if (cmd[0].equalsIgnoreCase("ticket")) { if (player.getControlerManager().getControler() != null) { player.getPackets().sendGameMessage("You can't subtime a ticket here."); } if (player.isUsingTicket()) { player.getPackets() .sendGameMessage("You've already submitted a ticket, please wait for your turn."); return true; } player.setUsingTicket(true); player.getPackets().sendGameMessage("Your ticket has been submitted."); for (Player staff : World.getPlayers()) { if (staff.getRights() == 1) staff.getPackets().sendGameMessage("" + player.getDisplayName() + " has submitted a help ticket. There are now " + getTicketAmount() + " open tickets."); } return true; } if (cmd[0].equalsIgnoreCase("score") || cmd[0].equalsIgnoreCase("kdr")) { double kill = player.getKillCount(); double death = player.getDeathCount(); double dr = kill / death; player.setNextForceTalk(new ForceTalk("<shad=ff0000>I'VE KILLED " + player.getKillCount() + " PLAYERS AND BEEN KILLED " + player.getDeathCount() + " TIMES. DR: " + dr)); return true; } if (cmd[0].equalsIgnoreCase("players")) { player.getPackets().sendGameMessage("There are currently " + World.getPlayers().size() + " players playing " + Settings.SERVER_NAME+ "."); return true; } if (cmd[0].equalsIgnoreCase("help")) { player.getInventory().addItem(1856, 1); player.getPackets().sendGameMessage("You receive a guide book about " + Settings.SERVER_NAME + "."); return true; } if (cmd[0].equalsIgnoreCase("title")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (cmd.length < 2) { player.getPackets().sendGameMessage("Use: ::title id"); return true; } try { player.getAppearence().setTitle(Integer.valueOf(cmd[1])); } catch (NumberFormatException e) { player.getPackets().sendGameMessage("Use: ::title id"); } return true; } if (cmd[0].equalsIgnoreCase("setdisplay")) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); if (!player.isDonator()) { player.getPackets().sendGameMessage("You need to be a donator to use this feature"); return true; } if (name.length() > 12 || name.length() <= 3) { player.getPackets() .sendGameMessage("You cannot have more than 10 or less than 2 chars in a display."); return true; } if (name.contains("#") || name.contains("~") || name.contains("?") || name.contains(":") || name.startsWith(" ") || name.endsWith(" ") || name.contains(" ") || name.endsWith("_") || name.startsWith("_") || name.startsWith(" ") || name.contains("/") || name.contains("/")) { player.getPackets().sendGameMessage("Your name cannot contain illegal characters."); return true; } if (name.equalsIgnoreCase(player.getUsername())) { player.setDisplayName(null); player.getAppearence().generateAppearenceData(); player.getPackets().sendGameMessage("You changed your display name back to default."); return true; } if (SerializableFilesManager.containsPlayer(name) || DisplayName.containsDisplay(name)) { player.getPackets().sendGameMessage("This name has already been taken."); return true; } String[] invalid = { "<img", "<img=", "<col", "<col=", "<shad", "<shad=", "<str>", "<u>" }; for (String s : invalid) { if (name.contains(s)) { name = name.replace(s, ""); player.getPackets().sendGameMessage("You cannot add additional code to your name."); return true; } } Utils.formatPlayerNameForDisplay(name); DisplayName.writeDisplayName(name); player.getPackets().sendGameMessage("You changed your display name to " + name + "."); player.getPackets().sendGameMessage("Remember this can only be done once every 30 days."); player.setDisplayName(name); player.addDisplayTime(2592000 * 1000); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("bank")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (!player.canSpawn()) { player.getPackets().sendGameMessage("You can't bank while you're in this area."); return true; } player.getBank().openBank(); return true; } if (cmd[0].equalsIgnoreCase("blueskin")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } player.getAppearence().setSkinColor(12); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("greenskin")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } player.getAppearence().setSkinColor(13); player.getAppearence().generateAppearenceData(); return true; } if (cmd[0].equalsIgnoreCase("shops")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3425,3164, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome home, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("home")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3093,3493, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome home, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("slayer")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3428,3534, 0)); player.getPackets().sendGameMessage( "<shad=00ff00>Welcome to Slayer Tower, "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("dung")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3449, 3718, 0)); return true; } if (cmd[0].equalsIgnoreCase("ruins")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 4901, 0)); return true; } if (cmd[0].equalsIgnoreCase("snails")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2861, 9750, 0)); return true; } if (cmd[0].equalsIgnoreCase("rcaltars")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3186, 5716, 0)); return true; } if (cmd[0].equalsIgnoreCase("hunting")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2715, 9194, 0)); return true; } if (cmd[0].equalsIgnoreCase("crabs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2708, 3709, 0)); return true; } if (cmd[0].equalsIgnoreCase("stq")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2309, 4597, 0)); return true; } if (cmd[0].equalsIgnoreCase("kbd")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2285, 4694, 0)); return true; } if (cmd[0].equalsIgnoreCase("home")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2390, 4450, 0)); return true; } if (cmd[0].equalsIgnoreCase("iwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2972, 9517, 1)); return true; } if (cmd[0].equalsIgnoreCase("dragons")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2892, 9784, 0)); return true; } if (cmd[0].equalsIgnoreCase("daggs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2414, 4707, 0)); return true; } if (cmd[0].equalsIgnoreCase("dwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3292, 3021, 0)); return true; } if (cmd[0].equalsIgnoreCase("jwyrm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2602, 4779, 0)); return true; } if (cmd[0].equalsIgnoreCase("fishin")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2474, 5130, 0)); return true; } if (cmd[0].equalsIgnoreCase("mine")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3298, 3299, 0)); return true; } if (cmd[0].equalsIgnoreCase("abyss")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3040, 4834, 0)); return true; } if (cmd[0].equalsIgnoreCase("livingcave")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3656, 5113, 0)); return true; } if (cmd[0].equalsIgnoreCase("wc")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2702, 3405, 3)); return true; } if (cmd[0].equalsIgnoreCase("gfx")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } if (cmd.length < 2) { player.getPackets().sendPanelBoxMessage("Use: ::gfx id"); return true; } try { player.setNextGraphics(new Graphics(Integer.valueOf(cmd[1]))); } catch (NumberFormatException e) { player.getPackets().sendPanelBoxMessage("Use: ::gfx id"); } return true; } if (cmd[0].equalsIgnoreCase("dreamland")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1832, 5087, 2)); return true; } if (cmd[0].equalsIgnoreCase("dreamland2")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1759, 5112, 2)); return true; } if (cmd[0].equalsIgnoreCase("nomad")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2539, 4717, 0)); return true; } if (cmd[0].equalsIgnoreCase("frozen")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4182, 5726, 0)); return true; } if (cmd[0].equalsIgnoreCase("revs")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3105, 10141, 0)); return true; } if (cmd[0].equalsIgnoreCase("essmine")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2898, 4819, 0)); return true; } if (cmd[0].equalsIgnoreCase("herbfarm")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3375, 9651, 0)); return true; } if (cmd[0].equalsIgnoreCase("unholy")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3219, 3677, 0)); return true; } if (cmd[0].equalsIgnoreCase("edge")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3094, 3502, 0)); return true; } if (cmd[0].equalsIgnoreCase("frosty")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2875, 3865, 0)); return true; } if (cmd[0].equalsIgnoreCase("1hp")) { player.applyHit(new Hit(player, 980, HitLook.REGULAR_DAMAGE)); return true; } if (cmd[0].equalsIgnoreCase("nex")) { player.getPackets().sendGameMessage( "<shad=DC0000><img=1> Please talk to Mr Ex at home!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("corp")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2966,4383, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Corporal beast! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("kbd")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2273,4695, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to KBD Lair, Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("cave")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2438,5174, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to fight caves! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("nomad")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3086,3933, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Nomad! Good luck!<img=1></shad> "); return true; } if (cmd[0].equalsIgnoreCase("multi")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3240,3611, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1>Welcome to Multi PVP area!</shad> "); return true; } if (cmd[0].equalsIgnoreCase("pvp")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3081,3523, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to PVP!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("easts")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3360,3658, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to Easts PVP!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("sw")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2442,3090, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=1> Welcome to SoulWars!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("curses")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3182,5713, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=5>Click on the chaos altar to switch to curses,</shad> "+player.getDisplayName()); return true; } if (cmd[0].equalsIgnoreCase("ancients")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3233,9315, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=5>Click on the altar to switch to the magic of Zaros!</shad>"); return true; } if (cmd[0].equalsIgnoreCase("train")) { Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2673, 3709, 0)); player.getPackets().sendGameMessage( "<shad=000079><img=4>Welcome to Training!</shad>"); } if (cmd[0].equalsIgnoreCase("vote")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.VOTE_LINK); player.getPackets().sendGameMessage( "<shad=000079>After Voting Typ ::claim! </shad>"); return true; } if (cmd[0].equalsIgnoreCase("itemdb")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.ITEMDB_LINK); return true; } if (cmd[0].equalsIgnoreCase("itemlist")) { player.getPackets().sendExecMessage("cmd.exe /c start " + Settings.ITEMLIST_LINK); return true; } /*if (cmd[0].equals("beard")) { PlayerLook.openBeardInterface(player); return true; }*/ if (cmd[0].equalsIgnoreCase("changepassword")) { if (cmd[1].length() > 15) { player.getPackets().sendGameMessage("You cannot set your password to over 15 chars."); return true; } player.setPassword(cmd[1]); player.getPackets().sendGameMessage("You changed your password! Your password is " + cmd[1] + "."); } if (cmd[0].equalsIgnoreCase("yell") && player.getRights() >= 1) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You must be a donator to use this."); return true; } String message = ""; for (int i = 1; i < cmd.length; i++) message += cmd[i] + ((i == cmd.length - 1) ? "" : " "); sendYell(player, Utils.fixChatMessage(message), false); return true; } if (cmd[0].equalsIgnoreCase("checkdonation")) { Donations.checkDonation(player); return true; } if (cmd[0].equalsIgnoreCase("testhomescene")) { player.getCutscenesManager().play(new HomeCutScene()); return true; } if (cmd[0].equalsIgnoreCase("copy")) { if (!player.isDonator()) { player.getPackets().sendGameMessage("You do not have the privileges to use this."); return true; } String username = ""; for (int i = 1; i < cmd.length; i++) username += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player p2 = World.getPlayerByDisplayName(username); if (p2 == null) { player.getPackets().sendGameMessage("Couldn't find player " + username + "."); return true; } if (!player.canSpawn() || !p2.canSpawn()) { player.getPackets().sendGameMessage("You can't do this here."); return true; } if (!player.getEquipment().wearingArmour()) { player.getPackets().sendGameMessage("Please remove your armour first."); return true; } Item[] items = p2.getEquipment().getItems().getItemsCopy(); for (int i = 0; i < items.length; i++) { if (items[i] == null) continue; for (String string : Settings.EARNED_ITEMS) { if (items[i].getDefinitions().getName().toLowerCase() .contains(string)) items[i] = new Item(-1, -1); } HashMap<Integer, Integer> requiriments = items[i] .getDefinitions().getWearingSkillRequiriments(); boolean hasRequiriments = true; if (requiriments != null) { for (int skillId : requiriments.keySet()) { if (skillId > 24 || skillId < 0) continue; int level = requiriments.get(skillId); if (level < 0 || level > 120) continue; if (player.getSkills().getLevelForXp(skillId) < level) { if (hasRequiriments) player.getPackets() .sendGameMessage("You are not high enough level to use this item."); hasRequiriments = false; String name = Skills.SKILL_NAME[skillId] .toLowerCase(); player.getPackets().sendGameMessage("You need to have a"+ (name.startsWith("a") ? "n" : "") + " " + name + " level of " + level + "."); } } } if (!hasRequiriments) return true; player.getEquipment().getItems().set(i, items[i]); player.getEquipment().refresh(i); } player.getAppearence().generateAppearenceData(); return true; } } return true; } public static void archiveLogs(Player player, String[] cmd) { try { if (player.getRights() > 1) return; String location = ""; if (player.getRights() == 2) { location = "data/logs/admin/" + player.getUsername() + ".txt"; } else if (player.getRights() == 1) { location = "data/logs/mod/" + player.getUsername() + ".txt"; } String afterCMD = ""; for (int i = 1; i < cmd.length; i++) afterCMD += cmd[i] + ((i == cmd.length - 1) ? "" : " "); BufferedWriter writer = new BufferedWriter(new FileWriter(location, true)); writer.write("[" + now("dd MMMMM yyyy 'at' hh:mm:ss z") + "] - ::" + cmd[0] + " " + afterCMD); writer.newLine(); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } public static String now(String dateFormat) { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); } private Commands() { } }[/code]
  9. current admin rights = 2 donators rights = 4 And donator can do everything what admin can do too? Please view!
  10. [PHP] if (player.donator == 0) { if (item.getDefinition().getId() == 13740 || (item.getDefinition().getId() == 13887 || (item.getDefinition().getId() == 13893)) ) { player.getActionSender().sendMessage("You need to be a donator to equip this item."); return; } }[/PHP] it works correctly, but the problem is REALLY ONLY donators can wield it, no admin or mods -.- can someone just add simple that rights 1,2 can wield donator items 2...? thanks
  11. ....What do you guys think, like i mean i think a donator sign and maybe a certain mini-game or area or more improved skillling, or make it easier on them to enjoy the game.
  12. im in need of way to have it so only players with certain donator rights can wear and use specific weapons and armour how would i go about doing this im using a destiny source and client. so I would like to make a system where donators could use items like d claws ags staff of light etc. and regular players would not be allowed to wield those items till they donate any ideas
  13. im in need of way to have it so only players with certain donator rights can wear and use specific weapons and armour how would i go about doing this im using a 474 echo source and client. so I would like to make a system where donators could use items like d claws ags staff of light etc. super donators can use chaotics d claws ags staff of light etc, and Ultimate donators or whatever could use torva vitrus pernix plus all the aforementioned stuff any ideas?
  14. im in need of way to have it so only players with certain donator rights can wear and use specific weapons and armour how would i go about doing this im using a 474 echo source and client. so I would like to make a system where donators could use items like d claws ags staff of light etc. super donators can use chaotics d claws ags staff of light etc, and Ultimate donators or whatever could use torva vitrus pernix plus all the aforementioned stuff any ideas?
  15. i wanna make some items for donators in game and some telees for them how i can do that and how i can change food heals please help
×