Package games.stendhal.server.entity.npc.condition

Examples of games.stendhal.server.entity.npc.condition.SentenceHasErrorCondition


          ConversationStates.ATTENDING, "I sell "
                  + Grammar.enumerateCollection(sellerBehaviour.dealtItems())
                  + ".", null);
    }

    engine.add(ConversationStates.ATTENDING, "buy", new SentenceHasErrorCondition(),
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());

    ChatCondition condition = new AndCondition(
      new NotCondition(new SentenceHasErrorCondition()),
      new NotCondition(sellerBehaviour.getTransactionCondition()));
    engine.add(ConversationStates.ATTENDING, "buy", condition,
      false, ConversationStates.ATTENDING,
      null, sellerBehaviour.getRejectedTransactionAction());

    condition = new AndCondition(
      new NotCondition(new SentenceHasErrorCondition()),
      sellerBehaviour.getTransactionCondition());

    engine.add(ConversationStates.ATTENDING, "buy", condition, false,
        ConversationStates.ATTENDING, null,
        new BehaviourAction(sellerBehaviour, "buy", "sell") {
View Full Code Here


            new QuestNotActiveCondition(QUEST_SLOT)),
        false, ConversationStates.ATTENDING, thisWelcomeMessage, null);

    engine.add(ConversationStates.ATTENDING,
        behaviour.getProductionActivity(),
        new SentenceHasErrorCondition(),
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());

        /* In the behaviour a production activity is defined, e.g. 'cast' or 'mill'
        * and this is used as the trigger to start the production,
        * provided that the NPC is not currently producing for player (not started, is rejected, or is complete) */   
        engine.add(
        ConversationStates.ATTENDING,
        behaviour.getProductionActivity(),
        new AndCondition(
          new NotCondition(new SentenceHasErrorCondition()),
          new QuestNotActiveCondition(QUEST_SLOT)
        ),
                false,
                ConversationStates.ATTENDING, null,
        new ProducerBehaviourAction(behaviour) {
View Full Code Here

          false,
          ConversationStates.ATTENDING,
          "I buy " + Grammar.enumerateCollectionPlural(buyerBehaviour.dealtItems()) + ".",
          null);
    }
    engine.add(ConversationStates.ATTENDING, "sell", new SentenceHasErrorCondition(),
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());

    engine.add(ConversationStates.ATTENDING, "sell",
      new AndCondition(
          new NotCondition(new SentenceHasErrorCondition()),
          new NotCondition(buyerBehaviour.getTransactionCondition())),
      false, ConversationStates.ATTENDING,
      null, buyerBehaviour.getRejectedTransactionAction());

    engine.add(ConversationStates.ATTENDING, "sell",
        new AndCondition(
            new NotCondition(new SentenceHasErrorCondition()),
            buyerBehaviour.getTransactionCondition()),
        false, ConversationStates.ATTENDING,
        null,
        new BehaviourAction(buyerBehaviour, "sell", "buy") {
          @Override
View Full Code Here

            new RepairingPriceCalculationStrategy(new HashSet<String>()),
            new HashSet<String>(Arrays.asList("buckler")));
    final Engine engine = npc.getEngine();
   
    //sentence was not recognized     
    ChatCondition errorCondition = new SentenceHasErrorCondition();
    engine.add(ConversationStates.ATTENDING, "repair", errorCondition,
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());
   
    //sentence recognized but not able to repair
    ChatCondition cannotRepair = new AndCondition(
        new NotCondition(new SentenceHasErrorCondition()),
        new NotCondition(repairerBehaviour.getTransactionCondition()));
   
    engine.add(ConversationStates.ATTENDING, "repair", cannotRepair,
        false, ConversationStates.ATTENDING,
        null, repairerBehaviour.getRejectedTransactionAction());
   
    //recognized and able to repair
    ChatCondition recognizedCondition = new AndCondition(
        new NotCondition(new SentenceHasErrorCondition()),
        repairerBehaviour.getTransactionCondition());
   
    engine.add(ConversationStates.ATTENDING, "repair",
        recognizedCondition, false, ConversationStates.REPAIR_OFFERED,
        null, new RepairingBehaviourAction(repairerBehaviour));
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.condition.SentenceHasErrorCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.