千年技术吧+ 关注 关注:3 帖子:257

  

NPC交换真气设置,脚本,详细教程!

  • 枫之精英

    具体设置如下:分三种物品,每种物品加的真气不同


    1,tgs1000\Init\Npc.sdb

    真气,真气兑换员,0,,,TRUE,,TRUE,TRUE,,,TRUE,8,24,144,1400,400,,,,10000,0,0,0,0,,4,,,,,,,,,,,,,,,,

    建立一个NPC用来交换真气用,名字自己取,前边的真气不要动,如果改了不能用千万别找我,后边有颜色的部分改了就行,我用的老侠客的外观

    2,tgs1000\Help\真气.txt

    <trade>
    <title>真气交换</title>
    <image name=z24 value=144>
    <text>
    红色真珠兑换真气比例1:10;绿色真珠兑换真气比例1:100;蓝色真珠兑换真气比例1:1000;

    </text>
    <command send='close'>关闭</command>
    <command send="jh10">红色真珠换真气</command>
    <command send="jh100">绿色真珠换真气</command>
    <command send="jh1000">蓝色真珠换真气</command>
    </trade>

    ---------------------------------------------------------------------------------------------------------------------------------------

    tgs1000\Help\真气.txt

    <trade>
    <title>真气交换</title>
    <image name=z24 value=144>
    <text>
    红色真珠兑换真气比例1:10;绿色真珠兑换真气比例1:100;蓝色真珠兑换真气比例1:1000;
    </text>
    <command send='close'>关闭</command>
    <command send="jh10">红色真珠换真气</command>
    <command send="jh100">绿色真珠换真气</command>
    <command send="jh1000">蓝色真珠换真气</command>
    </trade>

    ----------------------------------------------------------------------------------------------------------------------------

    3,tgs1000\Script\Script.sdb

    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 = 'jh10' then begin
    Str := callfunc ('getsenderitemexistence 真珠10:1');
    if Str = 'false' then begin
    Str := 'say 没有红色真珠,不能增加真气!!';
    print (Str);
    exit;
    end;
    if Str = 'true' then begin
    Str := 'getsenderitem 真珠10:1';
    print (Str);
    Str := 'addaddablestatepoint 10';
    print (Str);
    Str := 'say 恭喜大侠!交换10点真气成功。';
    print (Str);
    exit;
    end;
    end;
    if aStr = 'jh100' then begin
    Str := callfunc ('getsenderitemexistence 真珠100:1');
    if Str = 'false' then begin
    Str := 'say 没有绿色真珠,不能增加真气!!';
    print (Str);
    exit;
    end;
    if Str = 'true' then begin
    Str := 'getsenderitem 真珠100:1';
    print (Str);
    Str := 'addaddablestatepoint 100';
    print (Str);
    Str := 'say 恭喜大侠!交换100点真气成功。';
    print (Str);
    exit;
    end;
    end;
    if aStr = 'jh1000' then begin
    Str := callfunc ('getsenderitemexistence 真珠1000:1');
    if Str = 'false' then begin
    Str := 'say 没有蓝色真珠,不能增加真气!!';
    print (Str);
    exit;
    end;
    if Str = 'true' then begin
    Str := 'getsenderitem 真珠1000:1';
    print (Str);
    Str := 'addaddablestatepoint 1000';
    print (Str);
    Str := 'say 恭喜大侠!交换1000点真气成功。';

    print (Str);
    exit;
    end;
    end;
    end;

    end.

    --------------------------------------------------------------------------------------------------

    3,tgs1000\Script\Script.sdb

    143,真气.txt,,

    -------------------------------------------------------------------------------------------------

    5,tgs1000\Setting\CreateNpc1.sdb

    102,真气,500,500,1,5,143,,

    到中央市场500,500找NPC"真气"用真珠交换,地图坐标自己定.

    6,tgs1000\Init\Item.sdb

    真珠10,真珠,4,交换真气的凭证、可以交换10点真气,,,,,,,TRUE,FALSE,88,,,,,,12,,,,300,300,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1000,
    真珠100,真珠,4,交换真气的凭证、可以交换100点真气,,,,,,,TRUE,FALSE,88,,,,,,13,,,,3000,3000,,,,,,,,,,,,,,,,,,,,,,,,,,真珠10:8:金元:10,,,,,,,,,,,,,,,,,,,,,,100,
    真珠1000,真珠,4,交换真气的凭证、可以交换1000点真气,,,,,,,TRUE,FALSE,88,,,,,,14,,,,30000,30000,,,,,4429,4828,,,,,,,,,,,,,,,,,,,,真珠100:8:金元:100,,,,,,,,,,,,,,,,,,,,,,10,


    真珠10 为红色,最多1000个,可以设置怪物爆

    真珠100 为绿色,最多100个,8个红色真珠+10个金元=1个绿色真珠

    真珠1000 为蓝色,最多10个,8个绿色真珠+100个金元=1个蓝色真珠

    物品外观和名字 还有NPC的名字 都可以自己设置 根据需要修改吧

    注意事项:第1 2 4 6不用修改,第3 数字142 按你的数字顺延,第5 数字102 按你的数字顺延 数字142(你设置的数字)和第3对应相同



    1楼  2023/1/31 19:49:57  回复

  发表回复

    发帖