⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 game_master.pas

📁 RO模拟器!!适合玩仙境传说的玩家们呦~
💻 PAS
📖 第 1 页 / 共 5 页
字号:

        oldlevel := tc.JobLV;
        Val(Copy(str, 8, 256), i, k);

        if (k = 0) and (i >= 1) and (i <= 32767) and (i <> tc.JobLV) then begin
            tc.JobLV := i;

            for i := 1 to MAX_SKILL_NUMBER do begin
                if not tc.Skill[i].Card then tc.Skill[i].Lv := 0;
            end;

            if tc.JID = 0 then tc.SkillPoint := tc.JobLV - 1
            else if tc.JID < 7 then tc.SkillPoint := tc.JobLV - 1 + 9
            else tc.SkillPoint := tc.JobLV - 1 + 49 + 9;

            SendCSkillList(tc);

            if (tc.JobNextEXP = 0) then tc.JobNextEXP := 999999999;
            tc.JobEXP := tc.JobNextEXP - 1;

            if tc.JID < 13 then begin
                j := (tc.JID + 5) div 6 + 1;
            end else begin
                j := 3;
            end;

            tc.JobNextEXP := ExpTable[j][tc.JobLV];
            //初心者high等级限制
            if tc.JID = 4001 then begin
            if tc.JobLV > 10 then begin
            tc.JobLV := 10;
            tc.SkillPoint := tc.JobLV - 1 + 49 + 9;
            end;
            end;
            //初心者high等级限制
            CalcStat(tc);
            SendCStat(tc);
            SendCStat1(tc, 0, $0037, tc.JobLV);
            SendCStat1(tc, 0, $000c, tc.SkillPoint);
            SendCStat1(tc, 1, $0002, tc.JobEXP);


            Result := 'GM更改职业等级成功. 职业等级从 ' + IntToStr(oldlevel) + ' 更改为 ' + IntToStr(tc.JobLV) + '.';
        end else begin
            Result := Result + ' Incomplete information or level out of range.';
        end;
    end;

    function command_changestat(tc : TChara; str : String) : String;
    var
        sl : TStringList;
        i, j, k : Integer;
    begin
        Result := 'GM_CHANGESTAT Failure.';

        sl := TStringList.Create;
        sl.DelimitedText := Copy(str, 12, 256);

        if (sl.Count = 2) then begin
            Val(sl[0], i, k);

            if(i >= 0) and (i <= 5) then begin
                Val(sl[1], j, k);

                if(j >= 1) and (j <= 32767) then begin
                    tc.ParamBase[i] := j;
                    CalcStat(tc);
                    SendCStat(tc);
                    SendCStat1(tc, 0, $0009, tc.StatusPoint);

                    Result := 'GM_CHANGESTAT Success. Stat ' + IntToStr(i) + ' changed to ' + IntToStr(j) + '.';
                end;
            end else begin
                Result := Result + ' Incorrect stat index number.';
            end;
        end else begin
            Result := Result + ' Incomplete information.';
        end;

        sl.Free;
    end;

    function command_skillpoint(tc : TChara; str : String) : String;
    var
        i, k : Integer;
    begin
        Result := 'GM_SKILLPOINT Failure.';

        Val(Copy(str, 12, 256), i, k);
        if (k = 0) and (i >= 0) and (i <= 1001) then begin
            tc.SkillPoint := i;
            SendCStat1(tc, 0, $000c, tc.SkillPoint);
            Result := 'GM_SKILLPOINT Sucess. Skill Point amount set to ' + IntToStr(i) + '.';
        end else begin
            Result := Result + ' Skill Point amount out of range [0-1001].';
        end;
    end;

    function command_skillall(tc : TChara) : String;
    var
        j, i : Integer;
    begin
        Result := 'GM_SKILLALL Failure.';

        j := tc.JID;
        if (j > UPPER_JOB_BEGIN) then j := j - UPPER_JOB_BEGIN + LOWER_JOB_END;
        // (RN 4001 - 4000 + 23 = 24)

        for i := 1 to 157 do begin
            if (tc.Skill[i].Data.Job1[j]) or (tc.Skill[i].Data.Job2[j]) then begin
                tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
            end;
        end;

        for i := 210 to MAX_SKILL_NUMBER do begin
            if (tc.Skill[i].Data.Job1[j]) or (tc.Skill[i].Data.Job2[j]) then begin
                tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
            end;
        end;

        tc.SkillPoint := 1000;
        SendCSkillList(tc);
        CalcStat(tc);
        SendCStat(tc);

        Result := 'GM_SKILLALL Success.';
    end;

    function command_statall(tc : TChara) : String;
    var
        i : Integer;
    begin
        Result := 'GM_STATALL Failure.';

        for i := 0 to 5 do begin
            tc.ParamBase[i] := 99;
        end;

        tc.StatusPoint := 1000;
        CalcStat(tc);
        SendCStat(tc);
        SendCStat1(tc, 0, $0009, tc.StatusPoint);

        Result := 'GM_STATALL Success.';
    end;

    function command_superstats(tc : TChara) : String;
    var
        i : Integer;
    begin
        Result := 'GM_SUPERSTATS Failure.';

        for i := 0 to 5 do begin
            tc.ParamBase[i] := 32767;
        end;

        tc.StatusPoint := 1000;
        CalcStat(tc);
        SendCStat(tc);
        SendCStat1(tc, 0, $0009, tc.StatusPoint);

        Result := 'GM_SUPERSTATS Success.';
    end;

    function command_zeny(tc : TChara; str : String) : String;
    var
        i, k : Integer;
    begin
        Result := 'GM_ZENY Failure.';

        Val(Copy(str, 6, 256), i, k);
        if (k = 0) and (i >= -2147483647) and (i <= 2147483647) then begin
            if (tc.Zeny + i <= 2147483647) and (tc.Zeny + i >= 0) then begin
                tc.Zeny := tc.Zeny + i;
                SendCStat1(tc, 1, $0014, tc.Zeny);

                Result := 'GM_ZENY Success. ' + IntToStr(abs(i)) + ' Zeny';
                if (i = 0) then begin
                    tc.Zeny := i;
                    Result := Result + ' set.';
                end else
                if (i > 0) then begin
                    Result := Result + ' added.';
                end else if (i < 0) then begin
                    Result := Result + ' subtracted.';
                end;
            end else begin
                Result := Result + ' Zeny on hand amount out of range [0-2147483647].';
            end;
        end else begin
            Result := Result + ' Zeny amount out of range [-2147483647-2147483647].';
        end;
    end;

    function command_changeskill(tc : TChara; str : String) : String;
    var
        i, j, k : Integer;
        sl : TStringList;
    begin
        Result := 'GM_CHANGESKILL Failure.';

        sl := TStringList.Create;
        sl.DelimitedText := Copy(str, 13, 256);

        if (sl.Count = 2) then begin
            Val(sl.Strings[0], i, k);
            if k <> 0 then Exit;
            Val(sl.Strings[1], j, k);
            if k <> 0 then Exit;

            if ((i >= 1) and (i <= 157)) or ((i >= 210) and (i <= MAX_SKILL_NUMBER)) then begin
                if (j > tc.Skill[i].Data.MasterLV) then j := tc.Skill[i].Data.MasterLV;
                tc.Plag := i;
                tc.PLv := j;
                tc.Skill[i].Plag := true;
                SendCSkillList(tc);
                CalcStat(tc);
                SendCStat(tc);

                Result := 'GM_CHANGESKILL Success. Skill ' + IntToStr(i) + ' set to ' + IntToStr(j) + '.';
            end else begin
                Result := Result + ' Skill selection out of range [1-157,210-' + IntToStr(MAX_SKILL_NUMBER) + '].';
            end;
        end else begin
            Result := Result + ' Incomplete information.';
        end;

        sl.Free;
    end;

    function command_monster(tc : TChara; str : String) : String;
    var
        ts, ts1 : TMob;
        tm : TMap;
        h, i, j, k, l : Integer;
        sl : TStringList;
        tss : TSlaveDB;
    begin
        Result := 'GM_MONSTER Failure.';

        sl := TStringList.Create;
        sl.DelimitedText := Copy(str, 9, 256);
        if sl.Count = 2 then begin
            if (MobDBName.IndexOf(sl.Strings[0]) <> -1) then begin
                Val(sl.Strings[1], j, k);

                if(j >= 1) and (j <= 20) then begin
                    for l := 1 to j do begin
                        tm := tc.MData;

                        ts := TMob.Create;
                        ts.Data := MobDBName.Objects[MobDBName.IndexOf(sl.Strings[0])] as TMobDB;
                        ts.ID := NowMobID;
                        Inc(NowMobID);
                        ts.Name := ts.Data.JName;
                        ts.JID := ts.Data.ID;
                        ts.Map := tc.Map;
                        ts.Data.isLink :=false;
                        ts.Point.X := tc.Point.X + Random(2) - 1;
                        ts.Point.Y := tc.Point.Y + Random(2) - 1;
                        ts.Dir := Random(8);
                        ts.HP := ts.Data.HP;
                        ts.Speed := ts.Data.Speed;
                        ts.SpawnDelay1 := $7FFFFFFF;
                        ts.SpawnDelay2 := 0;
                        ts.SpawnType := 0;
                        ts.SpawnTick := 0;
                        if ts.Data.isDontMove then ts.MoveWait := $FFFFFFFF
                        else ts.MoveWait := timeGetTime;
                        ts.ATarget := 0;
                        ts.ATKPer := 100;
                        ts.DEFPer := 100;
                        ts.DmgTick := 0;
                        ts.Element := ts.Data.Element;

                        if (SummonMonsterName = true) then ts.Name := ts.Data.JName
             

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -