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

  

千年结婚脚本脚本

  • 枫之精英

    这一段必须男女两个玩家配合才能完成。



    如果没有男女两个人登记完,是不能启动公告的!!


    需要增加的物品有


    成人证明、新郎证书、新娘证书


    //----====help部分ql司仪.txt====------


    <trade>
    <title>司仪</title>
    <image name=z42 value=126>
    <text>
    祝福你们这对新人。
    </text>
    <command send='close'>关闭</command>
    <command send="qldengji">情侣登记</command>
    <command send="qlyishi">邀请好友参加婚礼</command>
    </trade>


    //----====脚本主体部分===-------


    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
    print ('showwindow .\help\ql司仪.txt 1'); //弹出help文件对话框
    exit;
    end;
    end;


    procedure OnGetResult (aStr : String);
    var
    Str, Name : String;
    nnName, vvName : String = '无名氏';
    begin
    if aStr = 'close' then begin
    exit;
    end;
    //下面是输入双方的姓名的
    if aStr = 'qldengji' then begin
    Str := callfunc ('getsenderitemexistence 成人证明:1');
    if Str = 'false' then begin
    Str := 'say 未成年人凑什么热闹?';
    print (Str);
    exit;
    end;
    //获取性别来自主判断弹出什么对话框
    Str := callfunc ('getsendersex');
    if Str = '1' then begin
    Str := callfunc ('getsenderitemexistence 新郎证书:1');
    if Str = 'true' then begin
    Str := 'say 接完婚的人还来这里胡闹成何体统?';
    print (Str);
    exit;
    end;
    nnName := callfunc ('getsendername');
    print ('getsenderitem 成人证明:1');
    print ('putsendermagicitem 新郎证书:1 @司仪 4');
    print ('say 新郎,快准备结婚典礼吧!');
    exit;
    end;

    if Str = '2' then begin
    Str := callfunc ('getsenderitemexistence 新娘证书:1');
    if Str = 'true' then begin
    Str := 'say 接完婚的人还来这里胡闹成何体统?';
    print (Str);
    exit;
    end;
    vvName := callfunc ('getsendername');
    print ('getsenderitem 成人证明:1');
    print ('putsendermagicitem 新娘证书:1 @司仪 4');
    print ('say 新娘,快准备结婚典礼吧!');
    exit;
    end;

    exit;
    end;



    //公告部分。如果没有男女两个玩家登记完,这里是不能生效的
    if aStr = 'qlyishi' then begin
    if nnName = '无名氏' then begin
    print ('say 新郎还没有登记吧!');
    exit;
    end;
    if vvName = '无名氏' then begin
    print ('say 新娘还没有登记吧!');
    exit;
    end;
    Str := callfunc ('getsendersex');
    if Str = '1' then begin
    Name := callfunc ('getsendername');
    if Name <> nnName then begin
    print ('say 似乎你不是刚才那位新郎吧!');
    exit;
    end;
    Str := 'sendsendertopmsg ' + '新郎【';
    Str := Str + nnName;
    Str := Str + '】和新娘【';
    Str := Str + vvName;
    Str := Str + '】的结婚典礼马上开始!';
    print (Str);
    exit;
    end;


    if Str = '2' then begin
    Name := callfunc ('getsendername');
    if Name <> vvName then begin
    print ('say 似乎你不是刚才那位新娘吧!');
    exit;
    end;
    Str := 'sendsendertopmsg ' + '新郎【';
    Str := Str + nnName;
    Str := Str + '】和新娘【';
    Str := Str + vvName;
    Str := Str + '】的结婚典礼马上开始!';
    print (Str);
    exit;
    end;
    exit;
    end;


    end;


    end.



    1楼  2023/2/1 20:43:09  回复

  发表回复

    发帖