Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
fbea0e702b
47
Patches/Bukkit-Patches/0031-EntityDismountEvent.patch
Normal file
47
Patches/Bukkit-Patches/0031-EntityDismountEvent.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From c6e51ae8ffc31d0fc059d33ca159df31c2b7a83e Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Sun, 22 Nov 2015 14:37:11 +1300
|
||||
Subject: [PATCH] EntityDismountEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||
index 24d4942..02943d6 100644
|
||||
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||
@@ -2,13 +2,14 @@ package org.spigotmc.event.entity;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.entity.EntityEvent;
|
||||
|
||||
/**
|
||||
* Called when an entity stops riding another entity.
|
||||
*
|
||||
*/
|
||||
-public class EntityDismountEvent extends EntityEvent
|
||||
+public class EntityDismountEvent extends EntityEvent implements Cancellable
|
||||
{
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@@ -36,4 +37,17 @@ public class EntityDismountEvent extends EntityEvent
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled()
|
||||
+ {
|
||||
+ return cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel)
|
||||
+ {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
@ -0,0 +1,159 @@
|
||||
From bc86c3b02f2efa4c1194fc908e8d1ee8723f62c5 Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Sun, 22 Nov 2015 14:41:11 +1300
|
||||
Subject: [PATCH] EntityDismountEvent & teleport crash fix
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 81ca499..7165579 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -23,6 +23,8 @@ import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
|
||||
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||
+import org.spigotmc.event.entity.EntityDismountEvent;
|
||||
+import org.spigotmc.event.entity.EntityMountEvent;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
@@ -1591,7 +1593,12 @@ public abstract class Entity implements ICommandListener {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
- pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
|
||||
+ EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(this.getBukkitEntity(), this.vehicle.getBukkitEntity());
|
||||
+ pluginManager.callEvent(event); // Spigot
|
||||
+
|
||||
+ if (event.isCancelled() || vehicle != originalVehicle) {
|
||||
+ return;
|
||||
+ } // Spigot
|
||||
this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||
this.vehicle.passenger = null;
|
||||
}
|
||||
@@ -1599,44 +1606,45 @@ public abstract class Entity implements ICommandListener {
|
||||
this.vehicle = null;
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
- if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) {
|
||||
+ if (entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) {
|
||||
// It's possible to move from one vehicle to another. We need to check if they're already in a vehicle, and fire an exit event if they are.
|
||||
VehicleExitEvent exitEvent = null;
|
||||
+ EntityDismountEvent exitEvent1 = null;
|
||||
if (this.vehicle != null) {
|
||||
- exitEvent = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||
+ if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle))
|
||||
+ exitEvent = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||
pluginManager.callEvent(exitEvent);
|
||||
|
||||
if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ exitEvent1 = new EntityDismountEvent(this.vehicle.getBukkitEntity(), this.bukkitEntity);
|
||||
+
|
||||
+ pluginManager.callEvent(exitEvent1);
|
||||
+
|
||||
+ if (exitEvent1.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
- VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.bukkitEntity);
|
||||
- pluginManager.callEvent(event);
|
||||
+ if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle)) {
|
||||
+ VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.bukkitEntity);
|
||||
+ pluginManager.callEvent(event);
|
||||
|
||||
- // If a plugin messes with the vehicle or the vehicle's passenger
|
||||
- if (event.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
- // If we only cancelled the enterevent then we need to put the player in a decent position.
|
||||
- if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) {
|
||||
- this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||
- this.vehicle.passenger = null;
|
||||
- this.vehicle = null;
|
||||
+ // If a plugin messes with the vehicle or the vehicle's passenger
|
||||
+ if (event.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
+ // If we only cancelled the enterevent then we need to put the player in a decent position.
|
||||
+ if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) {
|
||||
+ this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||
+ this.vehicle.passenger = null;
|
||||
+ this.vehicle = null;
|
||||
+ }
|
||||
+ return;
|
||||
}
|
||||
- return;
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
- // Spigot Start
|
||||
- if ( entity.world.isChunkLoaded( (int) entity.locX >> 4, (int) entity.locZ >> 4, true ) )
|
||||
- {
|
||||
- org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent( this.getBukkitEntity(), entity.getBukkitEntity() );
|
||||
- pluginManager.callEvent( event );
|
||||
- if ( event.isCancelled() )
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- // Spigot End
|
||||
|
||||
if (this.vehicle != null) {
|
||||
this.vehicle.passenger = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index b861dbe..96b3905 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -21,6 +21,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||
+import org.spigotmc.event.entity.EntityDismountEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
@@ -1725,8 +1726,15 @@ public abstract class EntityLiving extends Entity {
|
||||
return;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ EntityDismountEvent event = new EntityDismountEvent(this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||
+ getBukkitEntity().getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled() || vehicle != originalVehicle) {
|
||||
+ return;
|
||||
+ }
|
||||
// CraftBukkit end
|
||||
-
|
||||
+
|
||||
if (!this.world.isClientSide) {
|
||||
this.q(this.vehicle);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index efbf1a8..dbc7b54 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
+import com.google.common.primitives.Doubles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -234,6 +235,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
// If this entity is riding another entity, we must dismount before teleporting.
|
||||
entity.mount(null);
|
||||
|
||||
+ if (!Doubles.isFinite(location.getX()) || !Doubles.isFinite(location.getY()) || !Doubles.isFinite(location.getZ()))
|
||||
+ {
|
||||
+ Thread.dumpStack();
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
// Spigot start
|
||||
if (!location.getWorld().equals(getWorld())) {
|
||||
entity.teleportTo(location, cause.equals(TeleportCause.NETHER_PORTAL));
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
Binary file not shown.
@ -130,8 +130,10 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
|
||||
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
|
||||
|
||||
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
||||
|
||||
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
|
||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, new ConditionManager(this), disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
|
||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
|
||||
|
||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
|
||||
|
||||
@ -157,9 +159,11 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
CombatManager combatManager = new CombatManager(this);
|
||||
|
||||
ProjectileManager throwManager = new ProjectileManager(this);
|
||||
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
||||
|
||||
|
||||
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
|
||||
conditionManager.setDamageManager(damage);
|
||||
|
||||
Fire fire = new Fire(this, conditionManager, damage);
|
||||
Teleport teleport = new Teleport(this);
|
||||
Energy energy = new Energy(this);
|
||||
|
@ -27,6 +27,7 @@ public enum GameType
|
||||
Draw("Draw My Thing"),
|
||||
Evolution("Evolution"),
|
||||
FlappyBird("Flappy Bird"),
|
||||
Gladiators("Gladiators"),
|
||||
Gravity("Gravity"),
|
||||
Halloween("Halloween Horror"),
|
||||
HideSeek("Block Hunt"),
|
||||
|
@ -90,6 +90,13 @@ public class Assassin extends Skill
|
||||
event.AddMod(null, GetName(), -1.5, false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CancelEnergy(EnergyEvent event)
|
||||
{
|
||||
if (getLevel(event.GetPlayer()) > 0)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Reset(Player player)
|
||||
{
|
||||
|
@ -1,6 +1,8 @@
|
||||
package mineplex.minecraft.game.classcombat.Skill.Assassin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
@ -24,6 +26,7 @@ import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||
@ -31,7 +34,7 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
|
||||
public class Evade extends SkillActive
|
||||
{
|
||||
private HashSet<Player> _active = new HashSet<Player>();
|
||||
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||
|
||||
public Evade(SkillFactory skills, String name, ClassType classType, SkillType skillType,
|
||||
int cost, int levels,
|
||||
@ -56,12 +59,6 @@ public class Evade extends SkillActive
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetEnergyString()
|
||||
{
|
||||
return "Energy: #26#-2 and #18#-2 per Second";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean CustomCheck(Player player, int level)
|
||||
{
|
||||
@ -77,36 +74,12 @@ public class Evade extends SkillActive
|
||||
@Override
|
||||
public void Skill(Player player, int level)
|
||||
{
|
||||
_active.add(player);
|
||||
_active.put(player, System.currentTimeMillis());
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared to " + F.skill(GetName()) + "."));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Energy(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player cur : GetUsers())
|
||||
{
|
||||
if (!_active.contains(cur))
|
||||
continue;
|
||||
|
||||
if (!cur.isBlocking())
|
||||
{
|
||||
_active.remove(cur);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Factory.Energy().Use(cur, GetName(), 0.9 - (getLevel(cur) * 0.1), true, true))
|
||||
{
|
||||
_active.remove(cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void Damage(CustomDamageEvent event)
|
||||
{
|
||||
@ -125,7 +98,7 @@ public class Evade extends SkillActive
|
||||
return;
|
||||
|
||||
//Active
|
||||
if (!_active.contains(damagee))
|
||||
if (!_active.containsKey(damagee))
|
||||
return;
|
||||
|
||||
//Damager
|
||||
@ -136,9 +109,6 @@ public class Evade extends SkillActive
|
||||
int level = getLevel(damagee);
|
||||
if (level == 0) return;
|
||||
|
||||
if (!mineplex.core.recharge.Recharge.Instance.use(damagee, GetName(), 500, false, false))
|
||||
return;
|
||||
|
||||
//Cancel
|
||||
event.SetCancelled(GetName());
|
||||
|
||||
@ -230,4 +200,24 @@ public class Evade extends SkillActive
|
||||
{
|
||||
_active.remove(player);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void clean(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
Iterator<Player> activeIter = _active.keySet().iterator();
|
||||
|
||||
while (activeIter.hasNext())
|
||||
{
|
||||
Player player = activeIter.next();
|
||||
|
||||
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750))
|
||||
{
|
||||
activeIter.remove();
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + "."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,12 +77,6 @@ public class Illusion extends SkillActive
|
||||
setAchievementSkill(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetEnergyString()
|
||||
{
|
||||
return "Energy: #40#-3 and #12.5#-0.5 per Second";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean CustomCheck(Player player, int level)
|
||||
{
|
||||
@ -107,8 +101,8 @@ public class Illusion extends SkillActive
|
||||
UtilEnt.Vegetate(skel);
|
||||
UtilEnt.silence(skel, true);
|
||||
|
||||
skel.setMaxHealth(7);
|
||||
skel.setHealth(7);
|
||||
skel.setMaxHealth(14);
|
||||
skel.setHealth(14);
|
||||
|
||||
ClassCombatCreatureAllowSpawnEvent disableEvent = new ClassCombatCreatureAllowSpawnEvent(false);
|
||||
UtilServer.getServer().getPluginManager().callEvent(disableEvent);
|
||||
|
@ -39,8 +39,8 @@ public class Leap extends SkillActive
|
||||
"Take a great leap forwards.",
|
||||
"",
|
||||
"Wall Kick by using Leap with your",
|
||||
"back against a wall. This uses no",
|
||||
"Energy or Recharge.",
|
||||
"back against a wall. This doesn't",
|
||||
"trigger Leaps Recharge.",
|
||||
"",
|
||||
"Cannot be used while Slowed."
|
||||
});
|
||||
|
@ -41,8 +41,9 @@ public class Recall extends Skill
|
||||
{
|
||||
"Drop Axe/Sword to Use.",
|
||||
"",
|
||||
"Instantly teleport back to where",
|
||||
"you were #2#2 seconds ago.",
|
||||
"Go back in time #2#2 seconds,",
|
||||
"restoring your location and",
|
||||
"up to #3#1 health."
|
||||
});
|
||||
}
|
||||
|
||||
@ -85,7 +86,8 @@ public class Recall extends Skill
|
||||
return;
|
||||
|
||||
//Heal
|
||||
player.setHealth(health.getLast());
|
||||
double newHealth = Math.min(health.getLast(), player.getHealth() + 3 + level);
|
||||
player.setHealth(newHealth);
|
||||
|
||||
//Effect
|
||||
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
||||
|
@ -22,7 +22,8 @@ public class ViperStrikes extends Skill
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Your attacks give enemies",
|
||||
"Poison 1 for #1#2 seconds."
|
||||
"Shock, Slow 1 and Poison 1",
|
||||
"for #0#1 seconds."
|
||||
});
|
||||
}
|
||||
|
||||
@ -48,10 +49,8 @@ public class ViperStrikes extends Skill
|
||||
if (damagee == null) return;
|
||||
|
||||
//Confuse
|
||||
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 1 + 2*level, 0, false, false, false);
|
||||
|
||||
//Damage
|
||||
//event.AddMod(damager.getName(), GetName(), -1 - level, true);
|
||||
Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false);
|
||||
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
|
||||
|
||||
//Sound
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);
|
||||
|
@ -64,7 +64,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
@Override
|
||||
public String GetRechargeString()
|
||||
{
|
||||
return "Recharge: " + "#" + UtilMath.trim(1, 4000/1000d) + "#" + UtilMath.trim(1, -500/1000d) + " Seconds";
|
||||
return "Recharge: " + "#4#-0.5 Seconds";
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -92,6 +92,10 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
int level = getLevel(player);
|
||||
if (level == 0) return;
|
||||
|
||||
//Recharge
|
||||
if (!Recharge.Instance.usable(player, GetName()))
|
||||
return;
|
||||
|
||||
//Water
|
||||
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
|
||||
{
|
||||
@ -101,10 +105,6 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
|
||||
Block grab = event.getClickedBlock();
|
||||
|
||||
//Recharge
|
||||
if (!Recharge.Instance.use(player, GetName(), 1000, false, false))
|
||||
return;
|
||||
|
||||
//Door and Banner
|
||||
if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71 || grab.getRelative(BlockFace.UP).getType() == Material.STANDING_BANNER)
|
||||
{
|
||||
@ -202,6 +202,9 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
|
||||
for (Player cur : throwSet)
|
||||
{
|
||||
Recharge.Instance.recharge(cur, GetName());
|
||||
Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true);
|
||||
|
||||
FallingBlock block = _holding.remove(cur);
|
||||
float charge = _charge.remove(cur);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class Colossus extends Skill
|
||||
|
||||
//Damage
|
||||
event.AddMod(damagee.getName(), GetName(), 0, false);
|
||||
event.AddKnockback(GetName(), 0.35);
|
||||
event.AddKnockback(GetName(), 0.65);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||
import org.spigotmc.event.entity.EntityDismountEvent;
|
||||
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
@ -115,19 +116,23 @@ public class DwarfToss extends SkillActive
|
||||
return true;
|
||||
}
|
||||
|
||||
//getEntity is the vehicle
|
||||
@EventHandler
|
||||
public void PreventDismount(VehicleExitEvent event)
|
||||
public void PreventDismount(EntityDismountEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (!(event.getExited() instanceof Player))
|
||||
System.out.println(UtilEnt.getName(event.getDismounted()));
|
||||
System.out.println(UtilEnt.getName(event.getEntity()));
|
||||
|
||||
if (!(event.getDismounted() instanceof Player))
|
||||
return;
|
||||
|
||||
if (!(event.getVehicle() instanceof Player))
|
||||
if (!(event.getEntity() instanceof Player))
|
||||
return;
|
||||
|
||||
if (_holding.containsKey((Player)event.getVehicle()) && _holding.get((Player)event.getVehicle()) == event.getExited())
|
||||
if (_holding.containsKey((Player)event.getEntity()) && _holding.get((Player)event.getEntity()) == event.getDismounted())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class HoldPosition extends SkillActive
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Hold your position, gaining",
|
||||
"Protection 3, Slow 4 and no",
|
||||
"Protection 3, Slow 3 and no",
|
||||
"knockback for #3#1 seconds."
|
||||
});
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class HoldPosition extends SkillActive
|
||||
//Action
|
||||
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
|
||||
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 2, false, false, true);
|
||||
Factory.Condition().Factory().Jump(GetName(), player, player, duration, 250, false, false, true);
|
||||
Factory.Condition().Factory().ArcadeHungerDisable(GetName(), player, player, duration, false);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||
@ -119,6 +119,9 @@ public class HoldPosition extends SkillActive
|
||||
UtilParticle.PlayParticle(ParticleType.MOB_SPELL, player.getLocation(),
|
||||
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 3 + getLevel(player),
|
||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
|
||||
player.setFoodLevel(2);
|
||||
player.setSprinting(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class Riposte extends SkillActive
|
||||
//Effect
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
|
||||
|
||||
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.4, false, false);
|
||||
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(damagee, F.main(GetClassType().name(), "You parried with " + F.skill(GetName(level)) + "."));
|
||||
|
@ -128,7 +128,7 @@ 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, 1, false, false);
|
||||
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
|
||||
|
||||
_fall.put(damagee, System.currentTimeMillis());
|
||||
|
||||
|
@ -61,7 +61,9 @@ public class HealingShot extends SkillActive
|
||||
"Regeneration 3 for #3#1 seconds,",
|
||||
"and remove all negative effects.",
|
||||
"",
|
||||
"Gives Nausea to enemies for #5#1 seconds."
|
||||
"Self hits give Regeneration 2.",
|
||||
"",
|
||||
"Gives Nausea to enemies for #5#1 seconds.",
|
||||
});
|
||||
}
|
||||
|
||||
@ -153,9 +155,9 @@ public class HealingShot extends SkillActive
|
||||
projectile.remove();
|
||||
|
||||
//Regen
|
||||
if (!Factory.Relation().canHurt(damager, damagee))
|
||||
if (!Factory.Relation().canHurt(damager, damagee) || damager.equals(damagee))
|
||||
{
|
||||
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, 2, false, false, false);
|
||||
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, damager.equals(damagee) ? 1 : 2, false, false, false);
|
||||
|
||||
//Remove Bad
|
||||
damagee.setFireTicks(0);
|
||||
|
@ -40,8 +40,9 @@ public class HeavyArrows extends Skill
|
||||
"an additional #10#10 % knockback",
|
||||
"as well as #1#1 additional damage.",
|
||||
"",
|
||||
"You also receive #10#10 % knockback",
|
||||
"when firing arrows if not sneaking.",
|
||||
"You also receive #12#6 % reversed",
|
||||
"velocity of your arrows while not",
|
||||
"sneaking.",
|
||||
});
|
||||
}
|
||||
|
||||
@ -63,7 +64,7 @@ public class HeavyArrows extends Skill
|
||||
//Backboost
|
||||
if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false))
|
||||
{
|
||||
double vel = (event.getProjectile().getVelocity().length() * (0.1 + 0.1 * level));
|
||||
double vel = (event.getProjectile().getVelocity().length() * (0.12 + 0.06 * level));
|
||||
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel,
|
||||
false, 0, 0.3, 0.6, true);
|
||||
}
|
||||
|
@ -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,",
|
||||
"for every #4.5#-0.5 Blocks they travelled,",
|
||||
"however, their base damage is",
|
||||
"reduced by 5.",
|
||||
"",
|
||||
@ -74,7 +74,7 @@ public class Longshot extends Skill
|
||||
double length = UtilMath.offset(loc, projectile.getLocation());
|
||||
|
||||
// Damage
|
||||
double damage = Math.min(6 + 6 * level, (length / (4 - 0.5 * level)) - 5);
|
||||
double damage = Math.min(6 + 6 * level, (length / (4.5 - 0.5 * level)) - 5);
|
||||
|
||||
if (damage < 0)
|
||||
damage = 0;
|
||||
|
@ -49,7 +49,7 @@ public class Overcharge extends SkillChargeBow
|
||||
@Override
|
||||
public void DoSkillCustom(Player player, float charge, Arrow arrow)
|
||||
{
|
||||
double damage = charge * (getLevel(player));
|
||||
double damage = charge * (1.5 + 1.5 * getLevel(player));
|
||||
_arrows.put(arrow, damage);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
@ -78,25 +79,26 @@ public class Sharpshooter extends Skill
|
||||
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
|
||||
return;
|
||||
|
||||
int bonus = 1;
|
||||
int bonus = 0;
|
||||
if (_hitCount.containsKey(player))
|
||||
bonus = _hitCount.get(player);
|
||||
|
||||
//Increase
|
||||
bonus = Math.min(bonus + 1, 2 * level);
|
||||
_hitCount.put(player, bonus);
|
||||
|
||||
//Damage
|
||||
event.AddMod(player.getName(), GetName(), bonus, true);
|
||||
|
||||
//Increase
|
||||
bonus = Math.min(bonus + 1, 2 * level);
|
||||
|
||||
_hitCount.put(player, bonus);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
|
||||
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + "Damage" ) + C.cGray + ")" ) );
|
||||
UtilPlayer.message(event.GetDamagerPlayer(true), F.main(GetClassType().name(), GetName() + ": " +
|
||||
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + " Damage" ) + C.cGray + ")" ) );
|
||||
|
||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.8f + (float)(bonus * 0.2));
|
||||
|
||||
projectile.remove();
|
||||
|
||||
Recharge.Instance.useForce(player, GetName() + " Timer", 5000);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -45,7 +45,7 @@ public class WolfsPounce extends SkillChargeSword
|
||||
"Taking damage cancels charge.",
|
||||
"",
|
||||
"Colliding with another player",
|
||||
"mid-air deals up to 6 damage",
|
||||
"mid-air deals up to #4#1 damage",
|
||||
"and Slow 2 for 3 seconds."
|
||||
|
||||
});
|
||||
@ -61,7 +61,7 @@ public class WolfsPounce extends SkillChargeSword
|
||||
public void DoSkillCustom(Player player, float charge)
|
||||
{
|
||||
//Action
|
||||
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.3 + (0.8*charge), true);
|
||||
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.4 + (0.9*charge), true);
|
||||
_live.put(player, System.currentTimeMillis());
|
||||
|
||||
//Inform
|
||||
@ -128,7 +128,7 @@ public class WolfsPounce extends SkillChargeSword
|
||||
if (_chargeStore.containsKey(damager))
|
||||
charge = _chargeStore.remove(damager);
|
||||
|
||||
int damage = (int)(6 * charge);
|
||||
int damage = (int)((4 + getLevel(damager)) * charge);
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(damagee, damager, null,
|
||||
|
@ -236,14 +236,14 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
//Sword
|
||||
AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword,
|
||||
1, 4,
|
||||
26, -2,
|
||||
0, 0, true,
|
||||
0, 0,
|
||||
6500, -500, true,
|
||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
|
||||
1, 4,
|
||||
50, -4,
|
||||
0, 0,
|
||||
17000, -1000, true,
|
||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
@ -251,21 +251,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
//Axe
|
||||
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
|
||||
1, 4,
|
||||
64, -4,
|
||||
0, 0,
|
||||
12000, 0, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new Flash(this, "Flash", ClassType.Assassin, SkillType.Axe,
|
||||
1, 4,
|
||||
30, -2,
|
||||
0, 0,
|
||||
0, 0, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new Leap(this, "Leap", ClassType.Assassin, SkillType.Axe,
|
||||
1, 4,
|
||||
36, -3,
|
||||
0, 0,
|
||||
10500, -1500, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
@ -273,21 +273,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
//Bow
|
||||
AddSkill(new MarkedForDeath(this, "Marked for Death", ClassType.Assassin, SkillType.Bow,
|
||||
1, 4,
|
||||
40, 0,
|
||||
0, 0,
|
||||
20000, -2000, true,
|
||||
new Material[] {Material.BOW},
|
||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new SmokeArrow(this, "Smoke Arrow", ClassType.Assassin, SkillType.Bow,
|
||||
1, 4,
|
||||
40, 0,
|
||||
0, 0,
|
||||
20000, -2000, true,
|
||||
new Material[] {Material.BOW},
|
||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new SilencingArrow(this, "Silencing Arrow", ClassType.Assassin, SkillType.Bow,
|
||||
1, 4,
|
||||
40, 0,
|
||||
0, 0,
|
||||
20000, -2000, true,
|
||||
new Material[] {Material.BOW},
|
||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||
@ -330,21 +330,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new SeismicSlam(this, "Seismic Slam", ClassType.Brute, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
24000, -2000, true,
|
||||
21000, -1000, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
24000, -2000, true,
|
||||
21000, -1000, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
AddSkill(new WhirlwindAxe(this, "Whirlwind Axe", ClassType.Brute, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
24000, -2000, true,
|
||||
21000, -1000, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
@ -411,7 +411,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
2200, -200, true,
|
||||
3300, -300, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
|
@ -12,6 +12,7 @@ public class Condition
|
||||
{
|
||||
CLOAK,
|
||||
SHOCK,
|
||||
POISON_SHOCK,
|
||||
SILENCE,
|
||||
BURNING,
|
||||
FALLING,
|
||||
@ -19,6 +20,7 @@ public class Condition
|
||||
INVULNERABLE,
|
||||
EXPLOSION,
|
||||
FIRE_ITEM_IMMUNITY,
|
||||
ARCADE_HUNGER_DISABLE,
|
||||
|
||||
CUSTOM,
|
||||
|
||||
|
@ -347,9 +347,17 @@ public class ConditionEffect implements Listener
|
||||
LivingEntity ent = event.GetDamageeEntity();
|
||||
if (ent == null) return;
|
||||
|
||||
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON);
|
||||
if (condition == null) return;
|
||||
//Ignore Poison Shock
|
||||
Condition poisonShock = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
|
||||
if (poisonShock != null)
|
||||
{
|
||||
event.SetCancelled("Poison Shock - Poison Cancel");
|
||||
return;
|
||||
}
|
||||
|
||||
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON);
|
||||
if (condition == null)
|
||||
return;
|
||||
//Damage
|
||||
event.SetDamager(condition.GetSource());
|
||||
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
|
||||
@ -357,6 +365,24 @@ public class ConditionEffect implements Listener
|
||||
event.SetKnockback(false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PoisonShock(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (LivingEntity ent : Manager.GetActiveConditions().keySet())
|
||||
{
|
||||
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
|
||||
if (condition == null)
|
||||
continue;
|
||||
|
||||
Manager.getDamagerManager().NewDamageEvent(ent, condition.GetSource(), null,
|
||||
DamageCause.CUSTOM, 0.1, false, true, false,
|
||||
condition.GetSource().getName(), "Poison");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Fall(CustomDamageEvent event)
|
||||
{
|
||||
|
@ -246,6 +246,14 @@ public class ConditionFactory
|
||||
Material.SLIME_BALL, (byte)14, showIndicator, ambient));
|
||||
}
|
||||
|
||||
public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, boolean extend)
|
||||
{
|
||||
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||
ConditionType.POISON_SHOCK, 0, (int)(20 * duration), extend,
|
||||
Material.SLIME_BALL, (byte)14, false, false));
|
||||
}
|
||||
|
||||
public Condition Confuse(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
|
||||
{
|
||||
@ -277,4 +285,12 @@ public class ConditionFactory
|
||||
ConditionType.HEALTH_BOOST, mult, (int)(20 * duration), extend,
|
||||
Material.APPLE, (byte)0, showIndicator, ambient));
|
||||
}
|
||||
|
||||
public Condition ArcadeHungerDisable(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, boolean extend)
|
||||
{
|
||||
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||
ConditionType.ARCADE_HUNGER_DISABLE, 0, (int)(20 * duration), extend,
|
||||
Material.COAL, (byte)0, false, false));
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.minecraft.game.core.condition.events.ConditionApplyEvent;
|
||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -40,6 +41,8 @@ public class ConditionManager extends MiniPlugin
|
||||
private ConditionApplicator _applicator;
|
||||
protected ConditionEffect Effect;
|
||||
|
||||
private DamageManager _damageManager;
|
||||
|
||||
private WeakHashMap<LivingEntity, LinkedList<Condition>> _conditions = new WeakHashMap<LivingEntity, LinkedList<Condition>>();
|
||||
private WeakHashMap<LivingEntity, LinkedList<ConditionActive>> _activeConditions = new WeakHashMap<LivingEntity, LinkedList<ConditionActive>>();
|
||||
|
||||
@ -54,6 +57,16 @@ public class ConditionManager extends MiniPlugin
|
||||
Effect();
|
||||
}
|
||||
|
||||
public void setDamageManager(DamageManager damageManager)
|
||||
{
|
||||
_damageManager = damageManager;
|
||||
}
|
||||
|
||||
public DamageManager getDamagerManager()
|
||||
{
|
||||
return _damageManager;
|
||||
}
|
||||
|
||||
public ConditionFactory Factory()
|
||||
{
|
||||
if (_factory == null)
|
||||
|
@ -253,6 +253,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_damageManager = damageManager;
|
||||
_damageManager.UseSimpleWeaponDamage = true;
|
||||
_damageManager.setConditionManager(_conditionManager);
|
||||
_conditionManager.setDamageManager(_damageManager);
|
||||
|
||||
_disguiseManager = disguiseManager;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public enum GameType
|
||||
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
|
||||
Micro(Micro.class, GameDisplay.Micro),
|
||||
MilkCow(MilkCow.class, GameDisplay.MilkCow),
|
||||
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://chivebox.com/file/c/ResMinestrike.zip", true),
|
||||
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://chivebox.com/mineplex/ResMinestrike.zip", true),
|
||||
MineWare(MineWare.class, GameDisplay.MineWare),
|
||||
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
|
||||
Paintball(Paintball.class, GameDisplay.Paintball),
|
||||
|
@ -363,7 +363,7 @@ public class MineStrike extends TeamGame
|
||||
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
|
||||
|
||||
//Armor
|
||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 0, 0));
|
||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 75, 75));
|
||||
}
|
||||
}
|
||||
else if (team.GetColor() == ChatColor.AQUA)
|
||||
@ -379,7 +379,7 @@ public class MineStrike extends TeamGame
|
||||
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
|
||||
|
||||
//Armor
|
||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(0, 0, 255));
|
||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(125, 200, 255));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1233,8 +1233,6 @@ public class MineStrike extends TeamGame
|
||||
|
||||
//Effect
|
||||
damagee.getWorld().playSound(damagee.getLocation(), Sound.IRONGOLEM_DEATH, 1f, 1f);
|
||||
|
||||
event.SetKnockback(false);
|
||||
}
|
||||
//Standard
|
||||
else
|
||||
@ -1243,9 +1241,9 @@ public class MineStrike extends TeamGame
|
||||
event.AddMod(damager.getName(), "Knife", 6 - event.GetDamage(), false);
|
||||
|
||||
event.GetDamageeEntity().getWorld().playSound(event.GetDamageeEntity().getLocation(), Sound.BAT_HURT, 1f, 1f);
|
||||
|
||||
event.AddKnockback("Knife", 1.2);
|
||||
}
|
||||
|
||||
event.SetKnockback(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1307,12 +1305,11 @@ public class MineStrike extends TeamGame
|
||||
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getHelmet()) ||
|
||||
(_scoped.containsKey(event.GetDamageePlayer()) && UtilGear.isMat(_scoped.get(event.GetDamageePlayer()), Material.LEATHER_HELMET)))
|
||||
{
|
||||
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*1, false);
|
||||
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*0.5, false);
|
||||
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SPIDER_DEATH, 1f, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SLIME_ATTACK, 1f, 1f);
|
||||
}
|
||||
}
|
||||
@ -1384,16 +1381,16 @@ public class MineStrike extends TeamGame
|
||||
|
||||
public boolean hitBody(Player player, Location loc)
|
||||
{
|
||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 && //0.6 is ideal
|
||||
loc.getY() > player.getLocation().getY() &&
|
||||
loc.getY() < player.getEyeLocation().getY() - 0.1;
|
||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 &&
|
||||
loc.getY() >= player.getLocation().getY() &&
|
||||
loc.getY() <= player.getEyeLocation().getY();
|
||||
}
|
||||
|
||||
public boolean hitHead(Player player, Location loc)
|
||||
{
|
||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 && //0.3 was old value, too large
|
||||
loc.getY() >= player.getEyeLocation().getY() - 0.1 &&
|
||||
loc.getY() < player.getEyeLocation().getY() + 0.1; //0.2 was old value, too large
|
||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 &&
|
||||
loc.getY() >= player.getEyeLocation().getY() + 0.0 &&
|
||||
loc.getY() < player.getEyeLocation().getY() + 0.2;
|
||||
}
|
||||
|
||||
|
||||
@ -2722,7 +2719,7 @@ public class MineStrike extends TeamGame
|
||||
public void fireDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetCause() == DamageCause.FIRE)
|
||||
event.AddMod(this.GetName(), "Fire", 3, false);
|
||||
event.AddMod(this.GetName(), "Fire", 1, false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -3043,4 +3040,23 @@ public class MineStrike extends TeamGame
|
||||
|
||||
return SpectatorSpawn;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void enableScpResPack(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.getMessage().equalsIgnoreCase("/rpoff"))
|
||||
{
|
||||
event.getPlayer().setResourcePack("http://file.mineplex.com/ResReset.zip");
|
||||
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cRed + "Disabled"));
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpon") + " to enable."));
|
||||
}
|
||||
else if (event.getMessage().equalsIgnoreCase("/rpon"))
|
||||
{
|
||||
event.getPlayer().setResourcePack(GetType().getResourcePackUrl());
|
||||
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cGreen + "Enabled"));
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpoff") + " to disable."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,12 +238,12 @@ public class ShopManager
|
||||
|
||||
else if (item instanceof Helmet)
|
||||
{
|
||||
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
|
||||
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(255, 75, 75) : Color.fromRGB(125, 200, 255));
|
||||
}
|
||||
|
||||
else if (item instanceof Kevlar)
|
||||
{
|
||||
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
|
||||
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(255, 75, 75) : Color.fromRGB(125, 200, 255));
|
||||
}
|
||||
|
||||
else if (item instanceof DefusalKit)
|
||||
|
@ -84,7 +84,7 @@ public abstract class FireGrenadeBase extends Grenade
|
||||
game.Manager.GetBlockRestore().Add(block, 51, (byte)0, (long) time);
|
||||
}
|
||||
}
|
||||
}, 60 - (int)(60d * blocks.get(block)));
|
||||
}, 30 - (int)(30d * blocks.get(block)));
|
||||
}
|
||||
|
||||
//Initial Burn Sound
|
||||
|
@ -68,8 +68,8 @@ public class FlashBang extends Grenade
|
||||
double flashIntensity = 2 - UtilMath.offset(player.getEyeLocation().add(player.getLocation().getDirection()), eyeToGrenade);
|
||||
|
||||
//Duration
|
||||
double duration = (2 + (3 * (players.get(player)))) * flashIntensity;
|
||||
duration += 1;
|
||||
double duration = (2 + (2 * (players.get(player)))) * flashIntensity;
|
||||
duration = (Math.min(5, duration));
|
||||
|
||||
//Blind
|
||||
game.Manager.GetCondition().Factory().Blind(getName(), player, _thrower, duration, 0, false, false, false);
|
||||
|
@ -87,7 +87,7 @@ public abstract class Grenade extends StrikeItem
|
||||
int alreadyHas = 0;
|
||||
int bestSlot = -1;
|
||||
|
||||
for (int i = 5 ; i >= 3 ; i--)
|
||||
for (int i = 6 ; i >= 3 ; i--)
|
||||
{
|
||||
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
|
||||
alreadyHas++;
|
||||
|
@ -43,7 +43,7 @@ public class HighExplosive extends Grenade
|
||||
ent.getWorld().playSound(ent.getLocation(),
|
||||
Sound.EXPLODE, 3f, 0.8f);
|
||||
|
||||
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 10);
|
||||
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 9);
|
||||
List<Player> damagedPlayers = new ArrayList<>();
|
||||
for (Player player : players.keySet())
|
||||
{
|
||||
|
@ -31,9 +31,13 @@ public class Smoke extends Grenade
|
||||
{
|
||||
if (ent.getTicksLived() > 60)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
|
||||
// UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
|
||||
// ViewDist.MAX, UtilServer.getPlayers());
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.CLOUD, ent.getLocation(), 1.5f, 1.5f, 1.5f, 0, 100,
|
||||
ViewDist.MAX, UtilServer.getPlayers());
|
||||
|
||||
|
||||
ent.getWorld().playSound(ent.getLocation(), Sound.FIZZ, 0.1f, 0.1f);
|
||||
|
||||
for (Location loc : game.Manager.GetBlockRestore().RestoreBlockAround(Material.FIRE, ent.getLocation(), 5))
|
||||
|
@ -273,8 +273,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
||||
return;
|
||||
}
|
||||
|
||||
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
|
||||
if(event.getBlock().getLocation().getBlockY() < _maxY)
|
||||
if(event.getBlock().getLocation().getBlockY() < _maxY - 4)
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||
event.setCancelled(true);
|
||||
@ -298,7 +297,6 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
||||
}
|
||||
|
||||
Location blockLocation = event.getBlock().getLocation();
|
||||
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 3;
|
||||
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
|
||||
{
|
||||
for(Player humans: _runners.GetPlayers(true))
|
||||
@ -317,7 +315,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
||||
}
|
||||
}
|
||||
|
||||
if(blockLocation.getBlockY() < _maxY)
|
||||
if(blockLocation.getBlockY() < _maxY - 3)
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||
event.setCancelled(true);
|
||||
@ -435,6 +433,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
|
||||
_maxY = GetTeamList().get(1).GetSpawn().getBlockY();
|
||||
UtilTextMiddle.display(C.cGreen + "Humans Hiding",
|
||||
"15 Seconds until Assault", 10, 80, 10);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class PerkBlockRestorer extends Perk implements IThrown
|
||||
|
||||
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COMMAND));
|
||||
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
|
||||
Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, false, 0.5f);
|
||||
Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, true, 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.teleport.event.MineplexTeleportEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
@ -854,6 +855,9 @@ public class GameFlagManager implements Listener
|
||||
if (game.HungerSet != -1)
|
||||
for (Player player : game.GetPlayers(true))
|
||||
{
|
||||
if (Manager.GetCondition().HasCondition(player, ConditionType.ARCADE_HUNGER_DISABLE, null))
|
||||
continue;
|
||||
|
||||
player.setFoodLevel(game.HungerSet);
|
||||
player.setSaturation(1F);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user