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

  

千年私服里做活动的方法

  • 枫之精英

    在 tgs1000\init\npc.sdb里加

    奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,

    在tgs1000\script文件加里创建一个文本 名字:奖品兑换员

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

    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);

    procedure OnApproach (aStr : String);

    procedure OnAway (aStr : String);

    procedure OnArrival (aStr : String);

    var

    iCallCount : Integer = 0;

    implementation

    procedure OnAway (aStr : String);

    var

    Str : String;

    Race : Integer;

    begin

    Str := callfunc ('getsenderrace');

    Race := StrToInt (Str);

    if Race = 1 then begin

      print ('say 拉拉拉拉,贪财老人来喽...');

    exit;

    end;

    end;

    procedure OnApproach (aStr : String);

    var

    Str : String;

    Race : Integer;

    begin

    Str := callfunc ('getsenderrace');

    Race := StrToInt (Str);

    if Race = 1 then begin

      print ('say 各位节日快乐...');

    exit;

    end;

    end;

    procedure OnLeftClick (aStr : String);

    var

    Str : String;

    begin

    Str := 'showwindow .\help\奖品兑换员.txt 1';

    print (Str);

    exit;

    end;

    procedure OnGetResult (aStr : String);

    var

    Str, Name : String;

    iRandom, iKind : Integer;

    begin

    if aStr = 'jinyuan' then begin

      Str := callfunc ('getsenderitemexistence 金元:5');

      if Str = 'false' then begin

        Str := 'say 哪有免费的午餐?拿5个金元来!';

        print (Str);

        exit;

      end;

      if Str = 'true' then begin

        Str := 'getsenderitem 金元:5';

        print (Str);

        Str := 'say 小子,你的金子是假的!哈哈哈!';

        print (str);

        iRandom := Random (5);

        if iRandom = 1 then begin

        Str := callfunc ('checkenoughspace');

        if Str = 'false' then begin

          print ('say 物品栏已满~');

          exit;

        end;

        iKind := Random (29);

        if iKind = 0 then begin

          Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 1 then begin

          Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 2 then begin

          Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 3 then begin

          Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 4 then begin

          Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 5 then begin

          Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 6 then begin

          Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 7 then begin

          Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 8 then begin

          Str := 'putsendermagicitem 百炼三叉戟 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 9 then begin

          Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 10 then begin

          Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 11 then begin

          Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';

          print (Str);

        end;

        if iKind = 12 then begin

          Str := 'putsendermagicitem 生


    1楼  2022/1/28 12:51:22  回复

  发表回复

    发帖