Examples of SellerAdder


Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

  public void behave(final String method, final Map<String, Integer> items)
      throws NoSuchMethodException {
    if ("buy".equalsIgnoreCase(method)) {
      new BuyerAdder().add(this, new BuyerBehaviour(items), true);
    } else if ("sell".equalsIgnoreCase(method)) {
      new SellerAdder().addSeller(this, new SellerBehaviour(items));
    } else {
      throw new NoSuchMethodException("Behaviour.add(" + method
          + ") not supported.");
    }
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

      protected void createDialog() {
        addGreeting("Welcome to the Kobold City of Wofol. I hope you come in peace.");
        addJob("I run a buying and selling #trade with kobolds - or whoever else passes by. I am one of the few Kobolds who can speak with non-Kobolds.");
        addHelp("I #deal in all sorts of items.");
        addQuest("Try Alrak the mountain dwarf who lives here with the kobolds. He'd probably have more than one task to give you.");
        new SellerAdder().addSeller(this, new SellerBehaviour(shops.get("sellstuff2")), false);
        new BuyerAdder().add(this, new BuyerBehaviour(shops.get("buystuff2")), false);
        addOffer("Please look at the each blackboard on the wall to see what I buy and sell at the moment.");
        addGoodbye("Bye, and please don't attack too many of my friends.");

      }
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

    pricelist.put("dagger", 200);
   
    final SellerBehaviour sb = new SellerBehaviour(pricelist);
    final SpeakerNPC npc = new SpeakerNPC("npc");
    npc.addGreeting("blabla");
    new SellerAdder().addSeller(npc, sb);
      final Player player = PlayerTestHelper.createPlayer("bob");
     
      npc.getEngine().step(player, "hi");
      npc.getEngine().step(player, "buy 1 potion");
    assertEquals("Sorry, I don't sell bottles of potion.", getReply(npc));
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

    pricelist.put("fado city scroll", 1000);
    pricelist.put("empty scroll", 3000);
    final SellerBehaviour sb = new SellerBehaviour(pricelist);
    final SpeakerNPC npc = new SpeakerNPC("npc");
    npc.addGreeting("Hello!");
    new SellerAdder().addSeller(npc, sb);
      final Player player = PlayerTestHelper.createPlayer("bob");

      npc.getEngine().step(player, "hi");
    assertEquals("Hello!", getReply(npc));
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

        /*
         * addHelp("You may want to buy some potions or do some #task
         * for me.");
         */
        addHelp("I can #heal you, and I can #offer you powerful #scrolls that are #magic.");
        new SellerAdder().addSeller(this, new SellerBehaviour(shops.get("scrolls")));
        new HealerAdder().addHealer(this, 250);
        add(
                ConversationStates.ATTENDING,
                Arrays.asList("magic", "scroll", "scrolls"),
                null,
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

        addReply(ConversationPhrases.NO_MESSAGES, "Very well, if I can help you just say.");
        addJob("I sell roses in this here market.");
        addHelp("If you need to access your funds, there is a branch of Fado bank right here in Kirdneh. It's the small building north of the museum, on the east of the city.");
        final Map<String, Integer> offerings = new HashMap<String, Integer>();
        offerings.put("rose", 50);
        new SellerAdder().addSeller(this, new SellerBehaviour(offerings));
        addGoodbye("Come back soon!");
      }
    };

    sellernpc.setEntityClass("woman_001_npc");
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

      protected void createDialog() {
        addGreeting();
        addJob("I am a wizard who sells #magic #scrolls. Just ask me for an #offer!");
        addHelp("You can take powerful magic with you on your adventures with the aid of my #magic #scrolls!");

        new SellerAdder().addSeller(this, new SellerBehaviour(shops.get("scrolls")));

        add(
                ConversationStates.ATTENDING,
                Arrays.asList("magic", "scroll", "scrolls", "magic scrolls"),
                null,
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

            "way is a bit harder.");
        addQuest("I don't have time for those things, sorry. Working.. working.. working..");
        addReply("empty sack","Oh, I got plenty of those to sell. Ask me for an #offer.");
                final Map<String, Integer> offerings = new HashMap<String, Integer>();
                offerings.put("empty sack", 10);
                new SellerAdder().addSeller(this, new SellerBehaviour(offerings));
        addGoodbye("Bye bye. Be careful on your way.");
      }
    };

    npc.setDescription("You see Karl, a friendly elderly farmer.");
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

      @Override
      protected void createDialog() {
        addGreeting();
        addJob("I am Salesman. What you?");
        addHelp("I sell nice items, look at blackboard on wall.");
        new SellerAdder().addSeller(this, new SellerBehaviour(shops.get("sellbetterstuff1")), false);
        addOffer("Look at blackboard on wall to see my offer.");
        addQuest("I am so happy as I am. I want nothing.");
        addGoodbye();
      }
    };
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.adder.SellerAdder

        add(ConversationStates.ATTENDING, "heal", null, ConversationStates.ATTENDING, null, new HealPetsAction());

        addJob("I'm the veterinarian.");
       
        new SellerAdder().addSeller(this, new SellerBehaviour(shops.get("healing")) {

          @Override
          public int getUnitPrice(final String item) {
            // Player gets 20 % rebate
            return (int) (0.8f * priceCalculator.calculatePrice(item, null));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.