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

📄 localdb.pas

📁 传世源码可编译的,功能齐全.是学习的好模版,会DELPHI的朋友们也可以自己修改,弄个自己的引擎.
💻 PAS
📖 第 1 页 / 共 5 页
字号:

           if POS('KILLBYHUM',s34) > 0 then begin
              s34:= ArrestStringEx(s34,'(',')',sgotolabel);
              MapFlag.m_skillbyhumlabel:=sgotolabel;
              Continue;
            end;
           if POS('KILLBYMON',s34) > 0 then begin
              s34:= ArrestStringEx(s34,'(',')',sgotolabel);
              MapFlag.m_skillbymonlabel:=sgotolabel;
              Continue;
           end;
           if POS('KILLHUM',s34) > 0 then begin
              s34:= ArrestStringEx(s34,'(',')',sgotolabel);
              MapFlag.m_skillhumlabel:=sgotolabel;
              Continue;
            end;
           if POS('KILLMON',s34) > 0 then begin
              s34:= ArrestStringEx(s34,'(',')',sgotolabel);
              MapFlag.m_skillmonlabel:=sgotolabel;
              Continue;
           end;


           if POS('LEVELUP',s34) > 0 then begin
              s34:= ArrestStringEx(s34,'(',')',sgotolabel);
              MapFlag.m_slevelupgotolabel:=sgotolabel;
              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
              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 CompareLStr(s34,'RUNHUMAN',length('RUNHUMAN')) then begin
              MapFlag.boRUNHUMAN:= True;
              Continue;
            end;
            if CompareLStr(s34,'RUNMON',length('RUNMON')) then begin
              MapFlag.boRUNMON:= True;
              Continue;
            end;
            if CompareLStr(s34,'NEEDHOLE',length('NEEDHOLE')) then begin
              MapFlag.boNEEDHOLE := True;
              Continue;
            end;
            if CompareLStr(s34,'NORECALL',length('NORECALL')) then begin
              MapFlag.boNORECALL := True;
              Continue;
            end;
            if CompareLStr(s34,'NOGUILDRECALL',length('NOGUILDRECALL')) then begin
              MapFlag.boNOGUILDRECALL := True;
              Continue;
            end;
            if CompareLStr(s34,'NODEARRECALL',length('NODEARRECALL')) then begin
              MapFlag.boNODEARRECALL := True;
              Continue;
            end;
            if CompareLStr(s34,'NOMASTERRECALL',length('NOMASTERRECALL')) then begin
              MapFlag.boNOMASTERRECALL := True;
              Continue;
            end;
            if CompareLStr(s34,'NORANDOMMOVE',length('NORANDOMMOVE')) then begin
              MapFlag.boNORANDOMMOVE := True;
              Continue;
            end;
            if CompareLStr(s34,'NODRUG',length('NODRUG')) then begin
              MapFlag.boNODRUG := True;
              Continue;
            end;
            if CompareLStr(s34,'MINE',length('MINE')) then begin
              MapFlag.boMINE := True;
              Continue;
            end;
            if CompareLStr(s34,'NOPOSITIONMOVE',length('NOPOSITIONMOVE')) then begin
              MapFlag.boNOPOSITIONMOVE := True;
              Continue;
            end;
            if (s34[1] = 'L') then begin
              MapFlag.nL:= Str_ToInt(Copy(s34,2,Length(s34) -1),1);
            end;
          end;
          if g_MapManager.AddMapInfo(sMapName,sMapDesc,nServerIndex,@MapFlag,QuestNPC) = nil then Result:= -10;
          {
          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]);
            sMapName:=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);
            g_MapManager.AddMapRoute(sMapName,n14,n18,s44,n1C,n20);
            //sSMapNO,nSMapX,nSMapY,sDMapNO,nDMapX,nDMapY
        end;
      end;
      LoadList.Free;
    end;
end;

procedure TFrmDB.QSHOPNPC;
var
  sScriptFile :String;
  sScritpDir  :String;
  SaveList    :TStringList;
  sShowFile   :String;
begin
try
  sScriptFile:=g_Config.sEnvirDir + sMarket_Def + 'QSHOPNPC-0.txt';
  sShowFile:=ReplaceChar(sScriptFile,'\','/');
  sScritpDir:=g_Config.sEnvirDir + sMarket_Def;
  if not DirectoryExists(sScritpDir) then
    mkdir(Pchar(sScritpDir));

  if not FileExists(sScriptFile) then begin
    SaveList:=TStringList.Create;
    SaveList.Add(';此脚为功能脚本,用于实现各种与商城有关的功能');
    SaveList.SaveToFile(sScriptFile);
    SaveList.Free;
  end;
  if FileExists(sScriptFile) then begin
    g_SHOPNPC:=TMerchant.Create;
    g_SHOPNPC.m_sMapName  := '0';
    g_SHOPNPC.m_nCurrX    := 0;
    g_SHOPNPC.m_nCurrY    := 0;
    g_SHOPNPC.m_sCharName := 'QSHOPNPC';
    g_SHOPNPC.m_nFlag     := 0;
    g_SHOPNPC.m_wAppr     := 0;
    g_SHOPNPC.m_sFilePath := sMarket_Def;
    g_SHOPNPC.m_sScript   := 'QSHOPNPC';
    g_SHOPNPC.m_boIsHide  := True;
    g_SHOPNPC.m_boIsQuest := False;
    UserEngine.AddMerchant(g_SHOPNPC);
  end else begin
    g_SHOPNPC:=nil;
  end;
except
  g_SHOPNPC:=nil;
end;
end;

procedure TFrmDB.QFunctionNPC;
var
  sScriptFile :String;
  sScritpDir  :String;
  SaveList    :TStringList;
  sShowFile   :String;
begin
try
  sScriptFile:=g_Config.sEnvirDir + sMarket_Def + 'QFunction-0.txt';
  sShowFile:=ReplaceChar(sScriptFile,'\','/');
  sScritpDir:=g_Config.sEnvirDir + sMarket_Def;
  if not DirectoryExists(sScritpDir) then
    mkdir(Pchar(sScritpDir));

  if not FileExists(sScriptFile) then begin
    SaveList:=TStringList.Create;
    SaveList.Add(';此脚为功能脚本,用于实现各种与脚本有关的功能');
    SaveList.SaveToFile(sScriptFile);
    SaveList.Free;
  end;
  if FileExists(sScriptFile) then begin
    g_FunctionNPC:=TMerchant.Create;
    g_FunctionNPC.m_sMapName  := '0';
    g_FunctionNPC.m_nCurrX    := 0;
    g_FunctionNPC.m_nCurrY    := 0;
    g_FunctionNPC.m_sCharName := 'QFunction';
    g_FunctionNPC.m_nFlag     := 0;
    g_FunctionNPC.m_wAppr     := 0;
    g_FunctionNPC.m_sFilePath := sMarket_Def;
    g_FunctionNPC.m_sScript   := 'QFunction';
    g_FunctionNPC.m_boIsHide  := True;
    g_FunctionNPC.m_boIsQuest := False;
    UserEngine.AddMerchant(g_FunctionNPC);
  end else begin
    g_FunctionNPC:=nil;
  end;
except
  g_FunctionNPC:=nil;
end;
end;

procedure TFrmDB.QMangeNPC();
var
  sScriptFile :String;
  sScritpDir  :String;
  SaveList    :TStringList;
  sShowFile   :String;
begin
try
  sScriptFile:=g_Config.sEnvirDir + 'MapQuest_def\' + 'QManage.txt';
  sShowFile:=ReplaceChar(sScriptFile,'\','/');
  sScritpDir:=g_Config.sEnvirDir + 'MapQuest_def\';
  if not DirectoryExists(sScritpDir) then
    mkdir(Pchar(sScritpDir));

  if not FileExists(sScriptFile) then begin
    SaveList:=TStringList.Create;
    SaveList.Add(';此脚为登录脚本,人物每次登录时都会执行此脚本,所有人物初始设置都可以放在此脚本中。');
    SaveList.Add(';修改脚本内容,可用@ReloadManage命令重新加载该脚本,不须重启程序。');
    SaveList.Add('[@Login]');
    SaveList.Add('#if');
    SaveList.Add('#act');
//    tSaveList.Add(';设置10倍杀怪经验');    

⌨️ 快捷键说明

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