From 3a06b54b7f9ff673d962f4958462c3ee53dbef93 Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 22 Jun 2015 17:10:03 +1000 Subject: [PATCH] Changed notifications to 50% off sale --- .../core/notifier/NotificationManager.java | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java index bc96d60a7..7ebe587f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java @@ -9,6 +9,7 @@ import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; 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.UtilServer; import mineplex.core.updater.UpdateType; @@ -41,9 +42,41 @@ public class NotificationManager extends MiniPlugin if (!_enabled) return; - if (event.getType() != UpdateType.MIN_08) - return; + //if (event.getType() == UpdateType.MIN_08) + // 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()) { Rank rank = _clientManager.Get(player).GetRank();