完整新建NPC设定范例
npc.sdb 同 item 为资料数据库,不起关键作用 但后边涉及人物没有,就会出问题,即便设错也不会出现内存地址错误不能启动问题。假如启动时出现内存地址道错误,建议先从其他几项中查错。
1,,tgs1000\Init\Npc.sdb 渔村捕盗大将 ★help中 渔村捕盗大将.txt
代码:渔村捕盗大将,捕盗大将,0,,渔村捕盗大将.txt,TRUE,,TRUE,TRUE,,,TRUE,13,23,181,700,200,,,,7500,0,0,0,0,,4,,4020,4023,,4022,,,,白龙手套:1:50:雕火龙套:1:30,,,,,,,,
2,,tgs1000\Help\渔村捕盗大将.txt(买卖拜师) NPC交易内容 并在\NpcSetting 中加入 渔村捕盗大将.txt
3,,tgs1000\Script\Script.sdb 调用外形,序号调用(179) NPC交易选项Script.SDB/179,渔村捕盗大将.txt,,
4,,tgs1000\Script\渔村捕盗大将.txt NPC活动方式 修改语句,交易内容
5,,tgs1000\Setting\CreateNpc0.sdb(179,渔村捕盗大将.txt,,) 位置 24,渔村捕盗大将,283,271,1,3,179,,
6,,tgs1000\NpcSetting 可以加入任何已有物品,自动获取价格 NpcSetting删除也不会出错误
7,,tgs1000\Init\Item.sdb 包含物品
1,,tgs1000\Init\Npc.sdb ★,,(渔村捕盗大将).txt,TRUE,
渔村捕盗大将,捕盗大将,0,,渔村捕盗大将.txt,TRUE,,TRUE,TRUE,,,TRUE,13,23,181,700,200,,,,7500,0,0,0,0,,4,,4020,4023,,4022,,,,白龙手套:1:50:雕火龙套:1:30,,,,,,,,
2,,tgs1000\Help\渔村白捕校.txt
<trade>
<title>捕盗大将</title>
<image name=z23 value=181>
<text>
出售拳法武功密笈。
</text>
<command send='close'>关闭</command>
<command send="buy">出售物品</command> 对应Script\渔村捕盗大将.txt 中 'buy' then begin \NpcSetting 渔村捕盗大将.txt 中 SELLTITLE:渔村捕盗大将
<command send="sell">买拳法密笈</command> 对应Script\渔村捕盗大将.txt 中 'sell' then begin \NpcSetting BUYTITLE:渔村捕盗大将
<command send="baishi">申请拜师</command>
</trade>
3,,tgs1000\Setting\CreateNpc0.sdb
内容:24,渔村捕盗大将,283,271,1,3,179,,
4,,tgs1000\Script\Script.sdb
Script.sdb内容:179,渔村捕盗大将.txt,,
5,,tgs1000\Script\渔村捕盗大将.txt
unit 捕盗大将;
interface
function GetToken (aStr, aToken, aSep : String) : String;
function CompareStr (aStr1, aStr2 : String) : Boolean;
function callfunc (aText: string): string;
procedure print (aText: string);
function Random (aScope: integer): integer;
function Length (aText: string): integer;
procedure Inc (aInt: integer);
procedure Dec (aInt: integer);
function StrToInt (astr: string): integer;
function IntToStr (aInt: integer): string;
procedure exit;
procedure OnGetResult (aStr : String);
procedure OnLeftClick (aStr : String);
implementation
procedure OnLeftClick (aStr : String);
var
Str : String;
Race : Integer;
begin
Str := callfunc ('getsenderrace');
Race := StrToInt (Str);
if Race = 1 then begin
Str := 'showwindow .\help\渔村捕盗大将.txt 1';
print (Str);
exit;
end;
end;
procedure OnGetResult (aStr : String);
var
Str, Name : String;
begin
if aStr = 'close' then begin
exit;
end;
if aStr = 'sell' then begin
Name := callfunc ('getsendername');
Str := 'tradewindow ' + Name;
Str := Str + ' 0';
print (Str);
exit;
end;
if aStr = 'buy' then begin
Name := callfunc ('getsendername');
Str := 'tradewindow ' + Name;
Str := Str + ' 1';
print (Str);
exit;
end;
if aStr = 'baishi' then begin
Str := callfunc ('getsenderitemexistence 拜师申请书:1');
if Str = 'false' then begin
Str := 'say 没有拜师申请书';
print (Str);
exit;
end;
if Str = 'true' then begin
Str := callfunc ('checkenoughspace');
if Str = 'false' then begin
print ('say 物品栏已满');
exit;
end;
Str := 'getsenderitem 拜师申请书:1';
print (Str);
Str := 'putsendermagicitem 无影脚:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 旋风脚:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 骨架击:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 少林长拳:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 如来金刚拳:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 太极拳:1 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 生药:500 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 丸药:500 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 丹药:500 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 汤药:500 @渔村捕盗大将 4';
print (Str);
Str := 'putsendermagicitem 浪人手套:1 @渔村捕盗大将 4';
print (Str);
Str := 'say 徒儿.别给师傅丢脸哦~';
print (Str);
exit;
end;
end;
exit;
end;
end;
end.
6,,tgs1000\NpcSetting 可以加入任何已有物品,自动获取价格
注意:SELLTITLE:渔村捕盗大将,为引用名
渔村捕盗大将.txt中SELLIMAGE:181 = Help\渔村白捕校.txt 中 value=181(注:这是捕盗大将特有的,和别的NPC一定要区分)
SELLTITLE:渔村捕盗大将
SELLCAPTION:出售拳法武功密笈.
SELLIMAGE:181
SELLITEM:无影脚
SELLITEM:旋风脚
SELLITEM:太极拳
SELLITEM:骨架击
SELLITEM:少林长拳
SELLITEM:如来金刚拳
BUYTITLE:渔村捕盗大将
BUYCAPTION:有东西要出售吗?
BUYIMAGE:181
BUYITEM:九法手套1
BUYITEM:九法手套2
BUYITEM:青龙手套
BUYITEM:擒拿手
BUYITEM:轰岩手套
BUYITEM:黄金手套
BUYITEM:白龙手套
BUYITEM:黑龙手套
BUYITEM:雕火龙套
7,,tgs1000\Init\Item.sdb
Item 中包含上列物品