champions balance

This commit is contained in:
Cheese 2015-11-14 11:05:51 +11:00
parent 25f299b490
commit 5586132429
24 changed files with 463 additions and 367 deletions

View File

@ -55,7 +55,7 @@ public class Flash extends SkillActive
@Override
public String GetRechargeString()
{
return "Recharge: #10#-1 Seconds per Charge";
return "Recharge: #8#-1 Seconds per Charge";
}
@Override
@ -84,7 +84,7 @@ public class Flash extends SkillActive
}
@EventHandler
public void Recharge(UpdateEvent event)
public void recharge(UpdateEvent event)
{
for (Player cur : GetUsers())
{
@ -100,7 +100,7 @@ public class Flash extends SkillActive
if (charges >= 1 + level)
continue;
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 10000 - (1000 * level), false, false))
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 8000 - (1000 * level), false, false))
continue;
_flash.put(cur, charges + 1);

View File

@ -107,6 +107,9 @@ public class Illusion extends SkillActive
UtilEnt.Vegetate(skel);
UtilEnt.silence(skel, true);
skel.setMaxHealth(7);
skel.setHealth(7);
ClassCombatCreatureAllowSpawnEvent disableEvent = new ClassCombatCreatureAllowSpawnEvent(false);
UtilServer.getServer().getPluginManager().callEvent(disableEvent);

View File

@ -31,6 +31,7 @@ import org.bukkit.event.player.PlayerDropItemEvent;
public class Recall extends Skill
{
private HashMap<Player, LinkedList<Location>> _locMap = new HashMap<Player, LinkedList<Location>>();
private HashMap<Player, LinkedList<Double>> _healthMap = new HashMap<Player, LinkedList<Double>>();
public Recall(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
{
@ -52,7 +53,7 @@ public class Recall extends Skill
}
@EventHandler
public void Use(PlayerDropItemEvent event)
public void use(PlayerDropItemEvent event)
{
Player player = event.getPlayer();
@ -79,9 +80,17 @@ public class Recall extends Skill
if (locs == null)
return;
LinkedList<Double> health = _healthMap.remove(player);
if (health == null)
return;
//Heal
player.setHealth(health.getLast());
//Effect
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
//Teleport
Location current = player.getLocation();
Location target = locs.getLast();
@ -102,21 +111,32 @@ public class Recall extends Skill
}
@EventHandler
public void StoreLocation(UpdateEvent event)
public void storeLocation(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player cur : GetUsers())
{
//Create
if (!_locMap.containsKey(cur))
_locMap.put(cur, new LinkedList<Location>());
if (!_healthMap.containsKey(cur))
_healthMap.put(cur, new LinkedList<Double>());
//Store
_locMap.get(cur).addFirst(cur.getLocation());
_healthMap.get(cur).addFirst(cur.getHealth());
int level = getLevel(cur);
//Cull
if (_locMap.get(cur).size() > (2 + 2 * level) * 20)
_locMap.get(cur).removeLast();
if (_healthMap.get(cur).size() > (2 + 2 * level) * 20)
_healthMap.get(cur).removeLast();
}
}

View File

@ -52,7 +52,7 @@ public class SilencingArrow extends SkillActive
SetDesc(new String[]
{
"Your next arrow will Silence",
"target for #1#3 seconds.",
"target for #2#2 seconds.",
"",
"Silence stops skills being used."
});
@ -129,7 +129,7 @@ public class SilencingArrow extends SkillActive
if (level == 0) return;
//Confuse
Factory.Condition().Factory().Silence(GetName(), damagee, damager, 3 + 3*level, true, true);
Factory.Condition().Factory().Silence(GetName(), damagee, damager, 2 + 2*level, true, true);
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.BLAZE_BREATH, 2.5f, 2.0f);

View File

@ -112,7 +112,7 @@ public class BlockToss extends SkillCharge implements IThrown
}
// Ladder and beacon grabs
if (grab.getType() == Material.LADDER || grab.getType() == Material.BEACON)
if (grab.getType() == Material.LADDER || grab.getType() == Material.BEACON || grab.getType() == Material.WEB)
{
UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block."));
return;
@ -288,7 +288,17 @@ public class BlockToss extends SkillCharge implements IThrown
if (block.getType() != fall.getMaterial())
continue;
block.setTypeIdAndData(0, (byte)0, false);
//No idea why i was doing this
//block.setTypeIdAndData(0, (byte)0, false);
//Added this to fix ^
if (!UtilBlock.airFoliage(block))
continue;
int id = fall.getBlockId();
if (id == 12) id = Material.SANDSTONE.getId();
if (id == 13) id = Material.STONE.getId();
//Block Replace
Factory.BlockRestore().Add(block, fall.getBlockId(), (byte)0, 10000);

View File

@ -18,7 +18,7 @@ public class Colossus extends Skill
SetDesc(new String[]
{
"You are so huge that you take",
"#15#20 % less knockback from attacks."
"50% less knockback from attacks."
});
}
@ -36,7 +36,7 @@ public class Colossus extends Skill
//Damage
event.AddMod(damagee.getName(), GetName(), 0, false);
event.AddKnockback(GetName(), 0.85 - 0.20*level);
event.AddKnockback(GetName(), 0.5);
}
@Override

View File

@ -58,7 +58,7 @@ public class DwarfToss extends SkillActive
SetDesc(new String[]
{
"Hold Block to pick up target player.",
"Release Block to throw with #1.2#0.2 velocity.",
"Release Block to throw target player.",
"",
"Players you are holding cannot harm",
"you, or be harmed by others.",
@ -209,8 +209,8 @@ public class DwarfToss extends SkillActive
_time.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You picked up " + F.name(UtilEnt.getName(target)) + " with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(player.getName()) + " grabbed you with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You picked up " + F.name(UtilEnt.getName(target)) + " with " + F.skill(GetName()) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(player.getName()) + " grabbed you with " + F.skill(GetName()) + "."));
//Hide!
if (target instanceof Player)
@ -303,9 +303,8 @@ public class DwarfToss extends SkillActive
{
LivingEntity target = _holding.remove(cur);
_time.remove(cur);
int level = getLevel(cur);
UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(UtilEnt.getName(target)) + " escaped your " + F.skill(GetName(level)) + "."));
UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(UtilEnt.getName(target)) + " escaped your " + F.skill(GetName()) + "."));
//Show!
if (target instanceof Player)
@ -316,7 +315,6 @@ public class DwarfToss extends SkillActive
{
final LivingEntity target = _holding.remove(cur);
long time = _time.remove(cur);
int level = getLevel(cur);
//Time Reduce
double timeScale = 1;
@ -332,7 +330,7 @@ public class DwarfToss extends SkillActive
//Throw
cur.eject();
target.leaveVehicle();
final double mult = (1.2 + (0.2 * level)) * timeScale;
final double mult = (1.8) * timeScale;
//Delay
Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable()
@ -351,8 +349,8 @@ public class DwarfToss extends SkillActive
}, 5);
//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)) + "."));
UtilPlayer.message(cur, F.main(GetClassType().name(), "You threw " + F.name(UtilEnt.getName(target)) + " with " + F.skill(GetName()) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(cur.getName()) + " threw you with " + F.skill(GetName()) + "."));
}
}

View File

@ -51,8 +51,8 @@ public class FleshHook extends SkillActiveCharge implements IThrown
GetChargeString(),
"",
"If Flesh Hook hits a player, it",
"deals up to #2#2 damage, and rips them",
"towards you with #1.2#0.2 velocity.",
"deals up to #5#1 damage, and rips them",
"towards you with #1.2#0.3 velocity.",
});
}
@ -142,14 +142,14 @@ public class FleshHook extends SkillActiveCharge implements IThrown
//Pull
UtilAction.velocity(target,
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
1.2 + (0.2 * level), false, 0, 0.8, 1.5, true);
1.2 + (0.3 * level), false, 0, 0.7, 1.2, true);
//Condition
Factory.Condition().Factory().Falling(GetName(), target, player, 10, false, true);
//Damage Event
Factory.Damage().NewDamageEvent(target, player, null,
DamageCause.CUSTOM, velocity * (1 + (1*level)), false, true, false,
DamageCause.CUSTOM, 5 + level, false, true, false,
player.getName(), GetName());

View File

@ -81,7 +81,7 @@ public class SeismicSlam extends SkillActive
{
"Jump up and slam back into the ground.",
"Players within #5.5#0.5 Blocks take up to",
"#1#1 damage and are thrown into the air.",
"#1#1 damage and are smashed away from you.",
});
}
@ -151,7 +151,7 @@ public class SeismicSlam extends SkillActive
//Velocity
UtilAction.velocity(cur,
UtilAlg.getTrajectory2d(player.getLocation().toVector(), cur.getLocation().toVector()),
0.4 + 2 * targets.get(cur), true, 0, 0.2 + 1.2 * targets.get(cur), 1.6, true);
0.6 + 2 * targets.get(cur), true, 0, 0.2 + 1.0 * targets.get(cur), 1.4, true);
//Condition
Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true);

View File

@ -67,8 +67,9 @@ public class HoldPosition extends SkillActive
double duration = 3 + (1 * level);
//Action
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 3, false, true, false, true);
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 2, false, true, true);
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);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -49,7 +49,7 @@ public class Riposte extends SkillActive
"to riposte.",
"",
"If successful, you deal an additional",
"#0.5#0.5 bonus damage.",
"#0#0.5 bonus damage.",
"",
"You must block, parry, then riposte",
"all within 1 second of each other."
@ -155,7 +155,7 @@ public class Riposte extends SkillActive
_prepare.remove(damager);
//Damage
event.AddMod(damager.getName(), GetName(), 0.5 + 0.5 * level, true);
event.AddMod(damager.getName(), GetName(), 0.5 * level, true);
//Effect
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 1f, 1.2f);
@ -163,8 +163,6 @@ public class Riposte extends SkillActive
//UtilPlayer.health(damager, 1);
//UtilParticle.PlayParticle(ParticleType.HEART, damager.getEyeLocation(), 0, 0.3f, 0, 0, 1);
//Inform
UtilPlayer.message(damager, F.main(GetClassType().name(), "You countered with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(damager.getName()) + " countered with " + F.skill(GetName(level)) + "."));

View File

@ -46,10 +46,9 @@ public class ArcticArmor extends Skill
"",
"Create a freezing area around you",
"in a #3#1 Block radius. Allies inside",
"this area receive Protection 1.",
"this area receive Protection 2.",
"",
"You are permanently immune to the",
"Slowing effect of snow."
"You receive Protection 1."
});
}
@ -177,7 +176,7 @@ public class ArcticArmor extends Skill
//Protection
for (Player other : UtilPlayer.getNearby(cur.getLocation(), 3 + getLevel(cur)))
if (!Factory.Relation().canHurt(cur, other) || other.equals(cur))
Factory.Condition().Factory().Protection(GetName(), other, cur, 1.9, 0, false, true, true);
Factory.Condition().Factory().Protection(GetName(), other, cur, 1.9, cur.equals(other) ? 0 : 1, false, true, true);
}
}
@ -222,43 +221,6 @@ public class ArcticArmor extends Skill
}
}
// @EventHandler
// public void Slow(UpdateEvent event)
// {
// if (event.getType() != UpdateType.TICK)
// return;
//
// for (Player cur : UtilServer.getPlayers())
// {
// if (cur.getLocation().getChunk() == null)
// continue;
//
// Block block = cur.getLocation().getBlock();
//
// if (block.getTypeId() != 78)
// continue;
//
// if (block.getData() == 0)
// continue;
//
// if (getLevel(cur) > 0)
// continue;
//
// int level = 0;
// if (block.getData() == 2 || block.getData() == 3)
// level = 1;
// else if (block.getData() == 4 || block.getData() == 5)
// level = 2;
// else if (block.getData() == 6 || block.getData() == 7)
// level = 3;
//
// //Slow
// Factory.Condition().Factory().Custom("Thick Snow", cur, cur,
// ConditionType.SLOW, 1.9, level, false,
// Material.SNOW_BALL, (byte)0, true);
// }
// }
@EventHandler
public void Particle(UpdateEvent event)
{

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 seconds.",
"thats lasts for #3#1.5 seconds.",
});
}
@ -148,7 +148,7 @@ public class IcePrison extends SkillActive implements IThrown
if (!UtilBlock.airFoliage(freeze))
return;
long time = 2500 + (1000 * level);
long time = 3500 + (1500 * level);
int yDiff = freeze.getY() - mid.getY();

View File

@ -11,12 +11,14 @@ import org.bukkit.event.*;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
@ -24,6 +26,9 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.core.condition.Condition;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import org.bukkit.event.player.*;
@ -78,8 +83,8 @@ public class LightningOrb extends SkillActive implements IThrown
"Launch a lightning orb. Upon a direct",
"hit with player, or #5#-0.4 seconds, it will",
"strike all enemies within #3#0.5 Blocks ",
"with lightning, giving them Slow 2",
"for 4 seconds."
"with lightning, dealing #4#1 damage and",
"giving Slow 2 for 4 seconds."
});
}
@ -147,12 +152,6 @@ public class LightningOrb extends SkillActive implements IThrown
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(data.GetThrown().getLocation(), 3 + 0.5 * level);
//Lightning Condition
for (LivingEntity cur : hit.keySet())
{
Factory.Condition().Factory().Lightning(GetName(), cur, player, 0, 0.5, false, true);
}
List<LivingEntity> struck = new ArrayList<>();
//Lightning
@ -161,14 +160,16 @@ public class LightningOrb extends SkillActive implements IThrown
if (cur.equals(player))
continue;
if (cur instanceof Player)
{
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(player.getName()) + " hit you with " + F.skill(GetName(level)) + "."));
}
//Lightning
cur.getWorld().strikeLightning(cur.getLocation());
cur.getWorld().strikeLightningEffect(cur.getLocation());
//Damage Event
Factory.Damage().NewDamageEvent(cur, player, null,
DamageCause.LIGHTNING, 4 + level, false, true, false,
player.getName(), GetName());
struck.add(cur);
}
@ -180,6 +181,7 @@ public class LightningOrb extends SkillActive implements IThrown
continue;
Factory.Condition().Factory().Slow(GetName(), cur, player, 4, 1, false, true, true, true);
Factory.Condition().Factory().Shock(GetName(), cur, player, 1, false, true);
}
Bukkit.getPluginManager().callEvent(new LightningOrbEvent(player, struck));

View File

@ -32,7 +32,7 @@ public class Barrage extends SkillChargeBow
SkillType skillType, int cost, int maxLevel)
{
super(skills, name, classType, skillType, cost, maxLevel,
0.012f, 0.006f, false, true);
0.016f, 0.008f, false, true);
SetDesc(new String[]
{

View File

@ -55,10 +55,13 @@ public class HealingShot extends SkillActive
SetDesc(new String[]
{
"Prepare a healing shot;",
"Prepare a Healing Shot;",
"",
"Your next arrow will give its target",
"Regeneration 2 for #5#1 seconds,",
"and remove all negative effects."
"Regeneration 3 for #5#1 seconds,",
"and remove all negative effects.",
"",
"Gives Nausea to enemies for #5#1 seconds."
});
}
@ -109,7 +112,7 @@ public class HealingShot extends SkillActive
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.NORMAL)
public void ArrowHit(EntityDamageEvent event)
public void arrowHit(EntityDamageEvent event)
{
if (event.getCause() != DamageCause.PROJECTILE)
return;
@ -128,10 +131,10 @@ public class HealingShot extends SkillActive
if (!_arrows.contains((Entity)projectile))
return;
if (!(event.getEntity() instanceof LivingEntity))
if (!(event.getEntity() instanceof Player))
return;
LivingEntity damagee = (LivingEntity)event.getEntity();
Player damagee = (Player)event.getEntity();
if (projectile.getShooter() == null)
return;
@ -150,7 +153,9 @@ public class HealingShot extends SkillActive
projectile.remove();
//Regen
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + 2 * level, 1, false, true, true);
if (Factory.Relation().canHurt(damager, damagee))
{
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 5 + level, 2, false, false, false);
//Remove Bad
damagee.setFireTicks(0);
@ -158,6 +163,11 @@ public class HealingShot extends SkillActive
damagee.removePotionEffect(PotionEffectType.POISON);
damagee.removePotionEffect(PotionEffectType.CONFUSION);
damagee.removePotionEffect(PotionEffectType.WEAKNESS);
}
else
{
Factory.Condition().Factory().Confuse(GetName(), damagee, damager, 5 + level, 2, false, false, false);
}
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.LEVEL_UP, 1f, 1.5f);
@ -181,7 +191,7 @@ public class HealingShot extends SkillActive
}
@EventHandler
public void Particle(UpdateEvent event)
public void particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
@ -194,7 +204,7 @@ public class HealingShot extends SkillActive
}
@EventHandler
public void Clean(UpdateEvent event)
public void clean(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;

View File

@ -1,178 +1,178 @@
package mineplex.minecraft.game.classcombat.Skill.Ranger;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class IncendiaryShot extends SkillActive
{
private HashSet<Entity> _arrows = new HashSet<Entity>();
private HashSet<Player> _active = new HashSet<Player>();
public IncendiaryShot(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
int energy, int energyMod,
long recharge, long rechargeMod, boolean rechargeInform,
Material[] itemArray,
Action[] actionArray)
{
super(skills, name, classType, skillType,
cost, levels,
energy, energyMod,
recharge, rechargeMod, rechargeInform,
itemArray,
actionArray);
SetDesc(new String[]
{
"Prepare an incendiary shot;",
"Your next arrow will ignite",
"its target for #2#1 seconds."
});
}
@Override
public boolean CustomCheck(Player player, int level)
{
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
return true;
}
@Override
public void Skill(Player player, int level)
{
//Action
_active.add(player);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared " + F.skill(GetName(level)) + "."));
//Effect
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 2.5f, 2.0f);
}
@EventHandler
public void ShootBow(EntityShootBowEvent event)
{
if (!(event.getEntity() instanceof Player))
return;
if (!(event.getProjectile() instanceof Arrow))
return;
Player player = (Player)event.getEntity();
if (!_active.remove(player))
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
event.getProjectile().setFireTicks(200);
}
@EventHandler(priority = EventPriority.HIGH)
public void ArrowHit(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.PROJECTILE)
return;
Projectile projectile = event.GetProjectile();
if (projectile == null) return;
if (!_arrows.contains((Entity)projectile))
return;
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
//Level
int level = getLevel(damager);
if (level == 0) return;
//Ignite
Factory.Condition().Factory().Ignite(GetName(), damagee, damager, 2 + level, true, true);
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.FIZZ, 2f, 1.5f);
//Remove
projectile.remove();
}
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _arrows)
{
UtilParticle.PlayParticle(ParticleType.FLAME, ent.getLocation(), 0, 0, 0, 0, 1,
ViewDist.MAX, UtilServer.getPlayers());
}
}
@EventHandler
public void Clean(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
for (Iterator<Entity> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
{
Entity arrow = arrowIterator.next();
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
{
arrowIterator.remove();
}
}
}
@Override
public void Reset(Player player)
{
_active.remove(player);
}
}
//package mineplex.minecraft.game.classcombat.Skill.Ranger;
//
//import java.util.HashSet;
//import java.util.Iterator;
//
//import org.bukkit.Material;
//import org.bukkit.Sound;
//import org.bukkit.entity.Arrow;
//import org.bukkit.entity.Entity;
//import org.bukkit.entity.LivingEntity;
//import org.bukkit.entity.Player;
//import org.bukkit.entity.Projectile;
//import org.bukkit.event.EventHandler;
//import org.bukkit.event.EventPriority;
//import org.bukkit.event.block.Action;
//import org.bukkit.event.entity.EntityShootBowEvent;
//import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
//
//import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
//import mineplex.minecraft.game.core.damage.CustomDamageEvent;
//import mineplex.core.common.util.F;
//import mineplex.core.common.util.UtilParticle;
//import mineplex.core.common.util.UtilServer;
//import mineplex.core.updater.event.UpdateEvent;
//import mineplex.core.updater.UpdateType;
//import mineplex.core.common.util.UtilPlayer;
//import mineplex.core.common.util.UtilParticle.ParticleType;
//import mineplex.core.common.util.UtilParticle.ViewDist;
//import mineplex.minecraft.game.classcombat.Skill.SkillActive;
//import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
//
//public class IncendiaryShot extends SkillActive
//{
// private HashSet<Entity> _arrows = new HashSet<Entity>();
// private HashSet<Player> _active = new HashSet<Player>();
//
// public IncendiaryShot(SkillFactory skills, String name, ClassType classType, SkillType skillType,
// int cost, int levels,
// int energy, int energyMod,
// long recharge, long rechargeMod, boolean rechargeInform,
// Material[] itemArray,
// Action[] actionArray)
// {
// super(skills, name, classType, skillType,
// cost, levels,
// energy, energyMod,
// recharge, rechargeMod, rechargeInform,
// itemArray,
// actionArray);
//
// SetDesc(new String[]
// {
// "Prepare an incendiary shot;",
// "Your next arrow will ignite",
// "its target for #2#1 seconds."
// });
// }
//
// @Override
// public boolean CustomCheck(Player player, int level)
// {
// if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
// {
// UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
// return false;
// }
//
// return true;
// }
//
// @Override
// public void Skill(Player player, int level)
// {
// //Action
// _active.add(player);
//
// //Inform
// UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared " + F.skill(GetName(level)) + "."));
//
// //Effect
// player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 2.5f, 2.0f);
// }
//
// @EventHandler
// public void ShootBow(EntityShootBowEvent event)
// {
// if (!(event.getEntity() instanceof Player))
// return;
//
// if (!(event.getProjectile() instanceof Arrow))
// return;
//
// Player player = (Player)event.getEntity();
//
// if (!_active.remove(player))
// return;
//
// //Inform
// UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
//
// _arrows.add(event.getProjectile());
// event.getProjectile().setFireTicks(200);
// }
//
// @EventHandler(priority = EventPriority.HIGH)
// public void ArrowHit(CustomDamageEvent event)
// {
// if (event.IsCancelled())
// return;
//
// if (event.GetCause() != DamageCause.PROJECTILE)
// return;
//
// Projectile projectile = event.GetProjectile();
// if (projectile == null) return;
//
// if (!_arrows.contains((Entity)projectile))
// return;
//
// LivingEntity damagee = event.GetDamageeEntity();
// if (damagee == null) return;
//
// Player damager = event.GetDamagerPlayer(true);
// if (damager == null) return;
//
// //Level
// int level = getLevel(damager);
// if (level == 0) return;
//
// //Ignite
// Factory.Condition().Factory().Ignite(GetName(), damagee, damager, 2 + level, true, true);
//
// //Damage
// event.AddMod(damager.getName(), GetName(), 0, true);
//
// //Effect
// damagee.getWorld().playSound(damagee.getLocation(), Sound.FIZZ, 2f, 1.5f);
//
// //Remove
// projectile.remove();
// }
//
// @EventHandler
// public void Particle(UpdateEvent event)
// {
// if (event.getType() != UpdateType.TICK)
// return;
//
// for (Entity ent : _arrows)
// {
// UtilParticle.PlayParticle(ParticleType.FLAME, ent.getLocation(), 0, 0, 0, 0, 1,
// ViewDist.MAX, UtilServer.getPlayers());
// }
// }
//
// @EventHandler
// public void Clean(UpdateEvent event)
// {
// if (event.getType() != UpdateType.SEC)
// return;
//
// for (Iterator<Entity> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
// {
// Entity arrow = arrowIterator.next();
//
// if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
// {
// arrowIterator.remove();
// }
// }
// }
//
// @Override
// public void Reset(Player player)
// {
// _active.remove(player);
// }
//}

View File

@ -9,12 +9,15 @@ import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -31,6 +34,7 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class NapalmShot extends SkillActive
{
@ -53,9 +57,13 @@ public class NapalmShot extends SkillActive
SetDesc(new String[]
{
"Prepare a napalm shot;",
"Prepare a Napalm Shot;",
"",
"Your next arrow will burst into",
"#8#8 flames on impact."
"#8#8 flames on impact.",
"",
"If your arrow hit an enemy, it",
"will ignite them for #2#1 seconds."
});
}
@ -85,7 +93,7 @@ public class NapalmShot extends SkillActive
}
@EventHandler
public void BowShoot(EntityShootBowEvent event)
public void bowShoot(EntityShootBowEvent event)
{
if (!(event.getEntity() instanceof Player))
return;
@ -105,8 +113,46 @@ public class NapalmShot extends SkillActive
event.getProjectile().setFireTicks(120);
}
@EventHandler(priority = EventPriority.HIGH)
public void arrowDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.PROJECTILE)
return;
Projectile projectile = event.GetProjectile();
if (projectile == null) return;
if (!_arrows.contains((Entity)projectile))
return;
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
//Level
int level = getLevel(damager);
if (level == 0) return;
//Ignite
Factory.Condition().Factory().Ignite(GetName(), damagee, damager, 2 + level, true, true);
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.FIZZ, 2f, 1.5f);
//Remove
projectile.remove();
}
@EventHandler
public void ProjectileHit(ProjectileHitEvent event)
public void projectileHit(ProjectileHitEvent event)
{
Projectile proj = event.getEntity();
@ -142,20 +188,20 @@ public class NapalmShot extends SkillActive
}
@EventHandler
public void Particle(UpdateEvent event)
public void particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _arrows)
{
UtilParticle.PlayParticle(ParticleType.LAVA, ent.getLocation(), 0, 0, 0, 0, 1,
UtilParticle.PlayParticle(ParticleType.FLAME, ent.getLocation(), 0, 0, 0, 0, 1,
ViewDist.MAX, UtilServer.getPlayers());
}
}
@EventHandler
public void Clean(UpdateEvent event)
public void clean(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;

View File

@ -34,7 +34,7 @@ public class Overcharge extends SkillChargeBow
SkillType skillType, int cost, int maxLevel)
{
super(skills, name, classType, skillType, cost, maxLevel,
0.012f, 0.006f, false, true);
0.016f, 0.008f, false, true);
SetDesc(new String[]
{

View File

@ -2,18 +2,21 @@ package mineplex.minecraft.game.classcombat.Skill.Ranger;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.WeakHashMap;
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.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
@ -33,17 +36,16 @@ public class Sharpshooter extends Skill
SetDesc(new String[]
{
"Consecutive arrow hits deal an",
"additional #1#0.5 damage.",
"Hitting with arrows increases",
"arrow damage by 1 for 5 seconds.",
"",
"Stacks up to #1#1 times",
"",
"Missing an arrow resets the bonus.",
"Stacks up to #0#2 times, and each",
"hit sets duration to 5 seconds."
});
}
@EventHandler
public void ShootBow(EntityShootBowEvent event)
public void shootBow(EntityShootBowEvent event)
{
if (!(event.getEntity() instanceof Player))
return;
@ -56,7 +58,7 @@ public class Sharpshooter extends Skill
}
@EventHandler(priority = EventPriority.HIGH)
public void Damage(CustomDamageEvent event)
public void damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
@ -76,48 +78,69 @@ public class Sharpshooter extends Skill
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
return;
int bonus = 1;
if (_hitCount.containsKey(player))
{
bonus = _hitCount.get(player);
//Damage
event.AddMod(player.getName(), GetName(), _hitCount.get(player) * (1 + 0.5 * level), true);
event.AddMod(player.getName(), GetName(), bonus, true);
int limit = Math.min(1 + level, _hitCount.get(player) + 1);
//Increase
bonus = Math.min(bonus + 1, 2 * level);
_hitCount.put(player, limit);
_hitCount.put(player, bonus);
//Inform
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
F.elem(_hitCount.get(player) + " Consecutive Hits") + C.cGray + " (" + F.skill("+"+ (1 + 0.5 * limit) + "Damage" ) + C.cGray + ")" ) );
}
else
{
_hitCount.put(player, 1);
}
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();
}
@EventHandler
public void Clean(UpdateEvent event)
public void resetViaTime(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
if (event.getType() != UpdateType.TICK)
return;
HashSet<Entity> remove = new HashSet<Entity>();
Iterator<Player> playerIter = _hitCount.keySet().iterator();
for (Entity cur : _arrows.keySet())
if (cur.isDead() || !cur.isValid() || cur.isOnGround())
remove.add(cur);
for (Entity cur : remove)
while (playerIter.hasNext())
{
Player player = _arrows.remove(cur);
Player player = playerIter.next();
if (player != null)
if (_hitCount.remove(player) != null)
UtilPlayer.message(player, F.main(GetClassType().name(), GetName() + ": " + F.elem("0 Consecutive Hits")));
if (Recharge.Instance.usable(player, GetName() + " Timer"))
{
playerIter.remove();
UtilPlayer.message(player, F.main(GetClassType().name(), GetName() + ": " + F.elem("Damage Bonus Reset")));
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.75f);
}
}
}
// @EventHandler
// public void resetViaMiss(UpdateEvent event)
// {
// if (event.getType() != UpdateType.FAST)
// return;
//
// HashSet<Entity> remove = new HashSet<Entity>();
//
// for (Entity cur : _arrows.keySet())
// if (cur.isDead() || !cur.isValid() || cur.isOnGround())
// remove.add(cur);
//
// for (Entity cur : remove)
// {
// Player player = _arrows.remove(cur);
//
// if (player != null)
// if (_hitCount.remove(player) != null)
// UtilPlayer.message(player, F.main(GetClassType().name(), GetName() + ": " + F.elem("0 Consecutive Hits")));
// }
// }
@Override
public void Reset(Player player)

View File

@ -1,12 +1,16 @@
package mineplex.minecraft.game.classcombat.Skill.Ranger;
import java.util.HashMap;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
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.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
@ -18,24 +22,30 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class VitalitySpores extends Skill
{
private HashMap<Player, Long> _lastMove = new HashMap<Player, Long>();
public VitalitySpores(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
{
super(skills, name, classType, skillType, cost, levels);
SetDesc(new String[]
{
"After #5#-1 seconds of not taking damage,",
"forest spores surround you, restoring",
"1 health per second.",
"",
"This remains until you take damage."
"While standing still, forest spores",
"heal you for #0#0.5 health per 2 seconds."
});
}
@EventHandler
public void Update(UpdateEvent event)
public void playerMove(PlayerMoveEvent event)
{
if (event.getType() != UpdateType.SEC)
if (UtilMath.offset(event.getFrom(), event.getTo()) > 0)
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player cur : GetUsers())
@ -43,13 +53,17 @@ public class VitalitySpores extends Skill
int level = getLevel(cur);
if (level == 0) continue;
if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 5000 - 1000*level))
if (!_lastMove.containsKey(cur))
continue;
if (UtilTime.elapsed(_lastMove.get(cur), 2000))
{
//Factory.Condition().Factory().Regen(GetName(), cur, cur, 3.9 + 2*level, 0, false, true, true);
UtilPlayer.health(cur, 1);
UtilPlayer.health(cur, 0.5 * level);
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1,
ViewDist.LONG, UtilServer.getPlayers());
_lastMove.put(cur, System.currentTimeMillis());
}
}
}

View File

@ -118,7 +118,7 @@ public abstract class SkillChargeBow extends SkillCharge implements Listener
continue;
//Delay
if (!UtilTime.elapsed(_chargeStart.get(cur), 1200))
if (!UtilTime.elapsed(_chargeStart.get(cur), 1000))
continue;
float charge = _charge.get(cur);

View File

@ -201,21 +201,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new MarkedForDeath(this, "Marked for Death", ClassType.Assassin, SkillType.Bow,
1, 4,
40, 0,
20000, 0, true,
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,
20000, 0, true,
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,
20000, 0, true,
20000, -2000, true,
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
@ -238,9 +238,9 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Sword
AddSkill(new DwarfToss(this, "Dwarf Toss", ClassType.Brute, SkillType.Sword,
1, 5,
2, 1,
0, 0,
20000, -2000, true,
16000, 0, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -257,21 +257,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new SeismicSlam(this, "Seismic Slam", ClassType.Brute, SkillType.Axe,
1, 5,
0, 0,
30000, -2000, true,
24000, -2000, 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,
30000, -3000, true,
24000, -2000, 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,
30000, -3000, true,
24000, -2000, 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, 1, 3));
AddSkill(new Colossus(this, "Colossus", ClassType.Brute, SkillType.PassiveB, 2, 1));
AddSkill(new Overwhelm(this, "Overwhelm", ClassType.Brute, SkillType.PassiveB, 1, 3));
}
@ -331,7 +331,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new ShieldSmash(this, "Shield Smash", ClassType.Knight, SkillType.Axe,
1, 5,
0, 0,
10000, -1000, true,
15000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -400,7 +400,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new LightningOrb(this, "Lightning Orb", ClassType.Mage, SkillType.Axe,
1, 5,
60, -2,
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}));
@ -408,7 +408,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Fissure(this, "Fissure", 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}));
@ -434,13 +434,12 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new GlacialBlade(this, "Glacial Blade", ClassType.Mage, SkillType.PassiveB,
1, 3,
16, -2,
1200, -200, false,
1200, -250, false,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
AddSkill(new MagmaBlade(this, "Magma Blade", ClassType.Mage, SkillType.PassiveB, 1, 3));
AddSkill(new NullBlade(this, "Null Blade", ClassType.Mage, SkillType.PassiveB, 1, 3));
//AddSkill(new RootingAxe(this, "Rooting Axe", ClassType.Mage, SkillType.PassiveB, 5, 3));
}
public void AddRanger()
@ -451,7 +450,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Disengage(this, "Disengage", ClassType.Ranger, SkillType.Sword,
1, 4,
0, 0,
18000, -2000, true,
16000, -1000, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -480,12 +479,12 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
AddSkill(new IncendiaryShot(this, "Incendiary Shot", ClassType.Ranger, SkillType.Bow,
1, 4,
0, 0,
20000, -2000, true,
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
// AddSkill(new IncendiaryShot(this, "Incendiary Shot", ClassType.Ranger, SkillType.Bow,
// 1, 4,
// 0, 0,
// 20000, -2000, true,
// new Material[] {Material.BOW},
// new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
AddSkill(new NapalmShot(this, "Napalm Shot", ClassType.Ranger, SkillType.Bow,
1, 4,
@ -523,9 +522,9 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Passive B
AddSkill(new BarbedArrows(this, "Barbed Arrows", ClassType.Ranger, SkillType.PassiveB, 1, 3));
AddSkill(new HeavyArrows(this, "Heavy Arrows", ClassType.Ranger, SkillType.PassiveB, 1, 3));
//AddSkill(new Shadowmeld(this, "Shadowmeld", ClassType.Ranger, SkillType.PassiveB, 5, 3));
AddSkill(new Longshot(this, "Longshot", ClassType.Ranger, SkillType.PassiveB, 1, 3));
AddSkill(new Sharpshooter(this, "Sharpshooter", ClassType.Ranger, SkillType.PassiveB, 1, 3));
//AddSkill(new Shadowmeld(this, "Shadowmeld", ClassType.Ranger, SkillType.PassiveB, 5, 3));
//AddSkill(new Fletcher(this, "Fletcher", ClassType.Ranger, SkillType.PassiveB, 5, 3));
}

View File

@ -2,6 +2,7 @@ package mineplex.minecraft.game.core.condition;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.visibility.VisibilityManager;
@ -254,6 +255,15 @@ public class ConditionEffect implements Listener
Condition condition = Manager.GetActiveCondition(ent, ConditionType.LIGHTNING);
if (condition == null) return;
if (event.GetDamageePlayer() != null)
{
if (!Recharge.Instance.use(event.GetDamageePlayer(), "Lightning by " + UtilEnt.getName(condition.GetSource()), 1000, false, false))
{
event.SetCancelled("Lightning Rate");
return;
}
}
//Damage
event.SetDamager(condition.GetSource());
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);