Jump to content

Search the Community

Showing results for tags 'farming'.



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

  1. Greetings! For the last week or two, in my free time, I have been developing my servers farming based off of a few tutorials I have found. [B][U][COLOR="#FF8C00"][URL="http://www.rune-server.org/runescape-development/rs-503-client-server/snippets/559347-718-farming.html"]This tutorial[/URL] is the original code I used. If you wish to use my code, you will need to follow this tutorial first in order to use my code.[/COLOR][/U][/B] [URL="http://www.rune-server.org/runescape-development/rs-503-client-server/snippets/492567-718-farming-release.html"]This tutorial [/URL]has helped me to finish off the various config ID's for herbs, flowers and allotments. I have vastly improved and fixed hundreds of issues with my farming code, and hope to share so that others can use my code and improve it. I am by no means a master of convention but I am learning quickly. [COLOR="#FF0000"][B][U]Again, the original code here was not my creation! [/U][/B][/COLOR] My farming consists of 3 main files: FarmingSystem.java [CODE]package com.rs.game.player.content.farming; import java.util.Iterator; import com.rs.game.Animation; import com.rs.game.WorldObject; import com.rs.game.item.Item; import com.rs.game.player.Player; import com.rs.game.player.Inventory; import com.rs.game.player.Skills; import com.rs.game.player.content.farming.Seeds.Seed; import com.rs.game.player.content.farming.Seeds; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; public class FarmingSystem { /** * @author Jake | Santa Hat [MENTION=77]Rune[/MENTION]-Server */ /** * A list of all the Farming Allotments / Patches */ public static int[] farmingPatches = { 8552, 8553, 7848, 8151, 8550, 8551, 7847, 8150, 8554, 8555, 7849, 8152 }; /** * Handles the seeds on patch */ public static void handleSeeds(Player player, int seedId, WorldObject object) { if ((!canPlantSeeds(player, object) && (seedId == 952)) || (canPlantSeeds(player, object) && (seedId == 952))) { for (PatchStatus patch : player.farmingPatch) { if (patch.getObjectId() == object.getId()) { player.setNextAnimation(new Animation(2273)); player.getPackets().sendConfigByFile(object.getDefinitions().configFileId, 0); player.farmingPatch.remove(patch); } } player.getPackets().sendGameMessage("You remove the growing plants with your shovel."); return; } if (!canPlantSeeds(player, object)) { player.getPackets().sendGameMessage("You must clear the weeds before you may plant some seeds here."); return; } for (PatchStatus patch : player.farmingPatch) { if ((patch.getObjectId() == object.getId()) && (seedId != 952)) { player.getPackets().sendGameMessage("There is already something growing here."); return; } } for (Seeds.Seed seed : Seeds.Seed.values()) { if (seedId == seed.getItem().getId()) { if (player.getSkills().getLevel(Skills.FARMING) < seed.getLevel()) { player.getPackets().sendGameMessage("You need at least "+seed.getLevel()+" Farming in order to plant this."); return; } if (!player.getInventory().containsItem(seed.getItem().getId(), seed.getItem().getAmount())) { player.getPackets().sendGameMessage("You need at least "+seed.getItem().getAmount()+" "+new Item(seedId, 1).getDefinitions().getName()+"'s."); return; } for (int i = 0; i < seed.getSuitablePatch().length; i++) { if (seed.getSuitablePatch()[i] == object.getId()) { player.getPackets().sendGameMessage("You plant some "+new Item(seedId, 1).getDefinitions().getName()+"'s."); player.getInventory().deleteItem(seed.getItem()); player.setNextAnimation(new Animation(2291)); player.farmingPatch.add(new PatchStatus(object.getId(), object.getDefinitions().configFileId, seed.getConfigValues()[0], seed.getConfigValues()[seed.getConfigValues().length-1], "Some "+new Item(seedId, 1).getDefinitions().getName()+"'s have been planted here.", seed.getTime())); startGrowth(player, object, seed.getTime() / 2); } } } } } /** * Is the Patch Raked? Can the Player plant seeds? */ private static boolean canPlantSeeds(Player player, WorldObject object) { for (WorldObject o : player.rakedPatch) { if (object.getId() == o.getId()) return true; } return false; } /** * Starts the growth * 5 Stages of Growth */ private static void startGrowth(final Player player, final WorldObject object, int time) { WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { if (player.farmingPatch.size() == 0) { stop(); return; } PatchStatus status = null; for (PatchStatus patch : player.farmingPatch) { if (patch.getConfigId() == object.getDefinitions().configFileId) { status = patch; } } if (status == null) { stop(); return; } if ((status.getConfigValue() + 1) == status.getMaxConfigValue()) { player.getPackets().sendConfigByFile(status.getConfigId(), status.getMaxConfigValue()); player.getPackets().sendGameMessage("<col=ff0000>[Farming] Your crops have fully grown."); stop(); } else { player.farmingPatch.add(new PatchStatus(object.getId(), object.getDefinitions().configFileId, status.getConfigValue() + 1, status.getMaxConfigValue(), status.getInspectText(),status.getPatchTime())); player.farmingPatch.remove(status); player.getPackets().sendConfigByFile(status.getConfigId(), status.getConfigValue() + 1); } } }, 0, time); } /** * Should the Player Rake or Harvest? */ public static void executeAction(Player player, WorldObject object) { if (canHarvest(player, object)) harvestCrops(player, object); else rake(player, object); } /** * Harvest's The Crops */ private static void harvestCrops(Player player, WorldObject object) { if (canHarvest(player, object) && (player.getInventory().getFreeSlots() >= 4)) { sendItems(player, object); for (Iterator<PatchStatus> patches = player.farmingPatch.iterator(); patches.hasNext();) { PatchStatus patch = patches.next(); if (patch.getConfigId() == object.getDefinitions().configFileId) patches.remove(); //Removes the Crops } for (Iterator<WorldObject> rakedPatches = player.rakedPatch.iterator(); rakedPatches.hasNext();) { WorldObject rakedPatch = rakedPatches.next(); if (rakedPatch.getId() == object.getId()) rakedPatches.remove(); //Removes the Raked Patch } } else if (canHarvest(player, object) && (player.getInventory().getFreeSlots() < 4)) { player.getPackets().sendGameMessage("You need more inventory space!"); } } /** * Sends the Farming crops to the Players Inventory */ private static boolean harvestGood = false; private static boolean harvesting = false; private static void sendItems(Player player, WorldObject object) { for (PatchStatus patch : player.farmingPatch) { if (patch.getObjectId() == object.getId()) { for (Seeds.Seed seed : Seed.values()) { for (int i = 0; i < seed.getSuitablePatch().length; i++) { if (seed.getSuitablePatch()[i] == object.getId()) { if ((seed.getConfigValues()[seed.getConfigValues().length-1] == patch.getMaxConfigValue()) && (patch.getObjectId() == object.getId())) { player.lock(); player.getSkills().addXp(Skills.FARMING, seed.getSeedExp()); player.setNextAnimation(new Animation(2286)); player.getInventory().addItem(seed.getProduce()); player.getPackets().sendGameMessage("You harvest the "+new Item(seed.getProduce().getId(), 1).getDefinitions().getName()+"'s."); clearPatch(player, object); player.farmingPatch.remove(patch); player.unlock(); return; } } } } } } } private static void clearPatch(Player player, WorldObject object) { player.getPackets().sendConfigByFile(object.getDefinitions().configFileId, 0); } /** * Can the Player Harvest? */ public static boolean canHarvest(Player player, WorldObject object) { for (PatchStatus patch : player.farmingPatch) { if (patch.getConfigId() == object.getDefinitions().configFileId) { if ((patch.getConfigValue() + 1) == patch.getMaxConfigValue()) { return true; } } } return false; } /** * Sends the Configs Upon Login */ public static void sendPatchOnLogin(Player player) { player.rakedPatch.clear(); for (PatchStatus patch : player.farmingPatch) { int growTime = patch.getPatchTime() / 2; WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { if (player.farmingPatch.size() == 0) { stop(); return; } //for (PatchStatus patch : player.farmingPatch) { if ((patch.getConfigValue() + 1) == patch.getMaxConfigValue()) { player.getPackets().sendConfigByFile(patch.getConfigId(), patch.getMaxConfigValue()); player.getPackets().sendGameMessage("[Farming] Your crops have fully grown."); stop(); } else { player.farmingPatch.add(new PatchStatus(patch.getObjectId(), patch.getConfigId(), patch.getConfigValue() + 1, patch.getMaxConfigValue(), patch.getInspectText(),patch.getPatchTime())); player.getPackets().sendConfigByFile(patch.getConfigId(), patch.getConfigValue() + 1); player.farmingPatch.remove(patch); } //} } }, 0, growTime); //continueGrowth(player); } } /** * Continues the Growth of the crops when the player logs back in. */ // private static int pTime; /* public static void continueGrowth(final Player player) { WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { if (player.farmingPatch.size() == 0) { stop(); return; } for (PatchStatus patch : player.farmingPatch) { pTime = patch.getPatchTime() / 2; if ((patch.getConfigValue() + 1) == patch.getMaxConfigValue()) { player.getPackets().sendConfigByFile(patch.getConfigId(), patch.getMaxConfigValue()); player.getPackets().sendGameMessage("[Farming] Your crops have fully grown."); stop(); } else { player.farmingPatch.add(new PatchStatus(patch.getObjectId(), patch.getConfigId(), patch.getConfigValue() + 1, patch.getMaxConfigValue(), patch.getInspectText(),patch.getPatchTime())); player.getPackets().sendConfigByFile(patch.getConfigId(), patch.getConfigValue() + 1); player.farmingPatch.remove(patch); } } } }, 0, pTime); } */ /** * Rakes the patch */ private static void rake(final Player player, final WorldObject object) { if (!player.getInventory().containsItem(5341, 1)) { player.getPackets().sendGameMessage("You'll need a rake to get rid of the weeds."); return; } if (player.getInventory().getFreeSlots() >= 3) { WorldTasksManager.schedule(new WorldTask() { int loop; int configValue; [MENTION=15855]Over[/MENTION]ride public void run() { player.lock(); if (loop == 0 || loop == 3 || loop == 6) { configValue++; player.setNextAnimation(new Animation(2273)); player.getPackets().sendConfigByFile(object.getDefinitions().configFileId, configValue); player.getInventory().addItem(6055, 1); player.getSkills().addXp(Skills.FARMING, 25); player.rakedPatch.add(object); } else if (loop >= 7) { player.unlock(); stop(); } loop++; } }, 0, 1); player.getPackets().sendGameMessage("You successfully clear all the weeds."); } else if (player.getInventory().getFreeSlots() < 3) { player.getPackets().sendGameMessage("You need more inventory space to rake here."); } } /** * Right Click Patch - Inspect Option - Call this in ObjectHandler - Option2 */ public static void inspectPatch(Player player, WorldObject object) { if (player.farmingPatch.size() == 0) { player.getDialogueManager().startDialogue("SimpleMessage", "There is currently nothing growing here."); return; } for (PatchStatus patch : player.farmingPatch) { if (object.getId() == patch.getObjectId()) { player.getDialogueManager().startDialogue("SimpleMessage", ""+patch.getInspectText()+" ; Configid: "+patch.getConfigValue()); } else { player.getDialogueManager().startDialogue("SimpleMessage", "There is currently nothing growing here."); } } } }[/CODE] Next, my PatchStatus.java object: [CODE]package com.rs.game.player.content.farming; import java.io.Serializable; public class PatchStatus implements Serializable { /** * @author Jake | Santa Hat [MENTION=77]Rune[/MENTION]-Server */ private static final long serialVersionUID = 4641462661859309514L; private int objectId; private int configId; private int configValue; private int maxConfigValue; private String inspect; private int patchTime; public PatchStatus(int objectId, int configId, int configValue, int maxConfigValue, String inspect, int patchTime) { this.objectId = objectId; this.configId = configId; this.configValue = configValue; this.maxConfigValue = maxConfigValue; this.inspect = inspect; this.patchTime = patchTime; } public int getObjectId() { return objectId; } public int getConfigId() { return configId; } public int getConfigValue() { return configValue; } public int getMaxConfigValue() { return maxConfigValue; } public String getInspectText() { return inspect; } public int getPatchTime() { return patchTime; } }[/CODE] And finally, my Seeds.java: [CODE]package com.rs.game.player.content.farming; import com.rs.game.item.Item; public class Seeds { /** * @author Jake | Santa Hat [MENTION=77]Rune[/MENTION]-Server */ public enum Seed { /** * Allotments */ POTATO(new Item(5318, 4), new int[] { 6, 7, 8, 9, 10 }, 1, new Item(1942, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 300, 25), ONION(new Item(5319, 4), new int[] { 13, 14, 15, 16, 17 }, 5, new Item(1957, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 330, 55), CABBAGE(new Item(5324, 4), new int[] { 20, 21, 22, 23, 24 }, 7, new Item(1965, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 360, 85), TOMATO(new Item(5322, 4), new int[] { 27, 28, 29, 30, 31 }, 12, new Item(1982, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 420, 110), SWEETCORN(new Item(5320, 4), new int[] { 34, 35, 37, 39, 40 }, 20, new Item(5986, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 480, 200), STRAWBERRY(new Item(5323, 4), new int[] { 43, 45, 46, 48, 49 }, 31, new Item(5504, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 540, 301), WATERMELON(new Item(5321, 4), new int[] { 52, 53, 55, 59, 60 }, 47, new Item(5982, 4), new int[] { 8553, 8552, 8550, 8551, 8554, 8555 }, 600, 550), /** * Flower Patches */ MARIGOLD(new Item(5096, 1), new int[] { 8, 9, 10, 11, 12 }, 2, new Item(6010, 1), new int[] { 7848, 7847, 7849 }, 310, 30), ROSEMARY(new Item(5097, 1), new int[] { 13, 14, 15, 16, 17 }, 11, new Item(6014, 1), new int[] { 7848, 7847, 7849 }, 400, 45), NASTURTIUM(new Item(5098, 1), new int[] { 18, 19, 20, 21, 22 }, 24, new Item(6012, 1), new int[] { 7848, 7847, 7849 }, 480, 110), WOAD(new Item(5099, 1), new int[] { 23, 24, 25, 26, 27 }, 25, new Item(1793, 1), new int[] { 7848, 7847, 7849 }, 490, 120), LIMPWURT(new Item(5100, 1), new int[] { 28, 29, 30, 31, 32 }, 26, new Item(225, 1), new int[] { 7848, 7847, 7849 }, 500, 130), LILY(new Item(14589, 1), new int[] { 37, 38, 39, 40, 41 }, 52, new Item(14583, 1), new int[] { 7848, 7847, 7849 }, 700, 450), /** * Herb Patches */ GUAM(new Item(5291, 1), new int[] { 4, 5, 6, 7, 8 }, 9, new Item(199, 4), new int[] { 8151, 8150, 8152 }, 360, 50), MARRENTILL(new Item(5292, 1), new int[] { 11, 12, 13, 14, 15 }, 14, new Item(201, 4), new int[] { 8151, 8150, 8152 }, 420, 80), TARROMIN(new Item(5293, 1), new int[] { 18, 19, 20, 21, 22 }, 19, new Item(203, 4), new int[] { 8151, 8150, 8152 }, 480, 110), HARRALANDER(new Item(5294, 1), new int[] { 25, 26, 27, 28, 29 }, 26, new Item(205, 4), new int[] { 8151, 8150, 8152 }, 540, 150), RANARR(new Item(5295, 1), new int[] { 32, 33, 34, 35, 36 }, 32, new Item(207, 4), new int[] { 8151, 8150, 8152 }, 600, 190), TOADFLAX(new Item(5296, 1), new int[] { 39, 40, 41, 42, 43 }, 38, new Item(3049, 4), new int[] { 8151, 8150, 8152 }, 660, 225), IRIT(new Item(5297, 1), new int[] { 46, 47, 48, 49, 50 }, 44, new Item(209, 4), new int[] { 8151, 8150, 8152 }, 720, 270), AVANTOE(new Item(5298, 1), new int[] { 53, 54, 55, 56, 57 }, 50, new Item(211, 4), new int[] { 8151, 8150, 8152 }, 780, 300), WERGALI(new Item(14870, 1), new int[] { 60, 61, 62, 63, 64 }, 46, new Item(14836, 4), new int[] { 8151, 8150, 8152 }, 750, 285), KWUARM(new Item(5299, 1), new int[] { 69, 70, 71, 72, 73 }, 56, new Item(213, 4), new int[] { 8151, 8150, 8152 }, 820, 325), SNAPDRAGON(new Item(5300, 1), new int[] { 75, 76, 77, 78, 79 }, 62, new Item(3051, 4), new int[] { 8151, 8150, 8152 }, 880, 360), CADANTINE(new Item(5301, 1), new int[] { 82, 83, 84, 85, 86 }, 67, new Item(215, 4), new int[] { 8151, 8150, 8152 }, 920, 390), LANTADYME(new Item(5302, 1), new int[] { 89, 90, 91, 92, 93 }, 73, new Item(2485, 4), new int[] { 8151, 8150, 8152 }, 980, 420), DWARF_WEED(new Item(5303, 1), new int[] { 96, 97, 98, 99, 100 }, 79, new Item(217, 4), new int[] { 8151, 8150, 8152 }, 1020, 480), TORSTOL(new Item(5304, 1), new int[] { 103, 104, 105, 106, 107 }, 85, new Item(219, 4), new int[] { 8151, 8150, 8152 }, 1080, 520), FELLSTALK(new Item(21621, 1), new int[] { 106, 107, 108, 109, 110 }, 91, new Item(21626, 4), new int[] { 8151, 8150, 8152 }, 1120, 670); private Item item; private int[] configValues; private int level; private Item produce; private int[] suitablePatches; private int time; //Time to grow (In Seconds) private int exp; Seed(Item item, int[] configValues, int level, Item produce, int[] suitablePatches, int time, int exp) { this.item = item; this.configValues = configValues; this.level = level; this.produce = produce; this.suitablePatches = suitablePatches; this.time = time; this.exp = exp; } public Item getItem() { return item; } public int[] getConfigValues() { return configValues; } public int getLevel() { return level; } public int getSeedExp() { return exp; } public Item getProduce() { return produce; } public int[] getSuitablePatch() { return suitablePatches; } public int getTime() { return time; } } }[/CODE] These 3 files contain the majority of my farming system. As well, if you follow the tutorial for the original code, then update to mine, you should have a very functional farming system. I also added if statements to my Objecthandler.java to prevent the "Nothing interesting happens" message when interacting with the patches. You will have to add one statement in the HandleOption1 method, and one in the ItemonObject method. Features: -Fully supported Allotments -All Flowers -All Herbs -Raking -Planting, growth, harvesting -Proper rewards -Experience rates and growth times are set high, these can be easily changed in Seeds.java -Logout/Server restart does not hinder growth -Shovel will clear growing/grown/bugged plants -Player animations should be set to prevent glitched positioning -Improved indexing and the harvesting to prevent concurrentmodification exceptions, as well as Invalid array exceptions -Expanded the PatchStatus object to include growth time and help improve the farming experience As well, since this is still in development, I have left my commented out code in the classes. This may be clutter but it may provide useful when debugging, so I have left it for other users.
  2. [4/24/14 7:15 PM]: java.lang.NullPointerException [4/24/14 7:15 PM]: at server.model.items.UseItem.ItemonObject(UseItem.java:34) [4/24/14 7:15 PM]: at server.model.players.packets.ItemOnObject.processPacket(ItemOnObject.java:30) [4/24/14 7:15 PM]: at server.model.players.PacketHandler.processPacket(PacketHandler.java:143) [4/24/14 7:15 PM]: at server.model.players.Client.processQueuedPackets(Client.java:891) [4/24/14 7:15 PM]: at server.model.players.PlayerHandler.process(PlayerHandler.java:150) [4/24/14 7:15 PM]: at server.Server$1.execute(Server.java:250) [4/24/14 7:15 PM]: at server.event.Task.tick(Task.java:103) [4/24/14 7:15 PM]: at server.event.TaskScheduler.run(TaskScheduler.java:98) [4/24/14 7:15 PM]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [4/24/14 7:15 PM]: at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [4/24/14 7:15 PM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [4/24/14 7:15 PM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [4/24/14 7:15 PM]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [4/24/14 7:15 PM]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [4/24/14 7:15 PM]: at java.lang.Thread.run(Thread.java:744) That is the error I get when I use my rake on my farming patch. I honestly have tried everything (except the right thing of course). If anyone could please help me out with this so that my farming will work it would be much appreciated. Thank You.
  3. hey guys, im using the project-exile source and i have 2 problems that i cannot solve personally. firstly, after i rake a farming allotment, there is no way to select a cleaned patch, when you right click the patch there is only a 'cancel' option available so you cannot use seeds on it :/ secondly, in some of my shops, you can buy some items like seeds for coins when your inventory doesnt have any coins, even though it shows that the value of the seeds is 100k or w/e.. if anyone knows in which file i can find the fixes for the above or guide me, your help will be much appreciated. here's my shops.cfg, i tried changing the 1's to 2's but no change [CODE] shop = 1 General_Supplies 1 1 590 100 1755 100 2347 100 952 100 946 100 228 10000 1540 30 1523 100 7947 100 314 100 313 100 1437 100 527 100 2435 100 2429 100 114 100 2433 100 3041 100 2445 100 6686 100 303 10 311 10 301 10 307 10 309 10 305 10 shop = 3 Pk_Points_Shop 1 1 6914 10 6889 10 10551 10 10548 10 20072 10 15018 10 15019 10 15020 10 15220 10 13896 1 13884 100 13890 100 13902 100 13887 100 13893 100 13905 100 13899 100 13876 100 13870 100 13873 100 13864 100 13858 100 13861 100 13867 100 shop = 5 Magic_Gear_Shop 1 1 1381 100 1383 100 1385 100 1387 100 4675 100 3840 100 3842 100 3844 100 6109 100 6107 100 6108 100 6110 100 6106 100 4089 100 4091 100 4093 100 4095 100 4097 100 3755 100 9075 1000 565 1000 554 1000 555 1000 556 1000 557 1000 558 1000 559 1000 560 1000 561 1000 562 1000 563 1000 564 1000 566 1000 shop = 6 Weapons_Shop 1 1 7460 100 7461 100 4587 100 1305 100 1377 100 1434 100 3204 100 1215 100 5698 100 1323 100 1325 100 1329 100 1331 100 1333 100 1725 100 3105 100 4131 100 6568 100 10828 100 3751 100 shop = 9 Bob's_Axes_and_Pickaxes 2 1 1351 100 1349 100 1353 100 1355 100 1357 100 1359 100 1265 100 1267 100 1269 100 1271 100 1273 100 1275 100 shop = 10 Armour_Shop 1 1 1153 100 1157 100 1159 100 1161 4000 1163 100 1115 100 1119 100 1121 100 1123 100 1127 100 1067 100 1069 100 1071 100 1073 100 1079 100 shop = 13 Voting_Rewards_Shop 1 1 13661 100 shop = 15 Farming_Supplies 1 1 5318 100 5099 100 5319 100 5280 100 5283 100 5284 100 5285 100 5286 100 5287 100 5288 100 5289 100 5290 100 5291 100 5292 100 5293 100 5294 100 5295 100 5296 100 5297 100 5298 100 5299 100 5300 100 5301 100 5302 100 5303 100 5304 100 5341 100 5343 100 5340 100 952 100 1925 100 shop = 19 Range_Gear_Shop 1 1 1129 100 1131 100 1133 100 1065 100 1099 100 1135 100 2491 100 2497 100 2503 100 3749 100 6328 100 868 1000 841 100 861 100 882 1000 884 1000 886 1000 888 100 890 100 892 100 9185 100 9144 1000 9243 1000 9242 1000 9244 1000 [/CODE] thanks :D
  4. ok first i have searched the internet for this and didn't find anything and second i have tried to do this myself and i couldn't figure it out. ok so if someone could help me that would be great, i was trying to make something like if you kill someone you have to wait like 5 min before you can kill that person again and get the pkp for it but if you kill the other person before that timer is up you don't get the pkp for the kill or if possible make the timer restart. Thank you for reading and any help will be very much appreciated :) Btw i am using hybrid pvp v3 source PI if that is needed to be known for this but thanks again :)
  5. Hey guys i thought i would release part of the farming class since its very easy to do. I hope you guys enjoy. Some of the ints aren't needed but are used as a reference. This is only the raking part. Like the title is PART ONE. This is my own code, any reposting of my code MUST be given credits to me. Credits:me 100% Code: package com.rs.game.player.actions; import com.rs.game.Animation; import com.rs.game.World; import com.rs.game.WorldObject; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.utils.Utils; public class Farming { public static int RAKE = 5341; public static final Animation USERAKE = new Animation(2273); private final static int PATCH_CLEAN_ALLOTMENT = 8132; private final static int PATCH_CLEAN_HERB = 8132; private static boolean patchCleaned = false; private final static int[] VALID_SEEDS = {5291, 5292, 5293, 5294, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5295, 5304}; private final static int[] HERBS = {199, 201, 203, 205, 207, 209, 211, 213, 3051, 215, 2485, 217, 3049, 219}; private final static int[] SEED_PLANT_EXP = {10, 15, 30, 35, 70, 75, 150, 155, 310, 315, 630, 635, 1270, 1275}; private final static int[] HERB_EXPS = {220, 330, 660, 770, 1540, 1650, 3300, 3410, 6820, 6930, 13860, 13970, 27940, 28050}; private final static int[] FARMING_REQS = {1, 7, 14, 22, 28, 35, 43, 49, 56, 64, 70, 77, 85, 91}; private static Player player; static int seedId; static int herbId; static int exp; static int slot; private static boolean seedPlanted = false; private static boolean seedWatered = false; private static boolean patchRaked = false; private final static int PATCH_HERBS = 8143; private final static int PATCH_CLEAN = 8132; private final static int PATCH_WEEDS = 8389; private final static int PATCH_FLOWER = 7848; /// The unraked flower patch. private final static int PATCH_FLOWERS = 7840; ///the raked flower patch. private final static int WATER_CAN = 5340; private final static int SEED_DIBBER = 5343; private final static int SPADE = 952; public Farming(Player player) { this.player = player; } public static void startRake(Player player) { if (player.getInventory().containsItem(RAKE, 1)) { player.lock(4); // the 1000 is the xp once you rake the patch player.getSkills().addXp(Skills.FARMING, 1000); player.getPackets().sendGameMessage("You rake the weed."); player.getInventory().addItem(6055, 1); player.setNextAnimation(USERAKE); //calling cleanPatch() so it can spawn the object cleanPatch(); //refreshs the player's inventory so you will get the item player.getInventory().refresh(); } else { player.getPackets().sendGameMessage("You must have rake, buy one at general store."); } } public static void cleanPatch() { if (!patchCleaned) { patchCleaned = true; //Alright so this will be spawning a object at a location //it will spawn at this location (click on the link to see the picture). // [url]http://gyazo.com/5a34718779584ccecae9b4b0a19c9cc1[/url] //where is says you are here World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3308, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3308, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3307, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3307, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3306, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3306, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3305, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3305, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3055, 3304, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3056, 3304, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3057, 3304, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3304, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3304, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3055, 3303, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3056, 3303, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3057, 3303, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3058, 3303, 0), patchCleaned); World.spawnObject(new WorldObject(PATCH_CLEAN_ALLOTMENT, 10, 0, 3059, 3303, 0), patchCleaned); } else { player.getPackets().sendGameMessage("You have already cleaned the patch."); } }
  6. So that asshole 'Hope', hacked into Xlite's dedicated server, and stole our files. He then gave out these files to people on his friend's list on skype. Demonscape, then added two things that took us HOURS to code, and refuses to take them off because they're too fucking stupid to code it themselves. The two things they added, were Farming, and Decanting. Here's farming for you. I have a feeling our friend who coded decanting will be releasing decanting later as well. So here you go. EDIT: Ungrateful fucks. You will have to do the rest.
  7. For those who have, how have you managed to handle harvesting the (13) different herbs when there is only one herb object in the cache? (Without cache editing) What method of identification did you use? For example, a player plants two different herbs. How would I tell them apart without adding too many troublesome variables? I could use a herb identifier variable that is set upon planting, but how would I have it stay the same without changing when the second herb is planted and without the use of an extra variable/multidimensional array?
  8. Farming.java: [code]package server.model.players.skills; import server.model.players.Client; import server.model.players.Patch; import server.util.Misc; /** * Farming.java * * @author Flow * **/ public class Farming { private Client c; private enum Farming_Data { GUAM(5291, 199, 11, 13, 1), MARRENTIL(5292, 201, 14, 15, 14), TARROMIN(5293, 203, 16, 18, 19), HARRALANDER(5294, 205, 22, 24, 26), RANARR(5295, 207, 27, 31, 32), TOADFLAX(5296, 3049, 34, 39, 38), IRIT(5297, 209, 43, 49, 44), AVANTOE(5298, 211, 55, 62, 50), KWUARM(5299, 213, 69, 78, 56), SNAPDRAGON(5300, 3051, 88, 99, 62), CADANTINE(5301, 215, 107, 120, 67), LANTADYME(5302, 2485, 135, 152, 73), DWARF_WEED(5303, 217, 171, 192, 79), TORSTOL(5304, 219, 200, 225, 85); private int seedId, produce, plantXP, herbXP, req; private Farming_Data(int seedId, int produce, int plantXP, int herbXP, int req) { this.seedId = seedId; this.produce = produce; this.plantXP = plantXP; this.herbXP = herbXP; this.req = req; } public int getSeed() { return seedId; } public int getReq() { return req; } public int getProduce() { return produce; } public int getPlantXP() { return plantXP; } public int getHerbXP() { return herbXP; } } private Patch[] p = new Patch[5]; public Farming(Client c) { this.c = c; } public int getNearestFreePatch() { for (int i = 0; i < p.length; i++) { if (p[i] == null) { return i; } } return -1; } public void setPatchInfo(int produce, int xp) { int nearest = getNearestFreePatch(); if (getNearestFreePatch() > -1) { if (c.getPA().itemUsedInRegion(2809, 2812, 3335, 3338)) { //Entrana patch p[nearest] = new Patch(2809, 2812, 3335, 3338, new int[] {2812, 3338}, produce, Misc.random(12), xp); } } } public static Farming_Data forSeed(int seed) { for (Farming_Data fd : Farming_Data.values()) { if (fd.getSeed() == seed) { return fd; } } return null; } public void checkItemOnObject(int itemId) { Farming_Data fd = forSeed(itemId); if (fd != null) { handleFarming(fd); } return; } private void handleFarming(Farming_Data f) { if (c.playerLevel[c.playerFarming] >= f.getReq()) { if (c.getItems().playerHasItem(f.getSeed(), 1)) { c.getItems().deleteItem(f.getSeed(), c.getItems().getItemSlot(f.getSeed()), 1); c.getPA().addSkillXP(f.getPlantXP(), c.playerFarming); c.getPA().refreshSkill(c.playerFarming); setPatchInfo(f.getProduce(), f.getHerbXP()); updatePatch(); c.sendMessage("You plant the seed."); } } else { c.sendMessage("You need a farming level of "+f.getReq()+" to plant this seed."); } } public int getPatch() { for (int i = 0; i < p.length; i++) { if (c.getPA().itemUsedInRegion(p[i].minX, p[i].maxX, p[i].minY, p[i].maxY)) { return i; } } return -1; } public void updatePatch() { if (p != null) { if (getPatch() > -1) { if (p[getPatch()].getProduceAmount() > 0) { c.getPA().handleObjectRegion(-1, p[getPatch()].minX, p[getPatch()].minY, p[getPatch()].maxX, p[getPatch()].maxY); c.getPA().object(8143, p[getPatch()].produceSpot[0], p[getPatch()].produceSpot[1], -1, 10); } else { c.getPA().handleObjectRegion(8174, p[getPatch()].getMinX(), p[getPatch()].getMinY(), p[getPatch()].getMaxX(), p[getPatch()].getMaxY()); resetVariables(p[getPatch()]); } } } } public void pickHerb() { if (p[getPatch()].getProduceAmount() > 0) { if (c.getItems().freeSlots() > 0) { c.startAnimation(2273); c.getItems().addItem(p[getPatch()].getProduce(), 1); c.getPA().addSkillXP(p[getPatch()].getPickXP(), c.playerFarming); p[getPatch()].produceAmount--; c.sendMessage("You pick a herb."); updatePatch(); c.getPA().resetAnimation(); } else { c.sendMessage("You do not have enough inventory space to pick this herb."); } } } public void resetVariables(Patch p) { p.minX = -1; p.maxX = -1; p.minY = -1; p.maxY = -1; p.produce = -1; p.produceAmount = -1; p.produceSpot = new int[]{-1, -1}; p.pickXP = -1; p = null; } }[/code] Patch.java: (server.model.players) [code]package server.model.players; public class Patch { public int minX = -1, maxX = -1, minY = -1, maxY = -1, produce = -1, produceAmount = -1, pickXP = -1; public int[] produceSpot = new int[2]; public Patch(int minX, int maxX, int minY, int maxY, int[] produceSpot, int produce, int produceAmount, int pickXP) { this.minX = minX; this.maxX = maxX; this.minY = minY; this.maxY = maxY; this.produceSpot = produceSpot; this.produce = produce; this.produceAmount = produceAmount; this.pickXP = pickXP; } public int getMinX() { return minX; } public int getMaxX() { return maxX; } public int getMinY() { return minY; } public int getMaxY() { return maxY; } public int getProduceSpot(int i) { return produceSpot[i]; } public int getProduce() { return produce; } public int getProduceAmount() { return produceAmount; } public int getPickXP() { return pickXP; } }[/code] Add these two methods to playerassistant.java: [code] public void handleObjectRegion(int objectId, int minX, int minY, int maxX, int maxY) { for (int i = minX; i < maxX+1; i++) { for (int j = minY; j < maxY+1; j++) { c.getPA().object(objectId, i, j, -1, 10); } } } public boolean itemUsedInRegion(int minX, int maxX, int minY, int maxY) { return (c.objectX >= minX && c.objectX <= maxX) && (c.objectY >= minY && c.objectY <= maxY); }[/code] ItemOnObject.java: Add [code] c.objectX = objectX; c.objectY = objectY;[/code] if you didn't already have that. UseItem.java: Add [code] case 8151: case 8389: case 8174: c.getFarming().checkItemOnObject(itemId); break;[/code] If you didn't already have that. Good luck. Credits: phl0w
  9. [IMG]http://i.imgur.com/13kqZ.gif[/IMG] [IMG]http://tldr.me/157mwlh.gif[/IMG] Here is some work I did for my current development employer. Supports all herbs, all allotments, but I never got around to finishing the database for the other patches although the support exists. Timers are active, along with watering, diseasing, and adding compost to the patch. Since the base wasn't mine, and was PI, it was not as extensive as I wanted to be but was fun creating.
  10. [CENTER][IMG]http://www.dakotascape.com/open/images/welcome.png[/IMG] [IMG]http://dakotascape.com/images/dakotascape.png[/IMG][/CENTER] [SIZE="2"][FONT="Century Gothic"][CENTER]A [SIZE="3"][COLOR="Red"]server[/COLOR][/SIZE] that has been in development for [SIZE="3"][COLOR="DarkOrange"]4 years of coding[/COLOR][/SIZE]. A server that has [SIZE="3"][COLOR="MediumTurquoise"]original coding.[/COLOR][/SIZE] (Not from tutorials or ripped). An [SIZE="3"][COLOR="DarkGreen"]expert in Java coding[/COLOR][/SIZE] has officially released [SIZE="4"][COLOR="DarkRed"]DakotaScape Perfection[/COLOR][/SIZE]. Perfection has been the goal since day 1 of Development in August 2008. DakotaScape was created from the original release of [SIZE="4"][COLOR="Orange"]Palidino76[/COLOR][/SIZE], the server had only logging in, npc/item spawning (No combat), not even object training. DakotaScape has been basically an '[I]Underground[/I]' Project, meaning there has been virtually no news about this server. Except, [SIZE="4"][COLOR="DarkOrange"]Dakota[/COLOR][/SIZE] has release many tutorials including; The popular Summoning release, the first ever party room, agility courses, and has helped with the community development of 508's. The DakotaScape Staff and I are very excited to announce the release of DakotaScape Perfection. DakotaScape has been in a closed '[SIZE="3"][COLOR="DarkSlateBlue"]Beta[/COLOR][/SIZE]' Mode for[COLOR="Red"][SIZE="4"] 6 months[/SIZE][/COLOR] spotting out all errors, glitches, and crashes, Now we are happy to say that we know of [SIZE="4"][COLOR="DarkOrange"]NO crashes[/COLOR][/SIZE] in the game. [SIZE="4"][COLOR="Olive"]Week one[/COLOR][/SIZE] of the Release of DakotaScape will be a type of '[COLOR="DarkRed"][SIZE="3"]post Beta[/SIZE] [/COLOR]' you will [COLOR="Blue"][SIZE="4"]keep all[/SIZE][/COLOR] your stats you earn during the time spent this week. Every player will start out as level 3, though there will be a number of Veterans throughout the game (from the early release from October 2008 - september 2009). Discontinued Items such as a Partyhat, cracker, santa hats, etc... Are the only items carried over from the 2008-2009 version of the game. Veterans will also recieve a Scythe and Bunny ears, to represent their dedication to the game. Note that all skills are nearly perfected, skills are NOT half assed. XP rate is 15x RS speed (default for all skills), you will have options to change it to RS speed or 15x, while Admin may input any rate for you. (Most likely not to happen.) [COLOR="Orange"][SIZE="3"]Here is an Advertisement created by Dakota (Owner of DakotaScape):[/SIZE][/COLOR] [url=http://www.youtube.com/watch?v=TrSA8HvZweU]DakotaScape Perfection Like You've Never Seen - YouTube[/url] [COLOR="Red"]NOTE: This is NOT a PK server, but has perfect Melee PVP BUT range & mage are basic.[/COLOR] [COLOR="DarkOrange"][SIZE="4"]Server Features:[/SIZE][/COLOR] Player vs. NPC combat NPC vs. NPC combat - (only at Godwars ATM) Player vs. Player combat - (Melee perfected, mage + range are NOT) NPC Object rendering (Clipping) Almost all F2P Npc's added. (Many P2P area's are fully added as well.) Website Hiscores (does not lag the game) Almost perfect Grand Exchange (Few minor things to tweak out.) Many Dungeons fully added with all NPC's & agility shortcuts Every Code is ORIGINAL created by Dakota Almost every Guild - (Cooking, Crafting, champions, etc...) All Skill Master's - (The NPC where you get your capes) All F2P Quest's and 10+ Member Quest's - (More detailed & more Quest's Coming) Get Quest cape from Wise Old Man - (Will need all Quest's Completed & will not be able to wear if a new quest is added, until the new Quest is completed.) ABSOLUTELY FREE - No Donator Status's and bonus Daily Updates - (Soon to be perfected, releasing now because may take another year) Many Never Before seen Features for 508 servers - (or any server) Random Events - (Every random will be coming) Every skill is nearly 100% perfected! [COLOR="Red"]HD[/COLOR] & [COLOR="Blue"]LD[/COLOR] [SIZE="4"][B]Webclient's[/B][/SIZE] [SIZE="5"][COLOR="DarkRed"]Those are NOT all the Features the rest are for you to find out.[/COLOR][/SIZE] NOTE: Every skill is either Perfected or Near Perfection. [SIZE="4"][COLOR="DarkOrange"]Some Pictures:[/COLOR][/SIZE] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/1.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/689a8d55.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/2.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/3.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/4.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/5.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/6.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/7.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/8.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/9.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/10.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/11.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/12.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/13.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/14.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/15.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/16.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/17.png[/IMG] [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/18.png[/IMG] And a Full screen With the Grand Exchange. [IMG]http://i366.photobucket.com/albums/oo106/DakotaScape/21.png[/IMG] [SIZE="4"][COLOR="Cyan"]OFFICIAL WEBSITE:[/COLOR][/SIZE] [url=http://DakotaScape.com]DakotaScape - Perfection You've Never Seen[/url] The Client is on the site, Only use LD Webclient if you Don't have Titana Cache, at the moment. [B][COLOR="orange"]Downloadable Client:[/COLOR][/B] [URL="https://dl.dropbox.com/u/20470119/DakotaScape%20Perfection.zip"]DakotaScape Perfection - LD client[/URL] NOTE: This is the FIRST Official release, there may not be anyone online when you first arrive, just be patient. ALSO - (Hiscores database with previous records will be erased after shortly after release) [/CENTER][/FONT][/SIZE]
  11. Been going through farming doing up everything, making plants grow by being watered, etc. Skipped over the compost thing for now, but was enjoying a great deal of success......until I hit the herbs. The herbs all share a singular plant. And I cannot for the life of me figure out how to make the one plant give the proper herbs. Everything, literally everything else from flowers to bushes, trees, allotment seeds, and fruit trees are working perfectly. Just this one thing I have been stumped on for a couple of days. Any tutorial on it has either only worked for a singular herb, still made it pick each type, or just not been there at all. Some assistance if anyone can? I know farming is not a big skill in RSPS, but I am one of those who love EVERYTHING working lol.
  12. Allotments Fally + Catherby config 504 Fally NW is just value SE is (value << 8) << 16 NW + SE is ((se << 8) + nw) << 16 Catherby S is value << 8 N is (1 << 8) + value N + S is (value << 8) + value
  13. I need something to stop pk points farming, like, dont get pk points from same ip or double login, please help :L
  14. Okay I haven't used rsps in a few years now and I have totally forgotten how to do some stuff (especially since I am new to PI) I need to add the GFX/Emote for Farming and Herblore (probably a few more skills aswell) but just those two. I am doing ::gfx in my server and I need 2273 for farming and it will give me some other gfx. also is there a command out there for ::emote, i cant find one and my server only has ::gfx (if there is a such thing, like i said i cant find any of my previous server files and i cant remember too much just basics) Any answers will be appreciated. Thanks, -Pwner
  15. Minigame and everything works fine, it came pre-coded into PDF, and had same problem, i then removed, and put back in, still problem. How can it be solved? - I guess you can tell what the problem is.. :L This thing over the interface, and missing seeds? o.O Problem: [IMG]http://img651.imageshack.us/img651/4996/2bda6ead4c4f426ea6de008.png[/IMG]
×