作者laechan (打死不投马冏,李系咩安抓)
看板mud_sanc
标题Re: [wizs]问题请教(十一)
时间Wed Jul 4 12:33:40 2007
※ 引述《airkiss (空中之吻)》之铭言:
: 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
所以 mob id 越独特越好,例如在一般的 id 之外增设特别的,像是..
set("id",({"abc","ABC"})); // 保证没叫做 "ABC" 这个 id 的玩家、其它怪、物品
: 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
以 pre_exit_func 设定的出口通过检查函数,return 1 就是不执
行原先的方向动作(如上例是往北),return 0 就是执行原先的方向
动作。
return 1 有时也可以做其它用途,例如往北=>让他移动到别处,这
个你可以寻找相关的房间自行 more。
Laechan@Sanc
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.225.185.24