mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
Fixup dropping items
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package ParaScript.data;
|
package ParaScript.data;
|
||||||
|
|
||||||
import ParaScript.DesktopTray;
|
import ParaScript.DesktopTray;
|
||||||
|
import ParaScript.Methods;
|
||||||
import ParaScript.data.variables.*;
|
import ParaScript.data.variables.*;
|
||||||
import org.rev317.min.api.methods.Skill;
|
import org.rev317.min.api.methods.Skill;
|
||||||
import org.rev317.min.api.wrappers.Tile;
|
import org.rev317.min.api.wrappers.Tile;
|
||||||
@@ -177,7 +178,8 @@ public class Variables {
|
|||||||
case "Woodcutting":
|
case "Woodcutting":
|
||||||
return new int[]{woodcutting_tree_selected.getItemID()};
|
return new int[]{woodcutting_tree_selected.getItemID()};
|
||||||
case "Mining":
|
case "Mining":
|
||||||
return mining_rock_selected.getItemID();
|
// Include the gems array as mining will sometimes drop gems
|
||||||
|
return Methods.combineIntArrays(mining_rock_selected.getItemID(), Rocks.GEM.getItemID());
|
||||||
case "Fishing":
|
case "Fishing":
|
||||||
return fishing_spot_selected.getItemIDs();
|
return fishing_spot_selected.getItemIDs();
|
||||||
case "Attack":
|
case "Attack":
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public enum Rocks {
|
|||||||
public int x = 0;
|
public int x = 0;
|
||||||
public int y = 0;
|
public int y = 0;
|
||||||
|
|
||||||
Rocks(final String name, final int[] objectId, final int levelReq, final int xp, final int mineTimer, final int respawnTimer, final int... oreIds) {
|
Rocks(final String name, final int[] objectId, final int levelReq, final int xp, final int mineTimer, final int respawnTimer, final int[] oreIds) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.objectId = objectId;
|
this.objectId = objectId;
|
||||||
this.levelReq = levelReq;
|
this.levelReq = levelReq;
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public enum Trees {
|
public enum Trees {
|
||||||
NORMAL("Normal", new int[]{1276, 1277, 1278, 1279, 1280}, 1512),
|
NORMAL("Normal", new int[]{1276, 1277, 1278, 1279, 1280}, 1511),
|
||||||
OAK("Oak", new int[]{1281}, 1522),
|
OAK("Oak", new int[]{1281}, 1521),
|
||||||
WILLOW ("Willow", new int[]{1308, 5551, 5552, 5553}, 1520),
|
WILLOW ("Willow", new int[]{1308, 5551, 5552, 5553}, 1519),
|
||||||
MAPLE("Maple", new int[]{1307}, 1518),
|
MAPLE("Maple", new int[]{1307}, 1517),
|
||||||
YEW("Yew", new int[]{1309}, 1516),
|
YEW("Yew", new int[]{1309}, 1515),
|
||||||
MAGIC("Magic", new int[]{1306}, 1514);
|
MAGIC("Magic", new int[]{1306}, 1513);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private int[] ids;
|
private int[] ids;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class Drop implements Strategy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
items = Inventory.getItems(Variables.getItemIDs());
|
items = Inventory.getItems(inventoryItemIDs(Variables.getItemIDs()));
|
||||||
return Variables.running
|
return Variables.running
|
||||||
&& Game.isLoggedIn()
|
&& Game.isLoggedIn()
|
||||||
&& Variables.shouldDropItems()
|
&& Variables.shouldDropItems()
|
||||||
@@ -29,4 +29,12 @@ public class Drop implements Strategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return the item id + 1 (odd way inventory items are handled)
|
||||||
|
public int[] inventoryItemIDs(int[] itemIDs) {
|
||||||
|
for(int i = 0; i < itemIDs.length; i++) {
|
||||||
|
++itemIDs[i];
|
||||||
|
}
|
||||||
|
return itemIDs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user