Its late i haven't checked this to see if it works but it should, i am really tired if anything ill just copy and paste the actual code i use tomorrow, note this is en example as to how you can do it, i wrote in like 3min so it looks ugly lol, i suggest you rewrite it or just wait till tomorrow.
Code:public int helm() { return c.playerEquipment[c.playerHat]; } public int chest() { return c.playerEquipment[c.playerLegs]; } public int legs() { return c.playerEquipment[c.playerChest]; } public int torvaStat(int skill, double amount) { return (int)(c.getLevelForXP(c.playerXP[skill]) * amount); } public double getExtraHeal(int i) { double heal = 0; double[][] HealAmm = {{20135, ammount}, {20143, ammount}, {20139, ammount}}; for(int l = 0; l < HealAmm.length; l++) { if(i == HealAmm[l][0]) { heal = HealAmm[l][1]; } } return heal; } public void eat(int id, int slot) { if (c.duelRule[6]) { c.sendMessage("You may not eat in this duel."); return; } if (System.currentTimeMillis() - c.foodDelay >= 1500 && c.playerLevel[3] > 0) { c.getCombat().resetPlayerAttack(); c.attackTimer += 2; c.startAnimation(829); c.getItems().deleteItem(id,slot,1); FoodToEat f = FoodToEat.food.get(id); double BonusHeal = getExtraHeal(helm()) + getExtraHeal(chest()) + getExtraHeal(legs()); if (c.playerLevel[3] < torvaStat(3, BonusHeal) && c.torva()) { c.playerLevel[3] += f.getHeal(); if (c.playerLevel[3] > torvaStat(3, BonusHeal)); c.playerLevel[3] = torvaStat(3, BonusHeal); } else if (c.playerLevel[3] < c.getLevelForXP(c.playerXP[3]) && !c.torva()) { c.playerLevel[3] += f.getHeal(); if (c.playerLevel[3] > c.getLevelForXP(c.playerXP[3])) c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]); } c.foodDelay = System.currentTimeMillis(); c.getPA().refreshSkill(3); c.sendMessage("You eat the " + f.getName() + "."); } }
Code:public boolean torva() { if (playerEquipment[playerHat] == 20135 || playerEquipment[playerLegs] == 20143 || playerEquipment[playerChest] == 20139 || playerEquipment[playerHat] == 20147 || playerEquipment[playerLegs] == 20151 || playerEquipment[playerChest] == 20155 || playerEquipment[playerHat] == 20159 || playerEquipment[playerLegs] == 20163 || playerEquipment[playerChest] == 20167) { return true; } return false; }



