More supply drop fixes, implement new clans items to CUST-1, and fix forum group id assigned to the cmod tag

This commit is contained in:
AlexTheCoder 2017-09-26 05:41:30 -04:00
parent 1cdd6c0316
commit 4c4a3c029e
10 changed files with 161 additions and 27 deletions

View File

@ -50,7 +50,7 @@ public enum PermissionGroup
//SUB-GROUPS
QA("qa", "", "Members of the Quality Assurance team.", ChatColor.WHITE, 50, false),
QAM("qam", "", "Managers of the Quality Assurance team.", ChatColor.WHITE, 50, false, PermissionGroup.QA),
CMOD("cmod", "", "Members of the Clans Management team.", ChatColor.WHITE, 32, false),
CMOD("cmod", "", "Members of the Clans Management team.", ChatColor.WHITE, 46, false),
TM("tm", "", "Members of the Trainee Management team.", ChatColor.WHITE, 52, false),
MC("mc", "", "Members of the Moderator Coordination team.", ChatColor.WHITE, 49, false),
EVENTMOD("eventmod", "", "Members of the Event Management team.", ChatColor.WHITE, -1, false),

View File

@ -135,7 +135,7 @@ public class AmplifierGUI implements Listener
return;
}
if (slot == 3)
if (slot == 12)
{
_manager.runSyncLater(() ->
{
@ -143,7 +143,7 @@ public class AmplifierGUI implements Listener
getViewer().closeInventory();
}, 1L);
}
if (slot == 5)
if (slot == 14)
{
_selected = null;
propagate();

View File

@ -79,6 +79,10 @@ public class CashOverviewPage extends ShopPageBase<CashShopManager, CashShop>
C.cDAqua + "You own " + F.greenElem(String.valueOf(builders)) + C.cDAqua + " Builder's Boxes")),
(player, clickType) ->
{
if (builders < 1)
{
return;
}
player.closeInventory();
BoxType.BUILDER_BOX.onUse(player);
});

View File

@ -14,6 +14,7 @@ import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
@ -53,6 +54,7 @@ public class SupplyDrop
private static final int DROP_TICKS = 20 * 60 * 3; //3 Minutes
private static final int REMOVE_TICKS = DROP_TICKS + (20 * 120); // 2 Minutes
public static final Material SUPPLY_DROP_MATERIAL = Material.BEACON;
public static final String SUPPLY_DROP_FILLED_METADATA = "SUPPLY_DROP_FILLED";
private final SupplyDropType _type;
private final mineplex.game.clans.clans.supplydrop.SupplyDropManager.BlockPosition _position;
@ -126,6 +128,7 @@ public class SupplyDrop
{
inventory.setItem(i++, item);
}
_block.setMetadata(SUPPLY_DROP_FILLED_METADATA, new FixedMetadataValue(UtilServer.getPlugin(), true));
}, 5);
}

View File

@ -44,6 +44,7 @@ import mineplex.game.clans.items.ItemType;
import mineplex.game.clans.items.RareItemFactory;
import mineplex.game.clans.items.attributes.AttributeContainer;
import mineplex.game.clans.items.legendaries.LegendaryItem;
import mineplex.game.clans.items.legendaries.MeridianScepter;
import mineplex.game.clans.items.rares.RunedPickaxe;
public class SupplyDropManager extends MiniPlugin
@ -98,17 +99,17 @@ public class SupplyDropManager extends MiniPlugin
{
return;
}
if (!_active.isActive() || _active.isDropping())
{
return;
}
if (event.getClickedBlock().getType() != Material.CHEST)
{
return;
}
if (new BlockPosition(event.getClickedBlock()).equals(_active.getPosition()))
{
event.setCancelled(true);
if (!_active.isActive() || _active.isDropping())
{
return;
}
if (!event.getClickedBlock().hasMetadata(SupplyDrop.SUPPLY_DROP_FILLED_METADATA))
{
return;
}
if (UtilPlayer.isSpectator(event.getPlayer()) || event.getPlayer().getGameMode() != GameMode.SURVIVAL)
{
return;
@ -243,7 +244,7 @@ public class SupplyDropManager extends MiniPlugin
set.add(25, () ->
{
ItemType type = UtilMath.randomElement(itemTypes);
Material mat = UtilMath.randomElement((type == ItemType.ARMOR) ? armorTypes : weaponTypes);
Material mat = UtilMath.randomElement((type == ItemType.ARMOR) ? armorTypes : (type == ItemType.BOW ? new Material[] {Material.BOW} : weaponTypes));
AttributeContainer container = new AttributeContainer();
gear.generateAttributes(container, type, ThreadLocalRandom.current().nextInt(1, 3));
@ -280,6 +281,8 @@ public class SupplyDropManager extends MiniPlugin
{
GearManager gear = ClansManager.getInstance().getGearManager();
List<Class<? extends LegendaryItem>> legendaryTypes = Lists.newArrayList(gear.getFindableLegendaries());
List<Class<? extends LegendaryItem>> runeableLegendaryTypes = Lists.newArrayList(gear.getFindableLegendaries());
runeableLegendaryTypes.remove(MeridianScepter.class);
ItemType[] rareTypes = {ItemType.RARE, ItemType.LEGENDARY};
ItemType[] itemTypes = {ItemType.ARMOR, ItemType.BOW, ItemType.WEAPON};
Material[] weaponTypes = {Material.IRON_AXE, Material.IRON_SWORD};
@ -299,12 +302,20 @@ public class SupplyDropManager extends MiniPlugin
{
return factory.setRare(RunedPickaxe.class).fabricate();
}
return factory.setLegendary(UtilMath.randomElement(legendaryTypes)).fabricate();
boolean runed = false;
if (ThreadLocalRandom.current().nextDouble() < 0.02)
{
runed = true;
AttributeContainer container = new AttributeContainer();
gear.generateAttributes(container, type, ThreadLocalRandom.current().nextInt(1, 4));
factory.setSuperPrefix(container.getSuperPrefix()).setPrefix(container.getPrefix()).setSuffix(container.getSuffix());
}
return factory.setLegendary(UtilMath.randomElement(runed ? runeableLegendaryTypes : legendaryTypes)).fabricate();
});
set.add(25, () ->
{
ItemType type = UtilMath.randomElement(itemTypes);
Material mat = UtilMath.randomElement((type == ItemType.ARMOR) ? armorTypes : weaponTypes);
Material mat = UtilMath.randomElement((type == ItemType.ARMOR) ? armorTypes : (type == ItemType.BOW ? new Material[] {Material.BOW} : weaponTypes));
AttributeContainer container = new AttributeContainer();
gear.generateAttributes(container, type, ThreadLocalRandom.current().nextInt(1, 4));

View File

@ -4,17 +4,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.WeakHashMap;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.minecraft.game.classcombat.Skill.SkillChargeBow;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
@ -23,6 +12,18 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.SkillChargeBow;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
public class Barrage extends SkillChargeBow
{
private WeakHashMap<Player, Integer> _chargeArrows = new WeakHashMap<Player, Integer>();
@ -73,7 +74,13 @@ public class Barrage extends SkillChargeBow
_chargeArrows.remove(cur);
continue;
}
if (UtilServer.CallEvent(new SkillTriggerEvent(cur, GetName(), GetClassType())).IsCancelled())
{
_chargeArrows.remove(cur);
continue;
}
_chargeArrows.put(cur, arrows-1);
//Fire Arrow

View File

@ -184,6 +184,11 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
int clansDyeBoxesReceived = 0;
int clansBuilderBoxesReceived = 0;
int hogChestReceived = 0;
int clansGildedDyeBoxesReceived = 0;
int supplyDropsReceived = 0;
int gildedSupplyDropsReceived = 0;
int bossTokenWizardReceived = 0;
int bossTokenSkeletonReceived = 0;
for (CoinTransactionToken transaction : donor.getCoinTransactions())
{
@ -428,6 +433,56 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
hogChestReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Gilded Dye Box"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
clansGildedDyeBoxesReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
clansGildedDyeBoxesReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Supply Drop"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
supplyDropsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
supplyDropsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Gilded Supply Drop"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
gildedSupplyDropsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
gildedSupplyDropsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Boss Token Wizard"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
bossTokenWizardReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
bossTokenWizardReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Boss Token Skeleton"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
bossTokenSkeletonReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
bossTokenSkeletonReceived += 1;
}
}
}
StatsManager statsManager = Managers.get(StatsManager.class);
@ -469,6 +524,9 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
caller.sendMessage(C.cBlue + "Clans Dye Boxes Received: " + C.cYellow + clansDyeBoxesReceived + " " + C.cBlue + "Clans Builder Boxes Received: " + C.cYellow + clansBuilderBoxesReceived);
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedPackageStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedPackageStr(client.getUniqueId(), "Clan Banner Editor"));
caller.sendMessage(C.cBlue + "Clans Gilded Dye Boxes Received: " + C.cYellow + clansGildedDyeBoxesReceived);
caller.sendMessage(C.cBlue + "Supply Drops Received: " + C.cYellow + supplyDropsReceived + " " + C.cBlue + "Gilded Supply Drops Received: " + C.cYellow + gildedSupplyDropsReceived);
caller.sendMessage(C.cBlue + "Wizard Summon Tokens Received: " + C.cYellow + bossTokenWizardReceived + " " + C.cBlue + "Skeleton Summon Tokens Received: " + C.cYellow + bossTokenSkeletonReceived);
YearMonth yearMonth = YearMonth.now();
caller.sendMessage(C.cBlue + "Power Play Subscription (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.isSubscribed() ? C.cGreen + "Active" : C.cRed + "Inactive"));
if (powerPlayData.isSubscribed())

View File

@ -21,7 +21,9 @@ import mineplex.staffServer.salespackage.salespackages.AncientChest;
import mineplex.staffServer.salespackage.salespackages.ApplyKits;
import mineplex.staffServer.salespackage.salespackages.ClanBannerEditor;
import mineplex.staffServer.salespackage.salespackages.ClanBannerUsage;
import mineplex.staffServer.salespackage.salespackages.ClansBossToken;
import mineplex.staffServer.salespackage.salespackages.ClansBox;
import mineplex.staffServer.salespackage.salespackages.ClansSupplyDrop;
import mineplex.staffServer.salespackage.salespackages.Coins;
import mineplex.staffServer.salespackage.salespackages.DefaultRank;
import mineplex.staffServer.salespackage.salespackages.FreedomChest;
@ -107,7 +109,12 @@ public class SalesPackageManager extends MiniPlugin
addSalesPackage(new RuneAmplifier(this, 20));
addSalesPackage(new RuneAmplifier(this, 60));
addSalesPackage(new ClansBox(this, "Dye"));
addSalesPackage(new ClansBox(this, "Gilded Dye"));
addSalesPackage(new ClansBox(this, "Builder"));
addSalesPackage(new ClansSupplyDrop(this, false));
addSalesPackage(new ClansSupplyDrop(this, true));
addSalesPackage(new ClansBossToken(this, "Wizard"));
addSalesPackage(new ClansBossToken(this, "Skeleton"));
addSalesPackage(new PowerPlayClub(this, false));
addSalesPackage(new PowerPlayClub(this, true));
addSalesPackage(new OmegaChest(this));
@ -197,7 +204,7 @@ public class SalesPackageManager extends MiniPlugin
{
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else if (salesPackage instanceof ClanBannerEditor || salesPackage instanceof ClanBannerUsage || salesPackage instanceof RuneAmplifier || salesPackage instanceof ClansBox)
else if (salesPackage instanceof ClanBannerEditor || salesPackage instanceof ClanBannerUsage || salesPackage instanceof RuneAmplifier || salesPackage instanceof ClansBox || salesPackage instanceof ClansSupplyDrop || salesPackage instanceof ClansBossToken)
{
clanBuilder = clanBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}

View File

@ -0,0 +1,22 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClansBossToken extends SalesPackageBase
{
private final String _boss;
public ClansBossToken(SalesPackageManager manager, String boss)
{
super(manager, "1 Clans Boss Token " + boss);
_boss = boss;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Clans Boss Token " + _boss, "Give 1 Clans Boss Token " + _boss + ".");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -0,0 +1,22 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClansSupplyDrop extends SalesPackageBase
{
private final boolean _gilded;
public ClansSupplyDrop(SalesPackageManager manager, boolean gilded)
{
super(manager, "1 Clans " + (gilded ? "Gilded " : "") + "Supply Drop");
_gilded = gilded;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Clans " + (_gilded ? "Gilded " : "") + "Supply Drop", "Give 1 Clans " + (_gilded ? "Gilded " : "") + "Supply Drop.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}