Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
 public boolean doaction(
     Client c,
     int toadd,
     int toremove,
     int toremove2,
     int timestomake,
     int NOTUSED,
     int NOTUSED2,
     int xp) {
   int maketimes = timestomake;
   c.getPA().closeAllWindows();
   if (c.getItems().playerHasItem(toremove, toremove2)) {
     c.startAnimation(898);
     if (maketimes > 1 && c.getItems().playerHasItem(toremove, toremove2 * 2)) {
       c.sendMessage("You make some " + c.getItems().getItemName(toadd) + "s.");
     } else {
       c.sendMessage("You make a " + c.getItems().getItemName(toadd) + ".");
     }
     while (maketimes > 0) {
       if (c.getItems().playerHasItem(toremove, toremove2)) {
         c.getItems().deleteItem2(toremove, toremove2);
         if (c.getItems().getItemName(toadd).contains("bolt")) {
           c.getItems().addItem(toadd, 10);
         } else if (c.getItems().getItemName(toadd).contains("nail")) {
           c.getItems().addItem(toadd, 15);
         } else if (c.getItems().getItemName(toadd).contains("arrow")) {
           c.getItems().addItem(toadd, 15);
         } else if (c.getItems().getItemName(toadd).contains("knife")) {
           c.getItems().addItem(toadd, 5);
         } else if (c.getItems().getItemName(toadd).contains("cannon")) {
           c.getItems().addItem(toadd, 4);
         } else {
           c.getItems().addItem(toadd, 1);
         }
         c.getPA().addSkillXP(xp, 13);
         c.getPA().refreshSkill(13);
         maketimes--;
       } else {
         break;
       }
     }
   } else {
     c.sendMessage("You don't have enough bars to make this item!");
     c.getPA().closeAllWindows();
     return false;
   }
   return true;
 }
Ejemplo n.º 3
0
 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();
   }
 }
Ejemplo n.º 4
0
 public void cutGem(int id) {
   GemCrafting gem = GemCrafting.forId(id);
   if (gem == null) {
     return;
   }
   if (c.getItems().playerHasItem(gem.getUncut(), 1)) {
     if (c.playerLevel[c.playerCrafting] >= gem.getReq()) {
       c.getItems().deleteItem(gem.getUncut(), 1);
       c.sendMessage("You carefully cut the gem.");
       c.getItems().addItem(gem.getCut(), 1);
       c.getPA().addSkillXP(gem.getXP(), c.playerCrafting);
       c.startAnimation(gem.getAnim());
     } else {
       c.sendMessage("You need a crafting level of " + gem.getReq() + " to cut this gem.");
     }
   }
 }
Ejemplo n.º 5
0
 public void craftLeather(int id) {
   LeatherCrafting lea = LeatherCrafting.forId(id);
   if (lea == null) {
     return;
   }
   if (c.playerLevel[c.playerCrafting] >= lea.getReqLevel()) {
     if (c.getItems().playerHasItem(lea.getLeather(), lea.getReqAmt())) {
       c.startAnimation(1249);
       c.getItems().deleteItem(lea.getLeather(), lea.getReqAmt());
       c.getItems().addItem(lea.getOutcome(), 1);
       c.getPA().addSkillXP(lea.getXP(), c.playerCrafting);
       resetCrafting();
     } else {
       c.sendMessage("You do not have enough items to craft this item.");
     }
   } else {
     c.sendMessage("You need a crafting level of " + lea.getReqLevel() + " to craft this item.");
   }
   c.getPA().removeAllWindows();
 }
Ejemplo n.º 6
0
 public void drinkMagicPotion(int itemId, int replaceItem, int slot, int stat, boolean sup) {
   c.startAnimation(829);
   c.playerItems[slot] = replaceItem + 1;
   c.getItems().resetItems(3214);
   enchanceMagic(stat, sup);
 }
Ejemplo n.º 7
0
 public void drinkAntiPoison(int itemId, int replaceItem, int slot, long delay) {
   c.startAnimation(829);
   c.playerItems[slot] = replaceItem + 1;
   c.getItems().resetItems(3214);
   curePoison(delay);
 }