Jump to content

ghrim

Member
  • Content count

    72
  • Joined

  • Last visited

About ghrim

  • Rank
    Iron Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well either way it's a 562 client, so the packets shouldn't change. If it's coded like Matrix then I'd guess it would need to look like this. [CODE]private final static int CLAN_JOINING_PACKET = 36;//Goes with other packets initializers PACKET_SIZES[CLAN_JOINING_PACKET] = -1;//Goes with the set packet size list if(packetId == CLAN_JOINING_PACKET) { int hash = stream.readByte(); String name = ((char) hash) + stream.readString(); System.out.println(name);//Will display name in the console }[/CODE] Went and downloaded some 562 converted from Matrix source and this works fine. They just have different naming.
  2. It's packet ID: 36, not sure about packet size, but try -1. [CODE]int hash = packet.readByte(); String name = ((char) hash) + packet.readRSString(); System.out.println(name);//Verify it to make sure it reads the chucks correctly[/CODE] I think it's already handled in ClanPacketHandler.java if you're using RS2HD.
  3. Well here's my entry: Light Version for Dark BG: Dark Version for Light BG: Good luck to everyone else.
  4. [CODE]player.getPackets().sendItemOnIComponent(interfaceId, componentId, itemId, itemAmount); or player.getPackets().sendItemOnIComponent(103, componentId, 4151, 1);[/CODE] Component Ids are 6, 7, 8, 10, 11, 12, and 13.
  5. ghrim

    [562]Loading prices

    Find and add a new integer array under this. [CODE] private final int [] AlchPrice = new int[40000];[/CODE] Example: [CODE]private final int [] AlchPrice = new int[40000]; private final int [] newPrice = new int[40000];[/CODE] This creates a list of variables contains 40000 integers. After making the new array, find this. [CODE]AlchPrice[ItemId] = Integer.parseInt(token3[3]);[/CODE] then add this under it. [CODE]newPrice[ItemId] = Integer.parseInt(token3[4]);[/CODE] This sets the price to the array you made. After that find this [CODE]public int AlchPrice(int Id) { return AlchPrice[Id]; }[/CODE] and add this under it. [CODE]public int newPrice(int Id) { return newPrice[Id]; }[/CODE] This creates a function to call the items price. Save, compile, and run. I would recommend replacing this [CODE]private final int [] BuyPrice = new int[40000]; private final int [] SellPrice = new int[40000]; private final int [] AlchPrice = new int[40000]; private final int [] newPrice = new int[40000];[/CODE] with [CODE]private int length = 40000; private final int[] BuyPrice = new int[length]; private final int[] SellPrice = new int[length]; private final int[] AlchPrice = new int[length]; private final int[] newPrice = new int[length];[/CODE]
  6. Holy crap Ghrim! its been so long

  7. [quote name='Lightx']Thank you ghrim Mind if I add that in my tutorial?[/QUOTE] Go right ahead.
  8. Go to Location.java and add this somewhere: [CODE] public int getLocalX(Location tile, int mapSize) { return x - 8 * (tile.getRegionX() - (Settings.MAP_SIZES[mapSize] >> 4)); } public int getLocalY(Location tile, int mapSize) { return y - 8 * (tile.getRegionY() - (Settings.MAP_SIZES[mapSize] >> 4)); }[/CODE] then add the import from Settings.java into Location.java: [CODE]import com.rs2hd.Settings;[/CODE] Next save and close Location.java then go to Settings.java and add this somewhere in there and save and close: [CODE] public static final int [] MAP_SIZES = {104, 120, 136, 168};[/CODE] Then go to PlayerUpdate.java and replace: [CODE] data.addByteC(p.getNextForceMovement().getToFirstTile().getLocalX()); data.addByte((byte) p.getNextForceMovement().getToFirstTile().getLocalY()); data.addByteC(p.getNextForceMovement().getToSecondTile() == null ? 0 : p.getNextForceMovement().getToSecondTile().getLocalX()); data.addByte((byte) (p.getNextForceMovement().getToSecondTile() == null ? 0 : p.getNextForceMovement().getToSecondTile().getLocalY()));[/CODE] With this: [CODE] updateBlock.addByteC((byte) player.getUpdateFlags().getForceMovementCoordinate().getToFirstTile().getLocalX(player.getUpdateFlags().getLastRegion(), 0)); updateBlock.addByte((byte) player.getUpdateFlags().getForceMovementCoordinate().getToFirstTile().getLocalY(player.getUpdateFlags().getLastRegion(), 0)); updateBlock.addByteC((byte) player.getUpdateFlags().getForceMovementCoordinate().getToSecondTile().getLocalX(player.getUpdateFlags().getLastRegion(), 0)); updateBlock.addByte((byte) player.getUpdateFlags().getForceMovementCoordinate().getToSecondTile().getLocalY(player.getUpdateFlags().getLastRegion(), 0));[/CODE] Save and close PlayerUpdate.java and and compile. That should fix the random direction placing.
  9. ghrim

    help in magic on item

    Just replace the two parts that look like this [CODE] if(price > 0){ p.getInventory().addItem(995, price); }[/CODE] With this [CODE] if(price > 20000){ p.getInventory().addItem(995, price); }else{ p.getInventory().addItem(995, Misc.random(20000)); }[/CODE] If you want new players to have a way to make some kind of cash when alching items with a price lower than 20000 gp.
  10. ghrim

    help in magic on item

    This should fix the problem. All I did was copy what you had and modified it. [CODE] case 59://High Alching if(p.getInventory().getContainer().get(itemSlot) == null) return; int price = GameEngine.prices.getNormalPrice(p.getInventory().getContainer().get(itemSlot).getId()); if(p.getSkills().getLevel(6) < 55) { p.sm("You need 55 magic to cast this."); return; } if(!(p.getInventory().contains(561, 1) && p.getInventory().contains(554, 5) || p.getEquipment().get(3).getDefinition().getId() == 1387 && p.getInventory().contains(561, 1))) { p.sm("You do not have the required runes to cast this spell."); return; } if(itemid == 995) { p.sm("You cannot alch coins."); return; } if(itemid == 1037) { p.sm("You cannot alch holiday items."); return; } if(GameEngine.prices.getNormalPrice(itemid) == 0) { p.sm("You cannot alch this item."); return; } if(p.getEquipment().get(3) != null && p.getEquipment().get(3).getDefinition().getId() == 1387 && p.getInventory().contains(561, 1)) { p.animate(9633); p.graphics(1693); if(price > 0){ p.getInventory().addItem(995, price); } p.getInventory().deleteItem(561, 1); p.getInventory().deleteItem(itemid, 1); p.getSkills().addXp(6, 300); } else if(p.getInventory().contains(561, 1) && p.getInventory().contains(554, 5)){ p.animate(9631); p.graphics(1691); if(price > 0){ p.getInventory().addItem(995, price); } p.getInventory().deleteItem(554, 5); p.getInventory().deleteItem(561, 1); p.getInventory().deleteItem(itemid, 1); p.getSkills().addXp(6, 300); } break;[/CODE]
  11. Can u help me again with the gfx on player coords x +1 it works with ur code but it doesnt show it to all players.

  12. Staxc already gave you the method to send this, but you can use this. [CODE]if(cmd[0].equals("nub")) { player.getActionSender().sendGraphics(92, player.getLocation().getZ(), new Location(player.getLocation().getX()+1, player.getLocation().getY(), player.getLocation().getZ())); }[/CODE]
  13. [CODE] public void sendGraphics(int gfxId, int height, Object target) { StaticPacketBuilder stream = new StaticPacketBuilder(); stream.setId(109); stream.addLEShortA(height); int hash = 0; if(target instanceof Location) { Location tile = (Location) target; hash = tile.getZ() << 28 | tile.getX() << 14 | tile.getY() & 0x3fff| 1 << 30; } else if (target instanceof Player) { Player p = (Player) target; hash = p.getIndex() & 0xffff | 1 << 28; } else { NPC n = (NPC) target; hash = n.getIndex() & 0xffff; } stream.addLEInt(hash); stream.addShortA(gfxId); stream.addLEShortA(0); player.getSession().write(stream.toPacket()); }[/CODE] Should fix the errors.
  14. Put this in this some where in your commandpackethandler [CODE]if(cmd[0].equals("random")){ player.getActionSender().sendInterface(620); player.getActionSender().sendItems(-1, 2, 0, player.getInventory().getContainer()); }[/CODE] Then spawn like 4 items and use that caommand and tell me what you see. If it doesn't do anything with a normal 562 then I guess you can try a 562 loading 602 and if that does nothing then I don't even know why I even posted :/
×