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; }
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; }
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); }