1.x/List of Requirement node types

From Citizens Wiki

< 1.x

Revision as of 01:47, 29 January 2012 by Aufdemrand (talk | contribs) (Created page with "=Requirements node= The requirements node is used in Quests.yml to tell the quester what is required for the the player before the quest can start. If all the requirements l...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Requirements node

The requirements node is used in Quests.yml to tell the quester what is required for the the player before the quest can start. If all the requirements listed in the requirements: node are met, the quest is granted. Requirements share a lot in common with rewards, as most reward types can also be used for requirements.

For example:

requirements:
    '0':
        type: item    # Requires an item.
        id: 371       # gold_nugget
        amount: 30
        take: true    # Takes the gold nuggets from the player.
    '1':
        type: quest   # Requires a quest to be completed prior.
        quest: "Example Quest"

You may have multiple requirements, or just one.

Requirement Types

NPC

Notes from aufdemrand: I have to test that the NPC requirement actually works. I'll do this asap. If you find it does or doesn't, let me know on IRC

NPC requirement (npc:) - requires an NPC to be owned by the player. Uses a name: node to specify the name of the npc, and a comma-separated list of toggles in the types: node (eg. trader,quester,guard). Will create an NPC owned by the player who completed the quest, with a generated UID.

'0':
    type: npc
    npcid: 1   # id of npc in which to check ownership


Rank

Rank requirement (rank) - checks that a player has access to a group ('rank') provided it uses a compatible permissions system. Specified by the rank: node.

'0':
    type: rank
    rank: 'admin'   # Quest requires admin rank


Permission

Permission reward (permission) - grants a permission to a player. Specified by the permission: node.

'0':
    type: permission
    permission: 'quests.admin'


Quest

Quest reward (quest) - grants a quest to a player. Note that it cannot be taken away from a player. Specified by the quest: node.

'0':
    type: quest
    quest: 'builder'

Note by aufdemrand: Need to test behavior of using the quest reward in a sub-objective reward. Will report what I find soon.


Item

Item reward (item) - gives an item to a player. Loaded from the item: nodes.


'0':
    type: item
    item:
        id: 10
        amount: 50
        data: 0

Health

Health reward (health) - gives health to a player. Loaded from the amount: node.

'0':
    type: health
    amount: 10


Money

Money reward (money) - gives money to a player. Loaded from the money: node.

'0':
    type: money
    money: 100


Teleport

Teleport reward (teleport) - teleports a player to a location. Loaded from the location: node.

'0':
    type: teleport
    location:
        x: 10
        y: 50
        z: -10
        world: 'main'