import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class OHDHerblaw extends Script
{
int Herb;
int Identified = 0;
int Unfinished;
int Ingrediant;
int potsMade;
int Vials = 464;
int[] POTARRAY = { 222, 474, 477, 480, 483, 486, 489, 492, 495, 498, 566, 569, 570 };
int[] UNIDARRAY = new int[0];
int[] IDARRAY = new int[0];
boolean onlyId = false;
boolean idHerbs = false;
boolean isMixing = false;
boolean unfinishedOnly = false;
public OHDHerblaw(Extension paramExtension) { super(paramExtension); }
public void init(String paramString) {
String[] arrayOfString = paramString.trim().replaceAll(" ", "").split(",");
if (!arrayOfString[0].equals("")) {
this.Herb = Integer.parseInt(arrayOfString[0]);
if (this.Herb <= 443) {
if ((this.Herb == 165) || ((this.Herb >= 435) && (this.Herb <= 443))) {
this.idHerbs = true;
this.unfinishedOnly = false;
if (this.Herb == 165) {
this.Identified = 444;
this.Unfinished = 454;
}
else if (this.Herb > 165) {
this.Identified = (this.Herb + 10);
this.Unfinished = (this.Herb + 20);
}
}
}
else if (this.Herb >= 444) {
if ((this.Herb >= 444) && (this.Herb <= 453)) {
this.Herb -= 10;
this.Identified = (this.Herb + 10);
this.Unfinished = (this.Herb + 20);
this.idHerbs = false;
this.unfinishedOnly = false;
}
else if ((this.Herb >= 454) && (this.Herb <= 463)) {
this.Herb -= 20;
this.Identified = (this.Herb + 10);
this.Unfinished = (this.Herb + 20);
this.idHerbs = false;
this.unfinishedOnly = true;
}
}
else {
System.out.println("That's is not a valid Herb Id...");
stopScript();
}
}
if (!arrayOfString[1].equals("")) {
this.Ingrediant = Integer.parseInt(arrayOfString[1]);
if ((this.Ingrediant == 270) || (this.Ingrediant == 473) || (this.Ingrediant == 220) || (this.Ingrediant == 219) || (this.Ingrediant == 471) || (this.Ingrediant == 469) || (this.Ingrediant == 472) || (this.Ingrediant == 501)) {
this.isMixing = true;
}
else {
System.out.println("No ingredient selected. We will not be making full potions...");
this.Ingrediant = 0;
this.isMixing = false;
}
}
if ((this.unfinishedOnly) && (!this.isMixing)) {
System.out.println("Not possible, please re-check script setup...");
stopScript();
}
}
public int main() {
if (getFatigue() >= 90) {
useSleepingBag();
return random(800, 1000);
}
if (!this.onlyId)
{
int[] arrayOfInt;
label417:
if (this.isMixing)
{
if (this.idHerbs) {
if (getInventoryCount(new int[] { this.Herb }) > 0) {
useItem(getInventoryIndex(new int[] { this.Herb }));
return random(200, 350);
}
}
if (getInventoryCount(new int[] { this.Identified }) > 0) if (getInventoryCount(new int[] { this.Vials }) > 0) if (getInventoryCount(new int[] { this.Herb }) == 0) {
useItemWithItem(getInventoryIndex(new int[] { this.Identified }), getInventoryIndex(new int[] { this.Vials }));
return random(200, 350);
}
if (getInventoryCount(new int[] { this.Ingrediant }) > 0) if (getInventoryCount(new int[] { this.Unfinished }) > 0) {
useItemWithItem(getInventoryIndex(new int[] { this.Ingrediant }), getInventoryIndex(new int[] { this.Unfinished }));
return random(500, 600);
}
if (getInventoryCount(new int[] { this.Herb }) == 0) if (getInventoryCount(new int[] { this.Unfinished }) == 0) if (getInventoryCount(new int[] { this.Identified }) == 0) break label417; if (getInventoryCount(new int[] { this.Vials }) != 0) if (getInventoryCount(new int[] { this.Identified }) != 0) { if (getInventoryCount(new int[] { this.Vials }) != 0) if (getInventoryCount(new int[] { this.Identified }) != 0) break label1084; if (getInventoryCount(new int[] { this.Unfinished }) != 0)
break label1084; }
if (isQuestMenu()) {
answer(0);
return random(2000, 3000);
}
if (isBanking())
{
int i;
if (this.unfinishedOnly) {
if (getInventoryCount(new int[] { this.Ingrediant }) != 0) { if (getInventoryCount(new int[] { this.Unfinished }) != 0);
} else {
for (i = 0; i < this.POTARRAY.length; i++) {
if (getInventoryCount(new int[] { this.POTARRAY[i] }) > 0) {
deposit(this.POTARRAY[i], getInventoryCount(new int[] { this.POTARRAY[i] }));
return random(1250, 1500);
}
}
}
if (getInventoryCount(new int[] { this.Unfinished }) == 0) {
withdraw(this.Unfinished, 14);
return random(1500, 2000);
}
if (getInventoryCount(new int[] { this.Ingrediant }) == 0) if (getInventoryCount(new int[] { this.Unfinished }) > 0) {
withdraw(this.Identified, getInventoryCount(new int[] { this.Unfinished }));
return random(1500, 2000);
}
closeBank();
return random(200, 300);
}
if (!this.unfinishedOnly)
{
if (getInventoryCount(new int[] { this.Ingrediant }) != 0) { if (getInventoryCount(new int[] { this.Unfinished }) != 0);
} else {
for (i = 0; i < this.POTARRAY.length; i++) {
if (getInventoryCount(new int[] { this.POTARRAY[i] }) > 0) {
deposit(this.POTARRAY[i], getInventoryCount(new int[] { this.POTARRAY[i] }));
return random(1250, 1500);
}
}
}
if (getInventoryCount(new int[] { this.Unfinished }) > 0) {
withdraw(this.Ingrediant, getInventoryCount(new int[] { this.Unfinished }));
closeBank();
return random(2000, 3000);
}
if (getInventoryCount(new int[] { this.Vials }) == 0) {
withdraw(this.Vials, 14);
return random(1000, 1500);
}
if (getInventoryCount(new int[] { this.Herb }) == 0) if (getInventoryCount(new int[] { this.Unfinished }) == 0) if ((getInventoryCount(new int[] { this.Identified }) == 0) && (this.idHerbs)) {
withdraw(this.Herb, 14);
return random(2000, 3000);
}
if (getInventoryCount(new int[] { this.Identified }) == 0) {
withdraw(this.Identified, 14);
return random(1000, 1500);
}
closeBank();
return random(1000, 1500);
}
}
arrayOfInt = getNpcByIdNotTalk(this.BANKERS);
if ((arrayOfInt[0] != -1) && (!isBanking()) && (!isQuestMenu())) if (getInventoryCount(new int[] { this.Ingrediant }) == 0) {
talkToNpc(arrayOfInt[0]);
return random(3250, 3500);
}
}
label1084: if (!this.isMixing)
{
if (this.idHerbs) {
if (getInventoryCount(new int[] { this.Herb }) > 0) {
useItem(getInventoryIndex(new int[] { this.Herb }));
return random(200, 350);
}
}
if (getInventoryCount(new int[] { this.Identified }) > 0) if (getInventoryCount(new int[] { this.Vials }) > 0) if (getInventoryCount(new int[] { this.Herb }) == 0) {
useItemWithItem(getInventoryIndex(new int[] { this.Identified }), getInventoryIndex(new int[] { this.Vials }));
return random(200, 350);
}
if (getInventoryCount(new int[] { this.Herb }) == 0) if (getInventoryCount(new int[] { this.Unfinished }) == 0) if (getInventoryCount(new int[] { this.Vials }) == 0) if (getInventoryCount(new int[] { this.Identified }) == 0)
break label1391;
if (getInventoryCount(new int[] { this.Vials }) != 0) if (getInventoryCount(new int[] { this.Identified }) != 0) { if (getInventoryCount(new int[] { this.Vials }) != 0) if (getInventoryCount(new int[] { this.Identified }) != 0) break label1706; if (getInventoryCount(new int[] { this.Unfinished }) != 0)
break label1706; }
label1391: if (isQuestMenu()) {
answer(0);
return random(2000, 3000);
}
if (isBanking()) {
if (getInventoryCount(new int[] { this.Herb }) == 0) if (getInventoryCount(new int[] { this.Unfinished }) == 0) if (getInventoryCount(new int[] { this.Vials }) == 0) if ((getInventoryCount(new int[] { this.Identified }) == 0) && (this.idHerbs)) {
withdraw(this.Herb, 14);
return random(2000, 3000);
}
if (getInventoryCount(new int[] { this.Unfinished }) > 0) {
deposit(this.Unfinished, getInventoryCount(new int[] { this.Unfinished }));
return random(200, 300);
}
if (getInventoryCount(new int[] { this.Vials }) == 0) {
withdraw(this.Vials, 14);
return random(1000, 1500);
}
if (getInventoryCount(new int[] { this.Identified }) == 0) {
withdraw(this.Identified, 14);
return random(1000, 1500);
}
closeBank();
return random(1000, 1500);
}
arrayOfInt = getNpcByIdNotTalk(this.BANKERS);
if ((arrayOfInt[0] != -1) && (!isBanking()) && (!isQuestMenu())) {
talkToNpc(arrayOfInt[0]);
return random(3500, 3750);
}
}
}
label1706: return random(200, 300);
}
}