Package games.stendhal.server.entity.npc.behaviour.impl

Examples of games.stendhal.server.entity.npc.behaviour.impl.ProducerBehaviour


        requiredResources.put("flour", Integer.valueOf(2));
        requiredResources.put("meat", Integer.valueOf(2));
        requiredResources.put("carrot", Integer.valueOf(1));
        requiredResources.put("button mushroom", Integer.valueOf(2));

        final ProducerBehaviour behaviour = new ProducerBehaviour("arlindo_make_pie", "make", "pie",
                requiredResources, 7 * 60);

        new ProducerAdder().addProducer(this, behaviour,
                "Hi! I bet you've heard about my famous pie and want me to #make one for you, am I right?");
      }
View Full Code Here


        final Map<String, Integer> requiredResources = new TreeMap<String, Integer>();
        requiredResources.put("arandula", 1);
        requiredResources.put("kokuda", 1);
        requiredResources.put("minor potion", 1);

        final ProducerBehaviour mixerBehaviour = new ProducerBehaviour("david_mix_cream",
            "mix", "suntan cream", requiredResources, 10 * 60);

        new ProducerAdder().addProducer(this, mixerBehaviour, "Hallo!");

        addReply(
View Full Code Here

        // Xoderos casts iron if you bring him wood and iron ore.
        final Map<String, Integer> requiredResources = new TreeMap<String, Integer>()
        requiredResources.put("wood", 1);
        requiredResources.put("iron ore", 1);

        final ProducerBehaviour behaviour = new ProducerBehaviour("xoderos_cast_iron",
            "cast", "iron", requiredResources, 5 * 60);

        new ProducerAdder().addProducer(this, behaviour,
        "Greetings. I am sorry to tell you that, because of the war, I am not allowed to sell you any weapons. However, I can #cast iron for you. I can also #offer you tools.");

View Full Code Here

        final Map<String, Integer> requiredResources = new TreeMap<String, Integer>();
        requiredResources.put("sugar cane", 5);
        requiredResources.put("wood", 1);

        final ProducerBehaviour behaviour = new ProducerBehaviour("uncle_dag_brew_fierywater",
            "brew", "fierywater", requiredResources, 20 * 60);
        new ProducerAdder().addProducer(npc, behaviour,
            "Yo! I'm Uncle Dag, the distillery man! If you bring me #sugar #canes, I could #brew #fierywater for you.");

        npc.setDescription("You see Uncle Dag. He runs the distillery stand in Ados market.");
View Full Code Here

        // make cocktail!
        // (uses sorted TreeMap instead of HashMap)
        final Map<String, Integer> requiredResources = new TreeMap<String, Integer>();
        requiredResources.put("coconut", 1);
        requiredResources.put("pineapple", 1);
        final ProducerBehaviour mixerBehaviour = new ProducerBehaviour("barman_mix_pina",
            "mix", "pina colada", requiredResources, 2 * 60);
        new ProducerAdder().addProducer(this, mixerBehaviour, "Aloha!");
      }
    };

View Full Code Here

              player.notifyWorldAboutChanges();
            }
          }
        }

        final ProducerBehaviour behaviour = new SpecialProducerBehaviour("make", "oil",
            requiredResources, 10 * 60);

        // we are not using producer adder at all here because that uses Conversations states IDLE and saying 'hi' heavily.
        // we can't do that here because Pequod uses that all the time in his fishing quest. so player is going to have to #remind
        // him if he wants his oil back!

        add(
            ConversationStates.ATTENDING,
            "make",
            new QuestNotActiveCondition(behaviour.getQuestSlot()),
            ConversationStates.ATTENDING, null,
            new ProducerBehaviourAction(behaviour, "produce") {
              @Override
              public void fireRequestOK(final ItemParserResult res, final Player player, final Sentence sentence, final EventRaiser npc) {
                // Find out how much items we shall produce.
                if (res.getAmount() > 1000) {
                  logger.warn("Decreasing very large amount of "
                      + res.getAmount()
                      + " " + res.getChosenItemName()
                      + " to 1 for player "
                      + player.getName() + " talking to "
                      + npc.getName() + " saying " + sentence);
                  res.setAmount(1);
                }

                if (behaviour.askForResources(res, npc, player)) {
                  currentBehavRes = res;
                  npc.setCurrentState(ConversationStates.PRODUCTION_OFFERED);
                }
              }
            });

        add(ConversationStates.PRODUCTION_OFFERED,
            ConversationPhrases.YES_MESSAGES, null,
            ConversationStates.ATTENDING, null,
            new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
            behaviour.transactAgreedDeal(currentBehavRes, npc, player);

            currentBehavRes = null;
          }
        });

        add(ConversationStates.PRODUCTION_OFFERED,
            ConversationPhrases.NO_MESSAGES, null,
            ConversationStates.ATTENDING, "OK, no problem.", null);

        add(ConversationStates.ATTENDING,
            Arrays.asList(behaviour.getProductionActivity(), "remind"),
            new QuestActiveCondition(behaviour.getQuestSlot()),
            ConversationStates.ATTENDING, null,
            new ChatAction() {
          public void fire(final Player player, final Sentence sentence,
              final EventRaiser npc) {
            behaviour.giveProduct(npc, player);
          }
        });
      }
    };
    fisherman.setDescription("You see Pequod, a forgetful old fisherman. Sometimes he needs to be reminded of what he is supposed to be doing!");
View Full Code Here

        requiredResources.put("milk", 1);
        requiredResources.put("sugar", 1);
        requiredResources.put("chocolate bar", 1);
        requiredResources.put("fierywater", 1);

        final ProducerBehaviour behaviour = new ProducerBehaviour("gaston_bake_crepesuzette", "bake", "crepes suzette",
                requiredResources, 5 * 60);

        new ProducerAdder().addProducer(this, behaviour,
                "Hi there. I bet you've come to taste my #crepes suzette au chocolate! I can #bake some for you if you like.");
      }
View Full Code Here

        requiredResources.put("flour", 1);
        requiredResources.put("cod", 2);
        requiredResources.put("mackerel", 1);
        requiredResources.put("leek", 1);

        final ProducerBehaviour behaviour = new ProducerBehaviour("linzo_make_fish_pie", "make", "fish pie",
                requiredResources, 5 * 60);

        new ProducerAdder().addProducer(this, behaviour,
                "Hi there. Have you come to try my fish pies? I can #make one for you.");
      }
View Full Code Here

        requiredResources.put("honey", Integer.valueOf(1));
        requiredResources.put("milk", Integer.valueOf(1));
        requiredResources.put("egg", Integer.valueOf(1));
        requiredResources.put("apple", Integer.valueOf(1));

        final ProducerBehaviour behaviour = new ProducerBehaviour("martha_bake_applepie", "bake", "apple pie",
                requiredResources, 15 * 60);

        new ProducerAdder().addProducer(this, behaviour,
                "Hello! Did you come to taste one my delicious apple pies? I could #bake one for you right away!");
      }
View Full Code Here

        requiredResources.put("honey", Integer.valueOf(1));
        requiredResources.put("milk", Integer.valueOf(1));
        requiredResources.put("egg", Integer.valueOf(1));
        requiredResources.put("cherry", Integer.valueOf(2));

        final ProducerBehaviour behaviour = new ProducerBehaviour("gertha_bake_cherrypie", "bake", "cherry pie",
                requiredResources, 15 * 60);

        new ProducerAdder().addProducer(this, behaviour,
                "Hello! Did you come to taste one of my fabulous cherry pies? I could #bake one for you happily!");
      }
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.behaviour.impl.ProducerBehaviour

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.