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

📄 functionconfig.pas

📁 传奇2...飘飘M2的源码.曾经是传奇"龙"版用得最好的M2程序.完整M2源码
💻 PAS
📖 第 1 页 / 共 5 页
字号:
end;

procedure TfrmFunctionConfig.CheckBoxErrorCountKickClick(Sender: TObject);
begin
  if not boOpened then Exit;
  g_Config.nPasswordErrorCountLock := EditErrorPasswordCount.Value;
  ModValue();
end;

procedure TfrmFunctionConfig.ButtonPasswordLockSaveClick(Sender: TObject);
begin
{$IF SoftVersion <> VERDEMO}
  Config.WriteBool('Setup', 'PasswordLockSystem', g_Config.boPasswordLockSystem);
  Config.WriteBool('Setup', 'PasswordLockDealAction', g_Config.boLockDealAction);
  Config.WriteBool('Setup', 'PasswordLockDropAction', g_Config.boLockDropAction);
  Config.WriteBool('Setup', 'PasswordLockGetBackItemAction', g_Config.boLockGetBackItemAction);
  Config.WriteBool('Setup', 'PasswordLockWalkAction', g_Config.boLockWalkAction);
  Config.WriteBool('Setup', 'PasswordLockRunAction', g_Config.boLockRunAction);
  Config.WriteBool('Setup', 'PasswordLockHitAction', g_Config.boLockHitAction);
  Config.WriteBool('Setup', 'PasswordLockSpellAction', g_Config.boLockSpellAction);
  Config.WriteBool('Setup', 'PasswordLockSendMsgAction', g_Config.boLockSendMsgAction);
  Config.WriteBool('Setup', 'PasswordLockInObModeAction', g_Config.boLockInObModeAction);
  Config.WriteBool('Setup', 'PasswordLockUserItemAction', g_Config.boLockUserItemAction);

  Config.WriteBool('Setup', 'PasswordLockHumanLogin', g_Config.boLockHumanLogin);
  Config.WriteInteger('Setup', 'PasswordErrorCountLock', g_Config.nPasswordErrorCountLock);

{$IFEND}
  uModValue();
end;


procedure TfrmFunctionConfig.RefGeneral();
begin
  EditPKFlagNameColor.Value := g_Config.btPKFlagNameColor;
  EditPKLevel1NameColor.Value := g_Config.btPKLevel1NameColor;
  EditPKLevel2NameColor.Value := g_Config.btPKLevel2NameColor;
  EditAllyAndGuildNameColor.Value := g_Config.btAllyAndGuildNameColor;
  EditWarGuildNameColor.Value := g_Config.btWarGuildNameColor;
  EditInFreePKAreaNameColor.Value := g_Config.btInFreePKAreaNameColor;
end;

procedure TfrmFunctionConfig.CheckBoxHungerSystemClick(Sender: TObject);
begin
  if CheckBoxHungerSystem.Checked then begin
    CheckBoxHungerDecHP.Enabled := True;
    CheckBoxHungerDecPower.Enabled := True;
  end else begin
    CheckBoxHungerDecHP.Checked := False;
    CheckBoxHungerDecPower.Checked := False;
    CheckBoxHungerDecHP.Enabled := False;
    CheckBoxHungerDecPower.Enabled := False;
  end;

  if not boOpened then Exit;
  g_Config.boHungerSystem := CheckBoxHungerSystem.Checked;
  ModValue();
end;

procedure TfrmFunctionConfig.CheckBoxHungerDecHPClick(Sender: TObject);
begin
  if not boOpened then Exit;
  g_Config.boHungerDecHP := CheckBoxHungerDecHP.Checked;
  ModValue();

end;

procedure TfrmFunctionConfig.CheckBoxHungerDecPowerClick(Sender: TObject);
begin
  if not boOpened then Exit;
  g_Config.boHungerDecPower := CheckBoxHungerDecPower.Checked;
  ModValue();
end;

procedure TfrmFunctionConfig.ButtonGeneralSaveClick(Sender: TObject);
begin
{$IF SoftVersion <> VERDEMO}
  Config.WriteBool('Setup', 'HungerSystem', g_Config.boHungerSystem);
  Config.WriteBool('Setup', 'HungerDecHP', g_Config.boHungerDecHP);
  Config.WriteBool('Setup', 'HungerDecPower', g_Config.boHungerDecPower);

  Config.WriteInteger('Setup', 'PKFlagNameColor', g_Config.btPKFlagNameColor);
  Config.WriteInteger('Setup', 'AllyAndGuildNameColor', g_Config.btAllyAndGuildNameColor);
  Config.WriteInteger('Setup', 'WarGuildNameColor', g_Config.btWarGuildNameColor);
  Config.WriteInteger('Setup', 'InFreePKAreaNameColor', g_Config.btInFreePKAreaNameColor);
  Config.WriteInteger('Setup', 'PKLevel1NameColor', g_Config.btPKLevel1NameColor);
  Config.WriteInteger('Setup', 'PKLevel2NameColor', g_Config.btPKLevel2NameColor);
{$IFEND}
  uModValue();
end;

procedure TfrmFunctionConfig.EditMagicAttackRageChange(Sender: TObject);
begin
  if not boOpened then Exit;
  g_Config.nMagicAttackRage := EditMagicAttackRage.Value;
  ModValue();
end;
procedure TfrmFunctionConfig.RefMagicSkill;
begin
  EditSwordLongPowerRate.Value := g_Config.nSwordLongPowerRate;
  CheckBoxLimitSwordLong.Checked := g_Config.boLimitSwordLong;
  EditFireBoomRage.Value := g_Config.nFireBoomRage;
  EditSnowWindRange.Value := g_Config.nSnowWindRange;
  EditElecBlizzardRange.Value := g_Config.nElecBlizzardRange;
  EditMagicAttackRage.Value := g_Config.nMagicAttackRage;
  EditAmyOunsulPoint.Value := g_Config.nAmyOunsulPoint;
  EditMagTurnUndeadLevel.Value := g_Config.nMagTurnUndeadLevel;
  EditMagTammingLevel.Value := g_Config.nMagTammingLevel;
  EditMagTammingTargetLevel.Value := g_Config.nMagTammingTargetLevel;
  EditMagTammingHPRate.Value := g_Config.nMagTammingHPRate;
  EditTammingCount.Value := g_Config.nMagTammingCount;
  EditMabMabeHitRandRate.Value := g_Config.nMabMabeHitRandRate;
  EditMabMabeHitMinLvLimit.Value := g_Config.nMabMabeHitMinLvLimit;
  EditMabMabeHitSucessRate.Value := g_Config.nMabMabeHitSucessRate;
  EditMabMabeHitMabeTimeRate.Value := g_Config.nMabMabeHitMabeTimeRate;
  CheckBoxFireCrossInSafeZone.Checked := g_Config.boDisableInSafeZoneFireCross;
  CheckBoxGroupMbAttackPlayObject.Checked := g_Config.boGroupMbAttackPlayObject;
end;

procedure TfrmFunctionConfig.EditBoneFammCountChange(Sender: TObject);
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);

⌨️ 快捷键说明

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