Beispiel #1
0
 public void handlePotion(int itemId, int slot) {
   if (c.duelRule[5]) {
     c.sendMessage("You may not drink potions in this duel.");
     return;
   }
   if (System.currentTimeMillis() - c.potDelay >= 1200) {
     c.potDelay = System.currentTimeMillis();
     c.foodDelay = c.potDelay;
     c.getCombat().resetPlayerAttack();
     c.attackTimer++;
     c.sendMessage(
         "You drink some of your " + server.org.engine.item.Item.getItemName(itemId) + ".");
     String item = server.org.engine.item.Item.getItemName(itemId);
     if (item.endsWith("(4)")) {
       c.sendMessage("You have 3 doses of potion left.");
     } else if (item.endsWith("(3)")) {
       c.sendMessage("You have 2 doses of potion left.");
     } else if (item.endsWith("(2)")) {
       c.sendMessage("You have 1 dose of potion left.");
     } else if (item.endsWith("(1)")) {
       c.sendMessage("You have finished your potion.");
     }
     switch (itemId) {
         // Magic pots
       case 3040:
         drinkMagicPotion(itemId, 3042, slot, 6, false);
         break;
       case 3042:
         drinkMagicPotion(itemId, 3044, slot, 6, false);
         break;
       case 3044:
         drinkMagicPotion(itemId, 3046, slot, 6, false);
         break;
       case 3046:
         drinkMagicPotion(itemId, 229, slot, 6, false);
         break;
       case 6685: // brews
         doTheBrew(itemId, 6687, slot);
         break;
       case 6687:
         doTheBrew(itemId, 6689, slot);
         break;
       case 6689:
         doTheBrew(itemId, 6691, slot);
         break;
       case 6691:
         doTheBrew(itemId, 229, slot);
         break;
       case 2436:
         drinkStatPotion(itemId, 145, slot, 0, true); // sup attack
         break;
       case 145:
         drinkStatPotion(itemId, 147, slot, 0, true);
         break;
       case 147:
         drinkStatPotion(itemId, 149, slot, 0, true);
         break;
       case 149:
         drinkStatPotion(itemId, 229, slot, 0, true);
         break;
       case 2440:
         drinkStatPotion(itemId, 157, slot, 2, true); // sup str
         break;
       case 157:
         drinkStatPotion(itemId, 159, slot, 2, true);
         break;
       case 159:
         drinkStatPotion(itemId, 161, slot, 2, true);
         break;
       case 161:
         drinkStatPotion(itemId, 229, slot, 2, true);
         break;
       case 2444:
         drinkStatPotion(itemId, 169, slot, 4, false); // range pot
         break;
       case 169:
         drinkStatPotion(itemId, 171, slot, 4, false);
         break;
       case 171:
         drinkStatPotion(itemId, 173, slot, 4, false);
         break;
       case 173:
         drinkStatPotion(itemId, 229, slot, 4, false);
         break;
       case 2432:
         drinkStatPotion(itemId, 133, slot, 1, false); // def pot
         break;
       case 133:
         drinkStatPotion(itemId, 135, slot, 1, false);
         break;
       case 135:
         drinkStatPotion(itemId, 137, slot, 1, false);
         break;
       case 137:
         drinkStatPotion(itemId, 229, slot, 1, false);
         break;
       case 113:
         drinkStatPotion(itemId, 115, slot, 2, false); // str pot
         break;
       case 115:
         drinkStatPotion(itemId, 117, slot, 2, false);
         break;
       case 117:
         drinkStatPotion(itemId, 119, slot, 2, false);
         break;
       case 119:
         drinkStatPotion(itemId, 229, slot, 2, false);
         break;
       case 2428:
         drinkStatPotion(itemId, 121, slot, 0, false); // attack
         // pot
         break;
       case 121:
         drinkStatPotion(itemId, 123, slot, 0, false);
         break;
       case 123:
         drinkStatPotion(itemId, 125, slot, 0, false);
         break;
       case 125:
         drinkStatPotion(itemId, 229, slot, 0, false);
         break;
       case 2442:
         drinkStatPotion(itemId, 163, slot, 1, true); // super def
         // pot
         break;
       case 163:
         drinkStatPotion(itemId, 165, slot, 1, true);
         break;
       case 165:
         drinkStatPotion(itemId, 167, slot, 1, true);
         break;
       case 167:
         drinkStatPotion(itemId, 229, slot, 1, true);
         break;
       case 3024:
         drinkPrayerPot(itemId, 3026, slot, true); // sup restore
         break;
       case 3026:
         drinkPrayerPot(itemId, 3028, slot, true);
         break;
       case 3028:
         drinkPrayerPot(itemId, 3030, slot, true);
         break;
       case 3030:
         drinkPrayerPot(itemId, 229, slot, true);
         break;
       case 10925:
         drinkPrayerPot(itemId, 10927, slot, true); // sanfew
         // serums
         curePoison(300000);
         break;
       case 10927:
         drinkPrayerPot(itemId, 10929, slot, true);
         curePoison(300000);
         break;
       case 10929:
         drinkPrayerPot(itemId, 10931, slot, true);
         curePoison(300000);
         break;
       case 10931:
         drinkPrayerPot(itemId, 229, slot, true);
         curePoison(300000);
         break;
       case 2434:
         drinkPrayerPot(itemId, 139, slot, false); // pray pot
         break;
       case 139:
         drinkPrayerPot(itemId, 141, slot, false);
         break;
       case 141:
         drinkPrayerPot(itemId, 143, slot, false);
         break;
       case 143:
         drinkPrayerPot(itemId, 229, slot, false);
         break;
       case 2446:
         drinkAntiPoison(itemId, 175, slot, 30000); // anti poisons
         break;
       case 175:
         drinkAntiPoison(itemId, 177, slot, 30000);
         break;
       case 177:
         drinkAntiPoison(itemId, 179, slot, 30000);
         break;
       case 179:
         drinkAntiPoison(itemId, 229, slot, 30000);
         break;
       case 2448:
         drinkAntiPoison(itemId, 181, slot, 300000); // anti
         // poisons
         break;
       case 181:
         drinkAntiPoison(itemId, 183, slot, 300000);
         break;
       case 183:
         drinkAntiPoison(itemId, 185, slot, 300000);
         break;
       case 185:
         drinkAntiPoison(itemId, 229, slot, 300000);
         break;
     }
   }
 }