Jump to content

Search the Community

Showing results for tags 'itemonitem'.



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 6 results

  1. newboy

    itemonItem help

    For some reason my itemonItem isnt working. This is what it looks like: [code] private void itemOnItem(final Player player, final Packet packet) { final int interfaceIndex = packet.readShort(); packet.readShort(); int fromSlot = packet.readShort(); int toSlot = packet.readShort(); int itemUsed = packet.readLEShortA() & 0xFFFF; packet.readShort(); int toInterfaceIndex = packet.readLEShort(); int usedWith = packet.readLEShort() & 0xFFFF; if (interfaceIndex != 149 && toInterfaceIndex != 149) { return; } Item item = player.getInventory().get(fromSlot); if(item == null) return; if(item.getId() != itemUsed) return; item = player.getInventory().get(toSlot); if(item == null) return; if(item.getId() != usedWith) return; if(!player.getInventory().contains(itemUsed)) return; if(!player.getInventory().contains(usedWith)) return; if(player.getFletching().handle(itemUsed, usedWith)) return; //Fletching.fz(player, usedWith, itemUsed); //Fletch.fl(player, usedWith, itemUsed); Godsword.makeGWDs(player, usedWith, itemUsed); Herblore.hb(player, usedWith, itemUsed); Crafting.CraftGems(player, usedWith, itemUsed); if (itemUsed == 590 && (usedWith == 1511 || usedWith == 1521 || usedWith == 1519 || usedWith == 1517 || usedWith == 1515 || usedWith == 1513)) Firemaking.fire(player, 1, usedWith, 100); else if (usedWith == 590 && (itemUsed == 1511 || itemUsed == 1521 || itemUsed == 1519 || itemUsed == 1517 || itemUsed == 1515 || itemUsed == 1513)) Firemaking.fire(player, 1, itemUsed, 0); if (UseWith(2368,2366,usedWith,itemUsed)) { player.getSmithing().DragonSquaresmithing(player); } //Fletching.fletch(player, usedWith, itemUsed); //dfs make if (UseWith(1540,11286,usedWith,itemUsed)) { if (!player.getInventory().contains(2347)){ player.sm("You need a hammer for make an dragon fire shield."); return; } player.sm("You made a Dragon Fire Shield and you got some smithing xp."); player.getSkills().addXp(13, 50000); player.SkillingPoints += 1+Misc.random(5); player.getInventory().deleteItem(usedWith, 1); player.getInventory().deleteItem(itemUsed, 1); player.getInventory().addItem(11283, 1); } } private boolean UseWith(int Item1, int Item2,int itemUsed,int usedWith) { if(itemUsed == Item1 && usedWith == Item2 || itemUsed == Item2 && usedWith == Item1) { return true; } return false; } [/code] I also got this: [code] case 117: /* * Item on item. */ itemOnItem(player, packet); break; [/code] Constants: [code] PACKET_LENGTHS[117] = 16; //Item on item [/code] PacketHandlers: [code] ItemPacketHandler item = new ItemPacketHandler(); final int[] packetData = new int[] { 29,66,202,117,112,189,194,229,234,248,253,69, 138 }; for (int i : packetData) { handlers[i] = item; } [/code] I don't see a problem, but it just doesnt do anything. It was working before, I havent touched anything.
  2. I downloaded this source and im trying to rip the specs out of it and i got 2 from it and im trying to get pack yak, and when u click the special it says use the scroll on an item in ur invy to send it to bank, i copied the use itemonitem straight from that source to mine but when i do it, it does nothing. But it works fine on there? I downloaded the Catclysm Released that was just released in downloads, can someone help me get this use itemonitem thing to bank it for me?
  3. This is used for combining 2 items into 1. Example: Ely sigial + blessed shield = Ely shield. Create a new class in content folder and name it "ItemOnItemHandler.java" [code] package com.rs.game.player.content; import java.util.HashMap; import java.util.Map; import com.rs.game.player.Player; import com.rs.game.player.Skills; /** * Handles item on item. * * @author Own4g3 * */ public class ItemOnItemHandler { /** * An enum containing all the data. * * @author Own4g3 * */ public enum ItemOnItem { ELYSIAN_SPIRIT_SHIELD(13750, 13736, 13742, Skills.PRAYER, 90, 10, Skills.SMITHING, 85, 10); /** * A hasmap to store all the data. */ private static Map<Integer, ItemOnItem> itemOnItems = new HashMap<Integer, ItemOnItem>(); /** * Gets the data from mapping. * @param itemId The item used id. * @return The {@code ItemOnItem} {@code Object}, or {@code Null} if the data is nonexistent. */ public static ItemOnItem forId(int itemId) { return itemOnItems.get(itemId); } /** * Populating the map. */ static { for (ItemOnItem itemOnItem : ItemOnItem.values()) { itemOnItems.put(itemOnItem.getItem1(), itemOnItem); } } /** * The item to be used on item2. */ private final int item1; /** * The item to be used on item1. */ private final int item2; /** * The new item which player is going to make by combining item1 and item2. */ private final int item3; /** * If player can make this item. */ private final int[] skillRequirement; /** * Constructs a new {@code ItemOnItem} {@code Object}. * * @param item1 The item to be used on item2. * @param item2 The item to be used on item1. * @param item3 The new item which player is going to make by combining item1 and item2. * @param skillRequirement Skill Id, Required level, Exp in that skill. */ ItemOnItem(int item1, int item2, int item3, int...skillRequirement) { this.item1 = item1; this.item2 = item2; this.item3 = item3; this.skillRequirement = skillRequirement; } /** * Gets the first item. * @return item1 */ public int getItem1() { return item1; } /** * Gets the 2nd item. * @return item2 */ public int getItem2() { return item2; } /** * Gets the 3rd item. * @return item3 */ public int getItem3() { return item3; } /** * Gets skill requirments.. * @return skillRequirement */ public int[] getSkillRequirement() { return skillRequirement; } } /** * Handles the item on item action. * * @param player The player. * @param itemOnItem The itemOnItem. * @param usedWith The item used. * @param itemUsed The item used. */ public static void handleItemOnItem(Player player, ItemOnItem itemOnItem, int usedWith, int itemUsed) { int[] skillStuff = itemOnItem.getSkillRequirement(); if (player.getSkills().getLevel(skillStuff[0]) >= skillStuff[1]) { if (player.getSkills().getLevel(skillStuff[3]) >= skillStuff[4]) { player.getInventory().deleteItem(usedWith, 1); player.getInventory().deleteItem(itemUsed, 1); player.getInventory().addItem(itemOnItem.getItem3(), 1); player.getSkills().addXp(skillStuff[0], skillStuff[2]); } else player.getPackets().sendGameMessage("You need a " + Skills.SKILL_NAME[skillStuff[3]] + " level of " + Skills.SKILL_NAME[skillStuff[4]] + " to make this."); } else player.getPackets().sendGameMessage("You need a " + Skills.SKILL_NAME[skillStuff[0]] + " level of " + skillStuff[1] + " to make this."); } } [/code] Now, implement it. [B]InventoryOptionsHandler.java[/B] [code] ItemOnItem itemOnItem = ItemOnItem.forId(itemUsedId); if (itemOnItem != null) { if (itemUsedWithId == itemOnItem.getItem2()) ItemOnItemHandler.handleItemOnItem(player, itemOnItem, usedWith.getId(), itemUsed.getId()); return; } [/code] Add it under "handleItemOnItem" method. And that's it. You're done.
  4. I have no idea how I'd go about getting this.. so if anyone has it or knows how I could get it, it'd be much appreciated. itemSelect class example: [CODE]int itemSlot = p.stream.readUnsignedWordA();[/CODE]
  5. The only person I can think this release would hurt would be Emily... and doubt she cares (I'll remove if you do care Em.). Open up your all-in-one-shit-class that dkk has... Place this with the rest of the packIds... [CODE] private final static int ITEM_SELECT = 66; private final static int ITEM_ON_ITEM = 117;[/CODE] And the packet sizes... [CODE] PACKET_SIZES[ITEM_SELECT] = 8; PACKET_SIZES[ITEM_ON_ITEM] = 16;[/CODE] And here is the code for them... [CODE] else if (packetId == ITEM_ON_ITEM){ final int interfaceId = stream.readInt() >> 16; int fromSlot = stream.readShort(); int toSlot = stream.readShort(); int itemUsed = stream.readUnsignedShortLE128(); int toInterfaceIndex = stream.readInt() >> 16; int usedWith = stream.readUnsignedShortLE(); System.out.println("with: "+usedWith+", InterfaceId: "+interfaceId+", ItemId: "+itemUsed+", SlotId: "+fromSlot); System.out.println("toSlot: "+toSlot+", fromslot:"+fromSlot); if (interfaceId != 149 && toInterfaceIndex == 0) { return; } if(!clicked) { return; } clicked = false; if(player.isDead() || Utils.getInterfaceDefinitionsSize() <= interfaceId) { return; } if(player.getStopDelay() > System.currentTimeMillis()) return; if(!player.getInterfaceManager().containsInterface(interfaceId)) return; Item item = player.getInventory().getItem(fromSlot); if(item == null) return; if(item.getId() != itemUsed) return; item = player.getInventory().getItem(toSlot); if(item == null) return; if(item.getId() != usedWith) return; if(!player.getInventory().containsItem(itemUsed, 1)) return; if(!player.getInventory().containsItem(usedWith, 1)) return; if(interfaceId == 149) { } } else if (packetId == ITEM_SELECT) { int interfaceId = stream.readInt() >> 16; int itemId = stream.readUnsignedShort(); int slotId = stream.readShort128(); System.out.println("InterfaceId: "+interfaceId+", ItemId: "+itemId+", SlotId: "+slotId); if(!clicked) { return; } clicked = false; if(player.isDead() || Utils.getInterfaceDefinitionsSize() <= interfaceId) { return; } if(player.getStopDelay() > System.currentTimeMillis()) return; if(!player.getInterfaceManager().containsInterface(interfaceId)) return; Item item = player.getInventory().getItem(slotId); if(interfaceId == 149) { switch(itemId) { /*Start of food*/ case 391://Manta Ray break; default: System.out.println("Unhandled Food:"+item.getId()+", Slot:"+slotId); } } }[/CODE] I had to take out some of the food and stuff i added so there might be errors IDK. Say so if there is. Credits: Emily and DragonKk and my self.
×