跳到主要内容

登录消息

用对话的方式替代枯燥的登录提示消息

展开

对话模板配置

plugins/QuestEngine/space/template/example.yml
chat_login:
type: chat_dialog
header:
- "{{[[static]][[ %img_logo%]]}}"
- "{{[[static]][[ ]]}}"
- "{{[[static]][[ ]]}}{{[[animation]][[<0>]]}}"
addIndex: 1
add: "{{[[static]][[ ]]}}{{[[animation]][[__variable__]]}}"
footer:
- "{{[[static]][[ ]]}}"
提示

其中 img_logo 是占位符变量,配合 ItemAdders 实现图标

对话配置

plugins/QuestEngine/space/dialog/extra/login.yml
authmeLog:
npcIDs: []

#####
# 此设置为默认,复制使用
type: chat
template: chat_login
replyChoose: " &8&l[ &a&l! &8&l]&f "
#####

dialog:
- "&{#F99417}< &{#FF5F9E}&l欢迎来到 &{#8DCBE6}&l启迪之境 >"
- "请打开聊天框进行登录"
reply:
- replyID: a
content:
- "输入 &6/Login 密码"
flag:
- NO_CACHE_CHAT
- BLINDNESS
- KEEP_CONTENT
- SLOW
- NO_SELECT

authmeReg:
hook: authmeLog

dialog:
- "&{#F99417}< &{#FF5F9E}&l欢迎来到 &{#8DCBE6}&l启迪之境 >"
- "请打开聊天框进行注册"
reply:
- replyID: a
content:
- "输入 &6/reg 密码 重复密码"

authmeErrorReg:
hook: authmeLog

dialog:
- "&{#F99417}< &{#FF5F9E}&l欢迎来到 &{#8DCBE6}&l启迪之境 >"
- "&c密码与重复密码不相同"
reply:
- replyID: a
content:
- "输入 &6/reg 密码 重复密码"

authmeErrorLog:
hook: authmeLog

dialog:
- "&{#F99417}< &{#FF5F9E}&l欢迎来到 &{#8DCBE6}&l启迪之境 >"
- "&c密码错误,请重新输入"
reply:
- replyID: a
content:
- "输入 &6/Login 密码"

loginWelcome:
hook: authmeLog

dialog:
- "&{#F99417}< &{#FF5F9E}&l欢迎来到 &{#8DCBE6}&l启迪之境 >"
reply:
- replyID: a
content:
- "尽情游玩吧"
flag:
- NO_SCREEN
- NO_SELECT

任务配置

plugins/QuestEngine/space/quest/extra/login.yml
quest:
id: extra_login
accept:
# 加入服务器自动接受任务
auto: true
target:
- id: a
# 加入服务器时,重新接受任务,使所有目标条目状态为进行中
# 并且发送登录对话
event: 'player join server'
trigger:
- type: FINISH
script: |
dialog select authmeLog
dialog send
quest select extra_login
quest accept
- id: b
# 未注册过的,结束登录对话,发送注册对话
event: 'authme unregister'
trigger:
- type: FINISH
script: |
dialog select authmeLog
dialog end
dialog select authmeReg
dialog send
- id: c
# 注册失败,结束注册对话,发送注册失败对话
event: 'authme failed register'
trigger:
- type: FINISH
script: |
dialog select authmeReg
dialog end
dialog select authmeErrorReg
dialog send
- id: d
# 登录成功,结束登录相关对话,发送欢迎登录对话
event: 'authme login'
trigger:
- type: FINISH
script: |
dialog select authmeLog
dialog end
dialog select authmeErrorLog
dialog end
dialog select loginWelcome
dialog send
- id: e
# 密码错误,结束登录对话,发送密码错误提示对话
event: 'authme failed login'
trigger:
- type: FINISH
script: |
dialog select authmeLog
dialog end
dialog select authmeErrorLog
dialog send
- id: f
# 注册成功,结束注册相关对话,发送欢迎登录对话
event: 'authme register'
trigger:
- type: FINISH
script: |
dialog select authmeReg
dialog end
dialog select authmeErrorReg
dialog end
dialog select loginWelcome
dialog send