New Chest

This commit is contained in:
Sam 2017-08-03 00:34:22 +01:00
parent 3b637ca600
commit c88d609780
13 changed files with 298 additions and 157 deletions

View File

@ -104,7 +104,7 @@ import mineplex.core.gadget.gadgets.gamemodifiers.GameCosmeticType;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.HeroSkinGadget;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.ShopMorphType;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphType;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphGadget;
import mineplex.core.gadget.gadgets.hat.HatItem;
import mineplex.core.gadget.gadgets.hat.HatType;
@ -751,13 +751,6 @@ public class GadgetManager extends MiniPlugin
return new HeroSkinCategoryPage(parent.getPlugin(), parent.getShop(), parent.getClientManager(), parent.getDonationManager(), getCategoryName(), parent.getClient().GetPlayer(), parent);
}
};
new GameCosmeticCategory(this, "Taunts", new ItemStack(Material.LAVA_BUCKET), false)
{
@Override
public void addGadgets()
{
}
};
new GameCosmeticCategory(this, "Base Decorations", new ItemStack(Material.WOOD_DOOR), false)
{
@Override

View File

@ -46,21 +46,22 @@ public class GameCosmeticManager extends MiniPlugin
Gadget gadget = event.getGadget();
if (gadget instanceof GameModifierGadget)
if (!(gadget instanceof GameModifierGadget))
{
GameCosmeticCategory category = ((GameModifierGadget) gadget).getCategory();
if (category.isAllowingMultiple())
{
return;
}
// Disable all other gadgets if not allowing multiple.
category.getGadgets().stream()
.filter(gadget1 -> !gadget.equals(gadget1))
.forEach(gadget1 -> gadget.disable(event.getPlayer()));
return;
}
GameCosmeticCategory category = ((GameModifierGadget) gadget).getCategory();
if (category.isAllowingMultiple())
{
return;
}
// Disable all other gadgets if not allowing multiple.
category.getGadgets().stream()
.filter(gadget1 -> !gadget.equals(gadget1))
.forEach(gadget1 -> gadget1.disable(event.getPlayer()));
}
public GameModifierGadget getActiveCosmetic(Player player, GameDisplay gameType, String categoryName)

View File

@ -1,99 +0,0 @@
package mineplex.core.gadget.gadgets.gamemodifiers.moba;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.disguise.disguises.DisguiseCow;
import mineplex.core.disguise.disguises.DisguiseLiving;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.disguise.disguises.DisguiseSheep;
public enum ShopMorphType
{
SHEEP("Sheep", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.SHEEP), DisguiseSheep.class),
COW("Cow", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.COW), DisguiseCow.class),
MOOSHROOM("Mooshroom", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.MUSHROOM_COW), DisguiseMooshroom.class),
BOB_ROSS("Bob Ross", Material.PAINTING, SkinData.BOB_ROSS)
;
private final String _name;
private final Material _material;
private final byte _materialData;
private final Class<? extends DisguiseLiving> _clazz;
private final SkinData _skinData;
ShopMorphType(String name, Material material, Class<? extends DisguiseLiving> clazz)
{
this(name, material, (byte) 0, clazz);
}
ShopMorphType(String name, Material material, byte materialData, Class<? extends DisguiseLiving> clazz)
{
this(name, material, materialData, clazz, null);
}
ShopMorphType(String name, Material material, SkinData skinData)
{
this(name, material, (byte) 0, DisguisePlayer.class, skinData);
}
ShopMorphType(String name, Material material, byte materialData, SkinData skinData)
{
this(name, material, materialData, DisguisePlayer.class, skinData);
}
ShopMorphType(String name, Material material, byte materialData, Class<? extends DisguiseLiving> clazz, SkinData skinData)
{
_name = name;
_material = material;
_materialData = materialData;
_clazz = clazz;
_skinData = skinData;
}
public DisguiseLiving createInstance(LivingEntity entity)
{
try
{
return _clazz.getConstructor(Entity.class).newInstance(entity);
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
public String getName()
{
return _name;
}
public Material getMaterial()
{
return _material;
}
public byte getMaterialData()
{
return _materialData;
}
public Class<? extends DisguiseLiving> getClazz()
{
return _clazz;
}
public SkinData getSkinData()
{
return _skinData;
}
}

View File

@ -5,7 +5,6 @@ import org.bukkit.Material;
import mineplex.core.common.util.C;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.gamemodifiers.GameCosmeticCategory;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.ShopMorphType;
import mineplex.core.gadget.types.GameModifierGadget;
import mineplex.core.itemstack.ItemStackFactory;

View File

@ -0,0 +1,129 @@
package mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import mineplex.core.common.skin.SkinData;
import mineplex.core.disguise.disguises.DisguiseBlaze;
import mineplex.core.disguise.disguises.DisguiseCow;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.disguise.disguises.DisguiseGuardian;
import mineplex.core.disguise.disguises.DisguiseHorse;
import mineplex.core.disguise.disguises.DisguiseIronGolem;
import mineplex.core.disguise.disguises.DisguiseLiving;
import mineplex.core.disguise.disguises.DisguiseMagmaCube;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.disguise.disguises.DisguisePig;
import mineplex.core.disguise.disguises.DisguisePigZombie;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.disguise.disguises.DisguiseSheep;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.disguise.disguises.DisguiseSnowman;
import mineplex.core.disguise.disguises.DisguiseSpider;
import mineplex.core.disguise.disguises.DisguiseZombie;
import mineplex.core.reward.RewardRarity;
public enum ShopMorphType
{
SHEEP("Sheep", Material.SHEARS, DisguiseSheep.class, RewardRarity.UNCOMMON),
COW("Cow", Material.LEATHER, DisguiseCow.class, RewardRarity.UNCOMMON),
MOOSHROOM("Mooshroom", Material.RED_MUSHROOM, DisguiseMooshroom.class, RewardRarity.UNCOMMON),
PIG("Pig", Material.COOKED_BEEF, DisguisePig.class, RewardRarity.UNCOMMON),
HORSE("Horse", Material.SADDLE, DisguiseHorse.class, RewardRarity.UNCOMMON),
SNOW_GOLEM("Snowman", Material.SNOW_BALL, DisguiseSnowman.class, RewardRarity.UNCOMMON),
IRON_GOLEM("Iron Golem", Material.IRON_BLOCK, DisguiseIronGolem.class, RewardRarity.UNCOMMON),
ZOMBIE("Zombie", Material.ROTTEN_FLESH, DisguiseZombie.class, RewardRarity.UNCOMMON),
SKELETON("Skeleton", Material.BONE, DisguiseSkeleton.class, RewardRarity.UNCOMMON),
SPIDER("Spider", Material.SPIDER_EYE, DisguiseSpider.class, RewardRarity.UNCOMMON),
SLIME("Slime", Material.SLIME_BALL, DisguiseSlime.class, RewardRarity.UNCOMMON),
MAGMA_SLIME("Magma Slime", Material.MAGMA_CREAM, DisguiseMagmaCube.class, RewardRarity.UNCOMMON),
WITHER_SKELETON("Wither Skeleton", Material.SKULL_ITEM, 1, DisguiseSkeleton.class, RewardRarity.UNCOMMON),
PIG_ZOMBIE("Pig Zombie", Material.GOLD_SWORD, DisguisePigZombie.class, RewardRarity.UNCOMMON),
BLAZE("Blaze", Material.BLAZE_POWDER, DisguiseBlaze.class, RewardRarity.UNCOMMON),
GUARDIAN("Guardian", Material.PRISMARINE_SHARD, DisguiseGuardian.class, RewardRarity.UNCOMMON),
ENDERMAN("Enderman", Material.ENDER_PEARL, DisguiseEnderman.class, RewardRarity.UNCOMMON),
SANTA("Santa", Material.WOOL, 14, SkinData.SANTA, RewardRarity.RARE),
BOB_ROSS("Bob Ross", Material.PAINTING, SkinData.BOB_ROSS, RewardRarity.RARE),
;
private final String _name;
private final Material _material;
private final byte _materialData;
private final Class<? extends DisguiseLiving> _clazz;
private final SkinData _skinData;
private final RewardRarity _rarity;
ShopMorphType(String name, Material material, Class<? extends DisguiseLiving> clazz, RewardRarity rarity)
{
this(name, material, 0, clazz, null, rarity);
}
ShopMorphType(String name, Material material, int materialData, Class<? extends DisguiseLiving> clazz, RewardRarity rarity)
{
this(name, material, materialData, clazz, null, rarity);
}
ShopMorphType(String name, Material material, SkinData skinData, RewardRarity rarity)
{
this(name, material, 0, DisguisePlayer.class, skinData, rarity);
}
ShopMorphType(String name, Material material, int materialData, SkinData skinData, RewardRarity rarity)
{
this(name, material, materialData, DisguisePlayer.class, skinData, rarity);
}
ShopMorphType(String name, Material material, int materialData, Class<? extends DisguiseLiving> clazz, SkinData skinData, RewardRarity rarity)
{
_name = name;
_material = material;
_materialData = (byte) materialData;
_clazz = clazz;
_skinData = skinData;
_rarity = rarity;
}
public DisguiseLiving createInstance(LivingEntity entity)
{
try
{
return _clazz.getConstructor(Entity.class).newInstance(entity);
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
public String getName()
{
return _name;
}
public Material getMaterial()
{
return _material;
}
public byte getMaterialData()
{
return _materialData;
}
public SkinData getSkinData()
{
return _skinData;
}
public RewardRarity getRarity()
{
return _rarity;
}
}

View File

@ -5,14 +5,7 @@ import java.util.EnumMap;
import java.util.List;
import java.util.Random;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
import mineplex.core.gadget.gadgets.death.DeathMapleLeaf;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
import mineplex.core.gadget.gadgets.flag.FlagType;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleAuraNiceness;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleCanadian;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedomFireworks;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleStarSpangled;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -23,47 +16,53 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.banner.CountryFlag;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEmerald;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm;
import mineplex.core.gadget.gadgets.balloons.BalloonType;
import mineplex.core.gadget.gadgets.death.DeathBlood;
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
import mineplex.core.gadget.gadgets.death.DeathPresentDanger;
import mineplex.core.gadget.gadgets.death.DeathCupidsBrokenHeart;
import mineplex.core.gadget.gadgets.death.DeathEmerald;
import mineplex.core.gadget.gadgets.death.DeathEnchant;
import mineplex.core.gadget.gadgets.death.DeathFreedom;
import mineplex.core.gadget.gadgets.death.DeathFrostLord;
import mineplex.core.gadget.gadgets.death.DeathStorm;
import mineplex.core.gadget.gadgets.death.DeathMapleLeaf;
import mineplex.core.gadget.gadgets.death.DeathMusic;
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
import mineplex.core.gadget.gadgets.death.DeathPresentDanger;
import mineplex.core.gadget.gadgets.death.DeathShadow;
import mineplex.core.gadget.gadgets.death.DeathSpring;
import mineplex.core.gadget.gadgets.death.DeathBlood;
import mineplex.core.gadget.gadgets.death.DeathEnchant;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
import mineplex.core.gadget.gadgets.death.DeathStorm;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEmerald;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
import mineplex.core.gadget.gadgets.flag.FlagType;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.HeroSkinGadget;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphType;
import mineplex.core.gadget.gadgets.hat.HatType;
import mineplex.core.gadget.gadgets.item.ItemBatGun;
import mineplex.core.gadget.gadgets.item.ItemBow;
@ -98,6 +97,14 @@ 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.morph.moba.MorphAnath;
import mineplex.core.gadget.gadgets.morph.moba.MorphBardolf;
import mineplex.core.gadget.gadgets.morph.moba.MorphBiff;
import mineplex.core.gadget.gadgets.morph.moba.MorphDana;
import mineplex.core.gadget.gadgets.morph.moba.MorphDevon;
import mineplex.core.gadget.gadgets.morph.moba.MorphHattori;
import mineplex.core.gadget.gadgets.morph.moba.MorphLarissa;
import mineplex.core.gadget.gadgets.morph.moba.MorphRowena;
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitBoots;
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitChestplate;
import mineplex.core.gadget.gadgets.outfit.freezesuit.OutfitFreezeSuitHelmet;
@ -114,28 +121,32 @@ import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksBoots;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksChestplate;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksHat;
import mineplex.core.gadget.gadgets.outfit.stpatricks.OutfitStPatricksLeggings;
import mineplex.core.gadget.gadgets.particle.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
import mineplex.core.gadget.gadgets.particle.ParticleEmerald;
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
import mineplex.core.gadget.gadgets.particle.ParticlePartyTime;
import mineplex.core.gadget.gadgets.particle.ParticleRain;
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.ParticleWingsLove;
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
import mineplex.core.gadget.gadgets.particle.ParticleEmerald;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleAuraNiceness;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleCanadian;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
import mineplex.core.gadget.gadgets.particle.ParticleRain;
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
import mineplex.core.gadget.gadgets.particle.ParticlePartyTime;
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedomFireworks;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleStarSpangled;
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
import mineplex.core.gadget.gadgets.particle.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
import mineplex.core.gadget.gadgets.taunts.RainbowTaunt;
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
@ -367,6 +378,13 @@ public class RewardManager
// INFUSED CHESTS
for (ShopMorphType shopMorphType : ShopMorphType.values())
{
if (shopMorphType.getRarity() == rarity)
{
addMOBAShopSkin(Type.MOBA, shopMorphType, rarity, 1);
}
}
}
public void addRare()
@ -666,6 +684,14 @@ public class RewardManager
addGadget(Type.OMEGA, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.FLAMES_OF_FURY), rarity, 150);
addGadget(Type.ILLUMINATED, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.FLAMES_OF_FURY), rarity, 150);
addGadget(Type.MYTHICAL, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.FLAMES_OF_FURY), rarity, 150);
for (ShopMorphType shopMorphType : ShopMorphType.values())
{
if (shopMorphType.getRarity() == rarity)
{
addMOBAShopSkin(Type.MOBA, shopMorphType, rarity, 1);
}
}
}
public void addLegendary()
@ -974,6 +1000,15 @@ public class RewardManager
addGadget(Type.OMEGA, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.LOVE), rarity, 100);
addGadget(Type.ILLUMINATED, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.LOVE), rarity, 100);
addGadget(Type.MYTHICAL, getSingleParticleKitSelector(SingleParticleKitSelector.SingleParticleSelectors.LOVE), rarity, 100);
addGadget(Type.MOBA, getGadget(MorphHattori.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphDevon.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphAnath.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphDana.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphBardolf.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphRowena.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphLarissa.class), rarity, 1);
addGadget(Type.MOBA, getGadget(MorphBiff.class), rarity, 1);
}
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)
@ -1059,6 +1094,27 @@ public class RewardManager
return addGadget(type, gadget, gadget.getDisplayName() + " (Minestrike Weapon Skin)", rarity, weight, shards);
}
public UnknownPackageReward addMOBASkin(Type type, HeroSkinGadget gadget, RewardRarity rarity, int weight)
{
return addMOBASkin(type, gadget, rarity, weight, getShards(rarity));
}
public UnknownPackageReward addMOBASkin(Type type, HeroSkinGadget gadget, RewardRarity rarity, int weight, int shards)
{
return addGadget(type, gadget, gadget.getDisplayName() + " (HOG Hero Skin)", rarity, weight, shards);
}
public UnknownPackageReward addMOBAShopSkin(Type type, ShopMorphType morphType, RewardRarity rarity, int weight)
{
return addMOBAShopSkin(type, morphType, rarity, weight, getShards(rarity));
}
public UnknownPackageReward addMOBAShopSkin(Type type, ShopMorphType morphType, RewardRarity rarity, int weight, int shards)
{
Gadget gadget = _gadgetManager.getGameCosmeticManager().getGadgetFrom(morphType.getName());
return addGadget(type, gadget, gadget.getDisplayName() + " (HOG Shop Skin)", rarity, weight, shards);
}
public void addTitle(Type type, String trackName, RewardRarity rarity, int weight, int shards)
{
addReward(type, new TitleReward(_trackManager.getTrackById(trackName), rarity, weight, shards));

View File

@ -66,6 +66,7 @@ public class RewardPool
LOVECHEST(false, 1),
STPATRICKS(false, 1),
SPRING(false, 1),
MOBA(true),
CARL_SPINNER(true);
private boolean _useDuplicates;

View File

@ -23,6 +23,7 @@ public enum RewardType
VALENTINES_GIFT( 0, 7, 20, 20),
ST_PATRICKS( 0, 6, 18, 0),
SPRING( 0, 6, 18, 0),
MOBA( 0, 5, 25, 40),
SPINNER_FILLER( 0.1, 1, 4, 20),
SPINNER_REAL( 0.000001, 0.05, 0.4, 5);

View File

@ -104,7 +104,16 @@ public enum TreasureStyle
ParticleType.RED_DUST,
Sound.STEP_GRASS,
Sound.STEP_GRASS
);
),
MOBA(
ParticleType.FIREWORKS_SPARK,
ParticleType.FIREWORKS_SPARK,
ParticleType.FIREWORKS_SPARK,
Sound.ANVIL_LAND,
Sound.ANVIL_LAND
),
;
private ParticleType _secondaryParticle;
private ParticleType _chestSpawnParticle;

View File

@ -4,6 +4,7 @@ import org.bukkit.Material;
import mineplex.core.common.util.C;
import mineplex.core.reward.RewardPool;
import mineplex.core.reward.RewardPool.Type;
import mineplex.core.reward.RewardType;
public enum TreasureType
@ -36,7 +37,10 @@ public enum TreasureType
ST_PATRICKS(C.cGreen + "St Patrick's Treasure", "St Patricks Chest", "StPatricksChest", RewardType.ST_PATRICKS, Material.CHEST, TreasureStyle.STPATRICKS,RewardPool.Type.STPATRICKS, true, 20000),
SPRING(C.cGreen + "Spring Treasure", "Spring Chest", "SpringChest", RewardType.SPRING, Material.CHEST, TreasureStyle.SPRING, RewardPool.Type.SPRING, true, 20000);
SPRING(C.cGreen + "Spring Treasure", "Spring Chest", "SpringChest", RewardType.SPRING, Material.CHEST, TreasureStyle.SPRING, RewardPool.Type.SPRING, true, 20000),
MOBA(C.cAqua + "Heroes of GWEN Treasure", "HOG Chest", "HOGChest", RewardType.MOBA, Material.ENDER_CHEST, TreasureStyle.MOBA, RewardPool.Type.MOBA, false, -1),
;
private final String _name;
private final RewardType _rewardType;

View File

@ -106,6 +106,11 @@ public class BlockChangeAnimation extends Animation
{
mat = Material.GRASS;
}
else if (getTreasure().getTreasureType() == TreasureType.MOBA)
{
mat = Material.PRISMARINE;
data = 2;
}
else
continue;
@ -123,7 +128,7 @@ public class BlockChangeAnimation extends Animation
if (getTreasure().getTreasureType() == TreasureType.ANCIENT) mat = Material.NETHER_BRICK_STAIRS;
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) mat = Material.QUARTZ_STAIRS;
else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS) mat = Material.PACKED_ICE;
else if (getTreasure().getTreasureType() == TreasureType.ILLUMINATED)
else if (getTreasure().getTreasureType() == TreasureType.ILLUMINATED)
{
mat = Material.PRISMARINE;
data = 2;
@ -163,6 +168,11 @@ public class BlockChangeAnimation extends Animation
mat = Material.DIRT;
data = 2;
}
else if (getTreasure().getTreasureType() == TreasureType.MOBA)
{
mat = Material.STAINED_CLAY;
data = 11;
}
else
continue;
@ -278,6 +288,17 @@ public class BlockChangeAnimation extends Animation
}
}
}
else if(getTreasure().getTreasureType() == TreasureType.MOBA)
{
for(Block c : _chests)
{
if(c.equals(b))
{
_blockInfoList.add(new BlockInfo(b));
b.setType(Material.PRISMARINE);
}
}
}
}
}

View File

@ -148,7 +148,8 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName());
int stpatricksCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ST_PATRICKS.getItemName());
int springCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.SPRING.getItemName());
int mobaCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MOBA.getItemName());
boolean availableChristmas = new File("../../update/files/EnableChristmasChest.dat").exists();
boolean availableFreedom = new File("../../update/files/EnableFreedomChest.dat").exists();
boolean availableHaunted = new File("../../update/files/EnableHauntedChest.dat").exists();
@ -492,6 +493,21 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
}
}
List<String> mobaLore = Lists.newArrayList();
mobaLore.add(" ");
mobaLore.add(F.value("HOG Chests Owned", "" + mobaCount));
mobaLore.add(" ");
mobaLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Heroes of GWEN exclusive cosmetics! Each chest contains 4 exclusive items to the game!"}, LineFormat.LORE));
mobaLore.add(" ");
if (mobaCount > 0)
{
mobaLore.add(C.cGreen + "Click to Open!");
}
else
{
mobaLore.add(C.cAqua + "Earn HOG Chests by leveling up Roles with in Heroes of GWEN.");
}
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false);
// Normal chests
@ -501,6 +517,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
ItemStack illuminated = new ShopItem(Material.SEA_LANTERN, C.cDAqua + C.Bold + "Illuminated Treasure", illuminatedLore.toArray(new String[0]), 0, false, false);
ItemStack omega = SkinData.OMEGA_CHEST.getSkull(C.cAquaB + "Omega Treasure", omegaLore);
ItemStack minestrike = new ShopItem(Material.TNT, C.cGoldB + "Minestrike Treasure", minestrikeLore.toArray(new String[0]), 0, false, false);
ItemStack moba = new ShopItem(Material.PRISMARINE, (byte) 2, C.cAquaB + "Heroes of GWEN Treasure", mobaLore.toArray(new String[0]), 0, false, false);
// Seasonal chests
ItemStack christmas = SkinData.PRESENT.getSkull(C.cDGreen + C.Bold + "Winter Holiday Treasure", christmasLore);
@ -525,6 +542,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
TreasurePageItem illuminatedTreasureItem = new TreasurePageItem(illuminated, illuminatedCount, TreasureType.ILLUMINATED);
TreasurePageItem omegaTreasureItem = new TreasurePageItem(omega, omegaCount, TreasureType.OMEGA);
TreasurePageItem minestrikeTreasureItem = new TreasurePageItem(minestrike, minestrikeCount, TreasureType.MINESTRIKE);
TreasurePageItem mobaTreasureItem = new TreasurePageItem(moba, mobaCount, TreasureType.MOBA);
// Seasonal chests
TreasurePageItem winterTreasureItem = new TreasurePageItem(christmas, christmasCount, TreasureType.CHRISTMAS);
@ -543,7 +561,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
_normalTreasures.add(illuminatedTreasureItem);
_normalTreasures.add(omegaTreasureItem);
_normalTreasures.add(minestrikeTreasureItem);
_normalTreasures.add(mobaTreasureItem);
if (availableSpring)
_specialTreasures.add(springItem);

View File

@ -7,6 +7,7 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton.SkeletonType;
import com.mojang.authlib.GameProfile;
@ -14,8 +15,10 @@ import mineplex.core.common.skin.SkinData;
import mineplex.core.disguise.disguises.DisguiseInsentient;
import mineplex.core.disguise.disguises.DisguiseLiving;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.disguise.disguises.DisguiseVillager;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphGadget;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphType;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo;
@ -70,6 +73,11 @@ public class MobaShopNPC implements IPacketHandler
insentient.setName(MobaShop.getNPCName());
insentient.setCustomNameVisible(true);
disguise = insentient;
if (_gadget.getType() == ShopMorphType.WITHER_SKELETON)
{
((DisguiseSkeleton) insentient).SetSkeletonType(SkeletonType.WITHER);
}
}
_shop.getHost().getArcadeManager().GetDisguise().disguise(disguise);