Changed notifications to 50% off sale

This commit is contained in:
Cheese 2015-06-22 17:10:03 +10:00
parent 648355ac17
commit 3a06b54b7f

View File

@ -9,6 +9,7 @@ import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -41,9 +42,41 @@ public class NotificationManager extends MiniPlugin
if (!_enabled) if (!_enabled)
return; return;
if (event.getType() != UpdateType.MIN_08) //if (event.getType() == UpdateType.MIN_08)
return; // hugeSale();
if (event.getType() == UpdateType.MIN_16)
sale();
}
private void sale()
{
for (Player player : UtilServer.getPlayers())
{
Rank rank = _clientManager.Get(player).GetRank();
if (rank.Has(Rank.LEGEND))
continue;
if (rank == Rank.ALL)
{
UtilPlayer.message(player, C.cWhite + "Summer Sale! " + player.getName() + " Purchase " + C.cAqua + C.Bold + "Ultra RANK" + C.cWhite + " for $15");
}
else if (rank == Rank.ULTRA)
{
UtilPlayer.message(player, C.cWhite + "Summer Sale! " + player.getName() + " Upgrade to " + C.cPurple + C.Bold + "HERO RANK" + C.cWhite + " for $15!");
}
else if (rank == Rank.HERO)
{
UtilPlayer.message(player, C.cWhite + "Summer Sale! " + player.getName() + " Upgrade to " + C.cGreen + C.Bold + "LEGEND RANK" + C.cWhite + " for $15!");
}
UtilPlayer.message(player, C.cWhite + " Visit " + F.link("www.mineplex.com/shop") + " for 50% Off Ranks!");
}
}
private void hugeSale()
{
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
{ {
Rank rank = _clientManager.Get(player).GetRank(); Rank rank = _clientManager.Get(player).GetRank();