diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index 93455f16b..b1fbc2894 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -1222,4 +1222,9 @@ public class BonusManager extends MiniClientPlugin implements I return _powerPlayClubManager; } + public InventoryManager getInventoryManager() + { + return _inventoryManager; + } + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/commands/PowerPlayCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/commands/PowerPlayCommand.java index 363d93d92..64f9ca3b2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/commands/PowerPlayCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/commands/PowerPlayCommand.java @@ -1,20 +1,30 @@ package mineplex.core.bonuses.commands; +import java.util.UUID; + import mineplex.core.bonuses.BonusManager; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import org.bukkit.entity.Player; public class PowerPlayCommand extends CommandBase { + /** + * Examples: + * /powerplay LCastr0 5 -> Adds 5 months to player's power play club months + * /powerplay LCastr0 5 false -> same as above + * /powerplay LCastr0 5 true -> Sets the last claimed month as June + */ + private BonusManager _bonusManager; public PowerPlayCommand(BonusManager manager) { - super(manager, Rank.JNR_DEV, "powerplay"); + super(manager, Rank.SNR_MODERATOR, "powerplay"); _bonusManager = manager; } @@ -23,28 +33,45 @@ public class PowerPlayCommand extends CommandBase { if (args.length < 2) { - UtilPlayer.message(caller, F.main("Power Play Club", "Missing Args: " + F.elem("/powerplay "))); + UtilPlayer.message(caller, F.main("Power Play Club", "Missing Args: " + F.elem("/powerplay [setLastClaimed:true/false]"))); return; } final String targetName = args[0]; final String months = args[1]; + boolean setLastClaimed = false; + if (args.length >= 3) + { + setLastClaimed = Boolean.valueOf(args[2]); + } Player target = UtilPlayer.searchExact(targetName); - rewardPowerPlay(caller, target, target.getName(), months); + rewardPowerPlay(caller, target, target.getName(), months, setLastClaimed); } - private void rewardPowerPlay(Player caller, Player target, String targetName, String months) + private void rewardPowerPlay(Player caller, Player target, String targetName, String months, boolean setLastClaimed) { try { final int iMonths = Integer.parseInt(months); - _bonusManager.getPowerPlayClubManager().addPlayerMonths(target.getUniqueId(), iMonths); - UtilPlayer.message(caller, F.main("Power Play Club", "You gave " + F.elem(iMonths + " Months") + " to " + F.name(targetName) + ".")); + UUID targetUuid = target.getUniqueId(); + String messageCaller = "You gave " + F.elem(iMonths + UtilText.plural(" Month", iMonths)) + " to " + F.name(targetName) + "."; + String messageTarget = F.name(caller.getName()) + " gave you " + F.elem(iMonths + UtilText.plural(" Month", iMonths)) + "."; + if (setLastClaimed) + { + _bonusManager.getPowerPlayClubManager().setLastClaimedMonth(targetUuid, iMonths); + messageCaller = "You have set the last claimed month from " + F.name(targetName) + " to " + iMonths + "."; + messageTarget = F.name(caller.getName()) + " have set your last claimed month to " + iMonths + "."; + } + else + { + _bonusManager.getPowerPlayClubManager().addPlayerMonths(target.getUniqueId(), iMonths); + } + UtilPlayer.message(caller, F.main("Power Play Club", messageCaller)); if (target != null && !target.equals(caller)) { - UtilPlayer.message(target, F.main("Power Play Club", F.name(caller.getName()) + " gave you " + F.elem(iMonths + " Months") + ".")); + UtilPlayer.message(target, F.main("Power Play Club", messageTarget)); } } catch (Exception e) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java index 2421e2f0a..e7bf20748 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java @@ -37,9 +37,9 @@ public class BonusGui extends SimpleGui setItem(25, new ClaimTipsButton(getPlugin(), player, this, manager, boosterManager)); - setItem(31, new CarlSpinButton(getPlugin(), player, manager, rewardManager)); + setItem(33, new CarlSpinButton(getPlugin(), player, manager, rewardManager)); - setItem(35, new PowerPlayClubButton(player, manager.getDonationManager().getPowerPlayClubManager())); + setItem(29, new PowerPlayClubButton(player, manager)); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PowerPlayClubButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PowerPlayClubButton.java index e92425b22..26fb15cbf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PowerPlayClubButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PowerPlayClubButton.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; +import mineplex.core.bonuses.BonusManager; import mineplex.core.common.util.C; import mineplex.core.gui.GuiItem; +import mineplex.core.inventory.InventoryManager; import mineplex.core.powerplayclub.PowerPlayClubManager; import mineplex.core.shop.item.ShopItem; import org.bukkit.Material; @@ -20,11 +22,13 @@ public class PowerPlayClubButton implements GuiItem private ItemStack _item; private Player _player; private PowerPlayClubManager _powerPlayClubManager; + private InventoryManager _inventoryManager; - public PowerPlayClubButton(Player player, PowerPlayClubManager powerPlayClubManager) + public PowerPlayClubButton(Player player, BonusManager manager) { _player = player; - _powerPlayClubManager = powerPlayClubManager; + _powerPlayClubManager = manager.getPowerPlayClubManager(); + _inventoryManager = manager.getInventoryManager(); } @Override @@ -46,8 +50,7 @@ public class PowerPlayClubButton implements GuiItem { _player.closeInventory(); _player.playSound(_player.getLocation(), Sound.NOTE_PLING, 1, 1.6f); - _player.sendMessage("TEST"); - getMonthlyRewards().giveAllItems(); + getMonthlyRewards().giveAllItems(_player, _inventoryManager); updateLastClaimedMonth(); } else diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index e99bd92cb..d6fd2bbdb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -264,7 +264,8 @@ public class GadgetManager extends MiniPlugin addGadget(new MorphSnowman(this)); addGadget(new MorphUncleSam(this)); addGadget(new MorphSquid(this)); - addGadget(new MorphMetalMan(this)); + // Not being added in this update! + //addGadget(new MorphMetalMan(this)); // Particles addGadget(new ParticleFoot(this)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java index 1fc07c933..6751c430b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/LockCosmeticsCommand.java @@ -1,19 +1,14 @@ package mineplex.core.gadget.commands; +import java.util.UUID; + import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.inventory.ClientItem; import mineplex.core.inventory.data.Item; -import mineplex.core.mount.Mount; -import mineplex.core.pet.Pet; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; public class LockCosmeticsCommand extends CommandBase @@ -30,104 +25,41 @@ public class LockCosmeticsCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { - // Removes all cosmetic types - if (args.length == 0) - { - lockCosmetics(null, caller); - } - // Removes specific type - else - { - String type = args[0]; - if (type.equalsIgnoreCase("all")) - { - lockCosmetics(null, caller); - } - else if (type.equalsIgnoreCase("pet")) - { - lockPets(caller); - } - else if (type.equalsIgnoreCase("mount")) - { - lockMounts(caller); - } - else - { - GadgetType gadgetType = GadgetType.valueOf(type); - if (gadgetType == null) - { - UtilPlayer.message(caller, F.main("Cosmetics", "Invalid cosmetic type!")); - } - else - { - lockCosmetics(gadgetType, caller); - } - } - } - + lockCosmetics(caller); } - private void lockCosmetics(GadgetType gadgetType, Player caller) - { - if (gadgetType == null) - { - for (GadgetType type : GadgetType.values()) - { - lockCosmetics(type, caller); - } - lockMounts(caller); - lockPets(caller); - return; - } - int removed = 0; - for (Gadget gadget : _plugin.getGadgets(gadgetType)) - { - if (gadget.getGadgetType() == GadgetType.ITEM) - continue; - if (gadget.ownsGadget(caller)) - { - Item clientItem = _plugin.getInventoryManager().getItem(gadget.getName()); - if (clientItem == null) - continue; - _plugin.getInventoryManager().Get(caller.getName()).removeItem(new ClientItem(clientItem, 1)); - removed++; - } - } - UtilPlayer.message(caller, F.main("Cosmetics", "Removed all the " + gadgetType.name().toLowerCase() - .replace("_", " ") + "! (Removed " + C.cRed + removed + C.cGray + " " + - UtilText.plural("item", removed) + ")")); - } - - private void lockMounts(Player caller) + private void lockCosmetics(Player player) { - int removed = 0; - for (Mount mount : _plugin.getMountManager().getMounts()) + for (GadgetType gadgetType : GadgetType.values()) { - if (mount.hasMount(caller)) + for (Gadget gadget : _plugin.getGadgets(gadgetType)) { - Item clientItem = _plugin.getInventoryManager().getItem(mount.getName()); - if (clientItem == null) - continue; - _plugin.getInventoryManager().Get(caller.getName()).removeItem(new ClientItem(clientItem, 1)); - removed++; + if (gadget != null) + { + if (gadget.getName() != null) + { + lockCosmetic(gadget.getName(), player); + } + } } } - UtilPlayer.message(caller, F.main("Cosmetics", "Removed " + C.cRed + removed + C.cGray + " " + - UtilText.plural("mount", removed) + "!")); } - private void lockPets(Player caller) + private void lockCosmetic(String itemName, Player player) { - int removed = 0; - for (Pet pet : _plugin.getPetManager().getFactory().GetPets()) + // First try, with Donation Manager + _plugin.getDonationManager().Get(player).RemoveUnknownSalesPackagesOwned(itemName); + // Second try, with Inventory Manager + Item item = _plugin.getInventoryManager().getItem(itemName); + if (item != null) { - if (_plugin.getPetManager().Get(caller).getPets().containsKey(pet.getPetType())) - { - _plugin.getPetManager().Get(caller).getPets().remove(pet.getPetType()); - removed++; - } + _plugin.getInventoryManager().Get(player).removeItem(new ClientItem(item, 1)); } - UtilPlayer.message(caller, F.main("Cosmetics", "Removed " + C.cRed + removed + C.cGray + " " + - UtilText.plural("pet", removed) + "!")); } + + private void lockCosmetic(String itemName, UUID uuid) + { + // TODO + } + } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/powerplayclub/PowerPlayClubManager.java b/Plugins/Mineplex.Core/src/mineplex/core/powerplayclub/PowerPlayClubManager.java index 42ba76735..8c15239a9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/powerplayclub/PowerPlayClubManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/powerplayclub/PowerPlayClubManager.java @@ -5,9 +5,14 @@ import java.sql.ResultSet; import java.util.*; import mineplex.core.common.util.BukkitFuture; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.database.PlayerKeyValueRepository; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.inventory.data.Item; import org.bukkit.Bukkit; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; @@ -15,6 +20,11 @@ import org.bukkit.event.player.PlayerJoinEvent; public class PowerPlayClubManager implements Listener { + /** + * Manager for the Power Play Club system + * Sends and receives information from/to the database + */ + private PlayerKeyValueRepository _repository; private Map _playerMonths = new HashMap<>(); @@ -78,6 +88,10 @@ public class PowerPlayClubManager implements Listener addPlayerMonths(uuid, -1); } + /** + * Updates player's months and last claimed month + * @param uuid the player's UUID + */ private void updatePlayer(UUID uuid) { _repository.getAll(uuid).thenCompose(BukkitFuture.accept(values -> @@ -99,6 +113,9 @@ public class PowerPlayClubManager implements Listener })); } + /** + * Monthly rewards, based on each month, a different reward + */ public enum PowerPlayClubRewards { JANUARY, @@ -107,7 +124,7 @@ public class PowerPlayClubManager implements Listener APRIL, MAY, JUNE, - JULY, + JULY(new PowerPlayClubItem("Squid Morph", 1)), AUGUST(new PowerPlayClubItem("Squid Morph", 1)), SEPTEMBER, OCTOBER, @@ -126,13 +143,55 @@ public class PowerPlayClubManager implements Listener return _items; } - public void giveAllItems() + /** + * Gives the player the specific items for that month, plus + * 2x Game Boosters + * 1x Omega Chest + * @param player + * @param manager + */ + public void giveAllItems(Player player, InventoryManager manager) { - // TODO + for (PowerPlayClubItem item : _items) + { + Item fItem = manager.getItem(item.getPrize()); + if (fItem == null) + { + UtilPlayer.message(player, F.main("Power Play Club", "An unexpected error happened!")); + } + else + { + manager.addItemToInventory(player, fItem.Name, 1); + UtilPlayer.message(player, F.main("Power Play Club", "You received " + item.getAmount() + "x " + F.elem(item.getPrize()) + ".")); + } + } + Item gameAmplifier = manager.getItem("Game Booster"); + if (gameAmplifier == null) + { + UtilPlayer.message(player, F.main("Power Play Club", "An unexpected error happened!")); + } + else + { + manager.addItemToInventory(player, gameAmplifier.Name, 2); + UtilPlayer.message(player, F.main("Power Play Club", "You received 2x " + F.elem("Game Boosters") + ".")); + } + Item omegaChest = manager.getItem("Omega Chest"); + if (omegaChest == null) + { + UtilPlayer.message(player, F.main("Power Play Club", "An unexpected error happened!")); + } + else + { + manager.addItemToInventory(player, omegaChest.Name, 1); + UtilPlayer.message(player, F.main("Power Play Club", "You received 1x " + F.elem("Omega Chest") + ".")); + } } } + /** + * Class to help on monthly bonuses + */ public static class PowerPlayClubItem { private final String _prize; @@ -155,6 +214,9 @@ public class PowerPlayClubManager implements Listener } } + /** + * Class that stores player's months and last claimed month + */ protected class PlayerMonths { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 947cb4494..1e035fea6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -43,28 +43,8 @@ import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood; import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant; import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin; import mineplex.core.gadget.gadgets.hat.HatType; -import mineplex.core.gadget.gadgets.item.ItemBatGun; -import mineplex.core.gadget.gadgets.item.ItemBow; -import mineplex.core.gadget.gadgets.item.ItemCoal; -import mineplex.core.gadget.gadgets.item.ItemEtherealPearl; -import mineplex.core.gadget.gadgets.item.ItemFirework; -import mineplex.core.gadget.gadgets.item.ItemFleshHook; -import mineplex.core.gadget.gadgets.item.ItemFreezeCannon; -import mineplex.core.gadget.gadgets.item.ItemLovePotion; -import mineplex.core.gadget.gadgets.item.ItemMelonLauncher; -import mineplex.core.gadget.gadgets.item.ItemPaintballGun; -import mineplex.core.gadget.gadgets.item.ItemPartyPopper; -import mineplex.core.gadget.gadgets.item.ItemSnowball; -import mineplex.core.gadget.gadgets.item.ItemTNT; -import mineplex.core.gadget.gadgets.morph.MorphBat; -import mineplex.core.gadget.gadgets.morph.MorphBlock; -import mineplex.core.gadget.gadgets.morph.MorphChicken; -import mineplex.core.gadget.gadgets.morph.MorphCow; -import mineplex.core.gadget.gadgets.morph.MorphEnderman; -import mineplex.core.gadget.gadgets.morph.MorphSlime; -import mineplex.core.gadget.gadgets.morph.MorphSnowman; -import mineplex.core.gadget.gadgets.morph.MorphUncleSam; -import mineplex.core.gadget.gadgets.morph.MorphVillager; +import mineplex.core.gadget.gadgets.item.*; +import mineplex.core.gadget.gadgets.morph.*; import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots; import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate; import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitHelmet; @@ -73,13 +53,7 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet; import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings; -import mineplex.core.gadget.gadgets.particle.ParticleFairy; -import mineplex.core.gadget.gadgets.particle.ParticleFireRings; -import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel; -import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons; -import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal; -import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie; -import mineplex.core.gadget.gadgets.particle.ParticleYinYang; +import mineplex.core.gadget.gadgets.particle.*; import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane; import mineplex.core.gadget.gadgets.particle.cupidslove.ParticleHeart; import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald; @@ -91,36 +65,19 @@ import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime; import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; -import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; -import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap; -import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike; -import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan; -import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian; +import mineplex.core.gadget.gadgets.wineffect.*; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.HatGadget; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.inventory.InventoryManager; import mineplex.core.mount.Mount; -import mineplex.core.mount.types.MountBabyReindeer; -import mineplex.core.mount.types.MountCart; -import mineplex.core.mount.types.MountFreedomHorse; -import mineplex.core.mount.types.MountFrost; -import mineplex.core.mount.types.MountMule; -import mineplex.core.mount.types.MountSlime; -import mineplex.core.mount.types.MountUndead; +import mineplex.core.mount.types.*; import mineplex.core.pet.Pet; import mineplex.core.pet.PetManager; import mineplex.core.reward.RewardPool.Type; -import mineplex.core.reward.rewards.ExperienceReward; -import mineplex.core.reward.rewards.GemReward; -import mineplex.core.reward.rewards.InventoryReward; -import mineplex.core.reward.rewards.PetReward; -import mineplex.core.reward.rewards.RankReward; -import mineplex.core.reward.rewards.TreasureShardReward; -import mineplex.core.reward.rewards.UnknownPackageReward; +import mineplex.core.reward.rewards.*; import mineplex.core.stats.StatsManager; - import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -179,395 +136,7 @@ public class RewardManager addUncommon(); addRare(); addLegendary(); - -// addCommon(donationManager, inventoryManager, petManager, statsManager, commonValueMin, commonValueMax); -// addUncommon(donationManager, inventoryManager, petManager, statsManager, uncommonValueMin, uncommonValueMax); -// addRare(donationManager, inventoryManager, petManager, statsManager, rareValueMin, rareValueMax); -// addLegendary(donationManager, inventoryManager, petManager, statsManager, legendValueMin, legendValueMax); } - - /* - public void addCommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue) - { - RewardRarity rarity = RewardRarity.COMMON; - - // Coins - if (_carlSpinner) - { - addReward(new GemReward(donationManager, (int)minValue, (int)maxValue, 25, 0, rarity)); -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 25, rarity)); - addReward(new ExperienceReward(statsManager, (int)minValue*5, (int)maxValue*5, 25, 0, rarity)); - } - else - { -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 5, rarity)); - } - - //Increase Value - if (_doubleGadgetValue) - { - minValue *= 2; - maxValue *= 2; - } - - // Valentines - addReward(RewardPool.Type.VALENTINES_GIFT, new InventoryReward(inventoryManager, "Cupid's Arrows", "Cupid's Arrows", 1, 5, - new ItemStack(Material.BOW, 1), rarity, 300, 0)); - // Pets - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Cow Pet", "Cow", - EntityType.COW, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Sheep Pet", "Sheep", - EntityType.SHEEP, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Mooshroom Pet", "Mooshroom", - EntityType.MUSHROOM_COW, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Pig Pet", "Pig", - EntityType.PIG, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Ocelot Pet", "Cat", - EntityType.OCELOT, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Chicken Pet", "Chicken", - EntityType.CHICKEN, rarity, 50, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new PetReward(petManager, inventoryManager, donationManager, "Wolf Pet", "Dog", - EntityType.WOLF, rarity, 50, _uncommonShards)); - // Discs - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "13 Disc", "13 Disc", - new ItemStack(2256), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Cat Disc", "Cat Disc", - new ItemStack(2257), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Blocks Disc", "Blocks Disc", - new ItemStack(2258), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Chirp Disc", "Chirp Disc", - new ItemStack(2259), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Far Disc", "Far Disc", - new ItemStack(2260), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Mall Disc", "Mall Disc", - new ItemStack(2261), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Mellohi Disc", "Mellohi Disc", - new ItemStack(2262), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Stal Disc", "Stal Disc", - new ItemStack(2263), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Strad Disc", "Strad Disc", - new ItemStack(2264), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Ward Disc", "Ward Disc", - new ItemStack(2265), rarity, 10, _uncommonShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Music Disc", "Wait Disc", "Wait Disc", - new ItemStack(2267), rarity, 10, _uncommonShards)); - // Mounts - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Mount", "Mule", "Mount Mule", - new ItemStack(Material.HAY_BLOCK), rarity, 4, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Mount", "Minecart", "Minecart", - new ItemStack(Material.MINECART), rarity, 3, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Mount", "Slime", "Slime Mount", - new ItemStack(Material.SLIME_BALL), rarity, 2, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Mount", "Glacial Steed", "Glacial Steed", - new ItemStack(Material.SNOW_BALL), rarity, 1, _rareShards)); - - // Christmas - addReward(RewardPool.Type.WINTER_HOLIDAY, new InventoryReward(inventoryManager, "Coal", "Coal", 50, 100, - new ItemStack(Material.COAL), rarity, 10, 0)); - - addReward(RewardPool.Type.WINTER_HOLIDAY, new InventoryReward(inventoryManager, "Snowballs", "Snowball", 5, 20, - new ItemStack(Material.SNOW_BALL), rarity, 10, 0)); - - // Gadgets - addReward(new InventoryReward(inventoryManager, "Paintballs", "Paintball Gun", - (int)(100*(minValue/500)), (int)(100*(maxValue/500)), - new ItemStack(Material.GOLD_BARDING), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "Fireworks", "Fireworks", - (int)(50*(minValue/500)), (int)(50*(maxValue/500)), - new ItemStack(Material.FIREWORK), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "Melons", "Melon Launcher", - (int)(50*(minValue/500)), (int)(50*(maxValue/500)), - new ItemStack(Material.MELON_BLOCK), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "Flesh Hooks", "Flesh Hook", - (int)(40*(minValue/500)), (int)(40*(maxValue/500)), - new ItemStack(Material.getMaterial(131)), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "Pearls", "Ethereal Pearl", - (int)(30*(minValue/500)), (int)(30*(maxValue/500)), - new ItemStack(Material.ENDER_PEARL), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "Bat Swarms", "Bat Blaster", - (int)(20*(minValue/500)), (int)(20*(maxValue/500)), - new ItemStack(Material.IRON_BARDING), rarity, 10, 0)); - - addReward(new InventoryReward(inventoryManager, "TNT", "TNT", - (int)(20*(minValue/500)), (int)(20*(maxValue/500)), - new ItemStack(Material.TNT), rarity, 10, 0)); - - - } - - public void addUncommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue) - { - RewardRarity rarity = RewardRarity.UNCOMMON; - - // Coins - if (_carlSpinner) - { - addReward(new GemReward(donationManager, (int)minValue, (int)maxValue, 1200, 0, rarity)); -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 1200, rarity)); - addReward(new ExperienceReward(statsManager, (int)minValue*5, (int)maxValue*5, 1200, 0, rarity)); - } - else - { -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 250, RewardRarity.UNCOMMON)); - } - - //Increase Value - if (_doubleGadgetValue) - { - minValue *= 2; - maxValue *= 2; - } - - // Valentines - addReward(RewardPool.Type.VALENTINES_GIFT, new InventoryReward(inventoryManager, "Love Potion", "Love Potion", 1, 1, - new ItemStack(Material.POTION, 1), rarity, 100, 0)); - addReward(RewardPool.Type.VALENTINES_GIFT, new TreasureShardReward(_clientManager, donationManager, 100, 200, 25, rarity)); - - // Christmas - addReward(RewardPool.Type.WINTER_HOLIDAY, new InventoryReward(inventoryManager, "Freeze Cannon", "Freeze Cannon", 5, 10, - new ItemStack(Material.ICE), rarity, 10, 0)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new InventoryReward(inventoryManager, "Party Popper", "Party Popper", 5, 10, - new ItemStack(Material.GOLDEN_CARROT), rarity, 10, 0)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Hat", "Present", "Present", - SkinData.PRESENT.getSkull(), rarity, 5, 100)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Hat", "Snowman Head", "Snowman Head", - SkinData.SNOWMAN.getSkull(), rarity, 5, 100)); - - // Gadgets - addReward(new InventoryReward(inventoryManager, "Paintballs", "Paintball Gun", - (int)(100*(minValue/500)), (int)(100*(maxValue/500)), - new ItemStack(Material.GOLD_BARDING), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "Fireworks", "Fireworks", - (int)(50*(minValue/500)), (int)(50*(maxValue/500)), - new ItemStack(Material.FIREWORK), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "Melons", "Melon Launcher", - (int)(50*(minValue/500)), (int)(50*(maxValue/500)), - new ItemStack(Material.MELON_BLOCK), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "Flesh Hooks", "Flesh Hook", - (int)(40*(minValue/500)), (int)(40*(maxValue/500)), - new ItemStack(Material.getMaterial(131)), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "Pearls", "Ethereal Pearl", - (int)(30*(minValue/500)), (int)(30*(maxValue/500)), - new ItemStack(Material.ENDER_PEARL), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "Bat Swarms", "Bat Blaster", - (int)(20*(minValue/500)), (int)(20*(maxValue/500)), - new ItemStack(Material.IRON_BARDING), rarity, 250, 0)); - - addReward(new InventoryReward(inventoryManager, "TNT", "TNT", - (int)(20*(minValue/500)), (int)(20*(maxValue/500)), - new ItemStack(Material.TNT), rarity, 250, 0)); - - // Pets - addReward(new PetReward(petManager, inventoryManager, donationManager, "Cow Pet", "Cow", - EntityType.COW, rarity, 500, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Sheep Pet", "Sheep", - EntityType.SHEEP, rarity, 333, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Mooshroom Pet", "Mooshroom", - EntityType.MUSHROOM_COW, rarity, 200, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Pig Pet", "Pig", - EntityType.PIG, rarity, 200, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Ocelot Pet", "Cat", - EntityType.OCELOT, rarity, 167, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Chicken Pet", "Chicken", - EntityType.CHICKEN, rarity, 143, _uncommonShards)); - addReward(new PetReward(petManager, inventoryManager, donationManager, "Wolf Pet", "Dog", - EntityType.WOLF, rarity, 125, _uncommonShards)); - - // Music Discs - addReward(new UnknownPackageReward(donationManager, "Music Disc", "13 Disc", "13 Disc", - new ItemStack(2256), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Cat Disc", "Cat Disc", - new ItemStack(2257), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Blocks Disc", "Blocks Disc", - new ItemStack(2258), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Chirp Disc", "Chirp Disc", - new ItemStack(2259), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Far Disc", "Far Disc", - new ItemStack(2260), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Mall Disc", "Mall Disc", - new ItemStack(2261), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Mellohi Disc", "Mellohi Disc", - new ItemStack(2262), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Stal Disc", "Stal Disc", - new ItemStack(2263), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Strad Disc", "Strad Disc", - new ItemStack(2264), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Ward Disc", "Ward Disc", - new ItemStack(2265), rarity, 25, _uncommonShards)); - addReward(new UnknownPackageReward(donationManager, "Music Disc", "Wait Disc", "Wait Disc", - new ItemStack(2267), rarity, 25, _uncommonShards)); - } - - public void addRare(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue) - { - RewardRarity rarity = RewardRarity.RARE; - - // Coins - if (_carlSpinner) - { - addReward(new GemReward(donationManager, (int)minValue, (int)maxValue, 150, 0, rarity)); -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 150, rarity)); - addReward(new ExperienceReward(statsManager, (int)minValue*5, (int)maxValue*5, 150, 0, rarity)); - } - else - { -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 100, RewardRarity.RARE)); - } - - // Valentines - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Hat", "Companion Hat", "Companion", - SkinData.COMPANION_CUBE.getSkull(), rarity, 100, 0)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Hat", "Lovestruck Hat", "Lovestruck", - SkinData.LOVESTRUCK.getSkull(), rarity, 100, 0)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Hat", "Secret Package Hat", "Secret Package", - SkinData.SECRET_PACKAGE.getSkull(), rarity, 100, 0)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Hat", "Teddy Bear Hat", "Teddy Bear", - SkinData.TEDDY_BEAR.getSkull(), rarity, 100, 0)); - addReward(RewardPool.Type.VALENTINES_GIFT, new InventoryReward(inventoryManager, "Love Potion", "Love Potion", 1, 1, - new ItemStack(Material.POTION, 1), rarity, 1, 0)); - - // Christmas - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Hat", "Santa", "Santa", - SkinData.SANTA.getSkull(), rarity, 5, _rareShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new PetReward(petManager, inventoryManager, donationManager, "Elf", "Christmas Elf", - EntityType.VILLAGER, rarity, 5, _rareShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Death Effect", "Candy Cane Remains", "Candy Cane Remains", - new ItemStack(Material.SNOW_BALL), rarity, 5, _rareShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Particles", "Crushed Candy Cane", "Crushed Candy Cane", - new ItemStack(Material.SNOW_BALL), rarity, 5, _rareShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Arrow Effect", "Candy Cane Arrows", "Candy Cane Arrows", - new ItemStack(Material.SNOW_BALL), rarity, 5, _rareShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Jump Effect", "Candy Cane Blast", "Candy Cane Blast", - new ItemStack(Material.SNOW_BALL), rarity, 5, _rareShards)); - - // Mounts - addReward(new UnknownPackageReward(donationManager, "Mount", "Mule", "Mount Mule", - new ItemStack(Material.HAY_BLOCK), rarity, 200, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Mount", "Minecart", "Minecart", - new ItemStack(Material.MINECART), rarity, 100, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Mount", "Slime", "Slime Mount", - new ItemStack(Material.SLIME_BALL), rarity, 67, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Mount", "Glacial Steed", "Glacial Steed", - new ItemStack(Material.SNOW_BALL), rarity, 50, _rareShards)); - - // Morphs - addReward(new UnknownPackageReward(donationManager, "Morph", "Cow", "Cow Morph", - new ItemStack(Material.LEATHER), rarity, 167, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Morph", "Villager", "Villager Morph", - new ItemStack(Material.EMERALD), rarity, 83, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Morph", "Chicken", "Chicken Morph", - new ItemStack(Material.FEATHER), rarity, 50, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Morph", "Enderman", "Enderman Morph", - new ItemStack(Material.ENDER_PEARL), rarity, 33, _rareShards)); - - - // Costumes - addReward(new UnknownPackageReward(donationManager, "Costume", "Rave Hat", "Rave Hat", - new ItemStack(Material.LEATHER_HELMET), rarity, 30, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Rave Shirt", "Rave Shirt", - new ItemStack(Material.LEATHER_CHESTPLATE), rarity, 30, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Rave Pants", "Rave Pants", - new ItemStack(Material.LEATHER_LEGGINGS), rarity, 30, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Rave Boots", "Rave Boots", - new ItemStack(Material.LEATHER_BOOTS), rarity, 30, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Space Helmet", "Space Helmet", - new ItemStack(Material.GLASS), rarity, 50, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Space Jacket", "Space Jacket", - new ItemStack(Material.GOLD_CHESTPLATE), rarity, 50, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Space Pants", "Space Pants", - new ItemStack(Material.GOLD_LEGGINGS), rarity, 50, _rareShards)); - addReward(new UnknownPackageReward(donationManager, "Costume", "Space Boots", "Space Boots", - new ItemStack(Material.GOLD_BOOTS), rarity, 50, _rareShards)); - } - - public void addLegendary(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue) - { - RewardRarity rarity = RewardRarity.LEGENDARY; - - // Coins - if (_carlSpinner) - { - addReward(new GemReward(donationManager, (int)minValue, (int)maxValue, 10, 0, rarity)); -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 10, rarity)); - addReward(new ExperienceReward(statsManager, (int)minValue*5, (int)maxValue*5, 10, 0, rarity)); - } - else - { -// addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 25, rarity)); - } - - // Valentines - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Arrow Effect", "Arrows of Cupid", "Arrows of Cupid", - new ItemStack(Material.POTION), rarity, 100, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Death Effect", "Broken Hearted", "Broken Hearted", - new ItemStack(Material.POTION), rarity, 100, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Jump Effect", "Wings of Love", "Wings of Love", - new ItemStack(Material.POTION), rarity, 100, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new UnknownPackageReward(donationManager, "Particles", "Heartfelt Halo", "Heartfelt Halo", - new ItemStack(Material.POTION), rarity, 100, _rareShards)); - addReward(RewardPool.Type.VALENTINES_GIFT, new InventoryReward(inventoryManager, "Love Potion", "Love Potion", 1, 1, - new ItemStack(Material.POTION, 1), rarity, 2, 0)); - - // Christmas - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Hat", "The Grinch", "The Grinch", - SkinData.THE_GRINCH.getSkull(), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Morph", "Olaf", "Olaf Morph", - new ItemStack(Material.SNOW_BALL), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Mount", "Glacial Steed", "Glacial Steed", - new ItemStack(Material.SADDLE), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Mount", "Baby Reindeer", "Baby Reindeer", - new ItemStack(Material.GOLDEN_CARROT), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Particles", "Wind of the Frost Lord", "Wind of the Frost Lord", - new ItemStack(Material.SNOW_BALL), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Arrow Effect", "Arrows of the Frost Lord", "Arrows of the Frost Lord", - new ItemStack(Material.SNOW_BALL), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Jump Effect", "Gust of the Frost Lord", "Gust of the Frost Lord", - new ItemStack(Material.SNOW_BALL), rarity, 5, _legendaryShards)); - addReward(RewardPool.Type.WINTER_HOLIDAY, new UnknownPackageReward(donationManager, "Death Effect", "Fall of the Frost Lord", "Fall of the Frost Lord", - new ItemStack(Material.SNOW_BALL), rarity, 5, _legendaryShards)); - - // Mounts - addReward(new UnknownPackageReward(donationManager, "Mount", "Infernal Horror", "Infernal Horror", - new ItemStack(Material.BONE), rarity, 33, _legendaryShards)); - - // Morphs - addReward(new UnknownPackageReward(donationManager, "Morph", "Bat", "Bat Morph", - new ItemStack(Material.SKULL_ITEM, 1, (short) 0, (byte) 1), rarity, 25, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Morph", "Block", "Block Morph", - new ItemStack(Material.EMERALD_BLOCK), rarity, 20, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Morph", "Big Larry", "Big Larry Morph", - new ItemStack(Material.SLIME_BALL), rarity, 10, _legendaryShards)); - - - // Particles - addReward(new UnknownPackageReward(donationManager, "Particles", "Shadow Walk", "Shadow Walk", - new ItemStack(Material.LEATHER_BOOTS), rarity, 33, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Enchanted", "Enchanted", - new ItemStack(Material.BOOK), rarity, 25, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Flame Rings", "Flame Rings", - new ItemStack(Material.BLAZE_POWDER), rarity, 17, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Rain Cloud", "Rain Cloud", - new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 4), rarity, 13, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Blood Helix", "Blood Helix", - new ItemStack(Material.REDSTONE), rarity, 10, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Green Rings", "Green Ring", - new ItemStack(Material.EMERALD), rarity, 8, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Flame Fairy", "Flame Fairy", - new ItemStack(Material.APPLE), rarity, 4, _legendaryShards)); - addReward(new UnknownPackageReward(donationManager, "Particles", "Heart", "I Heart You", - new ItemStack(Material.BLAZE_POWDER), rarity, 2, _legendaryShards)); - } - */ public void addCommon() { @@ -642,6 +211,7 @@ public class RewardManager // WINTER Gadgets addHat(Type.WINTER_HOLIDAY, HatType.Present, rarity, 5); addHat(Type.WINTER_HOLIDAY, HatType.Snowman, rarity, 5); + } @@ -890,7 +460,7 @@ public class RewardManager addReward(type, reward); return reward; } - + public UnknownPackageReward addGadget(RewardPool.Type type, Gadget gadget, RewardRarity rarity, int weight, int shards) { return addGadget(type, gadget, gadget.getDisplayName(), rarity, weight, shards); @@ -1023,9 +593,24 @@ public class RewardManager if(pool == Type.NORMAL) { _rewardPools.get(Type.CARL_SPINNER).add(reward); - + if(!(reward instanceof InventoryReward)) + { _rewardPools.get(Type.ILLUMINATED).add(reward); + } + } + // OMEGA ITEMS + if (reward instanceof UnknownPackageReward) + { + UnknownPackageReward unknownPackageReward = (UnknownPackageReward) reward; + if (!unknownPackageReward.getHeader().equalsIgnoreCase("Game Modifiers")) + { + _rewardPools.get(Type.OMEGA).add(reward); + } + } + else if (!(reward instanceof InventoryReward) && !(reward instanceof TreasureShardReward)) + { + _rewardPools.get(Type.OMEGA).add(reward); } _rewardPools.get(pool).add(reward); } @@ -1033,7 +618,7 @@ public class RewardManager public Reward[] getRewards(Player player, RewardPool.Type pool, RewardType type) { int amount = 4; - if(type == RewardType.IlluminatedChest || type == RewardType.FreedomChest) amount = 1; + if(type == RewardType.IlluminatedChest || type == RewardType.FreedomChest || type == RewardType.OmegaChest) amount = 1; int currentReward = 0; Reward[] rewards = new Reward[amount]; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java index 19e01f1f1..89c4ea9dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java @@ -7,6 +7,8 @@ import java.util.List; import mineplex.core.reward.rewards.GemReward; import mineplex.core.reward.rewards.InventoryReward; +import mineplex.core.reward.rewards.TreasureShardReward; +import mineplex.core.reward.rewards.UnknownPackageReward; import org.bukkit.entity.Player; /** @@ -77,6 +79,21 @@ public class RewardPool return false; } } + if (this == OMEGA) + { + if (reward instanceof InventoryReward || reward instanceof TreasureShardReward) + { + return false; + } + else if (reward instanceof UnknownPackageReward) + { + UnknownPackageReward unknownPackageReward = (UnknownPackageReward) reward; + if (unknownPackageReward.getHeader().equalsIgnoreCase("Game Modifiers")) + { + return false; + } + } + } if (this == Type.CARL_SPINNER) { if (reward instanceof GemReward) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java index c007105be..0fd48d5a3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java @@ -13,6 +13,7 @@ public enum RewardType WinterChest( 0, 5, 18, 32), IlluminatedChest( 0, 2, 16, 72), FreedomChest( 0, 5, 18, 0), + OmegaChest( 0, 2, 16, 32), ValentinesGift( 0, 7, 20, 20), SpinnerFiller( 0.1, 1, 4, 20), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java index aeb5b3550..50f2c0d72 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java @@ -75,4 +75,9 @@ public class UnknownPackageReward extends Reward } return false; } + + public String getHeader() + { + return _header; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java index a2cc71f46..d0e794430 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java @@ -2,8 +2,22 @@ package mineplex.core.treasure; import java.util.List; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.*; +import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; -import mineplex.core.reward.RewardPool; +import mineplex.core.gadget.event.GadgetBlockEvent; +import mineplex.core.hologram.Hologram; +import mineplex.core.hologram.HologramInteraction; +import mineplex.core.hologram.HologramManager; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.reward.Reward; +import mineplex.core.status.ServerStatusManager; +import mineplex.core.treasure.event.TreasureFinishEvent; +import mineplex.core.treasure.event.TreasureStartEvent; +import mineplex.core.treasure.gui.TreasureShop; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -21,29 +35,6 @@ import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerVelocityEvent; -import mineplex.core.account.CoreClientManager; -import mineplex.core.common.util.C; -import mineplex.core.common.util.Callback; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.event.GadgetBlockEvent; -import mineplex.core.hologram.Hologram; -import mineplex.core.hologram.HologramInteraction; -import mineplex.core.hologram.HologramManager; -import mineplex.core.inventory.InventoryManager; -import mineplex.core.reward.Reward; -import mineplex.core.status.ServerStatusManager; -import mineplex.core.treasure.event.TreasureFinishEvent; -import mineplex.core.treasure.event.TreasureStartEvent; -import mineplex.core.treasure.gui.TreasureShop; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; - public class TreasureLocation implements Listener { private TreasureManager _treasureManager; @@ -135,7 +126,7 @@ public class TreasureLocation implements Listener return; } - if(treasureType == TreasureType.ILLUMINATED || treasureType == TreasureType.FREEDOM) + if(treasureType == TreasureType.ILLUMINATED || treasureType == TreasureType.FREEDOM || treasureType == TreasureType.OMEGA) { if(!_treasureManager.hasItemsToGivePlayer(treasureType.getRewardPool(), player)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java index 671ca2ba1..54fdeaea6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java @@ -48,6 +48,13 @@ public enum TreasureStyle ParticleType.RED_DUST, Sound.FIZZ, Sound.FIREWORK_TWINKLE2 + ), + OMEGA( + ParticleType.CRIT, + null, + ParticleType.CRIT, + Sound.FIRE, + Sound.FIREWORK_TWINKLE ); private ParticleType _secondaryParticle; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java index 6e424f0b4..7293f2d5e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java @@ -18,7 +18,9 @@ public enum TreasureType ILLUMINATED(C.cAqua + "Illuminated Treasure", "Illuminated Chest", "Illuminated", RewardType.IlluminatedChest, Material.CHEST, TreasureStyle.ILLUMINATED, RewardPool.Type.ILLUMINATED, true, 20000), - FREEDOM(C.cRed + "Freedom " + C.cBlue + "Treasure", "Freedom Treasure", "Freedom", RewardType.FreedomChest, Material.CHEST, TreasureStyle.FREEDOM, RewardPool.Type.FREEDOM, true, 35000); + FREEDOM(C.cRed + "Freedom " + C.cBlue + "Treasure", "Freedom Treasure", "Freedom", RewardType.FreedomChest, Material.CHEST, TreasureStyle.FREEDOM, RewardPool.Type.FREEDOM, true, 35000), + + OMEGA(C.cAqua + "Omega Chest", "Omega Chest", "Omega", RewardType.OmegaChest, Material.ENDER_CHEST, TreasureStyle.OMEGA, RewardPool.Type.OMEGA, true, 1); private final String _name; private final RewardType _rewardType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java index 4ec8090b9..092821c53 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java @@ -2,16 +2,12 @@ package mineplex.core.treasure.animation; import java.util.List; -import org.bukkit.Bukkit; -import org.bukkit.Effect; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Player; - import mineplex.core.treasure.BlockInfo; import mineplex.core.treasure.Treasure; import mineplex.core.treasure.TreasureType; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; public class BlockChangeAnimation extends Animation { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java index 2d7203f06..62393077e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java @@ -54,6 +54,12 @@ public class BuyChestButton implements IButton return; } } + if (!_page.getPlugin().hasItemsToGivePlayer(TreasureType.OMEGA.getRewardPool(), player) + && _chestType == TreasureType.OMEGA) + { + player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!")); + return; + } if (!_page.getPlugin().hasItemsToGivePlayer(TreasureType.ILLUMINATED.getRewardPool(), player) && _chestType == TreasureType.ILLUMINATED) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index e1648228c..792a283a9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -1,5 +1,8 @@ package mineplex.core.treasure.gui; +import java.util.ArrayList; +import java.util.List; + import mineplex.core.account.CoreClientManager; import mineplex.core.common.currency.GlobalCurrency; import mineplex.core.common.skin.SkinData; @@ -27,9 +30,6 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.ArrayList; -import java.util.List; - public class TreasurePage extends ShopPageBase { private TreasureLocation _treasureLocation; @@ -58,6 +58,7 @@ public class TreasurePage extends ShopPageBase int christmasCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.CHRISTMAS.getItemName()); int illuminatedCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ILLUMINATED.getItemName()); int freedomCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.FREEDOM.getItemName()); + int omegaCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.OMEGA.getItemName()); List shardLore = new ArrayList<>(); shardLore.add(" "); @@ -176,13 +177,17 @@ public class TreasurePage extends ShopPageBase freedomLore.add(" "); freedomLore.add(ChatColor.RESET + C.cGreen + getFreedomUnlockedAmount(getPlayer()) + "/7 Unlocked"); + List omegaLore = new ArrayList<>(); + omegaLore.add("PLACEHOLDER"); + ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Treasure", basicLore.toArray(new String[0]), 0, false, false); ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Treasure", heroicLore.toArray(new String[0]), 0, false, false); ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Treasure", legendaryLore.toArray(new String[0]), 0, false, false); ItemStack christmas = SkinData.PRESENT.getSkull(C.cDGreen + C.Bold + "Winter Holiday Treasure", christmasLore); ItemStack illuminated = new ShopItem(Material.SEA_LANTERN, C.cDAqua + C.Bold + "Illuminated Treasure", illuminatedLore.toArray(new String[0]), 0, false, false); - ItemStack freedom = SkinData.FREEDOM_CHEST.getSkull(C.cRed + C.Bold + "Freedom " + C.cBlue + C.Bold + "Treasure", freedomLore); + ItemStack freedom = SkinData.FREEDOM_CHEST.getSkull(C.cRedB + "Freedom " + C.cBlueB + "Treasure", freedomLore); + ShopItem omega = new ShopItem(Material.NETHER_STAR, C.cAquaB + "Omega Treasure", omegaLore.toArray(new String[0]), 0, false, false); addItem(40, shards); @@ -198,6 +203,7 @@ public class TreasurePage extends ShopPageBase addChest(20, basic, TreasureType.OLD, basicCount); addChest(22, heroic, TreasureType.ANCIENT, heroicCount); addChest(24, legendary, TreasureType.MYTHICAL, legendaryCount); + addChest(4, omega, TreasureType.OMEGA, omegaCount); } private void addChest(int slot, ItemStack item, TreasureType treasureType, int owned) diff --git a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java index cd50a732f..3487544c8 100644 --- a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java +++ b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java @@ -1,16 +1,11 @@ package mineplex.enjinTranslator; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.AbstractMap; +import java.util.Date; +import java.util.Iterator; import java.util.Map.Entry; - -import mineplex.core.powerplayclub.PowerPlayClubManager; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.plugin.java.JavaPlugin; +import java.util.UUID; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClient; @@ -22,6 +17,7 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UUIDFetcher; import mineplex.core.donation.DonationManager; import mineplex.core.inventory.InventoryManager; +import mineplex.core.powerplayclub.PowerPlayClubManager; import mineplex.core.server.util.TransactionResponse; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -33,13 +29,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.plugin.java.JavaPlugin; -import java.text.SimpleDateFormat; -import java.util.AbstractMap; -import java.util.Date; -import java.util.Iterator; -import java.util.Map.Entry; -import java.util.UUID; - public class Enjin extends MiniPlugin implements CommandExecutor { private CoreClientManager _clientManager; @@ -144,14 +133,17 @@ public class Enjin extends MiniPlugin implements CommandExecutor { if (!checkForPurchase(args, name, client)) { - StringBuilder sb = new StringBuilder(); - - for (String arg : args) + if (!checkForPowerPlayClub(args, name, playerUUID, client)) { - sb.append(arg + " "); - } + StringBuilder sb = new StringBuilder(); - System.out.println("Received Command : " + sb.toString()); + for (String arg : args) + { + sb.append(arg + " "); + } + + System.out.println("Received Command : " + sb.toString()); + } } } } @@ -315,7 +307,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor if (args.length != 3 || !args[0].equalsIgnoreCase("powerplayclub")) return false; - if (args[1].equalsIgnoreCase("month")) + if (args[2].equalsIgnoreCase("month")) { _powerPlayClubManager.addPlayerMonths(playerUUID, 1); } else diff --git a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java index 26f7065f6..6b5e6fad3 100644 --- a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java +++ b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java @@ -188,7 +188,7 @@ public class HubManager extends MiniPlugin _mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager); _inventoryManager = inventoryManager; new BenefitManager(plugin, clientManager, _inventoryManager); - _gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager); + _gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager, incognito); FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager); YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);