diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java index a5581a8..22a72ec 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java @@ -11,12 +11,10 @@ import com.willfp.ecobosses.bosses.effects.Effects; import com.willfp.ecobosses.bosses.util.bosstype.BossEntityUtils; import com.willfp.ecobosses.bosses.util.bosstype.BossType; import com.willfp.ecobosses.bosses.util.obj.BossbarProperties; -import com.willfp.ecobosses.bosses.util.obj.EffectOption; import com.willfp.ecobosses.bosses.util.obj.ExperienceOptions; import com.willfp.ecobosses.bosses.util.obj.ImmunityOptions; import com.willfp.ecobosses.bosses.util.obj.OptionedSound; import com.willfp.ecobosses.bosses.util.obj.SpawnTotem; -import com.willfp.ecobosses.bosses.util.obj.SummonsOption; import com.willfp.ecobosses.bosses.util.obj.TargetMode; import com.willfp.ecobosses.bosses.util.obj.TeleportOptions; import lombok.AccessLevel; @@ -32,7 +30,6 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -144,24 +141,6 @@ public class EcoBoss extends PluginDependent { @Getter private final ExperienceOptions experienceOptions; - /** - * The effects. - */ - @Getter - private final Set effects; - - /** - * The summons. - */ - @Getter - private final Set summons; - - /** - * The shuffle chance. - */ - @Getter - private final double shuffleChance; - /** * If attacks should be called on injury. */ @@ -347,33 +326,6 @@ public class EcoBoss extends PluginDependent { double projectile = this.getConfig().getDouble("defence.incoming-multipliers.projectile"); this.incomingMultipliers.put(EntityDamageEvent.DamageCause.PROJECTILE, projectile); - // Effects - this.effects = new HashSet<>(); - for (String string : this.getConfig().getStrings("attacks.potion-effects")) { - String[] split = string.split(":"); - PotionEffectType type = PotionEffectType.getByName(split[0].toUpperCase()); - assert type != null; - this.effects.add(new EffectOption( - Double.parseDouble(split[3]), - Integer.parseInt(split[1]) - 1, - Integer.parseInt(split[2]), - type - )); - } - - // Summons - this.summons = new HashSet<>(); - for (String string : this.getConfig().getStrings("attacks.summons")) { - String[] split = string.split(":"); - this.summons.add(new SummonsOption( - Double.parseDouble(split[1]), - BossEntityUtils.getBossType(split[0].toUpperCase()) - )); - } - - // Shuffle - this.shuffleChance = this.getConfig().getDouble("attacks.shuffle-chance"); - // Attack on injure this.attackOnInjure = this.getConfig().getBool("attacks.on-injure"); @@ -494,7 +446,7 @@ public class EcoBoss extends PluginDependent { * * @return The effects. */ - public Set createEffectTickers() { + public Set createEffects() { Set effects = new HashSet<>(); this.effectNames.forEach((string, args) -> { effects.add(Effects.getEffect(string, args)); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java index 8f75740..d490b90 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java @@ -3,36 +3,24 @@ package com.willfp.ecobosses.bosses; import com.willfp.eco.core.EcoPlugin; import com.willfp.eco.core.PluginDependent; import com.willfp.eco.core.scheduling.RunnableTask; -import com.willfp.eco.util.NumberUtils; import com.willfp.eco.util.StringUtils; +import com.willfp.ecobosses.bosses.effects.Effect; import com.willfp.ecobosses.bosses.tick.BossTicker; import com.willfp.ecobosses.bosses.tick.tickers.BossBarTicker; import com.willfp.ecobosses.bosses.tick.tickers.HealthPlaceholderTicker; import com.willfp.ecobosses.bosses.tick.tickers.TargetTicker; -import com.willfp.ecobosses.bosses.util.obj.EffectOption; import com.willfp.ecobosses.bosses.util.obj.OptionedSound; -import com.willfp.ecobosses.bosses.util.obj.SummonsOption; import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeInstance; import org.bukkit.attribute.AttributeModifier; import org.bukkit.boss.BarFlag; -import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Mob; import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; import org.bukkit.persistence.PersistentDataType; -import org.bukkit.potion.PotionEffect; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.Collections; import java.util.HashSet; -import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicLong; @@ -52,6 +40,11 @@ public class LivingEcoBoss extends PluginDependent { */ private final Set tickers; + /** + * The effects. + */ + private final Set effects; + /** * Create new living EcoBoss. * @@ -85,13 +78,13 @@ public class LivingEcoBoss extends PluginDependent { ) ); } - this.tickers.addAll(boss.createEffectTickers()); + // Effects + this.effects = new HashSet<>(); + this.effects.addAll(boss.createEffects()); AtomicLong currentTick = new AtomicLong(0); - this.getPlugin().getRunnableFactory().create(runnable -> { - this.tick(currentTick.getAndAdd(1), runnable); - }).runTaskTimer(0, 1); + this.getPlugin().getRunnableFactory().create(runnable -> this.tick(currentTick.getAndAdd(1), runnable)).runTaskTimer(0, 1); } private void onSpawn() { @@ -137,10 +130,16 @@ public class LivingEcoBoss extends PluginDependent { for (BossTicker ticker : tickers) { ticker.tick(boss, entity, tick); } + for (Effect effect : effects) { + effect.tick(boss, entity, tick); + } if (entity.isDead()) { for (BossTicker ticker : tickers) { ticker.onDeath(boss, entity, tick); } + for (Effect effect : effects) { + effect.onDeath(boss, entity, tick); + } runnable.cancel(); boss.removeLivingBoss(entity.getUniqueId()); } @@ -156,46 +155,8 @@ public class LivingEcoBoss extends PluginDependent { player.getWorld().playSound(entity.getLocation(), sound.getSound(), sound.getVolume(), sound.getPitch()); } - for (EffectOption effect : boss.getEffects()) { - if (NumberUtils.randFloat(0, 100) > effect.getChance()) { - continue; - } - - player.addPotionEffect(new PotionEffect(effect.getEffectType(), effect.getDuration(), effect.getLevel())); - } - - if (NumberUtils.randFloat(0, 100) < boss.getShuffleChance()) { - List hotbar = new ArrayList<>(); - for (int i = 0; i < 9; i++) { - hotbar.add(player.getInventory().getItem(i)); - } - Collections.shuffle(hotbar); - int i2 = 0; - for (ItemStack item : hotbar) { - player.getInventory().setItem(i2, item); - i2++; - } - player.playSound(player.getLocation(), Sound.ENTITY_ENDER_PEARL_THROW, 1, 0.5f); - } - - for (SummonsOption summon : boss.getSummons()) { - if (NumberUtils.randFloat(0, 100) > summon.getChance()) { - continue; - } - - Location loc = player.getLocation().add(NumberUtils.randInt(2, 6), 0, NumberUtils.randInt(2, 6)); - while (!loc.getBlock().getType().equals(Material.AIR)) { - loc.add(0, 1, 0); - } - - Entity summonedEntity = summon.getType().spawnBossEntity(loc); - if (summonedEntity instanceof Mob) { - ((Mob) summonedEntity).setTarget(player); - } - - for (OptionedSound sound : boss.getSummonSounds()) { - player.getWorld().playSound(entity.getLocation(), sound.getSound(), sound.getVolume(), sound.getPitch()); - } + for (Effect effect : effects) { + effect.onAttack(boss, entity, player); } } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effect.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effect.java index f6ac430..e8c8c6f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effect.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effect.java @@ -1,8 +1,11 @@ package com.willfp.ecobosses.bosses.effects; +import com.willfp.ecobosses.bosses.EcoBoss; import com.willfp.ecobosses.bosses.tick.BossTicker; import lombok.Getter; import org.bukkit.Bukkit; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import java.util.List; @@ -40,4 +43,44 @@ public abstract class Effect implements BossTicker { * @return The usage. */ public abstract String getUsage(); + + /** + * Handle the boss attacking a player. + * + * @param boss The boss. + * @param entity The boss entity. + * @param player The player. + */ + public void onAttack(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + @NotNull final Player player) { + // Override when needed. + } + + /** + * Tick the effect. + * + * @param boss The boss. + * @param entity The boss entity. + * @param tick The current tick: counts up from zero. + */ + public void tick(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + final long tick) { + // Override when needed. + } + + /** + * On boss death. + * + * @param boss The boss. + * @param entity The boss entity. + * @param tick The current tick: counts up from zero. + */ + @Override + public void onDeath(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + final long tick) { + // Override when needed. + } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effects.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effects.java index 4166fe0..de70882 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effects.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/Effects.java @@ -1,8 +1,11 @@ package com.willfp.ecobosses.bosses.effects; import com.google.common.collect.ImmutableMap; -import com.willfp.ecobosses.bosses.effects.effects.DamageNearbyPlayers; -import com.willfp.ecobosses.bosses.effects.effects.LightningNearbyEntities; +import com.willfp.ecobosses.bosses.effects.effects.EffectDamageNearbyPlayers; +import com.willfp.ecobosses.bosses.effects.effects.EffectGivePotionEffect; +import com.willfp.ecobosses.bosses.effects.effects.EffectLightningNearbyEntities; +import com.willfp.ecobosses.bosses.effects.effects.EffectShuffleHotbar; +import com.willfp.ecobosses.bosses.effects.effects.EffectSummon; import lombok.experimental.UtilityClass; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,8 +20,11 @@ public class Effects { * Registered effects. */ private static final Map, Effect>> EFFECTS = new ImmutableMap.Builder, Effect>>() - .put("damage-nearby-players", DamageNearbyPlayers::new) - .put("lightning-nearby-entities", LightningNearbyEntities::new) + .put("damage-nearby-players", EffectDamageNearbyPlayers::new) + .put("lightning-nearby-entities", EffectLightningNearbyEntities::new) + .put("summon", EffectSummon::new) + .put("give-potion-effect", EffectGivePotionEffect::new) + .put("shuffle-hotbar", EffectShuffleHotbar::new) .build(); /** diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/DamageNearbyPlayers.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectDamageNearbyPlayers.java similarity index 90% rename from eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/DamageNearbyPlayers.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectDamageNearbyPlayers.java index 3af8d9d..3a111bd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/DamageNearbyPlayers.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectDamageNearbyPlayers.java @@ -9,12 +9,12 @@ import org.jetbrains.annotations.NotNull; import java.util.List; -public class DamageNearbyPlayers extends Effect { +public class EffectDamageNearbyPlayers extends Effect { private final int frequency; private final double damage; private final double radius; - public DamageNearbyPlayers(@NotNull final List args) { + public EffectDamageNearbyPlayers(@NotNull final List args) { super(args); if (args.size() < 3) { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectGivePotionEffect.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectGivePotionEffect.java new file mode 100644 index 0000000..f45e222 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectGivePotionEffect.java @@ -0,0 +1,48 @@ +package com.willfp.ecobosses.bosses.effects.effects; + +import com.willfp.eco.util.NumberUtils; +import com.willfp.ecobosses.bosses.EcoBoss; +import com.willfp.ecobosses.bosses.effects.Effect; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class EffectGivePotionEffect extends Effect { + private final PotionEffectType type; + private final double chance; + private final int duration; + private final int strength; + + public EffectGivePotionEffect(@NotNull final List args) { + super(args); + + if (args.size() < 4) { + showConfigError("Incorrect amount of arguments!"); + } + + type = PotionEffectType.getByName(args.get(0).toUpperCase()); + chance = Double.parseDouble(args.get(1)); + duration = Integer.parseInt(args.get(2)); + strength = Integer.parseInt(args.get(3)); + } + + @Override + public String getUsage() { + return "give-potion-effect::::"; + } + + @Override + public void onAttack(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + @NotNull final Player player) { + if (NumberUtils.randFloat(0, 100) > this.chance) { + return; + } + + player.addPotionEffect(new PotionEffect(type, duration, strength - 1)); + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/LightningNearbyEntities.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectLightningNearbyEntities.java similarity index 91% rename from eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/LightningNearbyEntities.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectLightningNearbyEntities.java index 840a8e6..674b9b7 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/LightningNearbyEntities.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectLightningNearbyEntities.java @@ -10,13 +10,13 @@ import org.jetbrains.annotations.NotNull; import java.util.List; -public class LightningNearbyEntities extends Effect { +public class EffectLightningNearbyEntities extends Effect { private final int frequency; private final double chance; private final double damage; private final double radius; - public LightningNearbyEntities(@NotNull final List args) { + public EffectLightningNearbyEntities(@NotNull final List args) { super(args); if (args.size() < 4) { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectShuffleHotbar.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectShuffleHotbar.java new file mode 100644 index 0000000..f71f628 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectShuffleHotbar.java @@ -0,0 +1,54 @@ +package com.willfp.ecobosses.bosses.effects.effects; + +import com.willfp.eco.util.NumberUtils; +import com.willfp.ecobosses.bosses.EcoBoss; +import com.willfp.ecobosses.bosses.effects.Effect; +import org.bukkit.Sound; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class EffectShuffleHotbar extends Effect { + private final double chance; + + public EffectShuffleHotbar(@NotNull final List args) { + super(args); + + if (args.size() < 1) { + showConfigError("Incorrect amount of arguments!"); + } + + chance = Double.parseDouble(args.get(0)); + } + + @Override + public String getUsage() { + return "shuffle-hotbar::::"; + } + + @Override + public void onAttack(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + @NotNull final Player player) { + if (NumberUtils.randFloat(0, 100) > this.chance) { + return; + } + + List hotbar = new ArrayList<>(); + for (int i = 0; i < 9; i++) { + hotbar.add(player.getInventory().getItem(i)); + } + Collections.shuffle(hotbar); + int i2 = 0; + for (ItemStack item : hotbar) { + player.getInventory().setItem(i2, item); + i2++; + } + player.playSound(player.getLocation(), Sound.ENTITY_ENDER_PEARL_THROW, 1, 0.5f); + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectSummon.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectSummon.java new file mode 100644 index 0000000..937d3fc --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/effects/effects/EffectSummon.java @@ -0,0 +1,65 @@ +package com.willfp.ecobosses.bosses.effects.effects; + +import com.willfp.eco.util.NumberUtils; +import com.willfp.ecobosses.bosses.EcoBoss; +import com.willfp.ecobosses.bosses.effects.Effect; +import com.willfp.ecobosses.bosses.util.bosstype.BossEntityUtils; +import com.willfp.ecobosses.bosses.util.bosstype.BossType; +import com.willfp.ecobosses.bosses.util.obj.OptionedSound; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class EffectSummon extends Effect { + private final BossType type; + private final double chance; + + public EffectSummon(@NotNull final List args) { + super(args); + + if (args.size() < 2) { + showConfigError("Incorrect amount of arguments!"); + } + + type = BossEntityUtils.getBossType(args.get(0)); + chance = Double.parseDouble(args.get(1)); + } + + @Override + public String getUsage() { + return "summon::"; + } + + @Override + public void onAttack(@NotNull final EcoBoss boss, + @NotNull final LivingEntity entity, + @NotNull final Player player) { + if (NumberUtils.randFloat(0, 100) > this.chance) { + return; + } + + Location loc = player.getLocation().add(NumberUtils.randInt(2, 6), 0, NumberUtils.randInt(2, 6)); + for (int i = 0; i < 15; i++) { + if (loc.getBlock().getType() == Material.AIR) { + break; + } + + loc.add(0, 1, 0); + } + + Entity summonedEntity = type.spawnBossEntity(loc); + if (summonedEntity instanceof Mob) { + ((Mob) summonedEntity).setTarget(player); + } + + for (OptionedSound sound : boss.getSummonSounds()) { + player.getWorld().playSound(entity.getLocation(), sound.getSound(), sound.getVolume(), sound.getPitch()); + } + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/EffectOption.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/EffectOption.java deleted file mode 100644 index d5132e7..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/EffectOption.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.willfp.ecobosses.bosses.util.obj; - -import lombok.Getter; -import org.bukkit.potion.PotionEffectType; -import org.jetbrains.annotations.NotNull; - -public class EffectOption { - /** - * The chance of the effect being applied. - */ - @Getter - private final double chance; - - /** - * The level of the effect. - */ - @Getter - private final int level; - - /** - * The potion effect type. - */ - @Getter - private final PotionEffectType effectType; - - /** - * The duration, in ticks. - */ - @Getter - private final int duration; - - /** - * Create a new effect option. - * - * @param chance The chance. - * @param level The level. - * @param duration The duration in ticks. - * @param effectType The effect. - */ - public EffectOption(final double chance, - final int level, - final int duration, - @NotNull final PotionEffectType effectType) { - this.chance = chance; - this.level = level; - this.effectType = effectType; - this.duration = duration; - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/SummonsOption.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/SummonsOption.java deleted file mode 100644 index e3bb402..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/obj/SummonsOption.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.willfp.ecobosses.bosses.util.obj; - -import com.willfp.ecobosses.bosses.util.bosstype.BossType; -import lombok.Getter; -import org.jetbrains.annotations.NotNull; - -public class SummonsOption { - /** - * The chance of a mob being spawned. - */ - @Getter - private final double chance; - - /** - * The type of entity to summon. - */ - @Getter - private final BossType type; - - /** - * Create a new summons option. - * - * @param chance The chance. - * @param type The entity type. - */ - public SummonsOption(final double chance, - @NotNull final BossType type) { - this.chance = chance; - this.type = type; - } -} diff --git a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml index 1a4d6b2..24182bd 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml @@ -54,7 +54,10 @@ broadcast: - "&f - %third%&f (%third_damage% Damage)" - "" -effects: [] +effects: + - "summon:wolf:15" + - "give-potion-effect:wither:4:200:10" + - "give-potion-effect:hunger:10:600:10" defence: immunities: @@ -78,22 +81,6 @@ attacks: # Chance is rolled when boss attacks player on-injure: true # If chance should be rolled when boss is attacked too - # Potion effects are formatted like this: - # effect:level:duration:chance - # Duration is in ticks, chance is as a percentage - potion-effects: - - "wither:4:200:10" - - "hunger:10:600:10" - - # Bonus enemies that spawn to fight you - # entity:chance - # Chance is as a percentage - summons: - - "wolf:15" - - # Chance to shuffle your hotbar as a percentage - set to 0 to disable. - shuffle-chance: 0 - # How the boss decides who to attack target: distance: 15 # The distance to check for nearby players. diff --git a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml index b344d36..da58d19 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml @@ -54,7 +54,12 @@ broadcast: - "&f - &9%third%&f (%third_damage% Damage)" - "" -effects: [ ] +effects: + - "summon:evoker:10" + - "summon:vindicator:10" + - "shuffle-hotbar:10" + - "give-potion-effect:confusion:10:200:10" + - "give-potion-effect:blindness:1:40:20" defence: immunities: @@ -78,23 +83,6 @@ attacks: # Chance is rolled when boss attacks player on-injure: true # If chance should be rolled when boss is attacked too - # Potion effects are formatted like this: - # effect:level:duration:chance - # Duration is in ticks, chance is as a percentage - potion-effects: - - "confusion:10:200:10" - - "blindness:1:40:20" - - # Bonus enemies that spawn to fight you - # entity:chance - # Chance is as a percentage - summons: - - "evoker:10" - - "vindicator:10" - - # Chance to shuffle your hotbar as a percentage - set to 0 to disable. - shuffle-chance: 10 - # How the boss decides who to attack target: distance: 15 # The distance to check for nearby players. diff --git a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml index 85a687a..8a0a844 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml @@ -56,6 +56,12 @@ broadcast: effects: - "damage-nearby-players:15:2:3" + - "summon:iron_golem:10" + - "summon:vindicator:5" + - "shuffle-hotbar:30" + - "give-potion-effect:weakness:5:100:10" + - "give-potion-effect:slow:5:100:20" + - "give-potion-effect:levitation:3:50:10" defence: immunities: @@ -79,24 +85,6 @@ attacks: # Chance is rolled when boss attacks player on-injure: true # If chance should be rolled when boss is attacked too - # Potion effects are formatted like this: - # effect:level:duration:chance - # Duration is in ticks, chance is as a percentage - potion-effects: - - "weakness:5:100:10" - - "slow:5:100:20" - - "levitation:3:50:10" - - # Bonus enemies that spawn to fight you - # entity:chance - # Chance is as a percentage - summons: - - "iron_golem:5" - - "vindicator:10" - - # Chance to shuffle your hotbar as a percentage - set to 0 to disable. - shuffle-chance: 30 - # How the boss decides who to attack target: distance: 15 # The distance to check for nearby players. diff --git a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml index be1739d..593ad97 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml @@ -56,6 +56,12 @@ broadcast: effects: - "lightning-nearby-entities:100:15:2:3" + - "summon:spider:15" + - "summon:cave_spider:15" + - "give-potion-effect:poison:8:200:10" + - "give-potion-effect:slow:4:100:20" + - "give-potion-effect:hunger:5:400:10" + - "give-potion-effect:slow_digging:3:40:10" defence: immunities: @@ -79,25 +85,6 @@ attacks: # Chance is rolled when boss attacks player on-injure: true # If chance should be rolled when boss is attacked too - # Potion effects are formatted like this: - # effect:level:duration:chance - # Duration is in ticks, chance is as a percentage - potion-effects: - - "poison:8:200:10" - - "slow:4:100:20" - - "hunger:5:400:10" - - "slow_digging:3:40:10" - - # Bonus enemies that spawn to fight you - # entity:chance - # Chance is as a percentage - summons: - - "spider:15" - - "cave_spider:15" - - # Chance to shuffle your hotbar as a percentage - set to 0 to disable. - shuffle-chance: 0 - # How the boss decides who to attack target: distance: 15 # The distance to check for nearby players.