From 91b8f4d0fc520df7125617f18fd2aa30b91ca45e Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 30 Nov 2013 17:09:56 -0700 Subject: [PATCH] Start Cook job buffs. --- BankEconomyMod/src/me/kaZep/Base/Main.java | 102 ++- .../src/me/kaZep/Base/PlayerListener.java | 660 +++++++++--------- .../me/kaZep/Commands/commandBankEconomy.java | 11 + 3 files changed, 437 insertions(+), 336 deletions(-) diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 6867601..a60464d 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -653,6 +653,104 @@ public class Main extends JavaPlugin artifact_clay.addIngredient(Material.EYE_OF_ENDER); Bukkit.addRecipe(artifact_clay); + //Add deconversion recipes. + ShapelessRecipe DeConv_diamond_chestplate = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_chestplate.addIngredient(Material.DIAMOND_CHESTPLATE); + ShapelessRecipe DeConv_iron_chestplate = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_chestplate.addIngredient(Material.IRON_CHESTPLATE); + ShapelessRecipe DeConv_gold_chestplate = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_chestplate.addIngredient(Material.GOLD_CHESTPLATE); + ShapelessRecipe DeConv_chainmail_chestplate = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_chainmail_chestplate.addIngredient(Material.CHAINMAIL_CHESTPLATE); + ShapelessRecipe DeConv_diamond_helmet = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_helmet.addIngredient(Material.DIAMOND_HELMET); + ShapelessRecipe DeConv_iron_helmet = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_helmet.addIngredient(Material.IRON_HELMET); + ShapelessRecipe DeConv_gold_helmet = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_helmet.addIngredient(Material.GOLD_HELMET); + ShapelessRecipe DeConv_chainmail_helmet = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_chainmail_helmet.addIngredient(Material.CHAINMAIL_HELMET); + ShapelessRecipe DeConv_diamond_leggings = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_leggings.addIngredient(Material.DIAMOND_LEGGINGS); + ShapelessRecipe DeConv_iron_leggings = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_leggings.addIngredient(Material.IRON_LEGGINGS); + ShapelessRecipe DeConv_gold_leggings = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_leggings.addIngredient(Material.GOLD_LEGGINGS); + ShapelessRecipe DeConv_chainmail_leggings = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_chainmail_leggings.addIngredient(Material.CHAINMAIL_LEGGINGS); + ShapelessRecipe DeConv_diamond_boots = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_boots.addIngredient(Material.DIAMOND_BOOTS); + ShapelessRecipe DeConv_iron_boots = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_boots.addIngredient(Material.IRON_BOOTS); + ShapelessRecipe DeConv_gold_boots = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_boots.addIngredient(Material.GOLD_BOOTS); + ShapelessRecipe DeConv_chainmail_boots = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_chainmail_boots.addIngredient(Material.CHAINMAIL_BOOTS); + ShapelessRecipe DeConv_diamond_pickaxe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_pickaxe.addIngredient(Material.DIAMOND_PICKAXE); + ShapelessRecipe DeConv_iron_pickaxe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_pickaxe.addIngredient(Material.IRON_PICKAXE); + ShapelessRecipe DeConv_gold_pickaxe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_pickaxe.addIngredient(Material.GOLD_PICKAXE); + ShapelessRecipe DeConv_stone_pickaxe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); + DeConv_stone_pickaxe.addIngredient(Material.STONE_PICKAXE); + ShapelessRecipe DeConv_diamond_spade = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_spade.addIngredient(Material.DIAMOND_SPADE); + ShapelessRecipe DeConv_iron_spade = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_spade.addIngredient(Material.IRON_SPADE); + ShapelessRecipe DeConv_gold_spade = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_spade.addIngredient(Material.GOLD_SPADE); + ShapelessRecipe DeConv_stone_spade = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); + DeConv_stone_spade.addIngredient(Material.STONE_SPADE); + ShapelessRecipe DeConv_diamond_axe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_axe.addIngredient(Material.DIAMOND_AXE); + ShapelessRecipe DeConv_iron_axe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_axe.addIngredient(Material.IRON_AXE); + ShapelessRecipe DeConv_gold_axe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_axe.addIngredient(Material.GOLD_AXE); + ShapelessRecipe DeConv_stone_axe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); + DeConv_stone_axe.addIngredient(Material.STONE_AXE); + ShapelessRecipe DeConv_diamond_hoe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); + DeConv_diamond_hoe.addIngredient(Material.DIAMOND_HOE); + ShapelessRecipe DeConv_iron_hoe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); + DeConv_iron_hoe.addIngredient(Material.IRON_HOE); + ShapelessRecipe DeConv_gold_hoe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); + DeConv_gold_hoe.addIngredient(Material.GOLD_HOE); + ShapelessRecipe DeConv_stone_hoe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); + DeConv_stone_hoe.addIngredient(Material.STONE_HOE); + Bukkit.addRecipe(DeConv_diamond_chestplate); + Bukkit.addRecipe(DeConv_iron_chestplate); + Bukkit.addRecipe(DeConv_gold_chestplate); + Bukkit.addRecipe(DeConv_chainmail_chestplate); + Bukkit.addRecipe(DeConv_diamond_leggings); + Bukkit.addRecipe(DeConv_iron_leggings); + Bukkit.addRecipe(DeConv_gold_leggings); + Bukkit.addRecipe(DeConv_chainmail_leggings); + Bukkit.addRecipe(DeConv_diamond_helmet); + Bukkit.addRecipe(DeConv_iron_helmet); + Bukkit.addRecipe(DeConv_gold_helmet); + Bukkit.addRecipe(DeConv_chainmail_helmet); + Bukkit.addRecipe(DeConv_diamond_boots); + Bukkit.addRecipe(DeConv_iron_boots); + Bukkit.addRecipe(DeConv_gold_boots); + Bukkit.addRecipe(DeConv_chainmail_boots); + Bukkit.addRecipe(DeConv_diamond_axe); + Bukkit.addRecipe(DeConv_iron_axe); + Bukkit.addRecipe(DeConv_gold_axe); + Bukkit.addRecipe(DeConv_stone_axe); + Bukkit.addRecipe(DeConv_diamond_pickaxe); + Bukkit.addRecipe(DeConv_iron_pickaxe); + Bukkit.addRecipe(DeConv_gold_pickaxe); + Bukkit.addRecipe(DeConv_stone_pickaxe); + Bukkit.addRecipe(DeConv_diamond_hoe); + Bukkit.addRecipe(DeConv_iron_hoe); + Bukkit.addRecipe(DeConv_gold_hoe); + Bukkit.addRecipe(DeConv_stone_hoe); + Bukkit.addRecipe(DeConv_diamond_spade); + Bukkit.addRecipe(DeConv_iron_spade); + Bukkit.addRecipe(DeConv_gold_spade); + Bukkit.addRecipe(DeConv_stone_spade); + ItemSetList = new ItemSetList(); ItemSetList.Init(); @@ -976,8 +1074,8 @@ public class Main extends JavaPlugin Blacksmith_job.setBuffData("All crafted items are buffed with a Lv5 enchantment.", "All crafted items are buffed with a Lv10 enchantment.", "Crafting Blacksmith items have a 30% chance of preserving materials used.", - "All blacksmith items crafted gain +4 Health bonus enchantments. (Increases by +4 per blacksmithing level after 30.)", - "Blacksmiths gain the ability to craft armor they find back into ingots / materials, based on the remaining durability. (About 50% lossy)", + "All blacksmith items crafted gain +2 Health bonus enchantments. (Increases by +2 per blacksmithing level after 30.)", + "Blacksmiths gain the ability to craft armor they find back into ingots / materials, based on the remaining durability. (About 90% lossy)", "All crafted Blacksmith items stack between 2 and 5 of the same item, effectively multiplying the amount you craft. Items are buffed with a Lv20 enchantment and have a 50% chance to be enchanted with a level 30 enchantment."); Cook_job.setJobName("Cook"); diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 1c6abe9..efaab2d 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -908,6 +908,29 @@ implements Listener e.setResult(result); } } + if (this.plugin.hasJobBuff("Cook", owner, Job.JOB10)) { + if (e.getResult().getType()==Material.COOKED_FISH || + e.getResult().getType()==Material.BAKED_POTATO || + e.getResult().getType()==Material.COOKED_CHICKEN || + e.getResult().getType()==Material.GRILLED_PORK || + e.getResult().getType()==Material.COOKED_BEEF) { + List lore = new ArrayList(); + if (e.getResult().getItemMeta().hasLore()) { + lore = e.getResult().getItemMeta().getLore(); + } else { + lore.add("This food item was fabulously"); + lore.add("created by cook "+ChatColor.YELLOW+owner+","); + lore.add("restoring more hunger and"); + lore.add("saturation than normal, and"); + lore.add("healing 1 Heart of health."); + } + ItemMeta meta = e.getResult().getItemMeta(); + meta.setLore(lore); + ItemStack newstack = e.getResult(); + newstack.setItemMeta(meta); + e.setResult(newstack); + } + } //*************************//Not Job Buffies below. if (this.plugin.PlayerinJob(owner, "Digger")) { @@ -948,11 +971,12 @@ implements Listener this.plugin.gainMoneyExp(owner,"Cook",0.20,80); crafteditem=true; } + /* if (this.plugin.getJobLv("Cook", owner)>=20 && crafteditem) { ItemStack result = e.getResult(); result.setAmount(result.getAmount()+1); e.setResult(result); - } + }*/ } } @@ -4667,6 +4691,85 @@ implements Listener return; } } + + //Find out if there is only 1 item in the crafting matrix. It also have to be an armor/tool. + boolean check=false; + int count=0; + for (int i=0;i=5 && crafteditem) { - //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); - if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { - ItemStack resulting = EnchantItem(result.getResult(),5,p); - result.setResult(resulting); + ItemStack resulting = result.getResult(); + if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { + if (this.plugin.hasJobBuff("Blacksmith", p, Job.JOB30A) && crafteditem) { + ItemMeta meta = resulting.getItemMeta(); + List lore = new ArrayList(); + if (meta.hasLore()) { + lore = meta.getLore(); + } + lore.add(ChatColor.YELLOW+"+"+((getJobLv("Blacksmith", p.getName())-29)*2)+" "+ChatColor.BLUE+"Health"); + meta.setLore(lore); + resulting.setItemMeta(meta); + } + if (this.plugin.hasJobBuff("Blacksmith", p, Job.JOB5) && crafteditem) { + //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); + if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { + resulting = EnchantItem(result.getResult(),5,p); + result.setResult(resulting); + } } - } - if (this.plugin.getJobLv("Blacksmith", p)>=10 && crafteditem) { - //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); - if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { - ItemStack resulting = EnchantItem(result.getResult(),10,p); - result.setResult(resulting); + if (this.plugin.hasJobBuff("Blacksmith", p, Job.JOB10) && crafteditem) { + //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); + if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { + resulting = EnchantItem(result.getResult(),10,p); + result.setResult(resulting); + } } - } - if (this.plugin.getJobLv("Blacksmith", p)>=20 && crafteditem) { - ItemStack[] crafteditems = result.getMatrix(); - if (e.getClick()==ClickType.SHIFT_RIGHT || e.getClick()==ClickType.SHIFT_LEFT) { - int lowestamt=9999; - for (int i=0;i lore = new ArrayList(); + if (resulting.getItemMeta().hasLore()) { + lore = resulting.getItemMeta().getLore(); + } else { + lore.add("This food item was fabulously"); + lore.add("created by cook "+ChatColor.YELLOW+p.getName()+","); + lore.add("restoring more hunger and"); + lore.add("saturation than normal, and"); + lore.add("healing 1 Heart of health."); + } + ItemMeta meta = resulting.getItemMeta(); + meta.setLore(lore); + resulting.setItemMeta(meta); + result.setResult(resulting); + } + } + + ItemStack item = result.getResult(); + int amount=1; + if (this.plugin.PlayerinJob(p,"Digger")) { + if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { + if (item.getType()==Material.SANDSTONE) { + this.plugin.gainMoneyExp(p,"Digger",0.02*amount,6*amount); + } + if (item.getType()==Material.BRICK) { + this.plugin.gainMoneyExp(p,"Digger",0.04*amount,8*amount); + } + } + } + if (this.plugin.PlayerinJob(p,"Cook")) { + if (e.getClick()!=ClickType.SHIFT_RIGHT && e.getClick()!=ClickType.SHIFT_LEFT) { + boolean crafteditem=false; + if (item.getType()==Material.BREAD) { + this.plugin.gainMoneyExp(p,"Cook",0.003125*amount,1.25*amount); + crafteditem=true; + } + if (item.getType()==Material.COOKIE) { + this.plugin.gainMoneyExp(p,"Cook",0.016875*amount,1.50*amount); + crafteditem=true; + } + if (item.getType()==Material.MUSHROOM_SOUP) { + this.plugin.gainMoneyExp(p,"Cook",0.009375*amount,3.75*amount); + crafteditem=true; + } + if (item.getType()==Material.PUMPKIN_PIE) { + this.plugin.gainMoneyExp(p,"Cook",0.0375*amount,15*amount); + crafteditem=true; + } + if (item.getType()==Material.GOLDEN_CARROT) { + this.plugin.gainMoneyExp(p,"Cook",0.0875*amount,35*amount); + crafteditem=true; + } + if (item.getType()==Material.CAKE) { + this.plugin.gainMoneyExp(p,"Cook",0.10625*amount,21.25*amount); + crafteditem=true; + } + if (item.getType()==Material.GOLDEN_APPLE) { + this.plugin.gainMoneyExp(p,"Cook",0.1125*amount,45*amount); + crafteditem=true; } } + /* + if (this.plugin.getJobLv("Cook", p)>=10 && crafteditem==true) { + //This is an ugly fix for the problem...But it works somehow. + //Player newp = Bukkit.getPlayer(p.getName().toLowerCase()); + p.getInventory().addItem(new ItemStack(item.getType(),amount,item.getDurability(),item.getData().getData())); + }*/ } + //***********************************//End job buff stuff + + /* //this.plugin.tempinventory = Bukkit.getPlayer(e.getWhoClicked().getName()).getInventory().getContents(); CraftingInventory result = e.getInventory(); @@ -11078,6 +11079,43 @@ implements Listener this.plugin.gainMoneyExp(p,"Digger",0.04*amount,8*amount); } } + if (this.plugin.PlayerinJob(p,"Cook")) { + boolean crafteditem=false; + if (item.getType()==Material.BREAD) { + this.plugin.gainMoneyExp(p,"Cook",0.003125*amount,1.25*amount); + crafteditem=true; + } + if (item.getType()==Material.COOKIE) { + this.plugin.gainMoneyExp(p,"Cook",0.016875*amount,1.50*amount); + crafteditem=true; + } + if (item.getType()==Material.MUSHROOM_SOUP) { + this.plugin.gainMoneyExp(p,"Cook",0.009375*amount,3.75*amount); + crafteditem=true; + } + if (item.getType()==Material.PUMPKIN_PIE) { + this.plugin.gainMoneyExp(p,"Cook",0.0375*amount,15*amount); + crafteditem=true; + } + if (item.getType()==Material.GOLDEN_CARROT) { + this.plugin.gainMoneyExp(p,"Cook",0.0875*amount,35*amount); + crafteditem=true; + } + if (item.getType()==Material.CAKE) { + this.plugin.gainMoneyExp(p,"Cook",0.10625*amount,21.25*amount); + crafteditem=true; + } + if (item.getType()==Material.GOLDEN_APPLE) { + this.plugin.gainMoneyExp(p,"Cook",0.1125*amount,45*amount); + crafteditem=true; + } + /* + if (this.plugin.getJobLv("Cook", p)>=10 && crafteditem==true) { + //This is an ugly fix for the problem...But it works somehow. + //Player newp = Bukkit.getPlayer(p.getName().toLowerCase()); + p.getInventory().addItem(new ItemStack(item.getType(),amount,item.getDurability(),item.getData().getData())); + }*/ + } if (this.plugin.PlayerinJob(p,"Weaponsmith")) { boolean crafteditem=false; if (item.getType()==Material.ARROW) { @@ -11298,98 +11336,6 @@ implements Listener crafteditem=true; } } - /*if (e.getBlock().getType()==Material.PUMPKIN) { - this.plugin.gainMoneyExp(p,"Farmer",0.00,1); - } - if (e.getBlock().getType()==Material.MELON_BLOCK) { - this.plugin.gainMoneyExp(p,"Farmer",0.10,10); - }*/ - if (this.plugin.PlayerinJob(p,"Farmer")) { - boolean crafteditem=false; - if (item.getType()==Material.MELON) { - this.plugin.gainMoneyExp(p,"Farmer",0.10,10); - crafteditem=true; - } - if (item.getType()==Material.PUMPKIN_SEEDS) { - this.plugin.gainMoneyExp(p,"Farmer",0.04,8); - crafteditem=true; - } - } - if (this.plugin.PlayerinJob(p,"Cook")) { - boolean crafteditem=false; - if (item.getType()==Material.BREAD) { - this.plugin.gainMoneyExp(p,"Cook",0.003125*amount,1.25*amount); - crafteditem=true; - } - if (item.getType()==Material.COOKIE) { - this.plugin.gainMoneyExp(p,"Cook",0.016875*amount,1.50*amount); - crafteditem=true; - } - if (item.getType()==Material.MUSHROOM_SOUP) { - this.plugin.gainMoneyExp(p,"Cook",0.009375*amount,3.75*amount); - crafteditem=true; - } - if (item.getType()==Material.PUMPKIN_PIE) { - this.plugin.gainMoneyExp(p,"Cook",0.0375*amount,15*amount); - crafteditem=true; - } - if (item.getType()==Material.GOLDEN_CARROT) { - this.plugin.gainMoneyExp(p,"Cook",0.0875*amount,35*amount); - crafteditem=true; - } - if (item.getType()==Material.CAKE) { - this.plugin.gainMoneyExp(p,"Cook",0.10625*amount,21.25*amount); - crafteditem=true; - } - if (item.getType()==Material.GOLDEN_APPLE) { - this.plugin.gainMoneyExp(p,"Cook",0.1125*amount,45*amount); - crafteditem=true; - } - if (this.plugin.getJobLv("Cook", p)>=10 && crafteditem==true) { - //This is an ugly fix for the problem...But it works somehow. - //Player newp = Bukkit.getPlayer(p.getName().toLowerCase()); - p.getInventory().addItem(new ItemStack(item.getType(),amount,item.getDurability(),item.getData().getData())); - } - } - /* - if (this.plugin.PlayerinJob(p,"Support")) { - if (item.getType()==Material.BREAD) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.MUSHROOM_SOUP) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.COOKIE) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.GOLDEN_CARROT) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.GOLDEN_APPLE) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.PUMPKIN_PIE) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.CAKE) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,2*amount); - } - if (item.getType()==Material.IRON_SWORD) { - this.plugin.gainMoneyExp(p,"Support",0.015*amount,3*amount); - } - if (item.getType()==Material.IRON_CHESTPLATE || item.getType()==Material.IRON_HELMET || item.getType()==Material.IRON_BOOTS || item.getType()==Material.IRON_LEGGINGS) { - this.plugin.gainMoneyExp(p,"Support",0.025*amount,5*amount); - } - if (item.getType()==Material.DIAMOND_SWORD) { - this.plugin.gainMoneyExp(p,"Support",0.075*amount,8*amount); - } - if (item.getType()==Material.DIAMOND_CHESTPLATE || item.getType()==Material.DIAMOND_HELMET || item.getType()==Material.DIAMOND_BOOTS || item.getType()==Material.DIAMOND_LEGGINGS) { - this.plugin.gainMoneyExp(p,"Support",0.20*amount,20*amount); - } - if (item.getType()==Material.CAKE) { - this.plugin.gainMoneyExp(p,"Support",0.03*amount,2*amount); - } - }*/ } private void handleCrafting(InventoryClickEvent event) { @@ -11580,16 +11526,51 @@ implements Listener } } if (PlayerinJob((Player)player,"Blacksmith")) { + ItemStack resulting = clone; + if (hasJobBuff("Blacksmith", player.getName(), Job.JOB30A) && validItem_Blacksmith(post)) { + ItemMeta meta = resulting.getItemMeta(); + List lore = new ArrayList(); + if (meta.hasLore()) { + lore = meta.getLore(); + } + lore.add(ChatColor.YELLOW+"+"+((getJobLv("Blacksmith", player.getName())-29)*2)+" "+ChatColor.BLUE+"Health"); + meta.setLore(lore); + resulting.setItemMeta(meta); + } if (getJobLv("Blacksmith", player.getName())>=10 && validItem_Blacksmith(post)) { //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); - ItemStack resulting = EnchantItem(clone,10,(Player)player); - player.getInventory().setItem(i, resulting); + resulting = EnchantItem(clone,10,(Player)player); } else - if (getJobLv("Blacksmith", player.getName())>=5 && validItem_Blacksmith(post)) { - //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); - ItemStack resulting = EnchantItem(clone,5,(Player)player); - player.getInventory().setItem(i, resulting); + if (getJobLv("Blacksmith", player.getName())>=5 && validItem_Blacksmith(post)) { + //Bukkit.getPlayer("sigonasr2").sendMessage("Valid item. Going to attempt to enchant."); + resulting = EnchantItem(clone,5,(Player)player); + } + if (hasJobBuff("Blacksmith", (Player)player, Job.JOB40) && validItem_Blacksmith(post)) { + if (Math.random()<=0.5) { + resulting = EnchantItem(clone, 30, (Player)player); + } else { + resulting = EnchantItem(clone, 20, (Player)player); } + resulting.setAmount((int)(Math.random()*4)+2); + } + player.getInventory().setItem(i, resulting); + } + if (hasJobBuff("Cook", (Player)player, Job.JOB10)) { + ItemStack resulting = clone; + List lore = new ArrayList(); + if (resulting.getItemMeta().hasLore()) { + lore = resulting.getItemMeta().getLore(); + } else { + lore.add("This food item was fabulously"); + lore.add("created by cook "+ChatColor.YELLOW+player.getName()+","); + lore.add("restoring more hunger and"); + lore.add("saturation than normal, and"); + lore.add("healing 1 Heart of health."); + } + ItemMeta meta = resulting.getItemMeta(); + meta.setLore(lore); + resulting.setItemMeta(meta); + player.getInventory().setItem(i, resulting); } } //Bukkit.getPlayer("sigonasr2").sendMessage("Item amounts differ. New count: "+newItemsCount); @@ -13845,6 +13826,10 @@ implements Listener } } } + + public boolean isFood(ItemStack i) { + + } @EventHandler public void onPlayerInteract(PlayerInteractEvent e) @@ -14154,6 +14139,13 @@ implements Listener } } } + + if ((e.getAction()==Action.RIGHT_CLICK_AIR || (e.getAction()==Action.RIGHT_CLICK_BLOCK && p.isSneaking())) && p.getItemInHand().hasItemMeta() && p.getItemInHand().getItemMeta().hasLore()) { + if (isFood(p.getItemInHand().getType())) { + + } + } + //******************************//End Job related buffs. if (this.plugin.PlayerinJob(p, "Explorer")) { diff --git a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java index ab9debc..3c5c13d 100644 --- a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java +++ b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java @@ -624,6 +624,17 @@ public String convertToItemName(String val) { } } else if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) { + if (args[0].equalsIgnoreCase("job_max")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1", String.valueOf(args[1])); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1lv", Integer.valueOf(40)); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".jobs.ultimate", String.valueOf(args[1])); + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".jobs.ultimatesealed", Boolean.valueOf(true)); + p.sendMessage("Set job slot 1 to "+args[1]+" @ Lv40, set ultimate and sealed it as well."); + } + if (args[0].equalsIgnoreCase("job_30")) { + this.plugin.getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job1_30", Integer.valueOf(args[1])); + p.sendMessage("Set job slot 1 LV30 buff to Type "+args[1]); + } if (args[0].equalsIgnoreCase("loot")) { p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest(Integer.valueOf(args[1]))); }