📄 localdb.pas
字号:
MapFlag.nGuildTerritory:=-1;
while (True) do begin
if sFlag = '' then break;
sFlag:=GetValidStr3(sFlag,s34,[' ', ',', #9]);
if s34 = '' then break;
if CompareText(s34,'SAFE') = 0 then begin
MapFlag.boSAFE:=True;
Continue;
end;
if CompareText(s34,'DARK') = 0 then begin
MapFlag.boDarkness:=True;
Continue;
end;
if CompareText(s34,'FIGHT') = 0 then begin
MapFlag.boFightZone:=True;
Continue;
end;
if CompareText(s34,'FIGHT3') = 0 then begin
MapFlag.boFight3Zone:=True;
Continue;
end;
if CompareText(s34,'DAY') = 0 then begin
MapFlag.boDayLight:=True;
Continue;
end;
if CompareText(s34,'QUIZ') = 0 then begin
MapFlag.boQUIZ:=True;
Continue;
end;
if CompareLStr(s34,'NORECONNECT',length('NORECONNECT')) then begin
MapFlag.boNORECONNECT:=True;
ArrestStringEx(s34,'(',')',sReConnectMap);
MapFlag.sNoReConnectMap:=sReConnectMap;
if MapFlag.sNoReConnectMap = '' then Result:= -11;
Continue;
end;
if CompareLStr(s34,'CHECKQUEST',length('CHECKQUEST')) then begin
ArrestStringEx(s34,'(',')',s38);
QuestNPC:=LoadMapQuest(s38);
Continue;
end;
if CompareLStr(s34,'NEEDSET_ON',length('NEEDSET_ON')) then begin
MapFlag.nNeedONOFF:=1;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nNEEDSETONFlag:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'NEEDSET_OFF',length('NEEDSET_OFF')) then begin
MapFlag.nNeedONOFF:=0;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nNEEDSETONFlag:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'MUSIC',length('MUSIC')) then begin
MapFlag.boMUSIC:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nMUSICID:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'EXPRATE',length('EXPRATE')) then begin
MapFlag.boEXPRATE:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nEXPRATE:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'PKWINLEVEL',length('PKWINLEVEL')) then begin
MapFlag.boPKWINLEVEL:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nPKWINLEVEL:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'PKWINEXP',length('PKWINEXP')) then begin
MapFlag.boPKWINEXP:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nPKWINEXP:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'PKLOSTLEVEL',length('PKLOSTLEVEL')) then begin
MapFlag.boPKLOSTLEVEL:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nPKLOSTLEVEL:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'PKLOSTEXP',length('PKLOSTEXP')) then begin
MapFlag.boPKLOSTEXP:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nPKLOSTEXP:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'DECHP',length('DECHP')) then begin
MapFlag.boDECHP:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nDECHPPOINT:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nDECHPTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'INCHP',length('INCHP')) then begin
MapFlag.boINCHP:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nINCHPPOINT:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nINCHPTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'DECGAMEGOLD',length('DECGAMEGOLD')) then begin
MapFlag.boDECGAMEGOLD:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nDECGAMEGOLD:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nDECGAMEGOLDTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'DECGAMEPOINT',length('DECGAMEPOINT')) then begin
MapFlag.boDECGAMEPOINT:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nDECGAMEPOINT:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nDECGAMEPOINTTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'INCGAMEGOLD',length('INCGAMEGOLD')) then begin
MapFlag.boINCGAMEGOLD:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nINCGAMEGOLD:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nINCGAMEGOLDTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'INCGAMEPOINT',length('INCGAMEPOINT')) then begin
MapFlag.boINCGAMEPOINT:=True;
ArrestStringEx(s34,'(',')',s38);
MapFlag.nINCGAMEPOINT:=Str_ToInt(GetValidStr3(s38,s38,['/']),-1);
MapFlag.nINCGAMEPOINTTIME:=Str_ToInt(s38,-1);
Continue;
end;
if CompareText(s34,'RUNHUMAN') = 0 then begin
MapFlag.boRUNHUMAN:= True;
Continue;
end;
if CompareText(s34,'RUNMON') = 0 then begin
MapFlag.boRUNMON:= True;
Continue;
end;
if CompareText(s34,'NEEDHOLE') = 0 then begin
MapFlag.boNEEDHOLE := True;
Continue;
end;
if CompareText(s34,'NORECALL') = 0 then begin
MapFlag.boNORECALL := True;
Continue;
end;
if CompareText(s34,'NOGUILDRECALL') = 0 then begin
MapFlag.boNOGUILDRECALL := True;
Continue;
end;
if CompareText(s34,'NODEARRECALL') = 0 then begin
MapFlag.boNODEARRECALL := True;
Continue;
end;
if CompareText(s34,'NOMASTERRECALL') = 0 then begin
MapFlag.boNOMASTERRECALL := True;
Continue;
end;
if CompareText(s34,'NORANDOMMOVE') = 0 then begin
MapFlag.boNORANDOMMOVE := True;
Continue;
end;
if CompareText(s34,'NODRUG') = 0 then begin
MapFlag.boNODRUG := True;
Continue;
end;
if CompareText(s34,'MINE') = 0 then begin
MapFlag.boMINE := True;
Continue;
end;
if CompareText(s34,'MINE2') = 0 then begin
MapFlag.boMINE2 := True;
Continue;
end;
if CompareText(s34,'MINE3') = 0 then begin
MapFlag.boMINE3 := True;
Continue;
end;
if CompareText(s34,'NOTHROWITEM') = 0 then begin
MapFlag.boNOTHROWITEM := True;
Continue;
end;
if CompareText(s34,'NODROPITEM') = 0 then begin
MapFlag.boNODROPITEM := True;
Continue;
end;
if CompareText(s34,'NOPOSITIONMOVE') = 0 then begin
MapFlag.boNOPOSITIONMOVE := True;
Continue;
end;
if CompareText(s34,'NOHORSE') = 0 then begin
MapFlag.boNOHORSE := True;
Continue;
end;
if CompareText(s34,'NOCHAT') = 0 then begin
MapFlag.boNOCHAT := True;
Continue;
end;
if (s34[1] = 'L') then begin
MapFlag.nL:= Str_ToInt(Copy(s34,2,Length(s34) -1),1);
end;
if CompareLStr(s34,'THUNDER',length('THUNDER')) then begin
ArrestStringEx(s34,'(',')',s38);
MapFlag.nThunder := Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'LAVA',length('LAVA')) then begin
ArrestStringEx(s34,'(',')',s38);
MapFlag.nLava := Str_ToInt(s38,-1);
Continue;
end;
if CompareLStr(s34,'GT',length('GT')) then begin
ArrestStringEx(s34,'(',')',s38);
MapFlag.nGuildTerritory := Str_ToInt(s38,-1);
if g_GuildTerritory.FindGuildTerritory(MapFlag.nGuildTerritory) = nil then
g_GuildTerritory.AddEmptyGT(MapFlag.nGuildTerritory);
Continue;
end;
end;
if g_MapManager.AddMapInfo(sMapName,sMapDesc,nServerIndex,@MapFlag,QuestNPC) = nil then Result:= -10;
Result := 1;
{$IFDEF UseTXT}
end;
end;
sData := s34;
for i:=0 to LoadList.Count -1 do begin
sLineText:=LoadList.Strings[i];
if (sLineText <> '') and (sLineText[1] <> '[') and (sLineText[1] <> ';') then begin
sLineText:=GetValidStr3(sLineText,sData,[' ', ',', #9]);
sMapName:=sData;
sLineText:=GetValidStr3(sLineText,sData,[' ', ',', #9]);
nSMapX:=Str_ToInt(sData,0);
sLineText:=GetValidStr3(sLineText,sData,[' ', ',', #9]);
nSMapY:=Str_ToInt(sData,0);
sLineText:=GetValidStr3(sLineText,sData,[' ', ',','-','>', #9]);
sDMapNO:=sData;
sLineText:=GetValidStr3(sLineText,sData,[' ', ',', #9]);
nDMapX:=Str_ToInt(sData,0);
sLineText:=GetValidStr3(sLineText,sData,[' ', ',',';', #9]);
nDMapY:=Str_ToInt(sData,0);
g_MapManager.AddMapRoute(sMapName,nSMapX,nSMapY,sDMapNO,nDMapX,nDMapY);
end;
end;
LoadList.Free;
end;
{$ELSE}
Query.Next;
end;
finally
Query.Close;
end;
{$ENDIF}
finally
LeaveCriticalSection(ProcessHumanCriticalSection);
end;
FrmMain.Caption:=sCaption;
{$IFNDEF UseTXT}
LoadMapRoute();
{$ENDIF}
end;
{$IFDEF UseTXT}
function TFrmDB.LoadMinMap():Integer;
var
sFileName,tStr,sMapNO,sMapIdx:String;
tMapList:TStringList;
i,nIdx:Integer;
begin
Result:=0;
sFileName:=g_Config.sEnvirDir + 'MiniMap.txt';
if FileExists(sFileName) then begin
MiniMapList.Clear;
tMapList:=TStringList.Create;
tMapList.LoadFromFile(sFileName);
for i:=0 to tMapList.Count -1 do begin
tStr:=tMapList.Strings[i];
if (tStr <> '') and (tStr[1] <> ';') then begin
tStr:=GetValidStr3(tStr, sMapNO, [' ', #9]);
tStr:=GetValidStr3(tStr, sMapIdx, [' ', #9]);
nIdx:=Str_ToInt(sMapIdx,0);
if nIdx > 0 then
MiniMapList.AddObject(sMapNO,TObject(nIdx));
end;
end;
g_MapManager.ReSetMinMap(); //Sergiu
tMapList.Free;
end;
end;
function TFrmDB.LoadBigMap():Integer;
var
sFileName,tStr,sMapNO,sMapIdx:String;
tMapList:TStringList;
i,nIdx:Integer;
begin
Result:=0;
sFileName:=g_Config.sEnvirDir + 'BigMap.txt';
if FileExists(sFileName) then begin
BigMapList.Clear;
tMapList:=TStringList.Create;
tMapList.LoadFromFile(sFileName);
for i:=0 to tMapList.Count -1 do begin
tStr:=tMapList.Strings[i];
if (tStr <> '') and (tStr[1] <> ';') then begin
tStr:=GetValidStr3(tStr, sMapNO, [' ', #9]);
tStr:=GetValidStr3(tStr, sMapIdx, [' ', #9]);
nIdx:=Str_ToInt(sMapIdx,0);
if nIdx > 0 then
BigMapList.AddObject(sMapNO,TObject(nIdx));
end;
end;
g_MapManager.ReSetBigMap();
tMapList.Free;
end;
end;
{$ELSE}
function TFrmDB.LoadMapRoute():Integer;
var
i,nSMapX,nSMapY,nDMapX,nDMapY:Integer;
sSMapNO,sDMapNO:String;
ResourceString
sSQLString = 'SELECT * FROM TBL_MOVEMAPEVENT';
begin
Result:= -1;
EnterCriticalSection(ProcessHumanCriticalSection);
try
try
UseSQL();
Query.SQL.Clear;
Query.SQL.Add(sSQLString);
try
Query.Open;
except
Result:= -2;
end;
for i:=0 to Query.RecordCount -1 do begin
sSMapNO := Trim(Query.FieldByName('FLD_SMAPFILENAME').AsString);
nSMapX := Query.FieldByName('FLD_SX').AsInteger;
nSMapY := Query.FieldByName('FLD_SY').AsInteger;
sDMapNO := Trim(Query.FieldByName('FLD_DMAPFILENAME').AsString);
nDMapX := Query.FieldByName('FLD_DX').AsInteger;
nDMapY := Query.FieldByName('FLD_DY').AsInteger;
g_MapManager.AddMapRoute(sSMapNO,nSMapX,nSMapY,sDMapNO,nDMapX,nDMapY);
Result := 1;
Query.Next;
end;
finally
Query.Close;
end;
finally
LeaveCriticalSection(ProcessHumanCriticalSection);
end;
end;
{$ENDIF}
procedure TFrmDB.QFunctionNPC;
var
sScriptFile :String;
sScritpDir :String;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -