1.x/List of Rewards node types: Difference between revisions

From Citizens Wiki

< 1.x

(Created page with "The rewards: node is used in Quests.yml for rewarding the player when certain conditions have been met. ''Format:''' Name (''type specifier'') - '''description''' These can...")
 
No edit summary
Line 1: Line 1:
The rewards: node is used in [[Quests.yml]] for rewarding the player when certain conditions have been met.
=Rewards node=
The rewards node is used in [[Quests.yml]] to tell the quester what to reward the player with when conditions are met. If all the objectives are completed, the rewards: node is triggered. 


''Format:''' Name (''type specifier'') - '''description'''
For example:


These can be used as both rewards ''and'' requirements to start a quest. As rewards, they can be either give rewards, or take rewards. As requirements, they can only be used to take from a player. Rewards can also be specified under each objective, and also for each step, using the same syntax.
<pre>rewards:
    '0':
        type: item    # Rewards an item
        id: 15        # iron_ore
        amount: 30
    '1':
        type: quest  # Rewards a quest. This quest will start immediately.
        quest: "Part II"
</pre>


Command reward (command) - executes a command.
You may have multiple rewards, or just one.  Rewards can also be subset into objectives to reward the player as objectives are completed. The format is the same.
 
=Rewards Types=
==Command==
 
Command reward (command:) - executes a command.
Specified by the command: node. Use <player> as a variable that will be replaced with the name of the player who is receiving the reward. Use <world> as a variable that will be replaced with the name of the world the player is currently in. Use server: true to execute the command from the console.
Specified by the command: node. Use <player> as a variable that will be replaced with the name of the player who is receiving the reward. Use <world> as a variable that will be replaced with the name of the world the player is currently in. Use server: true to execute the command from the console.
Ex:
    '0':
        type: command
        command: give <player> 1 100
        server: false


NPC reward (npc) - grants an npc to a player.
<pre>'0':
    type: command
    command: give <player> 1 100
    server: false
</pre>
 
 
==NPC==
 
NPC reward (npc:) - grants an npc to a 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.
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.
Ex:
 
    '0':
<pre>'0':
        type: npc
    type: npc
        npcid: 1 (optional - gives the ownership of npc specified by this id to the player)
    npcid: 1   # optional - gives the ownership of npc specified by this id to the player
        name: 'Bill'
    name: 'Bill'
        types: 'guard,trader,quester'
    types: 'guard,trader,quester'
        location:
    location:
            x: 10
        x: 10
            y: 10
        y: 10
            z: -50
        z: -50
            world: 'test'
        world: 'world'</pre>
 
 
==Rank==


Rank reward (rank) - grants a group ('rank') to a player.
Rank reward (rank) - grants a group ('rank') to a player.
Specified by the rank: node.
Specified by the rank: node.
Ex:
 
    '0':
<pre>'0':
        type: rank
    type: rank
        rank: 'admin'
    rank: 'admin'</pre>
 
 
==Permission==


Permission reward (permission) - grants a permission to a player.
Permission reward (permission) - grants a permission to a player.
Specified by the permission: node.
Specified by the permission: node.
Ex:
 
    '0':
<pre>'0':
        type: permission
    type: permission
        permission: 'quests.admin'
    permission: 'quests.admin'
</pre>
 
 
==Quest==


Quest reward (quest) - grants a quest to a player. Note that it cannot be taken away from a player.
Quest reward (quest) - grants a quest to a player. Note that it cannot be taken away from a player.
Specified by the quest: node.
Specified by the quest: node.
Ex:
<pre>'0':
    '0':
    type: quest
        type: quest
    quest: 'builder'
        quest: 'builder'
 
 
==Item==


Item reward (item) - gives an item to a player.
Item reward (item) - gives an item to a player.
Loaded from the item: nodes.
Loaded from the item: nodes.
Ex:
 
    '0':
 
        type: item
<pre>'0':
        item:
    type: item
            id: 10
    item:
            amount: 50
        id: 10
            data: 0
        amount: 50
        data: 0</pre>
 
 
==Health==


Health reward (health) - gives health to a player.
Health reward (health) - gives health to a player.
Loaded from the amount: node.
Loaded from the amount: node.
Ex:
 
    '0':
<pre>
        type: health
'0':
        amount: 10
    type: health
    amount: 10
</pre>
 
 
==Money==


Money reward (money) - gives money to a player.
Money reward (money) - gives money to a player.
Loaded from the money: node.
Loaded from the money: node.
Ex:
 
    '0':
<pre>'0':
        type: money
    type: money
        money: 100
    money: 100</pre>
 
 
==Teleport==


Teleport reward (teleport) - teleports a player to a location.
Teleport reward (teleport) - teleports a player to a location.
Loaded from the location: node.
Loaded from the location: node.
Ex:
 
    '0':
<pre>'0':
        type: teleport
    type: teleport
        location:
    location:
            x: 10
        x: 10
            y: 50
        y: 50
            z: -10
        z: -10
            world: 'main'
        world: 'main'</pre>

Revision as of 01:36, 27 January 2012

Rewards node

The rewards node is used in Quests.yml to tell the quester what to reward the player with when conditions are met. If all the objectives are completed, the rewards: node is triggered.

For example:

rewards:
    '0':
        type: item    # Rewards an item
        id: 15        # iron_ore
        amount: 30
    '1':
        type: quest   # Rewards a quest.  This quest will start immediately.
        quest: "Part II"

You may have multiple rewards, or just one. Rewards can also be subset into objectives to reward the player as objectives are completed. The format is the same.

Rewards Types

Command

Command reward (command:) - executes a command. Specified by the command: node. Use <player> as a variable that will be replaced with the name of the player who is receiving the reward. Use <world> as a variable that will be replaced with the name of the world the player is currently in. Use server: true to execute the command from the console.

'0':
    type: command
    command: give <player> 1 100
    server: false


NPC

NPC reward (npc:) - grants an npc to a 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   # optional - gives the ownership of npc specified by this id to the player
    name: 'Bill'
    types: 'guard,trader,quester'
    location:
        x: 10
        y: 10
        z: -50
        world: 'world'


Rank

Rank reward (rank) - grants a group ('rank') to a player. Specified by the rank: node.

'0':
    type: rank
    rank: 'admin'


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'


==Item==

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


<pre>'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'