Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 15.98 KB | None | 0 0
  1. package server;
  2.  
  3.  
  4. /**
  5.  *@Auther - Jeff
  6.  *Herblore Class
  7.  */
  8.  
  9. public class Herblore {
  10.  
  11.  
  12.     public Client c;
  13.  
  14.     public Herblore(Client client) {
  15.         this.c = client;
  16.     }
  17.  
  18.  
  19.     public void potionMaking(int itemUsed, int useWith) {
  20.  
  21.     /**
  22.      *List of Potions for Dose Mixing
  23.      */
  24.     public static final int potions[][] = { { 229, 125, 123, 121, 2428 },
  25.         { 229, 179, 177, 175, 2446 }, { 229, 119, 117, 115, 113 },
  26.         { 229, 131, 129, 127, 2430 }, { 229, 137, 135, 133, 2432 },
  27.         { 229, 143, 141, 139, 2434 }, { 229, 149, 147, 145, 2436 },
  28.         { 229, 161, 159, 157, 2440 }, { 229, 3030, 3028, 3026, 3024 },
  29.         { 229, 167, 165, 163, 2442 }, { 229, 6691, 6689, 6687, 6685 } };
  30.  
  31.  
  32.  
  33.         /**
  34.          *This method handles the potion dose mixing
  35.          */
  36.  
  37.         potionLoop: for (int i2 = 0; i2 < potions.length; i2++) {
  38.             for (int i3 = 1; i3 < potions[i2].length; i3++) {
  39.                 if (itemUsed == potions[i2][i3]) {
  40.                     for (int i4 = 1; i4 < potions[i2].length; i4++) {
  41.                         if (useWith == potions[i2][i4]) {
  42.                             int newDosage1 = 0;
  43.                             int newDosage2 = i3 + i4;
  44.                             if (newDosage2 >= potions[i2].length) {
  45.                                 newDosage1 = (newDosage2)
  46.                                 - (potions[i2].length - 1);
  47.                                 newDosage2 = potions[i2].length - 1;
  48.                             }
  49.                             playerItems[itemUsedSlot] = potions[i2][newDosage1] + 1;
  50.                             playerItems[usedWithSlot] = potions[i2][newDosage2] + 1;
  51.                             resetItems(3214);
  52.                             break potionLoop;
  53.                         }
  54.                     }
  55.                     break potionLoop;
  56.                 }
  57.             }
  58.         }
  59.  
  60.         /**
  61.          * Start of Herb Identification
  62.          */
  63.         if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  64.             c.actionInterval = 1800;
  65.             c.lastAction = System.currentTimeMillis();
  66.             switch (ItemID) {
  67.  
  68.             case 199: // Guam Leaf Indentifier
  69.                 if (playerLevel[15] >= 1) {
  70.                     c.deleteItem(199, 1);
  71.                     c.sM("You indentify the herb, it's a Guam Leaf");
  72.                     c.addItem(249, 1);
  73.                     c.addSkillXP(100, 15);
  74.                 }
  75.  
  76.                 break;
  77.             case 201: // Marentill Indentifier
  78.                 if (playerLevel[15] >= 5) {
  79.                     c.deleteItem(201, 1);
  80.                     c.sM("You indentify the herb, it's a Marrentill");
  81.                     c.addItem(251, 1);
  82.                     c.addSkillXP(200, 15);
  83.                 } else {
  84.                     c.sM("You need a Herblore Level of 5 to indentify this");
  85.                 }
  86.  
  87.                 break;
  88.             case 203: // Tarromin Indentifier
  89.                 if (playerLevel[15] >= 11) {
  90.                     c.deleteItem(203, 1);
  91.                     c.sM("You indentify the herb, it's a Tarromin");
  92.                     c.addItem(253, 1);
  93.                     c.addSkillXP(400, 15);
  94.                 } else {
  95.                     c.sM("You need a Herblore Level of 11 to indentify this");
  96.                 }
  97.                 break;
  98.             case 205: // Harralander Indentifier
  99.                 if (playerLevel[15] >= 20) {
  100.                     c.deleteItem(205, 1);
  101.                     c.sM("You indentify the herb, it's a Harralander");
  102.                     c.addItem(255, 1);
  103.                     c.addSkillXP(800, 15);
  104.                 } else {
  105.                     c.sM("You need a Herblore Level of 20 to indentify this");
  106.                 }
  107.                 break;
  108.             case 207: // Ranarr Weed Indentifier
  109.                 if (playerLevel[15] >= 25) {
  110.                     c.deleteItem(207, 1);
  111.                     c.sM("You indentify the herb, it's a Ranarr Weed");
  112.                     c.addItem(257, 1);
  113.                     c.addSkillXP(1600, 15);
  114.                 } else {
  115.                     c.sM("You need a Herblore Level of 25 to indentify this");
  116.                 }
  117.                 break;
  118.  
  119.             case 209: // Irit Leaf Indentifier
  120.                 if (playerLevel[15] >= 40) {
  121.                     c.deleteItem(209, 1);
  122.                     c.sM("You indentify the herb, it's an Irit Leaf");
  123.                     c.addItem(259, 1);
  124.                     c.addSkillXP(3200, 15);
  125.                 } else {
  126.                     c.sM("You need a Herblore Level of 40 to indentify this");
  127.                 }
  128.                 break;
  129.             case 211: // Avantoe Indentifier
  130.                 if (playerLevel[15] >= 48) {
  131.                     c.deleteItem(211, 1);
  132.                     c.sM("You indentify the herb, it's an Avantoe");
  133.                     c.addItem(261, 1);
  134.                     c.addSkillXP(6400, 15);
  135.                 } else {
  136.                     c.sM("You need a Herblore Level of 48 to indentify this");
  137.                 }
  138.                 break;
  139.             case 213: // Kwuarm Indentifier
  140.                 if (playerLevel[15] >= 54) {
  141.                     c.deleteItem(213, 1);
  142.                     c.sM("You indentify the herb, it's a Kwuarm");
  143.                     c.addItem(263, 1);
  144.                     c.addSkillXP(12800, 15);
  145.                 } else {
  146.                     c.sM("You need a Herblore Level of 54 to indentify this");
  147.                 }
  148.                 break;
  149.             case 215: // Cadantine Indentifier
  150.                 if (playerLevel[15] >= 65) {
  151.                     c.deleteItem(215, 1);
  152.                     c.sM("You indentify the herb, it's a Cadantine");
  153.                     c.addItem(265, 1);
  154.                     c.addSkillXP(25600, 15);
  155.                 } else {
  156.                     c.sM("You need a Herblore Level of 65 to indentify this");
  157.                 }
  158.                 break;
  159.             case 217: // Dwarf Weed Indentifier
  160.                 if (playerLevel[15] >= 70) {
  161.                     c.deleteItem(217, 1);
  162.                     c.sM("You indentify the herb, it's a Dwarf Weed");
  163.                     c.addItem(267, 1);
  164.                     c.addSkillXP(51200, 15);
  165.                 } else {
  166.                     c.sM("You need a Herblore Level of 70 to indentify this");
  167.                 }
  168.                 break;
  169.             case 219: // Torstol Indentifier
  170.                 if (playerLevel[15] >= 75) {
  171.                     c.deleteItem(219, 1);
  172.                     c.sM("You indentify the herb, it's a Torstol");
  173.                     c.addItem(269, 1);
  174.                     c.addSkillXP(102400, 15);
  175.                 } else {
  176.                     c.sM("You need a Herblore Level of 75 to indentify this");
  177.                 }
  178.                 break;
  179.             }
  180.         }
  181.         /**
  182.          *End of Identifying
  183.          */
  184.         break;
  185.  
  186.  
  187.         /**
  188.          * Start of Herblore potion making
  189.          */
  190.         // Guam used on Vial
  191.         if (itemUsed == 227 && useWith == 249 || itemUsed == 249
  192.                 && useWith == 227) {
  193.             if (playerLevel[15] >= 1) {
  194.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  195.                     c.actionInterval = 2800;
  196.                     c.lastAction = System.currentTimeMillis();
  197.                     c.deleteItem(227, 1);
  198.                     c.deleteItem(249, 1);
  199.                     c.setAnimation(3283);
  200.                     c.addItem(91, 1);
  201.                     c.sM("You combine the ingredients together to form an unfinished potion");
  202.                 }
  203.             }
  204.         }
  205.         // Marrentill used on Vial
  206.         if (itemUsed == 227 && useWith == 251 || itemUsed == 251
  207.                 && useWith == 227) {
  208.             if (playerLevel[15] >= 5) {
  209.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  210.                     c.actionInterval = 2800;
  211.                     c.lastAction = System.currentTimeMillis();
  212.                     c.deleteItem(227, 1);
  213.                     c.deleteItem(251, 1);
  214.                     c.setAnimation(3283);
  215.                     c.addItem(93, 1);
  216.                     c.sM("You combine the ingredients together to form an unfinished potion");
  217.                 }
  218.             } else {
  219.                 c.sM("You need an Herblore Level of 5 to make this");
  220.             }
  221.         }
  222.  
  223.         // Tarromin used on Vial
  224.         if (itemUsed == 227 && useWith == 253 || itemUsed == 253
  225.                 && useWith == 227) {
  226.             if (playerLevel[15] >= 12) {
  227.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  228.                     c.actionInterval = 2800;
  229.                     c.lastAction = System.currentTimeMillis();
  230.                     c.deleteItem(227, 1);
  231.                     c.deleteItem(253, 1);
  232.                     c.setAnimation(3283);
  233.                     c.addItem(95, 1);
  234.                     c.sM("You combine the ingredients together to form an unfinished potion");
  235.                 }
  236.             } else {
  237.                 c.sM("You need an Herblore Level of 12 to make this");
  238.             }
  239.         }
  240.  
  241.         // Harralander Weed used on Vial
  242.         if (itemUsed == 227 && useWith == 255 || itemUsed == 255
  243.                 && useWith == 227) {
  244.             if (playerLevel[15] >= 22) {
  245.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  246.                     c.actionInterval = 2800;
  247.                     c.lastAction = System.currentTimeMillis();
  248.                     c.deleteItem(227, 1);
  249.                     c.deleteItem(255, 1);
  250.                     c.setAnimation(3283);
  251.                     c.addItem(97, 1);
  252.                     c.sM("You combine the ingredients together to form an unfinished potion");
  253.                 }
  254.             } else {
  255.                 c.sM("You need an Herblore Level of 22 to make this");
  256.             }
  257.         }
  258.  
  259.         // Ranarr Weed used on Vial
  260.         if (itemUsed == 227 && useWith == 257 || itemUsed == 257
  261.                 && useWith == 227) {
  262.             if (playerLevel[15] >= 30) {
  263.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  264.                     c.actionInterval = 2800;
  265.                     c.lastAction = System.currentTimeMillis();
  266.                     c.deleteItem(227, 1);
  267.                     c.deleteItem(257, 1);
  268.                     c.setAnimation(3283);
  269.                     c.addItem(99, 1);
  270.                     c.sM("You combine the ingredients together to form an unfinished potion");
  271.                 }
  272.             } else {
  273.                 c.sM("You need an Herblore Level of 30 to make this");
  274.             }
  275.         }
  276.  
  277.         // Irit Leaf used on Vial
  278.         if (itemUsed == 227 && useWith == 259 || itemUsed == 259
  279.                 && useWith == 227) {
  280.             if (playerLevel[15] >= 45) {
  281.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  282.                     c.actionInterval = 2800;
  283.                     c.lastAction = System.currentTimeMillis();
  284.                     c.deleteItem(227, 1);
  285.                     c.deleteItem(259, 1);
  286.                     c.setAnimation(3283);
  287.                     c.addItem(101, 1);
  288.                     c.sM("You combine the ingredients together to form an unfinished potion");
  289.                 }
  290.             } else {
  291.                 c.sM("You need an Herblore Level of 45 to make this");
  292.             }
  293.         }
  294.         // Avantoe used on Vial
  295.         if (itemUsed == 227 && useWith == 261 || itemUsed == 261
  296.                 && useWith == 227) {
  297.             if (playerLevel[15] >= 52) {
  298.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  299.                     c.actionInterval = 2800;
  300.                     c.lastAction = System.currentTimeMillis();
  301.                     c.deleteItem(227, 1);
  302.                     c.deleteItem(261, 1);
  303.                     c.setAnimation(3283);
  304.                     c.addItem(103, 1);
  305.                     c.sM("You combine the ingredients together to form an unfinished potion");
  306.                 }
  307.             } else {
  308.                 c.sM("You need an Herblore Level of 52 to make this");
  309.             }
  310.         }
  311.         // Kwuarm used on Vial
  312.         if (itemUsed == 227 && useWith == 263 || itemUsed == 263
  313.                 && useWith == 227) {
  314.             if (playerLevel[15] >= 55) {
  315.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  316.                     c.actionInterval = 2800;
  317.                     c.lastAction = System.currentTimeMillis();
  318.                     c.deleteItem(227, 1);
  319.                     c.deleteItem(263, 1);
  320.                     c.setAnimation(3283);
  321.                     c.addItem(105, 1);
  322.                     c.sM("You combine the ingredients together to form an unfinished potion");
  323.                 }
  324.             } else {
  325.                 c.sM("You need an Herblore Level of 55 to make this");
  326.             }
  327.         }
  328.  
  329.         // Cadantine used on Vial
  330.         if (itemUsed == 227 && useWith == 265 || itemUsed == 265
  331.                 && useWith == 227) {
  332.             if (playerLevel[15] >= 66) {
  333.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  334.                     c.actionInterval = 2800;
  335.                     c.lastAction = System.currentTimeMillis();
  336.                     c.deleteItem(227, 1);
  337.                     c.deleteItem(265, 1);
  338.                     c.setAnimation(3283);
  339.                     c.addItem(107, 1);
  340.                     c.sM("You combine the ingredients together to form an unfinished potion");
  341.                 }
  342.             } else {
  343.                 c.sM("You need an Herblore Level of 66 to make this");
  344.             }
  345.         }
  346.         // Dwarf Weed used on Vial
  347.         if (itemUsed == 227 && useWith == 267 || itemUsed == 267
  348.                 && useWith == 227) {
  349.             if (playerLevel[15] >= 72) {
  350.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  351.                     c.actionInterval = 2800;
  352.                     c.lastAction = System.currentTimeMillis();
  353.                     c.deleteItem(227, 1);
  354.                     c.deleteItem(267, 1);
  355.                     c.setAnimation(3283);
  356.                     c.addItem(109, 1);
  357.                     c.sM("You combine the ingredients together to form an unfinished potion");
  358.                 }
  359.             } else {
  360.                 c.sM("You need an Herblore Level of 72 to make this");
  361.             }
  362.         }
  363.         // Eye of Newt used on Unfinished Potion
  364.         if (itemUsed == 221 && useWith == 91 || itemUsed == 91
  365.                 && useWith == 221) {
  366.             if (playerLevel[15] >= 1) {
  367.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  368.                     c.actionInterval = 2800;
  369.                     c.lastAction = System.currentTimeMillis();
  370.                     c.deleteItem(221, 1);
  371.                     c.deleteItem(91, 1);
  372.                     c.setAnimation(3283);
  373.                     c.addItem(121, 1);
  374.                     c.addSkillXP(1000, 15);
  375.                     c.sM("You add an Eye of Newt to create an Attack Potion");
  376.                 }
  377.             }
  378.         }
  379.  
  380.         // Unicorn horn dust on Unfinished potion
  381.         if (itemUsed == 235 && useWith == 93 || itemUsed == 93
  382.                 && useWith == 235) {
  383.             if (playerLevel[15] >= 5) {
  384.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  385.                     c.actionInterval = 2800;
  386.                     c.lastAction = System.currentTimeMillis();
  387.                     c.deleteItem(235, 1);
  388.                     c.deleteItem(93, 1);
  389.                     c.setAnimation(3283);
  390.                     c.addItem(175, 1);
  391.                     c.addSkillXP(1000, 15);
  392.                     c.sM("You add Unicorn horn dust to create an Anti-Posion Potion");
  393.                 }
  394.             } else {
  395.                 c.sM("You need an Herblore Level of 5 to make this");
  396.             }
  397.         }
  398.  
  399.         // Limpwurt root used on Unfinished potion
  400.         if (itemUsed == 225 && useWith == 95 || itemUsed == 95
  401.                 && useWith == 225) {
  402.             if (playerLevel[15] >= 12) {
  403.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  404.                     c.actionInterval = 2800;
  405.                     c.lastAction = System.currentTimeMillis();
  406.                     c.deleteItem(221, 1);
  407.                     c.deleteItem(95, 1);
  408.                     c.setAnimation(3283);
  409.                     c.addItem(113, 1);
  410.                     c.addSkillXP(1000, 15);
  411.                     c.sM("You add Limpwurt root to create an Strength Potion");
  412.                 }
  413.             } else {
  414.                 c.sM("You need an Herblore Level of 12 to make this");
  415.             }
  416.         }
  417.         // Red spider eggs root used on Unfinished potion
  418.         if (itemUsed == 223 && useWith == 97 || itemUsed == 97
  419.                 && useWith == 223) {
  420.             if (playerLevel[15] >= 22) {
  421.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  422.                     c.actionInterval = 2800;
  423.                     c.lastAction = System.currentTimeMillis();
  424.                     c.deleteItem(223, 1);
  425.                     c.deleteItem(97, 1);
  426.                     c.setAnimation(3283);
  427.                     c.addItem(127, 1);
  428.                     c.addSkillXP(1000, 15);
  429.                     c.sM("You add Red Spider eggs to create a Restore Potion");
  430.                 }
  431.             } else {
  432.                 c.sM("You need an Herblore Level of 22 to make this");
  433.             }
  434.         }
  435.  
  436.         // White berries used on Unfinished potion
  437.         if (itemUsed == 239 && useWith == 99 || itemUsed == 99
  438.                 && useWith == 239) {
  439.             if (playerLevel[15] >= 30) {
  440.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  441.                     c.actionInterval = 2800;
  442.                     c.lastAction = System.currentTimeMillis();
  443.                     c.deleteItem(239, 1);
  444.                     c.deleteItem(99, 1);
  445.                     c.setAnimation(3283);
  446.                     c.addItem(134, 1);
  447.                     c.addSkillXP(1000, 15);
  448.                     c.sM("You add White berries to create a Defence Potion");
  449.                 }
  450.             } else {
  451.                 c.sM("You need an Herblore Level of 30 to make this");
  452.             }
  453.         }
  454.  
  455.         // Snape Grass used on Unfinished potion
  456.         if (itemUsed == 231 && useWith == 99 || itemUsed == 99
  457.                 && useWith == 231) {
  458.             if (playerLevel[15] >= 38) {
  459.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  460.                     c.actionInterval = 2800;
  461.                     c.lastAction = System.currentTimeMillis();
  462.                     c.deleteItem(231, 1);
  463.                     c.deleteItem(99, 1);
  464.                     c.setAnimation(3283);
  465.                     c.addItem(139, 1);
  466.                     c.addSkillXP(1000, 15);
  467.                     c.sM("You add Snape Grass to create a Prayer Potion");
  468.                 }
  469.             } else {
  470.                 c.sM("You need an Herblore Level of 38 to make this");
  471.             }
  472.         }
  473.  
  474.         // Eye of Newt used on Unfinished potion
  475.         if (itemUsed == 221 && useWith == 101 || itemUsed == 101
  476.                 && useWith == 221) {
  477.             if (playerLevel[15] >= 45) {
  478.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  479.                     c.actionInterval = 2800;
  480.                     c.lastAction = System.currentTimeMillis();
  481.                     c.deleteItem(221, 1);
  482.                     c.deleteItem(101, 1);
  483.                     c.setAnimation(3283);
  484.                     c.addItem(145, 1);
  485.                     c.addSkillXP(1000, 15);
  486.                     c.sM("You add an Eye of Newt to create an Super Attack Potion");
  487.                 }
  488.             } else {
  489.                 c.sM("You need an Herblore Level of 45 to make this");
  490.             }
  491.         }
  492.  
  493.         // Limpwurt Root used on Unfinished potion
  494.         if (itemUsed == 225 && useWith == 103 || itemUsed == 103
  495.                 && useWith == 225) {
  496.             if (playerLevel[15] >= 55) {
  497.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  498.                     c.actionInterval = 2800;
  499.                     c.lastAction = System.currentTimeMillis();
  500.                     c.deleteItem(225, 1);
  501.                     c.deleteItem(103, 1);
  502.                     c.setAnimation(3283);
  503.                     c.addItem(157, 1);
  504.                     c.addSkillXP(1000, 15);
  505.                     c.sM("You add a Limpwurt Root to create a Super Strength Potion");
  506.                 }
  507.             } else {
  508.                 c.sM("You need an Herblore Level of 55 to make this");
  509.             }
  510.         }
  511.  
  512.         // Whiteberries used on Unfinished potion
  513.         if (itemUsed == 239 && useWith == 107 || itemUsed == 107
  514.                 && useWith == 239) {
  515.             if (playerLevel[15] >= 66) {
  516.                 if (System.currentTimeMillis() - c.lastAction > c.actionInterval) {
  517.                     c.actionInterval = 2800;
  518.                     c.lastAction = System.currentTimeMillis();
  519.                     c.deleteItem(239, 1);
  520.                     c.deleteItem(107, 1);
  521.                     c.setAnimation(3283);
  522.                     c.addItem(163, 1);
  523.                     c.addSkillXP(1000, 15);
  524.                     c.sM("You add Whiteberries to create a Super Defence Potion");
  525.                 }
  526.             } else {
  527.                 c.sM("You need an Herblore Level of 66 to make this");
  528.             }
  529.         }
  530.     }
  531. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement