Exemplo n.º 1
0
  public DamageOverTime getDotByName(String dotName) {

    List<DamageOverTime> dots = new ArrayList<DamageOverTime>(dotList.get());

    for (DamageOverTime dot : dots) {
      if (dot.getCommandName().equalsIgnoreCase(dotName)) return dot;
    }

    return null;
  }
Exemplo n.º 2
0
  public DamageOverTime getDotByBuff(Buff buff) {

    List<DamageOverTime> dots = new ArrayList<DamageOverTime>(dotList.get());

    for (DamageOverTime dot : dots) {
      if (dot.getBuff() == buff) return dot;
    }

    return null;
  }
Exemplo n.º 3
0
  public void removeBuffFromCreature(CreatureObject creature, Buff buff) {

    if (!creature.getBuffList().contains(buff)) return;
    DamageOverTime dot = creature.getDotByBuff(buff);
    if (dot != null) {
      dot.getTask().cancel(true);
      creature.removeDot(dot);
    }
    if (FileUtilities.doesFileExist("scripts/buffs/" + buff.getBuffName() + ".py"))
      core.scriptService.callScript(
          "scripts/buffs/", "removeBuff", buff.getBuffName(), core, creature, buff);
    creature.removeBuff(buff);
  }