Changed kit availability to be based on free/premium.

This commit is contained in:
Chiss 2014-08-01 14:05:53 +10:00
parent 308c2e1b91
commit 599a6eb1f7
4 changed files with 16 additions and 10 deletions

View File

@ -368,6 +368,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return _statsManager;
}
public ServerStatusManager GetServerStatusManager()
{
return _serverStatusManager;
}
public ChatColor GetColor(Player player)
{
if (_game == null)

View File

@ -129,7 +129,7 @@ public abstract class Kit implements Listener
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
entity.setCustomName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Premium" + ChatColor.GRAY + ")" : ""));
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);

View File

@ -977,7 +977,9 @@ public class GameLobbyManager implements IPacketRunnable, Listener
System.out.println("Manager.GetServerConfig() is null");
}
if (client.GetRank().Has(Rank.ULTRA) || donor.OwnsUnknownPackage(game.GetName() + " " + ent.GetKit().GetName()) || donor.OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA") || ent.GetKit().GetAvailability() == KitAvailability.Free)
if (ent.GetKit().GetAvailability() == KitAvailability.Free || //Free
donor.OwnsUnknownPackage(Manager.GetGame().GetName() + " " + ent.GetKit().GetName()) || //Green
Manager.GetServerStatusManager().getCurrentServerName().toLowerCase().contains("free")) //Blue
{
entityName = ent.GetKit().GetAvailability().GetColor() + entityName;
}
@ -986,9 +988,9 @@ public class GameLobbyManager implements IPacketRunnable, Listener
entityName = ChatColor.RED + C.Bold + entityName;
if (ent.GetKit().GetAvailability() != KitAvailability.Blue)
entityName += ChatColor.RESET + " " + ChatColor.WHITE + C.Line + ent.GetKit().GetCost() + " Gems";
entityName += ChatColor.RESET + " (" + C.cGreen + ent.GetKit().GetCost() + " Gems" + ChatColor.RESET + ")";
else
entityName += ChatColor.RESET + " " + ChatColor.WHITE + C.Line + "Ultra";
entityName += ChatColor.RESET + " (" + C.cAqua + "Premium" + ChatColor.RESET + ")";
}
return entityName;

View File

@ -314,11 +314,11 @@ public class GamePlayerManager implements Listener
if (!Manager.GetGame().HasKit(kit))
return;
CoreClient client = Manager.GetClients().Get(player);
Donor donor = Manager.GetDonation().Get(player.getName());
if (kit.GetAvailability() == KitAvailability.Free || client.GetRank().Has(Rank.ULTRA) || donor.OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA") || donor.OwnsUnknownPackage(Manager.GetGame().GetName() + " " + kit.GetName()))
if (kit.GetAvailability() == KitAvailability.Free || //Free
donor.OwnsUnknownPackage(Manager.GetGame().GetName() + " " + kit.GetName()) || //Green
Manager.GetServerStatusManager().getCurrentServerName().toLowerCase().contains("free")) //Blue
{
Manager.GetGame().SetKit(player, kit, true);
}
@ -343,13 +343,12 @@ public class GamePlayerManager implements Listener
if (kit.GetAvailability() == KitAvailability.Blue)
{
UtilPlayer.message(player, F.main("Kit", "This kit requires " + F.elem(C.cAqua + "Ultra") + "."));
UtilPlayer.message(player, F.main("Kit", "Purchase at " + F.elem(C.cYellow + "www.mineplex.com/shop")));
UtilPlayer.message(player, F.main("Kit", "This " + F.elem(C.cAqua + "Premium Kit") + " is only available on " + F.elem(C.cAqua + "Premium Servers") + "."));
UtilPlayer.message(player, F.main("Kit", "Buy " + F.elem(C.cAqua + "Ultra") + " at " + F.elem(C.cGreen + C.Line + "www.mineplex.com/shop") + " to use " + F.elem(C.cAqua + "Premium Kits") + "."));
}
else
{
UtilPlayer.message(player, F.main("Kit", "You do not have enough " + F.elem(C.cGreen + "Gems") + "."));
UtilPlayer.message(player, F.main("Kit", "Purchase more at " + F.elem(C.cYellow + "www.mineplex.com/shop")));
}
}
}