All pastes #1969411 Raw Edit

Hyperion Castlewars B ase

public javascript v1 · immutable
#1969411 ·published 2010-10-21 22:15 UTC
rendered paste body
package org.hyperion.rs2.content.minigames;import java.util.ArrayList;import java.util.List;import java.util.Random;import org.hyperion.misc.Misc;import org.hyperion.rs2.event.impl.castlewars.WaitingRoomEvent;import org.hyperion.rs2.model.Animation;import org.hyperion.rs2.model.GameObject;import org.hyperion.rs2.model.Item;import org.hyperion.rs2.model.Location;import org.hyperion.rs2.model.Player;import org.hyperion.rs2.model.World;import org.hyperion.rs2.model.container.Equipment;public class CastleWars {		public CastleWars() {			}		/**	 * Is the game started?	 */	public static boolean gameStarted = false;		/**	 * How many barricades are in game.	 */	public static int barricades = 0;		/**	 * Data for door's health	 */	public static int saradominDoorHealth = 10;	public static int zamorakDoorHealth = 10;		/**	 * Are the doors unlocked?	 */	public static boolean saradominDoorOpen = false;	public static boolean zamorakDoorOpen = false;		/**	 * Randoms	 */	public static final Random r = new Random();	public static final int rInt(int value) {		return Misc.random(value);	}		public static List<String> allPlayers = new ArrayList<String>();		/**	 * Lists of players in game, and on seperate teams	 */	public static List<String> waitPlayers = new ArrayList<String>();	public static List<String> zamWaitPlayers = new ArrayList<String>();	public static List<String> saraWaitPlayers = new ArrayList<String>();		/**	 * In game players.	 */	public static List<String> inGamePlayers = new ArrayList<String>();	public static List<String> inGameZ = new ArrayList<String>();	public static List<String> inGameS = new ArrayList<String>();		public static Animation TABLE_GRAB = Animation.create(881);		/**	 * Handles Castle War's objects	 * @param player Handles object clicking for this player.	 * @param loc Location of the object.	 * @param option The option on the object	 * @param object Defined object (usually o)	 */	@SuppressWarnings("static-access")	public static void handleObjectClicking(final Player player, Location loc, int objectId, int option, final GameObject o) {		if(option == 1) {			switch(objectId) {				case 7272: //Castle Wars leave portal					player.setTeleportTarget(player.DEFAULT_LOCATION);					break;				case 1519: //Castle Wars lobby door					player.getActionSender().sendMessage("You cannot leave Castle Wars this way!");					break;				case 1516: //Castle Wars lobby door					player.getActionSender().sendMessage("You cannot leave Castle Wars this way!");					break;				case 4388: //Enter Zamorak portal					joinTeam(1, player);					break;				case 4408: //Enter Guthix portal					joinGuthixPortal(player);					break;				case 4387: //Enter Saradomin portal					joinTeam(2, player);					break;				case 4390: //Leave Zamorak portal					leaveTeam(1, player);					break;				case 4389: //Leave Saradomin portal					leaveTeam(2, player);					break;				case 4406: //Leave Game Saradomin portal					leaveTeam(2, player);					break;				case 4458: //Bandage table					if(player.tableWait == 0) {						player.playAnimation(Animation.create(881));						player.getInventory().add(new Item(4049, 1));						player.tableWait++;					}					break;				case 6280: //Ladder in Saradomin spawn room					player.setTeleportTarget(Location.create(2429, 3075, 2));					break;				case 4471: //Trapdoor in Saradomin					if(!inGameS.contains(player.getName())) {						player.getActionSender().sendMessage("You can't enter into the other team's spawn room!");						return;					}					player.setTeleportTarget(Location.create(2429, 3075, 1));					break;				case 4469: //Saradomin barrier					if(!inGameS.contains(player.getName())) {						player.getActionSender().sendMessage("You can't enter into the other team's spawn room!");						return;					}					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3080) {						player.setTeleportTarget(Location.create(2426, 3081, 1));					}					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2426, 3080, 1));					}					if(player.getLocation().getX() == 2423 && player.getLocation().getY() == 3076) {						player.setTeleportTarget(Location.create(2422, 3076, 1));					}					if(player.getLocation().getX() == 2422 && player.getLocation().getY() == 3076) {						player.setTeleportTarget(Location.create(2423, 3076, 1));					}					break;				case 354: //Crate				case 366:				case 355:				case 356:				case 357:				case 3685:				case 360:				case 359:					player.getActionSender().sendMessage("You search the create... but find nothing!");					break;				case 4417: //Saradomin stairs (up)					if(player.getLocation().getX() == 2425 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2425, 3074, 3));					}					if(player.getLocation().getX() == 2427 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2430, 3081, 2));					}					if(player.getLocation().getX() == 2419 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2419, 3080, 1));					}					break;				case 4415: //Saradomin/Zamorak stairs (down)					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3074) {						player.setTeleportTarget(Location.create(2425, 3077, 2));					}					if(player.getLocation().getX() == 2430 && player.getLocation().getY() == 3080 || player.getLocation().getX() == 2430 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2427, 3081, 1));					}					if(player.getLocation().getX() == 2420 && player.getLocation().getY() == 3080 || player.getLocation().getX() == 2419 && player.getLocation().getY() == 3080) {						player.setTeleportTarget(Location.create(2419, 3077, 0));					}					if(player.getLocation().getX() == 2369 && player.getLocation().getY() == 3126 || player.getLocation().getX() == 2369 && player.getLocation().getY() == 3127) {						player.setTeleportTarget(Location.create(2372, 3126, 1));					}					if(player.getLocation().getX() == 2374 && player.getLocation().getY() == 3133 || player.getLocation().getX() == 2373 && player.getLocation().getY() == 3133) {						player.setTeleportTarget(Location.create(2374, 3130, 2));					}					if(player.getLocation().getX() == 2379 && player.getLocation().getY() == 3127 || player.getLocation().getX() == 2380 && player.getLocation().getY() == 3127) {						player.setTeleportTarget(Location.create(2380, 3130, 0));					}					break;				case 4418: //Zamorak stairs (up)					if(player.getLocation().getX() == 2372 && player.getLocation().getY() == 3126) {						player.setTeleportTarget(Location.create(2369, 3126, 2));					}					if(player.getLocation().getX() == 2374 && player.getLocation().getY() == 3130) {						player.setTeleportTarget(Location.create(2374, 3133, 3));					}					if(player.getLocation().getX() == 2380 && player.getLocation().getY() == 3130) {						player.setTeleportTarget(Location.create(2380, 3127, 1));					}					break;				case 4420: //Zamorak stairs (up)					if(player.getLocation().getX() == 2382 && player.getLocation().getY() == 3130) {						player.setTeleportTarget(Location.create(2383, 3133, 0));					}					if(player.getLocation().getX() == 2383 && player.getLocation().getY() == 3133) {						player.setTeleportTarget(Location.create(2382, 3130, 0));					}					break;				case 4419: //Saradomin stairs (down)					if(player.getLocation().getX() == 2416 && player.getLocation().getY() == 3074) {						player.setTeleportTarget(Location.create(2417, 3077, 0));					}					if(player.getLocation().getX() == 2417 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2416, 3074, 0));					}					break;				case 4902: //Capture Saradomin Flag					if(inGameS.contains(player.getName())) {						if(player.getEquipment().hasItem(4039)) {							for(Player all : World.getWorld().getPlayers()) {								if(inGamePlayers.contains(all.getName())) {									player.getEquipment().remove(new Item(4039));									all.getActionSender().sendMessage(player.getName() + " gained a point for " + getTeamName(2) + "!");									return;								}							}						}						player.getActionSender().sendMessage("You can't capture your own flag!");						return;					}					if(player.getEquipment().isSlotUsed(Equipment.SLOT_WEAPON)) {						player.getActionSender().sendMessage("Remove your weapon before taking the flag!");						return;					}					player.getEquipment().add(new Item(4037));					for(Player all : World.getWorld().getPlayers()) {						if(inGamePlayers.contains(all.getName())) {							//TODO: Send the object							all.getActionSender().sendMessage(player.getName() + " captured the " + getTeamName(2) + " flag!");						}					}					break;				case 4460: //Rock table					break;				case 4464: //Pickaxe table					if(player.tableWait == 0) {						player.playAnimation(TABLE_GRAB);						player.getInventory().add(new Item(1265));						player.tableWait += 2;					}					break;				case 4463: //Explosive potion table					if(player.tableWait == 0) {						player.playAnimation(TABLE_GRAB);						player.getInventory().add(new Item(4045));						player.tableWait += 2;					}					break;				case 4462: //Rope table					if(player.tableWait == 0) {						player.playAnimation(TABLE_GRAB);						player.getInventory().add(new Item(4047));						player.tableWait += 2;					}					break;				case 4459: //Toolbox table					if(player.tableWait == 0) {						player.playAnimation(TABLE_GRAB);						player.getInventory().add(new Item(590));						player.tableWait += 2;					}					break;				case 4461: //Barricade table					if(player.tableWait == 0) {						player.playAnimation(TABLE_GRAB);						player.getInventory().add(new Item(4053));						player.tableWait += 2;					}					break;				case 1747: //Ladder (up)					if(player.getLocation().getX() == 2421 && player.getLocation().getY() == 3074 || player.getLocation().getX() == 2421 && player.getLocation().getY() == 3073) {						player.setTeleportTarget(Location.create(2421, 3074, 1));					}					if(player.getLocation().getX() == 2378 && player.getLocation().getY() == 3133) {						player.setTeleportTarget(Location.create(2378, 3133, 1));					}					break;				case 4911: //Ladder (down)					if(player.getLocation().getX() == 2421 && player.getLocation().getY() == 3074) {						player.setTeleportTarget(Location.create(2421, 3074, 0));					}					if(player.getLocation().getX() == 2378 && player.getLocation().getY() == 3133) {						player.setTeleportTarget(Location.create(2378, 3133, 0));					}					break;				case 4411: //Stone					break;				case 6281: //Zammy wait room ladder					player.setTeleportTarget(Location.create(2370, 3132, 2));					break;				case 4472: //Zammy trapdoor					if(!inGameZ.contains(player.getName())) {						player.getActionSender().sendMessage("You can't enter into the other team's spawn room!");						return;					}					player.setTeleportTarget(Location.create(2370, 3132, 1));					break;				case 4470: //Zammy barrier					if(!inGameZ.contains(player.getName())) {						player.getActionSender().sendMessage("You can't enter into the other team's spawn room!");						return;					}					if(player.getLocation().getX() == 2376 && player.getLocation().getY() == 3131) {						player.setTeleportTarget(Location.create(2377, 3131, 1));					}					if(player.getLocation().getX() == 2377 && player.getLocation().getY() == 3131) {						player.setTeleportTarget(Location.create(2376, 3131, 1));					}					if(player.getLocation().getX() == 2373 && player.getLocation().getY() == 3127) {						player.setTeleportTarget(Location.create(2373, 3126, 1));					}					if(player.getLocation().getX() == 2373 && player.getLocation().getY() == 3126) {						player.setTeleportTarget(Location.create(2373, 3127, 1));					}					break;				case 4407: //Zamorak leave portal					leaveTeam(1, player);					break;				case 4903: //Zamorak banner					if(inGameZ.contains(player.getName())) {						if(player.getEquipment().hasItem(4039)) {							for(Player all : World.getWorld().getPlayers()) {								if(inGamePlayers.contains(all.getName())) {									player.getEquipment().remove(new Item(4039));									all.getActionSender().sendMessage(player.getName() + " gained a point for " + getTeamName(1) + "!");									return;								}							}						}						player.getActionSender().sendMessage("You can't capture your own flag!");						return;					}					if(player.getEquipment().isSlotUsed(Equipment.SLOT_WEAPON)) {						player.getActionSender().sendMessage("Remove your weapon before taking the flag!");						return;					}					player.getEquipment().add(new Item(4039));					for(Player all : World.getWorld().getPlayers()) {						if(inGamePlayers.contains(all.getName())) {							//TODO: Send the object							all.getActionSender().sendMessage(player.getName() + " captured the " + getTeamName(1) + " flag!");						}					}					break;				case 4427: //Zamorak doors (attack)				case 4428:					if(inGameZ.contains(player.getName())) {						if(player.getLocation().getY() == 3119) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() + 1, 0));						}						if(player.getLocation().getY() == 3120) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() - 1, 0));						}					}					if(inGameS.contains(player.getName())) {						if(!zamorakDoorOpen) {							player.getActionSender().sendMessage("The door is not unlocked, attack it!");							return;						}						if(player.getLocation().getY() == 3119) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() + 1, 0));						}						if(player.getLocation().getY() == 3120) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() - 1, 0));						}					}					break;				case 4424: //Saradomin doors (attack)				case 4423:					if(inGameS.contains(player.getName())) {						if(player.getLocation().getY() == 3088) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() - 1, 0));						}						if(player.getLocation().getY() == 3087) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() + 1, 0));						}					}					if(inGameZ.contains(player.getName())) {						if(!saradominDoorOpen) {							player.getActionSender().sendMessage("The door is not unlocked, attack it!");							return;						}						if(player.getLocation().getY() == 3088) {								player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() - 1, 0));						}						if(player.getLocation().getY() == 3087) {							player.setTeleportTarget(Location.create(player.getLocation().getX(), player.getLocation().getY() + 1, 0));						}					}					break;				case 4467: //Zamorak door (unlock)					break;				case 4912: //Zamorak ladder (down to underground)					break;			}		}		if(option == 2) {			switch(objectId) {				case 4427: //Zamorak doors				case 4428:					if(player.attackDoorWait != 0) {						return;					}					if(CastleWars.inGameZ.contains(player.getName())) {						player.getActionSender().sendMessage("Why would you attack your own door?");						return;					}					if(zamorakDoorOpen) {						player.getActionSender().sendMessage("The door is already open!");						return;					}					player.playAnimation(Animation.create(Equipment.getAttackAnimation(player)));					zamorakDoorHealth--;					player.attackDoorWait += 3;					if(zamorakDoorHealth == 0) {						zamorakDoorOpen = true;						player.getActionSender().sendMessage("The door is unlocked!");						return;					}					break;				case 4424: //Saradomin doors (attack)				case 4423:					if(player.attackDoorWait != 0) {						return;					}					if(CastleWars.inGameS.contains(player.getName())) {						player.getActionSender().sendMessage("Why would you attack your own door?");						return;					}					if(saradominDoorOpen) {						player.getActionSender().sendMessage("The door is already open!");						return;					}					player.playAnimation(Animation.create(Equipment.getAttackAnimation(player)));					saradominDoorHealth--;					player.attackDoorWait += 3;					if(saradominDoorHealth == 0) {						saradominDoorOpen = true;						player.getActionSender().sendMessage("The door is unlocked!");						return;					}					break;				case 4437: //Underground rocks					//TODO: Pickaxe mining it and collapse on players					break;			}		}		if(option == 3) {			switch(objectId) {						}		}	}		/**	 * The amount of players on a team.	 * @param teamID The team's ID	 * @return The amount of players on the team.	 */	public static int getPlayers(int teamID) {		if(teamID == 1) {			return inGameZ.size();		}		if(teamID == 2) {			return inGameS.size();		}		return 0;	}		/**	 * Gets the amount of players in Castle Wars.	 * @return The count of players in the cwPlayers list.	 */	public static int getCWPlayers() {		return allPlayers.size();	}		/**	 * Gets the amount of players on the Zamorak team.	 * @return The count of players in the zPlayers list.	 */	public static int zPlayers() {		return zamWaitPlayers.size();	}		/**	 * Gets the amount of players on the Saradomin team.	 * @return The count of players in the sPlayers list.	 */	public int sPlayers() {		return saraWaitPlayers.size();	}		/**	 * Gets the specified team's name.	 * @param teamID The team's ID	 * @return The team's name.	 */	public static String getTeamName(int teamID) {		if(teamID == 1) {			return "Zamorak";		}		if(teamID == 2) {			return "Saradomin";		}		return null;	}		/**	 * Checks if a player is on a team.	 * @param teamID The team's ID	 * @param player Who we're checking	 */	public boolean isOnTeam(int teamID, Player player) {		if(teamID == 1) {			if(inGameZ.contains(player.getName())) {				return true;			}		}		if(teamID == 2) {			if(inGameS.contains(player.getName())) {				return true;			}		}		return false;	}		/**	 * Checks if a player is in Castle Wars.	 * @param player Who we're checking	 */	public static boolean isInCW(Player player) {		if(allPlayers.contains(player.getName())) {			return true;		}		return false;	}		/**	 * Does the team have the maximum amount of players?	 * @param teamID The team's ID	 * @return If the team has max players or not.	 */	public static boolean hasMaxPlayers(int teamID) {		if(teamID == 1) {			if(getPlayers(1) >= 25) {				return true;			} else {				return false;			}		}		if(teamID == 2) {			if(getPlayers(2) >= 25) {				return true;			} else {				return false;			}		}		return false;	}		/**	 * Locations of the waiting rooms	 */	public static Location ZAMORAK_ROOM = Location.create(2421 + r.nextInt(3), 9524 + r.nextInt(3), 0);	public static Location SARADOMIN_ROOM = Location.create(2381 + r.nextInt(3), 9489 + r.nextInt(3), 0);		/**	 * Location of the Clan Wars lobby	 */	public static Location CASTLE_WARS_LOBBY = Location.create(2440 + r.nextInt(3), 3090 + r.nextInt(3), 0);		/**	 * Location of the spawn rooms	 */	public static Location SARADOMIN_SPAWN_ROOM = Location.create(2429 + r.nextInt(3), 3078 + r.nextInt(3), 1);	public static Location ZAMORAK_SPAWN_ROOM = Location.create(2370 + r.nextInt(3), 3129 + r.nextInt(3), 1);		/**	 * Joins a team.	 * @param teamID The team's ID	 * @param player The player who is joining	 */	public static void joinTeam(final int teamID, final Player player) {		if(player.getEquipment().isSlotUsed(Equipment.SLOT_HELM) && player.getEquipment().isSlotUsed(Equipment.SLOT_CAPE)) {			player.getActionSender().sendMessage("You cannot be wearing headgear or capes.");			return;		}		if(player.getEquipment().isSlotUsed(Equipment.SLOT_HELM)) {			player.getActionSender().sendMessage("You cannot be wearing headgear.");			return;		}		if(player.getEquipment().isSlotUsed(Equipment.SLOT_CAPE)) {			player.getActionSender().sendMessage("You cannot be wearing a cape.");			return;		}		if(teamID == 1) {			if(hasMaxPlayers(1)) {				player.getActionSender().sendMessage("The " + getTeamName(1) + " team already has enough players.");				return;			}			if(getCWPlayers() == 0) {				if(!gameStarted) {					World.getWorld().submit(new WaitingRoomEvent());					gameStarted = true;				}			}			player.setTeleportTarget(ZAMORAK_ROOM);			player.getEquipment().add(new Item(4515));			player.getEquipment().add(new Item(4516));			allPlayers.add(player.getName().toString());			zamWaitPlayers.add(player.getName().toString());			waitPlayers.add(player.getName().toString());		}		if(teamID == 2) {			if(hasMaxPlayers(2)) {				player.getActionSender().sendMessage("The " + getTeamName(2) + " team already has enough players.");				return;			}			if(getCWPlayers() == 0) {				if(!gameStarted) {					World.getWorld().submit(new WaitingRoomEvent());					gameStarted = true;				}			}			player.setTeleportTarget(SARADOMIN_ROOM);			player.getEquipment().add(new Item(4513));			player.getEquipment().add(new Item(4514));			allPlayers.add(player.getName().toString());			saraWaitPlayers.add(player.getName().toString());			waitPlayers.add(player.getName().toString());		}	}		/**	 * Joins the Guthix portal.	 * @param player The player joining.	 * @param teamID The team's ID	 */	public static void joinGuthixPortal(final Player player) {		if(hasMaxPlayers(1) && hasMaxPlayers(2)) {			player.getActionSender().sendMessage("Both teams already have enough players.");			return;		}		if(getPlayers(1) == getPlayers(2)) {			player.getActionSender().sendMessage("Guthix denies access as both teams are balanced.");			return;		}		if(getPlayers(1) < getPlayers(2)) {			joinTeam(1, player);		} else if(getPlayers(1) > getPlayers(2)) {			joinTeam(2, player);		}	}		/**	 * Removes a player from the waiting room.	 * @param teamID The team's ID	 * @param player The player who is being removed.	 */	public static void leaveTeam(int teamID, Player player) {		if(teamID == 1) {			zamWaitPlayers.remove(player.getName());			inGameZ.remove(player.getName());		}		if(teamID == 2) {			saraWaitPlayers.remove(player.getName());			inGameS.remove(player.getName());		}		allPlayers.remove(player.getName());		inGamePlayers.remove(player.getName());		waitPlayers.remove(player.getName());		player.setTeleportTarget(CASTLE_WARS_LOBBY);		player.getEquipment().remove(new Item(4513));		player.getEquipment().remove(new Item(4514));		player.getEquipment().remove(new Item(4515));		player.getEquipment().remove(new Item(4516));	}		/**	 * Checks if the player is in the castle wars area upon login, if they are, teleport them to the Castle War's lobby.	 * @param player The player who is being checked.	 */	public static void checkForCastleWarsLogin(final Player player) {		if(player.getLocation().castleWars()) {			player.setTeleportTarget(CASTLE_WARS_LOBBY);			leaveTeam(1, player);			leaveTeam(2, player);		}	}	public static boolean clickObject(Player player, Location loc, int id) {		// TODO Auto-generated method stub		return false;	}}@h@Also, I was redoing some of the stairs, and tunnels... anyway, add them if you wish.....case 4389: //Leave Saradomin portal					joinTeam(1, player);					player.setTeleportTarget(Location.create(2440,3089,0));					player.getActionSender().sendMessage("You leave the Saradomin team.");					player.getEquipment().remove(new Item(4513));					player.getEquipment().remove(new Item(4514));					player.getEquipment().remove(new Item(4515));					player.getEquipment().remove(new Item(4516));					player.getActionSender().sendWalkableInterface(-1);					break;				case 6280: //Ladder in Saradomin spawn room					player.setTeleportTarget(Location.create(2429, 3075, 2));					break;					case 4458: //Bandage table					//	if(player.tableWait == 0) {						//	player.playAnimation(Animation.create(881));							player.getInventory().add(new Item(4049, 1));							//player.tableWait += 2;						//}					break;					// SARA				case 4471: //Trapdoor in Saradomin					player.setTeleportTarget(Location.create(2429, 3075, 1));					break;				case 4469: //Saradomin barrier					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3080) {						player.setTeleportTarget(Location.create(2426, 3081, 1));					}					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2426, 3080, 1));					}					if(player.getLocation().getX() == 2423 && player.getLocation().getY() == 3076) {						player.setTeleportTarget(Location.create(2422, 3076, 1));					}					if(player.getLocation().getX() == 2422 && player.getLocation().getY() == 3076) {						player.setTeleportTarget(Location.create(2423, 3076, 1));					}					break;				case 354: //Crate (random lol)				case 366:					player.getActionSender().sendMessage("You search the create... but find nothing!");					break;				case 4417: //Saradomin stairs (up)					if(player.getLocation().getX() == 2419 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2420, 3080, 1));					}					if(player.getLocation().getX() == 2427 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2430, 3080, 2));					}					if(player.getLocation().getX() == 2425 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2425, 3074, 3));					}										break;				case 4415: //Saradomin/Zammy stairs (down)					if(player.getLocation().getX() == 2426 && player.getLocation().getY() == 3074) {						player.setTeleportTarget(Location.create(2425, 3077, 2));					}					if(player.getLocation().getX() == 2430 && player.getLocation().getY() == 3080) {						player.setTeleportTarget(Location.create(2427, 3081, 1));					}					if(player.getLocation().getX() == 2420 && player.getLocation().getY() == 3080) {						player.setTeleportTarget(Location.create(2419, 3077, 0));					}					if(player.getLocation().getX() == 2373 && player.getLocation().getY() == 3133) {						player.setTeleportTarget(Location.create(2374, 3130, 2));					}					if(player.getLocation().getX() == 2369 && player.getLocation().getY() == 3127) {						player.setTeleportTarget(Location.create(2372, 3126, 1));					}					if(player.getLocation().getX() == 2379 && player.getLocation().getY() == 3127) {						player.setTeleportTarget(Location.create(2380, 3130, 0));					}					break;				case 4911: //Ladder down Saradomin lower floor				player.setTeleportTarget(Location.create(2421, 3074, 0));					break;				case 1747: //Ladder up Saradomin lower floor  (WTF WONT WORK??????)						player.setTeleportTarget(Location.create(2421, 3074, 1));						break;				case 4912: //Trap door going to underground tunnels for Sara					if(player.getLocation().getX() == 2430 && player.getLocation().getY() == 3081) {						player.setTeleportTarget(Location.create(2430, 9481, 0));////Trap door going up from underground tunnels for Sara					}					if(player.getLocation().getX() == 2369 && player.getLocation().getY() == 3126) {						player.setTeleportTarget(Location.create(2369, 9526, 0));////Trap door going up from underground tunnels for Zammy					}					break;				case 1757: 													if(player.getLocation().getX() == 2430 && player.getLocation().getY() == 9481) {						player.setTeleportTarget(Location.create(2430, 3081, 0));////Trap door going up from underground tunnels for Sara					}					if(player.getLocation().getX() == 2399 && player.getLocation().getY() == 9500) {						player.setTeleportTarget(Location.create(2399, 3100, 0));//Cwars ladder #2					}					if(player.getLocation().getX() == 2399 && player.getLocation().getY() == 3100) {						player.setTeleportTarget(Location.create(2399, 9500, 0));//Cwars ladder #2					}					if(player.getLocation().getX() == 2400 && player.getLocation().getY() == 3107) {						player.setTeleportTarget(Location.create(2400,9507,0));//cwars trapdoor #1					}					if(player.getLocation().getX() == 2400 && player.getLocation().getY() == 9507) {						player.setTeleportTarget(Location.create(2400,3107,0));//cwars trapdoor #1					}					if(player.getLocation().getX() == 2369 && player.getLocation().getY() == 9526) {						player.setTeleportTarget(Location.create(2369,3126,0));//cwars ladder up from tunnels to Zammy					}				case 4419: //stairs outside of sara castle going up to catapault					if(player.getLocation().getX() == 2417 && player.getLocation().getY() == 3077) {						player.setTeleportTarget(Location.create(2416, 3074, 0));					}					if(player.getLocation().getX() == 2416 && player.getLocation().getY() == 3074) {						player.setTeleportTarget(Location.create(2417, 3077, 0));					}										break;								case 4902: //Capture Saradomin Flag					if(player.getEquipment().isSlotUsed(Equipment.SLOT_WEAPON)) {						player.getActionSender().sendMessage("Remove your weapon before taking the flag!");						return;					}										break;										// END OF SARA													// START OF ZAMMY				case 4903: //Capture Zamorak Flag					if(player.getEquipment().isSlotUsed(Equipment.SLOT_WEAPON)) {						player.getActionSender().sendMessage("Remove your weapon before taking the flag!");						return;					}					break;										case 4420: //stairs up to catapault for Zammy						if(player.getLocation().getX() == 2383 && player.getLocation().getY() == 3133) {							player.setTeleportTarget(Location.create(2382, 3130, 0));						}						if(player.getLocation().getX() == 2382 && player.getLocation().getY() == 3130) {							player.setTeleportTarget(Location.create(2383, 3133, 0));						}					break;					case 4418: //Ladder up Saradomin lower floor  (WTF WONT WORK??????)						if(player.getLocation().getX() == 2380 && player.getLocation().getY() == 3130) {							player.setTeleportTarget(Location.create(2380, 3127, 1));						}						if(player.getLocation().getX() == 2372 && player.getLocation().getY() == 3126) {							player.setTeleportTarget(Location.create(2369, 3126, 2));						}						if(player.getLocation().getX() == 2374 && player.getLocation().getY() == 3130) {							player.setTeleportTarget(Location.create(2374, 3133, 3));						}						break;																									// END OF ZAMMY												//Castle Wars Item tables																case 4464:// pickaxes						player.getInventory().add(new Item(1265, 1));						break;					case 4463:// exploding potions						player.getInventory().add(new Item(4045, 1));						break;					case 4462:// ropes						player.getInventory().add(new Item(954, 1));						break;					case 4459:// toolbox						player.getInventory().add(new Item(4051, 1));						break;					case 4460:// rock						player.getInventory().add(new Item(4043, 1));						break;						// End of Castle Wars Table items