关灯
开启左侧

[端游] 【千年服务端】千年宝宝脚本

[复制链接]
admin实名认证 发表于 2025-8-12 14:38:49 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
千年宝宝脚本--呕血奉献


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

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

文字解说一下

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

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

然后把下面代码复制到内

  1. unit 老泊;

  2. interface

  3. function  GetToken (aStr, aToken, aSep : String) : String;
  4. function  CompareStr (aStr1, aStr2 : String) : Boolean;
  5. function  callfunc (aText: string): string;
  6. procedure print (aText: string);
  7. function  Random (aScope: integer): integer;
  8. function  Length (aText: string): integer;
  9. procedure Inc (aInt: integer);
  10. procedure Dec (aInt: integer);
  11. function  StrToInt (astr: string): integer;
  12. function  IntToStr (aInt: integer): string;
  13. procedure exit;

  14. procedure OnDblClick(aStr : String);
  15. procedure OnGetResult (aStr : String);
  16. procedure OnHear (aStr : String);
  17. procedure OnDie (aStr : String);
  18. procedure OnAway (aStr : String);

  19. var
  20. yidong :string;
  21. name :string;
  22. implementation

  23. procedure OnHear (aStr : String);
  24. var
  25.   namea, pstr, Str, rdStr, xStr, yStr : String;
  26.    x, y, xx, yy : Integer;
  27.    Race : Integer;
  28.    cuan, detu : String;
  29.    detua : Integer;
  30. begin
  31. namea := callfunc ('getsendername');
  32. if namea <> 'GM玫瑰小姐' then begin
  33. exit;
  34. end;
  35. if astr = '停止攻击' then begin
  36. str := 'say ' + 'Yes-老大!停止攻击〔';
  37. str := str + pstr;
  38. str := str + '〕';
  39. print (str);
  40. print ('attack 狗日')
  41. yidong := '停';
  42. exit;
  43. end;

  44. rdstr := GetToken (astr, yStr, '_');
  45. if ystr = '攻击' then begin
  46. rdstr := 'say ' + astr;
  47. print (rdstr);
  48. pstr := GetToken (astr, xStr, '_');
  49. str := 'say ' + 'Yes-老大!攻击〔';
  50. str := str + pstr;
  51. str := str + '〕';
  52. print (str);
  53. str :='findobjectbyname '+ pstr;
  54. str := callfunc (str) ;
  55. str := 'attack ' + str;
  56. print (str);
  57. yidong := '停';
  58. exit;
  59. end;

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

  62. print ('attack 狗日');
  63. detu := callfunc ('getsenderserverid');
  64. str := callfunc ('getsenderposition');

  65.    Str := GetToken (Str, xStr, '_');
  66.    x := StrToInt (xStr);
  67.    Str := GetToken (Str, yStr, '_');
  68.    y := StrToInt (yStr);

  69.    rdStr := 'getnearxy ' + xStr;
  70.    rdStr := rdStr + ' ';
  71.    rdStr := rdStr  + yStr;
  72.    Str := callfunc (rdStr);


  73.    Str := GetToken (Str, xStr, '_');
  74.    xx := StrToInt (xStr);
  75.    Str := GetToken (Str, yStr, '_');
  76.    yy := StrToInt (yStr);

  77.    if x = xx then begin
  78.       if y = yy then begin
  79.          exit;
  80.       end;
  81.    end;

  82. if yidong <> '走' then exit;
  83. cuan := 'directmovespace 老泊 npc ';
  84. str :=cuan + detu;
  85. str :=str + ' ';
  86. str :=str + xstr;
  87. str :=str + ' ';
  88. str :=str + ystr;
  89. print (str);
  90. str := 'say ' + '老大抱我! 100';
  91. print (str);
  92. exit;
  93. end;
  94. end;

  95. end;


  96. procedure OnAway (aStr : String);
  97. var
  98.    namea, Str, rdStr, xStr, yStr : String;
  99.    x, y, xx, yy : Integer;
  100.    cuan, detu : String;
  101.    detua : Integer;
  102. begin
  103. name := 'GM玫瑰小姐';
  104. namea := callfunc ('getsendername');
  105. if namea = name then begin
  106.    Str := callfunc ('getsenderrace');
  107.    if Str <> '1' then exit;
  108.    print ('say 哈哈...');

  109. detu := callfunc ('getsenderserverid');
  110. str := callfunc ('getsenderposition');

  111.    Str := GetToken (Str, xStr, '_');
  112.    x := StrToInt (xStr);
  113.    Str := GetToken (Str, yStr, '_');
  114.    y := StrToInt (yStr);

  115.    rdStr := 'getnearxy ' + xStr;
  116.    rdStr := rdStr + ' ';
  117.    rdStr := rdStr  + yStr;
  118.    Str := callfunc (rdStr);


  119.    Str := GetToken (Str, xStr, '_');
  120.    xx := StrToInt (xStr);
  121.    Str := GetToken (Str, yStr, '_');
  122.    yy := StrToInt (yStr);

  123.    if x = xx then begin
  124.       if y = yy then begin
  125.          exit;
  126.       end;
  127.    end;

  128. if yidong <> '走' then exit;
  129. cuan := 'directmovespace 老泊 npc ';
  130. str :=cuan + detu;
  131. str :=str + ' ';
  132. str :=str + xstr;
  133. str :=str + ' ';
  134. str :=str + ystr;
  135. print (str);
  136. end;
  137. exit;
  138. end;
  139. end;
  140. procedure OnDblClick (aStr : String);
  141. var
  142.    name, namea, Str, rdStr, xStr, yStr : String;
  143.    x, y, xx, yy : Integer;
  144.    cuan, detu : String;
  145.    detua : Integer;
  146. begin
  147. print ('attack 狗日');
  148. detu := callfunc ('getsenderserverid');
  149. str := callfunc ('getsenderposition');

  150.    Str := GetToken (Str, xStr, '_');
  151.    x := StrToInt (xStr);
  152.    Str := GetToken (Str, yStr, '_');
  153.    y := StrToInt (yStr);

  154.    rdStr := 'getnearxy ' + xStr;
  155.    rdStr := rdStr + ' ';
  156.    rdStr := rdStr  + yStr;
  157.    Str := callfunc (rdStr);


  158.    Str := GetToken (Str, xStr, '_');
  159.    xx := StrToInt (xStr);
  160.    Str := GetToken (Str, yStr, '_');
  161.    yy := StrToInt (yStr);

  162.    if x = xx then begin
  163.       if y = yy then begin
  164.          exit;
  165.       end;
  166.    end;
  167. cuan := 'directmovespace 老泊 npc ';
  168. str :=cuan + detu;
  169. str :=str + ' ';
  170. str :=str + xstr;
  171. str :=str + ' ';
  172. str :=str + ystr;
  173.    if x = xx then begin
  174.       if y = yy then begin
  175.          exit;
  176.       end;
  177.    end;
  178. print (str);

  179. end;

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

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

7粉丝

3752帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523.Games

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523.Games