Merge remote-tracking branch 'origin/Bonus' into Bonus
Conflicts: Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/VoteButton.java
This commit is contained in:
commit
184c592786
@ -16,7 +16,7 @@
|
|||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -11,6 +11,7 @@
|
|||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" filepath="$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" group="Game" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" filepath="$PROJECT_DIR$/Mineplex.Game.Clans/Mineplex.Game.Clans.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" filepath="$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" filepath="$PROJECT_DIR$/Mineplex.Hub/Mineplex.Hub.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" filepath="$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" filepath="$PROJECT_DIR$/Mineplex.MapParser/Mineplex.MapParser.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" group="Bungee" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" group="Game" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" group="Game" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" group="Game" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" filepath="$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" filepath="$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" />
|
||||||
|
@ -2,8 +2,6 @@ package mineplex.core.bonuses;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
|
||||||
public class BonusAmount
|
public class BonusAmount
|
||||||
@ -140,7 +138,6 @@ public class BonusAmount
|
|||||||
|
|
||||||
public void addLore(List<String> lore)
|
public void addLore(List<String> lore)
|
||||||
{
|
{
|
||||||
lore.add(C.cYellow + "Rewards");
|
|
||||||
addLore(lore, getTickets(), 0, "Carl Spin Ticket" + (getTickets() > 1 ? "s" : ""));
|
addLore(lore, getTickets(), 0, "Carl Spin Ticket" + (getTickets() > 1 ? "s" : ""));
|
||||||
addLore(lore, getCoins(), getBonusCoins(), "Coins");
|
addLore(lore, getCoins(), getBonusCoins(), "Coins");
|
||||||
addLore(lore, getGems(), getBonusGems(), "Gems");
|
addLore(lore, getGems(), getBonusGems(), "Gems");
|
||||||
@ -151,7 +148,7 @@ public class BonusAmount
|
|||||||
private void addLore(List<String> lore, int amount, int bonus, String suffix)
|
private void addLore(List<String> lore, int amount, int bonus, String suffix)
|
||||||
{
|
{
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
lore.add(" " + C.cWhite + amount + " " + suffix);
|
lore.add(C.cYellow + "Reward: " + C.cWhite + amount + " " + suffix);
|
||||||
|
|
||||||
// if (bonus > 0)
|
// if (bonus > 0)
|
||||||
// lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + bonus + " " + suffix);
|
// lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + bonus + " " + suffix);
|
||||||
|
@ -4,6 +4,7 @@ import java.sql.Date;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import mineplex.core.MiniClientPlugin;
|
import mineplex.core.MiniClientPlugin;
|
||||||
@ -24,10 +25,9 @@ import mineplex.core.database.DBPool;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.hologram.Hologram;
|
import mineplex.core.hologram.Hologram;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
|
||||||
import mineplex.core.npc.Npc;
|
import mineplex.core.npc.Npc;
|
||||||
import mineplex.core.npc.NpcManager;
|
import mineplex.core.npc.NpcManager;
|
||||||
import mineplex.core.pet.PetManager;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.reward.RewardManager;
|
import mineplex.core.reward.RewardManager;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -45,7 +45,6 @@ import mineplex.core.bonuses.gui.SpinGui;
|
|||||||
import mineplex.core.poll.PollManager;
|
import mineplex.core.poll.PollManager;
|
||||||
import mineplex.serverdata.commands.ServerCommandManager;
|
import mineplex.serverdata.commands.ServerCommandManager;
|
||||||
|
|
||||||
import org.jooq.DSLContext;
|
|
||||||
import org.jooq.SQLDialect;
|
import org.jooq.SQLDialect;
|
||||||
import org.jooq.impl.DSL;
|
import org.jooq.impl.DSL;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -73,6 +72,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
|
|
||||||
private ArrayList<Object> _pendingExplosions = new ArrayList<>();
|
private ArrayList<Object> _pendingExplosions = new ArrayList<>();
|
||||||
private ArrayList<Player> _pendingExplosionsPlayers = new ArrayList<>();
|
private ArrayList<Player> _pendingExplosionsPlayers = new ArrayList<>();
|
||||||
|
private HashMap<String, Boolean> _showCarl = new HashMap<>();
|
||||||
private long _explode;
|
private long _explode;
|
||||||
private boolean _canVote;
|
private boolean _canVote;
|
||||||
|
|
||||||
@ -996,4 +996,36 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
entity.remove();
|
entity.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void Join(final PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
runSyncLater(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
_showCarl.put(event.getPlayer().getName(), true);
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void carlUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.SEC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (Recharge.Instance.use(player, "Carl Inform", 240000, false, false))
|
||||||
|
{
|
||||||
|
if(_pollManager.Get(player).shouldPoll() || canVote(player) || canRank(player) || canDaily(player))
|
||||||
|
{
|
||||||
|
if(_showCarl.containsKey(player.getName()))
|
||||||
|
UtilPlayer.message(player, C.cDGreen + C.Bold + "Carl the Creeper)" + C.cGreen + " Hey " + player.getName().replace("s", "sss") + "! I have sssome amazing rewardsss for you! Come sssee me!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -7,11 +7,7 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
||||||
import mineplex.core.bonuses.gui.SpinGui;
|
|
||||||
import mineplex.core.common.util.Callback;
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.database.DBPool;
|
import mineplex.core.database.DBPool;
|
||||||
import mineplex.core.database.RepositoryBase;
|
import mineplex.core.database.RepositoryBase;
|
||||||
import mineplex.core.database.ResultSetCallable;
|
import mineplex.core.database.ResultSetCallable;
|
||||||
@ -21,9 +17,7 @@ import mineplex.database.Tables;
|
|||||||
import mineplex.database.tables.records.BonusRecord;
|
import mineplex.database.tables.records.BonusRecord;
|
||||||
import org.jooq.DSLContext;
|
import org.jooq.DSLContext;
|
||||||
import org.jooq.Record2;
|
import org.jooq.Record2;
|
||||||
import org.jooq.SQLDialect;
|
|
||||||
import org.jooq.TableField;
|
import org.jooq.TableField;
|
||||||
import org.jooq.impl.DSL;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -101,42 +95,6 @@ public class BonusRepository extends RepositoryBase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attemptAddTickets(final int accountId, final BonusClientData client, final int tickets, final Callback<Boolean> callback)
|
|
||||||
{
|
|
||||||
if (client.getTickets() + tickets < 0)
|
|
||||||
callback.run(false);
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(_manager.getPlugin(), new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DSLContext create = DSL.using(DBPool.ACCOUNT, SQLDialect.MYSQL);
|
|
||||||
create.update(Tables.bonus).set(Tables.bonus.tickets, Tables.bonus.tickets.add(tickets)).
|
|
||||||
where(Tables.bonus.accountId.eq(accountId)).execute();
|
|
||||||
final int newTickets = create.select(Tables.bonus.tickets).from(Tables.bonus).where(Tables.bonus.accountId.eq(accountId)).fetchOne().value1();
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTask(_manager.getPlugin(), new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
client.setTickets(newTickets);
|
|
||||||
callback.run(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
callback.run(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void attemptDailyBonus(final Player player, final Callback<Boolean> result)
|
public void attemptDailyBonus(final Player player, final Callback<Boolean> result)
|
||||||
{
|
{
|
||||||
final int accountId = _manager.getClientManager().Get(player).getAccountId();
|
final int accountId = _manager.getClientManager().Get(player).getAccountId();
|
||||||
|
@ -2,7 +2,6 @@ package mineplex.core.bonuses.commands;
|
|||||||
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.Callback;
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.bonuses.BonusManager;
|
import mineplex.core.bonuses.BonusManager;
|
||||||
@ -37,28 +36,15 @@ public class TicketCommand extends CommandBase<BonusManager>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final int tickets = Integer.parseInt(ticketString);
|
int tickets = Integer.parseInt(ticketString);
|
||||||
int accountId = Plugin.getClientManager().getAccountId(target);
|
Plugin.Get(target).setTickets(Plugin.Get(targetName).getTickets() + tickets);
|
||||||
Plugin.getRepository().attemptAddTickets(accountId, Plugin.Get(target), tickets, new Callback<Boolean>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run(Boolean data)
|
|
||||||
{
|
|
||||||
if (data)
|
|
||||||
{
|
|
||||||
UtilPlayer.message(caller, F.main("Carl", "You gave " + F.elem(tickets + " Carl Tickets") + " to " + F.name(targetName) + "."));
|
|
||||||
|
|
||||||
if (target != null && !target.equals(caller))
|
UtilPlayer.message(caller, F.main("Carl", "You gave " + F.elem(tickets + " Carl Tickets") + " to " + F.name(targetName) + "."));
|
||||||
{
|
|
||||||
UtilPlayer.message(target, F.main("Carl", F.name(caller.getName()) + " gave you " + F.elem(tickets + " Carl Tickets") + "."));
|
if (target != null)
|
||||||
}
|
{
|
||||||
}
|
UtilPlayer.message(target, F.main("Carl", F.name(caller.getName()) + " gave you " + F.elem(tickets + " Carl Tickets") + "."));
|
||||||
else
|
}
|
||||||
{
|
|
||||||
UtilPlayer.message(caller, F.main("Carl", "Failed to give tickets. Try again later!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,9 @@ public class DailyBonusButton implements GuiItem, Listener
|
|||||||
lore.add(" ");
|
lore.add(" ");
|
||||||
|
|
||||||
lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getDailyStreak());
|
lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getDailyStreak());
|
||||||
lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + "+" + _bonusManager.getDailyMultiplier(_player) + "%");
|
lore.add(C.cYellow + "Streak Bonus: " + C.cWhite + _bonusManager.getDailyMultiplier(_player) + "%");
|
||||||
|
lore.add(" ");
|
||||||
|
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxDailyStreak());
|
||||||
|
|
||||||
if (client.getDailyTime() != null)
|
if (client.getDailyTime() != null)
|
||||||
{
|
{
|
||||||
@ -157,8 +159,6 @@ public class DailyBonusButton implements GuiItem, Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lore.add(" ");
|
|
||||||
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxDailyStreak());
|
|
||||||
StreakRecord streakRecord = _bonusManager.getDailyStreak();
|
StreakRecord streakRecord = _bonusManager.getDailyStreak();
|
||||||
if (streakRecord != null)
|
if (streakRecord != null)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,6 @@ public class RewardManager
|
|||||||
private JavaPlugin _plugin;
|
private JavaPlugin _plugin;
|
||||||
private HashMap<RewardRarity, List<Reward>> _treasureMap;
|
private HashMap<RewardRarity, List<Reward>> _treasureMap;
|
||||||
private Random _random;
|
private Random _random;
|
||||||
private boolean _carlSpinner;
|
|
||||||
|
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ public class RewardManager
|
|||||||
int uncommonValueMin, int uncommonValueMax,
|
int uncommonValueMin, int uncommonValueMax,
|
||||||
int rareValueMin, int rareValueMax,
|
int rareValueMin, int rareValueMax,
|
||||||
int legendValueMin, int legendValueMax,
|
int legendValueMin, int legendValueMax,
|
||||||
boolean doubleGadgetValue, boolean carlSpinner)
|
boolean doubleGadgetValue)
|
||||||
{
|
{
|
||||||
_plugin = donationManager.getPlugin();
|
_plugin = donationManager.getPlugin();
|
||||||
_treasureMap = new HashMap<RewardRarity, List<Reward>>();
|
_treasureMap = new HashMap<RewardRarity, List<Reward>>();
|
||||||
@ -57,15 +56,21 @@ public class RewardManager
|
|||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
|
|
||||||
_doubleGadgetValue = doubleGadgetValue;
|
_doubleGadgetValue = doubleGadgetValue;
|
||||||
_carlSpinner = carlSpinner;
|
|
||||||
|
|
||||||
addCommon(donationManager, inventoryManager, petManager, statsManager, commonValueMin, commonValueMax);
|
addGame(donationManager, inventoryManager, petManager, statsManager);
|
||||||
addUncommon(donationManager, inventoryManager, petManager, statsManager, uncommonValueMin, uncommonValueMax);
|
addCommon(donationManager, inventoryManager, petManager, commonValueMin, commonValueMax);
|
||||||
addRare(donationManager, inventoryManager, petManager, statsManager, rareValueMin, rareValueMax);
|
addUncommon(donationManager, inventoryManager, petManager, uncommonValueMin, uncommonValueMax);
|
||||||
addLegendary(donationManager, inventoryManager, petManager, statsManager, legendValueMin, legendValueMax);
|
addRare(donationManager, inventoryManager, petManager, rareValueMin, rareValueMax);
|
||||||
|
addLegendary(donationManager, inventoryManager, petManager, legendValueMin, legendValueMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addCommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue)
|
public void addGame(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager)
|
||||||
|
{
|
||||||
|
addReward(new GemReward(donationManager, 100, 500, 100, RewardRarity.GAME));
|
||||||
|
addReward(new ExperienceReward(statsManager, 100, 5000, 100, RewardRarity.GAME));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, double minValue, double maxValue)
|
||||||
{
|
{
|
||||||
RewardRarity rarity = RewardRarity.COMMON;
|
RewardRarity rarity = RewardRarity.COMMON;
|
||||||
|
|
||||||
@ -107,16 +112,9 @@ public class RewardManager
|
|||||||
addReward(new InventoryReward(inventoryManager, "TNT", "TNT",
|
addReward(new InventoryReward(inventoryManager, "TNT", "TNT",
|
||||||
(int)(20*(minValue/500)), (int)(20*(maxValue/500)),
|
(int)(20*(minValue/500)), (int)(20*(maxValue/500)),
|
||||||
new ItemStack(Material.TNT), rarity, 10));
|
new ItemStack(Material.TNT), rarity, 10));
|
||||||
|
|
||||||
if (_carlSpinner)
|
|
||||||
{
|
|
||||||
addReward(new GemReward(donationManager, 0, 0, 25, rarity));
|
|
||||||
addReward(new CoinReward(donationManager, 0, 0, 25, rarity));
|
|
||||||
addReward(new ExperienceReward(statsManager, 0, 0, 25, rarity));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addUncommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue)
|
public void addUncommon(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, double minValue, double maxValue)
|
||||||
{
|
{
|
||||||
RewardRarity rarity = RewardRarity.UNCOMMON;
|
RewardRarity rarity = RewardRarity.UNCOMMON;
|
||||||
|
|
||||||
@ -200,16 +198,9 @@ public class RewardManager
|
|||||||
// new ItemStack(2266), rarity, 25));
|
// new ItemStack(2266), rarity, 25));
|
||||||
addReward(new UnknownPackageReward(donationManager, "Wait Disc", "Wait Disc",
|
addReward(new UnknownPackageReward(donationManager, "Wait Disc", "Wait Disc",
|
||||||
new ItemStack(2267), rarity, 25));
|
new ItemStack(2267), rarity, 25));
|
||||||
|
|
||||||
if (_carlSpinner)
|
|
||||||
{
|
|
||||||
addReward(new GemReward(donationManager, 0, 0, 1300, rarity));
|
|
||||||
addReward(new CoinReward(donationManager, 0, 0, 1300, rarity));
|
|
||||||
addReward(new ExperienceReward(statsManager, 0, 0, 1300, rarity));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRare(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue)
|
public void addRare(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, double minValue, double maxValue)
|
||||||
{
|
{
|
||||||
RewardRarity rarity = RewardRarity.RARE;
|
RewardRarity rarity = RewardRarity.RARE;
|
||||||
|
|
||||||
@ -259,20 +250,14 @@ public class RewardManager
|
|||||||
addReward(new UnknownPackageReward(donationManager, "Space Boots", "Space Boots",
|
addReward(new UnknownPackageReward(donationManager, "Space Boots", "Space Boots",
|
||||||
new ItemStack(Material.GOLD_BOOTS), rarity, 50));
|
new ItemStack(Material.GOLD_BOOTS), rarity, 50));
|
||||||
|
|
||||||
if (_carlSpinner)
|
|
||||||
{
|
|
||||||
addReward(new GemReward(donationManager, 0, 0, 390, rarity));
|
|
||||||
addReward(new CoinReward(donationManager, 0, 0, 390, rarity));
|
|
||||||
addReward(new ExperienceReward(statsManager, 0, 0, 390, rarity));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLegendary(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, StatsManager statsManager, double minValue, double maxValue)
|
public void addLegendary(DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, double minValue, double maxValue)
|
||||||
{
|
{
|
||||||
RewardRarity rarity = RewardRarity.LEGENDARY;
|
RewardRarity rarity = RewardRarity.LEGENDARY;
|
||||||
|
|
||||||
// Coins
|
// Coins
|
||||||
addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 25, rarity));
|
addReward(new CoinReward(donationManager, (int)minValue, (int)maxValue, 25, RewardRarity.LEGENDARY));
|
||||||
|
|
||||||
// Mounts
|
// Mounts
|
||||||
addReward(new UnknownPackageReward(donationManager, "Infernal Horror", "Infernal Horror",
|
addReward(new UnknownPackageReward(donationManager, "Infernal Horror", "Infernal Horror",
|
||||||
@ -301,13 +286,6 @@ public class RewardManager
|
|||||||
new ItemStack(Material.APPLE), rarity, 4));
|
new ItemStack(Material.APPLE), rarity, 4));
|
||||||
addReward(new UnknownPackageReward(donationManager, "Heart Particles", "I Heart You",
|
addReward(new UnknownPackageReward(donationManager, "Heart Particles", "I Heart You",
|
||||||
new ItemStack(Material.BLAZE_POWDER), rarity, 2));
|
new ItemStack(Material.BLAZE_POWDER), rarity, 2));
|
||||||
|
|
||||||
if (_carlSpinner)
|
|
||||||
{
|
|
||||||
addReward(new GemReward(donationManager, 0, 0, 70, rarity));
|
|
||||||
addReward(new CoinReward(donationManager, 0, 0, 70, rarity));
|
|
||||||
addReward(new ExperienceReward(statsManager, 0, 0, 70, rarity));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addReward(Reward reward)
|
public void addReward(Reward reward)
|
||||||
|
@ -20,7 +20,7 @@ public enum RewardRarity
|
|||||||
|
|
||||||
OTHER("Other", cWhite, Material.STAINED_GLASS_PANE, (byte) 0),
|
OTHER("Other", cWhite, Material.STAINED_GLASS_PANE, (byte) 0),
|
||||||
COMMON("Common", cWhite, Material.STAINED_GLASS_PANE, (byte) 0),
|
COMMON("Common", cWhite, Material.STAINED_GLASS_PANE, (byte) 0),
|
||||||
// CARL_EXTRA("Game", cYellow, Material.STAINED_GLASS_PANE, (byte) 4),
|
GAME("Game", cYellow, Material.STAINED_GLASS_PANE, (byte) 4),
|
||||||
UNCOMMON("Uncommon", cAqua, Material.STAINED_GLASS_PANE, (byte) 3),
|
UNCOMMON("Uncommon", cAqua, Material.STAINED_GLASS_PANE, (byte) 3),
|
||||||
RARE("Rare", cPurple, Material.STAINED_GLASS_PANE, (byte) 10),
|
RARE("Rare", cPurple, Material.STAINED_GLASS_PANE, (byte) 10),
|
||||||
LEGENDARY("Legendary", cGreen, Material.STAINED_GLASS_PANE, (byte) 5),
|
LEGENDARY("Legendary", cGreen, Material.STAINED_GLASS_PANE, (byte) 5),
|
||||||
|
@ -3,7 +3,7 @@ package mineplex.core.reward;
|
|||||||
public enum RewardType
|
public enum RewardType
|
||||||
{
|
{
|
||||||
//% Chances Mythic Legend Rare Uncommon
|
//% Chances Mythic Legend Rare Uncommon
|
||||||
GameLoot( 0.000001, 0.00001, 0.0001, 3, 0),
|
GameLoot( 0.000001, 0.00001, 0.0001, 3, 10),
|
||||||
|
|
||||||
OldChest( 0, 0.05, 0.4, 5, 0),
|
OldChest( 0, 0.05, 0.4, 5, 0),
|
||||||
AncientChest( 0, 1, 4, 25, 0),
|
AncientChest( 0, 1, 4, 25, 0),
|
||||||
@ -37,7 +37,7 @@ public enum RewardType
|
|||||||
else if (rand <= _legendaryChance) rarity = RewardRarity.LEGENDARY;
|
else if (rand <= _legendaryChance) rarity = RewardRarity.LEGENDARY;
|
||||||
else if (rand <= _rareChance) rarity = RewardRarity.RARE;
|
else if (rand <= _rareChance) rarity = RewardRarity.RARE;
|
||||||
else if (rand <= _uncommonChance || requiresUncommon) rarity = RewardRarity.UNCOMMON;
|
else if (rand <= _uncommonChance || requiresUncommon) rarity = RewardRarity.UNCOMMON;
|
||||||
// else if (rand <= _gameChance) rarity = RewardRarity.CARL_EXTRA;
|
else if (rand <= _gameChance) rarity = RewardRarity.GAME;
|
||||||
|
|
||||||
return rarity;
|
return rarity;
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,13 @@ public class ExperienceReward extends Reward
|
|||||||
|
|
||||||
_statsManager.incrementStat(player, "Global.ExpEarned", experience);
|
_statsManager.incrementStat(player, "Global.ExpEarned", experience);
|
||||||
|
|
||||||
return new RewardData(getRarity().getColor() + experience + " Experience", new ItemStack(Material.EXP_BOTTLE), getRarity());
|
return new RewardData(getRarity().getColor() + experience + " Experience", new ItemStack(Material.EXP_BOTTLE), RewardRarity.GAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RewardData getFakeRewardData(Player player)
|
public RewardData getFakeRewardData(Player player)
|
||||||
{
|
{
|
||||||
return new RewardData(getRarity().getColor() + "Experience", new ItemStack(Material.EXP_BOTTLE), getRarity());
|
return new RewardData(getRarity().getColor() + "Experience", new ItemStack(Material.EXP_BOTTLE), RewardRarity.GAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,7 +20,6 @@ import mineplex.core.pet.PetManager;
|
|||||||
import mineplex.core.reward.Reward;
|
import mineplex.core.reward.Reward;
|
||||||
import mineplex.core.reward.RewardManager;
|
import mineplex.core.reward.RewardManager;
|
||||||
import mineplex.core.reward.RewardType;
|
import mineplex.core.reward.RewardType;
|
||||||
import mineplex.core.stats.StatsManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Shaun on 8/27/2014.
|
* Created by Shaun on 8/27/2014.
|
||||||
@ -33,19 +32,14 @@ public class TreasureManager extends MiniPlugin
|
|||||||
private HologramManager _hologramManager;
|
private HologramManager _hologramManager;
|
||||||
private List<TreasureLocation> _treasureLocations;
|
private List<TreasureLocation> _treasureLocations;
|
||||||
|
|
||||||
public TreasureManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, BlockRestore blockRestore, HologramManager hologramManager, StatsManager statsManager)
|
public TreasureManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, PetManager petManager, BlockRestore blockRestore, HologramManager hologramManager, RewardManager rewardManager)
|
||||||
{
|
{
|
||||||
super("Treasure", plugin);
|
super("Treasure", plugin);
|
||||||
|
|
||||||
_inventoryManager = inventoryManager;
|
_inventoryManager = inventoryManager;
|
||||||
_blockRestore = blockRestore;
|
_blockRestore = blockRestore;
|
||||||
_hologramManager = hologramManager;
|
_hologramManager = hologramManager;
|
||||||
_rewardManager = new RewardManager(clientManager, donationManager, _inventoryManager, petManager, statsManager,
|
_rewardManager = rewardManager;
|
||||||
100, 250,
|
|
||||||
500, 1000,
|
|
||||||
4000, 6000,
|
|
||||||
12000, 32000,
|
|
||||||
true, false);;
|
|
||||||
|
|
||||||
World world = Bukkit.getWorlds().get(0);
|
World world = Bukkit.getWorlds().get(0);
|
||||||
|
|
||||||
|
@ -190,7 +190,14 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
new BenefitManager(plugin, clientManager, _inventoryManager);
|
new BenefitManager(plugin, clientManager, _inventoryManager);
|
||||||
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager);
|
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager);
|
||||||
|
|
||||||
_treasureManager = new TreasureManager(_plugin, clientManager, donationManager, _inventoryManager, petManager, _blockRestore, hologramManager, statsManager);
|
RewardManager rewardManager = new RewardManager(clientManager, donationManager, _inventoryManager, petManager, statsManager,
|
||||||
|
100, 250,
|
||||||
|
500, 1000,
|
||||||
|
4000, 6000,
|
||||||
|
12000, 32000,
|
||||||
|
true);
|
||||||
|
|
||||||
|
_treasureManager = new TreasureManager(_plugin, clientManager, donationManager, _inventoryManager, petManager, _blockRestore, hologramManager, rewardManager);
|
||||||
new CosmeticManager(_plugin, clientManager, donationManager, _inventoryManager, _gadgetManager, _mountManager, petManager, _treasureManager);
|
new CosmeticManager(_plugin, clientManager, donationManager, _inventoryManager, _gadgetManager, _mountManager, petManager, _treasureManager);
|
||||||
|
|
||||||
new SoccerManager(this, _gadgetManager);
|
new SoccerManager(this, _gadgetManager);
|
||||||
@ -215,7 +222,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true;
|
((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true;
|
||||||
|
|
||||||
|
|
||||||
new BonusManager(plugin, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager);
|
new BonusManager(plugin, clientManager, donationManager, pollManager , npcManager, hologramManager, rewardManager, statsManager);
|
||||||
|
|
||||||
|
|
||||||
// NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager);
|
// NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager);
|
||||||
|
@ -55,7 +55,7 @@ public class GameLootManager implements Listener
|
|||||||
500, 1000,
|
500, 1000,
|
||||||
1500, 2500,
|
1500, 2500,
|
||||||
6000, 12000,
|
6000, 12000,
|
||||||
false, false);
|
false);
|
||||||
|
|
||||||
//Chest
|
//Chest
|
||||||
_rewardManager.addReward(new InventoryReward(Manager.getInventoryManager(), "Old Chest", "Old Chest", 1, 1,
|
_rewardManager.addReward(new InventoryReward(Manager.getInventoryManager(), "Old Chest", "Old Chest", 1, 1,
|
||||||
|
@ -3,7 +3,6 @@ package nautilus.game.arcade.managers;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import mineplex.core.bonuses.event.CarlSpinnerEvent;
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilFirework;
|
import mineplex.core.common.util.UtilFirework;
|
||||||
@ -132,16 +131,6 @@ public class GameManager implements Listener
|
|||||||
UtilTime.MakeStr(Math.max(0, game.PrepareTime - (System.currentTimeMillis() - game.GetStateTime()))), player);
|
UtilTime.MakeStr(Math.max(0, game.PrepareTime - (System.currentTimeMillis() - game.GetStateTime()))), player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void cancelCarlSpinner(CarlSpinnerEvent event)
|
|
||||||
{
|
|
||||||
Game game = Manager.GetGame();
|
|
||||||
if (game == null) return;
|
|
||||||
|
|
||||||
if (game.GetCountdown() <= 0)
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void StateUpdate(UpdateEvent event)
|
public void StateUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user