private void prepareCowardSoldier(){
  final SpeakerNPC henry=npcs.get("Henry");
  henry.add(ConversationStates.ATTENDING,ConversationPhrases.QUEST_MESSAGES,new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT),new QuestNotInStateCondition(QUEST_SLOT,"map")),ConversationStates.QUEST_OFFERED,"Find my #group, Peter, Tom, and Charles, prove it and I will reward you. Will you do it?",null);
  henry.add(ConversationStates.ATTENDING,ConversationPhrases.QUEST_MESSAGES,new OrCondition(new QuestCompletedCondition(QUEST_SLOT),new QuestInStateCondition(QUEST_SLOT,"map")),ConversationStates.ATTENDING,"I'm so sad that most of my friends are dead.",null);
  henry.add(ConversationStates.QUEST_OFFERED,ConversationPhrases.YES_MESSAGES,null,ConversationStates.ATTENDING,"Thank you! I'll be waiting for your return.",new SetQuestAction(QUEST_SLOT,"start"));
  henry.add(ConversationStates.QUEST_OFFERED,"group",null,ConversationStates.QUEST_OFFERED,"The General sent five of us to explore this area in search for #treasure. So, will you help me find them?",null);
  henry.add(ConversationStates.QUEST_OFFERED,"treasure",null,ConversationStates.QUEST_OFFERED,"A big treasure is rumored to be #somewhere in this dungeon. Will you help me find my group?",null);
  henry.add(ConversationStates.QUEST_OFFERED,ConversationPhrases.NO_MESSAGES,null,ConversationStates.ATTENDING,"OK. I understand. I'm scared of the #dwarves myself.",new SetQuestAndModifyKarmaAction(QUEST_SLOT,"rejected",-5.0));
  final List<ChatAction> actions=new LinkedList<ChatAction>();
  actions.add(new IncreaseXPAction(2500));
  actions.add(new DropInfostringItemAction("leather legs","tom"));
  actions.add(new DropInfostringItemAction("scale armor","peter"));
  actions.add(new IncreaseKarmaAction(15.0));
  actions.add(new GiveMapAction(false));
  henry.add(ConversationStates.IDLE,ConversationPhrases.GREETING_MESSAGES,new AndCondition(new GreetingMatchesNameCondition(henry.getName()),new QuestInStateCondition(QUEST_SLOT,"start"),new PlayerHasInfostringItemWithHimCondition("leather legs","tom"),new PlayerHasInfostringItemWithHimCondition("note","charles"),new PlayerHasInfostringItemWithHimCondition("scale armor","peter")),ConversationStates.ATTENDING,"Oh my! Peter, Tom, and Charles are all dead? *cries*. Anyway, here is your reward. And keep the IOU.",new MultipleActions(actions));
  henry.add(ConversationStates.IDLE,ConversationPhrases.GREETING_MESSAGES,new AndCondition(new GreetingMatchesNameCondition(henry.getName()),new QuestInStateCondition(QUEST_SLOT,"start"),new NotCondition(new AndCondition(new PlayerHasInfostringItemWithHimCondition("leather legs","tom"),new PlayerHasInfostringItemWithHimCondition("note","charles"),new PlayerHasInfostringItemWithHimCondition("scale armor","peter")))),ConversationStates.ATTENDING,"You didn't prove that you have found them all!",null);
  henry.add(ConversationStates.ATTENDING,Arrays.asList("map","group","help"),new OrCondition(new QuestCompletedCondition(QUEST_SLOT),new AndCondition(new HenryQuestCompletedCondition(),new PlayerOwnsItemIncludingBankCondition("map"))),ConversationStates.ATTENDING,"I'm so sad that most of my friends are dead.",null);
  henry.add(ConversationStates.ATTENDING,Arrays.asList("map"),new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT),new HenryQuestCompletedCondition(),new NotCondition(new PlayerOwnsItemIncludingBankCondition("map"))),ConversationStates.ATTENDING,"Luckily I drew a copy of the map, but please don't lose this one.",new GiveMapAction(true));
  henry.add(ConversationStates.ATTENDING,Arrays.asList("map"),new HenryQuestNotCompletedCondition(),ConversationStates.ATTENDING,"If you find my friends, I will give you the map.",null);
}

private void prepareCowardSoldier ( ) { final SpeakerNPC henry = npcs . get ( "Henry" ) ; henry . add ( ConversationStates . ATTENDING , ConversationPhrases . QUEST_MESSAGES , new AndCondition ( new QuestNotCompletedCondition ( QUEST_SLOT ) , new QuestNotInStateCondition ( QUEST_SLOT , "map" ) ) , ConversationStates . QUEST_OFFERED , "Find my #group, Peter, Tom, and Charles, prove it and I will reward you. Will you do it?" , null ) ; henry . add ( ConversationStates . ATTENDING , ConversationPhrases . QUEST_MESSAGES , new OrCondition ( new QuestCompletedCondition ( QUEST_SLOT ) , new QuestInStateCondition ( QUEST_SLOT , "map" ) ) , ConversationStates . ATTENDING , "I'm so sad that most of my friends are dead." , null ) ; henry . add ( ConversationStates . QUEST_OFFERED , ConversationPhrases . YES_MESSAGES , null , ConversationStates . ATTENDING , "Thank you! I'll be waiting for your return." , new SetQuestAction ( QUEST_SLOT , "start" ) ) ; henry . add ( ConversationStates . QUEST_OFFERED , "group" , null , ConversationStates . QUEST_OFFERED , "The General sent five of us to explore this area in search for #treasure. So, will you help me find them?" , null ) ; henry . add ( ConversationStates . QUEST_OFFERED , "treasure" , null , ConversationStates . QUEST_OFFERED , "A big treasure is rumored to be #somewhere in this dungeon. Will you help me find my group?" , null ) ; henry . add ( ConversationStates . QUEST_OFFERED , ConversationPhrases . NO_MESSAGES , null , ConversationStates . ATTENDING , "OK. I understand. I'm scared of the #dwarves myself." , new SetQuestAndModifyKarmaAction ( QUEST_SLOT , "rejected" , - 5.0 ) ) ; final List < ChatAction > actions = new LinkedList < ChatAction > ( ) ; actions . add ( new IncreaseXPAction ( 2500 ) ) ; actions . add ( new DropInfostringItemAction ( "leather legs" , "tom" ) ) ; actions . add ( new DropInfostringItemAction ( "scale armor" , "peter" ) ) ; actions . add ( new IncreaseKarmaAction ( 15.0 ) ) ; actions . add ( new GiveMapAction ( false ) ) ; henry . add ( ConversationStates . IDLE , ConversationPhrases . GREETING_MESSAGES , new AndCondition ( new GreetingMatchesNameCondition ( henry . getName ( ) ) , new QuestInStateCondition ( QUEST_SLOT , "start" ) , new PlayerHasInfostringItemWithHimCondition ( "leather legs" , "tom" ) , new PlayerHasInfostringItemWithHimCondition ( "note" , "charles" ) , new PlayerHasInfostringItemWithHimCondition ( "scale armor" , "peter" ) ) , ConversationStates . ATTENDING , "Oh my! Peter, Tom, and Charles are all dead? *cries*. Anyway, here is your reward. And keep the IOU." , new MultipleActions ( actions ) ) ; henry . add ( ConversationStates . IDLE , ConversationPhrases . GREETING_MESSAGES , new AndCondition ( new GreetingMatchesNameCondition ( henry . getName ( ) ) , new QuestInStateCondition ( QUEST_SLOT , "start" ) , new NotCondition ( new AndCondition ( new PlayerHasInfostringItemWithHimCondition ( "leather legs" , "tom" ) , new PlayerHasInfostringItemWithHimCondition ( "note" , "charles" ) , new PlayerHasInfostringItemWithHimCondition ( "scale armor" , "peter" ) ) ) ) , ConversationStates . ATTENDING , "You didn't prove that you have found them all!" , null ) ; henry . add ( ConversationStates . ATTENDING , Arrays . asList ( "map" , "group" , "help" ) , new OrCondition ( new QuestCompletedCondition ( QUEST_SLOT ) , new AndCondition ( new HenryQuestCompletedCondition ( ) , new PlayerOwnsItemIncludingBankCondition ( "map" ) ) ) , ConversationStates . ATTENDING , "I'm so sad that most of my friends are dead." , null ) ; henry . add ( ConversationStates . ATTENDING , Arrays . asList ( "map" ) , new AndCondition ( new QuestNotCompletedCondition ( QUEST_SLOT ) , new HenryQuestCompletedCondition ( ) , new NotCondition ( new PlayerOwnsItemIncludingBankCondition ( "map" ) ) ) , ConversationStates . ATTENDING , "Luckily I drew a copy of the map, but please don't lose this one." , new GiveMapAction ( true ) ) ; henry . add ( ConversationStates . ATTENDING , Arrays . asList ( "map" ) , new HenryQuestNotCompletedCondition ( ) , ConversationStates . ATTENDING , "If you find my friends, I will give you the map." , null ) ; }
we add text for npc henry who will get us on the quest .
