admin 发表于 2025-8-12 15:53:41

【千年服务端】太极牌升级NPC脚本

太极牌升级NPC脚本 想当初我们玩官方的时候太极牌是多少人向往的宝贝,可是现在服务器太级装备都是垃圾了,用这个脚本可以稍微为太极剑门带来点门票收入,呵呵.也许有办法让太级牌直接可以升级,但是我实在是能力有限,喜欢的话拿去用吧^_^

首先,TGS\ITEM.SDB下增加以下4样物品

太极牌1级,太极牌,38,身上有太极类武器时才能发挥作用,,,,,,,FALSE,FALSE,193,,,,,,1,,,,10000,,,,,,,,TRUE,,,,,,36,,240,84,84,84,,,,,,,,,,FALSE,,,FALSE,,,,,,,,,,,,,199,,,,,
太极牌2级,太极牌,38,身上有太极类武器时才能发挥作用,,,,,,,FALSE,FALSE,193,,,,,,1,,,,10000,,,,,,,,TRUE,,,,,,45,,300,105,105,105,,,,,,,,,,FALSE,,,FALSE,,,,,,,,,,,,,199,,,,,
太极牌3级,太极牌,38,身上有太极类武器时才能发挥作用,,,,,,,FALSE,FALSE,193,,,,,,1,,,,10000,,,,,,,,TRUE,,,,,,60,,400,140,140,140,,,,,,,,,,FALSE,,,FALSE,,,,,,,,,,,,,199,,,,,
太极牌4级,太极牌,38,身上有太极类武器时才能发挥作用,,,,,,,FALSE,FALSE,193,,,,,,1,,,,10000,,,,,,,,TRUE,,,,,,75,,500,175,175,175,,,,,,,,,,FALSE,,,FALSE,,,,,,,,,,,,,199,,,,,
然后是TGS\NPC.SDB

太极牌锻造师,太极牌锻造师,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,4,,,,,,,,,,,,,,,TRUE,
接着是TGS\HTLP下建立一个文件   太极牌锻造师.TXT

<trade>
<title>太极牌锻造师</title>
<image name=z81 value=235>
<text>
把太极牌交给我可以帮你锻造
</text>
<command send='close'>关闭</command>
<command send="sheng1">太极牌升1级</command>

<command send="sheng2">太极牌升2级</command>

<command send="sheng3">太极牌升3级</command>

<command send="sheng4">太极牌升4级</command>

</trade>

接着是TGS\SCRIPT下建立一个文件 太极牌锻造师.TXT

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 OnLeftClick (aStr : String);
procedure OnGetResult (aStr : String);

implementation

procedure OnGetResult (aStr : String);
var
   Str, Name : String;
   iCount, iKind : Integer;
begin
   if aStr = 'close' then begin
      exit;
   end;
   if aStr = 'sheng1' then begin
      Str := callfunc ('getsenderitemexistence 太极牌:1');
      if Str = 'false' then begin
         print ('say 没太极牌怎么升级啊?');
         exit;
      end;
      Str := callfunc ('checkenoughspace');
      if Str = 'false' then begin
         print ('say 你的包包太小了');
         exit;
      end;

      print ('getsenderitem 太极牌:1');

      iKind:= Random (4);
      if iKind = 0 then begin
         Str := 'putsendermagicitem 太极牌1级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 1 then begin
         Str := 'putsendermagicitem 太极牌1级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 2 then begin
         Str := 'putsendermagicitem 太极牌1级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 3 then begin
         print (Str);
      end;
      print ('say 无论如何,都要感谢你让我看到太极剑门的壮大');
   end;
   if aStr = 'sheng2' then begin
      Str := callfunc ('getsenderitemexistence 太极牌1级:1');
      if Str = 'false' then begin
         print ('say 没有太极牌或者太极牌不是1段');
         exit;
      end;
      Str := callfunc ('checkenoughspace');
      if Str = 'false' then begin
         print ('say 你的包包太小了');
         exit;
      end;
      print ('getsenderitem 太极牌1级:1');

      iKind:= Random (2);
      if iKind = 0 then begin
         Str := 'putsendermagicitem 太极牌2级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 1 then begin
         print (Str);
      end;
   
      print ('say 无论如何,都要感谢你让我看到太极剑门的壮大');
   end;
   if aStr = 'sheng3' then begin
      Str := callfunc ('getsenderitemexistence 太极牌2级:1');
      if Str = 'false' then begin
         print ('say 没太极牌或者太极牌不是2段');
         exit;
      end;
      Str := callfunc ('checkenoughspace');
      if Str = 'false' then begin
         print ('say 你的包包太小了');
         exit;
      end;
      print ('getsenderitem 太极牌2级:1');

      iKind:= Random (3);
      if iKind = 0 then begin
         Str := 'putsendermagicitem 太极牌3级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 1 then begin
         Str := 'putsendermagicitem 太极牌3级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 2 then begin
         print (Str);
      end;
   
      print ('say 无论如何,都要感谢你让我看到太极剑门的壮大');
   end;
   if aStr = 'sheng4' then begin
      Str := callfunc ('getsenderitemexistence 太极牌3级:1');
      if Str = 'false' then begin
         print ('say 没太极牌或者太极牌不是3段');
         exit;
      end;
      Str := callfunc ('checkenoughspace');
      if Str = 'false' then begin
         print ('say 你的包包太小了');
         exit;
      end;
      print ('getsenderitem 太极牌3级:1');

      iKind:= Random (4);
      if iKind = 0 then begin
         Str := 'putsendermagicitem 太极牌4级 @太极牌锻造师 4';
         print (Str);
      end;
      if iKind = 1 then begin
         print (Str);
      end;
      if iKind = 2 then begin
         print (Str);
      end;
      if iKind = 3 then begin
         print (Str);
      end;
   
      print ('say 无论如何,都要感谢你让我看到太极剑门的壮大');
   end;
end;
end;

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;

end.
页: [1]
查看完整版本: 【千年服务端】太极牌升级NPC脚本