Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package server.model.content;
  2.  
  3. import server.model.players.Client;
  4.  
  5. public class SummonXP {
  6.    
  7.     public static enum summonXp {
  8.        
  9.         GREEN(12159, 5, 250, 1, "Green Charm"),
  10.         GOLD(12158, 1, 200, 1, "Gold Charm"),
  11.         BLUE(12163, 10, 300, 1, "Blue Charm"),
  12.         CRIMSON(12160, 20, 400, 1, "Crimson Charm");
  13.        
  14.         int itemId;
  15.         int charmUsed;
  16.         int xpGiven;
  17.         int levelTillUse;
  18.         String name;
  19.        
  20.         private summonXp(int itemId, int charmUsed, int xpGiven, int levelTillUse, String name){
  21.             this.itemId = itemId;
  22.             this.charmUsed = charmUsed;
  23.             this.xpGiven = xpGiven;
  24.             this.levelTillUse = levelTillUse;
  25.             this.name = name;
  26.         }
  27.        
  28.         public int getLevelTillUse() {
  29.             return levelTillUse;
  30.         }
  31.  
  32.         public void setLevelTillUse(int levelTillUse) {
  33.             this.levelTillUse = levelTillUse;
  34.         }
  35.  
  36.         public int getCharmUsed() {
  37.             return charmUsed;
  38.         }
  39.  
  40.         public void setCharmUsed(int charmUsed) {
  41.             this.charmUsed = charmUsed;
  42.         }
  43.  
  44.         public int getXpGiven() {
  45.             return xpGiven;
  46.         }
  47.  
  48.         public void setXpGiven(int xpGiven) {
  49.             this.xpGiven = xpGiven;
  50.         }
  51.  
  52.         public String getName() {
  53.             return name;
  54.         }
  55.  
  56.         public void setName(String name) {
  57.             this.name = name;
  58.         }
  59.        
  60.         public int getItemId() {
  61.             return itemId;
  62.         }
  63.  
  64.         public void setItemId(int itemId) {
  65.             this.itemId = itemId;
  66.         }
  67.        
  68.     };
  69.    
  70.     public static void process(final Client player){
  71.         for(summonXp charm : summonXp.values()){
  72.             if(charm.getName() != null){
  73.                 player.sendMessage("You've clearly not brought any charms.");
  74.                 return;
  75.             }
  76.             if(player.getItems().playerHasItem(charm.getItemId(), charm.getCharmUsed())){
  77.             player.getPA().addSkillXP(charm.xpGiven, 21);
  78.             player.sendMessage("You've been granted "+charm.getXpGiven()+" for this using your " +charm.getName()+" on this altar.");
  79.             player.getItems().deleteItem(charm.getItemId(), charm.getCharmUsed());
  80.             player.startAnimation(8502);
  81.             player.gfx0(1303);
  82.             }
  83.         }
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement