Quests Example

This example will show you a conversation that will start and finish a Quests for the player using the plugin QUESTS.

The quest will consist on bringing an iron ingot to the NPC. I will use an empty quest called bob_the_king. What I mean by an empty quest is that it will have an empty stage, the quest itself will be managed by my plugin Interactions because we want something simple.

Since we will be using some PlaceholderAPI variables remember to download the following expansions: CheckItem and Quests /papi ecloud download CheckItem (https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#checkitem) /papi ecloud download Quests (https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#quests)

Config

name: '{centered}&c&lBob'
starts_with:
- NPC named Bob
block_movement: true
slow_effect: false
save_conversation_progress: false
start_conversation_radius: 0
end_conversation_radius: 5
requires_permission: false
conversation:
  conversation1:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7Hello, can you help me with something?'
        time: 2
        show_name: false
        conditional_dialogue:
          conditional_dialogue1:
            requires:
            - '%quests_player_has_completed_quest_bob_the_king% == true'
            start_conversation: conversation6
          conditional_dialogue2:
            requires:
            - '%quests_player_has_current_quest_bob_the_king% == Yes'
            start_conversation: conversation4
    options:
      option1:
        text: '&eSure.'
        start_conversation: conversation2
      option2:
        text: '&eNot now.'
        start_conversation: conversation3
    random_dialogue: false
  conversation2:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7Could you bring me an iron ingot please?'
        - ' '
        - ' '
        time: 2
        show_name: false
      dialogue2:
        text:
        - '{centered}&eQUEST STARTED!'
        - '{centered}&f&nBob the King'
        - '{centered}'
        - '{centered}&6Objective:'
        - '{centered}&7Bring x1 Iron Ingot to Bob on Kryngel city.'
        time: 2
        actions:
        - 'title: 20;40;20;&6QUEST STARTED!;&fBob the King'
        - 'console_command: questadmin give %player% bob_the_king'
        show_name: false
        save_dialogue_to_player: true
    random_dialogue: false
  conversation3:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7Ok no problem.'
        time: 2
        show_name: false
    random_dialogue: false
  conversation4:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7I don''t see an iron ingot with you.'
        - '{centered}&7Please hurry!'
        time: 2
        show_name: false
        conditional_dialogue:
          conditional_dialogue1:
            requires:
            - '%checkitem_mat:IRON_INGOT,amt:1% == yes'
            start_conversation: conversation5
    random_dialogue: false
  conversation5:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7You have the iron ingot? Perfect, thanks!'
        time: 2
        actions:
        - 'remove_item: IRON_INGOT;1'
        - 'console_command: questadmin finish %player% bob_the_king'
        show_name: false
        actions_after_dialogue: true
    random_dialogue: false
  conversation6:
    dialogue:
      dialogue1:
        text:
        - '{centered}&c&lBob &f:'
        - '{centered}&7Thank you again for the iron ingot. Have'
        - '{centered}&7a nice day.'
        time: 2
        show_name: false
    random_dialogue: false

Explanation

We have 6 different conversations, I will explain what each of them does.

The first time the player speaks with this NPC, it will ask for help and show 2 options. The first option will send the player to conversation2 and the second option to conversation3. If the player has already completed the quest bob_the_king , conversation6 will be started instead. If the player is currently doing the quest, conversation4 will be started. These conditions/requirements are managed by the conditional dialogues. In the case of the plugin Quests each variable will return something else (it's king of weird) %quests_player_has_completed_quest_<quest>% should return true or false. %quests_player_has_current_quest_<quest>% should return Yes or No.

Interactions Quests Module

You can also create quests that require to "start conversation" and "end conversation" objectives to your Quests plugin. For that you will need the following plugin: https://www.spigotmc.org/resources/interactions-quests-module.92421/

Last updated