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

📄 functionconfig.pas

📁 乐都SQL版传奇全套代码,绝对可编译
💻 PAS
📖 第 1 页 / 共 5 页
字号:
begin
  if not boOpened then
    exit;
  g_Config.nBoneFammCount := EditBoneFammCount.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.EditDogzCountChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nDogzCount := EditDogzCount.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.CheckBoxLimitSwordLongClick(
  Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.boLimitSwordLong := CheckBoxLimitSwordLong.Checked;
  ModValue();
end;

procedure TfrmFunctionConfig.EditSwordLongPowerRateChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nSwordLongPowerRate := EditSwordLongPowerRate.Value;
  ModValue()
end;

procedure TfrmFunctionConfig.EditBoneFammNameChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  ModValue();
end;

procedure TfrmFunctionConfig.EditDogzNameChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  ModValue();
end;

procedure TfrmFunctionConfig.EditFireBoomRageChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nFireBoomRage := EditFireBoomRage.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.EditSnowWindRangeChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nSnowWindRange := EditSnowWindRange.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.EditElecBlizzardRangeChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nElecBlizzardRange := EditElecBlizzardRange.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.EditMagTurnUndeadLevelChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nMagTurnUndeadLevel := EditMagTurnUndeadLevel.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.GridBoneFammSetEditText(Sender: TObject; ACol,
  ARow: Integer; const Value: string);
begin
  if not boOpened then
    exit;
  ModValue();
end;

procedure TfrmFunctionConfig.EditAmyOunsulPointChange(Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.nAmyOunsulPoint := EditAmyOunsulPoint.Value;
  ModValue();
end;


procedure TfrmFunctionConfig.CheckBoxFireCrossInSafeZoneClick(
  Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.boDisableInSafeZoneFireCross := CheckBoxFireCrossInSafeZone.Checked;
  ModValue();
end;


procedure TfrmFunctionConfig.CheckBoxGroupMbAttackPlayObjectClick(
  Sender: TObject);
begin
  if not boOpened then
    exit;
  g_Config.boGroupMbAttackPlayObject := CheckBoxGroupMbAttackPlayObject.Checked;
  ModValue();
end;

procedure TfrmFunctionConfig.ButtonSkillSaveClick(Sender: TObject);
var
  i                                     : Integer;
  RecallArray                           : array[0..9] of TRecallMigic;
  Rect                                  : TGridRect;
begin
  FillChar(RecallArray, SizeOf(RecallArray), #0);

  g_Config.sBoneFamm := Trim(EditBoneFammName.Text);

  for i := Low(RecallArray) to High(RecallArray) do
  begin
    RecallArray[i].nHumLevel := Str_ToInt(GridBoneFamm.Cells[0, i + 1], -1);
    RecallArray[i].sMonName := Trim(GridBoneFamm.Cells[1, i + 1]);
    RecallArray[i].nCount := Str_ToInt(GridBoneFamm.Cells[2, i + 1], -1);
    RecallArray[i].nLevel := Str_ToInt(GridBoneFamm.Cells[3, i + 1], -1);
    if GridBoneFamm.Cells[0, i + 1] = '' then
      break;
    if (RecallArray[i].nHumLevel <= 0) then
    begin
      Application.MessageBox('人物等级设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 0;
      Rect.Top := i + 1;
      Rect.Right := 0;
      Rect.Bottom := i + 1;
      GridBoneFamm.Selection := Rect;
      exit;
    end;
    if UserEngine.GetMonRace(RecallArray[i].sMonName) <= 0 then
    begin
      Application.MessageBox('怪物名称设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 1;
      Rect.Top := i + 1;
      Rect.Right := 1;
      Rect.Bottom := i + 1;
      GridBoneFamm.Selection := Rect;
      exit;
    end;
    if RecallArray[i].nCount <= 0 then
    begin
      Application.MessageBox('召唤数量设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 2;
      Rect.Top := i + 1;
      Rect.Right := 2;
      Rect.Bottom := i + 1;
      GridBoneFamm.Selection := Rect;
      exit;
    end;
    if RecallArray[i].nLevel < 0 then
    begin
      Application.MessageBox('召唤等级设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 3;
      Rect.Top := i + 1;
      Rect.Right := 3;
      Rect.Bottom := i + 1;
      GridBoneFamm.Selection := Rect;
      exit;
    end;
  end;

  for i := Low(RecallArray) to High(RecallArray) do
  begin
    RecallArray[i].nHumLevel := Str_ToInt(GridDogz.Cells[0, i + 1], -1);
    RecallArray[i].sMonName := Trim(GridDogz.Cells[1, i + 1]);
    RecallArray[i].nCount := Str_ToInt(GridDogz.Cells[2, i + 1], -1);
    RecallArray[i].nLevel := Str_ToInt(GridDogz.Cells[3, i + 1], -1);
    if GridDogz.Cells[0, i + 1] = '' then
      break;
    if (RecallArray[i].nHumLevel <= 0) then
    begin
      Application.MessageBox('人物等级设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 0;
      Rect.Top := i + 1;
      Rect.Right := 0;
      Rect.Bottom := i + 1;
      GridDogz.Selection := Rect;
      exit;
    end;
    if UserEngine.GetMonRace(RecallArray[i].sMonName) <= 0 then
    begin
      Application.MessageBox('怪物名称设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 1;
      Rect.Top := i + 1;
      Rect.Right := 1;
      Rect.Bottom := i + 1;
      GridDogz.Selection := Rect;
      exit;
    end;
    if RecallArray[i].nCount <= 0 then
    begin
      Application.MessageBox('召唤数量设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 2;
      Rect.Top := i + 1;
      Rect.Right := 2;
      Rect.Bottom := i + 1;
      GridDogz.Selection := Rect;
      exit;
    end;
    if RecallArray[i].nLevel < 0 then
    begin
      Application.MessageBox('召唤等级设置错误!!!', '错误信息', MB_OK +
        MB_ICONERROR);
      Rect.Left := 3;
      Rect.Top := i + 1;
      Rect.Right := 3;
      Rect.Bottom := i + 1;
      GridDogz.Selection := Rect;
      exit;
    end;
  end;
  FillChar(g_Config.BoneFammArray, SizeOf(g_Config.BoneFammArray), #0);
  for i := Low(g_Config.BoneFammArray) to High(g_Config.BoneFammArray) do
  begin
    Config.WriteInteger('Setup', 'BoneFammHumLevel' + IntToStr(i), 0);
    Config.WriteString('Names', 'BoneFamm' + IntToStr(i), '');
    Config.WriteInteger('Setup', 'BoneFammCount' + IntToStr(i), 0);
    Config.WriteInteger('Setup', 'BoneFammLevel' + IntToStr(i), 0);
  end;
  for i := Low(g_Config.BoneFammArray) to High(g_Config.BoneFammArray) do
  begin
    if GridBoneFamm.Cells[0, i + 1] = '' then
      break;
    g_Config.BoneFammArray[i].nHumLevel := Str_ToInt(GridBoneFamm.Cells[0, i +
      1], -1);
    g_Config.BoneFammArray[i].sMonName := Trim(GridBoneFamm.Cells[1, i + 1]);
    g_Config.BoneFammArray[i].nCount := Str_ToInt(GridBoneFamm.Cells[2, i + 1],
      -1);
    g_Config.BoneFammArray[i].nLevel := Str_ToInt(GridBoneFamm.Cells[3, i + 1],
      -1);

    Config.WriteInteger('Setup', 'BoneFammHumLevel' + IntToStr(i),
      g_Config.BoneFammArray[i].nHumLevel);
    Config.WriteString('Names', 'BoneFamm' + IntToStr(i),
      g_Config.BoneFammArray[i].sMonName);
    Config.WriteInteger('Setup', 'BoneFammCount' + IntToStr(i),
      g_Config.BoneFammArray[i].nCount);
    Config.WriteInteger('Setup', 'BoneFammLevel' + IntToStr(i),
      g_Config.BoneFammArray[i].nLevel);
  end;

  FillChar(g_Config.DogzArray, SizeOf(g_Config.DogzArray), #0);
  for i := Low(g_Config.DogzArray) to High(g_Config.DogzArray) do
  begin
    Config.WriteInteger('Setup', 'DogzHumLevel' + IntToStr(i), 0);
    Config.WriteString('Names', 'Dogz' + IntToStr(i), '');
    Config.WriteInteger('Setup', 'DogzCount' + IntToStr(i), 0);
    Config.WriteInteger('Setup', 'DogzLevel' + IntToStr(i), 0);
  end;
  for i := Low(g_Config.DogzArray) to High(g_Config.DogzArray) do
  begin
    if GridDogz.Cells[0, i + 1] = '' then
      break;

    g_Config.DogzArray[i].nHumLevel := Str_ToInt(GridDogz.Cells[0, i + 1], -1);
    g_Config.DogzArray[i].sMonName := Trim(GridDogz.Cells[1, i + 1]);
    g_Config.DogzArray[i].nCount := Str_ToInt(GridDogz.Cells[2, i + 1], -1);
    g_Config.DogzArray[i].nLevel := Str_ToInt(GridDogz.Cells[3, i + 1], -1);

    Config.WriteInteger('Setup', 'DogzHumLevel' + IntToStr(i),
      g_Config.DogzArray[i].nHumLevel);
    Config.WriteString('Names', 'Dogz' + IntToStr(i),
      g_Config.DogzArray[i].sMonName);
    Config.WriteInteger('Setup', 'DogzCount' + IntToStr(i),
      g_Config.DogzArray[i].nCount);
    Config.WriteInteger('Setup', 'DogzLevel' + IntToStr(i),
      g_Config.DogzArray[i].nLevel);
  end;

{$IF SoftVersion <> VERDEMO}
  Config.WriteBool('Setup', 'LimitSwordLong', g_Config.boLimitSwordLong);
  Config.WriteInteger('Setup', 'SwordLongPowerRate',
    g_Config.nSwordLongPowerRate);
  Config.WriteInteger('Setup', 'BoneFammCount', g_Config.nBoneFammCount);
  Config.WriteString('Names', 'BoneFamm', g_Config.sBoneFamm);
  Config.WriteInteger('Setup', 'DogzCount', g_Config.nDogzCount);
  Config.WriteString('Names', 'Dogz', g_Config.sDogz);
  Config.WriteInteger('Setup', 'FireBoomRage', g_Config.nFireBoomRage);
  Config.WriteInteger('Setup', 'SnowWindRange', g_Config.nSnowWindRange);
  Config.WriteInteger('Setup', 'ElecBlizzardRange',
    g_Config.nElecBlizzardRange);
  Config.WriteInteger('Setup', 'AmyOunsulPoint', g_Config.nAmyOunsulPoint);

  Config.WriteInteger('Setup', 'MagicAttackRage', g_Config.nMagicAttackRage);
  Config.WriteInteger('Setup', 'MagTurnUndeadLevel',
    g_Config.nMagTurnUndeadLevel);
  Config.WriteInteger('Setup', 'MagTammingLevel', g_Config.nMagTammingLevel);
  Config.WriteInteger('Setup', 'MagTammingTargetLevel',
    g_Config.nMagTammingTargetLevel);
  Config.WriteInteger('Setup', 'MagTammingTargetHPRate',
    g_Config.nMagTammingHPRate);
  Config.WriteInteger('Setup', 'MagTammingCount', g_Config.nMagTammingCount);

  Config.WriteInteger('Setup', 'MabMabeHitRandRate',
    g_Config.nMabMabeHitRandRate);
  Config.WriteInteger('Setup', 'MabMabeHitMinLvLimit',
    g_Config.nMabMabeHitMinLvLimit);
  Config.WriteInteger('Setup', 'MabMabeHitSucessRate',
    g_Config.nMabMabeHitSucessRate);
  Config.WriteInteger('Setup', 'MabMabeHitMabeTimeRate',
    g_Config.nMabMabeHitMabeTimeRate);

  Config.WriteBool('Setup', 'DisableInSafeZoneFireCross',
    g_Config.boDisableInSafeZoneFireCross);
  Config.WriteBool('Setup', 'GroupMbAttackPlayObject',
    g_Config.boGroupMbAttackPlayObject);
  Config.WriteBool('Setup', 'GroupMbAttackBaoBao',
    g_Config.boGroupMbAttackBaoBao);
{$IFEND}
  uModValue();
end;

procedure TfrmFunctionConfig.RefUpgradeWeapon();
begin
  ScrollBarUpgradeWeaponDCRate.Position := g_Config.nUpgradeWeaponDCRate;
  ScrollBarUpgradeWeaponDCTwoPointRate.Position :=
    g_Config.nUpgradeWeaponDCTwoPointRate;
  ScrollBarUpgradeWeaponDCThreePointRate.Position :=
    g_Config.nUpgradeWeaponDCThreePointRate;

  ScrollBarUpgradeWeaponMCRate.Position := g_Config.nUpgradeWeaponMCRate;
  ScrollBarUpgradeWeaponMCTwoPointRate.Position :=
    g_Config.nUpgradeWeaponMCTwoPointRate;
  ScrollBarUpgradeWeaponMCThreePointRate.Position :=
    g_Config.nUpgradeWeaponMCThreePointRate;

  ScrollBarUpgradeWeaponSCRate.Position := g_Config.nUpgradeWeaponSCRate;
  ScrollBarUpgradeWeaponSCTwoPointRate.Position :=
    g_Config.nUpgradeWeaponSCTwoPointRate;
  ScrollBarUpgradeWeaponSCThreePointRate.Position :=
    g_Config.nUpgradeWeaponSCThreePointRate;

  EditUpgradeWeaponMaxPoint.Value := g_Config.nUpgradeWeaponMaxPoint;
  EditUpgradeWeaponPrice.Value := g_Config.nUpgradeWeaponPrice;
  EditUPgradeWeaponGetBackTime.Value := g_Config.dwUPgradeWeaponGetBackTime div
    1000;
  EditClearExpireUpgradeWeaponDays.Value :=
    g_Config.nClearExpireUpgradeWeaponDays;
end;

procedure TfrmFunctionConfig.ScrollBarUpgradeWeaponDCRateChange(
  Sender: TObject);
var
  nPostion                              : Integer;
begin
  nPostion := ScrollBarUpgradeWeaponDCRate.Position;
  EditUpgradeWeaponDCRate.Text := IntToStr(nPostion);
  if not boOpened then
    exit;
  g_Config.nUpgradeWeaponDCRate := nPostion;
  ModValue();
end;

procedure TfrmFunctionConfig.ScrollBarUpgradeWeaponDCTwoPointRateChange(
  Sender: TObject);
var
  nPostion                              : Integer;

⌨️ 快捷键说明

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