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

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


    // 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 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",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "start"),
View Full Code Here

                                    new IncreaseXPAction(5000),
                                    new IncreaseKarmaAction(15),
                  addRandomNumberOfItemsAction,                      
                  new IncrementQuestAction(QUEST_SLOT, 2, 1),
                  new SetQuestToTimeStampAction(QUEST_SLOT,1),
                  new SetQuestAction(QUEST_SLOT, 0, "done")));

   
  }
View Full Code Here

        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotCompletedCondition(QUEST_SLOT),
            new NotCondition(new PlayerHasItemWithHimCondition("kanmararn prison key"))),
        ConversationStates.IDLE,
        "Help! The duergars have raided the prison and locked me up! I'm supposed to be the Guard! It's a shambles.",
        new SetQuestAction(QUEST_SLOT, "start"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        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

        null);

    //player returns to Hayunn having killed a rat
    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new IncreaseXPAction(10));
    actions.add(new SetQuestAction(QUEST_SLOT, "killed"));

    npc.add(
        ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        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!",
View Full Code Here

                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

            }
        };

        // 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);

        // add triggers for the item names
View Full Code Here

        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_1, "Fine, what did you bring?",
        null);

    ChatAction completeAction = new MultipleActions(
                      new SetQuestAction(QUEST_SLOT, "reward"),
                      new SayTextAction("You have served me well, my crown will be the mightiest of them all!"
                      + " Go to see "+ REWARD_NPC_NAME+ " in the Wizard City to get your #reward."),
                      new IncreaseXPAction(XP_REWARD)
                      );
    /* add triggers for the item names */
 
View Full Code Here

    // player says he has a blue elf cloak with him and it's the last one
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("blue elf cloak"));
    reward.add(new EquipItemAction("golden shield", 1, true));
    reward.add(new IncreaseXPAction(15000));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(25));
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "1"), new PlayerHasItemWithHimCondition("blue elf cloak")),
        ConversationStates.ATTENDING,
View Full Code Here

    int points = (int) (DEFAULT_REWARD_POINTS * Math.exp(1 - normalized));
    // Give at least one xp for persistent but hopelessly slow players
    points = Math.max(points, 1);

    DBCommandQueue.get().enqueue(new WriteHallOfFamePointsCommand(player.getName(), "M", points, true));
    new SetQuestAction("maze", 0, "done").fire(player, null, null);
    new IncrementQuestAction("maze", 2, 1).fire(player, null, null);
    player.sendPrivateText("You used " + TimeUtil.timeUntil((int) (timediff / 1000), true)
        + " to solve the maze. That was worth " + Grammar.quantityplnoun(points, "point") + ".");
    SingletonRepository.getAchievementNotifier().onFinishQuest(player);
    player.addXP(REWARD_XP);
View Full Code Here

TOP

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

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.