!'magical' -> 'magic'

This commit is contained in:
Indyuce 2019-12-28 15:39:18 +01:00
parent 318fa143b4
commit 9a952187d4
41 changed files with 42 additions and 42 deletions

Binary file not shown.

View File

@ -82,7 +82,7 @@ public class Bouncy_Fireball extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (entity.getLocation().distanceSquared(loc) < radius * radius)
if (MMOUtils.canDamage(stats.getPlayer(), entity)) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).setFireTicks((int) (ignite * 20));
}

View File

@ -64,7 +64,7 @@ public class Burning_Hands extends Ability implements Listener {
if (j % 5 == 0)
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (entity.getLocation().distanceSquared(loc) < 60 && stats.getPlayer().getEyeLocation().getDirection().angle(entity.getLocation().toVector().subtract(stats.getPlayer().getLocation().toVector())) < Math.PI / 6 && MMOUtils.canDamage(stats.getPlayer(), entity))
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
}
}.runTaskTimer(MMOItems.plugin, 0, 2);

View File

@ -65,7 +65,7 @@ public class Contamination extends Ability {
loc.getWorld().playSound(loc, VersionSound.ENTITY_ENDERMAN_HURT.toSound(), 2, 1);
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc) <= 25)
MMOLib.plugin.getDamage().damage(stats.getPlayer(), (LivingEntity) entity, new AttackResult(dps, DamageType.SKILL, DamageType.MAGICAL), false);
MMOLib.plugin.getDamage().damage(stats.getPlayer(), (LivingEntity) entity, new AttackResult(dps, DamageType.SKILL, DamageType.MAGIC), false);
}
}
}.runTaskTimer(MMOItems.plugin, 0, 1);

View File

@ -57,7 +57,7 @@ public class Corrupt extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc) <= radius * radius) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).removePotionEffect(PotionEffectType.WITHER);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.WITHER, (int) (duration * 20), (int) amplifier));
}

View File

@ -71,7 +71,7 @@ public class Corrupted_Fangs extends Ability implements Listener {
Object[] data = MMOItems.plugin.getEntities().getEntityData(damager);
CachedStats stats = (CachedStats) data[0];
if (MMOUtils.canDamage(stats.getPlayer(), event.getEntity()))
new AttackResult((double) data[1], DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) event.getEntity());
new AttackResult((double) data[1], DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) event.getEntity());
}
}
}

View File

@ -74,7 +74,7 @@ public class Cursed_Beam extends Ability {
for (Entity entity : entities)
if (MMOUtils.canDamage(stats.getPlayer(), entity) && loc.distanceSquared(entity.getLocation().add(0, 1, 0)) < 9) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, (int) (duration * 20), 0));
}
cancel();

View File

@ -66,7 +66,7 @@ public class Earthquake extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && loc.distanceSquared(entity.getLocation()) < 2 && !hit.contains(entity.getEntityId())) {
hit.add(entity.getEntityId());
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (slowDuration * 20), (int) slowAmplifier));
}
}

View File

@ -96,7 +96,7 @@ public class Explosive_Turkey extends Ability implements Listener {
chicken.getWorld().playSound(chicken.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2, 1.5f);
for (Entity entity : MMOUtils.getNearbyChunkEntities(chicken.getLocation()))
if (!entity.isDead() && entity.getLocation().distanceSquared(chicken.getLocation()) < radiusSquared && MMOUtils.canDamage(stats.getPlayer(), entity)) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
entity.setVelocity(entity.getLocation().toVector().subtract(chicken.getLocation().toVector()).multiply(.1 * knockback).setY(.4 * knockback));
}
cancel();

View File

@ -65,7 +65,7 @@ public class Fire_Meteor extends Ability {
double radius = ability.getModifier("radius");
for (Entity entity : loc.getWorld().getEntitiesByClass(LivingEntity.class))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc) < radius * radius) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
entity.setVelocity(entity.getLocation().toVector().subtract(loc.toVector()).multiply(.1 * knockback).setY(.4 * knockback));
}
cancel();

View File

@ -67,7 +67,7 @@ public class Firebolt extends Ability {
loc.getWorld().spawnParticle(Particle.LAVA, loc, 8, 0, 0, 0, 0);
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
loc.getWorld().playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, 3, 1);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) target);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) target);
target.setFireTicks((int) ability.getModifier("ignite") * 20);
cancel();
return;

View File

@ -70,7 +70,7 @@ public class Firefly extends Ability {
stats.getPlayer().getWorld().spawnParticle(Particle.FLAME, stats.getPlayer().getLocation().add(0, 1, 0), 24, 0, 0, 0, .3);
entity.setVelocity(stats.getPlayer().getVelocity().setY(0.3).multiply(1.7 * knockback));
stats.getPlayer().setVelocity(stats.getPlayer().getEyeLocation().getDirection().multiply(-3).setY(.5));
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
cancel();
return;
}

View File

@ -73,7 +73,7 @@ public class Freezing_Curse extends Ability {
double damage = ability.getModifier("damage");
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (entity.getLocation().distanceSquared(loc) < radius * radius && MMOUtils.canDamage(stats.getPlayer(), entity)) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).removePotionEffect(PotionEffectType.SLOW);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (duration * 20), (int) amplifier));
}

View File

@ -71,7 +71,7 @@ public class Holy_Missile extends Ability {
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 1);
loc.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc, 32, 0, 0, 0, .2);
loc.getWorld().playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
cancel();
return;
}

View File

@ -81,7 +81,7 @@ public class Ice_Crystal extends Ability {
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
loc.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc, 48, 0, 0, 0, .2);
loc.getWorld().playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
cancel();
return;

View File

@ -72,7 +72,7 @@ public class Life_Ender extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(source))
if (entity.getLocation().distanceSquared(source) < radius * radius && MMOUtils.canDamage(stats.getPlayer(), entity)) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
entity.setVelocity(entity.getLocation().subtract(source).toVector().setY(.75).normalize().multiply(knockback));
}
cancel();

View File

@ -41,7 +41,7 @@ public class Lightning_Beam extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc) <= radius * radius)
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
stats.getPlayer().getWorld().playSound(stats.getPlayer().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_BLAST.toSound(), 1, 0);
loc.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc, 64, 0, 0, 0, .2);

View File

@ -60,7 +60,7 @@ public class Magma_Fissure extends Ability {
if (target.getLocation().distanceSquared(loc) < 1) {
loc.getWorld().playSound(loc, Sound.ENTITY_BLAZE_HURT, 2, 1);
target.setFireTicks((int) (target.getFireTicks() + ability.getModifier("ignite") * 20));
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), target);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), target);
cancel();
}
}

View File

@ -46,7 +46,7 @@ public class Overload extends Ability {
for (Entity entity : stats.getPlayer().getNearbyEntities(radius, radius, radius))
if (MMOUtils.canDamage(stats.getPlayer(), entity))
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
double step = 12 + (radius * 2.5);
for (double j = 0; j < Math.PI * 2; j += Math.PI / step) {

View File

@ -97,7 +97,7 @@ public class Present_Throw extends Ability {
item.getEntity().getWorld().playSound(item.getEntity().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 1.5f);
for (Entity entity : MMOUtils.getNearbyChunkEntities(item.getEntity().getLocation()))
if (entity.getLocation().distanceSquared(item.getEntity().getLocation()) < radiusSquared && MMOUtils.canDamage(stats.getPlayer(), entity))
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
item.close();
cancel();
}

View File

@ -62,7 +62,7 @@ public class Shulker_Missile extends Ability implements Listener {
stats.getPlayer().getWorld().playSound(stats.getPlayer().getLocation(), Sound.ENTITY_WITHER_SHOOT, 2, 2);
ShulkerBullet shulkerBullet = (ShulkerBullet) stats.getPlayer().getWorld().spawnEntity(stats.getPlayer().getLocation().add(0, 1, 0), EntityType.SHULKER_BULLET);
shulkerBullet.setShooter(stats.getPlayer());
MMOItems.plugin.getEntities().registerCustomEntity(shulkerBullet, new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE), ability.getModifier("effect-duration"));
MMOItems.plugin.getEntities().registerCustomEntity(shulkerBullet, new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE), ability.getModifier("effect-duration"));
new BukkitRunnable() {
double ti = 0;

View File

@ -29,7 +29,7 @@ public class Smite extends Ability {
@Override
public void whenCast(CachedStats stats, AbilityResult ability, ItemAttackResult result) {
LivingEntity target = ((TargetAbilityResult) ability).getTarget();
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), target);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), target);
target.getWorld().strikeLightningEffect(target.getLocation());
}
}

View File

@ -41,7 +41,7 @@ public class Sparkle extends Ability {
double radius = ability.getModifier("radius");
double limit = ability.getModifier("limit");
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), target);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), target);
target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation().add(0, 1, 0), 0);
target.getWorld().playSound(target.getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 2);
@ -49,7 +49,7 @@ public class Sparkle extends Ability {
for (Entity entity : target.getNearbyEntities(radius, radius, radius))
if (count < limit && entity instanceof LivingEntity && entity != stats.getPlayer() && !(entity instanceof ArmorStand)) {
count++;
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
entity.getWorld().playSound(entity.getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 2);
Location loc_t = target.getLocation().add(0, .75, 0);
Location loc_ent = entity.getLocation().add(0, .75, 0);

View File

@ -76,7 +76,7 @@ public class Tactical_Grenade extends Ability {
if (entity.equals(target))
cancel();
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
entity.setVelocity(entity.getVelocity().add(offsetVector(knockup)));
}
}

View File

@ -65,7 +65,7 @@ public class Targeted_Fireball extends Ability {
loc.getWorld().spawnParticle(Particle.FLAME, loc, 32, 0, 0, 0, .1);
loc.getWorld().playSound(loc, Sound.ENTITY_BLAZE_HURT, 2, 1);
target.setFireTicks((int) (target.getFireTicks() + ability.getModifier("ignite") * 20));
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGICAL, DamageType.PROJECTILE).damage(stats.getPlayer(), target);
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), target);
cancel();
}
}

View File

@ -58,7 +58,7 @@ public class Arcane_Hail extends Ability {
loc1.getWorld().playSound(loc1, VersionSound.ENTITY_ENDERMAN_HURT.toSound(), 1, 0);
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc1))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc1) <= 4)
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
loc1.getWorld().spawnParticle(Particle.SPELL_WITCH, loc1, 12, 0, 0, 0, .1);
loc1.getWorld().spawnParticle(Particle.SMOKE_NORMAL, loc1, 6, 0, 0, 0, .1);

View File

@ -69,7 +69,7 @@ public class Arcane_Rift extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), entity) && loc.distanceSquared(entity.getLocation()) < 2 && !hit.contains(entity.getEntityId())) {
hit.add(entity.getEntityId());
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (slowDuration * 20), (int) slowAmplifier));
}
}

View File

@ -55,7 +55,7 @@ public class Death_Mark extends Ability {
target.getWorld().spawnParticle(Particle.SPELL_MOB, target.getLocation(), 4, .2, 0, .2, 0);
if (ti % 20 == 0)
MMOLib.plugin.getDamage().damage(stats.getPlayer(), target, new AttackResult(dps, DamageType.SKILL, DamageType.MAGICAL), false);
MMOLib.plugin.getDamage().damage(stats.getPlayer(), target, new AttackResult(dps, DamageType.SKILL, DamageType.MAGIC), false);
}
}.runTaskTimer(MMOItems.plugin, 0, 1);
target.getWorld().playSound(target.getLocation(), Sound.ENTITY_BLAZE_HURT, 1, 2);

View File

@ -47,7 +47,7 @@ public class Minor_Explosion extends Ability {
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
if (entity.getLocation().distanceSquared(loc) < radiusSquared && MMOUtils.canDamage(stats.getPlayer(), entity)) {
new AttackResult(damage, DamageType.SKILL, DamageType.MAGICAL).damage(stats.getPlayer(), (LivingEntity) entity);
new AttackResult(damage, DamageType.SKILL, DamageType.MAGIC).damage(stats.getPlayer(), (LivingEntity) entity);
entity.setVelocity(MMOUtils.normalize(entity.getLocation().subtract(loc).toVector().setY(0)).setY(.2).multiply(2 * knockback));
}
}

View File

@ -69,7 +69,7 @@ public class Lute extends UntargetedWeapon {
for (Entity target : entities)
if (MMOUtils.canDamage(getPlayer(), loc, target)) {
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, getNBTItem(), (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, getNBTItem(), (LivingEntity) target);
cancel();
return;
}

View File

@ -48,7 +48,7 @@ public class Staff extends UntargetedWeapon {
MMORayTraceResult trace = MMOLib.plugin.getVersion().getWrapper().rayTrace(stats.getPlayer(), range, entity -> MMOUtils.canDamage(stats.getPlayer(), entity));
if (trace.hasHit())
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, getNBTItem(), trace.getHit());
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, getNBTItem(), trace.getHit());
trace.draw(loc, getPlayer().getEyeLocation().getDirection(), 2, (tick) -> tick.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, tick, 0, .1, .1, .1, 0));
getPlayer().getWorld().playSound(getPlayer().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 2);
}

View File

@ -28,7 +28,7 @@ public class LightningSpirit implements StaffAttackHandler {
loc.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc, 0);
for (Entity target : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), loc, target)) {
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
loc.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, loc, 16, 0, 0, 0, .1);
return;
}

View File

@ -51,7 +51,7 @@ public class ManaSpirit implements StaffAttackHandler {
}
for (Entity target : targets)
if (MMOUtils.canDamage(stats.getPlayer(), loc, target)) {
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
cancel();
return;

View File

@ -42,7 +42,7 @@ public class NetherSpirit implements StaffAttackHandler {
loc.getWorld().spawnParticle(Particle.SMOKE_NORMAL, loc, 0);
for (Entity target : targets)
if (MMOUtils.canDamage(stats.getPlayer(), loc, target)) {
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
cancel();
return;

View File

@ -44,7 +44,7 @@ public class SunfireSpirit implements StaffAttackHandler {
loc.getWorld().playSound(loc, VersionSound.ENTITY_FIREWORK_ROCKET_BLAST.toSound(), 2, 2);
for (Entity target : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), target) && target.getLocation().distanceSquared(loc) <= 9)
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
cancel();
break;
}

View File

@ -42,7 +42,7 @@ public class ThunderSpirit implements StaffAttackHandler {
loc.getWorld().playSound(loc, VersionSound.ENTITY_FIREWORK_ROCKET_BLAST.toSound(), 2, 2);
for (Entity target : MMOUtils.getNearbyChunkEntities(loc))
if (MMOUtils.canDamage(stats.getPlayer(), target) && target.getLocation().distanceSquared(loc) <= 9)
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
cancel();
}
}

View File

@ -32,6 +32,6 @@ public class VoidSpirit implements StaffAttackHandler {
shulkerBullet.setVelocity(vec);
}
}.runTaskTimer(MMOItems.plugin, 0, 1);
MMOItems.plugin.getEntities().registerCustomEntity(shulkerBullet, new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.MAGICAL, DamageType.PROJECTILE), 0., stats, nbt);
MMOItems.plugin.getEntities().registerCustomEntity(shulkerBullet, new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.MAGIC, DamageType.PROJECTILE), 0., stats, nbt);
}
}

View File

@ -24,7 +24,7 @@ public class XRaySpirit implements StaffAttackHandler {
MMORayTraceResult trace = MMOLib.plugin.getVersion().getWrapper().rayTrace(stats.getPlayer(), range, entity -> MMOUtils.canDamage(stats.getPlayer(), entity));
if (trace.hasHit())
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGICAL).applyEffectsAndDamage(stats, nbt, trace.getHit());
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, trace.getHit());
trace.draw(loc, stats.getPlayer().getEyeLocation().getDirection(), 2, Color.BLACK);
stats.getPlayer().getWorld().playSound(stats.getPlayer().getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 0.40f, 2);
}

View File

@ -34,7 +34,7 @@ public class HeroesHook implements RPGHandler, Listener, DamageHandler {
MMOLib.plugin.getDamage().registerHandler(this);
damages.put(SkillType.ABILITY_PROPERTY_PHYSICAL, DamageType.PHYSICAL);
damages.put(SkillType.ABILITY_PROPERTY_MAGICAL, DamageType.MAGICAL);
damages.put(SkillType.ABILITY_PROPERTY_MAGICAL, DamageType.MAGIC);
damages.put(SkillType.ABILITY_PROPERTY_PROJECTILE, DamageType.PROJECTILE);
}
@ -79,7 +79,7 @@ public class HeroesHook implements RPGHandler, Listener, DamageHandler {
*/
if (event.getSkill().isType(SkillType.ABILITY_PROPERTY_MAGICAL)) {
if (event.getDamager().getEntity() instanceof Player)
event.setDamage(event.getDamage() * (1 + PlayerData.get((Player) event.getDamager().getEntity()).getStats().getStat(ItemStat.MAGICAL_DAMAGE) / 100));
event.setDamage(event.getDamage() * (1 + PlayerData.get((Player) event.getDamager().getEntity()).getStats().getStat(ItemStat.MAGIC_DAMAGE) / 100));
if (event.getEntity() instanceof Player)
event.setDamage(event.getDamage() * (1 - PlayerData.get((Player) event.getDamager().getEntity()).getStats().getStat(ItemStat.MAGIC_DAMAGE_REDUCTION) / 100));
}

View File

@ -28,7 +28,7 @@ public class SkillAPIHook implements RPGHandler, Listener {
public void a(SkillDamageEvent event) {
if (event.getDamager() instanceof Player)
event.setDamage(event.getDamage() * (1 + net.Indyuce.mmoitems.api.player.PlayerData.get((Player) event.getDamager()).getStats().getStat(ItemStat.MAGICAL_DAMAGE) / 100));
event.setDamage(event.getDamage() * (1 + net.Indyuce.mmoitems.api.player.PlayerData.get((Player) event.getDamager()).getStats().getStat(ItemStat.MAGIC_DAMAGE) / 100));
if (event.getTarget() instanceof Player)
event.setDamage(event.getDamage() * (1 - net.Indyuce.mmoitems.api.player.PlayerData.get((Player) event.getTarget()).getStats().getStat(ItemStat.MAGIC_DAMAGE_REDUCTION) / 100));

View File

@ -111,7 +111,7 @@ public abstract class ItemStat {
public static final ItemStat WEAPON_DAMAGE = new DoubleStat(new ItemStack(Material.IRON_SWORD), "Weapon Damage", new String[] { "Additional on-hit weapon damage in %." }, "weapon-damage");
public static final ItemStat SKILL_DAMAGE = new DoubleStat(new ItemStack(Material.BOOK), "Skill Damage", new String[] { "Additional ability damage in %." }, "skill-damage");
public static final ItemStat PROJECTILE_DAMAGE = new DoubleStat(new ItemStack(Material.ARROW), "Projectile Damage", new String[] { "Additional skill/weapon projectile damage." }, "projectile-damage");
public static final ItemStat MAGICAL_DAMAGE = new DoubleStat(new ItemStack(Material.BOOK), "Magical Damage", new String[] { "Additional magical skill damage in %." }, "magical-damage");
public static final ItemStat MAGIC_DAMAGE = new DoubleStat(new ItemStack(Material.BOOK), "Magic Damage", new String[] { "Additional magic skill damage in %." }, "magic-damage");
public static final ItemStat PHYSICAL_DAMAGE = new DoubleStat(new ItemStack(Material.IRON_AXE), "Physical Damage", new String[] { "Additional skill/weapon physical damage." }, "physical-damage");
public static final ItemStat DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.IRON_CHESTPLATE), "Damage Reduction", new String[] { "Reduces damage from any source.", "In %." }, "damage-reduction");
public static final ItemStat FALL_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.FEATHER), "Fall Damage Reduction", new String[] { "Reduces fall damage.", "In %." }, "fall-damage-reduction");