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

📄 localdb.~pas

📁 M2原代码 M2原代码
💻 ~PAS
📖 第 1 页 / 共 5 页
字号:
  boQUIZ:Boolean;
  boNORECONNECT:Boolean;
  sReConnectMap:String;
  boNEEDHOLE:Boolean;
  boNORECALL:Boolean;
  boNORANDOMMOVE:Boolean;
  boNODRUG:Boolean;
  boMINE:Boolean;
  boNOPOSITIONMOVE:Boolean;
  QuestNPC:TMerchant;
  nNEEDSETONFlag:Integer;
  nNeedONOFF:Integer;
begin
    Result:= -1;
    sFileName:=sEnvirDir + 'MapInfo.txt';
    if FileExists(sFileName) then begin
      LoadList:=TStringList.Create;
      LoadList.LoadFromFile(sFileName);
      if LoadList.Count < 0 then begin
        LoadList.Free;
        exit;
      end;
      Result:=1;
      //加载地图设置
      for i:=0 to LoadList.Count -1 do begin
        s30:=LoadList.Strings[i];
        if (s30 <> '') and (s30[1] = '[') then begin
          n10:=1;
          s40:='';
          boSAFE:=False;
          s30:=ArrestStringEx(s30,'[',']',s40);
          s48:=GetValidStrCap(s40,s40,[' ', ',', #9]);
          if (s48 <> '') and (s48[1] = '"') then
              ArrestStringEx(s48,'"','"',s48);
          s4C:=Trim(GetValidStr3(s48,s48,[' ', ',', #9]));
          nServerIndex:=Str_ToInt(s4C,0);
          if s40 = '' then Continue;
          boSAFE:=False;
          boFIGHT:=False;
          boDARK:=False;
          boFIGHT3:=False;
          boDAY:=False;
          boQUIZ:=False;
          boNORECONNECT:=False;
          sReConnectMap:='';
          n10:=1;
          boNEEDHOLE:=False;
          boNORECALL:=False;
          boNORANDOMMOVE:=False;
          boNODRUG:=False;
          boMINE:=False;
          boNOPOSITIONMOVE:=False;
          QuestNPC:=nil;
          nNEEDSETONFlag:= -1;
          nNeedONOFF:= -1;
          while (True) do begin
            if s30 = '' then break;
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            if s34 = '' then break;
            if CompareText(s34,'SAFE') = 0 then begin
              boSAFE:=True;
              Continue;
            end;
            if CompareText(s34,'DARK') = 0 then begin
              boDARK:=True;
              Continue;
            end;   
            if CompareText(s34,'FIGHT') = 0 then begin
              boFIGHT:=True;
              Continue;
            end;
            if CompareText(s34,'FIGHT3') = 0 then begin
              boFIGHT3:=True;
              Continue;
            end;
            if CompareText(s34,'DAY') = 0 then begin
              boDAY:=True;
              Continue;
            end;
            if CompareText(s34,'QUIZ') = 0 then begin
              boQUIZ:=True;
              Continue;
            end;
            if CompareLStr(s34,'NORECONNECT',length('NORECONNECT')) then begin
               boNORECONNECT:=True;
               ArrestStringEx(s34,'(',')',sReConnectMap);
               if sReConnectMap = '' 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
              nNeedONOFF:=1;
              ArrestStringEx(s34,'(',')',s38);
              nNEEDSETONFlag:=Str_ToInt(s38,-1);
              Continue;
            end;
            if CompareLStr(s34,'NEEDSET_OFF',length('NEEDSET_OFF')) then begin
              nNeedONOFF:=0;
              ArrestStringEx(s34,'(',')',s38);
              nNEEDSETONFlag:=Str_ToInt(s38,-1);
              Continue;
            end;
            if CompareLStr(s34,'NEEDHOLE',length('NEEDHOLE')) then begin
              boNEEDHOLE := True;
              Continue;
            end;
            if CompareLStr(s34,'NORECALL',length('NORECALL')) then begin
              boNORECALL := True;
              Continue;
            end;
            if CompareLStr(s34,'NORANDOMMOVE',length('NORANDOMMOVE')) then begin
              boNORANDOMMOVE := True;
              Continue;
            end;
            if CompareLStr(s34,'NODRUG',length('NODRUG')) then begin
              boNODRUG := True;
              Continue;
            end;
            if CompareLStr(s34,'MINE',length('MINE')) then begin
              boMINE := True;
              Continue;
            end;
            if CompareLStr(s34,'NOPOSITIONMOVE',length('NOPOSITIONMOVE')) then begin
              boNOPOSITIONMOVE := True;
              Continue;
            end;
            if (s34[1] = 'L') then begin
              n10:= Str_ToInt(Copy(s34,2,Length(s34) -1),1);
            end;
          end;
          if EnvirList.AddMapInfo(s40,
                                  s48,
                                  nServerIndex,
                                  n10,
                                  boSAFE,
                                  boFIGHT,
                                  boFIGHT3,
                                  boDARK,
                                  boDAY,
                                  boQUIZ,
                                  boNORECONNECT,
                                  boNEEDHOLE,
                                  boNORECALL,
                                  boNORANDOMMOVE,
                                  boNODRUG,
                                  boMINE,
                                  boNOPOSITIONMOVE,
                                  sReConnectMap,
                                  QuestNPC,
                                  nNEEDSETONFlag,
                                  nNeedONOFF) = nil then Result:= -10;
        end;
      end;
      //加载地图连接点
      for i:=0 to LoadList.Count -1 do begin
        s30:=LoadList.Strings[i];
        if (s30 <> '') and (s30[1] <> '[') and (s30[1] <> ';') then begin
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            s40:=s34;
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            n14:=Str_ToInt(s34,0);
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            n18:=Str_ToInt(s34,0);
            s30:=GetValidStr3(s30,s34,[' ', ',','-','>', #9]);
            s44:=s34;
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            n1C:=Str_ToInt(s34,0);
            s30:=GetValidStr3(s30,s34,[' ', ',',';', #9]);
            n20:=Str_ToInt(s34,0);
            EnvirList.AddMapRoute(s40,n14,n18,s44,n1C,n20);
            //sSMapNO,nSMapX,nSMapY,sDMapNO,nDMapX,nDMapY
        end;
      end;
      LoadList.Free;
    end;
end;
}
//00486D1C
function TFrmDB.LoadMapInfo: Integer;
  //00486C1C
  function LoadMapQuest(sName:String):TMerchant;
  var
    QuestNPC:TMerchant;
  begin
    QuestNPC:=TMerchant.Create;
    QuestNPC.m_sMapName:='0';
    QuestNPC.m_nCurrX:=0;
    QuestNPC.m_nCurrY:=0;
    QuestNPC.m_sCharName:=sName;
    QuestNPC.m_nFlag:=0;
    QuestNPC.m_wAppr:=0;
    QuestNPC.m_sFilePath:='MapQuest_def\';
    QuestNPC.m_boIsHide:=True;
    QuestNPC.m_boIsQuest:=False;
    UserEngine.QuestNPCList.Add(QuestNPC);
    Result:=QuestNPC;
  end;
  procedure LoadSubMapInfo(LoadList:TStringList;sFileName:String);
  var
    I: Integer;
    sFilePatchName,sFileDir:String;
    LoadMapList:TStringList;
  begin
    sFileDir:=g_Config.sEnvirDir + 'MapInfo\';
    if not DirectoryExists(sFileDir) then begin
      CreateDir(sFileDir);
    end;
      
    sFilePatchName:=sFileDir + sFileName;
    if FileExists(sFilePatchName) then begin
      LoadMapList:=TStringList.Create;
      LoadMapList.LoadFromFile(sFilePatchName);
      for I := 0 to LoadMapList.Count - 1 do begin
        LoadList.Add(LoadMapList.Strings[I]);
      end;
      LoadMapList.Free;
    end;
  end;
var
  sFileName:String;

  LoadList:TStringList;
  i:Integer;
  s30,s34,s38,sMapName,s44,sMapDesc,s4C,sReConnectMap:String;
  n14,n18,n1C,n20:Integer;
  nServerIndex:Integer;

  MapFlag:TMapFlag;
  QuestNPC:TMerchant;
  sMapInfoFile:String;
begin
    Result:= -1;
    sFileName:=g_Config.sEnvirDir + 'MapInfo.txt';
    if FileExists(sFileName) then begin
      LoadList:=TStringList.Create;
      LoadList.LoadFromFile(sFileName);
      if LoadList.Count < 0 then begin
        LoadList.Free;
        exit;
      end;
      I:=0;
      while (True) do begin
        if I >= LoadList.Count then break;
        if CompareLStr('loadmapinfo',LoadList.Strings[I],Length('loadmapinfo')) then begin
          sMapInfoFile:=GetValidStr3(LoadList.Strings[I], s30, [' ', #9]);
          LoadList.Delete(I);
          if sMapInfoFile <> '' then begin
            LoadSubMapInfo(LoadList,sMapInfoFile);
          end;
        end;
        Inc(I);
      end;
      Result:=1;
      //加载地图设置
      for i:=0 to LoadList.Count -1 do begin
        s30:=LoadList.Strings[i];
        if (s30 <> '') and (s30[1] = '[') then begin
          sMapName:='';
          MapFlag.boSAFE:=False;
          s30:=ArrestStringEx(s30,'[',']',sMapName);
          sMapDesc:=GetValidStrCap(sMapName,sMapName,[' ', ',', #9]);
          if (sMapDesc <> '') and (sMapDesc[1] = '"') then
              ArrestStringEx(sMapDesc,'"','"',sMapDesc);
          s4C:=Trim(GetValidStr3(sMapDesc,sMapDesc,[' ', ',', #9]));
          nServerIndex:=Str_ToInt(s4C,0);
          if sMapName = '' then Continue;
          FillChar(MapFlag,SizeOf(TMapFlag),#0);
          MapFlag.nL:=1;
          QuestNPC:=nil;
          MapFlag.nNEEDSETONFlag:= -1;
          MapFlag.nNeedONOFF:= -1;

          while (True) do begin
            if s30 = '' then break;
            s30:=GetValidStr3(s30,s34,[' ', ',', #9]);
            if s34 = '' then break;
            MapFlag.nMUSICID:=-1;
            if CompareText(s34,'SAFE') = 0 then begin
              MapFlag.boSAFE:=True;
              Continue;
            end;
            if CompareText(s34,'DARK') = 0 then begin
              MapFlag.boDARK:=True;
              Continue;
            end;
            if CompareText(s34,'FIGHT') = 0 then begin
              MapFlag.boFIGHT:=True;
              Continue;
            end;
            if CompareText(s34,'FIGHT3') = 0 then begin
              MapFlag.boFIGHT3:=True;
              Continue;
            end;
            if CompareText(s34,'DAY') = 0 then begin
              MapFlag.boDAY:=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.sReConnectMap:=sReConnectMap;
               if MapFlag.sReConnectMap = '' 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

⌨️ 快捷键说明

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