|
|
|
@ -5,7 +5,6 @@ import java.util.EnumMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
|
|
import org.bukkit.Material;
|
|
|
|
|
import org.bukkit.entity.EntityType;
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
@ -13,13 +12,94 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
|
|
|
|
|
import mineplex.core.account.CoreClientManager;
|
|
|
|
|
import mineplex.core.common.Rank;
|
|
|
|
|
import mineplex.core.common.skin.SkinData;
|
|
|
|
|
import mineplex.core.donation.DonationManager;
|
|
|
|
|
import mineplex.core.gadget.GadgetManager;
|
|
|
|
|
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.ArrowTrailFrostLord;
|
|
|
|
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
|
|
|
|
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
|
|
|
|
|
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathBlood;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathEmerald;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathEnchant;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathMusic;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathShadow;
|
|
|
|
|
import mineplex.core.gadget.gadgets.death.DeathStorm;
|
|
|
|
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood;
|
|
|
|
|
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.DoubleJumpMusic;
|
|
|
|
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
|
|
|
|
|
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
|
|
|
|
|
import mineplex.core.gadget.gadgets.item.ItemBatGun;
|
|
|
|
|
import mineplex.core.gadget.gadgets.item.ItemCoal;
|
|
|
|
|
import mineplex.core.gadget.gadgets.item.ItemCoinBomb;
|
|
|
|
|
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.ItemMelonLauncher;
|
|
|
|
|
import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
|
|
|
|
|
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
|
|
|
|
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.MorphVillager;
|
|
|
|
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots;
|
|
|
|
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate;
|
|
|
|
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitHelmet;
|
|
|
|
|
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitLeggings;
|
|
|
|
|
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.ParticleBlood;
|
|
|
|
|
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.ParticleHeart;
|
|
|
|
|
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
|
|
|
|
|
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.ParticleWingsPixie;
|
|
|
|
|
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
|
|
|
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
|
|
|
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectFireworks;
|
|
|
|
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
|
|
|
|
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.WinEffectSnowTrails;
|
|
|
|
|
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.MountCart;
|
|
|
|
|
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.pet.Pet;
|
|
|
|
|
import mineplex.core.pet.PetManager;
|
|
|
|
|
import mineplex.core.reward.rewards.ExperienceReward;
|
|
|
|
|
import mineplex.core.reward.rewards.GemReward;
|
|
|
|
|
import mineplex.core.reward.RewardPool.Type;
|
|
|
|
|
import mineplex.core.reward.rewards.InventoryReward;
|
|
|
|
|
import mineplex.core.reward.rewards.PetReward;
|
|
|
|
|
import mineplex.core.reward.rewards.RankReward;
|
|
|
|
@ -38,9 +118,17 @@ public class RewardManager
|
|
|
|
|
private CoreClientManager _clientManager;
|
|
|
|
|
private DonationManager _donationManager;
|
|
|
|
|
private ServerStatusManager _statusManager;
|
|
|
|
|
private InventoryManager _iInventoryManager;
|
|
|
|
|
private GadgetManager _gadgetManager;
|
|
|
|
|
private PetManager _petManager;
|
|
|
|
|
|
|
|
|
|
private boolean _doubleGadgetValue;
|
|
|
|
|
|
|
|
|
|
private int _commonAmmoMin, _commonAmmoMax,
|
|
|
|
|
_uncommonAmmoMin, _uncommonAmmoMax,
|
|
|
|
|
_rareAmmoMin, _rareAmmoMax,
|
|
|
|
|
_legendAmmoMin, _legendAmmoMax;
|
|
|
|
|
|
|
|
|
|
private int _uncommonShards = 100;
|
|
|
|
|
private int _rareShards = 500;
|
|
|
|
|
private int _legendaryShards = 5000;
|
|
|
|
@ -57,6 +145,17 @@ public class RewardManager
|
|
|
|
|
_rewardPools = new EnumMap<RewardPool.Type, RewardPool>(RewardPool.Type.class);
|
|
|
|
|
_random = new Random();
|
|
|
|
|
|
|
|
|
|
int mult = _doubleGadgetValue? 2 : 1;
|
|
|
|
|
|
|
|
|
|
_commonAmmoMin = commonValueMin * mult;
|
|
|
|
|
_commonAmmoMax = commonValueMax * mult;
|
|
|
|
|
_uncommonAmmoMin = uncommonValueMin * mult;
|
|
|
|
|
_uncommonAmmoMax = uncommonValueMax * mult;
|
|
|
|
|
_rareAmmoMin = rareValueMin * mult;
|
|
|
|
|
_rareAmmoMax = rareValueMax * mult;
|
|
|
|
|
_legendAmmoMin = legendValueMin * mult;
|
|
|
|
|
_legendAmmoMax = legendValueMax * mult;
|
|
|
|
|
|
|
|
|
|
for (RewardPool.Type type : RewardPool.Type.values())
|
|
|
|
|
{
|
|
|
|
|
_rewardPools.put(type, new RewardPool());
|
|
|
|
@ -65,16 +164,20 @@ public class RewardManager
|
|
|
|
|
_clientManager = clientManager;
|
|
|
|
|
_statusManager = statusManager;
|
|
|
|
|
_donationManager = donationManager;
|
|
|
|
|
_petManager = petManager;
|
|
|
|
|
|
|
|
|
|
_doubleGadgetValue = doubleGadgetValue;
|
|
|
|
|
_carlSpinner = carlSpinner;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
@ -455,18 +558,250 @@ public class RewardManager
|
|
|
|
|
addReward(new UnknownPackageReward(donationManager, "Particles", "Heart", "I Heart You",
|
|
|
|
|
new ItemStack(Material.BLAZE_POWDER), rarity, 2, _legendaryShards));
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward getUnknownPackageReward(Gadget gadget, RewardRarity rarity, int weight)
|
|
|
|
|
public void addCommon()
|
|
|
|
|
{
|
|
|
|
|
return getUnknownPackageReward(gadget, rarity, weight, getShards(rarity));
|
|
|
|
|
RewardRarity rarity = RewardRarity.COMMON;
|
|
|
|
|
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemEtherealPearl.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemFirework.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemTNT.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemMelonLauncher.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemFleshHook.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemPaintballGun.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemBatGun.class), rarity, 10, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemCoinBomb.class), rarity, 10, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addInventoryReward(Type.WINTER_HOLIDAY, getGadget(ItemCoal.class), rarity, 10);
|
|
|
|
|
addInventoryReward(Type.WINTER_HOLIDAY, getGadget(ItemPartyPopper.class), rarity, 10);
|
|
|
|
|
addInventoryReward(Type.WINTER_HOLIDAY, getGadget(ItemFreezeCannon.class), rarity, 10);
|
|
|
|
|
addInventoryReward(Type.WINTER_HOLIDAY, getGadget(ItemTNT.class), rarity, 10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward getUnknownPackageReward(Gadget gadget, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
public void addUncommon()
|
|
|
|
|
{
|
|
|
|
|
return new UnknownPackageReward(_donationManager, gadget.getGadgetType().getCategoryType(), gadget.GetDisplayName(),
|
|
|
|
|
RewardRarity rarity = RewardRarity.UNCOMMON;
|
|
|
|
|
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemEtherealPearl.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemFirework.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemTNT.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemMelonLauncher.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemFleshHook.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemPaintballGun.class), rarity, 250, 0);
|
|
|
|
|
addInventoryReward(Type.NORMAL, getGadget(ItemBatGun.class), rarity, 250, 0);
|
|
|
|
|
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.PIG, rarity, 200);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.SHEEP, rarity, 333);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.COW, rarity, 500);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.CHICKEN, rarity, 143);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.WOLF, rarity, 125);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.MUSHROOM_COW, rarity, 200);
|
|
|
|
|
addPetReward(Type.NORMAL, EntityType.OCELOT, rarity, 167);
|
|
|
|
|
|
|
|
|
|
addMusicReward(Type.NORMAL, "Cat Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Blocks Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Chirp Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Far Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Mall Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Mellohi Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Stal Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Strad Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Ward Disk", rarity, 25);
|
|
|
|
|
addMusicReward(Type.NORMAL, "Wait Disk", rarity, 25);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addRare()
|
|
|
|
|
{
|
|
|
|
|
RewardRarity rarity = RewardRarity.RARE;
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphVillager.class), rarity, 83);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphCow.class), rarity, 167);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphChicken.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphEnderman.class), rarity, 33);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addMount(Type.NORMAL, getMount(MountFrost.class), rarity, 50);
|
|
|
|
|
addMount(Type.NORMAL, getMount(MountSlime.class), rarity, 67);
|
|
|
|
|
addMount(Type.NORMAL, getMount(MountCart.class), rarity, 100);
|
|
|
|
|
addMount(Type.NORMAL, getMount(MountMule.class), rarity, 200);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitRaveSuitHelmet.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitRaveSuitChestplate.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitRaveSuitLeggings.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitRaveSuitBoots.class), rarity, 30);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitSpaceSuitHelmet.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitSpaceSuitChestplate.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitSpaceSuitLeggings.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(OutfitSpaceSuitBoots.class), rarity, 50);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailConfetti.class), rarity, 27);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailBlood.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailEmerald.class), rarity, 25);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailShadow.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailMusic.class), rarity, 27);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailStorm.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailShadow.class), rarity, 15);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpFirecracker.class), rarity, 33);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpEmerald.class), rarity, 25);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpShadow.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpStorm.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpBlood.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpMusic.class), rarity, 20);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathPinataBurst.class), rarity, 27);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathEmerald.class), rarity, 25);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathShadow.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathStorm.class), rarity, 30);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathBlood.class), rarity, 50);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathMusic.class), rarity, 20);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectFireworks.class), rarity, 100);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectFlames.class), rarity, 100);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectSnowTrails.class), rarity, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addLegendary()
|
|
|
|
|
{
|
|
|
|
|
RewardRarity rarity = RewardRarity.LEGENDARY;
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ArrowTrailEnchant.class), rarity, 10);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DeathEnchant.class), rarity, 10);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(DoubleJumpEnchant.class), rarity, 10);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphSlime.class), rarity, 10);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphBat.class), rarity, 25);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(MorphBlock.class), rarity, 20);
|
|
|
|
|
|
|
|
|
|
addMount(Type.NORMAL, getMount(MountUndead.class), rarity, 33);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleWingsAngel.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleBlood.class), rarity, 10);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleWingsDemons.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleEnchant.class), rarity, 25);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleFairy.class), rarity, 4);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleFireRings.class), rarity, 17);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleEmerald.class), rarity, 8);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleHeart.class), rarity, 2);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleWingsInfernal.class), rarity, 4);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleMusic.class), rarity, 15);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleWingsPixie.class), rarity, 4);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleRain.class), rarity, 13);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleFoot.class), rarity, 33);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(ParticleYinYang.class), rarity, 20);
|
|
|
|
|
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectBabyChicken.class), rarity, 10);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectLavaTrap.class), rarity, 20);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectLightningStrike.class), rarity, 20);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectMrPunchMan.class), rarity, 33);
|
|
|
|
|
addGadget(Type.NORMAL, getGadget(WinEffectRiseOfTheElderGuardian.class), rarity, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addMount(Type type, Mount mount, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
return addMount(type, mount, rarity, weight, getShards(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addMount(Type type, Mount mount, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
{
|
|
|
|
|
UnknownPackageReward reward = new UnknownPackageReward(_donationManager, "Mount", mount.GetDisplayName(), mount.GetName(),
|
|
|
|
|
new ItemStack(mount.GetDisplayMaterial(), 1, (short) 0, (byte) mount.GetDisplayData()), rarity, weight, shards);
|
|
|
|
|
addReward(type, reward);
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addMusicReward(Type type, String musicDisk, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
return addMusicReward(type, musicDisk, rarity, weight, getShards(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addMusicReward(Type type, String musicDisk, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
{
|
|
|
|
|
for(Gadget gadget : _gadgetManager.getGadgets(GadgetType.MusicDisc))
|
|
|
|
|
{
|
|
|
|
|
if(gadget.GetName().equals(musicDisk) || gadget.GetName().equals(musicDisk + " Disk"))
|
|
|
|
|
{
|
|
|
|
|
return addGadget(type, gadget, rarity, weight, shards);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addHatReward(RewardPool.Type type, HatGadget gadget, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
UnknownPackageReward reward =
|
|
|
|
|
new UnknownPackageReward(_donationManager, gadget.getGadgetType().getCategoryType(), gadget.GetDisplayName(),
|
|
|
|
|
gadget.GetName(), gadget.getHelmetItem(), rarity, weight, getShards(rarity));
|
|
|
|
|
addReward(type, reward);
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addGadget(RewardPool.Type type, Gadget gadget, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
return addGadget(type, gadget, rarity, weight, getShards(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UnknownPackageReward addGadget(RewardPool.Type type, Gadget gadget, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
{
|
|
|
|
|
UnknownPackageReward reward =
|
|
|
|
|
new UnknownPackageReward(_donationManager, gadget.getGadgetType().getCategoryType(), gadget.GetDisplayName(),
|
|
|
|
|
gadget.GetName(), new ItemStack(gadget.GetDisplayMaterial(), 1, (short) 0, gadget.GetDisplayData()), rarity,
|
|
|
|
|
weight,
|
|
|
|
|
shards);
|
|
|
|
|
weight, shards);
|
|
|
|
|
addReward(type, reward);
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InventoryReward addInventoryReward(RewardPool.Type type, ItemGadget gadget, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
return addInventoryReward(type, gadget, rarity, weight, getShards(rarity), getAmmoMin(rarity), getAmmoMax(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InventoryReward addInventoryReward(RewardPool.Type type, ItemGadget gadget, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
{
|
|
|
|
|
return addInventoryReward(type, gadget, rarity, weight, shards, getAmmoMin(rarity), getAmmoMax(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InventoryReward addInventoryReward(RewardPool.Type type, ItemGadget gadget, RewardRarity rarity, int weight, int shards,
|
|
|
|
|
int minAmmo, int maxAmmo)
|
|
|
|
|
{
|
|
|
|
|
InventoryReward reward = new InventoryReward(_iInventoryManager, gadget.GetDisplayName(),
|
|
|
|
|
gadget.GetName(), minAmmo, maxAmmo,
|
|
|
|
|
new ItemStack(gadget.GetDisplayMaterial(), 1, (short) 0, gadget.GetDisplayData()), rarity, weight, shards);
|
|
|
|
|
addReward(type, reward);
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PetReward addPetReward(Type type, EntityType entityType, RewardRarity rarity, int weight)
|
|
|
|
|
{
|
|
|
|
|
return addPetReward(type, entityType, rarity, weight, getShards(rarity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PetReward addPetReward(Type type, EntityType entityType, RewardRarity rarity, int weight, int shards)
|
|
|
|
|
{
|
|
|
|
|
Pet pet = _petManager.GetFactory().getPet(entityType);
|
|
|
|
|
PetReward reward = new PetReward(_petManager, _iInventoryManager, _donationManager,
|
|
|
|
|
pet.GetName() + " Pet", pet.GetName(), entityType, rarity, weight, shards);
|
|
|
|
|
addReward(type, reward);
|
|
|
|
|
return reward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public <T extends Mount<?>> T getMount(Class<T> mount)
|
|
|
|
|
{
|
|
|
|
|
for(Mount<?> m : _gadgetManager.getMountManager().getMounts())
|
|
|
|
|
{
|
|
|
|
|
if(m.getClass().equals(mount)) return (T) m;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private <T extends Gadget> T getGadget(Class<T> gadget)
|
|
|
|
|
{
|
|
|
|
|
return _gadgetManager.getGadget(gadget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getShards(RewardRarity rarity)
|
|
|
|
@ -484,6 +819,38 @@ public class RewardManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getAmmoMin(RewardRarity rarity)
|
|
|
|
|
{
|
|
|
|
|
switch (rarity)
|
|
|
|
|
{
|
|
|
|
|
case LEGENDARY:
|
|
|
|
|
return _legendAmmoMin;
|
|
|
|
|
case RARE:
|
|
|
|
|
return _rareAmmoMin;
|
|
|
|
|
case UNCOMMON:
|
|
|
|
|
return _uncommonAmmoMin;
|
|
|
|
|
case COMMON:
|
|
|
|
|
default:
|
|
|
|
|
return _commonAmmoMin;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getAmmoMax(RewardRarity rarity)
|
|
|
|
|
{
|
|
|
|
|
switch (rarity)
|
|
|
|
|
{
|
|
|
|
|
case LEGENDARY:
|
|
|
|
|
return _legendAmmoMax;
|
|
|
|
|
case RARE:
|
|
|
|
|
return _rareAmmoMax;
|
|
|
|
|
case UNCOMMON:
|
|
|
|
|
return _uncommonAmmoMax;
|
|
|
|
|
case COMMON:
|
|
|
|
|
default:
|
|
|
|
|
return _commonAmmoMax;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addReward(Reward reward)
|
|
|
|
|
{
|
|
|
|
|
addReward(RewardPool.Type.NORMAL, reward);
|
|
|
|
|