@Override public boolean fire(final Player player,final Sentence sentence,final Entity npc){
  String toadd="";
  List<String> neededcreatures;
  if (allcreatures == null) {
    neededcreatures=creatures;
  }
 else {
    final String givenEnemies=player.getQuest(questSlot,questGroupIndex);
    neededcreatures=allcreatures.get(givenEnemies);
  }
  ;
  final String temp=player.getQuest(questSlot,questIndex);
  if (temp == null) {
    return false;
  }
  final List<String> tokens=Arrays.asList(temp.split(","));
  if ((tokens.size() % 5) != 0) {
    logger.error("Wrong record in player's " + player.getName() + " quest slot ("+ questSlot+ "), position "+ questIndex+ " : ["+ player.getQuest(questSlot)+ "]");
    return true;
  }
  LinkedList<String> mycreatures=new LinkedList<String>();
  for (int i=0; i < tokens.size() / 5; i++) {
    mycreatures.add(tokens.get(i * 5));
  }
  for (  String monster : neededcreatures) {
    if (!mycreatures.contains(monster)) {
      if (do_update) {
        toadd=toadd + "," + monster+ ",0,0,0,0";
        logger.debug("Will add <" + monster + "> to player <"+ player.getName()+ "> quest <"+ questSlot+ "> slot <"+ Integer.toString(questIndex)+ ">");
      }
 else {
        return true;
      }
    }
  }
  if (do_update && !toadd.isEmpty()) {
    String finalcreatures=temp + toadd;
    logger.debug("new player <" + player.getName() + "> quest <"+ questSlot+ "> slot <"+ Integer.toString(questIndex)+ "> value: ("+ finalcreatures+ ")");
    player.setQuest(questSlot,questIndex,finalcreatures);
  }
  return false;
}

@ Override public boolean fire ( final Player player , final Sentence sentence , final Entity npc ) { String toadd = "" ; List < String > neededcreatures ; if ( allcreatures == null ) { neededcreatures = creatures ; } else { final String givenEnemies = player . getQuest ( questSlot , questGroupIndex ) ; neededcreatures = allcreatures . get ( givenEnemies ) ; } ; final String temp = player . getQuest ( questSlot , questIndex ) ; if ( temp == null ) { return false ; } final List < String > tokens = Arrays . asList ( temp . split ( "," ) ) ; if ( ( tokens . size ( ) % 5 ) != 0 ) { logger . error ( "Wrong record in player's " + player . getName ( ) + " quest slot (" + questSlot + "), position " + questIndex + " : [" + player . getQuest ( questSlot ) + "]" ) ; return true ; } LinkedList < String > mycreatures = new LinkedList < String > ( ) ; for ( int i = 0 ; i < tokens . size ( ) / 5 ; i ++ ) { mycreatures . add ( tokens . get ( i * 5 ) ) ; } for ( String monster : neededcreatures ) { if ( ! mycreatures . contains ( monster ) ) { if ( do_update ) { toadd = toadd + "," + monster + ",0,0,0,0" ; logger . debug ( "Will add <" + monster + "> to player <" + player . getName ( ) + "> quest <" + questSlot + "> slot <" + Integer . toString ( questIndex ) + ">" ) ; } else { return true ; } } } if ( do_update && ! toadd . isEmpty ( ) ) { String finalcreatures = temp + toadd ; logger . debug ( "new player <" + player . getName ( ) + "> quest <" + questSlot + "> slot <" + Integer . toString ( questIndex ) + "> value: (" + finalcreatures + ")" ) ; player . setQuest ( questSlot , questIndex , finalcreatures ) ; } return false ; }
return true if player need update , or if required update was unsuccessful .
