Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex into wizards

Conflicts:
	Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellLightningStrike.java
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java
This commit is contained in:
libraryaddict 2015-04-11 12:20:29 +12:00
commit afa372dca7
132 changed files with 1865 additions and 761 deletions

View File

@ -17,8 +17,8 @@
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/commons-pool2-2.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jedis-2.4.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/gson-2.2.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.4.2.jar" path-in-jar="/" />
<element id="module-output" name="Mineplex.Database" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" />
</root>
</artifact>
</component>

View File

@ -14,6 +14,7 @@
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.BungeeSigns/Mineplex.Minecraft.BungeeSigns.iml" group="Bungee" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.ClassCombat/Mineplex.Minecraft.Game.ClassCombat.iml" group="Game" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" filepath="$PROJECT_DIR$/Mineplex.Minecraft.Game.Core/Mineplex.Minecraft.Game.Core.iml" group="Game" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" filepath="$PROJECT_DIR$/Mineplex.PlayerCache/Mineplex.PlayerCache.iml" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" filepath="$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" group="Core" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" filepath="$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" group="Core" />
<module fileurl="file://$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" filepath="$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" group="Game" />

View File

@ -6,6 +6,7 @@
package net.minecraft.server.v1_7_R4;
import java.io.IOException;
import java.util.Calendar;
import java.util.Iterator;
import org.bukkit.craftbukkit.v1_7_R4.scoreboard.CraftScoreboard;
@ -16,6 +17,11 @@ import net.minecraft.util.com.mojang.authlib.properties.Property;
import net.minecraft.util.com.mojang.authlib.properties.PropertyMap;
public class PacketPlayOutPlayerInfo extends Packet {
public static final String NOTCH_SKIN = "eyJ0aW1lc3RhbXAiOjE0Mjc4MjgyMzMwNDUsInByb2ZpbGVJZCI6IjA2OWE3OWY0NDRlOTQ3MjZhNWJlZmNhOTBlMzhhYWY1IiwicHJvZmlsZU5hbWUiOiJOb3RjaCIsImlzUHVibGljIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTExNmU2OWE4NDVlMjI3ZjdjYTFmZGRlOGMzNTdjOGM4MjFlYmQ0YmE2MTkzODJlYTRhMWY4N2Q0YWU5NCJ9LCJDQVBFIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Y2ODhlMGU2OTliM2Q5ZmU0NDhiNWJiNTBhM2EyODhmOWM1ODk3NjJiM2RhZTgzMDg4NDIxMjJkY2I4MSJ9fX0=";
public static final String NOTCH_SIGNATURE = "WrBmNqkpkjh6VJY26jOOMNS6oSOPi0MTm9WWc0t4EMUHchUbTd6/1sT2O2zz2s7xwmCeUxuIhvRREa+1bIPzIIbXJLjhxiBWMdTJbQhv6zBb1U2SZb7eb5cYrFTD6rvxy0rOarScxCBdeOXpr1coxrvN8a6VkgLhc/dGhFx0ZmORxELBLFiCNi+4WE//MI+KioAq84Gdf0ltT9ZLWdlHNFV2ynBgcx2MfNTA2lrpdKEUVOYD7xhPoOdHa5d1hzdDxbYPGDgM0FzYjzNUlBx8SLvHEpyBB7XyOsIGnfqrS0ltIDTq82wgLrEwDRncuQN18w6IiQbNK06MZBDyNnIp79mmUYvRj+Zl0dPBrZok2q2uQ08hZ87ufU3jhjY39kr+iEaPYMvfWaBxt3ALjopsZRCGSlEukMzITjeYxhfVKuQ0fhWKRfwWn/Jv2de2h+i+t7nulvN3MV3rJVrS6OXsx87p/vm9biU7Hs07T8VSGONfkxXmsgYEtY6m2egU5pmqFnsKM0MwwnZJ7Sxz2EjiPikoGzJzpv4ncj3rhelIKJKjDk9jSAz7nPzc8/UdOiTrfy4ezr3jFVAVatiKr+kS/HNXHWiCFdufhpG4DVCrSkwkFBJw030pJ6ICVhpuYq5yOswQB5QOp0JDWc2Rdth7SVmvxthSCL9G2ksfm+v7sKw=";
public static final int ADD_PLAYER = 0;
public static final int UPDATE_GAMEMODE = 1;
public static final int UPDATE_LATENCY = 2;
@ -38,6 +44,7 @@ public class PacketPlayOutPlayerInfo extends Packet {
packet.player = player.getProfile();
packet.ping = player.ping;
packet.gamemode = player.playerInteractManager.getGameMode().getId();
packet._tabName = getFormattedName(player);
return packet;
}
@ -87,6 +94,9 @@ public class PacketPlayOutPlayerInfo extends Packet {
public void b(PacketDataSerializer packetdataserializer) throws IOException {
if(packetdataserializer.version >= 20) {
Calendar c = Calendar.getInstance();
packetdataserializer.b(this.action);
packetdataserializer.b(1);
packetdataserializer.writeUUID(this.player.getId());
@ -94,18 +104,43 @@ public class PacketPlayOutPlayerInfo extends Packet {
case 0:
packetdataserializer.a(this.player.getName());
PropertyMap properties = this.player.getProperties();
// April Fools
if (isAprilFools() && properties.size() == 0)
{
// add texture if no textures exist
properties.put("textures", new Property("textures", NOTCH_SKIN, NOTCH_SIGNATURE));
}
packetdataserializer.b(properties.size());
Iterator var3 = properties.values().iterator();
while(var3.hasNext()) {
Property property = (Property)var3.next();
// April Fools
if (isAprilFools() && property.getName().equalsIgnoreCase("textures"))
{
System.out.println("Applying notch texture for : " + property.getName());
System.out.println("Skin: " + property.getValue());
System.out.println("Signature: " + property.getSignature());
packetdataserializer.a(property.getName());
packetdataserializer.a(NOTCH_SKIN);
packetdataserializer.writeBoolean(true);
packetdataserializer.a(NOTCH_SIGNATURE);
}
else
{
packetdataserializer.a(property.getName());
packetdataserializer.a(property.getValue());
packetdataserializer.writeBoolean(property.hasSignature());
if(property.hasSignature()) {
packetdataserializer.a(property.getSignature());
}
}
}
packetdataserializer.b(this.gamemode);
packetdataserializer.b(this.ping);
@ -149,6 +184,8 @@ public class PacketPlayOutPlayerInfo extends Packet {
{
String name = player.getName();
if (isAprilFools()) name = "Notch";
CraftScoreboard scoreboard = player.getBukkitEntity().getScoreboard();
if (scoreboard != null)
{
@ -159,4 +196,12 @@ public class PacketPlayOutPlayerInfo extends Packet {
return name;
}
public static boolean isAprilFools()
{
Calendar c = Calendar.getInstance();
// return true;
return c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1;
}
}

View File

@ -13,5 +13,6 @@
<orderEntry type="module" module-name="Mineplex.ServerData" />
<orderEntry type="library" name="httpcore" level="project" />
<orderEntry type="library" name="httpclient" level="project" />
<orderEntry type="module" module-name="Mineplex.PlayerCache" />
</component>
</module>

View File

@ -11,10 +11,12 @@ import mineplex.serverdata.data.Data;
*/
public class GlobalMotd implements Data
{
// The unique name representing this MOTD set
private String _name;
private String _headline;
public String getHeadline() { return _headline; }
// List of lines describing the MOTD
private List<String> _motd;
public List<String> getMotd() { return _motd; }
@ -24,9 +26,10 @@ public class GlobalMotd implements Data
* @param name
* @param motd
*/
public GlobalMotd(String name, List<String> motd)
public GlobalMotd(String name, String headline, List<String> motd)
{
_name = name;
_headline = headline;
_motd = motd;
}

View File

@ -5,7 +5,6 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import mineplex.serverdata.Region;
import mineplex.serverdata.data.BungeeServer;
import mineplex.serverdata.data.DataRepository;
import mineplex.serverdata.redis.RedisDataRepository;
import mineplex.serverdata.servers.ServerManager;
@ -23,7 +22,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory
private DataRepository<GlobalMotd> _repository;
private String firstLine = " §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r";
private String _firstLine = " §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r";
private List<String> _motdLines;
public MotdManager(Plugin plugin)
@ -35,6 +34,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory
_repository = new RedisDataRepository<GlobalMotd>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
Region.ALL, GlobalMotd.class, "globalMotd");
run();
}
@EventHandler
@ -42,7 +42,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory
{
net.md_5.bungee.api.ServerPing serverPing = event.getResponse();
String motd = firstLine;
String motd = _firstLine;
if (_motdLines != null && _motdLines.size() > 0)
{
motd += "\n" + _motdLines.get(0);
@ -55,19 +55,31 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory
public void run()
{
// Add in default MOTD listing to database
/*
if (!_repository.elementExists("MainMotd"))
{
_repository.removeElement("MainMotd");
List<String> lines = new ArrayList<String>();
lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); // TODO: Implement in-game command to update MOTD?
lines.add(" §a§lDouble Gems for 1.8 Players!");
lines.add(" §e§lChampions Update §a§lBalance Patch");
lines.add(" §6§lSpecial Egg Baskets!");
lines.add(" §e§lBunny Morph §a§lLimited Time!");
lines.add(" §d§lHero Sale §a§l33% Off");
lines.add(" §e§lSurvival Games §a§lBIG UPDATE!");
lines.add(" §a§lDouble Gems for 1.8 Players!");
updateMainMotd(lines);
updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines);
}
*/
GlobalMotd motd = _repository.getElement("MainMotd");
if (motd != null)
{
_motdLines = motd.getMotd();
_firstLine = motd.getHeadline();
}
_motdLines = _repository.getElement("MainMotd").getMotd(); // Update MOTD lines
InitialHandler.setCustomMotdFactory(this);
}
@ -75,9 +87,9 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory
* Update the main {@link GlobalMotd} determining the MOTD for Bungee instances.
* @param motdLines - the lines to update the MOTD to.
*/
public void updateMainMotd(List<String> motdLines)
public void updateMainMotd(String headline, List<String> motdLines)
{
_repository.addElement(new GlobalMotd("MainMotd", motdLines));
_repository.addElement(new GlobalMotd("MainMotd", headline, motdLines));
}
public List<String> getMotdLines()

View File

@ -14,14 +14,15 @@ public enum Rank
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
MODERATOR("Mod", ChatColor.GOLD),
HELPER("Helper", ChatColor.DARK_AQUA),
MAPDEV("Mapper", ChatColor.BLUE),
MAPLEAD("MapKing", ChatColor.DARK_PURPLE),
MAPDEV("MapTeam", ChatColor.BLUE),
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
EVENT("Event", ChatColor.WHITE),
//Staff ^^
YOUTUBE("YouTube", ChatColor.RED),
TWITCH("Twitch", ChatColor.DARK_PURPLE),
LEGEND("Legend", ChatColor.GREEN),
HERO("Hero", ChatColor.LIGHT_PURPLE),
ULTRA("Ultra", ChatColor.AQUA),

View File

@ -627,4 +627,9 @@ public class UtilEnt
return null;
}
public static boolean inWater(LivingEntity ent)
{
return ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9;
}
}

View File

@ -79,11 +79,16 @@ public class UtilInv
for (ItemStack stack : getItems(player, checkArmor, checkCursor))
{
if (required <= 0)
{
return true;
}
if (stack == null)
continue;
if (stack.getType() != item)
continue;
if (stack.getAmount() <= 0)
continue;

View File

@ -220,7 +220,13 @@ public class CoreClientManager extends MiniPlugin
if (client.getAccountId() > 0)
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()));
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable()
{
public void run()
@ -230,14 +236,6 @@ public class CoreClientManager extends MiniPlugin
}
});
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
runnable.run();
}
}
});
}

View File

@ -52,7 +52,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
final Rank rank = tempRank;
if ((rank == Rank.YOUTUBE && Plugin.Get(caller).GetRank().Has(Rank.OWNER)) || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
if (rank == Rank.YOUTUBE || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
{
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
{

View File

@ -102,6 +102,8 @@ public class AntiHack extends MiniPlugin
_movementDetectors.add(new Speed(this));
_combatDetectors.add(new Reach(this));
_enabled = false;
}
public static void Initialize(JavaPlugin plugin, Punish punish, Portal portal, PreferencesManager preferences, CoreClientManager clientManager)

View File

@ -30,7 +30,7 @@ public class Reach extends MiniPlugin implements Detector
public Reach (AntiHack host)
{
super("Speed Detector", host.getPlugin());
super("Reach Detector", host.getPlugin());
Host = host;
}

View File

@ -0,0 +1,203 @@
package mineplex.core.aprilfools;
import java.util.Calendar;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.disguise.disguises.DisguiseCow;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class AprilFoolsManager extends MiniPlugin
{
public static AprilFoolsManager Instance;
private boolean _enabled;
private DisguiseManager _disguiseManager;
private CoreClientManager _clientManager;
protected AprilFoolsManager(JavaPlugin plugin, CoreClientManager clientManager, DisguiseManager disguiseManager)
{
super("April Fools", plugin);
_disguiseManager = disguiseManager;
_clientManager = clientManager;
Calendar c = Calendar.getInstance();
_enabled = (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1);
}
public static void Initialize(JavaPlugin plugin, CoreClientManager clientManager, DisguiseManager disguiseManager)
{
Instance = new AprilFoolsManager(plugin, clientManager, disguiseManager);
}
@EventHandler
public void updateEnabled(UpdateEvent event)
{
if (event.getType() != UpdateType.SLOW)
return;
Calendar c = Calendar.getInstance();
_enabled = (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1);
}
@EventHandler(priority = EventPriority.LOW)
public void chatAdd(AsyncPlayerChatEvent event)
{
if (!_enabled)
return;
String[] words = event.getMessage().split(" ");
String out = "";
for (String word : words)
{
//Prefix
if (Math.random() > 0.85)
{
out += "moo";
for (int i=0 ; i<UtilMath.r(2) ; i++)
out += "o";
out += " " + word + " ";
}
//Suffix
else if (Math.random() > 0.85)
{
out += word + " ";
out += "moo";
for (int i=0 ; i<UtilMath.r(2) ; i++)
out += "o";
out += " ";
}
//Swap
else if (Math.random() > 0.99)
{
out += "moo";
for (int i=3 ; i<word.length() ; i++)
out += "o";
out += " ";
}
else
{
out += word + " ";
}
}
event.setMessage(out);
}
@EventHandler
public void updateText(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.SLOW)
return;
if (Math.random() <= 0.99)
return;
UtilTextMiddle.display("Moo", null, 5, 20, 5);
}
@EventHandler
public void updateCow(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.FAST)
return;
//Disguise
for (Player player : UtilServer.getPlayers())
{
if (_disguiseManager.getDisguise(player) != null)
{
//Moo
if (Math.random() > 0.8)
{
if (_disguiseManager.getDisguise(player) instanceof DisguiseCow)
{
player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, (float)Math.random() + 0.5f, (float)Math.random() + 0.5f);
}
}
continue;
}
//Disguise
DisguiseCow disguise = new DisguiseCow(player);
disguise.setName(getName(player), _clientManager.Get(player).GetRank());
disguise.setCustomNameVisible(true);
_disguiseManager.disguise(disguise);
}
}
public boolean isActive()
{
return _enabled;
}
public String getName(Player player)
{
//Name
int index = 0;
boolean hitVowel = false;
for (int i=0 ; i<player.getName().length()-2 && i<5 ; i++)
{
//Detect vowel ;o
if (player.getName().toLowerCase().charAt(i) == 'a' ||
player.getName().toLowerCase().charAt(i) == 'e' ||
player.getName().toLowerCase().charAt(i) == 'i' ||
player.getName().toLowerCase().charAt(i) == 'o' ||
player.getName().toLowerCase().charAt(i) == 'u')
{
hitVowel = true;
}
//Post vowel consonant - stop here
else if (hitVowel)
{
break;
}
index = i+1;
}
String name = "Moo" + player.getName().substring(index, player.getName().length());
if (name.length() > 16)
name = name.substring(0, 16);
return name;
}
public void setEnabled(boolean b)
{
Calendar c = Calendar.getInstance();
_enabled = b && (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1);
}
}

View File

@ -6,6 +6,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import net.minecraft.server.v1_7_R4.Block;
@ -17,6 +18,7 @@ import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent;
import net.minecraft.server.v1_7_R4.EntityPlayer;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutBed;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityStatus;
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunk;
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk;
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
@ -28,6 +30,7 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove;
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect;
@ -62,6 +65,7 @@ import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseInsentient;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.disguise.disguises.DisguiseRabbit;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.packethandler.PacketVerifier;
@ -80,6 +84,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
private NautHashMap<DisguiseBase, HashSet<Player>> _disguisePlayerMap = new NautHashMap<DisguiseBase, HashSet<Player>>();
private HashSet<String> _blockedNames = new HashSet<String>();
private NautHashMap<Integer, Entry<DisguiseBase, Player[]>> _futureDisguises = new NautHashMap<Integer, Entry<DisguiseBase, Player[]>>();
private NautHashMap<Integer, NautHashMap<Integer, Long>> _lastRabbitHop = new NautHashMap<Integer, NautHashMap<Integer, Long>>();
private boolean _handlingPacket = false;
@ -93,6 +98,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
private Field _bedD;
private Field _xChunk;
private Field _zChunk;
private Field _eStatusId;
private Field _eStatusState;
private Chunk _bedChunk;
private boolean _bedPackets;
@ -121,6 +128,10 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
_bedB.setAccessible(true);
_bedD = PacketPlayOutBed.class.getDeclaredField("d");
_bedD.setAccessible(true);
_eStatusId = PacketPlayOutEntityStatus.class.getDeclaredField("a");
_eStatusId.setAccessible(true);
_eStatusState = PacketPlayOutEntityStatus.class.getDeclaredField("b");
_eStatusState.setAccessible(true);
_bedChunk = new Chunk(null, 0, 0);
Field cSection = Chunk.class.getDeclaredField("sections");
@ -221,6 +232,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
disguise.setEntity(event.GetEntity());
_spawnPacketMap.put(event.GetEntity().getEntityId(), disguise);
_entityDisguiseMap.remove(event.GetEntity().getUniqueId().toString());
if (disguise instanceof DisguiseRabbit)
{
_lastRabbitHop.put(disguise.GetEntityId(), new NautHashMap<Integer, Long>());
}
}
}
@ -325,6 +341,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
{
_entityDisguiseMap.put(entity.getUniqueId().toString(), _spawnPacketMap.get(entity.getEntityId()));
_spawnPacketMap.remove(entity.getEntityId());
_lastRabbitHop.remove(entity.getEntityId());
}
}
}
@ -374,6 +391,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
_spawnPacketMap.put(disguise.GetEntityId(), disguise);
_disguisePlayerMap.put(disguise, new HashSet<Player>());
if (disguise instanceof DisguiseRabbit)
{
_lastRabbitHop.put(disguise.GetEntityId(), new NautHashMap<Integer, Long>());
}
for (Player player : players)
addViewerToDisguise(disguise, player, false);
@ -513,6 +535,63 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
final Player owner = packetInfo.getPlayer();
final PacketVerifier packetVerifier = packetInfo.getVerifier();
if (UtilPlayer.is1_8(owner)
&& (packet instanceof PacketPlayOutRelEntityMoveLook || packet instanceof PacketPlayOutRelEntityMove))
{
int entityId = -1;
if (packet instanceof PacketPlayOutRelEntityMoveLook)
{
entityId = ((PacketPlayOutRelEntityMoveLook) packet).a;
}/*
else if (packet instanceof PacketPlayOutEntityLook)
{
entityId = ((PacketPlayOutEntityLook) packet).a;
}*/
else if (packet instanceof PacketPlayOutRelEntityMove)
{
PacketPlayOutRelEntityMove rPacket = (PacketPlayOutRelEntityMove) packet;
if (rPacket.b != 0 || rPacket.c != 0 || rPacket.d != 0)
{
entityId = rPacket.a;
}
}
/*else if (packet instanceof PacketPlayOutEntityTeleport)
{
entityId = ((PacketPlayOutEntityTeleport) packet).a;
}*/
if (_lastRabbitHop.containsKey(entityId))
{
NautHashMap<Integer, Long> rabbitHops = _lastRabbitHop.get(entityId);
if (rabbitHops != null)
{
long last = rabbitHops.containsKey(owner.getEntityId()) ? System.currentTimeMillis()
- rabbitHops.get(owner.getEntityId()) : 1000;
if (last > 500 || last < 100)
{
rabbitHops.put(owner.getEntityId(), System.currentTimeMillis());
PacketPlayOutEntityStatus entityStatus = new PacketPlayOutEntityStatus();
try
{
_eStatusId.set(entityStatus, entityId);
_eStatusState.set(entityStatus, (byte) 1);
handlePacket(entityStatus, packetVerifier);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}
}
}
if (packet instanceof PacketPlayOutPlayerInfo)
{
if (_blockedNames.contains(((PacketPlayOutPlayerInfo) packet).username))
@ -520,10 +599,23 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
packetInfo.setCancelled(true);
}
}
else if (packet instanceof PacketPlayOutSpawnEntity || packet instanceof PacketPlayOutNamedEntitySpawn)
else if (packet instanceof PacketPlayOutSpawnEntity || packet instanceof PacketPlayOutSpawnEntityLiving
|| packet instanceof PacketPlayOutNamedEntitySpawn)
{
int entityId = packet instanceof PacketPlayOutSpawnEntity ? ((PacketPlayOutSpawnEntity) packet).a
: ((PacketPlayOutNamedEntitySpawn) packet).a;
int entityId = -1;
if (packet instanceof PacketPlayOutSpawnEntity)
{
entityId = ((PacketPlayOutSpawnEntity) packet).a;
}
else if (packet instanceof PacketPlayOutSpawnEntityLiving)
{
entityId = ((PacketPlayOutSpawnEntityLiving) packet).a;
}
else if (packet instanceof PacketPlayOutNamedEntitySpawn)
{
entityId = ((PacketPlayOutNamedEntitySpawn) packet).a;
}
if (_futureDisguises.containsKey(entityId))
{
@ -737,6 +829,12 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
private void handleSpawnPackets(PacketInfo packetInfo, DisguiseBase disguise)
{
final Player player = packetInfo.getPlayer();
if (!UtilPlayer.is1_8(player) && disguise instanceof DisguiseRabbit)
{
return;
}
final PacketVerifier packetVerifier = packetInfo.getVerifier();
if (disguise instanceof DisguisePlayer)
@ -795,55 +893,13 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
{
_disguisePlayerMap.get(disguise).remove(event.getPlayer());
}
}
/*public void reApplyDisguise(final DisguiseBase disguise, final Player player)
for (Integer disguise : _lastRabbitHop.keySet())
{
PacketPlayOutEntityDestroy destroyPacket = new PacketPlayOutEntityDestroy(disguise.GetEntityId());
if (disguise.GetEntity() == ((CraftPlayer) player).getHandle())
return;
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
entityPlayer.playerConnection.sendPacket(destroyPacket);
List<Packet> tempArmor = new ArrayList<Packet>();
if (disguise instanceof DisguiseInsentient && disguise.GetEntity() instanceof LivingEntity)
{
if (((DisguiseInsentient) disguise).armorVisible())
{
for (Packet armorPacket : ((DisguiseInsentient) disguise).getArmorPackets())
tempArmor.add(armorPacket);
_lastRabbitHop.get(disguise).remove(event.getPlayer().getEntityId());
}
}
final List<Packet> armorPackets = tempArmor;
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
{
public void run()
{
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
entityPlayer.playerConnection.sendPacket(disguise.GetSpawnPacket());
if (disguise instanceof DisguisePlayer && ((DisguisePlayer) disguise).getSleepingDirection() != null)
{
for (Packet packet : getBedPackets(player.getLocation(), (DisguisePlayer) disguise))
{
entityPlayer.playerConnection.sendPacket(packet);
}
}
for (Packet packet : armorPackets)
{
entityPlayer.playerConnection.sendPacket(packet);
}
}
});
}*/
private void prepareChunk(Location loc)
{
int chunkX = getChunk(loc.getX());
@ -1007,6 +1063,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
if (!_spawnPacketMap.containsKey(entity.getEntityId()))
return;
_lastRabbitHop.remove(entity.getEntityId());
DisguiseBase disguise = _spawnPacketMap.remove(entity.getEntityId());
Collection<? extends Player> players = (disguise.Global ? Bukkit.getOnlinePlayers() : _disguisePlayerMap.remove(disguise));
@ -1054,4 +1111,34 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
entityPlayer.playerConnection.sendPacket(disguise.GetMetaDataPacket());
}
}
@EventHandler
public void cleanDisguises(UpdateEvent event)
{
if (event.getType() != UpdateType.SLOWER || _disguisePlayerMap.isEmpty())
return;
for (Iterator<DisguiseBase> disguiseIterator = _disguisePlayerMap.keySet().iterator(); disguiseIterator.hasNext();)
{
DisguiseBase disguise = disguiseIterator.next();
if (!(disguise.GetEntity() instanceof EntityPlayer))
continue;
EntityPlayer disguisedPlayer = (EntityPlayer)disguise.GetEntity();
if (Bukkit.getPlayerExact(disguisedPlayer.getName()) == null || !disguisedPlayer.isAlive() || !disguisedPlayer.valid)
disguiseIterator.remove();
else
{
for (Iterator<Player> playerIterator = _disguisePlayerMap.get(disguise).iterator(); playerIterator.hasNext();)
{
Player player = playerIterator.next();
if (!player.isOnline() || !player.isValid())
playerIterator.remove();
}
}
}
}
}

View File

@ -1,5 +1,7 @@
package mineplex.core.disguise.disguises;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
@ -31,7 +33,11 @@ public class DisguisePlayer extends DisguiseHuman
public void setProfile(GameProfile profile)
{
_profile = profile;
GameProfile newProfile = new GameProfile(UUID.randomUUID(), profile.getName());
newProfile.getProperties().putAll(profile.getProperties());
_profile = newProfile;
}
public BlockFace getSleepingDirection()

View File

@ -0,0 +1,80 @@
package mineplex.core.disguise.disguises;
import net.minecraft.server.v1_7_R4.EnumEntitySize;
import net.minecraft.server.v1_7_R4.MathHelper;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
public class DisguiseRabbit extends DisguiseInsentient
{
public DisguiseRabbit(org.bukkit.entity.Entity entity)
{
super(entity);
DataWatcher.a(4, Byte.valueOf((byte) 0));
DataWatcher.a(12, (byte) 0);
DataWatcher.a(15, Byte.valueOf((byte) 0));
DataWatcher.a(18, Byte.valueOf((byte) 0));
}
@Override
public Packet GetSpawnPacket()
{
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
packet.a = Entity.getId();
packet.b = (byte) 101;
packet.c = (int) EnumEntitySize.SIZE_2.a(Entity.locX);
packet.d = (int) MathHelper.floor(Entity.locY * 32.0D);
packet.e = (int) EnumEntitySize.SIZE_2.a(Entity.locZ);
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
double var2 = 3.9D;
double var4 = 0;
double var6 = 0;
double var8 = 0;
if (var4 < -var2)
{
var4 = -var2;
}
if (var6 < -var2)
{
var6 = -var2;
}
if (var8 < -var2)
{
var8 = -var2;
}
if (var4 > var2)
{
var4 = var2;
}
if (var6 > var2)
{
var6 = var2;
}
if (var8 > var2)
{
var8 = var2;
}
packet.f = (int) (var4 * 8000.0D);
packet.g = (int) (var6 * 8000.0D);
packet.h = (int) (var8 * 8000.0D);
packet.l = DataWatcher;
packet.m = DataWatcher.b();
return packet;
}
}

View File

@ -251,22 +251,35 @@ public class DonationManager extends MiniDbClientPlugin<Donor>
if (event.getType() != UpdateType.SLOWER)
return;
for (Player player : _coinQueue.keySet())
for (final Player player : _coinQueue.keySet())
{
String caller = null;
int total = 0;
String tempCaller = null;
int tempTotal = 0;
for (String curCaller : _coinQueue.get(player).keySet())
{
caller = curCaller;
total += _coinQueue.get(player).get(curCaller);
tempCaller = curCaller;
tempTotal += _coinQueue.get(player).get(curCaller);
}
final int total = tempTotal;
final String caller = tempCaller;
if (caller == null)
continue;
//Actually Add Gems
if (player.isOnline() && player.isValid())
RewardCoins(null, caller, player.getName(), ClientManager.Get(player).getAccountId(), total, false);
else
{
Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
{
public void run()
{
RewardCoins(null, caller, player.getName(), ClientManager.getCachedClientAccountId(player.getUniqueId()), total, false);
}
});
}
System.out.println("Queue Added [" + player + "] with Coins [" + total + "] for [" + caller + "]");

View File

@ -16,6 +16,7 @@ import mineplex.core.common.util.NautHashMap;
import mineplex.core.database.DBPool;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.ResultSetCallable;
import mineplex.core.database.column.ColumnInt;
import mineplex.core.database.column.ColumnVarChar;
import mineplex.core.friend.FriendStatusType;
import mineplex.serverdata.Region;
@ -26,11 +27,8 @@ import mineplex.serverdata.servers.ServerManager;
public class FriendRepository extends RepositoryBase
{
private static String CREATE_FRIEND_TABLE = "CREATE TABLE IF NOT EXISTS accountFriend (id INT NOT NULL AUTO_INCREMENT, uuidSource VARCHAR(100), uuidTarget VARCHAR(100), status VARCHAR(100), PRIMARY KEY (id), UNIQUE INDEX uuidIndex (uuidSource, uuidTarget));";
private static String RETRIEVE_MULTIPLE_FRIEND_RECORDS = "SELECT uuidSource, tA.Name, status, tA.lastLogin, now() FROM accountFriend INNER Join accounts AS fA ON fA.uuid = uuidSource INNER JOIN accounts AS tA ON tA.uuid = uuidTarget WHERE uuidSource IN ";
private static String ADD_FRIEND_RECORD = "INSERT INTO accountFriend (uuidSource, uuidTarget, status, created) SELECT fA.uuid AS uuidSource, tA.uuid AS uuidTarget, ?, now() FROM accounts as fA LEFT JOIN accounts AS tA ON tA.name = ? WHERE fA.name = ?;";
private static String UPDATE_MUTUAL_RECORD = "UPDATE accountFriend AS aF INNER JOIN accounts as fA ON aF.uuidSource = fA.uuid INNER JOIN accounts AS tA ON aF.uuidTarget = tA.uuid SET aF.status = ? WHERE tA.name = ? AND fA.name = ?;";
private static String DELETE_FRIEND_RECORD = "DELETE aF FROM accountFriend AS aF INNER JOIN accounts as fA ON aF.uuidSource = fA.uuid INNER JOIN accounts AS tA ON aF.uuidTarget = tA.uuid WHERE fA.name = ? AND tA.name = ?;";
private static String ADD_FRIEND_RECORD = "INSERT INTO accountFriend (sourceId, targetId) VALUES(?, ?);";
private static String DELETE_FRIEND_RECORD = "DELETE FROM accountFriend WHERE id = ?;";
// Repository holding active PlayerStatus data.
private DataRepository<PlayerStatus> _repository;
@ -54,29 +52,14 @@ public class FriendRepository extends RepositoryBase
{
}
public boolean addFriend(final Player caller, String name)
public boolean addFriend(int sourceAccountId, int targetAccountId)
{
int rowsAffected = executeUpdate(ADD_FRIEND_RECORD, new ColumnVarChar("status", 100, "Sent"), new ColumnVarChar("name", 100, name), new ColumnVarChar("name", 100, caller.getName()));
if (rowsAffected > 0)
return executeUpdate(ADD_FRIEND_RECORD, new ColumnVarChar("status", 100, "Pending"), new ColumnVarChar("name", 100, caller.getName()), new ColumnVarChar("uuid", 100, name)) > 0;
return false;
return executeUpdate(ADD_FRIEND_RECORD, new ColumnInt("sourceId", sourceAccountId), new ColumnInt("targetId", targetAccountId)) > 0;
}
public boolean updateFriend(String caller, String name, String status)
public boolean removeFriendRecord(int recordId)
{
return executeUpdate(UPDATE_MUTUAL_RECORD, new ColumnVarChar("status", 100, status), new ColumnVarChar("uuid", 100, name), new ColumnVarChar("name", 100, caller)) > 0;
}
public boolean removeFriend(String caller, String name)
{
int rowsAffected = executeUpdate(DELETE_FRIEND_RECORD, new ColumnVarChar("name", 100, name), new ColumnVarChar("name", 100, caller));
if (rowsAffected > 0)
return executeUpdate(DELETE_FRIEND_RECORD, new ColumnVarChar("name", 100, caller), new ColumnVarChar("uuid", 100, name)) > 0;
return false;
return executeUpdate(DELETE_FRIEND_RECORD, new ColumnInt("id", recordId)) > 0;
}
public NautHashMap<String, FriendData> getFriendsForAll(Player...players)
@ -84,7 +67,7 @@ public class FriendRepository extends RepositoryBase
final NautHashMap<String, FriendData> friends = new NautHashMap<String, FriendData>();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(RETRIEVE_MULTIPLE_FRIEND_RECORDS + "(");
//stringBuilder.append(RETRIEVE_MULTIPLE_FRIEND_RECORDS + "(");
for (Player player : players)
{

View File

@ -119,6 +119,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new MorphBlaze(this));
//addGadget(new MorphGeno(this));
addGadget(new MorphWither(this));
addGadget(new MorphBunny(this));
// Particles
addGadget(new ParticleFoot(this));

View File

@ -46,7 +46,7 @@ public class ItemFleshHook extends ItemGadget implements IThrown
1.6, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 2d);
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.5f);
//Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));

View File

@ -58,7 +58,7 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
1, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 2d);
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
//Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));

View File

@ -115,7 +115,7 @@ public class MorphBat extends MorphGadget implements IThrown
0.01, true, -0.3, 0, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 3d);
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
//Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill("Poop") + "."));

View File

@ -0,0 +1,253 @@
package mineplex.core.gadget.gadgets;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ItemDespawnEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseRabbit;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class MorphBunny extends MorphGadget
{
private HashSet<Player> _jumpCharge = new HashSet<Player>();
private HashMap<Item, String> _eggs = new HashMap<Item, String>();
public MorphBunny(GadgetManager manager)
{
super(manager, "Easter Bunny Morph", new String[]
{
C.cWhite + "Happy Easter!",
" ",
C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg",
" ",
C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" ,
" ",
C.cPurple + "Special Limited Time Morph",
C.cPurple + "Purchase at www.mineplex.com/shop",
},
-1,
Material.MONSTER_EGG, (byte)98);
}
@Override
public void EnableCustom(final Player player)
{
this.ApplyArmor(player);
DisguiseRabbit disguise = new DisguiseRabbit(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
disguise.setCustomNameVisible(true);
Manager.getDisguiseManager().disguise(disguise);
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 999999999, 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 999999999, 1));
}
@Override
public void DisableCustom(Player player)
{
_jumpCharge.remove(player);
this.RemoveArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.removePotionEffect(PotionEffectType.SPEED);
player.removePotionEffect(PotionEffectType.JUMP);
}
@EventHandler
public void jumpTrigger(PlayerToggleSneakEvent event)
{
Player player = event.getPlayer();
if (!IsActive(player))
return;
//Start
if (!event.getPlayer().isSneaking())
{
if (UtilEnt.isGrounded(event.getPlayer()))
_jumpCharge.add(event.getPlayer());
}
//Jump
else if (_jumpCharge.remove(event.getPlayer()))
{
float power = player.getExp();
player.setExp(0f);
UtilAction.velocity(player, power * 4, 0.4, 4, true);
player.getWorld().playSound(player.getLocation(), Sound.CAT_HIT, 0.75f, 2f);
}
}
@EventHandler
public void jumpBoost(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<Player> jumpIter = _jumpCharge.iterator();
while (jumpIter.hasNext())
{
Player player = jumpIter.next();
if (!player.isValid() || !player.isOnline() || !player.isSneaking())
{
jumpIter.remove();
continue;
}
player.setExp(Math.min(0.9999f, player.getExp() + 0.03f));
player.playSound(player.getLocation(), Sound.FIZZ, 0.25f + player.getExp() * 0.5f, 0.5f + player.getExp());
}
}
@EventHandler
public void eggHide(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (!IsActive(player))
return;
if (!UtilEvent.isAction(event, ActionType.L))
return;
if (Manager.getDonationManager().Get(player.getName()).GetBalance(CurrencyType.Coins) < 500)
{
UtilPlayer.message(player, F.main("Gadget", "You do not have enough Coins."));
return;
}
if (!Recharge.Instance.use(player, "Hide Egg", 30000, true, false))
return;
//Color
//Item
ItemStack eggStack = ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte)0, 1, "Hidden Egg" + System.currentTimeMillis());
eggStack.setDurability((short) 98);
Item egg = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), eggStack);
UtilAction.velocity(egg, player.getLocation().getDirection(), 0.2, false, 0, 0.2, 1, false);
Manager.getDonationManager().RewardCoinsLater(this.GetName() + " Egg Hide", player, -500);
egg.setPickupDelay(40);
_eggs.put(egg, player.getName());
//Announce
Bukkit.broadcastMessage(C.cYellow + C.Bold + player.getName() +
ChatColor.RESET + C.Bold + " hid an " +
C.cYellow + C.Bold + "Easter Egg" +
ChatColor.RESET + C.Bold + " worth " +
C.cYellow + C.Bold + "450 Coins");
for (Player other : UtilServer.getPlayers())
other.playSound(other.getLocation(), Sound.CAT_HIT, 1.5f, 1.5f);
}
@EventHandler
public void eggPickup(PlayerPickupItemEvent event)
{
if (_eggs.containsKey(event.getItem()) && !_eggs.get(event.getItem()).equals(event.getPlayer().getName()))
{
_eggs.remove(event.getItem());
event.setCancelled(true);
event.getItem().remove();
Manager.getDonationManager().RewardCoinsLater(GetName() + " Egg Pickup", event.getPlayer(), 450);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1.5f, 0.75f);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1.5f, 1.25f);
UtilFirework.playFirework(event.getItem().getLocation(), Type.BURST, Color.YELLOW, true, true);
//Announce
Bukkit.broadcastMessage(C.cGold + C.Bold + event.getPlayer().getName() +
ChatColor.RESET + C.Bold + " found an " +
C.cGold + C.Bold + "Easter Egg" +
ChatColor.RESET + C.Bold + "! " + _eggs.size() + " Eggs left!");
}
}
@EventHandler
public void eggClean(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
Iterator<Item> eggIter = _eggs.keySet().iterator();
while (eggIter.hasNext())
{
Item egg = eggIter.next();
if (!egg.isValid() || egg.getTicksLived() > 24000)
{
egg.remove();
eggIter.remove();
//Announce
Bukkit.broadcastMessage(
ChatColor.RESET + C.Bold + "No one found an " +
C.cGold + C.Bold + "Easter Egg" +
ChatColor.RESET + C.Bold + "! " + _eggs.size() + " Eggs left!");
}
else
{
UtilParticle.PlayParticle(ParticleType.SPELL, egg.getLocation().add(0, 0.1, 0), 0.1f, 0.1f, 0.1f, 0, 1);
}
}
}
@EventHandler
public void eggDespawnCancel(ItemDespawnEvent event)
{
if (_eggs.containsKey(event.getEntity()))
event.setCancelled(true);
}
}

View File

@ -98,7 +98,7 @@ public class MorphVillager extends MorphGadget implements IThrown
//Throw
Manager.getProjectileManager().AddThrow(gem, player, this, -1, true, true, true,
null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 2d);
null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 0.5f);
Manager.getDonationManager().RewardGems(null, this.GetName() + " Throw", player.getName(), player.getUniqueId(), -20);

View File

@ -34,7 +34,7 @@ public class ParticleBlizzard extends ParticleGadget
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
" ",
C.cPurple + "Purchased at www.mineplex.com/shop",
C.cPurple + "No longer available",
},
-1,
Material.SNOW_BALL, (byte)0);

View File

@ -31,54 +31,46 @@ public class ProjectileManager extends MiniPlugin
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, double hitboxMult)
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, float hitboxGrow)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false,
null, 1f, 1f, null, 0, null, null, hitboxMult, null));
null, 1f, 1f, null, 0, null, null, hitboxGrow));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, double hitboxMult, DisguiseManager disguise)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false,
null, 1f, 1f, null, 0, null, null, hitboxMult, disguise));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, double hitboxMult)
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, pickup,
null, 1f, 1f, null, 0, null, null, hitboxMult, null));
null, 1f, 1f, null, 0, null, null, hitboxGrow));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , double hitboxMult)
Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxMult, null));
sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxGrow));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, double hitboxMult)
Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxMult, null));
sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxGrow));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, double hitboxMult)
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, hitboxMult, null));
sound, soundVolume, soundPitch, null, 0, effectRate, particle, hitboxMult));
}
@EventHandler

View File

@ -3,6 +3,7 @@ package mineplex.core.projectile;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
@ -48,14 +49,14 @@ public class ProjectileUser
private int _effectData = 0;
private UpdateType _effectRate = UpdateType.TICK;
private DisguiseManager _disguise;
private double _hitboxGrow;
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup,
Sound sound, float soundVolume, float soundPitch,
Effect effect, int effectData, UpdateType effectRate,
ParticleType particle,
double hitboxMult, DisguiseManager disguise)
double hitboxMult)
{
Throw = throwInput;
@ -77,7 +78,7 @@ public class ProjectileUser
_effectData = effectData;
_effectRate = effectRate;
_disguise = disguise;
_hitboxGrow = hitboxMult;
}
public void Effect(UpdateEvent event)
@ -104,6 +105,8 @@ public class ProjectileUser
return true;
}
if (_hitPlayer)
{
double distanceToEntity = 0.0D;
LivingEntity victim = null;
@ -120,7 +123,11 @@ public class ProjectileUser
vec3d1 = Vec3D.a(finalObjectPosition.pos.a, finalObjectPosition.pos.b, finalObjectPosition.pos.c);
}
for (Object entity : ((CraftWorld)_thrown.getWorld()).getHandle().getEntities(((CraftEntity)_thrown).getHandle(), ((CraftEntity)_thrown).getHandle().boundingBox.a(((CraftEntity)_thrown).getHandle().motX, ((CraftEntity)_thrown).getHandle().motY, ((CraftEntity)_thrown).getHandle().motZ).grow(1.0D, 1.0D, 1.0D)))
for (Object entity : ((CraftWorld)_thrown.getWorld()).getHandle().getEntities(((CraftEntity)_thrown).getHandle(),
((CraftEntity)_thrown).getHandle().boundingBox.a(
((CraftEntity)_thrown).getHandle().motX,
((CraftEntity)_thrown).getHandle().motY,
((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxGrow, _hitboxGrow, _hitboxGrow)))
{
if (entity instanceof net.minecraft.server.v1_7_R4.Entity)
{
@ -139,19 +146,15 @@ public class ProjectileUser
if (((Player)ent).getGameMode() == GameMode.CREATIVE || UtilPlayer.isSpectator(ent))
continue;
EntityType disguise = null;
if (_disguise != null && _disguise.getDisguise(ent) != null)
{
if (_disguise.getDisguise(ent) instanceof DisguiseSquid)
disguise = EntityType.SQUID;
}
float f1 = (float)(nmsEntity.boundingBox.a() * .6);
AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(f1, f1, f1);
//float f1 = (float)(nmsEntity.boundingBox.a() * 0.6f);
AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(1F, 1F, 1F);
MovingObjectPosition entityCollisionPosition = axisalignedbb1.a(vec3d, vec3d1);
if (entityCollisionPosition != null)
{
if (_thrower instanceof Player)
((Player)_thrower).playSound(_thrower.getLocation(), Sound.ORB_PICKUP, 1f, 1.25f);
double d1 = vec3d.distanceSquared(entityCollisionPosition.pos);
if ((d1 < distanceToEntity) || (distanceToEntity == 0.0D))
{
@ -191,6 +194,7 @@ public class ProjectileUser
}
}
}
}
try
{

View File

@ -1,9 +1,5 @@
package mineplex.core.reward.rewards;
/**
* Created by shaun on 2014-09-08.
*/
import java.util.Random;
import org.bukkit.entity.Player;
@ -16,9 +12,6 @@ import mineplex.core.reward.RewardData;
import mineplex.core.reward.RewardManager;
import mineplex.core.reward.RewardRarity;
/**
* Created by shaun on 2014-09-08.
*/
public class CoinReward extends Reward
{
private DonationManager _donationManager;

View File

@ -69,7 +69,7 @@ public class PvpShopButton<PageType extends ShopPageBase<ClansManager, ?>> imple
UtilPlayer.message(player, F.main(Page.getPlugin().getName(), "An error occurred processing your purchase."));
}
}
}, "Clans", player.getName(), player.getUniqueId(), -cost);
}, "Clans", player.getName(), Page.getClientManager().Get(player).getAccountId(), -cost);
}
}
else if (clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT)
@ -109,7 +109,7 @@ public class PvpShopButton<PageType extends ShopPageBase<ClansManager, ?>> imple
UtilPlayer.message(player, F.main(Page.getPlugin().getName(), "An error occurred processing your return."));
}
}
}, "Clans", player.getName(), player.getUniqueId(), creditAmount);
}, "Clans", player.getName(), Page.getClientManager().Get(player).getAccountId(), creditAmount);
}
}
}

View File

@ -50,7 +50,7 @@ public class EnergyShopButton implements IButton
_clanInfo.adjustEnergy(energy);
_page.refresh();
}
}, "Energy Purchase", player.getName(), player.getUniqueId(), -goldCost, true);
}, "Energy Purchase", player.getName(), _page.getClientManager().Get(player).getAccountId(), -goldCost, true);
}
}

View File

@ -8,6 +8,7 @@ import mineplex.core.TablistFix;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.aprilfools.AprilFoolsManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.chat.Chat;
import mineplex.core.command.CommandCenter;
@ -129,6 +130,8 @@ public class Hub extends JavaPlugin implements IRelation
//new Replay(this, packetHandler);
new PersonalServerManager(this, clientManager);
AprilFoolsManager.Initialize(this, clientManager, disguiseManager);
CombatManager combatManager = new CombatManager(this);
ProjectileManager throwManager = new ProjectileManager(this);

View File

@ -1,6 +1,7 @@
package mineplex.hub;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.bukkit.Bukkit;
@ -45,6 +46,7 @@ import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.aprilfools.AprilFoolsManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
@ -510,18 +512,22 @@ public class HubManager extends MiniClientPlugin<HubClient>
public void PlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
String playerName = player.getName();
// April Fools
if (AprilFoolsManager.Instance.isActive())
playerName = AprilFoolsManager.Instance.getName(player);
//Public Message
if (_clientManager.Get(player).GetRank() != Rank.LEGEND)
event.setJoinMessage(null);
else
{
event.setJoinMessage(C.cGreen + C.Bold + "Legend " + player.getName() + " has joined!");
event.setJoinMessage(C.cGreen + C.Bold + "Legend " + playerName + " has joined!");
UtilFirework.playFirework(player.getEyeLocation(), org.bukkit.FireworkEffect.Type.BALL_LARGE, Color.LIME, true, true);
player.getWorld().playSound(player.getEyeLocation(), Sound.WITHER_SPAWN, 2f, 1f);
}
//Teleport
player.teleport(GetSpawn().add(0, 10, 0));
@ -622,6 +628,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
}
Player player = event.getPlayer();
String playerName = player.getName();
// April Fools
if (AprilFoolsManager.Instance.isActive())
playerName = AprilFoolsManager.Instance.getName(player);
Rank rank = GetClients().Get(player).GetRank();
@ -647,7 +658,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
event.getRecipients().clear();
event.setMessage(event.getMessage().substring(1, event.getMessage().length()));
event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + "%1$s " + C.cPurple + "%2$s");
event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + playerName + " " + C.cPurple + "%2$s");
for (String name : party.GetPlayers())
{
@ -676,7 +687,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
}
event.setMessage(event.getMessage());
event.setFormat(levelStr + rankStr + C.cYellow + "%1$s " + C.cWhite + "%2$s");
event.setFormat(levelStr + rankStr + C.cYellow + playerName + " " + C.cWhite + "%2$s");
}
}
}

View File

@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin
for (Player player : UtilServer.getPlayers())
{
if (Manager.getPreferences().Get(player).HubForcefield)
if (Manager.getPreferences().Get(player).HubForcefield && Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN))
{
for (Player other : UtilServer.getPlayers())
{

View File

@ -206,7 +206,7 @@ public class StackerManager extends MiniPlugin implements IThrown
UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false);
_projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 2.4d);
_projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 0.5f);
//Portal Delay
Manager.SetPortalDelay(thrower);

View File

@ -209,6 +209,9 @@ public class WorldManager extends MiniPlugin
if (!(ent instanceof Item))
continue;
if (((Item)ent).getItemStack().getType() == Material.MONSTER_EGG)
continue;
if (ent.getTicksLived() > 1200)
ent.remove();
}

View File

@ -34,6 +34,9 @@ public class ListCommand extends BaseCommand
for (GameType gameType : GameType.values())
{
if (gameType == GameType.InProgress)
continue;
if (listMaps(player, gameType, colorSwitch))
colorSwitch = !colorSwitch;
}
@ -41,6 +44,12 @@ public class ListCommand extends BaseCommand
else if (args.length == 1)
{
GameType gameType = null;
if (args[0].equalsIgnoreCase("p"))
{
gameType = GameType.InProgress;
}
else
{
try
{
gameType = GameType.valueOf(args[0]);
@ -49,7 +58,7 @@ public class ListCommand extends BaseCommand
{
getPlugin().sendValidGameTypes(player);
}
}
UtilPlayer.message(player, F.main("Parser", "Listing Maps for gametype " + F.elem(gameType.GetName())));
listMaps(player, gameType, false);

View File

@ -26,6 +26,7 @@ import mineplex.minecraft.game.classcombat.Class.repository.token.SlotToken;
import mineplex.minecraft.game.classcombat.Skill.ISkill;
import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.Knight.AxeThrow;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
public class ClientClass
@ -372,6 +373,14 @@ public class ClientClass
{
_client.GetPlayer().getInventory().setItem(defaultItem.getKey(), defaultItem.getValue());
}
for (ISkill skill : _skillMap.values())
{
if (skill instanceof AxeThrow)
{
((AxeThrow)skill).Reset(_client.GetPlayer());
}
}
}
public void ResetToDefaults(boolean equipItems, boolean equipDefaultArmor)
@ -555,4 +564,30 @@ public class ClientClass
}
}
//This is used to fix a dual class bug using Twitch broadcasting GUI (F6)
public void validateClassSkills(Player player)
{
if (_gameClass == null || _skillMap == null)
return;
for (SkillType type : SkillType.values())
{
if (type == SkillType.GlobalPassive)
continue;
if (!_skillMap.containsKey(type))
continue;
ISkill skill = _skillMap.get(type);
if (skill.GetClassType() != _gameClass.GetType())
{
skill.Reset(player);
RemoveSkill(skill);
System.out.println("[" + player.getName() + " / " + _gameClass.GetType() + "] Removed Invalid " + skill.GetClassType() + " Skill (" + skill.GetName() + ")");
}
}
}
}

View File

@ -23,7 +23,7 @@ public class Assassin extends Skill
SetDesc(new String[]
{
"Permanent Speed II.",
"Fall damage reduced by 1."
"Fall damage reduced by 1.5."
});
}
@ -87,7 +87,7 @@ public class Assassin extends Skill
int level = getLevel(player);
if (level == 0) return;
event.AddMod(null, GetName(), -1, false);
event.AddMod(null, GetName(), -1.5, false);
}
@Override

View File

@ -70,11 +70,14 @@ public class Blink extends SkillActive
return false;
}
//Mastery
//Deblink
if (_loc.containsKey(player) && _blinkTime.containsKey(player))
if (!UtilTime.elapsed(_blinkTime.get(player), 5000))
{
//Require 500ms after blink to deblink
if (UtilTime.elapsed(_blinkTime.get(player), 500))
Deblink(player, level);
return false;
}

View File

@ -53,7 +53,7 @@ public class Flash extends SkillActive
@Override
public String GetRechargeString()
{
return "Recharge: #11#-1 Seconds per Charge";
return "Recharge: #10#-1 Seconds per Charge";
}
@Override
@ -98,7 +98,7 @@ public class Flash extends SkillActive
if (charges >= 1 + level)
continue;
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 11000 - (1000 * level), false, false))
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 10000 - (1000 * level), false, false))
continue;
_flash.put(cur, charges + 1);

View File

@ -34,6 +34,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.disguise.disguises.DisguisePig;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -121,13 +122,9 @@ public class Illusion extends SkillActive
if (UtilMath.offset2d(skel, other) < 70)
inRange.add(other);
Player[] disguiseList = new Player[inRange.size()];
for (int i=0 ; i<inRange.size() ; i++)
disguiseList[i] = inRange.get(i);
//Disguise
DisguisePlayer disguise = new DisguisePlayer(skel, ((CraftPlayer)player).getHandle().getProfile());
Factory.Disguise().disguise(disguise, disguiseList);
Factory.Disguise().disguise(disguise, inRange.toArray(new Player[inRange.size()]));
//Invis
Factory.Condition().Factory().Cloak(GetName(), player, player, 2 + 1*level, false, true);

View File

@ -46,7 +46,7 @@ public class Recall extends Skill
@Override
public String GetRechargeString()
{
return "Recharge: #90#-15 Seconds";
return "Recharge: #60#-10 Seconds";
}
@EventHandler
@ -70,7 +70,7 @@ public class Recall extends Skill
if (trigger.IsCancelled())
return;
if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (level * 15000), true, false))
if (!Recharge.Instance.use(player, GetName(), GetName(level), 60000 - (level * 10000), true, false))
return;
LinkedList<Location> locs = _locMap.remove(player);

View File

@ -50,7 +50,7 @@ public class SilencingArrow extends SkillActive
SetDesc(new String[]
{
"Your next arrow will Silence",
"target for #3#3 seconds.",
"target for #1#3 seconds.",
"",
"Silence stops skills being used."
});

View File

@ -50,7 +50,7 @@ public class SmokeArrow extends SkillActive
SetDesc(new String[]
{
"Your next arrow will give Blindness",
"to target for #3#1 seconds."
"to target for #4#1 seconds."
});
}

View File

@ -46,7 +46,7 @@ public class SmokeBomb extends Skill
@Override
public String GetRechargeString()
{
return "Recharge: #90#-15 Seconds";
return "Recharge: #60#-10 Seconds";
}
@EventHandler
@ -75,7 +75,7 @@ public class SmokeBomb extends Skill
return;
}
if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (level * 15000), true, false))
if (!Recharge.Instance.use(player, GetName(), GetName(level), 60000 - (level * 10000), true, false))
return;
//Action

View File

@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.Skill.Brute;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
@ -25,6 +26,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilServer;
@ -55,9 +57,6 @@ public class BlockToss extends SkillCharge implements IThrown
"dealing up to #6#1 damage.",
"",
GetChargeString(),
"",
"You can only pick up Stone, Dirt,",
"Cobblestone, Sand, Gravel or Snow."
});
}
@ -99,21 +98,10 @@ public class BlockToss extends SkillCharge implements IThrown
return;
}
//Recharge
if (!Recharge.Instance.use(player, GetName(), 1000, false, false))
return;
Block grab = event.getClickedBlock();
int id = event.getClickedBlock().getTypeId();
if (
id != 1 &&
id != 2 &&
id != 3 &&
id != 12 &&
id != 13 &&
id != 80)
//Recharge
if (!Recharge.Instance.use(player, GetName(), 1000, false, false))
return;
//Door
@ -143,7 +131,6 @@ public class BlockToss extends SkillCharge implements IThrown
//Block to Item
FallingBlock block = player.getWorld().spawnFallingBlock(player.getEyeLocation(), event.getClickedBlock().getType(), (byte)0);
Factory.BlockRestore().Add(event.getClickedBlock(), 0, (byte)0, 10000);
//Action
player.eject();
@ -211,7 +198,7 @@ public class BlockToss extends SkillCharge implements IThrown
//Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0, 0, 1, true);
Factory.Projectile().AddThrow(block, cur, this, -1, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 2.5d);
null, 0, 0, null, 0, UpdateType.FASTEST, 1.2f);
//Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(cur, GetName(), ClassType.Brute));
@ -240,7 +227,7 @@ public class BlockToss extends SkillCharge implements IThrown
//Damage Event
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (2.5 + 0.5 * level), true, true, false,
DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
//Block to Item
@ -278,34 +265,26 @@ public class BlockToss extends SkillCharge implements IThrown
if (event.getType() != UpdateType.TICK)
return;
HashSet<FallingBlock> fallen = new HashSet<FallingBlock>();
Iterator<FallingBlock> fallIter = _falling.keySet().iterator();
for (FallingBlock cur : _falling.keySet())
while (fallIter.hasNext())
{
if (cur.isDead() || !cur.isValid())
fallen.add(cur);
}
FallingBlock fall = fallIter.next();
for (FallingBlock cur : fallen)
{
_falling.remove(cur);
Block block = cur.getLocation().getBlock();
if (!fall.isDead() && fall.isValid())
continue;
int id = block.getTypeId();
if (
id != 1 &&
id != 2 &&
id != 3 &&
id != 4 &&
id != 12 &&
id != 13 &&
id != 80)
fallIter.remove();
Block block = fall.getLocation().getBlock();
if (block.getType() != fall.getMaterial())
continue;
block.setTypeIdAndData(0, (byte)0, false);
//Block Replace
Factory.BlockRestore().Add(block, cur.getBlockId(), (byte)0, 10000);
Factory.BlockRestore().Add(block, fall.getBlockId(), (byte)0, 10000);
//Effect
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());

View File

@ -8,6 +8,8 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import com.mysql.jdbc.Util;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent;
@ -32,9 +34,9 @@ public class Bloodlust extends Skill
SetDesc(new String[]
{
"When an enemy dies within #8#2 blocks,",
"you go into a Bloodlust, receiving",
"Speed 1 and Strength 1 for #4#2 seconds.",
"When you kill an enemy, you go into",
"a Bloodlust, receiving Speed 1 and",
"Strength 1 for #4#2 seconds.",
"You also heal #0#1 health.",
"",
"Bloodlust can stack up to 3 times,",
@ -48,49 +50,52 @@ public class Bloodlust extends Skill
if (!(event.GetEvent().getEntity() instanceof Player))
return;
for (Player cur : UtilServer.getPlayers())
{
if (Expire(cur))
continue;
if (event.GetLog().GetKiller() == null || !event.GetLog().GetKiller().IsPlayer())
return;
if (!Factory.Relation().canHurt(cur, (Player)event.GetEvent().getEntity()))
continue;
Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (player == null)
return;
if (cur.equals(event.GetEvent().getEntity()))
continue;
if (!Factory.Relation().canHurt(player, (Player)event.GetEvent().getEntity()))
return;
if (player.equals(event.GetEvent().getEntity()))
return;
//Level
int level = getLevel(cur);
if (level == 0) continue;
int level = getLevel(player);
if (level == 0)
return;
//Offset
double distance = 4 + (4 * level);
if (UtilMath.offset(event.GetEvent().getEntity().getLocation(), cur.getLocation()) > distance)
continue;
if (UtilMath.offset(event.GetEvent().getEntity().getLocation(), player.getLocation()) > distance)
return;
//Strength
int str = 0;
if (_str.containsKey(cur))
str = _str.get(cur) + 1;
str = Math.min(str, 3);
_str.put(cur, str);
if (_str.containsKey(player))
str = _str.get(player) + 1;
str = Math.min(str, 2);
_str.put(player, str);
//Time
double dur = 4 + (2 * level);
_time.put(cur, (System.currentTimeMillis() + (long)(dur*1000)));
_time.put(player, (System.currentTimeMillis() + (long)(dur*1000)));
//Condition
Factory.Condition().Factory().Speed(GetName(), cur, event.GetEvent().getEntity(), dur, str, false, true, true);
Factory.Condition().Factory().Strength(GetName(), cur, event.GetEvent().getEntity(), dur, 0, false, true, true);
Factory.Condition().Factory().Speed(GetName(), player, event.GetEvent().getEntity(), dur, str, false, true, true);
Factory.Condition().Factory().Strength(GetName(), player, event.GetEvent().getEntity(), dur, 0, false, true, true);
UtilPlayer.health(cur, level);
UtilPlayer.health(player, level);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "You entered " + F.skill(GetName(level)) + " at " + F.elem("Level " + (str+1)) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You entered " + F.skill(GetName(level)) + " at " + F.elem("Level " + (str+1)) + "."));
//Effect
cur.getWorld().playSound(cur.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 2f, 0.6f);
}
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 2f, 0.6f);
}
@EventHandler

View File

@ -17,8 +17,8 @@ public class Colossus extends Skill
SetDesc(new String[]
{
"You are so huge that you do not",
"take any knockback from attacks."
"You are so huge that you take",
"#25#25 % less knockback from attacks."
});
}
@ -36,7 +36,7 @@ public class Colossus extends Skill
//Damage
event.AddMod(damagee.getName(), GetName(), 0, false);
event.SetKnockback(false);
event.AddKnockback(GetName(), 0.75 - 0.25*level);
}
@Override

View File

@ -23,7 +23,7 @@ public class CripplingBlow extends Skill
SetDesc(new String[]
{
"Your powerful axe attacks give",
"targets Slow 1 for 1.5 second,",
"targets Slow 2 for 1.5 second,",
"as well as no knockback."
});
}
@ -53,7 +53,7 @@ public class CripplingBlow extends Skill
if (level == 0) return;
//Stun
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 0, false, true, false, true);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 1, false, true, false, true);
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);

View File

@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.Skill.Brute;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.EntityEffect;
import org.bukkit.GameMode;
import org.bukkit.Material;
@ -298,28 +299,37 @@ public class DwarfToss extends SkillActive
UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(UtilEnt.getName(target)) + " escaped your " + F.skill(GetName(level)) + "."));
}
for (Player cur : throwSet)
for (final Player cur : throwSet)
{
LivingEntity target = _holding.remove(cur);
final LivingEntity target = _holding.remove(cur);
_time.remove(cur);
int level = getLevel(cur);
//Throw
cur.eject();
target.leaveVehicle();
double mult = 1.2 + (0.2 * level);
final double mult = 1.2 + (0.2 * level);
//Delay
Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable()
{
@Override
public void run()
{
UtilAction.velocity(target, cur.getLocation().getDirection(), mult, false, 0, 0.2, 1.2, true);
//Condition
Factory.Condition().Factory().Falling(GetName(), target, cur, 10, false, true);
//Effect
target.playEffect(EntityEffect.HURT);
}
}, 4);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "You threw " + F.name(UtilEnt.getName(target)) + " with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(cur.getName()) + " threw you with " + F.skill(GetName(level)) + "."));
//Effect
target.playEffect(EntityEffect.HURT);
}
}

View File

@ -108,7 +108,7 @@ public class FleshHook extends SkillActiveCharge implements IThrown
1 + charge , false, 0, 0.2, 20, false);
Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 1.5d);
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 1.2f);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -23,7 +23,7 @@ public class Overwhelm extends Skill
"than your target, you deal 0.25",
"bonus damage",
"",
"Maximum of #0#1 bonus damage."
"Maximum of #0.5#0.5 bonus damage."
});
}
@ -52,7 +52,7 @@ public class Overwhelm extends Skill
int level = getLevel(damager);
if (level == 0) return;
diff = Math.min(diff, level);
diff = Math.min(diff, 0.5 + 0.5 * level);
//Damage
event.AddMod(damager.getName(), GetName(), diff, true);

View File

@ -42,9 +42,8 @@ public class WhirlwindAxe extends SkillActive
SetDesc(new String[]
{
"Whirl your axes around rapidly dealing",
"#4#1 damage to nearby enemies, and",
"pulling enemies within #5#1 blocks",
"towards you.",
"up to #3#1 damage to enemies within",
"#4#1 blocks, pulling them towards you.",
});
this.setAchievementSkill(true);
@ -66,17 +65,21 @@ public class WhirlwindAxe extends SkillActive
public void Skill(final Player player, int level)
{
//Pull + Damage
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5d + 1 * level);
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 4d + 1 * level);
for (LivingEntity cur : targets.keySet())
{
if (cur.equals(player))
continue;
if (cur instanceof Player)
if (!Factory.Relation().canHurt((Player)cur, player))
continue;
//Damage Event
if (UtilMath.offset(cur, player) < 4)
{
Factory.Damage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, 4 + level, false, true, false,
DamageCause.CUSTOM, 2 + (1 + level) * targets.get(cur), false, true, false,
player.getName(), GetName());
}

View File

@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
@ -53,13 +54,13 @@ public class AxeThrow extends SkillActive implements IThrown
SetDesc(new String[]
{
"Throw your axe with #0.7#0.1 velocity, ",
"dealing #6.5#0.5 damage.",
"dealing #5.5#0.5 damage.",
"",
"You pull your axe back to you when it",
"collides with anything.",
"",
"Your axe is returned to you if you do",
"not pick it up within #20#-2 seconds."
"not pick it up within #15#-1 seconds."
});
setAchievementSkill(true);
@ -90,7 +91,7 @@ public class AxeThrow extends SkillActive implements IThrown
player.setItemInHand(null);
//Projectile
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, false, 2.5d);
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, false, 0.5f);
//Store
_thrown.put(item, player);
@ -111,7 +112,7 @@ public class AxeThrow extends SkillActive implements IThrown
if (level <= 0)
return;
double damage = 6.5 + 0.5 * level;
double damage = 5.5 + 0.5 * level;
//Damage Event
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
@ -186,7 +187,7 @@ public class AxeThrow extends SkillActive implements IThrown
int level = getLevel(player);
if (item.getTicksLived() > 400 - level * 40)
if (item.getTicksLived() > 300 - level * 20)
{
_thrown.get(item).getInventory().addItem(item.getItemStack());
item.remove();

View File

@ -15,6 +15,7 @@ import org.bukkit.util.Vector;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilTime;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -86,6 +87,9 @@ public class DefensiveStance extends SkillActive
if (event.GetCause() != DamageCause.ENTITY_ATTACK && event.GetCause() != DamageCause.PROJECTILE)
return;
if (UtilEnt.inWater(event.GetDamageeEntity()))
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
@ -112,6 +116,9 @@ public class DefensiveStance extends SkillActive
}
//Damage
if (event.GetCause() == DamageCause.ENTITY_ATTACK)
event.AddMult(GetName(), GetName(), 0.1, false);
else
event.SetCancelled(GetName() + " Defense");
//Effect

View File

@ -29,7 +29,7 @@ public class Deflection extends Skill
{
"Prepare to deflect incoming attacks.",
"You gain 1 Charge every #5#-1 seconds.",
"You can store a maximum of #2#1 Charges.",
"You can store a maximum of #1#1 Charges.",
"",
"When you are attacked, the damage is",
"reduced by the number of your Charges,",
@ -73,7 +73,7 @@ public class Deflection extends Skill
if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false))
continue;
int max = 2 + (1 * level);
int max = 1 + (1 * level);
int charge = 1;
if (_charges.containsKey(cur))

View File

@ -17,6 +17,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
@ -46,13 +47,19 @@ public class HiltSmash extends SkillActive
{
"Smash the hilt of your sword into",
"your opponent, dealing #2#1 damage",
"and Slow 4 for #0.5#0.5 seconds."
"and Slow 3 for #0.5#0.5 seconds."
});
}
@Override
public boolean CustomCheck(Player player, int level)
{
if (UtilEnt.inWater(player))
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
if (_used.contains(player))
return false;
@ -112,6 +119,9 @@ public class HiltSmash extends SkillActive
if (event.isCancelled())
return;
if (UtilEnt.inWater(event.getPlayer()))
return;
Player player = event.getPlayer();
//Level
@ -123,6 +133,9 @@ public class HiltSmash extends SkillActive
Entity ent = event.getRightClicked();
if (UtilPlayer.isSpectator(ent))
return;
if (ent == null)
return;
@ -169,7 +182,7 @@ public class HiltSmash extends SkillActive
return;
//Condition
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * level, 4, false, true, true, true);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * level, 2, false, true, true, true);
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.2f);

View File

@ -66,7 +66,7 @@ public class Blizzard extends SkillActive
@Override
public String GetEnergyString()
{
return "Energy: #32#-2 per Second";
return "Energy: #34#-2 per Second";
}
@Override
@ -113,7 +113,7 @@ public class Blizzard extends SkillActive
}
//Energy
if (!Factory.Energy().Use(cur, GetName(), 1.6 - (0.1 * level), true, true))
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, true))
{
_active.remove(cur);
continue;
@ -234,7 +234,7 @@ public class Blizzard extends SkillActive
{
Entry<Projectile, Player> entry = snowBallIterator.next();
if (!entry.getValue().isOnline())
if (!entry.getKey().isValid() || entry.getKey().getTicksLived() > 60 || !entry.getValue().isOnline())
snowBallIterator.remove();
}
}

View File

@ -70,7 +70,7 @@ public class FreezingBlast extends SkillActive implements IThrown
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79));
item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true,
Sound.FIZZ, 0.6f, 1.6f, null, 0, UpdateType.FASTEST, 2d);
Sound.FIZZ, 0.6f, 1.6f, null, 0, UpdateType.FASTEST, 1f);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -7,8 +7,10 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Item;
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.PlayerCommandPreprocessEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.itemstack.ItemStackFactory;
@ -42,7 +44,7 @@ public class GlacialBlade extends SkillActive implements IThrown
SetDesc(new String[]
{
"Swinging your sword releases a",
"shard of ice, dealing 4 damage",
"shard of ice, dealing 3.5 damage",
"to anything it hits.",
"",
"Will not work if enemies are close."
@ -71,7 +73,7 @@ public class GlacialBlade extends SkillActive implements IThrown
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370));
UtilAction.velocity(item, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, false);
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true,
null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5d);
null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 0.4f);
//Effect
item.getWorld().playSound(item.getLocation(), Sound.ORB_PICKUP, 1f, 2f);
@ -91,7 +93,7 @@ public class GlacialBlade extends SkillActive implements IThrown
//Damage
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.CUSTOM, 4, false, true, false,
DamageCause.CUSTOM, 3.5, false, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
}

View File

@ -48,7 +48,7 @@ public class IcePrison extends SkillActive implements IThrown
{
"Launch an icy orb. When it collides,",
"it creates a hollow sphere of ice",
"thats lasts for #2#1.5 seconds.",
"thats lasts for #1#1.5 seconds.",
});
}
@ -70,8 +70,8 @@ public class IcePrison extends SkillActive implements IThrown
//Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79));
item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 2000, true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 2d);
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5f);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
@ -148,7 +148,7 @@ public class IcePrison extends SkillActive implements IThrown
if (!UtilBlock.airFoliage(freeze))
return;
long time = 4000 + (1500 * level);
long time = 2500 + (1500 * level);
int yDiff = freeze.getY() - mid.getY();

View File

@ -53,7 +53,7 @@ public class Inferno extends SkillActive
@Override
public String GetEnergyString()
{
return "Energy: #30#-2 per Second";
return "Energy: #34#-2 per Second";
}
@Override
@ -100,7 +100,7 @@ public class Inferno extends SkillActive
}
//Energy
if (!Factory.Energy().Use(cur, GetName(), 1.5 - (0.1 * level), true, false))
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, false))
{
_active.remove(cur);
continue;

View File

@ -33,8 +33,7 @@ public class LifeBondsData
return true;
}
_loc.add(UtilAlg.getTrajectory(_loc, _target.getLocation().add(0, 0.8, 0)).multiply(0.5));
_loc.add(UtilAlg.getTrajectory(_loc, _target.getLocation().add(0, 0.8, 0)).multiply(0.9));
UtilParticle.PlayParticle(ParticleType.HEART, _loc, 0, 0, 0, 0, 1);
return false;

View File

@ -102,7 +102,7 @@ public class LightningOrb extends SkillActive implements IThrown
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57));
item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1.5d);
Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1f);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -33,7 +33,7 @@ public class StaticLazer extends SkillChargeSword
int cost, int maxLevel)
{
super(skills, name, classType, skillType, cost, maxLevel,
0.012f, 0.008f,
0.012f, 0.004f,
12000, -1000, true, true,
false, true);
@ -45,11 +45,12 @@ public class StaticLazer extends SkillChargeSword
GetChargeString(),
"Taking damage cancels charge.",
"",
"Deals up to #7#1 damage and travels",
"up to #20#10 blocks.",
"Deals #6#1 damage and travels up to",
"#20#10 blocks.",
});
_fireOnFull = true;
_fireOnFull = false;
_energyPerCharge = 1.2f;
setAchievementSkill(true);
}
@ -59,6 +60,12 @@ public class StaticLazer extends SkillChargeSword
return "Recharge: " + "#12#-1 Seconds";
}
@Override
public String GetEnergyString()
{
return "Energy: " + "24 per Second";
}
@Override
public void DoSkillCustom(Player player, float charge)
{
@ -105,7 +112,7 @@ public class StaticLazer extends SkillChargeSword
//Damage Event
Factory.Damage().NewDamageEvent(other, player, null,
DamageCause.CUSTOM, (2 + (5 + level) * hit.get(other)) * charge, true, true, false,
DamageCause.CUSTOM, 6 + level * charge, true, true, false,
player.getName(), GetName());
}

View File

@ -33,7 +33,7 @@ public class Void extends Skill
"Drop Axe/Sword to Toggle.",
"",
"While in void form, you receive",
"Slow 2, take no knockback and",
"Slow 3, take no knockback and",
"use no energy to swing weapons.",
"",
"Reduces incoming damage by #1#1 , but",
@ -144,8 +144,8 @@ public class Void extends Skill
continue;
//Condition
Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 0, false, true, true);
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1, false, true, false, true);
Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 1, false, true, true);
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 2, false, true, false, true);
}
}

View File

@ -45,7 +45,7 @@ public class Agility extends SkillActive
SetDesc(new String[]
{
"Sprint with great agility, gaining",
"Speed I for #3#1 seconds. You take",
"Speed 2 for #3#1 seconds. You take",
"#45#5 % less damage and take no knockback.",
"",
"Agility ends if you Left-Click."
@ -68,7 +68,7 @@ public class Agility extends SkillActive
public void Skill(Player player, int level)
{
//Action
Factory.Condition().Factory().Speed(GetName(), player, player, 3 + level, 0, false, true, true);
Factory.Condition().Factory().Speed(GetName(), player, player, 3 + level, 1, false, true, true);
_active.add(player);
//Inform

View File

@ -21,6 +21,7 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -28,6 +29,7 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class Disengage extends SkillActive
{
private HashMap<Player, Long> _prepare = new HashMap<Player, Long>();
private HashMap<Player, Long> _fall = new HashMap<Player, Long>();
public Disengage(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
@ -118,7 +120,9 @@ public class Disengage extends SkillActive
//Condition
Factory.Condition().Factory().Slow(GetName(), damager, damagee, 2.5 + (0.5 * level), 3, false, true, true, true);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 2, false, false);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 1, false, false);
_fall.put(damagee, System.currentTimeMillis());
//Effect
damagee.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
@ -138,9 +142,19 @@ public class Disengage extends SkillActive
for (Player cur : GetUsers())
{
if (!_prepare.containsKey(cur))
continue;
if (_fall.containsKey(cur))
{
if (UtilTime.elapsed(_fall.get(cur), 2000))
{
if (UtilEnt.isGrounded(cur) || UtilTime.elapsed(_fall.get(cur), 20000))
{
_fall.remove(cur);
}
}
}
if (_prepare.containsKey(cur))
{
if (System.currentTimeMillis() > _prepare.get(cur))
{
//Remove
@ -151,10 +165,27 @@ public class Disengage extends SkillActive
}
}
}
}
@EventHandler(priority = EventPriority.LOW)
public void fallCancel(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.FALL)
return;
if (_fall.remove(event.GetDamageeEntity()) != null)
{
event.SetCancelled(GetName() + " Fall");
}
}
@Override
public void Reset(Player player)
{
_fall.remove(player);
_prepare.remove(player);
}
}

View File

@ -55,7 +55,7 @@ public class HealingShot extends SkillActive
{
"Prepare a healing shot;",
"Your next arrow will give its target",
"Regeneration 1 for #2#2 seconds,",
"Regeneration 2 for #3#2 seconds,",
"and remove all negative effects."
});
}
@ -148,7 +148,7 @@ public class HealingShot extends SkillActive
projectile.remove();
//Regen
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 2 + 2 * level, 0, false, true, true);
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + 2 * level, 1, false, true, true);
//Remove Bad
damagee.setFireTicks(0);

View File

@ -39,7 +39,7 @@ public class HeavyArrows extends Skill
"as well as #1#1 additional damage.",
"",
"You also receive #10#10 % knockback",
"when firing arrows.",
"when firing arrows if not sneaking.",
});
}
@ -59,11 +59,11 @@ public class HeavyArrows extends Skill
if (level == 0) return;
//Backboost
if (Recharge.Instance.use(player, GetName(), 500, false, false))
if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false))
{
double vel = (event.getProjectile().getVelocity().length() * (0.1 + 0.1 * level));
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel,
false, 0, 0.2, 0.6, true);
false, 0, 0.3, 0.6, true);
}
//Decrease Speed

View File

@ -25,7 +25,7 @@ public class Longshot extends Skill
SetDesc(new String[]
{
"Arrows do an additional 1 damage", "for every #4#-0.5 Blocks they travelled,",
"however, their base damage is", "reduced by 3.", "", "Maximum of #5#5 additional damage."
"however, their base damage is", "reduced by 3.", "", "Maximum of #6#6 additional damage."
});
}
@ -70,7 +70,7 @@ public class Longshot extends Skill
double length = UtilMath.offset(loc, projectile.getLocation());
// Damage
double damage = Math.min(5 + 5 * level, (length / (4 - 0.5 * level)) - 3);
double damage = Math.min(6 + 6 * level, (length / (4 - 0.5 * level)) - 3);
event.AddMod(damager.getName(), GetName(), damage, damage > 0);
}

View File

@ -40,7 +40,7 @@ public class Overcharge extends SkillChargeBow
"",
GetChargeString(),
"",
"Deals up to #0#1 bonus damage."
"Deals up to #1.5#1.5 bonus damage."
});
}

View File

@ -73,6 +73,9 @@ public class Sharpshooter extends Skill
Player player = _arrows.remove(projectile);
int level = getLevel(player);
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
return;
if (_hitCount.containsKey(player))
{
//Damage

View File

@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
@ -40,12 +41,12 @@ public class VitalitySpores extends Skill
int level = getLevel(cur);
if (level == 0) continue;
if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 12000 - 2000*level))
if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 5000 - 1000*level))
{
//Factory.Condition().Factory().Regen(GetName(), cur, cur, 3.9 + 2*level, 0, false, true, true);
UtilPlayer.health(cur, 1);
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1);
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1);
}
}
}

View File

@ -33,7 +33,7 @@ public class WolfsPounce extends SkillChargeSword
{
super(skills, name, classType, skillType, cost, maxLevel,
0.012f, 0.008f,
7000, -1000, true, true,
8000, -1000, true, true,
false, false);
SetDesc(new String[]
@ -88,7 +88,7 @@ public class WolfsPounce extends SkillChargeSword
if (!_live.containsKey(player))
continue;
if (!UtilTime.elapsed(_live.get(player), 2000))
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
_live.remove(player);

View File

@ -14,6 +14,8 @@ public class SkillCharge extends Skill
protected float _rateBase;
protected float _rateBoost;
protected float _energyPerCharge = 0;
public SkillCharge(SkillFactory skills, String name, ClassType classType,
SkillType skillType, int cost, int maxLevel,
float base, float boost)
@ -37,6 +39,24 @@ public class SkillCharge extends Skill
float charge = _charge.get(player);
if (charge >= 1)
{
//Display
DisplayProgress(player, GetName(level), charge);
return true;
}
//Energy
if (_energyPerCharge > 0)
{
if (!Factory.Energy().Use(player, GetName(), _energyPerCharge, true, false))
{
//Display
DisplayProgress(player, GetName(level), charge);
return true;
}
}
//Increase Charge
charge = Math.min(1f, charge + _rateBase + (_rateBoost * level));
_charge.put(player, charge);

View File

@ -171,7 +171,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
1, 4,
50, -4,
20000, -1000, true,
17000, -1000, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -193,7 +193,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Leap(this, "Leap", ClassType.Assassin, SkillType.Axe,
1, 4,
36, -3,
9500, -1500, true,
10500, -1500, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -282,7 +282,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Passive B
AddSkill(new CripplingBlow(this, "Crippling Blow", ClassType.Brute, SkillType.PassiveB, 2, 1));
AddSkill(new Colossus(this, "Colossus", ClassType.Brute, SkillType.PassiveB, 2, 1));
AddSkill(new Colossus(this, "Colossus", ClassType.Brute, SkillType.PassiveB, 1, 3));
AddSkill(new Overwhelm(this, "Overwhelm", ClassType.Brute, SkillType.PassiveB, 1, 3));
}
@ -338,7 +338,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
1, 5,
0, 0,
3000, -450, true,
2200, -200, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -386,7 +386,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe,
1, 5,
60, -3,
11000, -1000, true,
13000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));

View File

@ -160,7 +160,7 @@ public abstract class ItemUsable extends Item implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(GetType()));
UtilAction.velocity(ent, player.getLocation().getDirection(), _throwPower, false, 0, 0.2, 10, false);
Factory.Throw().AddThrow(ent, player, this, expire, _throwPlayer, _throwBlock, _throwIdle, _throwPickup, 1d);
Factory.Throw().AddThrow(ent, player, this, expire, _throwPlayer, _throwBlock, _throwIdle, _throwPickup, 0.5f);
ThrowCustom(event, ent);
}

View File

@ -243,6 +243,15 @@ public class CustomDamageEvent extends Event implements Cancellable
_damagerPlayer = (Player)ent;
}
public void setDamagee(LivingEntity ent)
{
_damageeEntity = ent;
_damageePlayer = null;
if (ent instanceof Player)
_damageePlayer = (Player)ent;
}
public void changeReason(String initial, String reason)
{
for (DamageChange change : _damageMod)
@ -307,4 +316,6 @@ public class CustomDamageEvent extends Event implements Cancellable
{
SetCancelled("No reason given because SOMEONE IS AN IDIOT");
}
}

View File

@ -21,6 +21,7 @@ import net.minecraft.server.v1_7_R4.DamageSource;
import net.minecraft.server.v1_7_R4.EntityHuman;
import net.minecraft.server.v1_7_R4.EntityLiving;
import org.bukkit.Bukkit;
import org.bukkit.EntityEffect;
import org.bukkit.GameMode;
import org.bukkit.Location;
@ -100,8 +101,16 @@ public class DamageManager extends MiniPlugin
if (!DisableDamageChanges)
WeaponDamage(event, damager);
double damage = event.getDamage();
//Consistent Arrow Damage
if (projectile != null && projectile instanceof Arrow)
{
damage = projectile.getVelocity().length() * 3;
}
//New Event
NewDamageEvent(damagee, damager, projectile, event.getCause(), event.getDamage(), true, false, false, null, null, preCancel);
NewDamageEvent(damagee, damager, projectile, event.getCause(), damage, true, false, false, null, null, preCancel);
//System.out.println(UtilEnt.getName(damagee) + " by " + event.getCause() + " at " + UtilWorld.locToStr(damagee.getLocation()));

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Mineplex.ServerData" />
</component>
</module>

View File

@ -230,6 +230,9 @@ public class ServerMonitor
for (MinecraftServer minecraftServer : _serverStatuses)
{
if (minecraftServer.getGroup().equalsIgnoreCase("Testing"))
continue;
onlineServers.add(minecraftServer.getName());
if (minecraftServer.getTps() <= 17)
@ -369,7 +372,7 @@ public class ServerMonitor
_deadServers.clear();
for (MinecraftServer deadServer : _repository.getDeadServers())
{
if (deadServer.getUptime() <= 10)
if (deadServer.getUptime() <= 10 || deadServer.getGroup().equalsIgnoreCase("Testing"))
continue;
if (_count == 0 || deadServers.contains(deadServer.getName()))
@ -427,6 +430,7 @@ public class ServerMonitor
if (availableSlots < 1500)
{
serversToAdd = Math.max(1, (1500 - availableSlots) / serverGroup.getMaxPlayers());
serversToAdd = Math.min(250 - totalServers, serversToAdd);
serversToKill = 0;
}
else if (serversToKill > 0)
@ -439,6 +443,8 @@ public class ServerMonitor
if (serversToRestart <= 5)
serversToRestart = 0;
}
}
else if (serverGroup.getName().equalsIgnoreCase("Halloween"))
{

View File

@ -16,6 +16,7 @@ import mineplex.staffServer.salespackage.salespackages.AncientChest;
import mineplex.staffServer.salespackage.salespackages.ApplyKits;
import mineplex.staffServer.salespackage.salespackages.Coins;
import mineplex.staffServer.salespackage.salespackages.DefaultRank;
import mineplex.staffServer.salespackage.salespackages.EasterBunny;
import mineplex.staffServer.salespackage.salespackages.FrostLord;
import mineplex.staffServer.salespackage.salespackages.GemHunter;
import mineplex.staffServer.salespackage.salespackages.LifetimeHero;
@ -61,6 +62,7 @@ public class SalesPackageManager extends MiniPlugin
AddSalesPackage(new AncientChest(this));
AddSalesPackage(new MythicalChest(this));
AddSalesPackage(new FrostLord(this));
AddSalesPackage(new EasterBunny(this));
}
private void AddSalesPackage(SalesPackageBase salesPackage)

View File

@ -0,0 +1,20 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class EasterBunny extends SalesPackageBase
{
public EasterBunny(SalesPackageManager manager)
{
super(manager, "Easter Bunny Morph");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Morph Easter Bunny Morph", "Give Easter Bunny Morph.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -109,6 +109,7 @@ import nautilus.game.arcade.managers.GameSpectatorManager;
import nautilus.game.arcade.managers.GameStatManager;
import nautilus.game.arcade.managers.GameTournamentManager;
import nautilus.game.arcade.managers.GameWorldManager;
import nautilus.game.arcade.managers.HolidayManager;
import nautilus.game.arcade.managers.IdleManager;
import nautilus.game.arcade.managers.MiscManager;
import nautilus.game.arcade.shop.ArcadeShop;
@ -264,7 +265,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
new MiscManager(this);
_hologramManager = hologramManager;
_idleManager = new IdleManager(this);
//new HalloweenManager(this);
new HolidayManager(this);
// Game Addons
new CompassAddon(plugin, this);
@ -602,8 +603,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation
@EventHandler
public void MessageJoin(PlayerJoinEvent event)
{
String name = event.getPlayer().getName();
if (_game != null && _game.AnnounceJoinQuit)
event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + event.getPlayer().getName()));
event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + name));
else
event.setJoinMessage(null);
@ -612,8 +615,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation
@EventHandler
public void MessageQuit(PlayerQuitEvent event)
{
String name = event.getPlayer().getName();
if (_game == null || _game.AnnounceJoinQuit)
event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + event.getPlayer().getName()));
event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + name));
else
event.setQuitMessage(null);
}
@ -758,6 +763,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
player.setFireTicks(0);
player.setFallDistance(0);
player.eject();
player.leaveVehicle();
player.setLevel(0);
player.setExp(0f);

View File

@ -1,20 +1,28 @@
package nautilus.game.arcade.game.games.baconbrawl.kits;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguisePig;
import mineplex.core.itemstack.ItemStackFactory;
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.PerkBaconBlast;
import nautilus.game.arcade.kit.perks.PerkSpeed;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
public class KitMamaPig extends Kit
{
@ -37,7 +45,7 @@ public class KitMamaPig extends Kit
}
@Override
public void GiveItems(Player player)
public void GiveItems(final Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
@ -48,12 +56,39 @@ public class KitMamaPig extends Kit
Manager.GetDisguise().disguise(disguise);
Manager.GetGame().CreatureAllowOverride = true;
Pig pig = player.getWorld().spawn(player.getEyeLocation(), Pig.class);
final Pig pig = player.getWorld().spawn(player.getEyeLocation(), Pig.class);
pig.setBaby();
pig.setAgeLock(true);
pig.setCustomName(C.cYellow + player.getName());
pig.setCustomNameVisible(true);
pig.setCustomNameVisible(false);
Manager.GetGame().CreatureAllowOverride = false;
player.setPassenger(pig);
Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
{
@Override
public void run()
{
UtilPlayer.sendPacket(player, new PacketPlayOutEntityDestroy(new int[] { pig.getEntityId() }));
}
}, 2);
}
@EventHandler(priority=EventPriority.LOWEST)
public void damageTransfer(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (!(event.GetDamageeEntity() instanceof Pig))
return;
Pig pig = (Pig)event.GetDamageeEntity();
if (pig.getVehicle() == null || !(pig.getVehicle() instanceof LivingEntity))
return;
event.setDamagee((LivingEntity)pig.getVehicle());
}
}

View File

@ -43,7 +43,7 @@ public class KitPig extends Kit
//Disguise
DisguisePig disguise = new DisguisePig(player);
disguise.setName(C.cYellow + player.getName());
disguise.setCustomNameVisible(true);
disguise.setCustomNameVisible(false);
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -50,7 +50,7 @@ public class KitSheepPig extends Kit
//Disguise
DisguiseSheep disguise = new DisguiseSheep(player);
disguise.setName(C.cYellow + player.getName());
disguise.setCustomNameVisible(true);
disguise.setCustomNameVisible(false);
disguise.setColor(DyeColor.PINK);
Manager.GetDisguise().disguise(disguise);
}

View File

@ -2,6 +2,8 @@ package nautilus.game.arcade.game.games.champions;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
@ -120,4 +122,16 @@ public class ChampionsDominate extends Domination
if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CHEST)
player.closeInventory();
}
@EventHandler
public void validateSkills(UpdateEvent event)
{
if (event.getType() == UpdateType.SEC)
{
for (Player player : GetPlayers(true))
{
Manager.getClassManager().Get(player).validateClassSkills(player);
}
}
}
}

View File

@ -8,6 +8,8 @@ import org.bukkit.event.inventory.InventoryType;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
@ -120,4 +122,16 @@ public class ChampionsTDM extends TeamDeathmatch
if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CHEST)
player.closeInventory();
}
@EventHandler
public void validateSkills(UpdateEvent event)
{
if (event.getType() == UpdateType.SEC)
{
for (Player player : GetPlayers(true))
{
Manager.getClassManager().Get(player).validateClassSkills(player);
}
}
}
}

View File

@ -49,6 +49,8 @@ public class KitAssassin extends Kit
@Override
public void Selected(Player player)
{
Manager.Clear(player);
_class.put(player, Manager.getClassManager().Get(player));
ClientClass clientClass = _class.get(player);
IPvpClass pvpClass = Manager.getClassManager().GetClass("Assassin");

View File

@ -48,6 +48,8 @@ public class KitBrute extends Kit
@Override
public void Selected(Player player)
{
Manager.Clear(player);
_class.put(player, Manager.getClassManager().Get(player));
ClientClass clientClass = _class.get(player);
IPvpClass pvpClass = Manager.getClassManager().GetClass("Brute");

View File

@ -45,6 +45,8 @@ public class KitKnight extends Kit
@Override
public void Selected(Player player)
{
Manager.Clear(player);
AddPlayer(player);
Manager.openClassShop(player);

View File

@ -45,6 +45,8 @@ public class KitMage extends Kit
@Override
public void Selected(Player player)
{
Manager.Clear(player);
_class.put(player, Manager.getClassManager().Get(player));
ClientClass clientClass = _class.get(player);
IPvpClass pvpClass = Manager.getClassManager().GetClass("Mage");

View File

@ -45,6 +45,8 @@ public class KitRanger extends Kit
@Override
public void Selected(Player player)
{
Manager.Clear(player);
_class.put(player, Manager.getClassManager().Get(player));
ClientClass clientClass = _class.get(player);
IPvpClass pvpClass = Manager.getClassManager().GetClass("Ranger");

View File

@ -301,6 +301,8 @@ public class CapturePoint
RewardCapture(player, 30);
}
}
UtilTextMiddle.display(null, _owner.GetColor() + _owner.GetName() + " captured " + _name, 5, 40, 5);
}
}
//Count Down

View File

@ -9,13 +9,10 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTime;
import mineplex.core.timing.TimingManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;

View File

@ -109,7 +109,6 @@ import nautilus.game.arcade.stats.KillFastStatTracker;
import nautilus.game.arcade.stats.KillReasonStatTracker;
import nautilus.game.arcade.stats.KillsWithConditionStatTracker;
import nautilus.game.arcade.stats.MineStrikeLastAliveKillStatTracker;
import net.minecraft.server.v1_7_R4.EntityArrow;
public class MineStrike extends TeamGame

View File

@ -42,7 +42,6 @@ import mineplex.core.common.util.UtilServer;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.visibility.VisibilityManager;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;

Some files were not shown because too many files have changed in this diff Show More