📄 clmain.pas
字号:
FirstClientTimerTime: longword; //timer 矫埃
LatestClientTimerTime: longword;
FirstClientGetTime: longword; //gettickcount 矫埃
LatestClientGetTime: longword;
TimeFakeDetectSum: integer;
TimeFakeDetectTimer: integer;
BonusPoint, SaveBonusPoint: integer;
BonusTick: TNakedAbility;
BonusAbil: TNakedAbility;
NakedAbil: TNakedAbility;
BonusAbilChg: TNakedAbility;
SellDlgItem: TClientItem;
SellDlgItemSellWait: TClientItem;
DealDlgItem: TClientItem;
BoQueryPrice: Boolean;
QueryPriceTime: longword;
SellPriceStr: string;
BoOneClick: Boolean;
OneClickMode: TOneClickMode;
BoFirstTime: Boolean;
ConnectionStep: TConnectionStep;
ServerConnected: Boolean;
ViewFog: Boolean;
DayBright: integer;
AreaStateValue: integer;
MyHungryState: integer;
LastAttackTime: longword; //弥辟狼傍拜 矫埃, 傍拜档吝 努腐角荐肺 捞悼窍绰 巴阑 阜澜
LastMoveTime: longword;
ItemMoving: Boolean;
MovingItem: TMovingItem;
WaitingUseItem: TMovingItem;
EatingItem: TClientItem;
EatTime: longword; //timeout...
LatestStruckTime: longword;
LatestSpellTime: longword;
LatestFireHitTime: longword;
LatestRushRushTime: longword;
LatestHitTime: longword; //巢阑 傍拜窍绊 立加阑 辆丰 给窍霸
LatestMagicTime: longword; //付过阑 荤侩窍绊 立加阑 辆丰 给窍霸
DizzyDelayStart: longword;
DizzyDelayTime: integer;
DoFadeOut: Boolean;
DoFadeIn: Boolean;
FadeIndex: integer;
DoFastFadeOut: Boolean;
BoAttackSlow: Boolean; //公霸 檬苞肺 傍拜阑 蠢府霸 茄促.
BoMoveSlow: Boolean; //呈公 腹捞 甸菌芭唱, 公芭款 渴阑 涝绢辑 框流烙捞 敌秦柳促.
MoveSlowLevel: integer;
MapMoving: Boolean; //甘 捞悼吝, 钱副锭鳖瘤 捞悼 救凳
MapMovingWait: Boolean;
CheckBadMapMode: Boolean;
BoCheckSpeedHackDisplay: Boolean;
BoViewMiniMap: Boolean;
MiniMapIndex: integer;
MCX: integer; //付快胶啊 啊府虐绰 cell 困摹
MCY: integer;
MouseX, MouseY: integer; //付快胶啊 啊府虐绰 胶农赴 谅钎
TargetX: integer; //啊绊磊 窍绰 格利瘤
TargetY: integer;
TargetCret, FocusCret, MagicTarget: TActor;
BoAutoDig: Boolean;
BoSelectMyself: Boolean;
FocusItem: PTDropItem;
MagicDelayTime: longword;
MagicPKDelayTime: longword;
ChrAction: TChrAction;
NoDarkness: Boolean;
RunReadyCount: integer; //3惯 捞惑 叭促啊 囤促.
SoftClosed: Boolean;
SelChrAddr: string;
SelChrPort: integer;
ImgMixSurface: TDirectDrawSurface;
MiniMapSurface: TDirectDrawSurface;
CurMerchant: integer; //弥辟俊 皋春甫 焊辰 惑牢
MDlgX, MDlgY: integer; //皋春甫 罐篮 镑
changegroupmodetime: longword;
dealactiontime: longword;
querymsgtime: longword;
DupSelection: integer;
AllowGroup: Boolean;
GroupMembers: TStringList;
MySpeedPoint, MyHitPoint, MyAntiPoison, MyPoisonRecover,
MyHealthRecover, MySpellRecover, MyAntiMagic: integer;
AvailIDDay, AvailIDHour: word;
AvailIPDay, AvailIPHour: word;
CaptureSerial: integer;
SendCount, ReceiveCount: integer;
TestSendCount, TestReceiveCount: integer;
SpellCount, SpellFailCount, FireCount: integer;
DebugCount, DebugCount1, DebugCount2: integer;
LastestClientGetTime: longword;
ToolMenuHook: HHOOK;
LastHookKey: integer;
LastHookKeyTime: longword;
BoNextTimePowerHit: Boolean;
BoCanLongHit: Boolean;
BoCanWideHit: Boolean;
BoNextTimeFireHit: Boolean;
implementation
uses FState;
{$R *.DFM}
function CheckMirProgram: Boolean;
var
pstr, cstr: array[0..255] of char;
mirapphandle: HWnd;
begin
Result := FALSE;
StrPCopy (pstr, 'legend of mir2');
mirapphandle := FindWindow (nil, pstr);
if (mirapphandle <> 0) and (mirapphandle <> Application.Handle) then begin
{$IFNDEF COMPILE}
SetActiveWindow(mirapphandle);
Result := TRUE;
{$ENDIF}
exit;
end;
end;
procedure PomiTextOut (dsurface: TDirectDrawSurface; x, y: integer; str: string);
var
i, n: integer;
d: TDirectDrawSurface;
begin
for i:=1 to Length(str) do begin
n := byte(str[i]) - byte('0');
if n in [0..9] then begin //箭磊父 凳
d := FrmMain.WProgUse.Images[30 + n];
if d <> nil then
dsurface.Draw (x + i*8, y, d.ClientRect, d, TRUE);
end else begin
if str[i] = '-' then begin
d := FrmMain.WProgUse.Images[40];
if d <> nil then
dsurface.Draw (x + i*8, y, d.ClientRect, d, TRUE);
end;
end;
end;
end;
procedure WaitAndPass (msec: longword);
var
start: longword;
begin
start := GetTickCount;
while GetTickCount - start < msec do begin
Application.ProcessMessages;
end;
end;
function GetRGB (c256: byte): integer;
var
i: integer;
begin
;
with FrmMain.DxDraw1 do begin
Result := RGB(DefColorTable[c256].rgbRed,
DefColorTable[c256].rgbGreen,
DefColorTable[c256].rgbBlue);
end;
end;
procedure DebugOutStr (msg: string);
var
flname: string;
fhandle: TextFile;
begin
exit;
flname := '.\!debug.txt';
if FileExists(flname) then begin
AssignFile (fhandle, flname);
Append (fhandle);
end else begin
AssignFile (fhandle, flname);
Rewrite (fhandle);
end;
WriteLn (fhandle, TimeToStr(Time) + ' ' + msg);
CloseFile (fhandle);
end;
function KeyboardHookProc (Code: Integer; WParam: Longint; var Msg: TMsg): Longint; stdcall;
begin
if ((WParam = 9){ or (WParam = 13)}) and (LastHookKey = 18) and (GetTickCount - LastHookKeyTime < 500) then begin
if FrmMain.WindowState <> wsMinimized then begin
FrmMain.WindowState := wsMinimized;
end else
Result := CallNextHookEx(ToolMenuHook, Code, WParam, Longint(@Msg));
exit;
end;
LastHookKey := WParam;
LastHookKeyTime := GetTickCount;
Result := CallNextHookEx(ToolMenuHook, Code, WParam, Longint(@Msg));
end;
procedure TFrmMain.FormCreate(Sender: TObject);
var
flname, str: string;
ini: TIniFile;
begin
myrecstr:= TStringList.Create;
mysendstr:= TStringList.Create;
g_bIsShowPacket:=FALSE;//是否显示封包
Randomize;
ini := TIniFile.Create ('.\mir.ini');
if ini <> nil then begin
if EnglishVersion then begin
SERVERADDR := ini.ReadString ('Setup', 'ServerAddr', SERVERADDR);
LocalLanguage := imOpen;
end;
CurFontName := ini.ReadString ('Setup', 'FontName', CurFontName);
ini.Free;
end;
//荤款靛 包访 檬扁拳
if DxSound.Initialized then begin
Sound := TSoundEngine.Create (DxSound.DSound);
end else begin
Sound := nil;
end;
ToolMenuHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHookProc, 0, GetCurrentThreadID);
SoundList := TStringList.Create;
flname := '.\wav\sound.lst';
LoadSoundList (flname);
//if FileExists (flname) then
// SoundList.LoadFromFile (flname);
DScreen := TDrawScreen.Create;
IntroScene := TIntroScene.Create;
LoginScene := TLoginScene.Create;
SelectChrScene := TSelectChrScene.Create;
PlayScene := TPlayScene.Create;
LoginNoticeScene := TLoginNotice.Create;
Map := TMap.Create;
DropedItemList := TList.Create;
MagicList := TList.Create;
FreeActorList := TList.Create;
//DObjList := TList.Create;
EventMan := TClEventManager.Create;
ChangeFaceReadyList := TList.Create;
Myself := nil;
FillChar (UseItems, sizeof(TClientItem)*9, #0);
FillChar (ItemArr, sizeof(TClientItem)*MAXBAGITEMCL, #0);
FillChar (DealItems, sizeof(TClientItem)*10, #0);
FillChar (DealRemoteItems, sizeof(TClientItem)*20, #0);
SaveItemList := TList.Create;
MenuItemList := TList.Create;
WaitingUseItem.Item.S.Name := ''; //馒侩芒 辑滚客 烹脚埃俊 烙矫历厘
EatingItem.S.Name := '';
TargetX := -1;
TargetY := -1;
TargetCret := nil;
FocusCret := nil;
FocusItem := nil;
MagicTarget := nil;
DebugCount := 0;
DebugCount1 := 0;
DebugCount2 := 0;
TestSendCount := 0;
TestReceiveCount := 0;
BoServerChanging := FALSE;
BoBagLoaded := FALSE;
BoAutoDig := FALSE;
LatestClientTime2 := 0;
FirstClientTime := 0;
FirstServerTime := 0;
FirstClientTimerTime := 0;
LatestClientTimerTime := 0;
FirstClientGetTime := 0;
LatestClientGetTime := 0;
TimeFakeDetectCount := 0;
TimeFakeDetectTimer := 0;
TimeFakeDetectSum := 0;
SHGetTime := 0;
SHTimerTime := 0;
SHFakeCount := 0;
DayBright := 3; //广
AreaStateValue := 0;
ConnectionStep := cnsLogin;
ServerConnected := FALSE;
SocStr := '';
WarningLevel := 0; //阂樊菩哦 荐脚 冉荐 (菩哦汗荤 啊瓷己 乐澜)
ActionFailLock := FALSE;
MapMoving := FALSE;
MapMovingWait := FALSE;
CheckBadMapMode := FALSE;
BoCheckSpeedHackDisplay := FALSE;
BoViewMiniMap := FALSE;
FailDir := 0;
FailAction := 0;
DupSelection := 0;
LastAttackTime := GetTickCount;
LastMoveTime := GetTickCount;
LatestSpellTime := GetTickCount;
BoFirstTime := TRUE;
ItemMoving := FALSE;
DoFadeIn := FALSE;
DoFadeOut := FALSE;
DoFastFadeOut := FALSE;
BoAttackSlow := FALSE;
BoMoveSlow := FALSE;
BoNextTimePowerHit := FALSE;
BoCanLongHit := FALSE;
BoCanWideHit := FALSE;
BoNextTimeFireHit := FALSE;
NoDarkness := FALSE;
SoftClosed := FALSE;
BoQueryPrice := FALSE;
SellPriceStr := '';
AllowGroup := FALSE;
GroupMembers := TStringList.Create;
MainWinHandle := DxDraw1.Handle;
//盔努腐, 内齿岿靛 殿..
BoOneClick := FALSE;
OneClickMode := toNone;
CSocket.Active := FALSE;
CSocket.Port := 7000;
if MainParam1 = '' then CSocket.Address := SERVERADDR
else begin
if (MainParam1 <> '') and (MainParam2 = '') then //颇扼皋磐 1俺
CSocket.Address := MainParam1;
if (MainParam2 <> '') and (MainParam3 = '') then begin //颇扼皋磐 2俺 牢版快
CSocket.Address := MainParam1;
CSocket.Port := Str_ToInt (MainParam2, 0);
end;
if (MainParam3 <> '') then begin //颇扼皋磐 3俺牢版快, 烹钦 立加
if CompareText (MainParam1, '/KWG') = 0 then begin
//内齿 岿靛 侩
// CSocket.Address := kornetworldaddress; //game.megapass.net';
// CSocket.Port := 9000;
CSocket.Address :=kornetworldaddress; //game.megapass.net';
CSocket.Port := 7000;
BoOneClick := TRUE;
OneClickMode := toKornetWorld;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -