admin 发表于 2025-8-12 14:38:49

【千年服务端】千年宝宝脚本

千年宝宝脚本--呕血奉献

NPC的名称和NPC判断的名称自己改。。
NPC名称是’老胡的儿子‘
自己改
所有的
if namea <> '老胡' then begin
把老胡改成自己的名称

可以输入命令攻击的宝宝。。
杀怪路上不在独单。。。
人物要自己加,,只是脚本,,不会加的看了白看。。。。
看了不顶是狗,,,最好来我的服务器玩玩。。。
记住命令”号不输入。。
“攻击+空格+玩家名称”
“停止攻击”
”跟我来“
点击浏览该文件

文字解说一下

有什么不对的地方 请大家指出来

首先在script文件夹内新建一个文档文件 名字随意 最好使用你将给宝宝取的名字做为文件名

然后把下面代码复制到内

unit 老泊;

interface

functionGetToken (aStr, aToken, aSep : String) : String;
functionCompareStr (aStr1, aStr2 : String) : Boolean;
functioncallfunc (aText: string): string;
procedure print (aText: string);
functionRandom (aScope: integer): integer;
functionLength (aText: string): integer;
procedure Inc (aInt: integer);
procedure Dec (aInt: integer);
functionStrToInt (astr: string): integer;
functionIntToStr (aInt: integer): string;
procedure exit;

procedure OnDblClick(aStr : String);
procedure OnGetResult (aStr : String);
procedure OnHear (aStr : String);
procedure OnDie (aStr : String);
procedure OnAway (aStr : String);

var
yidong :string;
name :string;
implementation

procedure OnHear (aStr : String);
var
namea, pstr, Str, rdStr, xStr, yStr : String;
   x, y, xx, yy : Integer;
   Race : Integer;
   cuan, detu : String;
   detua : Integer;
begin
namea := callfunc ('getsendername');
if namea <> 'GM玫瑰小姐' then begin
exit;
end;
if astr = '停止攻击' then begin
str := 'say ' + 'Yes-老大!停止攻击〔';
str := str + pstr;
str := str + '〕';
print (str);
print ('attack 狗日')
yidong := '停';
exit;
end;

rdstr := GetToken (astr, yStr, '_');
if ystr = '攻击' then begin
rdstr := 'say ' + astr;
print (rdstr);
pstr := GetToken (astr, xStr, '_');
str := 'say ' + 'Yes-老大!攻击〔';
str := str + pstr;
str := str + '〕';
print (str);
str :='findobjectbyname '+ pstr;
str := callfunc (str) ;
str := 'attack ' + str;
print (str);
yidong := '停';
exit;
end;

if astr = '跟我来' then begin
yidong := '走';

print ('attack 狗日');
detu := callfunc ('getsenderserverid');
str := callfunc ('getsenderposition');

   Str := GetToken (Str, xStr, '_');
   x := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   y := StrToInt (yStr);

   rdStr := 'getnearxy ' + xStr;
   rdStr := rdStr + ' ';
   rdStr := rdStr+ yStr;
   Str := callfunc (rdStr);


   Str := GetToken (Str, xStr, '_');
   xx := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   yy := StrToInt (yStr);

   if x = xx then begin
      if y = yy then begin
         exit;
      end;
   end;

if yidong <> '走' then exit;
cuan := 'directmovespace 老泊 npc ';
str :=cuan + detu;
str :=str + ' ';
str :=str + xstr;
str :=str + ' ';
str :=str + ystr;
print (str);
str := 'say ' + '老大抱我! 100';
print (str);
exit;
end;
end;

end;


procedure OnAway (aStr : String);
var
   namea, Str, rdStr, xStr, yStr : String;
   x, y, xx, yy : Integer;
   cuan, detu : String;
   detua : Integer;
begin
name := 'GM玫瑰小姐';
namea := callfunc ('getsendername');
if namea = name then begin
   Str := callfunc ('getsenderrace');
   if Str <> '1' then exit;
   print ('say 哈哈...');

detu := callfunc ('getsenderserverid');
str := callfunc ('getsenderposition');

   Str := GetToken (Str, xStr, '_');
   x := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   y := StrToInt (yStr);

   rdStr := 'getnearxy ' + xStr;
   rdStr := rdStr + ' ';
   rdStr := rdStr+ yStr;
   Str := callfunc (rdStr);


   Str := GetToken (Str, xStr, '_');
   xx := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   yy := StrToInt (yStr);

   if x = xx then begin
      if y = yy then begin
         exit;
      end;
   end;

if yidong <> '走' then exit;
cuan := 'directmovespace 老泊 npc ';
str :=cuan + detu;
str :=str + ' ';
str :=str + xstr;
str :=str + ' ';
str :=str + ystr;
print (str);
end;
exit;
end;
end;
procedure OnDblClick (aStr : String);
var
   name, namea, Str, rdStr, xStr, yStr : String;
   x, y, xx, yy : Integer;
   cuan, detu : String;
   detua : Integer;
begin
print ('attack 狗日');
detu := callfunc ('getsenderserverid');
str := callfunc ('getsenderposition');

   Str := GetToken (Str, xStr, '_');
   x := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   y := StrToInt (yStr);

   rdStr := 'getnearxy ' + xStr;
   rdStr := rdStr + ' ';
   rdStr := rdStr+ yStr;
   Str := callfunc (rdStr);


   Str := GetToken (Str, xStr, '_');
   xx := StrToInt (xStr);
   Str := GetToken (Str, yStr, '_');
   yy := StrToInt (yStr);

   if x = xx then begin
      if y = yy then begin
         exit;
      end;
   end;
cuan := 'directmovespace 老泊 npc ';
str :=cuan + detu;
str :=str + ' ';
str :=str + xstr;
str :=str + ' ';
str :=str + ystr;
   if x = xx then begin
      if y = yy then begin
         exit;
      end;
   end;
print (str);

end;

end.注意上面有的地方 是宝宝将有的名字 宝宝将得到命令以后的对话宝宝的主人名称使用宝宝的命令 注意不需要使用@
第二
我们在相同的文件夹中找到Script.SDB
在文件内加入          XXX(这里是排列顺序号),老泊.txt,,
第三步
在init文件夹内找到NPC.SDB
在里面编写宝宝(其实就是一个NPC)属性代码
第四步
打开setting文件夹找到刷出NPC的文件 根据地图添加
例如长城以南刷个宝宝在中央 就找到CreateNpc1.sdb
在里面添加宝宝NPC
102(这里是我的排列号改为你自己的),老泊,533,475,1,2,XXX(对应上面Script.SDB
的号码),,
好了这样就添加完成了
你可以上你的服务器到中央市场位置 533 475找到你的宝宝 键入口令“跟我来”这样狗狗就听你的话了 注意脚本里面要改好你自己的名字
如果还有什么不懂的 哪个朋友有空间 我可以发个屏录教程 这个脚本其实就是根据守门派石卒兵改变 不是原创 写的不好请不要骂我 扔扔砖头就可以了
页: [1]
查看完整版本: 【千年服务端】千年宝宝脚本