@Override
  public void processPacket(Client c, int packetType, int packetSize) {
    switch (packetType) {
      case 128:
        int answerPlayer = c.getInStream().readUnsignedWord();
        if (Server.playerHandler.players[answerPlayer] == null) {
          return;
        }
        Client o = (Client) Server.playerHandler.players[answerPlayer];
        if (c.duelStatus != 0 || o.duelStatus != 0) {
          c.sendMessage("You are currently unable to challenge this player.");
          return;
        }
        if (o.duelStatus > 0) {
          c.sendMessage("That player is currently dueling someone else.");
          return;
        }
        if (c.arenas() || c.duelStatus == 5) {
          c.sendMessage("You can't challenge inside the arena!");
          return;
        }
        c.sendMessage("");

        c.getTradeAndDuel().requestDuel(answerPlayer);
        break;
    }
  }
Пример #2
0
 public void lightFire(int slot) {
   if (c.duelStatus >= 5) {
     c.sendMessage("Why am I trying to light a fire in the duel arena?");
     return;
   }
   if (c.playerLevel[c.playerFiremaking] >= level[slot]) {
     if (c.getItems().playerHasItem(590) && c.getItems().playerHasItem(logs[slot])) {
       if (System.currentTimeMillis() - lastLight > DELAY) {
         c.startAnimation(733, 0);
         c.getItems().deleteItem(logs[slot], c.getItems().getItemSlot(logs[slot]), 1);
         c.getPA().addSkillXP(logs[slot] * Config.FIREMAKING_EXPERIENCE, c.playerFiremaking);
         Objects fire = new Objects(2732, c.getX(), c.getY(), 0, -1, 10, 3);
         Objects fire2 = new Objects(592, c.getX(), c.getY(), 0, -1, 10, 60);
         Server.objectHandler.addObject(fire);
         Server.objectHandler.addObject(fire2);
         c.sendMessage("You light the fire.");
         c.getPA().walkTo(-1, 0);
         c.turnPlayerTo(c.getX() + 1, c.getY());
         this.lastLight = System.currentTimeMillis();
         // c.getPA().frame1();
         resetAnim = true;
       }
     }
   }
 }
Пример #3
0
  public void handleOtherShop(int itemID) {
    if (c.myShopId == 18) {
      if (c.pkPoints >= getSpecialItemValue(itemID)) {
        if (c.getItems().freeSlots() > 0) {
          c.pkPoints -= getSpecialItemValue(itemID);
          c.getItems().addItem(itemID, 1);
          c.getItems().resetItems(3823);
        }
      } else {
        c.sendMessage("You do not have enough EXL points to buy this item.");
      }
    }
    if (c.myShopId == 73) {
      if (c.pkPoints >= getSpecialItemValue(itemID)) {
        if (c.getItems().freeSlots() > 0) {
          c.pkPoints -= getSpecialItemValue(itemID);
          c.getItems().addItem(itemID, 1);
          c.getItems().resetItems(3823);
        }
      } else {
        c.sendMessage("You do not have enough EXL points to buy this item.");
      }
    }

    if (c.myShopId == 10) {
      if (c.donorPoints >= getSpecialItemValue(itemID)) {
        if (c.getItems().freeSlots() > 0) {
          c.donorPoints -= getSpecialItemValue(itemID);
          c.getItems().addItem(itemID, 1);
          c.getItems().resetItems(3823);
        }
      } else {
        c.sendMessage("You do not have enough Donator points to buy this item.");
      }
    }
    if (c.myShopId == 74) {
      if (c.pkPoints >= getSpecialItemValue(itemID)) {
        if (c.getItems().freeSlots() > 0) {
          c.pkPoints -= getSpecialItemValue(itemID);
          c.getItems().addItem(itemID, 1);
          c.getItems().resetItems(3823);
        }
      } else {
        c.sendMessage("You do not have enough EXL points to buy this item.");
      }
    }
    if (c.myShopId == 48) {
      if (c.SPoints >= getSpecialItemValue(itemID)) {
        if (c.getItems().freeSlots() > 0) {
          c.SPoints -= getSpecialItemValue(itemID);
          c.getItems().addItem(itemID, 1);
          c.getItems().resetItems(3823);
        }
      } else {
        c.sendMessage("You do not have enough Slayer Points to buy this item.");
      }
    }
  }
Пример #4
0
 public boolean doaction(
     Client c,
     int toadd,
     int toremove,
     int toremove2,
     int timestomake,
     int NOTUSED,
     int NOTUSED2,
     int xp) {
   int maketimes = timestomake;
   c.getPlayerAssistant().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.getPlayerAssistant().addSkillXP(xp * Config.SMITHING_EXPERIENCE, 13);
         c.getPlayerAssistant().refreshSkill(13);
         maketimes--;
       } else {
         break;
       }
     }
   } else {
     c.sendMessage("You don't have enough bars to make this item!");
     return false;
   }
   return true;
 }
Пример #5
0
 private void cleanPatch() {
   if (!patchCleaned) {
     c.getPA().object(PATCH_CLEAN, 2813, 3463, -1, 10);
     patchCleaned = true;
   } else {
     c.sendMessage("You have already cleaned the patch.");
   }
 }
Пример #6
0
 private void waterSeed() {
   if (seedPlanted && !seedWatered) {
     c.startAnimation(2293);
     updateHerbPatch();
     seedWatered = true;
   } else {
     c.sendMessage("You must plant a seed before you can water the patch!");
   }
 }
Пример #7
0
 public void skillBuy(int item) {
   int nn = get99Count();
   if (nn > 1) nn = 1;
   else nn = 0;
   for (int j = 0; j < skillCapes.length; j++) {
     if (skillCapes[j] == item || skillCapes[j] + 1 == item) {
       if (c.getItems().freeSlots() > 1) {
         if (c.getItems().playerHasItem(995, 99000)) {
           if (c.getLevelForXP(c.playerXP[j]) >= 99) {
             c.getItems().deleteItem(995, c.getItems().getItemSlot(995), 99000);
             c.getItems().addItem(skillCapes[j] + nn, 1);
             c.getItems().addItem(skillCapes[j] + 2, 1);
           } else {
             c.sendMessage("You must have 99 in the skill of the cape you're trying to buy.");
           }
         } else {
           c.sendMessage("You need 99k to buy this item.");
         }
       } else {
         c.sendMessage("You must have at least 1 inventory spaces to buy this item.");
       }
     }
     /*if (skillCapes[j][1 + nn] == item) {
     	if (c.getItems().freeSlots() >= 1) {
     		if (c.getItems().playerHasItem(995,99000)) {
     			if (c.getLevelForXP(c.playerXP[j]) >= 99) {
     				c.getItems().deleteItem(995, c.getItems().getItemSlot(995), 99000);
     				c.getItems().addItem(skillCapes[j] + nn,1);
     				c.getItems().addItem(skillCapes[j] + 2,1);
     			} else {
     				c.sendMessage("You must have 99 in the skill of the cape you're trying to buy.");
     			}
     		} else {
     			c.sendMessage("You need 99k to buy this item.");
     		}
     	} else {
     		c.sendMessage("You must have at least 1 inventory spaces to buy this item.");
     	}
     	break;
     }*/
   }
   c.getItems().resetItems(3823);
 }
Пример #8
0
  /** Sell item to shop (Shop Price) */
  public void sellToShopPrice(int removeId, int removeSlot) {
    if (c.myShopId == 7390) {
      c.sendMessage("You choose your price when using POS.");
      return;
    }
    for (int i : Config.ITEM_SELLABLE) {

      if (i == removeId) {
        c.sendMessage("You can't sell " + c.getItems().getItemName(removeId).toLowerCase() + ".");
        return;
      }
    }
    boolean IsIn = false;
    if (Server.shopHandler.ShopSModifier[c.myShopId] > 1) {
      for (int j = 0; j <= Server.shopHandler.ShopItemsStandard[c.myShopId]; j++) {
        if (removeId == (Server.shopHandler.ShopItems[c.myShopId][j] - 1)) {
          IsIn = true;
          break;
        }
      }
    } else {
      IsIn = true;
    }
    if (IsIn == false) {
      c.sendMessage(
          "You can't sell " + c.getItems().getItemName(removeId).toLowerCase() + " to this store.");
    } else {
      int ShopValue = (int) Math.floor(getItemShopValue(removeId, 1, removeSlot));
      String ShopAdd = "";
      if (ShopValue >= 1000 && ShopValue < 1000000) {
        ShopAdd = " (" + (ShopValue / 1000) + "K)";
      } else if (ShopValue >= 1000000) {
        ShopAdd = " (" + (ShopValue / 1000000) + " million)";
      }
      c.sendMessage(
          c.getItems().getItemName(removeId)
              + ": shop will buy for "
              + ShopValue
              + " coins"
              + ShopAdd);
    }
  }
Пример #9
0
  public void startSmelting(int barType) {
    if (canSmelt(barType)) {

      if (hasOres(barType)) {

        this.exp = getExp(barType);
        this.oreId = getOre(barType);
        this.oreId2 = getOre2(barType);
        this.barId = barType;
        c.smeltAmount = c.getItems().getItemAmount(getOre(barType));
        smelt(barType);
      } else {
        c.sendMessage("You do not have the required ores to smelt this.");
        c.getPlayerAssistant().resetVariables();
      }
    } else {
      c.sendMessage("You must have a higher smithing level to smith this.");
      c.getPlayerAssistant().resetVariables();
    }
  }
Пример #10
0
 private void plantSeed(int seedId, int herbId, int exp, int slot) {
   if (c.playerLevel[c.playerFarming] < FARMING_REQS[slot]) {
     c.sendMessage("You require a farming level of " + FARMING_REQS[slot] + " to farm this seed.");
   } else if (!seedPlanted
       && patchRaked
       && c.getItems().playerHasItem(seedId, 1)
       && c.getItems().playerHasItem(SEED_DIBBER, 1)) {
     c.getItems().deleteItem(seedId, c.getItems().getItemSlot(seedId), 1);
     c.getPA().addSkillXP(SEED_PLANT_EXP[slot] * Config.FARMING_EXPERIENCE, c.playerFarming);
     c.startAnimation(2291);
     c.getPA().refreshSkill(c.playerFarming);
     int herbAmount = Misc.random(5) + 3;
     c.farm[0] = herbId;
     c.farm[1] = herbAmount;
     c.sendMessage("You plant your seed. Water it and watch it grow.");
     seedPlanted = true;
   } else {
     c.sendMessage("You need to rake the patch or you've already planted a seed!");
   }
 }
Пример #11
0
 /*updates to herb or weed. the clean patch should be part too but f**k it */
 private void
     rakePatch() { /// step three, once you've planted and watered you can rake the patch clean to
                   // pick your herbs.
   if (!patchRaked && System.currentTimeMillis() - c.waitTime > 2000) {
     c.startAnimation(2273);
     cleanPatch(); // calls the clear patch.
     c.getPA().addSkillXP(getExp() * Config.FARMING_EXPERIENCE, c.playerFarming);
     patchRaked = true;
   } else {
     c.sendMessage("You must plant and water a seed before you can rake here!");
   }
 }
Пример #12
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    int itemId = c.getInStream().readUnsignedWordA();
    c.getInStream().readUnsignedByte();
    c.getInStream().readUnsignedByte();
    int slot = c.getInStream().readUnsignedWordA();
    if (c.arenas()) {
      c.sendMessage("You can't drop items inside the arena!");
      return;
    }
    if (c.playerItemsN[slot] != 0 && itemId != -1 && c.playerItems[slot] == itemId + 1) {
      if (!c.getItems().playerHasItem(itemId, 1, slot)) {
        c.sendMessage("Stop cheating!");
        return;
      }
    }

    boolean droppable = true;
    for (int i : Config.UNDROPPABLE_ITEMS) {
      if (i == itemId) {
        droppable = true;
        break;
      }
    }
    if (c.playerItemsN[slot] != 0 && itemId != -1 && c.playerItems[slot] == itemId + 1) {
      if (droppable) {
        if (c.underAttackBy > 0) {
          if (c.getShops().getItemShopValue(itemId) > 1000) {
            c.sendMessage("You may not drop items worth more than 1000 while in combat.");
            return;
          }
        }
        Server.itemHandler.createGroundItem(
            c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
        c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
      } else {
        c.sendMessage("This items cannot be dropped.");
      }
    }
  }
Пример #13
0
 public void pickHerb() { // / Final step, picks the herbs from the grown herb patch.
   if (c.farm[0] > 0 && c.farm[1] > 0) {
     if (System.currentTimeMillis() - c.waitTime > 2000) {
       if (c.getItems().addItem(c.farm[0], 1)) {
         c.getPA().addSkillXP(getExp() * Config.FARMING_EXPERIENCE, c.playerFarming);
         c.farm[1]--;
         if (c.farm[1] == 0) {
           c.farm[0] = -1;
         }
         c.startAnimation(2286);
         c.sendMessage("You pick a herb.");
         updateHerbPatch(); // finish, lets try this.
       }
     }
   }
 }
Пример #14
0
 public void checkRequirements() {
   for (int j = 0; j < expsAndLevels.length; j++) {
     if (expsAndLevels[j][0] == hideType) {
       if (c.playerLevel[c.playerCrafting] >= expsAndLevels[j][1]) {
         if (c.getItems().playerHasItem(hideType, 1)) {
           c.getPA().closeAllWindows();
           exp = expsAndLevels[j][2];
           index = j;
           craftHides(hideType);
         }
       } else {
         c.sendMessage("You need a crafting level of " + expsAndLevels[j][1] + " to craft this.");
       }
     }
   }
 }
Пример #15
0
 public void checkItemOnObject(int itemId) {
   for (int j = 0; j < VALID_SEEDS.length; j++) {
     if (itemId == VALID_SEEDS[j]) {
       plantSeed(VALID_SEEDS[j], HERBS[j], HERB_EXPS[j], j);
     } // so if you use valid seeds on the patch it does plantSeed, cool.
   }
   if (itemId == WATER_CAN && !seedWatered) {
     waterSeed(); // watering is called
   } else if (itemId == RAKE && !patchRaked) {
     rakePatch(); // raking is called
   } else if (c.getItems().playerHasItem(SEED_DIBBER, 0)) ;
   {
     c.sendMessage(
         "You need a seed dibber to plant seeds."); // if you dont have a seed dibber it gets mad
                                                    // at you.
   }
 }
  public void ExchangeSets(Client c) {

    // Rune
    // Rune Armour Set (Skirt)
    if (c.getItems().playerHasItem(1, 1)) {
      // c.getItems().deleteItem(RuneArmourSetSK,1);
      // c.getItems().addItem(ExchangedRuneArmourSetSK,1);
      // c.sendMessage("You Exchange your Rune Armour Set (SK) For the real items");
    }
    // Rune Armour Set (Legs)
    if (c.getItems().playerHasItem(1, 1)) {
      c.getItems().deleteItem(RuneArmourSetLG);
      c.getItems().deleteItem(13736, 1);
      c.getItems().addItem(13738, 1);
      c.sendMessage("You Exchange your Rune Armour Set (LG) For the real items");
    }
  }
Пример #17
0
 public void smelt(int barType) {
   if (c.smeltAmount > 0) {
     c.getPlayerAssistant().closeAllWindows();
     if (hasOres(barType)) {
       c.getItems().deleteItem(oreId, c.getItems().getItemSlot(oreId), 1);
       if (oreId2 > 0) c.getItems().deleteItem(oreId2, c.getItems().getItemSlot(oreId2), 1);
       c.getItems().addItem(barId, 1);
       c.getPlayerAssistant().addSkillXP(exp * Config.SMITHING_EXPERIENCE, c.playerSmithing);
       c.getPlayerAssistant().refreshSkill(c.playerSmithing);
       c.smeltAmount--;
       c.smeltTimer = 1;
     } else {
       c.sendMessage("You do not have the required ores to smelt this.");
       c.getPlayerAssistant().removeAllWindows();
     }
   } else {
     c.getPlayerAssistant().resetVariables();
   }
 }
Пример #18
0
  public void readInput(int level, String type, Client c, int amounttomake) {

    if (c.getItems().getItemName(Integer.parseInt(type)).contains("Bronze")) {
      CheckBronze(c, level, amounttomake, type);
    } else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Iron")) {
      CheckIron(c, level, amounttomake, type);
    } else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Steel")) {
      CheckSteel(c, level, amounttomake, type);
    } else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Mith")) {
      CheckMith(c, level, amounttomake, type);
    } else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Adam")
        || c.getItems().getItemName(Integer.parseInt(type)).contains("Addy")) {
      CheckAddy(c, level, amounttomake, type);
    } else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Rune")
        || c.getItems().getItemName(Integer.parseInt(type)).contains("Runite")) {
      CheckRune(c, level, amounttomake, type);
    }
    c.sendMessage("Item: " + type);
  }
Пример #19
0
  private static void handleBones(Client c, int i, boolean altar, int slot) {
    for (int l = 0; l < BONES.length; l++) {
      if (i == BONES[l][0]) {
        if (System.currentTimeMillis() - c.buryDelay > 800) {
          // handleZombie();
          c.getItems().deleteItem(BONES[l][0], slot, 1);
          c.getPA().addSkillXP((altar ? BONES[l][1] * 2 : BONES[l][1]) * PRAYER_XP, 5);
          c.buryDelay = System.currentTimeMillis();
          c.startAnimation((altar ? 3705 : 827));

          c.sendMessage(
              altar ? "The gods are pleased with your offerings." : "You bury the bones.");
          if (altar) {
            c.getPA().createPlayersStillGfx(624, 3097, 3500, 0, 0);
          }
        }
      }
    }
  }
Пример #20
0
  public boolean sellItem(int itemID, int fromSlot, int amount) {
    if (c.myShopId == 7390) {
      for (int i : Config.ITEM_TRADEABLE) {
        if (i == itemID) {
          c.sendMessage("You can't sell this item.");
          return false;
        }
      }
      if (c.playerName.equals(c.myShopClient.playerName)) {
        c.sellingId = itemID;
        c.sellingN = amount;
        c.sellingS = fromSlot;
        c.xInterfaceId = 7390;
        c.outStream.createFrame(27);
      } else {
        c.sendMessage("You can only sell items on your own store.");
      }
      return true;
    }
    if (c.inTrade) {
      c.sendMessage("You cant sell items to the shop while your in trade!");
      return false;
    }
    if (c.myShopId == 14) return false;
    for (int i : Config.ITEM_SELLABLE) {
      if (i == itemID) {
        c.sendMessage("You can't sell " + c.getItems().getItemName(itemID).toLowerCase() + ".");
        return false;
      }
    }

    if (amount > 0 && itemID == (c.playerItems[fromSlot] - 1)) {
      if (Server.shopHandler.ShopSModifier[c.myShopId] > 1) {
        boolean IsIn = false;
        for (int i = 0; i <= Server.shopHandler.ShopItemsStandard[c.myShopId]; i++) {
          if (itemID == (Server.shopHandler.ShopItems[c.myShopId][i] - 1)) {
            IsIn = true;
            break;
          }
        }
        if (IsIn == false) {
          c.sendMessage(
              "You can't sell "
                  + c.getItems().getItemName(itemID).toLowerCase()
                  + " to this store.");
          return false;
        }
      }

      if (amount > c.playerItemsN[fromSlot]
          && (Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == true
              || Item.itemStackable[(c.playerItems[fromSlot] - 1)] == true)) {
        amount = c.playerItemsN[fromSlot];
      } else if (amount > c.getItems().getItemAmount(itemID)
          && Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == false
          && Item.itemStackable[(c.playerItems[fromSlot] - 1)] == false) {
        amount = c.getItems().getItemAmount(itemID);
      }
      // double ShopValue;
      // double TotPrice;
      int TotPrice2 = 0;
      // int Overstock;
      for (int i = amount; i > 0; i--) {
        TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 1, fromSlot));
        if (c.getItems().freeSlots() > 0 || c.getItems().playerHasItem(995)) {
          if (Item.itemIsNote[itemID] == false) {
            c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), 1);
          } else {
            c.getItems().deleteItem(itemID, fromSlot, 1);
          }
          c.getItems().addItem(995, TotPrice2);
          addShopItem(itemID, 1);
        } else {
          c.sendMessage("You don't have enough space in your inventory.");
          break;
        }
      }
      c.getItems().resetItems(3823);
      resetShop(c.myShopId);
      updatePlayerShop();
      return true;
    }
    return true;
  }
Пример #21
0
  private void CheckMith(Client c, int level, int amounttomake, String type) {
    remove = 2359;

    if (type.equalsIgnoreCase("1355") && level >= 51) // Axe
    {
      xp = 50;
      item = 1355;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equalsIgnoreCase("1209") && level >= 50) // Dagger
    {
      xp = 50;
      item = 1209;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1428") && level >= 52) // Mace
    {
      xp = 50;
      item = 1428;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1143") && level >= 53) // Med helm
    {
      xp = 50;
      item = 1143;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("9142") && level >= 54) // Dart tips
    {
      xp = 50;
      item = 9142;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1285") && level >= 54) // Sword (s)
    {
      xp = 50;
      item = 1285;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("4822") && level >= 54) // Nails
    {
      xp = 50;
      item = 4822;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("42") && level >= 55) // Arrow tips
    {
      xp = 50;
      item = 42;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1329") && level >= 55) // Scim
    {
      xp = 100;
      item = 1329;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1299") && level >= 56) // Longsword
    {
      xp = 100;
      item = 1299;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("866") && level >= 57) // Knives
    {
      xp = 50;
      item = 866;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1159") && level >= 57) // Full Helm
    {
      xp = 100;
      item = 1159;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1181") && level >= 58) // Square shield
    {
      xp = 100;
      item = 1181;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1343") && level >= 59) // Warhammer
    {
      xp = 150;
      item = 1343;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1369") && level >= 60) // Battle axe
    {
      xp = 150;
      item = 1369;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1109") && level >= 61) // Chain
    {
      xp = 150;
      item = 1109;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1197") && level >= 62) // Kite
    {
      xp = 150;
      item = 1197;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1315") && level >= 64) // 2h Sword
    {
      xp = 150;
      item = 1315;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1071") && level >= 66) // Platelegs
    {
      xp = 150;
      item = 1071;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1085") && level >= 66) // PlateSkirt
    {
      xp = 150;
      item = 1085;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1121") && level >= 68) // Platebody
    {
      xp = 250;
      item = 1121;
      removeamount = 5;
      maketimes = amounttomake;
    } else {
      c.sendMessage("You don't have a high enough level to make this Item!");
      return;
    }

    doaction(c, item, remove, removeamount, maketimes, -1, -1, xp);
  }
Пример #22
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    int junk = c.getInStream().readSignedWordBigEndianA();
    int itemSlot = c.getInStream().readUnsignedWordA();
    int itemId = c.getInStream().readUnsignedWordBigEndian();
    if (itemId != c.playerItems[itemSlot] - 1) {
      return;
    }
    switch (itemId) {
      case 2827: // Draynor River Bank
        c.clueScrollMap(7113, "1");
        break;
      case 2829: // Behind the Wizard's Tower
        c.clueScrollMap(9275, "1");
        break;
      case 3518: // North of Falador, right near the statue
        c.clueScrollMap(17537, "1");
        break;
      case 3520: // Varrock East Mine
        c.clueScrollMap(7045, "1");
        break;
      case 3522: // Search the Crate at the Goblin's Houses near Castle Wars
        c.clueScrollMap(9454, "1");
        break;
      case 3524: // Building in West Rimmington
        c.clueScrollMap(9839, "1");
        break;
      case 3525: // Edge of the Ranged Guild
        c.clueScrollMap(7162, "2");
        break;
      case 3598: // Falador Rock Garden
        c.clueScrollMap(7271, "2");
        break;
      case 3599: // Outside of the Monks House near McDoogle Woods
        c.clueScrollMap(9108, "2");
        break;
      case 3601: // Search the Crate in the Black Knight's Fortress
        c.clueScrollMap(9507, "2");
        break;
      case 3602: // Chaos Altar West of the Khazard Battlefield (south west of Ardougne), dig right
        // behind the altar
        c.clueScrollMap(17888, "2");
        break;
      case 7236: // Miscellania, just to the East of the entrance to the Castle grounds.
        c.clueScrollMap(17687, "2");
        break;
      case 7239: // Behind the House in Yanille Map
        c.clueScrollMap(9043, "3");
        break;
      case 7241: // Level 50 wilderness, directly to the West of the larger volcano, to the
        // Southeast of the Agility Course
        c.clueScrollMap(17620, "3");
        break;
      case 7286: // Just to the South of the Legends Guild entrance, to the Northeast of Ardougne
        c.clueScrollMap(17634, "3");
        break;
      case 7288: // Crate, Clocktower, South of the Ardougne Castle
        c.clueScrollMap(9720, "3");
        break;
      case 7290: // Hobgoblin Point (Crafting Guild)
        c.clueScrollMap(4305, "3");
        break;
      case 7292: // In a Building in West Ardougne
        c.clueScrollMap(9359, "3");
        break;
        /* Text Clue Scrolls */
      case 2678: // Talk to the Mage of Zamorak
        c.clueScroll(
            "Dressed in red,",
            "evil to the core,",
            "chaos is my path,",
            "peace be for none,",
            "ALL HAIL ZAMORAK!",
            "",
            "",
            "",
            "1");
        break;
      case 2831: // Talk to Romeo in Varrock Centre.
        c.clueScroll(
            "In an empty town,",
            "all alone I stand",
            "day after day, wishing",
            "that someone would just",
            "say 'hey', my love is",
            "asleep and I do nothing,",
            "destined for solitude I am...",
            "",
            "1");
        break;
      case 2833: // Talk to Emily in the Falador Bar.
        c.clueScroll(
            "You can have a cold one on me ",
            "and maybe more if you",
            "play your cards right.",
            "",
            "",
            "",
            "",
            "",
            "1");
        break;
      case 2835: // Talk to Tracker Gnome 1 outside of Falador Gates.
        c.clueScroll(
            "Gathering information on the",
            "giant breed known as 'humans' is",
            "tough work, thankfully the",
            "f-guards here can't see me!",
            "",
            "",
            "",
            "",
            "1");
        break;
      case 2837: // Talk to the Tracker Gnome 2 in Varrock Castle Courtyard.
        c.clueScroll(
            "Gathering information on the",
            "giant breed known as 'humans' is",
            "tough work, thankfully the",
            "v-guards here don't suspect me!",
            "",
            "",
            "",
            "",
            "1");
        break;
      case 2839: // Talk to the Tracker Gnome 3 in Ardougne Centre.
        c.clueScroll(
            "Gathering information on the",
            "giant breed known as 'humans' is",
            "tough work, thankfully the",
            "a-guards here don't suspect me!",
            "",
            "",
            "",
            "",
            "1");
        break;
      case 2841:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2843:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2845:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2847:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2848:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2849:
        c.clueScroll("", "", "", "", "", "", "", "", "2");
        break;
      case 2851:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
      case 2853:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
      case 2855:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
      case 2856:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
      case 2857:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
      case 2858:
        c.clueScroll("", "", "", "", "", "", "", "", "3");
        break;
        /* Reward Chests */
      case 2826: // Tier 1 Chest
        c.completeLevel1();
        c.getItems().deleteItem(2826, c.getItems().getItemSlot(2826), 1);
        break;
      case 2828: // Tier 2 Chest
        c.completeLevel2();
        c.getItems().deleteItem(2828, c.getItems().getItemSlot(2828), 1);
        break;
      case 2830: // Tier 3 Chest
        c.completeLevel3();
        c.getItems().deleteItem(2830, c.getItems().getItemSlot(2830), 1);
        break;
    }
    if (itemId == 8007) {
      c.getItems().deleteItem(8007, c.getItems().getItemSlot(8007), 1);
      c.getPA().teleTabTeleport(3213, 3423, 0, "teleTab");
    }
    if (itemId == 8008) {
      c.getItems().deleteItem(8008, c.getItems().getItemSlot(8008), 1);
      c.getPA().teleTabTeleport(3224, 3218, 0, "teleTab");
    }
    if (itemId == 8009) {
      c.getItems().deleteItem(8009, c.getItems().getItemSlot(8009), 1);
      c.getPA().teleTabTeleport(2965, 3383, 0, "teleTab");
    }
    if (itemId == 8010) {
      c.getItems().deleteItem(8010, c.getItems().getItemSlot(8010), 1);
      c.getPA().teleTabTeleport(2757, 3477, 0, "teleTab");
    }
    if (itemId == 8011) {
      c.getItems().deleteItem(8011, c.getItems().getItemSlot(8011), 1);
      c.getPA().teleTabTeleport(2653, 3283, 0, "teleTab");
    }
    if (itemId == 8012) {
      c.getItems().deleteItem(8012, c.getItems().getItemSlot(8012), 1);
      c.getPA().teleTabTeleport(2546, 3112, 0, "teleTab");
    }
    if (itemId == 8013) {
      c.getItems().deleteItem(8013, c.getItems().getItemSlot(8013), 1);
      c.getPA().teleTabTeleport(3086, 3499, 0, "teleTab");
    }
    if (itemId == 4447) {
      for (int i = 0; i < 5; i++) {
        c.playerLevel[0] = 99;
        c.playerLevel[1] = 99;
        c.playerLevel[2] = 99;
        c.playerLevel[3] = 99;
        c.playerLevel[4] = 99;
        c.playerLevel[6] = 99;
        c.playerXP[i] = c.getPA().getXPForLevel(100);
        c.playerXP[6] = c.getPA().getXPForLevel(100);
        c.getPA().refreshSkill(i);
        c.getPA().refreshSkill(6);
        c.getItems().deleteItem(4447, 1);
        c.logout();
      }
      c.getPA().requestUpdates();
    }

    if (itemId == 6796) {
      c.playerLevel[0] = 99;
      c.playerLevel[2] = 99;
      c.playerLevel[3] = 99;
      c.playerLevel[4] = 99;
      c.playerLevel[6] = 99;
      c.playerXP[0] = c.getPA().getXPForLevel(100);
      c.playerXP[2] = c.getPA().getXPForLevel(100);
      c.playerXP[3] = c.getPA().getXPForLevel(100);
      c.playerXP[4] = c.getPA().getXPForLevel(100);
      c.playerXP[6] = c.getPA().getXPForLevel(100);
      c.getPA().refreshSkill(0);
      c.getPA().refreshSkill(2);
      c.getPA().refreshSkill(3);
      c.getPA().refreshSkill(4);
      c.getPA().refreshSkill(6);
      c.getItems().deleteItem(6796, 1);
      c.logout();
    }

    if (itemId == 15272) {
      if (System.currentTimeMillis() - c.foodDelay >= 1500 && c.playerLevel[3] > 0) {
        c.getCombat().resetPlayerAttack();
        c.attackTimer += 2;
        c.startAnimation(829);
        c.getItems().deleteItem(15272, 1);
        if (c.playerLevel[3] < c.getLevelForXP(c.playerXP[3])) {
          c.playerLevel[3] += 23;
          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 Rocktail.");
      }
      c.playerLevel[3] += 10;
      if (c.playerLevel[3] > (c.getLevelForXP(c.playerXP[3]) * 1.11 + 1)) {
        c.playerLevel[3] = (int) (c.getLevelForXP(c.playerXP[3]) * 1.11);
      }
      c.getPA().refreshSkill(3);
      return;
    }
    if (itemId == 2528) {
      c.getItems().deleteItem(2528, 1);
      c.getPA().showInterface(2808);
    }
    // Begin artifacts by Hirukos
    if (itemId >= 14876 && itemId <= 14892) {
      int a = itemId;
      String YEYAF = "<col=1532693>You Exchanged Your Artifact For</col> ";
      if (a == 14876) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 10000000);
        c.sendMessage(YEYAF + "<col=1532693>10 million Coins!</col>");
      }
      if (a == 14877) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 2000000);
        c.sendMessage(YEYAF + "<col=1532693>2 million Coins!</col>");
      }
      if (a == 14878) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 1500000);
        c.sendMessage(YEYAF + "<col=1532693>1.5 million Coins!</col>");
      }
      if (a == 14879) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 1000000);
        c.sendMessage(YEYAF + "<col=1532693>1 million Coins!</col>");
      }
      if (a == 14880) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 800000);
        c.sendMessage(YEYAF + "<col=1532693>800,000 Coins!</col>");
      }
      if (a == 14881) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 600000);
        c.sendMessage(YEYAF + "<col=1532693>600,000 Coins!</col>");
      }
      if (a == 14882) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 540000);
        c.sendMessage(YEYAF + "<col=1532693>540,000 Coins!</col>");
      }
      if (a == 14883) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 400000);
        c.sendMessage(YEYAF + "<col=1532693>400,000 Coins!</col>");
      }
      if (a == 14884) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 300000);
        c.sendMessage(YEYAF + "<col=1532693>300,000 Coins!</col>");
      }
      if (a == 14885) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 200000);
        c.sendMessage(YEYAF + "<col=1532693>200,000 Coins!</col>");
      }
      if (a == 14886) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 150000);
        c.sendMessage(YEYAF + "<col=1532693>150,000 Coins!</col>");
      }
      if (a == 14887) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 100000);
        c.sendMessage(YEYAF + "<col=1532693>100,000 Coins!</col>");
      }
      if (a == 14888) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 80000);
        c.sendMessage(YEYAF + "<col=1532693>80,000 Coins!</col>");
      }
      if (a == 14889) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 60000);
        c.sendMessage(YEYAF + "<col=1532693>60,000 Coins!</col>");
      }
      if (a == 14890) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 40000);
        c.sendMessage(YEYAF + "<col=1532693>40,000 Coins!</col>");
      }
      if (a == 14891) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 20000);
        c.sendMessage(YEYAF + "<col=1532693>20,000 Coins!</col>");
      }
      if (a == 14892) {
        c.getItems().deleteItem(a, 1);
        c.getItems().addItem(995, 10000);
        c.sendMessage(YEYAF + "<col=1532693>10,000 Coins!</col>");
      }
    }
    // End of artifacts By Hirukos

    if (itemId == 5509) {
      c.getPA().addSmallPouch();
    }
    if (itemId == 5510) {
      c.getPA().addMediumPouch();
    }
    if (itemId == 5511) {
      c.getPA().addMediumPouch();
    }
    if (itemId == 5512) {
      c.getPA().addLargePouch();
    }
    if (itemId == 5513) {
      c.getPA().addLargePouch();
    }
    if (itemId == 5514) {
      c.getPA().addGiantPouch();
    }
    if (itemId == 5515) {
      c.getPA().addGiantPouch();
    }
    if (c.getHerblore().isUnidHerb(itemId)) c.getHerblore().handleHerbClick(itemId);
    if (c.getFood().isFood(itemId)) c.getFood().eat(itemId, itemSlot);
    // ScriptManager.callFunc("itemClick_"+itemId, c, itemId, itemSlot);
    if (c.getPotions().isPotion(itemId)) c.getPotions().handlePotion(itemId, itemSlot);
    if (Prayer.playerBones(c, itemId)) {
      Prayer.buryBones(c, itemId, itemSlot);
    }
    if (itemId == 952) {
      if (c.inArea(3553, 3301, 3561, 3294)) {
        c.teleTimer = 3;
        c.newLocation = 1;
      } else if (c.inArea(3550, 3287, 3557, 3278)) {
        c.teleTimer = 3;
        c.newLocation = 2;
      } else if (c.inArea(3561, 3292, 3568, 3285)) {
        c.teleTimer = 3;
        c.newLocation = 3;
      } else if (c.inArea(3570, 3302, 3579, 3293)) {
        c.teleTimer = 3;
        c.newLocation = 4;
      } else if (c.inArea(3571, 3285, 3582, 3278)) {
        c.teleTimer = 3;
        c.newLocation = 5;
      } else if (c.inArea(3562, 3279, 3569, 3273)) {
        c.teleTimer = 3;
        c.newLocation = 6;
      } else if (c.inArea(2986, 3370, 3013, 3388)) {
        c.teleTimer = 3;
        c.newLocation = 7;
      }
    }
  }
Пример #23
0
  private void CheckRune(Client c, int level, int amounttomake, String type) {
    remove = 2363;

    if (type.equalsIgnoreCase("1359") && level >= 86) // Axe
    {
      xp = 75;
      item = 1359;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equalsIgnoreCase("1213") && level >= 85) // Dagger
    {
      xp = 75;
      item = 1213;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1432") && level >= 87) // Mace
    {
      xp = 75;
      item = 1432;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1147") && level >= 88) // Med helm
    {
      xp = 75;
      item = 1147;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("9144") && level >= 89) // Dart tips
    {

      xp = 75;
      item = 9144;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1289") && level >= 89) // Sword (s)
    {
      xp = 75;
      item = 1289;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("4824") && level >= 89) // Nails
    {
      xp = 75;
      item = 4824;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("44") && level >= 90) // Arrow tips
    {
      xp = 75;
      item = 44;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1333") && level >= 90) // Scim
    {
      xp = 150;
      item = 1333;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1303") && level >= 91) // Longsword
    {
      xp = 150;
      item = 1303;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("868") && level >= 92) // Knives
    {
      xp = 75;
      item = 868;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1163") && level >= 92) // Full Helm
    {
      xp = 150;
      item = 1163;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1185") && level >= 93) // Square shield
    {
      xp = 150;
      item = 1185;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1347") && level >= 94) // Warhammer
    {
      xp = 225;
      item = 1347;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1373") && level >= 95) // Battle axe
    {
      xp = 225;
      item = 1373;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1113") && level >= 96) // Chain
    {
      xp = 225;
      item = 1113;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1201") && level >= 97) // Kite
    {
      xp = 225;
      item = 1201;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1319") && level >= 99) // 2h Sword
    {
      xp = 225;
      item = 1319;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1079") && level >= 99) // Platelegs
    {
      xp = 225;
      item = 1079;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1093") && level >= 99) // PlateSkirt
    {
      xp = 225;
      item = 1093;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1127") && level >= 99) // Platebody
    {
      xp = 313;
      item = 1127;
      removeamount = 5;
      maketimes = amounttomake;
    } else {
      c.sendMessage("You don't have a high enough level to make this Item!");
      return;
    }

    doaction(c, item, remove, removeamount, maketimes, -1, -1, xp);
  }
Пример #24
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    if (packetType == 248 || packetType == 164) {
      c.faceUpdate(0);
      if (c.SSPLIT == false) {
        c.npcIndex = 0;
        c.playerIndex = 0;
      } else {
      }
      if (c.followId > 0 || c.followId2 > 0) c.getPA().resetFollow();
    }
    c.fishing = false;
    if (!c.isBanking && !c.inTrade) {
      c.getPA().removeAllWindows();
    }
    if (c.duelRule[1] && c.duelStatus == 5) {
      if (Server.playerHandler.players[c.duelingWith] != null) {
        if (!c.goodDistance(
                c.getX(),
                c.getY(),
                Server.playerHandler.players[c.duelingWith].getX(),
                Server.playerHandler.players[c.duelingWith].getY(),
                1)
            || c.attackTimer == 0) {
          c.sendMessage("Walking has been disabled in this duel!");
        }
      }
      c.playerIndex = 0;
      return;
    }

    if (c.freezeTimer > 0) {
      if (Server.playerHandler.players[c.playerIndex] != null) {
        if (c.goodDistance(
                c.getX(),
                c.getY(),
                Server.playerHandler.players[c.playerIndex].getX(),
                Server.playerHandler.players[c.playerIndex].getY(),
                1)
            && packetType != 98) {
          c.playerIndex = 0;
          return;
        }
      }
      if (packetType != 98) {
        c.sendMessage("A magical force stops you from moving.");
        c.playerIndex = 0;
      }
      return;
    }

    if (System.currentTimeMillis() - c.lastSpear < 4000) {
      c.sendMessage("You have been stunned.");
      c.playerIndex = 0;
      return;
    }

    if (packetType == 98) {
      c.mageAllowed = true;
      c.fishing = false;
    }

    if (c.sit == true) {
      c.sendMessage("::unsit before you can start walking again!");
      return;
    }

    if ((c.duelStatus >= 1 && c.duelStatus <= 4) || c.duelStatus == 6) {
      if (c.duelStatus == 6) {
        c.getTradeAndDuel().claimStakedItems();
      }
      return;
    }

    if (c.respawnTimer > 3) {
      return;
    }
    if (System.currentTimeMillis() - c.lastEmote <= 7000) {
      return;
    }
    if (c.inTrade) {
      c.sendMessage("Please use the Decline option.");
      return;
    }
    if (c.isBanking) {
      c.getPA().closeAllWindows();
    }
    if (c.isShopping == true) {
      c.isShopping = false;
    }
    if (packetType == 248) {
      packetSize -= 14;
    }
    c.newWalkCmdSteps = (packetSize - 5) / 2;
    if (++c.newWalkCmdSteps > c.walkingQueueSize) {
      c.newWalkCmdSteps = 0;
      return;
    }

    c.getNewWalkCmdX()[0] = c.getNewWalkCmdY()[0] = 0;

    int firstStepX = c.getInStream().readSignedWordBigEndianA() - c.getMapRegionX() * 8;
    for (int i = 1; i < c.newWalkCmdSteps; i++) {
      c.getNewWalkCmdX()[i] = c.getInStream().readSignedByte();
      c.getNewWalkCmdY()[i] = c.getInStream().readSignedByte();
    }

    int firstStepY = c.getInStream().readSignedWordBigEndian() - c.getMapRegionY() * 8;
    c.setNewWalkCmdIsRunning(c.getInStream().readSignedByteC() == 1);
    for (int i1 = 0; i1 < c.newWalkCmdSteps; i1++) {
      c.getNewWalkCmdX()[i1] += firstStepX;
      c.getNewWalkCmdY()[i1] += firstStepY;
    }
  }
Пример #25
0
  public void startMining(final int j, final int x, final int y, final int type) {
    if (c.isMining) return;
    if (c.mining) return;
    int miningLevel = c.playerLevel[c.playerMining];
    a = -1;
    c.turnPlayerTo(x, y);
    if (Rock_Settings[j][1] > miningLevel) {
      c.sendMessage("You need a Mining level of " + Rock_Settings[j][1] + " to mine this rock.");
      return;
    }
    for (int i = 0; i < Pick_Settings.length; i++) {
      if (c.getItems().playerHasItem(Pick_Settings[i][0])
          || c.playerEquipment[c.playerWeapon] == Pick_Settings[i][0]) {
        if (Pick_Settings[i][1] <= miningLevel) {
          a = i;
        }
      }
    }
    if (a == -1) {
      c.sendMessage("You need a pickaxe to mine this rock.");
      return;
    }
    if (c.getItems().freeSlots() < 1) {
      c.sendMessage("You do not have enough inventory slots to do that.");
      return;
    }
    c.startAnimation(Pick_Settings[a][3]);
    c.isMining = true;
    c.rockX = x;
    c.rockY = y;
    c.mining = true;
    CycleEventHandler.getSingleton()
        .addEvent(
            c,
            new CycleEvent() {
              @Override
              public void execute(CycleEventContainer container) {
                if (!c.isMining) {
                  container.stop();
                  c.startAnimation(65535);
                  return;
                }
                if (c.isMining) {
                  c.getItems().addItem(Rock_Settings[j][4], 1);
                  c.getPA().addSkillXP(Rock_Settings[j][2], c.playerMining);
                }
                if (c.getItems().freeSlots() < 1) {
                  c.sendMessage("You have ran out of inventory slots.");
                  container.stop();
                }
                mineRock(Rock_Settings[j][3], x, y, type, Rock_Settings[j][0]);
                c.isMining = false;
                container.stop();
              }

              @Override
              public void stop() {
                c.getPA().removeAllWindows();
                c.startAnimation(65535);
                c.isMining = false;
                c.rockX = 0;
                c.rockY = 0;
                c.mining = false;
                return;
              }
            },
            getTimer(j, a, miningLevel));
  }
Пример #26
0
  private void CheckAddy(Client c, int level, int amounttomake, String type) {
    remove = 2361;

    if (type.equalsIgnoreCase("1357") && level >= 71) // Axe
    {
      xp = 63;
      item = 1357;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equalsIgnoreCase("1211") && level >= 70) // Dagger
    {
      xp = 63;
      item = 1211;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1430") && level >= 72) // Mace
    {
      xp = 63;
      item = 1430;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1145") && level >= 73) // Med helm
    {
      xp = 63;
      item = 1145;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("9143") && level >= 74) // Dart tips
    {
      xp = 63;
      item = 9143;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1287") && level >= 74) // Sword (s)
    {
      xp = 63;
      item = 1287;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("4823") && level >= 74) // Nails
    {
      xp = 63;
      item = 4823;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("43") && level >= 75) // Arrow tips
    {
      xp = 63;
      item = 43;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1331") && level >= 75) // Scim
    {
      xp = 125;
      item = 1331;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1301") && level >= 76) // Longsword
    {
      xp = 125;
      item = 1301;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("867") && level >= 77) // Knives
    {
      xp = 63;
      item = 867;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1161") && level >= 77) // Full Helm
    {
      xp = 125;
      item = 1161;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1183") && level >= 78) // Square shield
    {
      xp = 125;
      item = 1183;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1345") && level >= 79) // Warhammer
    {
      xp = 188;
      item = 1345;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1371") && level >= 80) // Battle axe
    {
      xp = 188;
      item = 1371;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1111") && level >= 81) // Chain
    {
      xp = 188;
      item = 1111;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1199") && level >= 82) // Kite
    {
      xp = 188;
      item = 1199;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1317") && level >= 84) // 2h Sword
    {
      xp = 188;
      item = 1317;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1073") && level >= 86) // Platelegs
    {
      xp = 188;
      item = 1073;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1091") && level >= 86) // PlateSkirt
    {
      xp = 188;
      item = 1091;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1123") && level >= 88) // Platebody
    {
      xp = 313;
      item = 1123;
      removeamount = 5;
      maketimes = amounttomake;
    } else {
      c.sendMessage("You don't have a high enough level to make this Item!");
      return;
    }

    doaction(c, item, remove, removeamount, maketimes, -1, -1, xp);
  }
Пример #27
0
  public static void ItemonItem(Client c, int itemUsed, int useWith) {
    if (itemUsed == 227 || useWith == 227) c.getHerblore().handlePotMaking(itemUsed, useWith);
    if (c.getItems().getItemName(itemUsed).contains("(")
        && c.getItems().getItemName(useWith).contains("("))
      c.getPotMixing().mixPotion2(itemUsed, useWith);
    if (itemUsed == 1733 || useWith == 1733) c.getCrafting().handleLeather(itemUsed, useWith);
    if (itemUsed == 1755 || useWith == 1755) c.getCrafting().handleChisel(itemUsed, useWith);
    /*if (itemUsed == 946 || useWith == 946)
    	c.getFletching().handleLog(itemUsed,useWith);
    if (itemUsed == 53 || useWith == 53 || itemUsed == 52 || useWith == 52)
    	c.getFletching().makeArrows(itemUsed, useWith);*/
    if ((itemUsed == 1540 && useWith == 11286) || (itemUsed == 11286 && useWith == 1540)) {
      if (c.playerLevel[c.playerSmithing] >= 95) {
        c.getItems().deleteItem(1540, c.getItems().getItemSlot(1540), 1);
        c.getItems().deleteItem(11286, c.getItems().getItemSlot(11286), 1);
        c.getItems().addItem(11284, 1);
        c.sendMessage("You combine the two materials to create a dragonfire shield.");
        c.getPA().addSkillXP(500 * Config.SMITHING_EXPERIENCE, c.playerSmithing);
      } else {
        c.sendMessage("You need a smithing level of 95 to create a dragonfire shield.");
      }
    }
    if (itemUsed == 9142 && useWith == 9190 || itemUsed == 9190 && useWith == 9142) {
      if (c.playerLevel[c.playerFletching] >= 58) {
        int boltsMade =
            c.getItems().getItemAmount(itemUsed) > c.getItems().getItemAmount(useWith)
                ? c.getItems().getItemAmount(useWith)
                : c.getItems().getItemAmount(itemUsed);
        c.getItems().deleteItem(useWith, c.getItems().getItemSlot(useWith), boltsMade);
        c.getItems().deleteItem(itemUsed, c.getItems().getItemSlot(itemUsed), boltsMade);
        c.getItems().addItem(9241, boltsMade);
        c.getPA().addSkillXP(boltsMade * 6 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 58 to fletch this item.");
      }
    }
    if (itemUsed == 9143 && useWith == 9191 || itemUsed == 9191 && useWith == 9143) {
      if (c.playerLevel[c.playerFletching] >= 63) {
        int boltsMade =
            c.getItems().getItemAmount(itemUsed) > c.getItems().getItemAmount(useWith)
                ? c.getItems().getItemAmount(useWith)
                : c.getItems().getItemAmount(itemUsed);
        c.getItems().deleteItem(useWith, c.getItems().getItemSlot(useWith), boltsMade);
        c.getItems().deleteItem(itemUsed, c.getItems().getItemSlot(itemUsed), boltsMade);
        c.getItems().addItem(9242, boltsMade);
        c.getPA().addSkillXP(boltsMade * 7 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 63 to fletch this item.");
      }
    }
    if (itemUsed == 9143 && useWith == 9192 || itemUsed == 9192 && useWith == 9143) {
      if (c.playerLevel[c.playerFletching] >= 65) {
        int boltsMade =
            c.getItems().getItemAmount(itemUsed) > c.getItems().getItemAmount(useWith)
                ? c.getItems().getItemAmount(useWith)
                : c.getItems().getItemAmount(itemUsed);
        c.getItems().deleteItem(useWith, c.getItems().getItemSlot(useWith), boltsMade);
        c.getItems().deleteItem(itemUsed, c.getItems().getItemSlot(itemUsed), boltsMade);
        c.getItems().addItem(9243, boltsMade);
        c.getPA().addSkillXP(boltsMade * 7 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 65 to fletch this item.");
      }
    }
    if (itemUsed == 9144 && useWith == 9193 || itemUsed == 9193 && useWith == 9144) {
      if (c.playerLevel[c.playerFletching] >= 71) {
        int boltsMade =
            c.getItems().getItemAmount(itemUsed) > c.getItems().getItemAmount(useWith)
                ? c.getItems().getItemAmount(useWith)
                : c.getItems().getItemAmount(itemUsed);
        c.getItems().deleteItem(useWith, c.getItems().getItemSlot(useWith), boltsMade);
        c.getItems().deleteItem(itemUsed, c.getItems().getItemSlot(itemUsed), boltsMade);
        c.getItems().addItem(9244, boltsMade);
        c.getPA().addSkillXP(boltsMade * 10 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 71 to fletch this item.");
      }
    }
    if (itemUsed == 9144 && useWith == 9194 || itemUsed == 9194 && useWith == 9144) {
      if (c.playerLevel[c.playerFletching] >= 58) {
        int boltsMade =
            c.getItems().getItemAmount(itemUsed) > c.getItems().getItemAmount(useWith)
                ? c.getItems().getItemAmount(useWith)
                : c.getItems().getItemAmount(itemUsed);
        c.getItems().deleteItem(useWith, c.getItems().getItemSlot(useWith), boltsMade);
        c.getItems().deleteItem(itemUsed, c.getItems().getItemSlot(itemUsed), boltsMade);
        c.getItems().addItem(9245, boltsMade);
        c.getPA().addSkillXP(boltsMade * 13 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 58 to fletch this item.");
      }
    }
    if (itemUsed == 1601 && useWith == 1755 || itemUsed == 1755 && useWith == 1601) {
      if (c.playerLevel[c.playerFletching] >= 63) {
        c.getItems().deleteItem(1601, c.getItems().getItemSlot(1601), 1);
        c.getItems().addItem(9192, 15);
        c.getPA().addSkillXP(8 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 63 to fletch this item.");
      }
    }
    if (itemUsed == 1607 && useWith == 1755 || itemUsed == 1755 && useWith == 1607) {
      if (c.playerLevel[c.playerFletching] >= 65) {
        c.getItems().deleteItem(1607, c.getItems().getItemSlot(1607), 1);
        c.getItems().addItem(9189, 15);
        c.getPA().addSkillXP(8 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 65 to fletch this item.");
      }
    }
    if (itemUsed == 1605 && useWith == 1755 || itemUsed == 1755 && useWith == 1605) {
      if (c.playerLevel[c.playerFletching] >= 71) {
        c.getItems().deleteItem(1605, c.getItems().getItemSlot(1605), 1);
        c.getItems().addItem(9190, 15);
        c.getPA().addSkillXP(8 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 71 to fletch this item.");
      }
    }
    if (itemUsed == 1603 && useWith == 1755 || itemUsed == 1755 && useWith == 1603) {
      if (c.playerLevel[c.playerFletching] >= 73) {
        c.getItems().deleteItem(1603, c.getItems().getItemSlot(1603), 1);
        c.getItems().addItem(9191, 15);
        c.getPA().addSkillXP(8 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 73 to fletch this item.");
      }
    }
    if (itemUsed == 1615 && useWith == 1755 || itemUsed == 1755 && useWith == 1615) {
      if (c.playerLevel[c.playerFletching] >= 73) {
        c.getItems().deleteItem(1615, c.getItems().getItemSlot(1615), 1);
        c.getItems().addItem(9193, 15);
        c.getPA().addSkillXP(8 * Config.FLETCHING_EXPERIENCE, c.playerFletching);
      } else {
        c.sendMessage("You need a fletching level of 73 to fletch this item.");
      }
    }
    if (itemUsed >= 11710 && itemUsed <= 11714 && useWith >= 11710 && useWith <= 11714) {
      if (c.getItems().hasAllShards()) {
        c.getItems().makeBlade();
      }
    }
    if (itemUsed == 2368 && useWith == 2366 || itemUsed == 2366 && useWith == 2368) {
      c.getItems().deleteItem(2368, c.getItems().getItemSlot(2368), 1);
      c.getItems().deleteItem(2366, c.getItems().getItemSlot(2366), 1);
      c.getItems().addItem(1187, 1);
    }

    if (c.getItems().isHilt(itemUsed) || c.getItems().isHilt(useWith)) {
      int hilt = c.getItems().isHilt(itemUsed) ? itemUsed : useWith;
      int blade = c.getItems().isHilt(itemUsed) ? useWith : itemUsed;
      if (blade == 11690) {
        c.getItems().makeGodsword(hilt);
      }
    }

    switch (itemUsed) {
      case 1511:
      case 1521:
      case 1519:
      case 1517:
      case 1515:
      case 1513:
      case 590:
        // c.getFiremaking().checkLogType(itemUsed, useWith);
        // c.sendMessage("Firemaking is disabled.");
        break;

      default:
        if (c.playerRights == 3)
          Misc.println("Player used Item id: " + itemUsed + " with Item id: " + useWith);
        break;
    }
  }
Пример #28
0
  private void CheckBronze(Client c, int level, int amounttomake, String type) {
    if (type.equalsIgnoreCase("1351") && level >= 1) {
      xp = 13;
      item = 1351;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equalsIgnoreCase("1205") && level >= 1) {
      xp = 13;
      item = 1205;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1422") && level >= 2) {
      xp = 13;
      item = 1422;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1139") && level >= 3) {
      xp = 13;
      item = 1139;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("819") && level >= 4) {
      xp = 13;
      item = 819;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1277") && level >= 4) {
      xp = 13;
      item = 1277;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("4819") && level >= 4) {
      xp = 13;
      item = 4819;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("39") && level >= 5) {
      xp = 13;
      item = 39;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1321") && level >= 5) {
      xp = 25;
      item = 1321;
      remove = 2349;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1291") && level >= 6) {
      xp = 25;
      item = 1291;
      remove = 2349;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("864") && level >= 7) {
      xp = 25;
      item = 864;
      remove = 2349;
      removeamount = 1;
      maketimes = amounttomake;
    } else if (type.equals("1155") && level >= 7) {
      xp = 25;
      item = 1155;
      remove = 2349;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1173") && level >= 8) {
      xp = 25;
      item = 1173;
      remove = 2349;
      removeamount = 2;
      maketimes = amounttomake;
    } else if (type.equals("1337") && level >= 9) {
      xp = 38;
      item = 1337;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1375") && level >= 10) {
      xp = 38;
      item = 1375;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1103") && level >= 11) {
      xp = 38;
      item = 1103;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1189") && level >= 12) {
      xp = 38;
      item = 1189;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1307") && level >= 14) {
      xp = 38;
      item = 1307;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1075") && level >= 16) {
      xp = 38;
      item = 1075;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1087") && level >= 16) {
      xp = 38;
      item = 1087;
      remove = 2349;
      removeamount = 3;
      maketimes = amounttomake;
    } else if (type.equals("1117") && level >= 18) {
      xp = 63;
      item = 1117;
      remove = 2349;
      removeamount = 5;
      maketimes = amounttomake;
    } else {
      c.sendMessage("You don't have a high enough level to make this Item!");
      return;
    }

    doaction(c, item, remove, removeamount, maketimes, -1, -1, xp);
  }
Пример #29
0
  public boolean buyItem(int itemID, int fromSlot, int amount) {
    if (c.myShopId == 7390
        && c.myShopClient != null
        && !c.myShopClient.properLogout
        && !c.playerName.equals(c.myShopClient.playerName)) {
      int bought = 0;
      int price = c.myShopClient.playerShopP[fromSlot];
      if (amount > c.myShopClient.playerShopN[fromSlot])
        amount = c.myShopClient.playerShopN[fromSlot];
      for (int x = 0; x < amount; x++) {
        if (c.getItems().playerHasItem(7478, c.myShopClient.playerShopP[fromSlot])
            && c.getItems().freeSlots() > 0) {
          c.getItems().deleteItem2(7478, c.myShopClient.playerShopP[fromSlot]);
          c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
          c.myShopClient.playerShopN[fromSlot]--;
          c.myShopClient.playerCollect += c.myShopClient.playerShopP[fromSlot];
          if (c.myShopClient.playerShopN[fromSlot] == 0) {
            c.myShopClient.playerShop[fromSlot] = 0;
            c.myShopClient.playerShopP[fromSlot] = 0;
          }
          bought++;
        } else {
          c.sendMessage("Not enought space or money.");
          break;
        }
      }
      if (bought > 0) {
        resetShop(c.myShopClient);
        c.getItems().resetItems(3823);
        ;
        c.sendMessage(
            "You just bought "
                + bought
                + " "
                + c.getItems().getItemName(itemID)
                + " for "
                + (bought * price));
        c.myShopClient.sendMessage(
            c.playerName
                + " has bought "
                + bought
                + " "
                + c.getItems().getItemName(itemID)
                + " from you!");
        c.myShopClient.sendMessage(
            "You now have " + c.myShopClient.playerCollect + " DT's to collect (::collect)");
      }
      return false;
    } else if (c.myShopId == 7390
        && c.myShopClient != null
        && !c.myShopClient.properLogout
        && c.playerName.equals(c.myShopClient.playerName)) {
      if (amount > c.myShopClient.playerShopN[fromSlot])
        amount = c.myShopClient.playerShopN[fromSlot];
      for (int x = 0; x < amount; x++) {
        if (c.getItems().freeSlots() > 0) {
          c.getItems().addItem(c.myShopClient.playerShop[fromSlot], 1);
          c.myShopClient.playerShopN[fromSlot]--;
          if (c.myShopClient.playerShopN[fromSlot] == 0) {
            c.myShopClient.playerShop[fromSlot] = 0;
            c.myShopClient.playerShopP[fromSlot] = 0;
            fixShop(c);
          }
        } else {
          c.sendMessage("Not enought space.");
          break;
        }
      }
      resetShop(c.myShopClient);
      c.getItems().resetItems(3823);
      return false;
    } else if (c.myShopId == 7390) {
      return false;
    }
    if (System.currentTimeMillis() - buyDelay < 1500) {
      return false;
    }

    if (c.myShopId == 14) {
      skillBuy(itemID);
      return false;

    } else if (c.myShopId == 15) {
      buyVoid(itemID);
      return false;

    } else if (c.myShopId == 1) {
      buyVoid(itemID);
      return false;
    }
    if (itemID != itemID) {
      c.sendMessage("Don't dupe or you will be IP Banned");
      return false;
    }

    if (!shopSellsItem(itemID)) return false;

    if (amount > 0) {
      if (amount > Server.shopHandler.ShopItemsN[c.myShopId][fromSlot]) {
        amount = Server.shopHandler.ShopItemsN[c.myShopId][fromSlot];
      }
      // double ShopValue;
      // double TotPrice;
      int TotPrice2 = 0;
      // int Overstock;
      int Slot = 0;
      int Slot1 = 0; // Tokkul
      int Slot2 = 0; // Pking Points
      int Slot3 = 0; // Donator Gold
      int Slot4 = 0; // Dragon Tokens

      if (c.myShopId == 18) {
        handleOtherShop(itemID);
        return false;
      }
      if (c.myShopId == 73) {
        handleOtherShop(itemID);
        return false;
      }
      if (c.myShopId == 74) {
        handleOtherShop(itemID);
        return false;
      }
      if (c.myShopId == 10) {
        handleOtherShop(itemID);
        return false;
      }
      if (c.myShopId == 11) {
        handleOtherShop(itemID);
        return false;
      }
      if (c.myShopId == 48) {
        handleOtherShop(itemID);
        return false;
      }
      if (amount > 1000) {
        TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, fromSlot)) * amount;
        Slot = c.getItems().getItemSlot(995);
        if (Slot == -1 && TotPrice2 != 0) {
          c.sendMessage("You don't have enough coins.");
        }
        if (TotPrice2 <= 1) {
          TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, fromSlot));
        }
        if (TotPrice2 <= 0) {
          if (c.getItems().freeSlots() > 0) {
            c.getItems().addItem(itemID, amount);
            Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
            Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
            if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
              Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
            }
          } else {
            c.sendMessage("Not enough space in your inventory.");
          }
        } else if (c.playerItemsN[Slot] >= TotPrice2) {
          if (c.getItems().freeSlots() > 0) {
            c.getItems().deleteItem(995, c.getItems().getItemSlot(995), TotPrice2);
            c.getItems().addItem(itemID, amount);
            Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= amount;
            Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
            if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
              Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
            }
          } else {
            c.sendMessage("Not enough space in your inventory.");
          }
        } else {
          c.sendMessage("You don't have enough coins.");
        }
      } else {
      }
      for (int i = amount; i > 0; i--) {
        TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, fromSlot));
        Slot = c.getItems().getItemSlot(995);
        Slot1 = c.getItems().getItemSlot(6529);
        Slot3 = c.getItems().getItemSlot(5555);
        Slot4 = c.getItems().getItemSlot(7478);
        if (Slot == -1
            && c.myShopId != 11
            && c.myShopId != 29
            && c.myShopId != 30
            && c.myShopId != 31
            && c.myShopId != 47) {
          c.sendMessage("You don't have enough coins.");
          break;
        }
        if (Slot1 == -1 && c.myShopId == 29 || c.myShopId == 30 || c.myShopId == 31) {
          c.sendMessage("You don't have enough tokkul.");
          break;
        }
        if (Slot4 == -1 && c.myShopId == 78) {
          c.sendMessage("You don't have enough DT's.");
          break;
        }

        if (TotPrice2 <= 1) {
          TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, fromSlot));
          TotPrice2 *= 1.66;
        }
        if (c.myShopId == 29 || c.myShopId == 30 || c.myShopId == 31) {
          if (c.playerItemsN[Slot1] >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.getItems().deleteItem(6529, c.getItems().getItemSlot(6529), TotPrice2);
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough tokkul.");
            break;
          }
        } else if (c.myShopId == 47) {
          if (c.pkPoints >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.pkPoints -= TotPrice2;
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough reflexion Points.");
            break;
          }
        } else if (c.myShopId == 48) {
          if (c.SPoints >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.SPoints -= TotPrice2;
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough Slayer Points.");
            break;
          }
        } else if (c.myShopId == 11) {
          if (c.lvlPoints >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.lvlPoints -= TotPrice2;
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough lvl Points.");
            break;
          }
        } else if (c.myShopId == 10) {
          if (c.donorPoints >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.donorPoints -= TotPrice2;
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough Donor Points.");
            break;
          }
        } else if (c.myShopId == 78) {
          if (c.playerItemsN[Slot4] >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.getItems().deleteItem(7478, c.getItems().getItemSlot(7478), TotPrice2);
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough DT's.");
            break;
          }
        } else if (c.myShopId != 11 && c.myShopId != 29
            || c.myShopId != 30
            || c.myShopId != 31
            || c.myShopId != 47) {
          if (c.playerItemsN[Slot] >= TotPrice2) {
            if (c.getItems().freeSlots() > 0) {
              buyDelay = System.currentTimeMillis();
              c.getItems().deleteItem(995, c.getItems().getItemSlot(995), TotPrice2);
              c.getItems().addItem(itemID, 1);
              Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
              Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
              if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
                Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
              }
            } else {
              c.sendMessage("You don't have enough space in your inventory.");
              break;
            }
          } else {
            c.sendMessage("You don't have enough coins.");
            break;
          }
        }
      }
      c.getItems().resetItems(3823);
      resetShop(c.myShopId);
      updatePlayerShop();
      return true;
    }
    return false;
  }
Пример #30
0
 /** buy item from shop (Shop Price) */
 public void buyFromShopPrice(int removeId, int removeSlot) {
   if (c.myShopId == 7390
       && c.myShopClient != null
       && !c.myShopClient.playerName.equals(c.playerName)) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + c.myShopClient.playerShopP[removeSlot]
             + " DT's.");
     return;
   } else if (c.myShopId == 7390
       && c.myShopClient != null
       && c.myShopClient.playerName.equals(c.playerName)) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + c.playerShopP[removeSlot]
             + " DT's.");
     return;
   }
   int ShopValue = (int) Math.floor(getItemShopValue(removeId, 0, removeSlot));
   ShopValue *= 1;
   String ShopAdd = "";
   if (c.myShopId == 18) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " EXLp.");
     return;
   }
   if (c.myShopId == 73) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " EXLp.");
     return;
   }
   if (c.myShopId == 74) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " EXLp.");
     return;
   }
   if (c.myShopId == 15) {
     c.sendMessage(
         "This item current costs " + c.getItems().getUntradePrice(removeId) + " coins.");
     return;
   }
   if (c.myShopId == 10) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " Donator Points.");
     return;
   }
   if (c.myShopId == 48) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " Slayer Points.");
     return;
   }
   if (c.myShopId == 78) {
     c.sendMessage(
         c.getItems().getItemName(removeId)
             + ": currently costs "
             + getSpecialItemValue(removeId)
             + " DT's.");
     return;
   }
   if (ShopValue >= 1000 && ShopValue < 1000000) {
     ShopAdd = " (" + (ShopValue / 1000) + "K)";
   } else if (ShopValue >= 1000000) {
     ShopAdd = " (" + (ShopValue / 1000000) + " million)";
   }
   c.sendMessage(
       c.getItems().getItemName(removeId) + ": currently costs " + ShopValue + " coins" + ShopAdd);
 }