让NPC根据条件决定是否对当前玩家不可见 [聽風] #697
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
*npchidecondition "<NPC名称>","<条件>";
让NPC根据条件决定是否对当前玩家不可见 [聽風]
NPC名称:
你可以指定 NPC 的名称, 或者用 strnpcinfo(0) 获取当前 NPC 的名称.
条件:
类似于 if 命令中的任何表达式(意思就是if里面怎么写,条件就怎么写)。
返回值:
该指令无论成功与否, 都不会有返回值
用法演示:
OnInit: npchidecondition(strnpcinfo(0), "npcview == 1 && countitem(501) >= 1"); end;完整例子:
prontera,151,90,4 script Pandas系统测试 123,{
mes "你好啊";
mes "如果你身上有的话红色药水";
mes "我就不会见你!";
close2;
if ( countitem(501) ) {
npcview = 1;
cloakonnpc strnpcinfo(0),getcharid(0);
}
end;
OnInit:
npchidecondition(strnpcinfo(0), "npcview == 1 && countitem(501) >= 1");
end;
}