※ 引述《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