经济与奖励动作
发钱、扣钱、给经验、寄邮件、给权限。这一页的 5 种类型在编辑器的「经济与奖励」分类里。
例子
plugins/StarQuest/quests/示例/悬赏令.yml
format: 1
id: 悬赏令
name: '&c悬赏令'
category: 示例
icon: PAPER
settings:
start: {command: true}
repeat: {mode: daily, reset-time: '04:00'}
rewards:
- {type: money, mode: give, amount: 300}
- {type: exp, mode: levels, amount: 2}
nodes:
开始:
type: start
x: 0
y: 100
next: [悬赏]
悬赏:
type: objective
x: 260
y: 100
track-text: 讨伐悬赏目标
goals:
- {type: kill, entity: [PILLAGER], amount: 6}
next: [完成]
完成:
type: end
x: 520
y: 100
result: complete
完成时聊天栏显示「获得奖励:」,下面两行「300 金钱」「2 级经验」。任务日志的奖励栏也是这两行。
金钱 money
需要 Vault 和经济插件。
mode(操作):give给予(默认)、take扣除amount(金额):必填,可以写变量
- {type: money, mode: take, amount: 500}
扣除时钱不够,玩家看到「钱袋里的金钱不够或暂时无法扣除(需要 500),这次的后续奖励没有发放」,同一串后面的动作都不执行。
给予时经济插件拒绝收(帐户冻结、超过上限、数据库断线),这笔钱记在 plugins/StarQuest/owed-money.yml,玩家上线时和之后每分钟自动补发,不会消失。
点券 playerpoints
需要 PlayerPoints。
mode(操作):give给予(默认)、take扣除amount(点券):必填,可以写变量
- {type: playerpoints, mode: give, amount: 20}
经验 exp
mode(操作):give给经验值(默认)、levels给等级、take-levels扣等级、set-level设定等级amount(数量):必填,可以写变量
- {type: exp, mode: levels, amount: 3}
寄星月邮件 mail
寄一封星月邮箱邮件,可附物品、金钱、点券和领取时执行的指令。需要星月邮箱 StarMail。
title(标题):必填content(内容):可以写成列表分好几行items(附件物品):列表,物品写法后面加*数量,例如ci:剑*2money(附金钱):默认 0points(附点券):默认 0commands(领取时执行的指令):列表
- type: mail
title: '&6主线奖励补发'
content:
- '辛苦了,{player}。'
- '这是第一章的纪念品。'
items: ['ci:星月徽章*1', 'DIAMOND*5']
money: 200
给予 / 移除权限 permission
通过 Vault 改玩家的权限,需要 Vault 和支持 Vault 的权限插件。
permission(权限):必填mode(操作):add给予(默认)、remove移除world(只在某个世界):不写 = 全部世界
- {type: permission, permission: essentials.fly, mode: add}
会踩的坑
奖励栏只会自动写出「给予」的金钱、点券、经验(给经验值和给等级),扣除、设定等级、邮件、权限都不会出现在奖励栏,要显示就写 reward-display,见 奖励。
money 没装 Vault 经济时什么都不会发生,后台印一次「没有 Vault 经济插件」。
permission 是永久的。要限时权限,用 command 动作执行权限插件自己的限时指令,例如 LuckPerms 的 lp user {player} permission settemp …。