예제 #1
0
 @Override
 public SkillResult use(Hero hero, String[] args) {
   int duration = SkillConfigManager.getUseSetting(hero, this, Setting.DURATION, 30000, false);
   int period = SkillConfigManager.getUseSetting(hero, this, Setting.PERIOD, 200, false);
   hero.addEffect(new LightEffect(this, period, duration));
   return SkillResult.NORMAL;
 }
예제 #2
0
  @Override
  public void onPlayerBedEnter(PlayerBedEnterEvent event) {
    Properties props = plugin.getConfigManager().getProperties();
    if (event.isCancelled()
        || !props.bedHeal
        || props.disabledWorlds.contains(event.getPlayer().getWorld().getName())) return;

    Hero hero = plugin.getHeroManager().getHero(event.getPlayer());
    long period = props.healInterval * 1000;
    double tickHealPercent = props.healPercent / 100.0;
    BedHealEffect bhEffect = new BedHealEffect(period, tickHealPercent);
    hero.addEffect(bhEffect);
  }