Jump to content

Wajdi

Member
  • Content count

    86
  • Joined

  • Last visited

About Wajdi

  • Rank
    Iron Member
  • Birthday 12/24/1999
  1. No problem :) Thanking this thread would be really appreciated!
  2. I am glad I helped Terron. Thanks placeholder for telling him the solution. No problem @ Night Night... also please thank this thread if you've used this.
  3. Hello guys.. I recently added cow milking and I noticed that the 'empty' option on bucket of milk and vial of water, etc doesn't work... How I can make that the 'empty' option works? (when I click on 'empty' it empties the item of the content' Is there a tutorial or what?
  4. bump EDIT: I think I got those errors from: There is a step in the tutorial says: "Then in your ClickObject packet you will see something like this" case FIRST_CLICK: c.objectX = c.getInStream().readSignedWordBigEndianA(); c.objectId = c.getInStream().readUnsignedWord(); c.objectY = c.getInStream().readUnsignedWordA(); under that add this if(c.goodDistance(c.getX(), c.getY(), c.objectX, c.objectY, 1)) { if (Doors.getSingleton().handleDoor(c.objectId, c.objectX, c.objectY, c.heightLevel)) { } } I searched for clickobject for that code above while I was doing the tutoria but all what I find is: (first some lines) package server.model.players.packets; import server.model.players.*; import server.util.Misc; import server.model.objects.Doors; public class ClickObject implements PacketType { public static final int FIRST_CLICK = 132; { public static final int SECOND_CLICK = 252; public static final int THIRD_CLICK = 70; So I added that code under 'Public static final int FIRST_CLICK = 132; {' because I haven't found case FIRST_CLICK, so I think that what I did wrong? if so where should I change it place to? P.S. My ClickObject.java [CODE]package server.model.players.packets; import server.model.players.*; import server.util.Misc; import server.model.objects.Doors; public class ClickObject implements PacketType { public static final int FIRST_CLICK = 132; { Player c = null; if(c.goodDistance(c.getX(), c.getY(), c.objectX, c.objectY, 1)) { Object c1; if (Doors.getSingleton().handleDoor(c.objectId, c.objectX, c.objectY, c.heightLevel)) { } } } public static final int SECOND_CLICK = 252; public static final int THIRD_CLICK = 70; public ClickObject() { } public void processPacket(Client client, int i, int j) { client.clickObjectType = client.objectX = client.objectId = client.objectY = 0; client.objectYOffset = client.objectXOffset = 0; client.getPA().resetFollow(); switch (i) { default: break; case 132: client.objectX = client.getInStream().readSignedWordBigEndianA(); client.objectId = client.getInStream().readUnsignedWord(); client.objectY = client.getInStream().readUnsignedWordA(); client.objectDistance = 1; if (client.playerRights >= 3 && client.playerName.equalsIgnoreCase("Sanity")) { Misc.println((new StringBuilder()).append("objectId: ") .append(client.objectId).append(" ObjectX: ") .append(client.objectX).append(" objectY: ") .append(client.objectY).append(" Xoff: ") .append(client.getX() - client.objectX) .append(" Yoff: ") .append(client.getY() - client.objectY).toString()); } else if (client.playerRights == 3) { client.sendMessage((new StringBuilder()).append("objectId: ") .append(client.objectId).append(" objectX: ") .append(client.objectX).append(" objectY: ") .append(client.objectY).toString()); } if (Math.abs(client.getX() - client.objectX) > 25 || Math.abs(client.getY() - client.objectY) > 25) { client.resetWalkingQueue(); } else { for (int k = 0; k < client.getRunecrafting().altarID.length; k++) { if (client.objectId == client.getRunecrafting().altarID[k]) { client.getRunecrafting().craftRunes(client.objectId); } } switch (client.objectId) { case 410: if (client.playerMagicBook == 0) { client.setSidebarInterface(6, 29999); client.playerMagicBook = 2; client.autocasting = false; client.sendMessage("An ancient wisdomin fills your mind."); client.autocastId = -1; client.getPA().resetAutocast(); } else { client.setSidebarInterface(6, 1151); client.playerMagicBook = 0; client.autocasting = false; client.sendMessage("You feel a drain on your memory."); client.autocastId = -1; client.getPA().resetAutocast(); } break; case 1733: client.objectYOffset = 2; break; case 3044: client.objectDistance = 3; break; case 245: client.objectYOffset = -1; client.objectDistance = 0; break; case 272: client.objectYOffset = 1; client.objectDistance = 0; break; case 273: client.objectYOffset = 1; client.objectDistance = 0; break; case 246: client.objectYOffset = 1; client.objectDistance = 0; break; case 4493: case 4494: case 4495: case 4496: client.objectDistance = 5; break; case 6522: case 10229: client.objectDistance = 2; break; case 8959: client.objectYOffset = 1; break; case 4417: if (client.objectX == 2425 && client.objectY == 3074) { client.objectYOffset = 2; } break; case 4420: if (client.getX() >= 2383 && client.getX() <= 2385) { client.objectYOffset = 1; } else { client.objectYOffset = -2; } // fall through case 409: case 6552: client.objectDistance = 2; break; case 2878: case 2879: client.objectDistance = 3; break; case 2558: client.objectDistance = 0; if (client.absX > client.objectX && client.objectX == 3044) { client.objectXOffset = 1; } if (client.absY > client.objectY) { client.objectYOffset = 1; } if (client.absX < client.objectX && client.objectX == 3038) { client.objectXOffset = -1; } break; case 9356: client.objectDistance = 2; break; case 1815: case 1816: case 5959: case 5960: client.objectDistance = 0; break; case 9293: client.objectDistance = 2; break; case 4418: if (client.objectX == 2374 && client.objectY == 3131) { client.objectYOffset = -2; } else if (client.objectX == 2369 && client.objectY == 3126) { client.objectXOffset = 2; } else if (client.objectX == 2380 && client.objectY == 3127) { client.objectYOffset = 2; } else if (client.objectX == 2369 && client.objectY == 3126) { client.objectXOffset = 2; } else if (client.objectX == 2374 && client.objectY == 3131) { client.objectYOffset = -2; } break; case 9706: client.objectDistance = 0; client.objectXOffset = 1; break; case 9707: client.objectDistance = 0; client.objectYOffset = -1; break; case 4419: case 6707: client.objectYOffset = 3; break; case 6823: client.objectDistance = 2; client.objectYOffset = 1; break; case 6706: client.objectXOffset = 2; break; case 6772: client.objectDistance = 2; client.objectYOffset = 1; break; case 6705: client.objectYOffset = -1; break; case 6822: client.objectDistance = 2; client.objectYOffset = 1; break; case 6704: client.objectYOffset = -1; break; case 6773: client.objectDistance = 2; client.objectXOffset = 1; client.objectYOffset = 1; break; case 6703: client.objectXOffset = -1; break; case 6771: client.objectDistance = 2; client.objectXOffset = 1; client.objectYOffset = 1; break; case 6702: client.objectXOffset = -1; break; case 6821: client.objectDistance = 2; client.objectXOffset = 1; client.objectYOffset = 1; break; case 1276: case 1278: case 1281: case 1306: case 1307: case 1308: case 1309: client.objectDistance = 3; break; default: client.objectDistance = 1; client.objectXOffset = 0; client.objectYOffset = 0; break; } if (client.goodDistance(client.objectX + client.objectXOffset, client.objectY + client.objectYOffset, client.getX(), client.getY(), client.objectDistance)) { client.getActions().firstClickObject(client.objectId, client.objectX, client.objectY); } else { client.clickObjectType = 1; } } break; case 252: client.objectId = client.getInStream().readUnsignedWordBigEndianA(); client.objectY = client.getInStream().readSignedWordBigEndian(); client.objectX = client.getInStream().readUnsignedWordA(); client.objectDistance = 1; if (client.playerRights >= 3) { Misc.println((new StringBuilder()).append("objectId: ") .append(client.objectId).append(" ObjectX: ") .append(client.objectX).append(" objectY: ") .append(client.objectY).append(" Xoff: ") .append(client.getX() - client.objectX) .append(" Yoff: ") .append(client.getY() - client.objectY).toString()); } switch (client.objectId) { case 6162: case 6163: case 6164: case 6165: case 6166: client.objectDistance = 2; break; default: client.objectDistance = 1; client.objectXOffset = 0; client.objectYOffset = 0; break; } if (client.goodDistance(client.objectX + client.objectXOffset, client.objectY + client.objectYOffset, client.getX(), client.getY(), client.objectDistance)) { client.getActions().secondClickObject(client.objectId, client.objectX, client.objectY); } else { client.clickObjectType = 2; } break; case 70: // 'F' client.objectX = client.getInStream().readSignedWordBigEndian(); client.objectY = client.getInStream().readUnsignedWord(); client.objectId = client.getInStream().readUnsignedWordBigEndianA(); if (client.playerRights >= 3) { Misc.println((new StringBuilder()).append("objectId: ") .append(client.objectId).append(" ObjectX: ") .append(client.objectX).append(" objectY: ") .append(client.objectY).append(" Xoff: ") .append(client.getX() - client.objectX) .append(" Yoff: ") .append(client.getY() - client.objectY).toString()); } switch (client.objectId) { default: client.objectDistance = 1; break; } client.objectXOffset = 0; client.objectYOffset = 0; if (client.goodDistance(client.objectX + client.objectXOffset, client.objectY + client.objectYOffset, client.getX(), client.getY(), client.objectDistance)) { client.getActions().secondClickObject(client.objectId, client.objectX, client.objectY); } else { client.clickObjectType = 3; } break; } } public void handleSpecialCase(Client client, int i, int j, int k) { } } [/CODE] My PacketHandler.java [CODE]package server.model.players; import server.model.players.packets.AttackPlayer; import server.model.players.packets.Bank10; import server.model.players.packets.Bank5; import server.model.players.packets.BankAll; import server.model.players.packets.BankX1; import server.model.players.packets.BankX2; import server.model.players.packets.ChallengePlayer; import server.model.players.packets.ChangeAppearance; import server.model.players.packets.ChangeRegions; import server.model.players.packets.Chat; import server.model.players.packets.ClanChat; import server.model.players.packets.ClickItem; import server.model.players.packets.ClickNPC; import server.model.players.packets.ClickObject; import server.model.players.packets.ClickingButtons; import server.model.players.packets.ClickingInGame; import server.model.players.packets.ClickingStuff; import server.model.players.packets.Commands; import server.model.players.packets.Dialogue; import server.model.players.packets.DropItem; import server.model.players.packets.FollowPlayer; import server.model.players.packets.IdleLogout; import server.model.players.packets.ItemClick2; import server.model.players.packets.ItemClick3; import server.model.players.packets.ItemOnGroundItem; import server.model.players.packets.ItemOnItem; import server.model.players.packets.ItemOnNpc; import server.model.players.packets.ItemOnObject; import server.model.players.packets.MagicOnFloorItems; import server.model.players.packets.MagicOnItems; import server.model.players.packets.MoveItems; import server.model.players.packets.PickupItem; import server.model.players.packets.PrivateMessaging; import server.model.players.packets.RemoveItem; import server.model.players.packets.SilentPacket; import server.model.players.packets.Trade; import server.model.players.packets.Walking; import server.model.players.packets.WearItem; public class PacketHandler { private static PacketType packetId[] = new PacketType[256]; static { SilentPacket u = new SilentPacket(); packetId[3] = u; packetId[202] = u; packetId[77] = u; packetId[86] = u; packetId[78] = u; packetId[36] = u; packetId[226] = u; packetId[246] = u; packetId[148] = u; packetId[183] = u; packetId[230] = u; packetId[136] = u; packetId[189] = u; packetId[152] = u; packetId[200] = u; packetId[85] = u; packetId[165] = u; packetId[238] = u; packetId[150] = u; packetId[40] = new Dialogue(); ClickObject co = new ClickObject(); packetId[132] = co; packetId[252] = co; packetId[70] = co; packetId[57] = new ItemOnNpc(); ClickNPC cn = new ClickNPC(); packetId[72] = cn; packetId[131] = cn; packetId[155] = cn; packetId[17] = cn; packetId[21] = cn; packetId[16] = new ItemClick2(); packetId[75] = new ItemClick3(); packetId[122] = new ClickItem(); packetId[241] = new ClickingInGame(); packetId[4] = new Chat(); packetId[236] = new PickupItem(); packetId[87] = new DropItem(); packetId[185] = new ClickingButtons(); packetId[130] = new ClickingStuff(); packetId[103] = new Commands(); packetId[214] = new MoveItems(); packetId[237] = new MagicOnItems(); packetId[181] = new MagicOnFloorItems(); packetId[202] = new IdleLogout(); AttackPlayer ap = new AttackPlayer(); packetId[73] = ap; packetId[249] = ap; packetId[128] = new ChallengePlayer(); packetId[139] = new Trade(); packetId[39] = new FollowPlayer(); packetId[41] = new WearItem(); packetId[145] = new RemoveItem(); packetId[117] = new Bank5(); packetId[43] = new Bank10(); packetId[129] = new BankAll(); packetId[101] = new ChangeAppearance(); PrivateMessaging pm = new PrivateMessaging(); packetId[188] = pm; packetId[126] = pm; packetId[215] = pm; packetId[59] = pm; packetId[95] = pm; packetId[133] = pm; packetId[135] = new BankX1(); packetId[208] = new BankX2(); Walking w = new Walking(); packetId[98] = w; packetId[164] = w; packetId[248] = w; packetId[53] = new ItemOnItem(); packetId[192] = new ItemOnObject(); packetId[25] = new ItemOnGroundItem(); ChangeRegions cr = new ChangeRegions(); packetId[121] = cr; packetId[210] = cr; packetId[60] = new ClanChat(); } public static void processPacket(Client c, int packetType, int packetSize) { if (packetType == -1) { return; } PacketType p = packetId[packetType]; if (p != null) { try { // System.out.println("packet: " + packetType); p.processPacket(c, packetType, packetSize); } catch (Exception e) { e.printStackTrace(); } } else { System.out.println("Unhandled packet type: " + packetType + " - size: " + packetSize); } } } [/CODE] P.S: Some of the additions is from eclipse fixes.
  5. Hello there, I've added killamess single doors and double doors, And then compiled, got errors, fixed them, compiled with no errors and then ran my server and it ran properly but when I log in I get this: [CODE][20:44 13/09/13]: Launching Project Insanity... [20:44 13/09/13]: Loaded 1023 doors in 136ms. [20:44 13/09/13]: Loaded 273 Double doors in 31ms. [20:44 13/09/13]: Server listening on port 0.0.0.0:43594 [20:44 13/09/13]: [REGISTERED]: wajdi [20:44 13/09/13]: Exception in thread "main" [20:44 13/09/13]: java.lang.Excepti onInInitializerError [20:44 13/09/13]: at server.model.players.Client.processQueuedPackets(Clie nt.java:775) [20:44 13/09/13]: at server.model.players.PlayerHandler.process(PlayerHand ler.java:142) [20:44 13/09/13]: at server.Server.main(Server.java:157) [20:44 13/09/13]: Caused by: java.lang.NullPointerException [20:44 13/09/13]: at server.model.players.packets.ClickObject.<init>(Click Object.java:11) [20:44 13/09/13]: at server.model.players.PacketHandler.<clinit>(PacketHan dler.java:69) [20:44 13/09/13]: ... 3 more [/CODE] how to fix that?
  6. Hello there and welcome to my first snippet :) I've used Rich's Teletabs system and added animations, gfx, and sendMessage when breaking the teletabs. Also it only break one teletab to teleport you even if you have more than one and good timing. Assumed knowledge - Searching and Copy-paste. Open up your server folder. Search for "PlayerAssistant.java" Open it. Search for this: [CODE]public void teleTab(String teleportType) {[/CODE] If you have it, replace it with this: [CODE]public void teleTab(String teleportType) { if(c.duelStatus == 5) { c.sendMessage("You can't teleport during a duel!"); return; } if (c.playerRights > 2 ) { if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL) { c.sendMessage("You can't teleport above level "+Config.NO_TELEPORT_WILD_LEVEL+" in the wilderness."); return; } } if(System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) { c.sendMessage("You are teleblocked and can't teleport."); return; } if(!c.isDead && c.teleTimer == 0 && c.respawnTimer == -6) { if (c.playerIndex > 0 || c.npcIndex > 0) c.getCombat().resetPlayerAttack(); c.stopMovement(); removeAllWindows(); c.npcIndex = 0; c.playerIndex = 0; c.faceUpdate(0); c.teleHeight = 0; c.startAnimation(4731); c.teleTimer = 9; c.teleGfx = 678; c.teleEndAnimation = 0; if(teleportType.equalsIgnoreCase("varrock")) { c.startAnimation(4731); c.gfx0(678); c.sendMessage("You break the teleport tab."); c.teleX = 3214; c.teleY = 3424; c.getItems().deleteItem(8007 ,c.getItems().getItemSlot(8007), 1); } if(teleportType.equalsIgnoreCase("lumbridge")) { c.startAnimation(4731); c.gfx0(678); c.sendMessage("You break the teleport tab."); c.teleX = 3222; c.teleY = 3222; c.getItems().deleteItem(8008 ,c.getItems().getItemSlot(8008), 1); } if(teleportType.equalsIgnoreCase("falador")) { c.startAnimation(4731); c.gfx0(678); c.sendMessage("You break the teleport tab."); c.teleX = 2965; c.teleY = 3380; c.getItems().deleteItem(8009 ,c.getItems().getItemSlot(8009), 1); } if(teleportType.equalsIgnoreCase("camelot")) { c.startAnimation(4731); c.gfx0(678); c.sendMessage("You break the teleport tab."); c.teleX = 2757; c.teleY = 3477; c.getItems().deleteItem(8010 ,c.getItems().getItemSlot(8010), 1); } if(teleportType.equalsIgnoreCase("ardy")) { c.startAnimation(4731); c.gfx0(678); c.sendMessage("You break the teleport tab."); c.teleX = 2659; c.teleY = 3308; c.getItems().deleteItem(8011 ,c.getItems().getItemSlot(8011), 1); } } }[/CODE] If you dont have it search for this: [CODE]public void addStarter() {[/CODE] and add that code directly above it. Now, save it, and search for ClickItem.java in your server folder. Open it. and search for this: [CODE]if (itemId != c.playerItems[itemSlot] - 1) { return; }[/CODE] and add this under the last bracket in that code ^^ [CODE]if (itemId == 8007) { c.getPA().teleTab("varrock"); } if (itemId == 8008) { c.getPA().teleTab("lumbridge"); } if (itemId == 8009) { c.getPA().teleTab("falador"); } if (itemId == 8010) { c.getPA().teleTab("camelot"); } if (itemId == 8011) { c.getPA().teleTab("ardy"); }[/CODE] Save, compile and you're done. Some credits goes to #Rich for the system itself. Please do not flame, I know this is similiar to Rich's topic but I only added animations, gfx, and sendmessage. [URL="http://www.runelocus.com/forums/showthread.php?76318-PI-Adding-Teletabs-the-right-way&highlight=adding+teletabs"]Rich's Original system[/URL] This was only tested on Project Insanity. I will edit this thread with a video of doing the action. Post any errors. also please thank this thread if you have used it. VIDEO: [url]http://www.youtube.com/watch?v=cKhpWbeW0w4[/url]
  7. I recently got Ambients PI Evolved V3 and I wanted to edit somethings in the cache... and I do not find the cache files, I know that it means I need to use Tom Cache Suite but I dont know how to work with it and prefer not, is there anyway I could edit it without the Suite? Thanks... also, I got a problem while opening eclipse. [url]http://i.imgur.com/Itax0bO.png[/url] What should I do to fix it?
  8. 8/10 I dont know why. MY SIGNATURE OWNS.
×