跳到主要内容

经济条件

检查玩家的钱。这一页的 2 种类型在编辑器的「经济」分类里。

例子​

付 500 金钱请向导带路。接取条件先挡钱不够的人,接到时再真的扣:

plugins/StarQuest/quests/示例/雇用向导.yml
format: 1
id: 雇用向导
name: '&e雇用向导'
category: 示例
icon: GOLD_INGOT
settings:
start: {command: true}
repeat: {mode: unlimited}
requirements:
- {type: money, compare: '>=', value: 500}
on-start:
- {type: money, mode: take, amount: 500}
- {type: message, text: '&7向导收下了 500 金钱。'}
nodes:
开始:
type: start
x: 0
y: 100
next: [带路]
带路:
type: objective
x: 260
y: 100
track-text: 跟着向导走
goals:
- {type: reach, location: 'world,400,72,120', radius: 6, display: '到达山谷入口'}
next: [完成]
完成:
type: end
x: 520
y: 100
result: complete

钱不够时提示「金钱需要至少 500」,任务接不到。

金钱 money​

需要 Vault 和一个经济插件。

  • compare(比较):默认 >=
  • value(金额):必填,可以写变量
- {type: money, compare: '>=', value: 1000}

点券 playerpoints​

需要 PlayerPoints。

  • compare、value(点券)
- {type: playerpoints, compare: '>=', value: 50}

会踩的坑​

条件只看不扣。要扣钱用动作「金钱」mode: take,见 经济动作。扣钱失败时同一串后面的动作不会执行,上面的「收下了」那句就不会出现。

扣钱动作会先看余额,不够就不扣,不会扣成负数。但写在 on-start 里时任务已经接了,扣失败任务也照样进行。想「付了钱才开始」,把扣钱放在第一个节点,用 判断节点 先检查 money 再扣。

0:000:00