From d36363701596dab2f23004ebe4bb485516851c75 Mon Sep 17 00:00:00 2001 From: CoderTim Date: Wed, 12 Nov 2014 20:56:57 -0500 Subject: [PATCH 1/7] Achievement bug fixes --- .../games/champions/ChampionsDominate.java | 2 +- .../game/games/champions/ChampionsTDM.java | 2 +- .../game/games/minestrike/MineStrike.java | 4 +- .../arcade/stats/KillReasonStatTracker.java | 50 ++++++++++++++++++- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index d1520a970..59f2f34d4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -67,7 +67,7 @@ public class ChampionsDominate extends Domination this.DisableKillCommand = false; registerStatTrackers( - new KillReasonStatTracker(this, "Backstab", "Assassination"), + new KillReasonStatTracker(this, "Backstab", "Assassination", false), new ElectrocutionStatTracker(this), new TheLongestShotStatTracker(this), new SeismicSlamStatTracker(this) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index be9446396..9af73ce5c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -67,7 +67,7 @@ public class ChampionsTDM extends TeamDeathmatch registerStatTrackers( new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"), new KillAllOpposingStatTracker(this), - new KillReasonStatTracker(this, "Backstab", "Assassination"), + new KillReasonStatTracker(this, "Backstab", "Assassination", false), new ElectrocutionStatTracker(this), new TheLongestShotStatTracker(this), new SeismicSlamStatTracker(this) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java index 1066109db..755d91281 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java @@ -284,10 +284,10 @@ public class MineStrike extends TeamGame }; registerStatTrackers( - new KillReasonStatTracker(this, "Headshot", "BoomHeadshot"), + new KillReasonStatTracker(this, "Headshot", "BoomHeadshot", true), new KillAllOpposingMineStrikeRoundStatTracker(this), new KaboomStatTracker(this), - new KillReasonStatTracker(this, "Backstab", "Assassination"), + new KillReasonStatTracker(this, "Backstab", "Assassination", false), new MineStrikeLastAliveKillStatTracker(this), new KillFastStatTracker(this, 4, 5, "KillingSpree"), new KillsWithConditionStatTracker(this, "Blindfolded", ConditionType.BLINDNESS, "Flash Bang", 2) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillReasonStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillReasonStatTracker.java index 291951292..84386faf2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillReasonStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillReasonStatTracker.java @@ -1,5 +1,11 @@ package nautilus.game.arcade.stats; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -8,6 +14,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.CombatComponent; import mineplex.minecraft.game.core.combat.CombatDamage; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.DamageChange; import nautilus.game.arcade.game.Game; @@ -15,13 +22,42 @@ public class KillReasonStatTracker extends StatTracker { private final String _reason; private final String _statName; + private final boolean _canBeDamagedByKilledPlayer; + private final Map> _damaged = new HashMap<>(); - public KillReasonStatTracker(Game game, String reason, String statName) + public KillReasonStatTracker(Game game, String reason, String statName, boolean canBeDamagedByKilledPlayer) { super(game); _reason = reason; _statName = statName; + _canBeDamagedByKilledPlayer = canBeDamagedByKilledPlayer; + } + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void onCustomDamage(CustomDamageEvent event) + { + if (canBeDamagedByKilledPlayer()) + return; + + if (getGame().GetState() != Game.GameState.Live) + return; + + Player damager = event.GetDamagerPlayer(false); + if (damager == null) + return; + + Player damagee = event.GetDamageePlayer(); + if (damagee == null) + return; + + Set set = _damaged.get(damagee.getUniqueId()); + if (set == null) + { + set = new HashSet<>(); + _damaged.put(damagee.getUniqueId(), set); + } + set.add(damager.getUniqueId()); } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @@ -50,6 +86,13 @@ public class KillReasonStatTracker extends StatTracker if (player == null) return; + if (!canBeDamagedByKilledPlayer()) + { + Set set = _damaged.remove(killer.getUniqueId()); + if (set != null && set.contains(player.getUniqueId())) + return; + } + if (event.GetLog().GetLastDamager() != null && event.GetLog().GetLastDamager().GetReason() != null && event.GetLog().GetLastDamager().GetReason().contains(getReason())) addStat(killer, getStatName(), 1, false, false); else @@ -84,4 +127,9 @@ public class KillReasonStatTracker extends StatTracker { return _reason; } + + public boolean canBeDamagedByKilledPlayer() + { + return _canBeDamagedByKilledPlayer; + } } From 09ca2234c4e61ee5240031ce8eb1fdf5fad3e383 Mon Sep 17 00:00:00 2001 From: CoderTim Date: Thu, 13 Nov 2014 01:49:14 -0500 Subject: [PATCH 2/7] Fixed survival games death match bug: https://trello.com/c/jNGSUUGI --- .../game/games/survivalgames/SurvivalGames.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 048dd9f8f..5b162544b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -1679,4 +1679,21 @@ public class SurvivalGames extends SoloGame Scoreboard.Draw(); } + + @Override + public boolean IsLive() + { + return super.IsLive() && !isDeathMatchAboutToStart(); + } + + public boolean isDeathMatchAboutToStart() + { + if (!_deathmatchLive) + return false; + + if (_deathmatchTime <= 0) + return false; + + return true; + } } From 9eaacd20abe53d95aa1699d473a8a94f6305368f Mon Sep 17 00:00:00 2001 From: Chiss Date: Thu, 13 Nov 2014 18:09:54 +1100 Subject: [PATCH 3/7] fixed slime healing fixed sheep quest brute not dropping sheep updated punish page --- .../src/mineplex/core/punish/UI/PunishPage.java | 12 +++++++++--- .../arcade/game/games/common/Domination.java | 2 +- .../game/arcade/game/games/sheep/SheepGame.java | 16 ++++++++-------- .../game/arcade/kit/perks/PerkSlimeRocket.java | 6 ------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java index ef4dc6b91..0edd44737 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java @@ -233,10 +233,16 @@ public class PunishPage extends CraftInventoryCustom implements Listener examplePrefixEx + " Forcefield", examplePrefixEx + " Speed Hack", examplePrefixEx + " Reach Hack", + examplePrefixEx + " Speed Hack", + examplePrefixEx + " Other Hack", " ", - examplePrefix + "Hack Reports;", - examplePrefixEx + " Forum Report", - examplePrefixEx + " Staff Report", + examplePrefix + "Hack Reports (SR & FR);", + examplePrefixEx + " Forcefield", + examplePrefixEx + " Speed Hack", + examplePrefixEx + " Reach Hack", + examplePrefixEx + " Speed Hack", + examplePrefixEx + " Other Hack", + examplePrefixEx + " Fly Hack", } , 1, false, true), new PunishButton(this, Category.Hacking, 2, true, getDuration(Category.Hacking, 2, offenseMap))); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java index 3138ddfeb..8a79001eb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java @@ -62,7 +62,7 @@ public class Domination extends TeamGame new String[] { "Capture Beacons for Points", - "+500 Points for Emerald Powerups", + "+300 Points for Emerald Powerups", "+50 Points for Kills", "First team to 15000 Points wins" diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 097d7136e..162adbeda 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -292,7 +292,7 @@ public class SheepGame extends TeamGame if (player.getPassenger() != null && player.getPassenger() instanceof Player) { - DropSheep(player, 500); + DropSheep(player, 500, false); } //Holding too many @@ -365,7 +365,7 @@ public class SheepGame extends TeamGame return; if (player.getPassenger() != null) - DropSheep(player, 500); + DropSheep(player, 500, false); if (!Recharge.Instance.usable(player, "Sheep Stack")) return; @@ -396,7 +396,7 @@ public class SheepGame extends TeamGame @EventHandler public void DeathDrop(PlayerDeathEvent event) { - DropSheep(event.getEntity(), 0); + DropSheep(event.getEntity(), 0, false); event.getEntity().eject(); } @@ -404,13 +404,13 @@ public class SheepGame extends TeamGame @EventHandler public void DeathDrop(PlayerItemHeldEvent event) { - DropSheep(event.getPlayer(), 0); + DropSheep(event.getPlayer(), 0, false); } - public void DropSheep(Player player, long cooldown) + public void DropSheep(Player player, long cooldown, boolean calledByCarrier) { //Brute can only throw - if (GetKit(player) instanceof KitBrute) + if (calledByCarrier && GetKit(player) instanceof KitBrute) return; boolean hadSheep = false; @@ -443,7 +443,7 @@ public class SheepGame extends TeamGame @EventHandler public void Drop(PlayerDropItemEvent event) { - DropSheep(event.getPlayer(), 500); + DropSheep(event.getPlayer(), 500, true); } @EventHandler @@ -558,7 +558,7 @@ public class SheepGame extends TeamGame Player player = event.GetDamageePlayer(); if (player == null) return; - DropSheep(player, 1000); + DropSheep(player, 1000, false); Bukkit.getPluginManager().callEvent(new DropEnemySheepEvent(event.GetDamagerPlayer(true), player)); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 25170cab1..4da248e0d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -282,12 +282,6 @@ public class PerkSlimeRocket extends Perk implements IThrown if (owner != null && owner.equals(event.GetDamageeEntity())) { event.SetCancelled("Owner Damage"); - - //Heal Owner - if (slime.getVehicle() == null) - { - UtilPlayer.health(owner, 1); - } } else { From 62fbeeda2047c90f5ac9d391b4efdbe1ce839f59 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 13 Nov 2014 19:14:14 -0800 Subject: [PATCH 4/7] Added Wither disguise. --- .../disguise/disguises/DisguiseWither.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java new file mode 100644 index 000000000..30367e810 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java @@ -0,0 +1,36 @@ +package mineplex.core.disguise.disguises; + +import org.bukkit.entity.EntityType; + +public class DisguiseWither extends DisguiseMonster +{ + public DisguiseWither(org.bukkit.entity.Entity entity) + { + super(EntityType.WITHER, entity); + + DataWatcher.a(17, new Integer(0)); + DataWatcher.a(18, new Integer(0)); + DataWatcher.a(19, new Integer(0)); + DataWatcher.a(20, new Integer(0)); + } + + public int ca() + { + return DataWatcher.getInt(20); + } + + public void s(int i) + { + DataWatcher.watch(20, Integer.valueOf(i)); + } + + public int t(int i) + { + return DataWatcher.getInt(17 + i); + } + + public void b(int i, int j) + { + DataWatcher.watch(17 + i, Integer.valueOf(j)); + } +} From 8ab0116a27b98ddfc1813a543300ba94c1ff7206 Mon Sep 17 00:00:00 2001 From: Chiss Date: Fri, 14 Nov 2014 14:14:31 +1100 Subject: [PATCH 5/7] initial push of Wither Assault --- .../mineplex/core/common/util/UtilAlg.java | 15 +- .../core/common/util/UtilParticle.java | 13 + .../src/mineplex/mapparser/BlockData.java | 25 ++ .../src/mineplex/mapparser/MapParser.java | 142 ++++++- .../src/nautilus/game/arcade/GameFactory.java | 2 + .../src/nautilus/game/arcade/GameType.java | 1 + .../arcade/game/games/wither/WitherGame.java | 354 ++++++++++++++++++ .../games/wither/kit/KitHumanBlinder.java | 61 +++ .../games/wither/kit/KitHumanRepairman.java | 59 +++ .../game/games/wither/kit/KitHumanRunner.java | 60 +++ .../game/games/wither/kit/KitWither.java | 119 ++++++ .../arcade/kit/perks/PerkBlockRestorer.java | 95 +++++ .../kit/perks/PerkWitherArrowBlind.java | 137 +++++++ .../arcade/kit/perks/PerkWitherArrows.java | 91 +++++ .../arcade/kit/perks/PerkWitherAttack.java | 175 +++++++++ .../arcade/kit/perks/PerkWitherMinion.java | 170 +++++++++ .../game/arcade/kit/perks/PerkWitherWeb.java | 111 ++++++ .../arcade/kit/perks/data/IBlockRestorer.java | 12 + 18 files changed, 1633 insertions(+), 9 deletions(-) create mode 100644 Plugins/Mineplex.MapParser/src/mineplex/mapparser/BlockData.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanBlinder.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRepairman.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRunner.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitWither.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrowBlind.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrows.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherAttack.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherMinion.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/IBlockRestorer.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java index 94ef466d3..364261023 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java @@ -139,14 +139,17 @@ public class UtilAlg public static boolean inBoundingBox(Location loc, Location cornerA, Location cornerB) { - if (loc.getX() < Math.min(cornerA.getX(), cornerB.getX())) return false; - if (loc.getX() > Math.max(cornerA.getX(), cornerB.getX())) return false; + if (loc.getX() <= Math.min(cornerA.getX(), cornerB.getX())) return false; + if (loc.getX() >= Math.max(cornerA.getX(), cornerB.getX())) return false; - if (loc.getY() < Math.min(cornerA.getY(), cornerB.getY())) return false; - if (loc.getY() > Math.max(cornerA.getY(), cornerB.getY())) return false; + if (cornerA.getY() != cornerB.getY()) + { + if (loc.getY() <= Math.min(cornerA.getY(), cornerB.getY())) return false; + if (loc.getY() >= Math.max(cornerA.getY(), cornerB.getY())) return false; + } - if (loc.getZ() < Math.min(cornerA.getZ(), cornerB.getZ())) return false; - if (loc.getZ() > Math.max(cornerA.getZ(), cornerB.getZ())) return false; + if (loc.getZ() <= Math.min(cornerA.getZ(), cornerB.getZ())) return false; + if (loc.getZ() >= Math.max(cornerA.getZ(), cornerB.getZ())) return false; return true; } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index b737ead33..1c42b669e 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -109,6 +109,19 @@ public class UtilParticle public static void PlayParticle(ParticleType type, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) { for (Player player : UtilServer.getPlayers()) + { + //Dont send to players who cannot see it! + if (type != ParticleType.FIREWORKS_SPARK && + type != ParticleType.LARGE_EXPLODE && + type != ParticleType.HUGE_EXPLOSION) + { + if (UtilMath.offset(player.getLocation(), location) > 24) + { + continue; + } + } + PlayParticle(player, type, location, offsetX, offsetY, offsetZ, speed, count); + } } } \ No newline at end of file diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/BlockData.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/BlockData.java new file mode 100644 index 000000000..5e1bc0f20 --- /dev/null +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/BlockData.java @@ -0,0 +1,25 @@ +package mineplex.mapparser; + +import org.bukkit.block.Block; +import org.bukkit.Material; + +public class BlockData +{ + public Block Block; + public Material Material; + public byte Data; + public long Time; + + public BlockData(Block block) + { + Block = block; + Material = block.getType(); + Data = block.getData(); + Time = System.currentTimeMillis(); + } + + public void restore() + { + Block.setTypeIdAndData(Material.getId(), Data, true); + } +} diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index 488893cb5..6da50f2ad 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -14,6 +14,7 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -22,6 +23,7 @@ import org.bukkit.entity.Sheep; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockFadeEvent; import org.bukkit.event.block.BlockSpreadEvent; @@ -45,7 +47,10 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; @@ -533,18 +538,17 @@ public class MapParser extends JavaPlugin implements Listener if (!event.getMessage().toLowerCase().startsWith("/tp")) return; - event.setCancelled(true); - Player player = event.getPlayer(); String[] tokens = event.getMessage().split(" "); if (tokens.length != 2) { - UtilPlayer.message(player, F.main("Game", "Invalid Input. " + F.elem("/tp ") + ".")); return; } + event.setCancelled(true); + Player target = UtilPlayer.searchOnline(player, tokens[1], true); if (target != null) { @@ -552,4 +556,136 @@ public class MapParser extends JavaPlugin implements Listener player.teleport(target); } } + + @EventHandler(priority = EventPriority.LOWEST) + public void FlySpeed(PlayerCommandPreprocessEvent event) + { + if (!event.getMessage().toLowerCase().startsWith("/speed")) + return; + + Player player = event.getPlayer(); + + String[] tokens = event.getMessage().split(" "); + + if (tokens.length != 2) + { + return; + } + + event.setCancelled(true); + + try + { + float speed = Float.parseFloat(tokens[1]); + + player.setFlySpeed(speed); + + UtilPlayer.message(player, F.main("Game", "Fly Speed set to " + F.elem("" + speed) + ".")); + } + catch (Exception e) + { + UtilPlayer.message(player, F.main("Game", "Invalid Speed Input.")); + } + } + + private HashMap>> treeHistory = new HashMap>>(); + + @EventHandler(priority = EventPriority.HIGHEST) + public void treeRemover(PlayerInteractEvent event) + { + if (event.isCancelled()) + return; + + //Permission + if (!GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer())) + { + return; + } + + Player player = event.getPlayer(); + + if (!UtilGear.isMat(player.getItemInHand(), Material.NETHER_STAR)) + return; + + event.setCancelled(true); + + //Remove + if (event.getAction() == Action.LEFT_CLICK_BLOCK) + { + if (event.getClickedBlock().getType() != Material.LOG) + { + player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log"); + return; + } + + HashSet toRemove = searchLog(new HashSet(), event.getClickedBlock()); + + if (toRemove.isEmpty()) + { + player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Left-Click on Log"); + return; + } + + HashSet history = new HashSet(); + + for (Block block : toRemove) + { + history.add(new BlockData(block)); + + block.setType(Material.AIR); + } + + if (!treeHistory.containsKey(player)) + treeHistory.put(player, new ArrayList>()); + + treeHistory.get(player).add(0, history); + + player.sendMessage(C.cRed + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Removed"); + + while (treeHistory.get(player).size() > 10) + treeHistory.get(player).remove(10); + } + else if (UtilEvent.isAction(event, ActionType.R)) + { + if (!treeHistory.containsKey(player) || treeHistory.get(player).isEmpty()) + { + player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "No Tree History"); + return; + } + + HashSet datas = treeHistory.get(player).remove(0); + + for (BlockData data : datas) + data.restore(); + + player.sendMessage(C.cGreen + C.Bold + "TreeTool: " + ChatColor.RESET + "Tree Restored"); + } + } + + private HashSet searchLog(HashSet blocks, Block current) + { + //Not Tree + if (current.getType() != Material.LOG && current.getType() != Material.LEAVES) + return blocks; + + if (!blocks.add(current)) + return blocks; + + for (Block other : UtilBlock.getSurrounding(current, true)) + { + if (current.getType() != Material.LOG && current.getType() != Material.LEAVES) + continue; + + if (blocks.contains(other)) + continue; + + //Dont spread from leaves to log + if (current.getType() == Material.LEAVES && other.getType() == Material.LOG) + continue; + + searchLog(blocks, other); + } + + return blocks; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java index 6108fa4b3..1a12c7afb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java @@ -47,6 +47,7 @@ import nautilus.game.arcade.game.games.paintball.Paintball; import nautilus.game.arcade.game.games.tug.Tug; import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.uhc.UHC; +import nautilus.game.arcade.game.games.wither.WitherGame; import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival; public class GameFactory @@ -102,6 +103,7 @@ public class GameFactory else if (gameType == GameType.Tug) return new Tug(_manager); else if (gameType == GameType.TurfWars) return new TurfForts(_manager); else if (gameType == GameType.UHC) return new UHC(_manager); + else if (gameType == GameType.WitherAssault) return new WitherGame(_manager); else if (gameType == GameType.ZombieSurvival) return new ZombieSurvival(_manager); else return null; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 5f8e40f34..a975248fb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -48,6 +48,7 @@ public enum GameType Tug("Tug of Wool"), TurfWars("Turf Wars"), UHC("Ultra Hardcore"), + WitherAssault("Wither Assault"), ZombieSurvival("Zombie Survival"); String _name; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java new file mode 100644 index 000000000..86d54146f --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java @@ -0,0 +1,354 @@ +package nautilus.game.arcade.game.games.wither; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.data.BlockData; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.TeamGame; +import nautilus.game.arcade.game.games.wither.kit.*; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.NullKit; +import nautilus.game.arcade.kit.perks.data.IBlockRestorer; + +public class WitherGame extends TeamGame implements IBlockRestorer +{ + private GameTeam _runners; + private GameTeam _withers; + + private double _witherFactor = 3; + + private long _gameTime = 240000; + private int _pointGoal = 50; + private int _points = 0; + + private int _witherY = 60; + + private Location _spawnA; + private Location _spawnB; + + private Location _safeA; + private Location _safeB; + + private Location _boatA; + private Location _boatB; + + private HashSet _blocks = new HashSet(); + + public WitherGame(ArcadeManager manager) + { + super(manager, GameType.WitherAssault, + + new Kit[] + { + new KitHumanRunner(manager), + new KitHumanBlinder(manager), + new KitHumanRepairman(manager), + new NullKit(manager), + new KitWither(manager), + }, + + new String[] + { + C.cGreen + "Humans" + C.cWhite + " Escape to the Beacon", + C.cGreen + "Humans" + C.cWhite + " Win by reaching Beacon 100 times", + " ", + C.cRed + "Withers" + C.cWhite + " Stop Humans from reaching the Beacon", + C.cRed + "Withers" + C.cWhite + " Win after 4 Minutes", + }); + + this.DeathOut = false; + this.DamageTeamSelf = false; + this.DamageSelf = false; + this.HungerSet = 20; + + this.KitRegisterState = GameState.Prepare; + } + + @Override + public void ParseData() + { + _witherY = WorldData.GetDataLocs("RED").get(0).getBlockY(); + + _safeA = WorldData.GetDataLocs("YELLOW").get(0); + _safeB = WorldData.GetDataLocs("YELLOW").get(1); + + _boatA = WorldData.GetDataLocs("GREEN").get(0); + _boatB = WorldData.GetDataLocs("GREEN").get(1); + + _spawnA = WorldData.GetDataLocs("BLUE").get(0); + _spawnB = WorldData.GetDataLocs("BLUE").get(1); + } + + @EventHandler + public void teamSetup(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Recruit) + return; + + for (Kit kit : GetKits()) + { + for (GameTeam team : GetTeamList()) + { + if (team.GetColor() == ChatColor.RED) + { + _withers = team; + _withers.SetName("Withers"); + _withers.SetColor(ChatColor.RED); + + if (!kit.GetName().contains("Wither")) + team.GetRestrictedKits().add(kit); + } + else + { + _runners = team; + _runners.SetName("Humans"); + _runners.SetColor(ChatColor.GREEN); + + if (kit.GetName().contains("Wither")) + team.GetRestrictedKits().add(kit); + } + } + } + } + + @EventHandler + public void teamBalance(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.FAST) + return; + + //Not Enough Players + if (_runners.GetPlayers(true).size() < 2) + return; + + //Enough Withers + if (_withers.GetPlayers(true).size() * _witherFactor >= _runners.GetPlayers(true).size()) + return; + + + Player player = UtilAlg.Random(_runners.GetPlayers(true)); + setWither(player, true); + } + + public void setWither(Player player, boolean forced) + { + SetPlayerTeam(player, _withers, true); + + //Kit + Kit newKit = GetKits()[4]; + + SetKit(player, newKit, false); + newKit.ApplyKit(player); + + if (forced) + { + AddGems(player, 10, "Forced Wither", false); + + Announce(F.main("Game", F.elem(_withers.GetColor() + player.getName()) + " has become a " + + F.elem(_withers.GetColor() + newKit.GetName()) + ".")); + + player.getWorld().strikeLightningEffect(player.getLocation()); + } + } + + @Override + public void EndCheck() + { + if (!IsLive()) + return; + + //Players Quit + if (GetPlayers(true).size() < 2) + { + SetState(GameState.End); + } + + GameTeam winner = null; + + //Wither Win + if (UtilTime.elapsed(this.GetStateTime(), _gameTime)) + winner = _withers; + + //Runner Win + if (_points >= _pointGoal) + winner = _runners; + + //Set Win + if (winner != null) + { + AnnounceEnd(_withers); + + for (GameTeam team : GetTeamList()) + { + if (WinnerTeam != null && team.equals(WinnerTeam)) + { + for (Player player : team.GetPlayers(false)) + AddGems(player, 10, "Winning Team", false); + } + + for (Player player : team.GetPlayers(false)) + if (player.isOnline()) + AddGems(player, 10, "Participation", false); + } + + //End + SetState(GameState.End); + } + } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (!InProgress()) + return; + + if (event.getType() != UpdateType.FAST) + return; + + //Wipe Last + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + Scoreboard.Write(_runners.GetColor() + C.Bold + _runners.GetName()); + Scoreboard.Write(_runners.GetColor() + "" + _runners.GetPlayers(true).size() + " Players"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(_withers.GetColor() + C.Bold + _withers.GetName()); + Scoreboard.Write(_withers.GetColor() + "" + _withers.GetPlayers(true).size() + " Players"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Escapes"); + Scoreboard.Write(_points + " / " + _pointGoal); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Time Left"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, _gameTime - (System.currentTimeMillis() - this.GetStateTime())), 1)); + + Scoreboard.Draw(); + } + + @Override + public boolean CanJoinTeam(GameTeam team) + { + if (team.equals(_withers)) + return team.GetSize() < getRequiredWithers(); + + return team.GetSize() < GetPlayers(true).size() - getRequiredWithers(); + } + + public int getRequiredWithers() + { + return (int)(GetPlayers(true).size()/_witherFactor); + } + + @EventHandler + public void witherBump(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.TICK) + return; + + for (Player player : _withers.GetPlayers(true)) + { + if (player.getLocation().getY() < _witherY) + { + player.setVelocity(new Vector(0, 0.6, 0)); + + if (Recharge.Instance.use(player, "Wither Bump", 5000, false, false)) + UtilPlayer.message(player, F.main("Game", "Withers cannot descend past this point.")); + } + } + } + + @Override + public void restoreBlock(Location loc, double radius) + { + Iterator dataIt = _blocks.iterator(); + + while (dataIt.hasNext()) + { + BlockData data = dataIt.next(); + + double dist = UtilMath.offset(loc, data.Block.getLocation().add(0.5, 0.5, 0.5)); + + if (dist < radius) + { + Manager.GetBlockRestore().Add(data.Block, 0, (byte)0, data.Material.getId(), data.Data, (long) (6000 * (dist/radius))); + dataIt.remove(); + } + } + } + + @Override + public void addBlocks(Set blocks) + { + Iterator blockIter = blocks.iterator(); + + while (blockIter.hasNext()) + { + Block block = blockIter.next(); + + if (UtilAlg.inBoundingBox(block.getLocation(), _safeA, _safeB) || UtilAlg.inBoundingBox(block.getLocation(), _spawnA, _spawnB)) + blockIter.remove(); + } + + for (Block block : blocks) + _blocks.add(new BlockData(block)); + } + + @EventHandler + public void boatEscape(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.TICK) + return; + + for (Player player : _runners.GetPlayers(true)) + { + if (UtilAlg.inBoundingBox(player.getLocation(), _boatA, _boatB)) + { + _points++; + + UtilFirework.playFirework(player.getLocation(), Type.BALL, Color.LIME, true, true); + + player.teleport(_runners.GetSpawn()); + + Announce(C.cGreen + C.Bold + player.getName() + " escaped!"); + + AddGems(player, 4, "Escapes", true); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanBlinder.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanBlinder.java new file mode 100644 index 000000000..d6731e4fc --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanBlinder.java @@ -0,0 +1,61 @@ +package nautilus.game.arcade.game.games.wither.kit; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkWitherArrowBlind; + +public class KitHumanBlinder extends Kit +{ + public KitHumanBlinder(ArcadeManager manager) + { + super(manager, "Human Blinder", KitAvailability.Free, + + new String[] + { + "" + }, + + new Perk[] + { + new PerkWitherArrowBlind(4) + }, + EntityType.ZOMBIE, + null); + + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ARROW, 8)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + + player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); + player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); + player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); + player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); + + Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 8, false, false); + } + + @Override + public void SpawnCustom(LivingEntity ent) + { + ent.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET)); + ent.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE)); + ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); + ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRepairman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRepairman.java new file mode 100644 index 000000000..874921f12 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRepairman.java @@ -0,0 +1,59 @@ +package nautilus.game.arcade.game.games.wither.kit; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkBlockRestorer; + +public class KitHumanRepairman extends Kit +{ + public KitHumanRepairman(ArcadeManager manager) + { + super(manager, "Human Repairman", KitAvailability.Free, + + new String[] + { + "" + }, + + new Perk[] + { + new PerkBlockRestorer() + }, + EntityType.ZOMBIE, + null); + + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + + player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); + player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); + player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); + player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); + + Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 8, false, false); + } + + @Override + public void SpawnCustom(LivingEntity ent) + { + ent.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET)); + ent.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE)); + ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); + ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRunner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRunner.java new file mode 100644 index 000000000..3db11acb2 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitHumanRunner.java @@ -0,0 +1,60 @@ +package nautilus.game.arcade.game.games.wither.kit; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemStackFactory; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.PerkLeap; + +public class KitHumanRunner extends Kit +{ + public KitHumanRunner(ArcadeManager manager) + { + super(manager, "Human Leaper", KitAvailability.Free, + + new String[] + { + "" + }, + + new Perk[] + { + new PerkLeap("Leap", 1, 1, 4000) + }, + EntityType.ZOMBIE, + null); + + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP)); + + player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); + player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); + player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); + player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); + + Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 8, false, false); + } + + @Override + public void SpawnCustom(LivingEntity ent) + { + ent.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET)); + ent.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE)); + ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); + ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitWither.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitWither.java new file mode 100644 index 000000000..e906d36e6 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/kit/KitWither.java @@ -0,0 +1,119 @@ +package nautilus.game.arcade.game.games.wither.kit; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilServer; +import mineplex.core.disguise.disguises.DisguiseBlaze; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.*; +import nautilus.game.arcade.kit.perks.data.IBlockRestorer; + +public class KitWither extends Kit +{ + public KitWither(ArcadeManager manager) + { + super(manager, "Wither", KitAvailability.Free, + + new String[] + { + "" + }, + + new Perk[] + { + new PerkWitherArrows(), + new PerkWitherAttack(), + new PerkWitherWeb(), + new PerkWitherMinion() + }, + EntityType.ZOMBIE, + null); + + } + + @Override + public void GiveItems(Player player) + { + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD, (byte)0, 1, + C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Wither Skull")); + + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, + C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Web Blast")); + + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, (byte)0, 1, + C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Skeletal Minions")); + + //Disguise + DisguiseBlaze disguise = new DisguiseBlaze(player); + + if (Manager.GetGame().GetTeam(player) != null) + disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + else + disguise.SetName(player.getName()); + + disguise.SetCustomNameVisible(true); + Manager.GetDisguise().disguise(disguise); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void witherDamageCancel(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + Player player = event.GetDamageePlayer(); + if (player == null) + return; + + if (HasKit(player)) + event.SetCancelled("Wither Immunity"); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void witherMeleeCancel(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + Player player = event.GetDamagerPlayer(true); + if (player == null) + return; + + if (!HasKit(player)) + return; + + if (event.GetCause() != DamageCause.ENTITY_ATTACK) + return; + + event.SetCancelled("Wither Melee Cancel"); + } + + @EventHandler + public void witherFlight(UpdateEvent event) + { + for (Player player : UtilServer.getPlayers()) + { + if (!HasKit(player)) + continue; + + if (player.isFlying()) + continue; + + player.setAllowFlight(true); + player.setFlying(true); + player.setFlySpeed(0.1f); + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java new file mode 100644 index 000000000..7c1819810 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java @@ -0,0 +1,95 @@ +package nautilus.game.arcade.kit.perks; + +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Color; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerInteractEvent; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.data.IBlockRestorer; + +public class PerkBlockRestorer extends Perk implements IThrown +{ + public PerkBlockRestorer() + { + super("Repair Master", new String[] + { + C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Throw Repairer", + }); + } + + @EventHandler + public void Throw(PlayerInteractEvent event) + { + if (!UtilEvent.isAction(event, ActionType.R)) + return; + + if (event.getPlayer().getItemInHand() == null) + return; + + if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE")) + return; + + if (UtilBlock.usable(event.getClickedBlock())) + return; + + Player player = event.getPlayer(); + + if (!Kit.HasKit(player)) + return; + + if (!Recharge.Instance.use(player, GetName(), 12000, true, true)) + return; + + event.setCancelled(true); + + org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COMMAND)); + UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); + Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, false, 2d); + } + + @Override + public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + restore(data.GetThrown()); + } + + @Override + public void Idle(ProjectileUser data) + { + restore(data.GetThrown()); + } + + @Override + public void Expire(ProjectileUser data) + { + restore(data.GetThrown()); + } + + public void restore(Entity entity) + { + if (Manager.GetGame() != null && Manager.GetGame() instanceof IBlockRestorer) + { + ((IBlockRestorer)Manager.GetGame()).restoreBlock(entity.getLocation(), 8); + } + + entity.remove(); + + UtilFirework.playFirework(entity.getLocation(), Type.BALL_LARGE, Color.WHITE, false, true); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrowBlind.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrowBlind.java new file mode 100644 index 000000000..2009937a1 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrowBlind.java @@ -0,0 +1,137 @@ +package nautilus.game.arcade.kit.perks; + +import java.util.ArrayList; +import java.util.Iterator; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityShootBowEvent; + +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.updater.UpdateType; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.kit.Perk; + +public class PerkWitherArrowBlind extends Perk +{ + private ArrayList _arrows = new ArrayList(); + + private int _proximityHit; + + public PerkWitherArrowBlind(int proximityHit) + { + super("Smoke Arrow", new String[] + { + "Your arrows give Blindness for 4 seconds" + }); + + _proximityHit = proximityHit; + } + + @EventHandler + public void FireBow(EntityShootBowEvent event) + { + if (!(event.getEntity() instanceof Player)) + return; + + if (!(event.getProjectile() instanceof Arrow)) + return; + + Player player = (Player)event.getEntity(); + + if (!Kit.HasKit(player)) + return; + + //Start + _arrows.add((Arrow)event.getProjectile()); + } + + @EventHandler(priority = EventPriority.HIGH) + public void Damage(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (event.GetProjectile() == null) + return; + + if (event.GetDamagerPlayer(true) == null) + return; + + if (!(event.GetProjectile() instanceof Arrow)) + return; + + Arrow arrow = (Arrow)event.GetProjectile(); + + if (!_arrows.remove(arrow)) + return; + + Manager.GetCondition().Factory().Blind(GetName(), event.GetDamageeEntity(), null, 4, 0, false, false, false); + + UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, arrow.getLocation(), 0, 0, 0, 0, 1); + + event.SetCancelled("Smoke Arrow"); + } + + @EventHandler + public void update(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for (Iterator arrowIterator = _arrows.iterator(); arrowIterator.hasNext();) + { + Arrow arrow = arrowIterator.next(); + + //Proxy + if (_proximityHit > 0 && getWitherTeam() != null) + { + boolean hit = false; + for (Player player : getWitherTeam().GetPlayers(true)) + { + if (UtilMath.offset(player.getLocation().add(0, 2, 0), arrow.getLocation()) < _proximityHit) + { + Manager.GetCondition().Factory().Blind(GetName(), player, null, 4, 0, false, false, false); + + UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, arrow.getLocation(), 0, 0, 0, 0, 1); + + arrowIterator.remove(); + arrow.remove(); + hit = true; + continue; + } + } + + if (hit) + continue; + } + + //Dead + if (arrow.isDead() || !arrow.isValid() || arrow.getTicksLived() > 120 || arrow.isOnGround()) + { + arrow.remove(); + arrowIterator.remove(); + } + //Particle + else + { + UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, arrow.getLocation(), 0, 0, 0, 0, 1); + } + } + } + + public GameTeam getWitherTeam() + { + if (Manager.GetGame() == null) + return null; + + return Manager.GetGame().GetTeam(ChatColor.RED); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrows.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrows.java new file mode 100644 index 000000000..396f82d7d --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherArrows.java @@ -0,0 +1,91 @@ +package nautilus.game.arcade.kit.perks; + +import java.util.Iterator; +import java.util.WeakHashMap; + +import org.bukkit.Sound; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +import nautilus.game.arcade.kit.Perk; + +public class PerkWitherArrows extends Perk +{ + private WeakHashMap _proj = new WeakHashMap(); + + public PerkWitherArrows() + { + super("Fire Storm", new String[] + { + C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Fire Storm" + }); + } + + @EventHandler + public void shoot(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for (Player player : Manager.GetGame().GetPlayers(true)) + { + if (!Kit.HasKit(player)) + continue; + + if (!player.isBlocking()) + { + player.setExp((float) Math.min(0.999, player.getExp()+(1f/40f))); + } + else if (player.getExp() > 0) + { + player.setExp((float) Math.max(0, player.getExp()-(1f/40f))); + + for (int i=0 ; i<2 ; i++) + { + Arrow arrow = player.getWorld().spawnArrow( + player.getEyeLocation().add(player.getLocation().getDirection()), + player.getLocation().getDirection(), 2, 12); + + arrow.setShooter(player); + + _proj.put(arrow, player); + } + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.FIZZ, 0.1f, 0.5f); + } + } + } + + + @EventHandler + public void update(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + Iterator arrowIter = _proj.keySet().iterator(); + + while (arrowIter.hasNext()) + { + Arrow arrow = arrowIter.next(); + + if (!arrow.isValid() || arrow.getTicksLived() > 60 || arrow.getLocation().getY() < 0) + { + arrow.remove(); + arrowIter.remove(); + } + else if (arrow.getTicksLived() > 1) + { + UtilParticle.PlayParticle(ParticleType.FLAME, arrow.getLocation(), 0, 0, 0, 0, 1); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherAttack.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherAttack.java new file mode 100644 index 000000000..07273c31c --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherAttack.java @@ -0,0 +1,175 @@ +package nautilus.game.arcade.kit.perks; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.WitherSkull; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.perks.data.IBlockRestorer; + +public class PerkWitherAttack extends Perk +{ + private ArrayList _active = new ArrayList(); + + public PerkWitherAttack() + { + super("Wither Skull", new String[] + { + C.cYellow + "Left-Click" + C.cGray + " with Gold Sword to use " + C.cGreen + "Wither Skull" + }); + } + + + @EventHandler + public void Activate(PlayerInteractEvent event) + { + if (event.isCancelled()) + return; + + if (!UtilEvent.isAction(event, ActionType.L)) + return; + + Player player = event.getPlayer(); + + if (!Kit.HasKit(player)) + return; + + if (!UtilGear.isMat(event.getPlayer().getItemInHand(), Material.GOLD_SWORD)) + return; + + if (!Recharge.Instance.use(player, GetName(), 2000, true, true)) + return; + + //Fire + _active.add(player.launchProjectile(WitherSkull.class)); + + //Sound + player.getWorld().playSound(player.getLocation(), Sound.WITHER_SHOOT, 1f, 1f); + + //Inform + UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); + } + + @EventHandler + public void explode(EntityExplodeEvent event) + { + if (!_active.contains(event.getEntity())) + return; + + event.setCancelled(true); + + WitherSkull skull = (WitherSkull)event.getEntity(); + + UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, skull.getLocation(), 0, 0, 0, 0, 1); + + explode(skull); + } + + @EventHandler + public void clean(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + Iterator skullIterator = _active.iterator(); + + while (skullIterator.hasNext()) + { + WitherSkull skull = skullIterator.next(); + + if (!skull.isValid()) + { + skullIterator.remove(); + skull.remove(); + continue; + } + } + } + + @EventHandler(priority = EventPriority.LOWEST) + public void ExplodeDamage(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (event.GetProjectile() != null && event.GetProjectile() instanceof WitherSkull) + event.SetCancelled("Wither Skull Cancel"); + } + + private void explode(WitherSkull skull) + { + double scale = 0.4 + 0.6 * Math.min(1, skull.getTicksLived()/20d); + + //Players + HashMap players = UtilPlayer.getInRadius(skull.getLocation(), 6); + for (Player player : players.keySet()) + { + if (!Manager.GetGame().IsAlive(player)) + continue; + + //Damage Event + Manager.GetDamage().NewDamageEvent(player, (LivingEntity)skull.getShooter(), null, + DamageCause.CUSTOM, 10 * scale, true, true, false, + UtilEnt.getName((LivingEntity)skull.getShooter()), GetName()); + } + + //Blocks + Set blocks = UtilBlock.getInRadius(skull.getLocation(), 4d).keySet(); + + Iterator blockIterator = blocks.iterator(); + while (blockIterator.hasNext()) + { + Block block = blockIterator.next(); + + if (block.isLiquid()) + blockIterator.remove(); + + else if (block.getRelative(BlockFace.UP).isLiquid()) + blockIterator.remove(); + } + + if (Manager.GetGame() != null && Manager.GetGame() instanceof IBlockRestorer) + { + ((IBlockRestorer)Manager.GetGame()).addBlocks(blocks); + } + + + Manager.GetExplosion().BlockExplosion(blocks, skull.getLocation(), false); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherMinion.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherMinion.java new file mode 100644 index 000000000..aa901d054 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherMinion.java @@ -0,0 +1,170 @@ +package nautilus.game.arcade.kit.perks; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.WeakHashMap; + +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Skeleton.SkeletonType; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.LeatherArmorMeta; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.kit.Perk; + +public class PerkWitherMinion extends Perk +{ + private ArrayList _ents = new ArrayList(); + + public PerkWitherMinion() + { + super("Wither Minions", new String[] + { + C.cYellow + "Left-Click" + C.cGray + " with Diamond Sword to use " + C.cGreen + "Wither Minions" + }); + } + + @EventHandler + public void ShootWeb(PlayerInteractEvent event) + { + if (event.isCancelled()) + return; + + if (!UtilEvent.isAction(event, ActionType.L)) + return; + + if (UtilBlock.usable(event.getClickedBlock())) + return; + + if (!UtilGear.isMat(event.getPlayer().getItemInHand(), Material.DIAMOND_SWORD)) + return; + + Player player = event.getPlayer(); + + if (!Kit.HasKit(player)) + return; + + if (!Recharge.Instance.use(player, GetName(), 10000, true, true)) + return; + + event.setCancelled(true); + + Manager.GetGame().CreatureAllowOverride = true; + + for (int i=0 ; i<3 ; i++) + { + Skeleton skel = player.getWorld().spawn(player.getEyeLocation(), Skeleton.class); + _ents.add(skel); + + skel.getEquipment().setHelmet(ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM, (byte)1, 1)); + + ItemStack armor = new ItemStack(Material.LEATHER_CHESTPLATE); + LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta(); + meta.setColor(Color.BLACK); + armor.setItemMeta(meta); + skel.getEquipment().setChestplate(armor); + + Manager.GetCondition().Factory().Invisible("Skeleton", skel, skel, 9999, 0, false, false, false); + Manager.GetCondition().Factory().Speed("Skeleton", skel, skel, 9999, 0, false, false, false); + + Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); + random.normalize(); + random.multiply(0.1); + + UtilAction.velocity(skel, player.getLocation().getDirection().add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false); + } + + Manager.GetGame().CreatureAllowOverride = false; + + //Inform + UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.WITHER_HURT, 2f, 0.6f); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void witherMeleeCancel(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (event.GetCause() != DamageCause.FALL) + return; + + if (_ents.contains(event.GetDamageeEntity())) + return; + + event.SetCancelled("Minion Fall Damage"); + } + + @EventHandler + public void entityTarget(EntityTargetEvent event) + { + if (getWitherTeam() == null) + return; + + if (getWitherTeam().GetPlayers(true).contains(event.getTarget())) + event.setCancelled(true); + } + + @EventHandler + public void update(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + Iterator skelIter = _ents.iterator(); + + while (skelIter.hasNext()) + { + Skeleton skel = skelIter.next(); + + if (!skel.isValid() || skel.getTicksLived() > 300 || skel.getLocation().getY() < 0) + { + skel.remove(); + skelIter.remove(); + } + else + { + if (skel.getTarget() == null) + { + skel.setTarget(UtilPlayer.getClosest(skel.getLocation(), getWitherTeam().GetPlayers(true))); + } + } + } + } + + public GameTeam getWitherTeam() + { + if (Manager.GetGame() == null) + return null; + + return Manager.GetGame().GetTeam(ChatColor.RED); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java new file mode 100644 index 000000000..08259622f --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java @@ -0,0 +1,111 @@ +package nautilus.game.arcade.kit.perks; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.kit.Perk; + +public class PerkWitherWeb extends Perk implements IThrown +{ + public PerkWitherWeb() + { + super("Web Blast", new String[] + { + C.cYellow + "Left-Click" + C.cGray + " with Iron Sword to use " + C.cGreen + "Web Blast" + }); + } + + @EventHandler + public void ShootWeb(PlayerInteractEvent event) + { + if (event.isCancelled()) + return; + + if (!UtilEvent.isAction(event, ActionType.L)) + return; + + if (UtilBlock.usable(event.getClickedBlock())) + return; + + if (!UtilGear.isMat(event.getPlayer().getItemInHand(), Material.IRON_SWORD)) + return; + + Player player = event.getPlayer(); + + if (!Kit.HasKit(player)) + return; + + if (!Recharge.Instance.use(player, GetName(), 6000, true, true)) + return; + + event.setCancelled(true); + + for (int i=0 ; i<40 ; i++) + { + org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.WEB)); + + Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); + random.normalize(); + random.multiply(0.25); + + UtilAction.velocity(ent, player.getLocation().getDirection().add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2d); + } + + //Inform + UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.WITHER_HURT, 2f, 0.6f); + } + + @Override + public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + Web(data); + } + + @Override + public void Idle(ProjectileUser data) + { + Web(data); + } + + @Override + public void Expire(ProjectileUser data) + { + Web(data); + } + + public void Web(ProjectileUser data) + { + Location loc = data.GetThrown().getLocation(); + data.GetThrown().remove(); + + if (data.GetThrown().getTicksLived() > 3) + Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 3000); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/IBlockRestorer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/IBlockRestorer.java new file mode 100644 index 000000000..8373827ae --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/IBlockRestorer.java @@ -0,0 +1,12 @@ +package nautilus.game.arcade.kit.perks.data; + +import java.util.Set; + +import org.bukkit.Location; +import org.bukkit.block.Block; + +public interface IBlockRestorer +{ + public void restoreBlock(Location loc, double radius); + public void addBlocks(Set blocks); +} From 1ee16d284db5de5bdd99fce64ca1d6fb8524583a Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 13 Nov 2014 19:14:43 -0800 Subject: [PATCH 6/7] Updated StaffServer packages to reflect enjin shop. --- .../src/mineplex/staffServer/StaffServer.java | 2 ++ .../salespackage/command/HeroCommand.java | 6 ------ .../command/LifetimeHeroCommand.java | 11 +---------- .../command/LifetimeUltraCommand.java | 11 +---------- .../salespackage/command/UltraCommand.java | 6 ------ .../salespackages/LifetimeHero.java | 5 +---- .../salespackages/LifetimeUltra.java | 5 +---- .../salespackages/MonthlyHero.java | 2 -- .../salespackages/MonthlyUltra.java | 2 -- Website/LOCWebsite.suo | Bin 474624 -> 474624 bytes 10 files changed, 6 insertions(+), 44 deletions(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java index 8df18e496..2ddfe47e4 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java @@ -11,6 +11,7 @@ import mineplex.core.monitor.LagMeter; import mineplex.core.npc.NpcManager; import mineplex.core.portal.Portal; import mineplex.core.preferences.PreferencesManager; +import mineplex.core.punish.Punish; import mineplex.core.recharge.Recharge; import mineplex.core.stats.StatsManager; import mineplex.core.status.ServerStatusManager; @@ -45,6 +46,7 @@ public class StaffServer extends JavaPlugin DonationManager donationManager = new DonationManager(this, webServerAddress); + new Punish(this, webServerAddress, clientManager); new NpcManager(this, new Creature(this)); ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager)); PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/HeroCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/HeroCommand.java index c0de8ec3b..5d18f1224 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/HeroCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/HeroCommand.java @@ -26,11 +26,5 @@ public class HeroCommand extends CommandBase resetCommandCharge(caller); Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 90")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales chest " + args[0] + " 40")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales key " + args[0] + " 10")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java index 08fffb258..c4e7c9b22 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java @@ -22,15 +22,6 @@ public class LifetimeHeroCommand extends CommandBase Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " HERO true")); resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 40000")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 180")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales chest " + args[0] + " 40")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales key " + args[0] + " 10")); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 30000")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java index dbc33691d..d22d363f8 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java @@ -22,15 +22,6 @@ public class LifetimeUltraCommand extends CommandBase Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ULTRA true")); resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 20000")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 60")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales chest " + args[0] + " 20")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales key " + args[0] + " 5")); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 15000")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/UltraCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/UltraCommand.java index 4aa7c6fd4..996bec1b4 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/UltraCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/UltraCommand.java @@ -26,11 +26,5 @@ public class UltraCommand extends CommandBase resetCommandCharge(caller); Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 30")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales chest " + args[0] + " 20")); - - resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales key " + args[0] + " 5")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java index 64940b81f..d1ff41360 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java @@ -13,10 +13,7 @@ public class LifetimeHero extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " 40000", " 40,000 Coins"); - addButton(agent, "/sales booster " + playerName + " 180", " 180 Gem Boosters"); - addButton(agent, "/sales chest " + playerName + " 40", " 40 Treasure Chests"); - addButton(agent, "/sales key " + playerName + " 10", " 10 Treasure Keys"); + addButton(agent, "/sales coin " + playerName + " 30000", " 30,000 Coins"); addButton(agent, "/sales rank " + playerName + " HERO true", " Lifetime Hero."); addButton(agent, "Apply All", "/sales lifetimehero " + playerName, " Apply all above."); agent.sendMessage(" "); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java index bca70da38..9446883ae 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java @@ -13,10 +13,7 @@ public class LifetimeUltra extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " 20000", " 20,000 Coins"); - addButton(agent, "/sales booster " + playerName + " 60", " 60 Gem Boosters"); - addButton(agent, "/sales chest " + playerName + " 20", " 20 Treasure Chests"); - addButton(agent, "/sales key " + playerName + " 5", " 5 Treasure Keys"); + addButton(agent, "/sales coin " + playerName + " 15000", " 15,000 Coins"); addButton(agent, "/sales rank " + playerName + " ULTRA true", " Lifetime Ultra."); addButton(agent, "Apply All", "/sales lifetimeultra " + playerName, " Apply all above."); agent.sendMessage(" "); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyHero.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyHero.java index 811e0e8ec..ad82d4d83 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyHero.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyHero.java @@ -15,8 +15,6 @@ public class MonthlyHero extends SalesPackageBase { addButton(agent, "/sales coin " + playerName + " 15000", " 15,000 Coins"); addButton(agent, "/sales booster " + playerName + " 90", " 90 Gem Boosters"); - addButton(agent, "/sales chest " + playerName + " 40", " 40 Treasure Chests"); - addButton(agent, "/sales key " + playerName + " 10", " 10 Treasure Keys"); addButton(agent, "/sales rank " + playerName + " HERO false", " Monthly Hero."); addButton(agent, "Apply All", "/sales hero " + playerName, " Apply all above."); agent.sendMessage(" "); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyUltra.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyUltra.java index 7a28b1b73..ce48bbf2f 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyUltra.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/MonthlyUltra.java @@ -15,8 +15,6 @@ public class MonthlyUltra extends SalesPackageBase { addButton(agent, "/sales coin " + playerName + " 7500", " 7,500 Coins"); addButton(agent, "/sales booster " + playerName + " 30", " 30 Gem Boosters"); - addButton(agent, "/sales chest " + playerName + " 20", " 20 Treasure Chests"); - addButton(agent, "/sales key " + playerName + " 5", " 5 Treasure Keys"); addButton(agent, "/sales rank " + playerName + " ULTRA false", " Monthly Ultra."); addButton(agent, "Apply All", "/sales ultra " + playerName, " Apply all above."); agent.sendMessage(" "); diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index 8bfe187473081cf482bd444e3ab2a07dfeec48ba..3db6bb26feb29f9cbda9e2f540bc9cd02bba5ddc 100644 GIT binary patch delta 13190 zcmZ8o4Oo;_+MaXX^NxTMj)X*r<3vcr5{-oB5{n~Y5+aO9iiC!UX0B_9td*IKKdWX& z$kBPsHAA;$%WaLcb^Kb=@n?6d&kW0L%gjdC{`?_SOe@pxK4%8?+pfzl=bd-n_xwE1 z{oMEc9KDwky_XVOXNc&|J(q7DbmaqPSS*&nPh01TLaW>>TwA-MN<<{Pg8zEq8)A7p zRo3_Nh-iG02VP0v+SRLFM5yoMy1zH8xW#fv{t#Oj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lqaiPU=Lp3Dzp=_l=nv w8Zy!9VDX6m&VNba{`gJ(6uhQ_Y93wp9#o~rzOr1Qn8{WP4}E@*HKgtT0D3)#g#Z8m From 4812da2cd9b34e5f25afb41483ca1e23908909de Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 13 Nov 2014 19:14:56 -0800 Subject: [PATCH 7/7] More work on Clans - Clan repository. --- .../mineplex/core/command/CommandCenter.java | 1 - .../mineplex/game/clans/clans/ClanInfo.java | 20 ++++++++++ .../clans/repository/ClanRepository.java | 38 ++++++++++++++++++- .../fields/repository/FieldRepository.java | 6 +-- 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java index 7e2a31a17..c96ee9a04 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java @@ -88,7 +88,6 @@ public class CommandCenter implements Listener } } - public void AddCommand(ICommand command) { for (String commandRoot : command.Aliases()) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java index 0eae99feb..b5eb58fcf 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java @@ -382,6 +382,26 @@ public class ClanInfo _lastOnline = lastOnline; } + public void saveAlliances() + { + + } + + public void saveMembers() + { + + } + + public void saveTerritories() + { + + } + + public void saveBasicInfo() + { + + } + public ClanToken GetToken() { // Update Members diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java index 6b03f54ab..69489e75f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/repository/ClanRepository.java @@ -1,21 +1,57 @@ package mineplex.game.clans.clans.repository; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.database.RepositoryBase; +import mineplex.core.database.ResultSetCallable; +import mineplex.core.database.column.ColumnVarChar; +import mineplex.game.clans.clans.repository.tokens.ClanToken; public class ClanRepository extends RepositoryBase { - public ClanRepository(JavaPlugin plugin) + private static String CREATE_CLAN_TABLE = "CREATE TABLE IF NOT EXISTS clans (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100), description VARCHAR(140), home VARCHAR(140), admin BOOL, dateCreated LONG, lastOnline LONG, PRIMARY KEY (id), INDEX clanName (name));"; + private static String CREATE_ACCOUNT_CLAN_TABLE = "CREATE TABLE IF NOT EXISTS accountClan (id INT NOT NULL AUTO_INCREMENT, accountId INT, clanId INT, clanRole VARCHAR(140), PRIMARY KEY (id), FOREIGN KEY (accountId) REFERENCES accounts(id), FOREIGN KEY (clanId) REFERENCES clans(id), INDEX clanIdIndex (clanId));"; + private static String CREATE_CLAN_TERRITORY_TABLE = "CREATE TABLE IF NOT EXISTS clanTerritory (id INT NOT NULL AUTO_INCREMENT, clanId INT, serverName VARCHAR(100), chunk VARCHAR(100), safe BOOL, PRIMARY KEY (id), FOREIGN KEY (clanId) REFERENCES clans(id), INDEX clanIdIndex (clanId, serverName));"; + private static String CREATE_CLAN_ALLIANCE_TABLE = "CREATE TABLE IF NOT EXISTS clanAlliances (id INT NOT NULL AUTO_INCREMENT, clanId INT, otherClanId INT, trusted BOOL, PRIMARY KEY (id), FOREIGN KEY (otherClanId) REFERENCES clans(id), FOREIGN KEY (clanId) REFERENCES clans(id), INDEX clanIdIndex (clanId));"; + + private static String RETRIEVE_START_CLAN_INFO = "SELECT id, name, description, home, admin, dateCreated, lastOnline FROM clans AS c INNER JOIN clanTerritory AS ct ON ct.clanId = c.id WHERE serverName = ?;"; + private static String RETRIEVE_CLAN_MEMBER_INFO = "SELECT a.name, role FROM accountClan AS ac INNER JOIN accounts AS a ON a.id = ac.accountId WHERE ac.clanId = ?;"; + private static String RETRIEVE_CLAN_ALLIANCE_INFO = "SELECT cOther.id, cOther.name FROM clanAlliances AS ca INNER JOIN clans AS c ON c.id = ca.clanId INNER JOIN clans as cOther ON cOther.id = ca.otherClanId WHERE ac.clanId = ?;"; + + private String _serverName; + + public ClanRepository(JavaPlugin plugin, String serverName) { super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh"); + + _serverName = serverName; } @Override protected void initialize() { + executeUpdate(CREATE_CLAN_TABLE); + executeUpdate(CREATE_ACCOUNT_CLAN_TABLE); + executeUpdate(CREATE_CLAN_TERRITORY_TABLE); + executeUpdate(CREATE_CLAN_ALLIANCE_TABLE); } + public List retrieveStartupClanInformation() + { + executeQuery(RETRIEVE_START_CLAN_INFO, new ResultSetCallable() + { + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + } + + }, new ColumnVarChar("serverName", 100, _serverName)); + } + @Override protected void update() { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java index 4fc3aa9ca..29b2ac2d9 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/fields/repository/FieldRepository.java @@ -16,9 +16,9 @@ import mineplex.core.database.column.ColumnVarChar; public class FieldRepository extends RepositoryBase { - private static String CREATE_FIELD_BLOCK_TABLE = "CREATE TABLE IF NOT EXISTS fieldBlock (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), blockId INT, blockData TINYINT, emptyId INT, emptyData TINYINT, stockMax INT, stockRegenTime DOUBLE, loot VARCHAR(100) PRIMARY KEY (id), INDEX serverLocation (server, location));"; - private static String CREATE_FIELD_ORE_TABLE = "CREATE TABLE IF NOT EXISTS fieldOre (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), PRIMARY KEY (id), INDEX serverLocation (server, location));"; - private static String CREATE_FIELD_MONSTER_TABLE = "CREATE TABLE IF NOT EXISTS fieldMonster (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), name VARCHAR(100), type VARCHAR(100), mobMax INT, mobRate DOUBLE, center VARCHAR(100), radius INT, height INT PRIMARY KEY (id), INDEX serverName (server, name));"; + private static String CREATE_FIELD_BLOCK_TABLE = "CREATE TABLE IF NOT EXISTS fieldBlock (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), blockId INT, blockData TINYINT, emptyId INT, emptyData TINYINT, stockMax INT, stockRegenTime DOUBLE, loot VARCHAR(100), PRIMARY KEY (id), INDEX serverLocation (server, location));"; + private static String CREATE_FIELD_ORE_TABLE = "CREATE TABLE IF NOT EXISTS fieldOre (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), location VARCHAR(100), PRIMARY KEY (id), INDEX serverLocation (server, location));"; + private static String CREATE_FIELD_MONSTER_TABLE = "CREATE TABLE IF NOT EXISTS fieldMonster (id INT NOT NULL AUTO_INCREMENT, server VARCHAR(100), name VARCHAR(100), type VARCHAR(100), mobMax INT, mobRate DOUBLE, center VARCHAR(100), radius INT, height INT, PRIMARY KEY (id), INDEX serverName (server, name));"; private static String RETRIEVE_FIELD_BLOCKS = "SELECT server, location, blockId, blockData, emptyId, emptyData, stockMax, stockRegen, loot FROM fieldBlock WHERE server = ?;"; private static String ADD_FIELD_BLOCK = "INSERT INTO fieldBlock (server, location, blockId, blockData, emptyId, emptyData, stockMax, stockRegen, loot) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);"; private static String DEL_FIELD_BLOCK = "DELETE FROM fieldBlock WHERE server = ? AND location = ?;";