Initial Commit

This commit is contained in:
samczsun 2016-07-02 17:16:42 -04:00
parent 2b74ec00b4
commit 54cda56c11
11 changed files with 127 additions and 120 deletions

View File

@ -40,6 +40,8 @@ import java.util.Map.Entry;
public class DisguiseManager extends MiniPlugin implements IPacketHandler
{
public static DisguiseManager INSTANCE;
private NautHashMap<Integer, DisguiseBase> _spawnPacketMap = new NautHashMap<Integer, DisguiseBase>();
private NautHashMap<Integer, PacketPlayOutEntityVelocity> _movePacketMap = new NautHashMap<Integer, PacketPlayOutEntityVelocity>();
private NautHashMap<Integer, PacketPlayOutEntityVelocity> _moveTempMap = new NautHashMap<Integer, PacketPlayOutEntityVelocity>();
@ -71,6 +73,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
PacketPlayOutEntityTeleport.class, PacketPlayOutEntityMetadata.class, PacketPlayOutSpawnEntityLiving.class,
PacketPlayOutUpdateAttributes.class, PacketPlayOutEntityEquipment.class, PacketPlayOutNamedSoundEffect.class);
INSTANCE = this;
try
{
_bedChunk = new Chunk(((CraftWorld) Bukkit.getWorlds().get(0)).getHandle(), 0, 0);

View File

@ -2,6 +2,9 @@ package mineplex.game.clans.clans.worldevent;
import java.lang.reflect.Constructor;
import mineplex.minecraft.game.core.boss.ironwizard.GolemBoss;
import mineplex.minecraft.game.core.boss.slimeking.SlimeBoss;
import mineplex.minecraft.game.core.boss.spider.SpiderBoss;
import org.bukkit.Location;
import mineplex.game.clans.clans.worldevent.kinghill.KingHill;
@ -11,10 +14,11 @@ import mineplex.minecraft.game.core.boss.WorldEvent;
public enum WorldEventType
{
// SLIME_KING("Slime King", SlimeBoss.class, 30),
// KING_HILL("King of The Hill", KingHill.class, 30),
UNDEAD_CAMP("Undead Camp", UndeadCamp.class, 30);// ,
// Golem("Iron Wizard", GolemBoss.class, 30);
SLIME_KING("Slime King", SlimeBoss.class, 30),
KING_HILL("King of The Hill", KingHill.class, 30),
UNDEAD_CAMP("Undead Camp", UndeadCamp.class, 30),
Golem("Iron Wizard",GolemBoss.class, 30),
BROOD_MOTHER("Brood Mother", SpiderBoss.class, 30);
private String _name;
private Class<? extends WorldEvent> _clazz;

View File

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import mineplex.core.common.util.*;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -53,7 +54,7 @@ public class KingHill extends WorldEvent
private long _lastOnHillMessage;
private long _goldDrops;
public KingHill(WorldEventManager eventManager, Location centerLocation)
public KingHill(WorldEventManager eventManager, Location centerLocation, SkillFactory skillFactory)
{
super(eventManager.getClans().getDisguiseManager(), eventManager.getClans().getProjectile(), eventManager.getDamage(), eventManager.getBlockRestore(), eventManager.getClans().getCondition(), "King of the Hill", centerLocation);
_clansManager = eventManager.getClans();

View File

@ -201,7 +201,7 @@ public class CustomItem implements Listener
name += word.substring(0, 1).toUpperCase() + word.substring(1) + " ";
}
return name;
return name.trim();
}
public Material getMaterial()

View File

@ -68,7 +68,7 @@ public class AttributeContainer
if (_suffix != null)
{
itemName += "of " + _suffix.getDisplayName();
itemName += " of " + _suffix.getDisplayName();
}
return itemName;

View File

@ -55,7 +55,7 @@ public class HyperAxe extends LegendaryItem
{
event.SetIgnoreRate(true);
event.AddMod("Hyper Axe", 9);
event.AddMod("Hyper Axe", 5);
_lastAttack = System.currentTimeMillis();
}
else

View File

@ -287,7 +287,7 @@ public class MeridianScepter extends LegendaryItem
{
_hit.getWorld().strikeLightningEffect(_hit.getLocation());
ClansManager.getInstance().getDamageManager().NewDamageEvent(_hit, _shooter, null,
DamageCause.CUSTOM, 6, false, true, true,
DamageCause.CUSTOM, 8, false, true, true,
_shooter.getName(), "Meridian Scepter");
ClansManager.getInstance().getCondition().Factory().Blind("Meridian Scepter", _hit, _shooter, 1, 0, true, true, true);
end();

View File

@ -6,6 +6,7 @@ import mineplex.core.projectile.ProjectileManager;
import mineplex.minecraft.game.core.boss.EventCreature;
import mineplex.minecraft.game.core.boss.EventState;
import mineplex.minecraft.game.core.boss.WorldEvent;
import mineplex.minecraft.game.core.condition.Condition;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.DamageManager;
@ -15,10 +16,9 @@ import org.bukkit.Location;
public class GolemBoss extends WorldEvent
{
public GolemBoss(DisguiseManager disguiseManager, ProjectileManager projectileManager, DamageManager damageManager,
BlockRestore blockRestore, ConditionManager conditionManager, Location cornerLocation)
public GolemBoss(DamageManager damageManager, BlockRestore blockRestore, ConditionManager conditionManager, ProjectileManager projectileManager, Location cornerLocation)
{
super(disguiseManager, projectileManager, damageManager, blockRestore, conditionManager, "Iron Wizard", cornerLocation, "schematic/Golem.schematic");
super(DisguiseManager.INSTANCE, projectileManager, damageManager, blockRestore, conditionManager, "Iron Wizard", cornerLocation, "schematic/Golem.schematic");
}
@Override

View File

@ -223,108 +223,108 @@ public class GolemCaveIn extends BossAbility<GolemCreature, IronGolem>
@Override
public void tick()
{
if (_tick++ == 0)
{
Location l = getLocation();
ArrayList<Location> blocks = UtilShapes.getSphereBlocks(l, 3, 3, true);
for (Location loc : blocks)
{
if (loc.getBlockY() >= l.getBlockY())
{
Block b = loc.getBlock();
if (b.getType() == Material.AIR)
{
_blocks.add(b);
loc.setY(l.getY() - 1);
b.setType(loc.getBlock().getType());
b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, loc.getBlock().getTypeId());
}
}
}
}
if (_tick % 5 == 0)
{
for (Player player : UtilPlayer.getNearby(getLocation(), 2.5, true))
{
player.teleport(player.getLocation().add(0, 4, 0));
UtilAction.velocity(player, new Vector(UtilMath.r(10) - 5, 3, UtilMath.r(10) - 5).normalize());
}
}
if (_tick < 200)
{
Location loc = getLocation();
loc.setY(loc.getY() + 4);
for (int i = 0; i < 30; i++)
{
loc.setY(loc.getY() + 1);
Block b = loc.getBlock();
if (UtilBlock.solid(b))
{
break;
}
}
if (!UtilBlock.solid(loc.getBlock()))
{
return;
}
List<Player> players = UtilPlayer.getNearby(getLocation(), 50, true);
for (int i = 0; i < players.size() * 4; i++)
{
int dist = UtilMath.r(10);
if (dist < 3)
{
dist = 2;
}
else if (dist < 5)
{
dist = 5;
}
else
{
dist = 10;
}
Location l = players.get(UtilMath.r(players.size())).getLocation().add(UtilMath.r(dist * 2) - dist, 0,
UtilMath.r(dist * 2) - dist);
l.setY(loc.getY());
Block b = l.getBlock();
l.subtract(0, 1, 0);
if (UtilBlock.solid(b))
{
if (l.getBlock().getType() == Material.AIR)
{
if (UtilAlg.HasSight(l, getLocation().add(0, 4, 0)))
{
FallingBlock block = b.getWorld().spawnFallingBlock(b.getLocation().add(0.5, -1, 0.5), b.getTypeId(),
b.getData());
block.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, block.getBlockId());
block.setDropItem(false);
_fallingBlocks.add(block);
}
}
}
}
}
// if (_tick++ == 0)
// {
// Location l = getLocation();
//
// ArrayList<Location> blocks = UtilShapes.getSphereBlocks(l, 3, 3, true);
//
// for (Location loc : blocks)
// {
// if (loc.getBlockY() >= l.getBlockY())
// {
// Block b = loc.getBlock();
//
// if (b.getType() == Material.AIR)
// {
// _blocks.add(b);
//
// loc.setY(l.getY() - 1);
//
// b.setType(loc.getBlock().getType());
//
// b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, loc.getBlock().getTypeId());
// }
// }
// }
// }
//
// if (_tick % 5 == 0)
//
// {
// for (Player player : UtilPlayer.getNearby(getLocation(), 2.5, true))
// {
// player.teleport(player.getLocation().add(0, 4, 0));
// UtilAction.velocity(player, new Vector(UtilMath.r(10) - 5, 3, UtilMath.r(10) - 5).normalize());
// }
// }
//
// if (_tick < 200)
//
// {
// Location loc = getLocation();
// loc.setY(loc.getY() + 4);
//
// for (int i = 0; i < 30; i++)
// {
// loc.setY(loc.getY() + 1);
// Block b = loc.getBlock();
//
// if (UtilBlock.solid(b))
// {
// break;
// }
// }
//
// if (!UtilBlock.solid(loc.getBlock()))
// {
// return;
// }
//
// List<Player> players = UtilPlayer.getNearby(getLocation(), 50, true);
//
// for (int i = 0; i < players.size() * 4; i++)
// {
// int dist = UtilMath.r(10);
//
// if (dist < 3)
// {
// dist = 2;
// }
// else if (dist < 5)
// {
// dist = 5;
// }
// else
// {
// dist = 10;
// }
//
// Location l = players.get(UtilMath.r(players.size())).getLocation().add(UtilMath.r(dist * 2) - dist, 0,
// UtilMath.r(dist * 2) - dist);
// l.setY(loc.getY());
//
// Block b = l.getBlock();
// l.subtract(0, 1, 0);
//
// if (UtilBlock.solid(b))
// {
// if (l.getBlock().getType() == Material.AIR)
// {
// if (UtilAlg.HasSight(l, getLocation().add(0, 4, 0)))
// {
// FallingBlock block = b.getWorld().spawnFallingBlock(b.getLocation().add(0.5, -1, 0.5), b.getTypeId(),
// b.getData());
//
// block.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, block.getBlockId());
// block.setDropItem(false);
//
// _fallingBlocks.add(block);
// }
// }
// }
// }
// }
}

View File

@ -25,10 +25,9 @@ public class SlimeBoss extends WorldEvent
private static final int MAX_SIZE = 16;
private static final int MIN_SIZE = 2;
public SlimeBoss(DisguiseManager disguiseManager, ProjectileManager projectileManager, DamageManager damageManager,
BlockRestore blockRestore, ConditionManager conditionManager, Location cornerLocation)
public SlimeBoss(DamageManager damageManager, BlockRestore blockRestore, ConditionManager conditionManager, ProjectileManager projectileManager, Location cornerLocation)
{
super(disguiseManager, projectileManager, damageManager, blockRestore, conditionManager, "Slime King", cornerLocation, "schematic/ClansSlime.schematic");
super(DisguiseManager.INSTANCE, projectileManager, damageManager, blockRestore, conditionManager, "Slime King", cornerLocation, "schematic/ClansSlime.schematic");
}
@Override

View File

@ -29,10 +29,9 @@ public class SpiderBoss extends WorldEvent
{
private HashMap<Block, Double> _webDurability = new HashMap<Block, Double>();
public SpiderBoss(DisguiseManager disguiseManager, ProjectileManager projectileManager, DamageManager damageManager,
BlockRestore blockRestore, ConditionManager conditionManager, Location cornerLocation)
public SpiderBoss(DamageManager damageManager, BlockRestore blockRestore, ConditionManager conditionManager, ProjectileManager projectileManager, Location cornerLocation)
{
super(disguiseManager, projectileManager, damageManager, blockRestore, conditionManager, "Brood Mother", cornerLocation,
super(DisguiseManager.INSTANCE, projectileManager, damageManager, blockRestore, conditionManager, "Brood Mother", cornerLocation,
"schematic/Golem.schematic");
}