public void doTheBrew(int itemId, int replaceItem, int slot) { if (c.duelRule[6]) { c.sendMessage("You may not eat in this duel."); return; } c.startAnimation(829); c.playerItems[slot] = replaceItem + 1; c.getItems().resetItems(3214); int[] toDecrease = {0, 2, 4, 6}; for (int tD : toDecrease) { c.playerLevel[tD] -= getBrewStat(tD, .10); if (c.playerLevel[tD] < 0) { c.playerLevel[tD] = 1; } c.getPA().refreshSkill(tD); c.getPA().setSkillLevel(tD, c.playerLevel[tD], c.playerXP[tD]); } c.playerLevel[1] += getBrewStat(1, .20); if (c.playerLevel[1] > c.getLevelForXP(c.playerXP[1]) * 1.2 + 1) { c.playerLevel[1] = (int) (c.getLevelForXP(c.playerXP[1]) * 1.2); } c.getPA().refreshSkill(1); c.playerLevel[3] += getBrewStat(3, .15); if (c.playerLevel[3] > c.getLevelForXP(c.playerXP[3]) * 1.17 + 1) { c.playerLevel[3] = (int) (c.getLevelForXP(c.playerXP[3]) * 1.17); } c.getPA().refreshSkill(3); }
public int getBoostedStat(int skill, boolean sup) { int increaseBy = 0; if (sup) { increaseBy = (int) (c.getLevelForXP(c.playerXP[skill]) * .20); } else { increaseBy = (int) (c.getLevelForXP(c.playerXP[skill]) * .13) + 1; } if (c.playerLevel[skill] + increaseBy > c.getLevelForXP(c.playerXP[skill]) + increaseBy + 1) { return c.getLevelForXP(c.playerXP[skill]) + increaseBy - c.playerLevel[skill]; } return increaseBy; }
public void restoreStats() { for (int j = 0; j <= 6; j++) { if (j == 5 || j == 3) { continue; } if (c.playerLevel[j] < c.getLevelForXP(c.playerXP[j])) { c.playerLevel[j] += c.getLevelForXP(c.playerXP[j]) * .33; if (c.playerLevel[j] > c.getLevelForXP(c.playerXP[j])) { c.playerLevel[j] = c.getLevelForXP(c.playerXP[j]); } c.getPA().refreshSkill(j); c.getPA().setSkillLevel(j, c.playerLevel[j], c.playerXP[j]); } } }
public void drinkPrayerPot(int itemId, int replaceItem, int slot, boolean rest) { c.startAnimation(829); c.playerItems[slot] = replaceItem + 1; c.getItems().resetItems(3214); c.playerLevel[5] += c.getLevelForXP(c.playerXP[5]) * .33; if (rest) { c.playerLevel[5] += 1; } if (c.playerLevel[5] > c.getLevelForXP(c.playerXP[5])) { c.playerLevel[5] = c.getLevelForXP(c.playerXP[5]); } c.getPA().refreshSkill(5); if (rest) { restoreStats(); } }
public int getBrewStat(int skill, double amount) { return (int) (c.getLevelForXP(c.playerXP[skill]) * amount); }