Advertisement
Guest User

FishingData.java

a guest
May 30th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.83 KB | None | 0 0
  1. package server.game.content.skills.fishing;
  2.  
  3. import java.util.EnumSet;
  4. import java.util.HashMap;
  5. import java.util.Map;
  6. import java.util.Set;
  7.  
  8. import server.game.player.Player;
  9.  
  10. /**
  11. * The data for fishing.
  12. *
  13. * @author Dj
  14. */
  15. public enum FishingData {
  16.    
  17.     SPOT_1(1521, 1, 317, 321, 1, 15, 303, 621, -1, false, false, 10, 40), //Shrimps and Anchovies
  18.     SPOT_1_1(1521, 2, 327, 345, 5, 10, 307, 623, 313, true, true, 20, 30), //Sardine and Herring
  19.     SPOT_2(1519, 1, 377, -1, 40, -1, 301, 619, -1, false, false, 90, -1), //Lobster
  20.     SPOT_2_1(1519, 2, 359, 371, 35, 50, 311, 618, -1, false, false, 80, 100), //Tuna and Swordfish
  21.     SPOT_3(1520, 1, 353, 341, 16, 23, 305, 620, -1, true, false, 20, 45), //Mackerel and Cod
  22.     SPOT_3_1(1520, 2, 383, -1, 76, -1, 311, 618, -1, false, false, 110, 0), //Shark
  23.     SPOT_4(1526, 1, 335, 331, 20, 30, 309, 622, 314, true, true, 50, 70), //Trout and Salmon
  24.     SPOT_4_1(1526, 2, 389, -1, 81, -1, 303, 620, -1, false, false, 46, -1), //Manta Ray
  25.     SPOT_5(635, 1, 3142, -1, 65, -1, 303, 620, -1, false, false, 105, -1); //Karambwan
  26.    
  27.     private int spotId; //The fishing spot at which you fish at.
  28.     private int spotOption; //The option selected.
  29.     private int fishId; //The first fish ID (the main fish).
  30.     private int secondFishId; //If a second fish is available at a spot, what is the ID of that fish.
  31.     private int levelRequired; //The level required to catch the first fish.
  32.     private int secondLevelRequired; //The level required to catch the second fish.
  33.     private int tool; //The equipment that needs to be used to fish.
  34.     private int animation; //The animation performed when fishing at the spot.
  35.     private int baitUsed; //The bait which will be used if required.
  36.     private boolean secondFish; //Is a second fish available?
  37.     private boolean baitRequired; //Is bait required?
  38.     private double firstFishExperience; //The experience gained from the first fish.
  39.     private double secondFishExperience; //The experience gained from the second fish.
  40.    
  41.     FishingData(int spotId, int spotOption, int fishId, int secondFishId, int levelRequired, int secondLevelRequired, int tool, int animation, int baitUsed, boolean secondFish, boolean baitRequired, double firstFishExperience, double secondFishExperience)
  42.     {
  43.         this.spotId = spotId;
  44.         this.spotOption = spotOption;
  45.         this.fishId = fishId;
  46.         this.secondFishId = secondFishId;
  47.         this.levelRequired = levelRequired;
  48.         this.secondLevelRequired = secondLevelRequired;
  49.         this.tool = tool;
  50.         this.animation = animation;
  51.         this.baitUsed = baitUsed;
  52.         this.secondFish = secondFish;
  53.         this.baitRequired = baitRequired;
  54.         this.firstFishExperience = firstFishExperience;
  55.         this.secondFishExperience = secondFishExperience;
  56.     }
  57.    
  58.     private static Map<Integer, FishingData> fishingData = new HashMap<Integer, FishingData>();
  59.  
  60.     private static Set<FishingData> enumSet = EnumSet.allOf(FishingData.class);
  61.  
  62.     public int getSpotId() {
  63.         return spotId;
  64.     }
  65.    
  66.     public int getFishId() {
  67.         return fishId;
  68.     }
  69.    
  70.     public int getSecondFishId() {
  71.         return secondFishId;
  72.     }
  73.    
  74.     public int getLevelRequired() {
  75.         return levelRequired;
  76.     }
  77.    
  78.     public int getSecondLevelRequired() {
  79.         return secondLevelRequired;
  80.     }
  81.    
  82.     public int getToolId() {
  83.         return tool;
  84.     }
  85.    
  86.     public int getAnimation() {
  87.         return animation;
  88.     }
  89.    
  90.     public int getBaitUsed() {
  91.         return baitUsed;
  92.     }
  93.    
  94.     public boolean isSecondFishAvailable() {
  95.         return secondFish;
  96.     }
  97.    
  98.     public boolean isBaitRequired() {
  99.         return baitRequired;
  100.     }
  101.    
  102.     public double getFirstExperience() {
  103.         return firstFishExperience;
  104.     }
  105.    
  106.     public double getSecondExperience() {
  107.         return secondFishExperience;
  108.     }
  109.    
  110.     public static FishingData forId(int id) {
  111.         if (fishingData.containsKey(id)) {
  112.             return fishingData.get(id);
  113.         }
  114.         for (FishingData data : enumSet) {
  115.             fishingData.put(data.getSpotId(), data);
  116.         }
  117.         return fishingData.get(id);
  118.     }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement