Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Arrxzon.rankkits;
- import me.Arrxzon.rankkits.SaveLoad;
- import java.util.ArrayList;
- import net.milkbowl.vault.economy.Economy;
- import net.milkbowl.vault.economy.EconomyResponse;
- import net.milkbowl.vault.permission.Permission;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.enchantments.Enchantment;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.PlayerInventory;
- import org.bukkit.plugin.RegisteredServiceProvider;
- import org.bukkit.plugin.java.JavaPlugin;
- import ru.tehkode.permissions.PermissionUser;
- import ru.tehkode.permissions.bukkit.PermissionsEx;
- public class RankKits extends JavaPlugin{
- private static final int slotsNeeded = 10;
- public static Economy econ = null;
- public static Permission perms = null;
- public static RankKits plugin;
- public void onEnable() {
- if(!getDataFolder().exists()) {
- getDataFolder().mkdir();
- }
- try{
- cooldown = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown2 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown3 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown4 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown5 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown6 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown7 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown8 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown9 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- cooldown10 = SaveLoad.load("plugins\\RankKits\\hashmap.bin");
- }
- catch(Exception e){
- e.printStackTrace();
- }
- getLogger().info("RankKits by Arrxzon Enabled!");
- if (!setupEconomy()) {
- getLogger().severe(ChatColor.RED + "Disabled due to no Vault dependency found!");
- getServer().getPluginManager().disablePlugin(this);
- return;
- }
- }
- public void onDisable() {
- // if(!getDataFolder().exists()) {
- // getDataFolder().mkdir();
- // }
- try{
- SaveLoad.save(cooldown, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown2, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown3, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown4, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown5, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown6, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown7, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown8, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown9, "plugins\\RankKits\\hashmap.bin");
- SaveLoad.save(cooldown10, "plugins\\RankKits\\hashmap.bin");
- }
- catch(Exception e){
- e.printStackTrace();
- }
- }
- private boolean setupEconomy() {
- if (getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- }
- RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
- if (rsp == null) {
- return false;
- }
- econ = rsp.getProvider();
- return econ != null;
- }
- @SuppressWarnings("unused")
- private boolean setupPermissions() {
- RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
- perms = rsp.getProvider();
- return perms != null;
- }
- private ArrayList<String> cooldown = new ArrayList<String>();
- private ArrayList<String> cooldown1 = new ArrayList<String>();
- private ArrayList<String> cooldown2 = new ArrayList<String>();
- private ArrayList<String> cooldown3 = new ArrayList<String>();
- private ArrayList<String> cooldown4 = new ArrayList<String>();
- private ArrayList<String> cooldown5 = new ArrayList<String>();
- private ArrayList<String> cooldown6 = new ArrayList<String>();
- private ArrayList<String> cooldown7 = new ArrayList<String>();
- private ArrayList<String> cooldown8 = new ArrayList<String>();
- private ArrayList<String> cooldown9 = new ArrayList<String>();
- private ArrayList<String> cooldown10 = new ArrayList<String>();
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
- final Player p = (Player) sender;
- PlayerInventory pi = p.getInventory();
- PermissionUser user = PermissionsEx.getUser(p);
- // final String name = Player.getName();
- // if (plugin.hashmap.keySet().contains(getName())) {
- // plugin.hashmap.put(getName(), plugin.hashmap.get(getName()) + 1);
- // }
- if (cmd.getName().equalsIgnoreCase("rkits")) {
- p.sendMessage(ChatColor.GOLD + "--==[" + ChatColor.AQUA + ChatColor.BOLD + "EdgeWire Rank Kits available" + ChatColor.GOLD + "]==--" + ChatColor.GRAY + "");
- p.sendMessage("[" + ChatColor.BLUE + "RankKit" + ChatColor.WHITE + "]" + " [" + ChatColor.BLUE + "Cost" + ChatColor.WHITE + "]" + " [" + ChatColor.BLUE + "Cooldown|hours" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Recruit" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $0 " + " [" + ChatColor.DARK_AQUA + "1" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Private" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $3,000 " + " [" + ChatColor.DARK_AQUA + "1.5" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Lieutenant" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $6,000 " + " [" + ChatColor.DARK_AQUA + "2" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Officer" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $12,000 " + " [" + ChatColor.DARK_AQUA + "3" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Captain" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $35,000 " + " [" + ChatColor.DARK_AQUA + "5" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Corporal" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $40,000 " + " [" + ChatColor.DARK_AQUA + "10" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.AQUA + "Commander" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $50,000 " + " [" + ChatColor.DARK_AQUA + "11" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.GREEN + "Sergeant" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $75,000 " + " [" + ChatColor.DARK_AQUA + "12" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.GREEN + "Sergeant Major" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $90,000 " + " [" + ChatColor.DARK_AQUA + "12" + ChatColor.WHITE + "]");
- p.sendMessage("[" + ChatColor.GREEN + "Master Sergeant" + ChatColor.WHITE + "]" + ChatColor.WHITE + " $100,000 " + " [" + ChatColor.DARK_AQUA + "12" + ChatColor.WHITE + "]");
- //To Do. list cooldown ????
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("rkit")) {
- if (args.length == 1) {
- if (args[0].equalsIgnoreCase("help")) {
- p.sendMessage(ChatColor.GOLD + "----==[" + ChatColor.AQUA + ChatColor.BOLD + "EdgeWire Rank Kits Help" + ChatColor.GOLD + "]==----");
- p.sendMessage(ChatColor.GOLD + "--" + ChatColor.WHITE + ChatColor.ITALIC + " You start from lowest rank and buy your way up,");
- p.sendMessage(ChatColor.GOLD + "--" + ChatColor.WHITE + ChatColor.ITALIC + " Each rank has it's own kit.");
- p.sendMessage(ChatColor.GOLD + "--" + ChatColor.WHITE + ChatColor.ITALIC + " Your able to use kits from previous ranks.");
- p.sendMessage(ChatColor.GOLD + "--");
- p.sendMessage(ChatColor.GOLD + "/kit:" + ChatColor.WHITE + " Shows This Menu");
- p.sendMessage(ChatColor.GOLD + "/kits:" + ChatColor.WHITE + " Lists All RankKits, Price and Cooldown");
- p.sendMessage(ChatColor.GOLD + "/kit [Name]:" + ChatColor.WHITE + " Purchases RankKit if Possible");
- p.sendMessage(ChatColor.GOLD + "--" + ChatColor.GREEN + " Green" + ChatColor.WHITE + ChatColor.ITALIC + " = Donators only");
- }
- }
- }
- if (cmd.getName().equalsIgnoreCase("rkit")) {
- if (args.length == 0) {
- p.sendMessage(ChatColor.GOLD + "---" + ChatColor.AQUA + ChatColor.BOLD + "Rank Kits Alpha v0.0.9" + ChatColor.GOLD + "---");
- p.sendMessage(ChatColor.GOLD + " /kit help:" + ChatColor.AQUA + " For Help");
- p.sendMessage(ChatColor.GOLD + "-" + ChatColor.GRAY + ChatColor.ITALIC + "Brought to you by Arrxzon" + ChatColor.GOLD + "-");
- return true;
- }
- /*
- * RECRUIT
- */
- if (args.length == 1) {
- //inventory check
- int openSlots = 0;
- for(ItemStack item : p.getInventory().getContents()){
- if(item == null)
- openSlots++;
- }
- if(openSlots < slotsNeeded){
- p.sendMessage("Please remove "+(slotsNeeded - openSlots)+" items from your inventory!");
- return false;
- }
- //end inventory check
- if(sender.hasPermission("rkit.0"))
- if (args[0].equalsIgnoreCase("recruit")) {
- if (cooldown.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return false;
- }
- pi.addItem(new ItemStack(Material.LEATHER_HELMET, 1));
- pi.addItem(new ItemStack(Material.LEATHER_BOOTS, 1));
- pi.addItem(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
- pi.addItem(new ItemStack(Material.LEATHER_LEGGINGS, 1));
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 10));
- p.sendMessage(ChatColor.AQUA + "You got RankKit" + ChatColor.GREEN + " Recruit");
- cooldown.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Private" + ChatColor.AQUA + " again!");
- }
- }, 600); //30seconds 1.5 hours
- return true;
- }
- }
- /*
- * Private
- */
- if (args.length == 1) {
- //p.getInventory().contains(9);
- if(sender.hasPermission("rkit.1"))
- if (args[0].equalsIgnoreCase("private")) {
- if (cooldown1.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 3000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.IRON_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL,1);
- pi.addItem(new ItemStack(Material.CHAINMAIL_HELMET, 1));
- pi.addItem(new ItemStack(Material.CHAINMAIL_CHESTPLATE, 1));
- pi.addItem(new ItemStack(Material.CHAINMAIL_LEGGINGS, 1));
- pi.addItem(new ItemStack(Material.CHAINMAIL_BOOTS, 1));
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 16));
- p.getInventory().addItem(is);
- p.sendMessage(ChatColor.AQUA + "You got RankKit" + ChatColor.GREEN + " Private" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 3000");
- if(user.inGroup("default")){
- user.addGroup("private");
- user.removeGroup("default");
- }
- cooldown1.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown1.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Private" + ChatColor.AQUA + " again!");
- }
- }, 108000); // 1.5 hours
- return true;
- }
- }
- }
- // else {
- // sender.sendMessage("You do not have permission for this kit. Have you got the previous first ?");
- // }
- /*
- * Lieutenant
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.lieutenant"))
- if (args[0].equalsIgnoreCase("lieutenant")) {
- if (cooldown2.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 6000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.IRON_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL, 2);
- pi.addItem(new ItemStack(Material.IRON_HELMET, 1));
- pi.addItem(new ItemStack(Material.IRON_CHESTPLATE, 1));
- pi.addItem(new ItemStack(Material.IRON_LEGGINGS, 1));
- pi.addItem(new ItemStack(Material.IRON_BOOTS, 1));
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 32));
- p.getInventory().addItem(is);
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Lieutenant" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 6000");
- if(user.inGroup("private")){
- user.addGroup("lieutenant");
- user.removeGroup("private");
- }
- cooldown2.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown2.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Lieutenant" + ChatColor.AQUA + " again!");
- }
- }, 144000); //2 hours
- return true;
- }
- }
- }
- /*
- * officer
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.officer")) {
- if (args[0].equalsIgnoreCase("officer")) {
- if (cooldown3.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 15000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.IRON_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL, 2);
- is.addEnchantment(Enchantment.FIRE_ASPECT, 1);
- ItemStack is1 = new ItemStack(Material.IRON_HELMET, 1);
- is1.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- ItemStack is2 = new ItemStack(Material.IRON_CHESTPLATE, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- ItemStack is3 = new ItemStack(Material.IRON_LEGGINGS, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- ItemStack is4 = new ItemStack(Material.IRON_BOOTS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 32));
- p.getInventory().addItem(is, is1, is2, is3, is4);
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Officer" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 15000");
- if(user.inGroup("lieutenant")){
- user.addGroup("officer");
- user.removeGroup("lieutenant");
- }
- cooldown3.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown3.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Officer" + ChatColor.AQUA + " again!");
- }
- }, 216000); //3hours
- return true;
- }
- else {
- p.sendMessage(ChatColor.RED + "Could not execute transaction. Got enough coins ?");
- return true;
- }
- }
- }
- // else {
- // sender.sendMessage("You do not have permission for this kit. Have you got the previous first ?");
- // }
- }
- /*
- * Captain
- *
- *
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.captain")) {
- if (args[0].equalsIgnoreCase("captain")) {
- if (cooldown4.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 35000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.DIAMOND_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL, 2);
- pi.addItem(new ItemStack(Material.DIAMOND_HELMET, 1));
- pi.addItem(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
- pi.addItem(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
- pi.addItem(new ItemStack(Material.DIAMOND_BOOTS, 1));
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- p.getInventory().addItem(is);
- if(user.inGroup("officer")){
- user.addGroup("captain");
- user.removeGroup("officer");
- }
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Captain" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 35000");
- cooldown4.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown4.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Captain" + ChatColor.AQUA + " again!");
- }
- }, 360000); //5 hours
- return true;
- }
- else {
- p.sendMessage(ChatColor.RED + "Could not execute transaction. Got enough coins ?");
- return true;
- }
- }
- }
- // else {
- // sender.sendMessage("You do not have permission for this kit. Have you got the previous first ?");
- // }
- }
- /*
- * Corporal
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.corporal")) {
- if (args[0].equalsIgnoreCase("corporal")) {
- if (cooldown5.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 40000);
- if (r.transactionSuccess()) {
- ItemStack is1 = new ItemStack(Material.DIAMOND_SWORD, 1);
- is1.addEnchantment(Enchantment.DAMAGE_ALL, 3);
- ItemStack is2 = new ItemStack(Material.DIAMOND_HELMET, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- ItemStack is3 = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- ItemStack is4 = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- ItemStack is5 = new ItemStack(Material.DIAMOND_BOOTS, 1);
- is5.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
- ItemStack is6 = new ItemStack(Material.BOW, 1);
- is6.addEnchantment(Enchantment.ARROW_DAMAGE, 2);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- p.getInventory().addItem(is1, is2, is3, is4, is5, is6);
- if(user.inGroup("captain")){
- user.addGroup("corporal");
- user.removeGroup("captain");
- }
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Corporal" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 40000");
- cooldown5.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown5.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Corporal" + ChatColor.AQUA + " again!");
- }
- }, 720000); //10 hours
- return true;
- }
- }
- }
- // else {
- // sender.sendMessage("You do not have permission for this kit. Have you got the previous first ?");
- // }
- }
- /*
- * Commander
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.commander")) {
- if (args[0].equalsIgnoreCase("Commander")) {
- if (cooldown6.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 50000);
- if (r.transactionSuccess()) {
- ItemStack is1 = new ItemStack(Material.DIAMOND_SWORD, 1);
- is1.addEnchantment(Enchantment.DAMAGE_ALL, 3);
- is1.addEnchantment(Enchantment.FIRE_ASPECT, 1);
- ItemStack is2 = new ItemStack(Material.DIAMOND_HELMET, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
- ItemStack is3 = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
- ItemStack is4 = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
- ItemStack is5 = new ItemStack(Material.DIAMOND_BOOTS, 1);
- is5.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
- ItemStack is6 = new ItemStack(Material.BOW, 1);
- is6.addEnchantment(Enchantment.ARROW_DAMAGE, 2);
- is6.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- p.getInventory().addItem(is1, is2, is3, is4, is5, is6);
- if(user.inGroup("corporal")){
- user.addGroup("commander");
- user.removeGroup("corporal");
- }
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Commander" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 50000");
- cooldown6.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown6.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Commander" + ChatColor.AQUA + " again!");
- }
- }, 792000); //11 hours
- return true;
- }
- }
- }
- // else {
- // sender.sendMessage("You do not have permission for this kit. Have you got the previous first ?");
- // }
- }
- /*
- * Sergeant
- *
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.vip1")) {
- if (args[0].equalsIgnoreCase("Sergeant")) {
- if (cooldown7.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 75000);
- if (r.transactionSuccess()) {
- ItemStack is1 = new ItemStack(Material.DIAMOND_SWORD, 1);
- is1.addEnchantment(Enchantment.DAMAGE_ALL, 4);
- is1.addEnchantment(Enchantment.FIRE_ASPECT, 2);
- is1.addEnchantment(Enchantment.KNOCKBACK, 2);
- ItemStack is2 = new ItemStack(Material.DIAMOND_HELMET, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is2.addEnchantment(Enchantment.PROTECTION_FIRE, 3);
- ItemStack is3 = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is3.addEnchantment(Enchantment.PROTECTION_FIRE, 3);
- ItemStack is4 = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is4.addEnchantment(Enchantment.PROTECTION_FIRE, 3);
- ItemStack is5 = new ItemStack(Material.DIAMOND_BOOTS, 1);
- is5.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is5.addEnchantment(Enchantment.PROTECTION_FIRE, 3);
- ItemStack is6 = new ItemStack(Material.BOW, 1);
- is6.addEnchantment(Enchantment.ARROW_DAMAGE, 4);
- is6.addEnchantment(Enchantment.ARROW_KNOCKBACK, 2);
- is6.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- p.getInventory().addItem(is1, is2, is3, is4, is5, is6);
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Sergeant" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 75000");
- cooldown7.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown7.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Sergeant" + ChatColor.AQUA + " again!");
- }
- }, 864000); //12 hours
- return true;
- }
- else {
- p.sendMessage(ChatColor.RED + "Could not execute transaction. Got enough coins ?");
- return true;
- }
- }
- }
- // else {
- // p.sendMessage(ChatColor.RED + "You do not have permission for this Donators kit.");
- // }
- }
- /*
- * Sergeant Major
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.vip2")) {
- if (args[0].equalsIgnoreCase("SergeantMajor")) {
- if (cooldown8.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 90000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.DIAMOND_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL, 4);
- is.addEnchantment(Enchantment.FIRE_ASPECT, 2);
- is.addEnchantment(Enchantment.KNOCKBACK, 2);
- ItemStack is1 = new ItemStack(Material.DIAMOND_HELMET, 1);
- is1.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is1.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is1.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is2 = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is2.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is2.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is3 = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is3.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is3.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is4 = new ItemStack(Material.DIAMOND_BOOTS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is4.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is4.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is5 = new ItemStack(Material.BOW, 1);
- is5.addEnchantment(Enchantment.ARROW_DAMAGE, 4);
- is5.addEnchantment(Enchantment.ARROW_FIRE, 1);
- is5.addEnchantment(Enchantment.ARROW_KNOCKBACK, 2);
- is5.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- pi.addItem(new ItemStack(Material.GOLDEN_APPLE, 16));
- p.getInventory().addItem(is, is1, is2, is3, is4, is5);
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Sergeant Major" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 90000");
- cooldown8.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown8.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Sergeant Major" + ChatColor.AQUA + " again!");
- }
- }, 864000); //12 hours
- return true;
- }
- else {
- p.sendMessage(ChatColor.RED + "Could not execute transaction. Got enough coins ?");
- return true;
- }
- }
- }
- // else {
- // p.sendMessage(ChatColor.RED + "You do not have permission for this Donators kit.");
- // }
- }
- /*
- * Master Sergeant
- */
- if (args.length == 1) {
- if(sender.hasPermission("rkit.vip3")) {
- if (args[0].equalsIgnoreCase("MasterSergeant")) {
- if (cooldown9.contains(p.getName())) {
- p.sendMessage(ChatColor.RED + "This kit is on cooldown!");
- return true;
- }
- EconomyResponse r = econ.withdrawPlayer(p.getName(), 100000);
- if (r.transactionSuccess()) {
- ItemStack is = new ItemStack(Material.DIAMOND_SWORD, 1);
- is.addEnchantment(Enchantment.DAMAGE_ALL, 5);
- is.addEnchantment(Enchantment.FIRE_ASPECT, 2);
- is.addEnchantment(Enchantment.KNOCKBACK, 2);
- is.addEnchantment(Enchantment.DURABILITY, 3);
- ItemStack is1 = new ItemStack(Material.DIAMOND_HELMET, 1);
- is1.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is1.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is1.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is2 = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
- is2.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is2.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is2.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is3 = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
- is3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is3.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is3.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is4 = new ItemStack(Material.DIAMOND_BOOTS, 1);
- is4.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
- is4.addEnchantment(Enchantment.PROTECTION_FIRE, 4);
- is4.addEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
- ItemStack is5 = new ItemStack(Material.BOW, 1);
- is5.addEnchantment(Enchantment.ARROW_DAMAGE, 4);
- is5.addEnchantment(Enchantment.ARROW_FIRE, 1);
- is5.addEnchantment(Enchantment.ARROW_KNOCKBACK, 2);
- is5.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- pi.addItem(new ItemStack(Material.COOKED_BEEF, 64));
- pi.addItem(new ItemStack(Material.GOLDEN_APPLE, 32));
- p.getInventory().addItem(is, is1, is2, is3, is4, is5);
- p.sendMessage(ChatColor.AQUA + "You got kit" + ChatColor.GREEN + " Master Sergeant" + ChatColor.AQUA + " at the cost of" + ChatColor.GREEN + " 100000");
- cooldown9.add(p.getName());
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- cooldown9.remove(p.getName());
- p.sendMessage(ChatColor.AQUA + "you can now use kit" + ChatColor.GREEN + " Master Sergeant" + ChatColor.AQUA + " again!");
- }
- }, 864000); //12 hours
- return true;
- }
- else {
- p.sendMessage(ChatColor.RED + "Could not execute transaction. Got enough coins ?");
- return true;
- }
- }
- }
- // else {
- // p.sendMessage(ChatColor.RED + "You do not have permission for this Donators kit.");
- // }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement