本帖最后由 1582952890 于 2017-9-17 06:55 编辑

本插件是最好的创建脚本npc的插件

下面举个例子(其实是作者举了个栗子)
——Citizens2附属插件,为npc添加脚本

本插件是最好的创建脚本npc的插件
本插件是citizen2的扩展,必须有前置插件才有效果
主要功能:增加与npc的对话,npc执行指令等
-该插件设计脚本编写,难度较高

下面举个例子(其实是作者举了个栗子)
Cookies: #名字type: assignment#类型interact scripts: #交互脚本- 100 Cookie Handler Cookie Handler: #脚本名称type: interact #类型译:互动steps: #步骤 'Spreading the Word*': #说这些话 click trigger: #点击触发 script: #脚本 - random 3 #3个中随机说 - chat 'I like cookies!' - chat 'MMmm.. cookies are favorite!' - chat 'Cocoa and wheat me freak!' chat trigger: #聊天触发 'Cookies': trigger: 'I love /cookie/s!' #触发用语 script: #脚本 - chat 'Me too!'#回答这句话 - narrate '<npc.name> gives you some cookies.'#字幕:(npc名字)给了你一些饼干 - give i@cookie qty:6 #脚本 - zap 'step:Cookies given' #执行指定脚本 'Cookies given': click trigger: script: - chat 'How were the cookies?' - zap 'step:Spreading the Word'
指令:/npc assignment --set cookies 给指向的npc添加此脚本
再举个例子
Basic Healer:
type: assignment
interact scripts:
- 100 heal me, bro!
Heal me, bro!:
type: interact
steps:
"Need a heal?*":
click trigger:
script:
- if '<player.health>' < '<m:<player.health.max> / 2>' { # 如果血量低于上限的二分之一
- look <player.location> #检查玩家
- chat 'Woah dude, you are <player.health.formatted>! You could use a heal!'
- chat 'Just give me another click to get some power!'
- zap "Healin'" duration:30s #执行下一个脚本
} else {
- look <player.location>
- chat 'Nice an healthy. Keep it up!'
}
"Healin'":
click trigger:
script:
- ^zap 'need a heal?'
- ^engage
- chat "Here goes nothin'!"
- playeffect instant_spell <npc.location> qty:25
- playeffect heart <player.location> qty:25 offset:1
- heal <player>#治愈玩家
- disengage
教程视频:http://mcmonkey.org/denizen/vids
旧脚本库
新脚本库
说实话我刚看到挺激动的。。确实也很有用但是难度较高。。适合技术水准高的腐竹和技术使用..
Denizen——让你的npc活起来!
——Citizens2附属插件,为npc添加脚本

本插件是最好的创建脚本npc的插件
本插件是citizen2的扩展,必须有前置插件才有效果
主要功能:增加与npc的对话,npc执行指令等
-该插件设计脚本编写,难度较高

下面举个例子(其实是作者举了个栗子)
再举个例子
2021.12 数据,可能有更多内容
Denizen——让你的npc活起来!——Citizens2附属插件,为npc添加脚本

本插件是最好的创建脚本npc的插件
本插件是citizen2的扩展,必须有前置插件才有效果
主要功能:增加与npc的对话,npc执行指令等
-该插件设计脚本编写,难度较高

下面举个例子(其实是作者举了个栗子)
Cookies: #名字type: assignment#类型interact scripts: #交互脚本- 100 Cookie Handler Cookie Handler: #脚本名称type: interact #类型译:互动steps: #步骤 'Spreading the Word*': #说这些话 click trigger: #点击触发 script: #脚本 - random 3 #3个中随机说 - chat 'I like cookies!' - chat 'MMmm.. cookies are favorite!' - chat 'Cocoa and wheat me freak!' chat trigger: #聊天触发 'Cookies': trigger: 'I love /cookie/s!' #触发用语 script: #脚本 - chat 'Me too!'#回答这句话 - narrate '<npc.name> gives you some cookies.'#字幕:(npc名字)给了你一些饼干 - give i@cookie qty:6 #脚本 - zap 'step:Cookies given' #执行指定脚本 'Cookies given': click trigger: script: - chat 'How were the cookies?' - zap 'step:Spreading the Word'
指令:/npc assignment --set cookies 给指向的npc添加此脚本
再举个例子
Basic Healer:
type: assignment
interact scripts:
- 100 heal me, bro!
Heal me, bro!:
type: interact
steps:
"Need a heal?*":
click trigger:
script:
- if '<player.health>' < '<m:<player.health.max> / 2>' { # 如果血量低于上限的二分之一
- look <player.location> #检查玩家
- chat 'Woah dude, you are <player.health.formatted>! You could use a heal!'
- chat 'Just give me another click to get some power!'
- zap "Healin'" duration:30s #执行下一个脚本
} else {
- look <player.location>
- chat 'Nice an healthy. Keep it up!'
}
"Healin'":
click trigger:
script:
- ^zap 'need a heal?'
- ^engage
- chat "Here goes nothin'!"
- playeffect instant_spell <npc.location> qty:25
- playeffect heart <player.location> qty:25 offset:1
- heal <player>#治愈玩家
- disengage
教程视频:http://mcmonkey.org/denizen/vids
旧脚本库
新脚本库
说实话我刚看到挺激动的。。确实也很有用但是难度较高。。适合技术水准高的腐竹和技术使用..
还好 对于经常修改配置文件的腐竹来说不是很难 顶一个
很好的作品!怎么没有多少人看呢?{:10_564:}难道是看贴不回帖的...
haidaidw0307 发表于 2015-9-30 19:15
很好的作品!怎么没有多少人看呢?难道是看贴不回帖的...
因为要写脚本。而一般的人大多只会指令,所以看了用不上
snowclay 发表于 2015-9-30 19:17
因为要写脚本。而一般的人大多只会指令,所以看了用不上
写这个我在行 =v= 有空可以试试、
@snowclay
我正需要这个插件,您可以再说得详细点吗?您发的插件都好简洁啊,功能希望能说全一下,毕竟您发的都是有用的。
唔..这个代码您知道吗?
[/quote]
不然您直接告诉吧,我要设置点击一个npc自动执行一条指令,就这样。。。您发的我真的看不懂。
我正需要这个插件,您可以再说得详细点吗?您发的插件都好简洁啊,功能希望能说全一下,毕竟您发的都是有用的。
唔..这个代码您知道吗?
[quote]abc
不然您直接告诉吧,我要设置点击一个npc自动执行一条指令,就这样。。。您发的我真的看不懂。
HuaiYang 发表于 2015-10-5 02:07
@snowclay
我正需要这个插件,您可以再说得详细点吗?您发的插件都好简洁啊,功能希望能说全一下,毕竟您 ...
这个是在配置文件里写脚本,然后给npc加上的。不同于一半的简单配置。所以我才说估计用的人少。。
不错 不过执行脚本的时候后台信息刷的有点多啊..
好插件,谢谢楼主
这个
interact scripts:
- 100 Cookie Handler
的作用是什么? 我删了它对话就不工作了
interact scripts:
- 100 Cookie Handler
的作用是什么? 我删了它对话就不工作了
还好··一般腐竹都不会用·
不然每个服都很牛啦··
不然每个服都很牛啦··
如果能够把citizen2 插件的mcbbs地址放在一起就完美了!
脚本放在哪个文件夹里?
测试:1.8.4水龙头服务器用不了!!会报错!!