Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. /**
  2. * Represents different Familiar's.
  3. * @Author: Brandyn
  4. */
  5. public static enum Familiar {
  6. WOLPERTINGER(6870, 12089, FamiliarType.NORMAL, 0, 40, "Familiar Special", new FamiliarSpecial() {
  7. @Override
  8. public void execute(Object... arguments) {
  9. if(((Client) arguments[2]).getItems().playerHasItem(12089)) {
  10. ((Client) arguments[2]).startAnimation(7660);
  11. ((Client) arguments[2]).gfx0(1313);
  12. ((Client) arguments[2]).getItems().deleteItem(12089, 1);
  13. ((Client) arguments[2]).getPotions().enchanceStat(6, false);
  14. }
  15. }}), PACK_YAK(6873, 12093, FamiliarType.BOB, 30, 10, "Take BoB", new FamiliarSpecial() {
  16. @Override
  17. public void execute(Object... arguments) {
  18. if(((Client) arguments[2]).getItems().playerHasItem(12435)) {
  19. ((Client) arguments[2]).startAnimation(7660);
  20. ((Client) arguments[2]).gfx0(1316);
  21. ((Client) arguments[2]).getItems().bankItem((Integer) arguments[0], (Integer) arguments[1], 1);
  22. ((Client) arguments[2]).getItems().deleteItem(12435, 1);
  23. ((Client) arguments[2]).sendMessage("Your Pack Yak sends the item back to your bank.");
  24. }
  25. }});
  26.  
  27. private Familiar(int npcId, int pouchId, FamiliarType familiarType, int storeCapacity, int specialEnergyConsumption, String clientTooltip, FamiliarSpecial familiarSpecial) {
  28. this.npcId = npcId;
  29. this.pouchId = pouchId;
  30. this.familiarType = familiarType;
  31. this.storeCapacity = storeCapacity;
  32. this.specialEnergyConsumption = specialEnergyConsumption;
  33. this.clientTooltip = "Dismiss Familiar;Renew Familiar;Call Familiar;" + clientTooltip;
  34. this.familiarSpecial = familiarSpecial;
  35. }
  36.  
  37. public int npcId;
  38. public int pouchId;
  39. public FamiliarType familiarType;
  40. public int storeCapacity;
  41. public int specialEnergyConsumption;
  42. public String clientTooltip;
  43. public FamiliarSpecial familiarSpecial;
  44.  
  45. public static HashMap <Integer, Familiar> familiars = new HashMap<Integer, Familiar>();
  46.  
  47. public static Familiar forPouchId(int id) {
  48. return familiars.get(id);
  49. }
  50.  
  51. static {
  52. for (Familiar f : Familiar.values())
  53. familiars.put(f.pouchId, f);
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement