Package games.stendhal.server.entity.npc.action

Examples of games.stendhal.server.entity.npc.action.MultipleActions


    final ChatCondition condition = new AndCondition(
        new QuestStateStartsWithCondition(QUEST_SLOT, "find_vera"),
        new PlayerHasItemWithHimCondition("note")
      );
   
    final ChatAction action = new MultipleActions(
          new SetQuestAction(QUEST_SLOT, 0, "kill_scientist"),
          new StartRecordingKillsAction(QUEST_SLOT, 1, "Sergej Elos", 0, 1),
          new DropItemAction("note")
        );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
View Full Code Here


          ConversationStates.QUESTION_1, null,
          new CollectRequestedItemsAction(
              item.getKey(), QUEST_SLOT,
              "Good, do you have anything else?",
              "You have already brought that!",
              new MultipleActions(
                  new SetQuestAction(QUEST_SLOT,"legs"),
                  new SayTextAction("I am a stupid fool too much in love with my wife Vera to remember, of course these legs also need a base to add " +
                      "the jewels to. Please return with a pair of shadow legs. Bye.")), ConversationStates.IDLE
              ));
    }
View Full Code Here

  //player returns with legs
  final AndCondition legscondition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
                new QuestInStateCondition(QUEST_SLOT, "legs"),
                new PlayerHasItemWithHimCondition("shadow legs")
                );
  final ChatAction action = new MultipleActions(
  new SetQuestAction(QUEST_SLOT,"making;"),
  new SetQuestToTimeStampAction(QUEST_SLOT, 1),
  new DropItemAction("shadow legs"));
  npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      legscondition,
View Full Code Here

    // Player agrees to find mum
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.ATTENDING,
      "Thank you so much! I hope that my #mum is ok and will return soon! Please tell her my name, #Jef, to prove that I sent you to her. If you have found her, return to me please and I'll give you something for your efforts.",
      new MultipleActions(new SetQuestAction(QUEST_SLOT, 0, "start"),
                new IncreaseKarmaAction(10.0)));

    // Player says no, they've lost karma.
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES, null, ConversationStates.IDLE,
      "Oh. Ok. I can understand you... You look like a busy hero so I'll not try to convince you of helping me out.",
      new MultipleActions(new SetQuestAction(QUEST_SLOT, 0, "rejected"),
          new DecreaseKarmaAction(10.0)));

    // Player asks for quest but is already on it

    npc.add(ConversationStates.ATTENDING,
View Full Code Here

      new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0,"start"),
               new PlayerCanEquipItemCondition("zantedeschia")),

      ConversationStates.IDLE,
      "Oh I see :) My son Jef asked you to take a look after me. He is such a nice and gentle boy! Please give him this zantedeschia here. I love these flowers! Please give it to him and tell him that I'm #fine.",
      new MultipleActions(new EquipItemAction("zantedeschia", 1, true),
                                new SetQuestAction(QUEST_SLOT, 0, "found_mom")));
   

    // don't put the flower on the ground - if player has no space, tell them
    amber.add(ConversationStates.ATTENDING, "Jef",
View Full Code Here

    };
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("flower", "zantedeschia", "fine", "amber", "done"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "found_mom"), new PlayerHasItemWithHimCondition("zantedeschia")),
        ConversationStates.ATTENDING, null,
        new MultipleActions(new DropItemAction("zantedeschia"),
                                    new IncreaseXPAction(5000),
                                    new IncreaseKarmaAction(15),
                  addRandomNumberOfItemsAction,                      
                  new IncrementQuestAction(QUEST_SLOT, 2, 1),
                  new SetQuestToTimeStampAction(QUEST_SLOT,1),
View Full Code Here

        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotCompletedCondition(QUEST_SLOT),
            new PlayerHasItemWithHimCondition("kanmararn prison key")),
        ConversationStates.ATTENDING,
        "You got the key to unlock me! *mumble*  Errrr ... it doesn't look too safe out there for me ... I think I'll just stay here ... perhaps someone could #offer me some good equipment ... ",
        new MultipleActions(new SetQuestAction(QUEST_SLOT, "done"),
                    new IncreaseXPAction(2000)));
  }
View Full Code Here

        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
            new KilledForQuestCondition(QUEST_SLOT, 1)),
        ConversationStates.INFORMATION_1,
        "You killed the rat! Now, I guess you want to explore. Do you want to know the way to Semos?",
        new MultipleActions(actions));


       // The player has had enough info for now. Send them to semos. When they come back they can learn some more tips.

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new EquipItemAction("money", 5));
    reward.add(new IncreaseXPAction(10));
    reward.add(new SetQuestAction(QUEST_SLOT, "taught"));
    reward.add(new ExamineChatAction("monogenes.png", "Monogenes", "North part of Semos city."));

    npc.add(
      ConversationStates.INFORMATION_1,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.IDLE,
      "Follow the path through this village to the east, and you can't miss Semos. If you go and speak to Monogenes, the old man in this picture, he will give you a map. Here's 5 money to get you started. Bye bye!",
      new MultipleActions(reward));

       // incase player didn't finish learning everything when he came after killing the rat, he must have another chance. Here it is.
    // 'little tip' is a pun as he gives some money, that is a tip, too.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "killed")),
        ConversationStates.INFORMATION_1,
            "You ran off pretty fast after coming to tell me you killed that rat! I was about to give you a little tip. Do you want it?",
        null);
   
    // Player has returned to say hi again.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "taught")),
        ConversationStates.INFORMATION_2,
            "Hello again. Have you come to learn more from me?",
        null);

    npc.add(
      ConversationStates.INFORMATION_2,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.INFORMATION_3,
      "Perhaps you have found Semos dungeons by now. The corridors are pretty narrow down there, so there's a trick to moving quickly and accurately, if you'd like to hear it. #Yes?",
      null);

    npc.add(
      ConversationStates.INFORMATION_3,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.INFORMATION_4,
      "Simple, really; just click the place you want to move to. There's a lot more information than I can relate just off the top of my head... do you want to know where to read more?",
      null);

    final String epilog = "You can find answers to frequently asked questions by typing #/faq \nYou can read about some of the currently most powerful and successful warriors at #http://stendhalgame.org\n ";
   
      //This is used if the player returns, asks for #help and then say #yes
      npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.YES_MESSAGES, new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      epilog + "You know, you remind me of my younger self...",
      null);

    final List<ChatAction> reward2 = new LinkedList<ChatAction>();
    reward2.add(new EquipItemAction("studded shield"));
    reward2.add(new IncreaseXPAction(20));
    reward2.add(new SetQuestAction(QUEST_SLOT, "done"));

    npc.add(ConversationStates.INFORMATION_4,
        ConversationPhrases.YES_MESSAGES, new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
        epilog + "Well, good luck in the dungeons! This shield should help you. Here's hoping you find fame and glory, and keep watch for monsters!",
        new MultipleActions(reward2));

    npc.add(new ConversationStates[] { ConversationStates.ATTENDING,
          ConversationStates.INFORMATION_1,
          ConversationStates.INFORMATION_2,
          ConversationStates.INFORMATION_3,
View Full Code Here

        // Player accepts the quest and gets to know what Wrviliza needs (switch to phase_2)
        npc.add(ConversationStates.QUEST_OFFERED,
            ConversationPhrases.YES_MESSAGES, null,
            ConversationStates.QUESTION_1, null,
            new MultipleActions(
                new ChatAction() {
                  public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
                    int pLevel = player.getLevel();
                    player.setQuest(QUEST_SLOT, getRequiredItemsCollection(pLevel));
                  }
                },
                new IncreaseKarmaAction(20),
                // here we have been careful to say the items from the collection only after the quest slot was set,
                // because in this quest, the amounts depend on level, above.
                new SayRequiredItemsFromCollectionAction(
                        QUEST_SLOT,
                        "Wroff! Right now, I need [items]. Do you by chance have anything of that with you already?")));

        // Player is not inclined to comply with the request and has not already rejected it once
        npc.add(ConversationStates.QUEST_OFFERED,
            ConversationPhrases.NO_MESSAGES,
            new AndCondition(
                new QuestNotActiveCondition(QUEST_SLOT),
                new QuestNotInStateCondition(QUEST_SLOT, "rejected")),
            ConversationStates.ATTENDING,
            "Wruff... I guess I will have to ask to someone with a better attitude!",
            new MultipleActions(
                new SetQuestAction(QUEST_SLOT, "rejected"),
                new DecreaseKarmaAction(20.0)));

        //Player is not inclined to comply with the request and he has rejected it last time
        //If player wants to buy any beverage here, he should really take the quest now
        //Wrviliza holds a grudge by turning idle again.
        npc.add(ConversationStates.QUEST_OFFERED,
            ConversationPhrases.NO_MESSAGES,
            new QuestInStateCondition(QUEST_SLOT, "rejected"),
            ConversationStates.IDLE,
            "Wruff... I guess you will wander around with a dry gulch then...",
            new MultipleActions(
                new SetQuestAction(QUEST_SLOT, "rejected"),
                new DecreaseKarmaAction(20.0)));
    }
View Full Code Here

                    + " bottles of my V.S.O.P. Koboldish Torcibud with my best wishes for you!");
            }
        };

        // Player collected all the items. grant the XP before handing out the torcibud
        ChatAction completeAction = new MultipleActions(
            new SetQuestAction(QUEST_SLOT, "done"),
            new SetQuestToFutureRandomTimeStampAction(QUEST_SLOT, 1, MIN_DELAY, MAX_DELAY),
            new IncreaseXPAction(XP_REWARD),
            addRewardAction);
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.action.MultipleActions

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.