作者airkiss (空中之吻)
看板mud_sanc
标题Re: [wizs]问题请教(十一)
时间Wed Jul 4 09:35:42 2007
※ 引述《hlead (希多)》之铭言:
: 想设往north走的人,
: 如果这里有"abc"这只怪,
: 然後身上小於30万就不能过去。
: 如果这里没有"abc"这只怪,就可以过去。
: 如果这里有"abc"这只怪,
: 且身上的钱大於或等於30万,
: 就可以过去。(然後身上的钱要减掉30万)
: 还是实验不出来= ="
在room的程式内create()中加入如下设定
============================================
set("pre_exit_func",([
"north":"do_north_check",
]) );
============================================
在create()之外, 自定function :
int do_north_check() {
object ppl = this_player();
if(ppl->query("wealth") < 300000) {
return 1; // you can't pass
if(present("abc")) { // the monster id : abc exists in the room
write("abc 说 : 您想干麽, 那边方向是不能进入的");
return 1; // it means that you can't pass
}
ppl->add("wealth",-300000);
write("您缴了30万後, 安全地通过往北的出口");
return 0; // it means that you can pass it
}
Airkiss
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.187.0.206
※ 编辑: airkiss 来自: 203.187.0.206 (07/04 09:50)