add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(super.getName()),
new QuestCompletedCondition(GRAFINDLE_QUEST_SLOT),
new QuestCompletedCondition(ZARA_QUEST_SLOT),
new QuestActiveCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
null,
new SayTextWithPlayerNameAction("Welcome to the Wizard's Bank, [name]. You may #leave sooner, if required."));
// hasn't got access to all banks yet
add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(super.getName()),
new OrCondition(
new QuestNotCompletedCondition(GRAFINDLE_QUEST_SLOT),
new QuestNotCompletedCondition(ZARA_QUEST_SLOT))),
ConversationStates.IDLE,
"You may not use this bank if you have not gained the right to use the chests at Nalwor, nor if you have not earned the trust of a certain young woman. Goodbye!",
null);
add(ConversationStates.ATTENDING,
Arrays.asList("fee", "enter"),
new QuestNotActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"The fee is " + COST
+ " money. Do you want to pay?",
null);
add(ConversationStates.ATTENDING,
Arrays.asList("fee", "enter"),
new QuestActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"As you already know, the fee is "
+ COST + " money.",
null);
add(ConversationStates.ATTENDING,
ConversationPhrases.YES_MESSAGES,
new AndCondition(
new PlayerHasItemWithHimCondition("money", COST),
new QuestNotActiveCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
"Semos, Nalwor and Fado bank chests are to my right. The chests owned by Ados Bank Merchants and your friend Zara are to my left. If you are finished before your time here is done, please say #leave.",
new MultipleActions(
new DropItemAction("money", COST),
new TeleportAction(ZONE_NAME, 10, 10, Direction.DOWN),
new SetQuestAction(QUEST_SLOT, "start"),
new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
SingletonRepository.getTurnNotifier().notifyInTurns(0, new Timer(player));
}}));
add(ConversationStates.ATTENDING,
ConversationPhrases.YES_MESSAGES,
new AndCondition(
new NotCondition(new PlayerHasItemWithHimCondition("money", COST)),
new QuestNotActiveCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
"You do not have enough money!",
null);
add(ConversationStates.ATTENDING,
ConversationPhrases.YES_MESSAGES,
new QuestActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"Hm, I do not understand you. If you wish to #leave, just say",
null);
add(ConversationStates.ATTENDING,
ConversationPhrases.NO_MESSAGES,
new QuestNotActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"Very well.",
null);
add(ConversationStates.ATTENDING,
ConversationPhrases.NO_MESSAGES,
new QuestActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"Hm, I do not understand you. If you wish to #leave, just say",
null);
add(ConversationStates.ATTENDING,
"leave",
new QuestNotActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"Leave where?",
null);
add(ConversationStates.ATTENDING,
"leave",
new QuestActiveCondition(QUEST_SLOT),
ConversationStates.ATTENDING,
"Thank you for using the Wizard's Bank",
// we used to use teleportAway() here
new MultipleActions(
new TeleportAction(ZONE_NAME, 15, 16, Direction.DOWN),