GenuineSounds

Item Drops

Aug 10th, 2011
197
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.26 KB | None | 0 0
  1. @Override
  2.     public int getDropItemId() {
  3.         if (npcIsFriend) {
  4.             if (Math.random() < 0.25) {
  5.                 if (npcLevel <= 9) {
  6.                     return Item.arrow.shiftedIndex;
  7.                 }
  8.                 if (npcLevel >= 10 && npcLevel <= 19) {
  9.                     return Item.cookie.shiftedIndex;
  10.                 }
  11.                 if (npcLevel >= 20 && npcLevel <= 29) {
  12.                     return Item.gunpowder.shiftedIndex;
  13.                 }
  14.                 if (npcLevel >= 30 && npcLevel <= 39) {
  15.                     return Item.cake.shiftedIndex;
  16.                 }
  17.                 if (npcLevel >= 40 && npcLevel <= 49) {
  18.                     return Block.tnt.blockID;
  19.                 }
  20.                 if (npcLevel == 50) {
  21.                     final double rand = Math.random() * 50;
  22.                     if (rand >= 0 && rand <= 7) {
  23.                         return Block.blockGold.blockID;
  24.                     }
  25.                     if (rand >= 8 && rand <= 17) {
  26.                         return Item.appleGold.shiftedIndex;
  27.                     }
  28.                     if (rand >= 18 && rand <= 27) {
  29.                         return Item.diamond.shiftedIndex;
  30.                     }
  31.                     if (rand >= 28 && rand <= 37) {
  32.                         return Block.obsidian.blockID;
  33.                     }
  34.                     if (rand >= 38 && rand <= 47) {
  35.                         return Block.blockSteel.blockID;
  36.                     }
  37.                     if (rand >= 48 && rand <= 50) {
  38.                         return Block.blockDiamond.blockID;
  39.                     }
  40.                 }
  41.             } else {
  42.                 return GenuineNpcItems.HumanBrain.shiftedIndex;
  43.             }
  44.         } else if (Math.random() < 0.25) {
  45.             if (npcLevel <= 9) {
  46.                 return Item.arrow.shiftedIndex;
  47.             }
  48.             if (npcLevel >= 10 && npcLevel <= 19) {
  49.                 return Item.cookie.shiftedIndex;
  50.             }
  51.             if (npcLevel >= 20 && npcLevel <= 29) {
  52.                 return Item.gunpowder.shiftedIndex;
  53.             }
  54.             if (npcLevel >= 30 && npcLevel <= 39) {
  55.                 return Item.cake.shiftedIndex;
  56.             }
  57.             if (npcLevel >= 40 && npcLevel <= 49) {
  58.                 return Block.tnt.blockID;
  59.             }
  60.             if (npcLevel == 50) {
  61.                 final int rand = (int) (Math.random() * 50);
  62.                 if (rand >= 0 && rand <= 7) {
  63.                     return Block.blockGold.blockID;
  64.                 }
  65.                 if (rand >= 8 && rand <= 17) {
  66.                     return Item.appleGold.shiftedIndex;
  67.                 }
  68.                 if (rand >= 18 && rand <= 27) {
  69.                     return Item.diamond.shiftedIndex;
  70.                 }
  71.                 if (rand >= 28 && rand <= 37) {
  72.                     return Block.obsidian.blockID;
  73.                 }
  74.                 if (rand >= 38 && rand <= 47) {
  75.                     return Block.blockSteel.blockID;
  76.                 }
  77.                 if (rand >= 48 && rand <= 50) {
  78.                     return Block.blockDiamond.blockID;
  79.                 }
  80.             }
  81.         } else {
  82.             return GenuineNpcItems.ZombieBrain.shiftedIndex;
  83.         }
  84.         return 0;
  85.     }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment