public static void enterCave(Player p) { AreaEvent enterCaveAreaEvent = new AreaEvent(p, 2438, 5168, 2439, 5168); enterCaveAreaEvent.setAction(() => { /* * Fight cave is 20k squares from the original place, then another (200 * playerIndex) squares west. */ Location instanceLocation = new Location((20000 + 2413) + (200 * p.getIndex()), 20000 + 5116, 0); p.teleport(instanceLocation); p.setFightCave(new FightCaveSession(p)); Event caveNpcEvent = new Event(600); caveNpcEvent.setAction(() => { caveNpcEvent.stop(); p.getPackets().sendNPCHead(2617, 242, 1); p.getPackets().modifyText("TzHaar-Mej-Jal", 242, 3); p.getPackets().modifyText("You're on your own now, JalYt.", 242, 4); p.getPackets().modifyText("Pepare to fight for your life!", 242, 5); p.getPackets().animateInterface(9827, 242, 1); p.getPackets().sendChatboxInterface2(242); }); Server.registerEvent(caveNpcEvent); }); Server.registerCoordinateEvent(enterCaveAreaEvent); }
public bool useDoor(Player p, int doorId, int doorX, int doorY, int doorHeight) { Location doorLocation = new Location(doorX, doorY, doorHeight); foreach (Door door in doors) { int id = door.isDoorOpen() ? door.getOpenDoorId() : door.getClosedDoorId(); if (id == doorId) { if (door.getDoorLocation().Equals(doorLocation)) { if (door.isDoorOpen() && (Environment.TickCount - door.getLastChangeTime() <= PLAYER_CHANGE_DELAY)) { // door was opened in the last PLAYER_CHANGE_DELAY ms..cant be instantly closed return true; } else if (!door.isClosable() && door.isDoorOpen()) { // door cannot be closed by a player return true; } Door d = door; AreaEvent useDoorAreaEvent = new AreaEvent(p, doorLocation.getX() - 1, doorLocation.getY() - 1, doorLocation.getX() + 1, doorLocation.getY() + 1); useDoorAreaEvent.setAction(() => { changeDoor(p, d); }); Server.registerCoordinateEvent(useDoorAreaEvent); return true; } } } return false; }
public WorldObject(ushort id, Location location, int face, int type) { this.originalId = id; this.location = location; this.face = face; this.type = type; this.objectType = 0; }
public WorldObject(Location location, int face, int type, bool deleteObject) { this.location = location; this.face = face; this.type = type; // default this.objectType = 0; this.deleteObject = deleteObject; }
public static void displayEmptyRockMessage(Player player, Location rockLocation) { AreaEvent displayEmptyRockMessageAreaEvent = new AreaEvent(player, rockLocation.getX() - 1, rockLocation.getY() - 1, rockLocation.getX() + 1, rockLocation.getY() + 1); displayEmptyRockMessageAreaEvent.setAction(() => { player.getPackets().sendMessage("There is currently no ore available from this rock."); }); }
public WorldObject(ushort id, Location location, int face, int type, bool spawned) { this.originalId = id; this.location = location; this.face = face; this.type = type; this.objectType = 0; this.spawnedObject = true; }
public bool deleteItem(int id, Location location) { GroundItem item = itemExists(location, id); if (item != null) { clearGlobalItem(item); return true; } return false; }
public static bool atDuelArena(Location l) { return l.inArea(3318, 3247, 3327, 3247) || l.inArea(3324, 3247, 3328, 3264) || l.inArea(3327, 3262, 3342, 3270) || l.inArea(3342, 3262, 3387, 3280) || l.inArea(3387, 3262, 3394, 3271) || l.inArea(3313, 3224, 3325, 3247) || l.inArea(3326, 3200, 3398, 3267); // Entire arena }
public CoordinateEvent(Player player, Location location) : base(0) { this.player = player; this.location = location; this.oldLocation = location; if (player != null) { player.setDistanceEvent(this); } }
public Rock(int index, ushort rockId, Location loc, int ore, int level, string name, double xp) { this.rockIndex = index; this.rockLocation = loc; this.ore = ore; this.rockId = rockId; this.level = level; this.xp = xp; this.name = name; this.continueMine = index == 0 || index == 9; }
public GroundItem itemExists(Location l, int id) { foreach (GroundItem i in items) { if (i.getLocation().Equals(l) && i.getItemId() == id) { return i; } } return null; }
public Tree(int index, ushort treeId, Location loc, int log, int level, string name, double xp, int distance) { this.treeIndex = index; this.treeLocation = loc; this.log = log; this.treeId = treeId; this.level = level; this.xp = xp; this.name = name; this.distance = distance; }
public WorldObject(ushort originalId, int secondaryId, int face, Location location, int delay, int health) { this.originalId = originalId; this.secondaryId = secondaryId; this.location = location; this.face = face; this.restoreDelay = delay; this.objectHealth = health; this.secondForm = false; this.type = 10; // default this.objectType = 0; }
public DwarfCannon(Player player) { p = player; cannonLocation = p.getLocation(); fakeCannonLocation = new Location(cannonLocation.getX() + 1, cannonLocation.getY() + 1, cannonLocation.getY()); firing = false; cannonballs = 0; constructionStage = 0; direction = 0; setNpcsInArea(); newCannon(); }
public GroundItem(int id, int amount, Location location, Player owner) : base(id, amount) { this.location = location; this.owner = owner; respawn = false; this.dropTime = Environment.TickCount; if (owner != null) { ownerId = owner.getIndex(); } }
// TODO make this use an AreaEvent so itll work from a distance. /** * Will fill vials in a continuous motion from a water source. */ public static bool fillingVial(Player p, Location loc) { if (!p.getInventory().hasItem(VIAL) || !p.getLocation().withinDistance(loc, 2)) { return true; } if (p.getTemporaryAttribute("fillVialTimer") != null) { long lastFillTime = (int)p.getTemporaryAttribute("fillVialTimer"); if (Environment.TickCount - lastFillTime < 600) { return true; } } p.setTemporaryAttribute("fillingVials", true); p.setFaceLocation(loc); Event fillVialEvent = new Event(500); fillVialEvent.setAction(() => { int amountFilled = 0; string s = amountFilled == 1 ? "vial" : "vials"; if (p.getTemporaryAttribute("fillingVials") == null || !p.getLocation().withinDistance(loc, 2) || !p.getInventory().hasItem(229)) { p.setLastAnimation(new Animation(65535)); if (amountFilled > 0) { p.getPackets().sendMessage("You fill up the " + s + " with water."); } fillVialEvent.stop(); return; } if (p.getInventory().replaceSingleItem(VIAL, VIAL_OF_WATER)) { p.setLastAnimation(new Animation(832)); amountFilled++; p.setTemporaryAttribute("fillVialTimer", Environment.TickCount); } else { if (amountFilled > 0) { p.setLastAnimation(new Animation(65535)); p.getPackets().sendMessage("You fill up the " + s + " with water."); } fillVialEvent.stop(); } }); Server.registerEvent(fillVialEvent); return true; }
public int getFace(ushort originalId, Location location) { foreach (WorldObject o in objects) { if (o != null) { if (o.getLocation().Equals(location) && o.getOriginalId() == originalId) { return o.getFace(); } } } return 0; }
public Spot(int[] spotFish, int[] spotLevel, int spotindex, int spotId, double[] spotXp, Location spotLocation, int primaryItem, int secondaryItem, string primaryName, string secondaryName, bool secondOption) { this.fish = spotFish; this.level = spotLevel; this.spotindex = spotindex; this.spotId = spotId; this.fishingXp = spotXp; this.spotLocation = spotLocation; this.secondaryItem = secondaryItem; this.primaryItem = primaryItem; this.primaryName = primaryName; this.secondaryName = secondaryName; this.secondOption = secondOption; }
public bool fireExists(Location location) { foreach (WorldObject o in objects) { if (o != null) { if (o.getLocation().Equals(location) && o.isFire()) { return true; } } } return false; }
public Entity() { this.entityFocusId = -1; queuedHits = new Queue<Hits.Hit>(); hits = new Hits(); hidden = false; dead = false; target = null; attacker = null; combatTurns = 0; poisonAmount = 0; killers = new Dictionary<Entity, double>(); temporaryAttributes = new Dictionary<string, Object>(); follow = new Follow(this); sprite = new Sprite(); this.location = new Location(2322 + Misc.random(1), 3171 + Misc.random(5), 0); }
public static void crossDitch(Player p, int x, int y) { if (p.getTemporaryAttribute("unmovable") != null) { return; } AreaEvent crossDitchAreaEvent = new AreaEvent(p, x, y - 1, x, y + 2); crossDitchAreaEvent.setAction(() => { p.getPackets().closeInterfaces(); p.getWalkingQueue().resetWalkingQueue(); p.setTemporaryAttribute("unmovable", true); int newY = p.getLocation().getY() >= 3523 ? p.getLocation().getY() - 3 : p.getLocation().getY() + 3; int dir = newY == 3 ? 0 : 4; Location faceLocation = new Location(p.getLocation().getX(), dir == 3 ? 3523 : 3520, 0); p.setFaceLocation(faceLocation); Event crossDitchMoveEvent = new Event(500); crossDitchMoveEvent.setAction(() => { crossDitchMoveEvent.stop(); p.setLastAnimation(new Animation(6132)); int regionX = p.getUpdateFlags().getLastRegion().getRegionX(); int regionY = p.getUpdateFlags().getLastRegion().getRegionY(); int lX = (p.getLocation().getX() - ((regionX - 6) * 8)); int lY = (p.getLocation().getY() - ((regionY - 6) * 8)); ForceMovement movement = new ForceMovement(lX, lY, lX, newY, 33, 60, dir); p.setForceMovement(movement); p.setFaceLocation(new Location(x, y, 0)); Event crossDitchTeleportEvent = new Event(1250); crossDitchTeleportEvent.setAction(() => { crossDitchTeleportEvent.stop(); int playerY = p.getLocation().getY(); int nY = playerY >= 3523 ? 3520 : 3523; p.teleport(new Location(p.getLocation().getX(), nY, 0)); p.removeTemporaryAttribute("unmovable"); }); Server.registerEvent(crossDitchTeleportEvent); }); Server.registerEvent(crossDitchMoveEvent); }); Server.registerCoordinateEvent(crossDitchAreaEvent); }
public static bool useWildernessObelisk(Player p, int id, Location loc) { for (int i = 0; i < OBELISK_ID.Length; i++) { if (id == OBELISK_ID[i]) { if (loc.inArea(OBELISK_LOCATIONS[i][0] - 2, OBELISK_LOCATIONS[i][1] - 2, OBELISK_LOCATIONS[i][0] + 2, OBELISK_LOCATIONS[i][1] + 2)) { AreaEvent useWildernessObeliskAreaEvent = new AreaEvent(p, loc.getX() - 1, loc.getY() - 1, loc.getX() + 1, loc.getY() + 1); useWildernessObeliskAreaEvent.setAction(() => { activateObelisk(i); }); Server.registerCoordinateEvent(useWildernessObeliskAreaEvent); } return true; } } return false; }
public bool addToStack(int id, int amount, Location location, Player p) { if (!ItemData.forId(id).isStackable()) { return false; } foreach (GroundItem i in items) { if (i.getLocation().Equals(location) && i.getItemId() == id) { if (!i.isGlobal() && i.getOwner().Equals(p)) { i.setItemAmount(i.getItemAmount() + amount); p.getPackets().clearGroundItem(i); p.getPackets().createGroundItem(i); return true; } } } return false; }
private static Location[] getLocations(int index) { Location[] loc = new Location[4]; int x = OBELISK_LOCATIONS[index][0]; int y = OBELISK_LOCATIONS[index][1]; loc[0] = new Location(x - 2, y - 2, 0); // SW loc[1] = new Location(x - 2, y + 2, 0); // NW loc[2] = new Location(x + 2, y + 2, 0); // NE loc[3] = new Location(x + 2, y - 2, 0); // SE return loc; }
public void setClosedDoorLocation(Location closedDoorLocation) { this.closedDoorLocation = closedDoorLocation; }
public static void handleLever(Player p, int id, Location loc) { if ((p.getTemporaryAttribute("teleporting") != null)) { return; } for (int i = 0; i < LEVER_COORDINATES.Length; i++) { Location loc1 = new Location(LEVER_COORDINATES[i][0], LEVER_COORDINATES[i][1], LEVER_COORDINATES[i][2]); if (loc.Equals(loc1)) { int index = i; Location loc2 = new Location(LEVER_FACE_COORDINATES[i][0], LEVER_FACE_COORDINATES[i][1], LEVER_FACE_COORDINATES[i][2]); CoordinateEvent wildernessHandleLeverCoordinateEvent = new CoordinateEvent(p, loc); wildernessHandleLeverCoordinateEvent.setAction(() => { p.setFaceLocation(loc2); displayWildernessLeverOptions(p, index); }); Server.registerCoordinateEvent(wildernessHandleLeverCoordinateEvent); return; } } LaddersAndStairs.useLever(p, id, loc); // Used for default levers/levers with no options }
public static void slashWeb(Player p, ushort webId, Location webLocation) { AreaEvent slashWebAreaEvent = new AreaEvent(p, webLocation.getX() - 1, webLocation.getY() - 1, webLocation.getX() + 1, webLocation.getY() + 1); slashWebAreaEvent.setAction(() => { long lastSlash = 0; p.setFaceLocation(webLocation); if (p.getTemporaryAttribute("lastWebSlash") != null) { lastSlash = (int)p.getTemporaryAttribute("lastWebSlash"); } if (Environment.TickCount - lastSlash <= 800) { return; } if (Server.getGlobalObjects().originalObjectExists(webId, webLocation)) { p.setLastAnimation(new Animation(p.getAttackAnimation())); p.setTemporaryAttribute("lastWebSlash", Environment.TickCount); Event attemptCutWebEvent = new Event(500); attemptCutWebEvent.setAction(() => { attemptCutWebEvent.stop(); bool webExists = Server.getGlobalObjects().originalObjectExists(webId, webLocation); Server.getGlobalObjects().lowerHealth(webId, webLocation); if (Server.getGlobalObjects().originalObjectExists(webId, webLocation)) { p.getPackets().sendMessage("You fail to cut through the web."); } else { if (webExists) { // This means we slashed it, if !webExists, someone else slashed it in the last 500ms p.getPackets().sendMessage("You slash through the web!"); } } }); Server.registerEvent(attemptCutWebEvent); } }); Server.registerCoordinateEvent(slashWebAreaEvent); }
public static void leverTeleport(Player p, int option) { p.getPackets().closeInterfaces(); Location teleLocation = new Location(LEVER_COORDINATES[option][0], LEVER_COORDINATES[option][1], LEVER_COORDINATES[option][2]); Event leverTeleportEvent = new Event(200); leverTeleportEvent.setAction(() => { leverTeleportEvent.stop(); if (p.getTemporaryAttribute("teleblocked") != null) { p.getPackets().sendMessage("A magical force prevents you from teleporting!"); return; } else if ((p.getTemporaryAttribute("teleporting") != null)) { return; } p.setLastAnimation(new Animation(2140)); p.getPackets().closeInterfaces(); p.setTemporaryAttribute("teleporting", true); p.getWalkingQueue().resetWalkingQueue(); p.getPackets().clearMapFlag(); SkillHandler.resetAllSkills(p); Event levelTeleportStartEvent = new Event(700); levelTeleportStartEvent.setAction(() => { levelTeleportStartEvent.stop(); p.setLastAnimation(new Animation(8939, 0)); p.setLastGraphics(new Graphics(1576, 0)); Event levelTeleportFinishEvent = new Event(1800); levelTeleportFinishEvent.setAction(() => { levelTeleportFinishEvent.stop(); p.teleport(teleLocation); p.setLastAnimation(new Animation(8941, 0)); p.setLastGraphics(new Graphics(1577, 0)); Teleport.resetTeleport(p); }); Server.registerEvent(levelTeleportFinishEvent); }); Server.registerEvent(levelTeleportStartEvent); }); Server.registerEvent(leverTeleportEvent); }
private void handleFirstClickObject(Player player, Packet packet) { int objectX = packet.readLEShort(); ushort objectId = (ushort)packet.readShortA(); int objectY = packet.readUShort(); if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } SkillHandler.resetAllSkills(player); player.getPackets().closeInterfaces(); Console.WriteLine("First object click = " + objectId + " " + objectX + " " + objectY); if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY)) { return; } else if (RuneCraft.enterRift(player, objectId, objectX, objectY)) { return; } else if (RuneCraft.enterViaTiara(player, objectId, objectX, objectY)) { player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ())); return; } else if (RuneCraft.leaveAltar(player, objectId, objectX, objectY)) { return; } else if (Barrows.leaveCrypt(player, objectId, objectX, objectY)) { return; } else if (Barrows.tryOpenCoffin(player, objectId)) { return; } else if (Barrows.openTunnelDoor(player, objectId, objectX, objectY)) { return; } else if (Thieving.wantToThieveChest(player, objectId, objectX, objectY)) { return; } else if (Agility.doAgility(player, objectId, objectX, objectY)) { return; } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1)) { return; } else if (Server.getGlobalObjects().getDoors().useDoor(player, objectId, objectX, objectY, player.getLocation().getZ())) { return; } else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1)) { return; } else if (WildernessObelisks.useWildernessObelisk(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()))) { return; } if (player.getTemporaryAttribute("unmovable") != null) { return; } player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ())); switch (objectId) { case 2492: // essence mine portals RuneCraft.leaveEssMine(player, new Location(objectX, objectY, player.getLocation().getZ())); break; case 5959: case 5960: Wilderness.handleLever(player, objectId, new Location(objectX, objectY, player.getLocation().getZ())); break; case 733: // Wilderness web Wilderness.slashWeb(player, objectId, new Location(objectX, objectY, player.getLocation().getZ())); break; case 28089: // GE desk Server.getGrandExchange().clickDesk(player, objectX, objectY, 1); break; case 9359: // Tzhaar main exit TzHaar.exitTzhaar(player); break; case 31284: // Tzhaar entrance TzHaar.enterTzhaar(player); break; case 9357: // Fight cave exit FightCave.exitCave(player, objectX, objectY); break; case 9356: // Fight cave entrance FightCave.enterCave(player); break; case 9391: // Tzhaar fight pits viewing orb Server.getMinigames().getFightPits().useOrb(player, -1); break; case 9369: // Tzhaar pits main entrance case 9368: // Tzhaar pits game door Server.getMinigames().getFightPits().useDoor(player, objectId); break; case 3617: // Agility arena ladder AgilityArena.enterArena(player, objectX, objectY); break; case 3618: if (Location.atAgilityArena(player.getLocation())) { AgilityArena.exitArena(player, objectX, objectY); } break; case 6: // Dwarf multicannon DwarfCannon cannon = player.getCannon(); Location l = new Location(objectX, objectY, player.getLocation().getZ()); if (cannon == null || (cannon != null & !l.withinDistance(cannon.getLocation(), 2))) { player.getPackets().sendMessage("This isn't your cannon!"); break; } cannon.fireCannon(); break; case 7: //Cannon base only case 8: //Cannon stand case 9: //Cannon barrels DwarfCannon cannonPickup = player.getCannon(); Location cannonLocation = new Location(objectX, objectY, player.getLocation().getZ()); if (cannonPickup == null || (cannonPickup != null & !cannonLocation.withinDistance(cannonPickup.getLocation(), 2))) { player.getPackets().sendMessage("This isn't your cannon!"); break; } cannonPickup.pickupCannon(); break; case 11601: // Clay oven player.getPackets().modifyText("Please use the item on the oven.", 210, 1); player.getPackets().sendChatboxInterface(210); break; case 10284: // Barrows chest Barrows.openChest(player); break; case 4483: // Castle wars bank chest. case 21301: // Neitiznot bank chest player.getBank().openBank(false, objectX, objectY); break; case 1276: // Normal tree case 1278: // Normal tree case 2409: // Normal tree case 1277: // Normal tree with but different coloured stump case 3034: // Normal tree with dark stump case 3033: // Normal tree with dark stump case 10041: // Normal tree case 1282: // Dead tree case 1283: // Dead tree case 1284: // Dead tree case 1285: // Dead tree case 1286: // Dead tree case 1289: // Dead tree case 1290: // Dead tree case 1365: // Dead tree case 1383: // Dead tree case 1384: // Dead tree case 1291: // Dead tree case 3035: // Dead tree case 3036: // Dead tree case 1315: // Evergreen case 1316: // Evergreen case 1318: // Snowy Evergreen case 1319: // Snowy Evergreen case 1330: // Snow covered tree case 1331: // Snow covered tree case 1332: // Snow covered tree case 3879: // Evergreen from elf land case 3881: // Evergreen from elf land (slightly bigger than one above) case 3882: // Evergreen from elf land (slightly bigger than one above) case 3883: // Small Evergreen from elf land case 1280: // Normal tree orange stump case 14309: // PC game island tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 0, true); break; case 1281: // Normal Oak tree case 3037: // Oak tree dark stump Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1, true); break; case 1308: // Normal Willow tree case 5551: // Normal Willow tree case 5552: // Normal Willow tree case 5553: // Normal Willow tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2, true); break; case 2023: // Achey tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 3, true); break; case 9036: // Normal Teak tree case 15062: // Normal Teak tree (same as above?) Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 4, true); break; case 1307: // Normal Maple tree case 4674:// Exactly same as above Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 5, true); break; case 2289: // Normal Hollow tree case 4060: // Normal Hollow tree (bigger than above) Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 6, true); break; case 9034: // Normal Mahogany tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 7, true); break; case 21273: // Normal Arctic pine Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 8, true); break; case 28951: // Normal Eucalyptus tree case 28952: // Normal Eucalyptus tree (smaller) case 28953: // Normal Eucalyptus tree (smallest) Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 9, true); break; case 1309: // Yew tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 10, true); break; case 1306: // Normal Magic tree Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 11, true); break; case 3203: // Duel arena trapdoors. if (player.getDuel() != null) { player.getDuel().forfeitDuel(objectX, objectY); break; } break; case 7152: // Abyss tendrils. case 7144: AbyssObstacles.chopTendrils(player, objectX, objectY); break; case 7147: // Abyss tunnel. AbyssObstacles.useAgilityTunnel(player, objectX, objectY); break; case 7146: // Abyss eyes. case 7150: AbyssObstacles.passEyes(player, objectX, objectY); break; case 7151: // Abyss boil. case 7145: AbyssObstacles.burnBoil(player, objectX, objectY); break; case 7153: // Abyss mining rock. case 7143: AbyssObstacles.mineRock(player, objectX, objectY); break; case 2213: // Catherby bank booth. case 11402: // Varrock bank booth. case 11758: // Falador bank booth. case 36786: // Lumbridge bank booth. case 35647: // Al-Kharid bank booth. case 25808: // Seers bank booth. case 34752: // Ardougne bank booth. case 26972: // Edgeville bank booth. case 29085: // Ooglog bank booth. player.getBank().openBank(true, objectX, objectY); break; case 2491: // Essence rock Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 0, true); break; case 11954: // Iron rocks case 11955: case 11956: case 14856: case 14857: case 14858: case 31071: case 31072: case 31073: case 32441: case 32442: case 32443: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 6, true); break; case 11948: // Silver rocks case 11949: case 11950: case 11165: case 11186: case 11187: case 11188: case 31074: case 31075: case 31076: case 32444: case 32445: case 32446: case 15579: case 15580: case 15581: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 8, true); break; case 15504: // Clay rocks case 15503: case 15505: case 11189: case 11190: case 11191: case 31062: case 31063: case 31064: case 32429: case 32430: case 32431: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1, true); break; case 11960: // Copper rocks case 11961: case 11962: case 11936: case 11937: case 11938: case 31080: case 31081: case 31082: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2, true); break; case 11959: // Tin rocks case 11958: case 11957: case 11933: case 11934: case 11935: case 31077: case 31078: case 31079: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 3, true); break; case 11930: // Coal rocks case 11931: case 11932: case 14850: case 14851: case 14852: case 31068: case 31069: case 31070: case 32426: case 32427: case 32428: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 9, true); break; case 11951: // Gold rocks case 11952: case 11953: case 11183: case 11184: case 11185: case 31065: case 31066: case 31067: case 32432: case 32433: case 32434: case 15576: case 15577: case 15578: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 10, true); break; case 11945: // Mithril rocks case 11946: case 11947: case 11942: case 11943: case 11944: case 14853: case 14854: case 14855: case 31086: case 31087: case 31088: case 32438: case 32439: case 32440: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 11, true); break; case 11963: // Adamant rocks case 11964: case 11965: case 11939: case 11940: case 11941: case 14862: case 14863: case 14864: case 31083: case 31084: case 31085: case 32435: case 32436: case 32437: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 12, true); break; case 14859: // Rune rocks case 14860: case 14861: Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 13, true); break; case 11552: // Empty rocks case 11553: case 11554: case 11555: case 11556: case 31059: case 31060: case 31061: case 14832: case 14833: case 14834: case 33400: case 33401: case 33402: case 15582: case 15583: case 15584: Mining.displayEmptyRockMessage(player, new Location(objectX, objectY, player.getLocation().getZ())); break; case 23271: // Wilderness ditch Wilderness.crossDitch(player, objectX, objectY); break; } }
private void handleSecondClickObject(Player player, Packet packet) { int objectY = packet.readLEShortA(); int objectX = packet.readLEShort(); ushort objectId = packet.readUShort(); Console.WriteLine("Second object click = " + objectId + " " + objectX + " " + objectY); if (player.getTemporaryAttribute("unmovable") != null) { return; } if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } SkillHandler.resetAllSkills(player); player.getPackets().closeInterfaces(); player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ())); if (Thieving.wantToThieveStall(player, objectId, objectX, objectY)) { return; } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1)) { return; } else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2)) { return; } switch (objectId) { case 28089: // GE desk Server.getGrandExchange().clickDesk(player, objectX, objectY, 2); break; case 25824: // Spinning wheel (Seers) case 36970: // Spinning wheel (Lumbridge Spinning.displaySpinningInterface(player); break; case 6: // Dwarf multicannon DwarfCannon cannon = player.getCannon(); Location l = new Location(objectX, objectY, player.getLocation().getZ()); if (cannon == null || (cannon != null & !l.Equals(cannon.getLocation()))) { player.getPackets().sendMessage("This isn't your cannon!"); break; } cannon.pickupCannon(); break; case 11666: // Falador furnace case 36956: // Lumbridge furnace Smelting.displaySmeltOptions(player); break; case 11959: // Tin rocks case 11958: case 11957: case 11933: case 11934: case 11935: case 31077: case 31078: case 31079: Mining.prospectRock(player, objectX, objectY, "tin"); break; case 11960: // Copper rocks case 11961: case 11962: case 11936: case 11937: case 11938: case 31080: case 31081: case 31082: Mining.prospectRock(player, objectX, objectY, "copper"); break; case 15504: // Clay rocks case 15503: case 15505: case 11189: case 11190: case 11191: case 31062: case 31063: case 31064: case 32429: case 32430: case 32431: Mining.prospectRock(player, objectX, objectY, "clay"); break; case 11948: // Silver rocks case 11949: case 11950: case 11165: case 11186: case 11187: case 11188: case 31074: case 31075: case 31076: case 32444: case 32445: case 32446: case 15579: case 15580: case 15581: Mining.prospectRock(player, objectX, objectY, "silver"); break; case 11930: // Coal rocks case 11931: case 11932: case 14850: case 14851: case 14852: case 31068: case 31069: case 31070: case 32426: case 32427: case 32428: Mining.prospectRock(player, objectX, objectY, "coal"); break; case 11945: // Mithril rocks case 11946: case 11947: case 11942: case 11943: case 11944: case 14853: case 14854: case 14855: case 31086: case 31087: case 31088: case 32438: case 32439: case 32440: Mining.prospectRock(player, objectX, objectY, "mithril"); break; case 11954: // Iron rocks case 11955: case 11956: case 14856: case 14857: case 14858: case 31071: case 31072: case 31073: case 32441: case 32442: case 32443: Mining.prospectRock(player, objectX, objectY, "iron"); break; case 14859: // Rune rocks case 14860: case 14861: Mining.prospectRock(player, objectX, objectY, "runite"); break; case 11951: // Gold rocks case 11952: case 11953: case 11183: case 11184: case 11185: case 31065: case 31066: case 31067: case 32432: case 32433: case 32434: case 15576: case 15577: case 15578: Mining.prospectRock(player, objectX, objectY, "gold"); break; case 11963: // Adamant rocks case 11964: case 11965: case 11939: case 11940: case 11941: case 14862: case 14863: case 14864: case 31083: case 31084: case 31085: case 32435: case 32436: case 32437: Mining.prospectRock(player, objectX, objectY, "adamantite"); break; case 11552: // Empty rocks case 11553: case 11554: case 11555: case 11556: case 31059: case 31060: case 31061: case 14832: case 14833: case 14834: case 33400: case 33401: case 33402: case 15582: case 15583: case 15584: Mining.displayEmptyRockMessage(player, new Location(objectX, objectY, player.getLocation().getZ())); break; case 2491: // Rune essence Mining.prospectRock(player, objectX, objectY, "Rune essence"); break; case 27663: // Duel arena bank chest. case 2213: // Catherby bank booth. case 11402: // Varrock bank booth. case 11758: // Falador bank booth. case 36786: // Lumbridge bank booth. case 35647: // Al-Kharid bank booth. case 25808: // Seers bank booth. case 34752: // Ardougne bank booth. case 26972: // Edgeville bank booth. case 29085: // Ooglog bank booth. player.getBank().openBank(false, objectX, objectY); break; } }