📄 localdb.~pas
字号:
MapFlag.boUnAllowStdItems := True;
ArrestStringEx(s34, '(', ')', s38);
MapFlag.sUnAllowStdItemsText := Trim(s38);
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倍杀怪经验');
// tSaveList.Add(';CANGETEXP 1 10');
SaveList.Add('#say');
SaveList.Add('游戏登录脚本运行成功,欢迎进入本游戏!!!\ \');
SaveList.Add('<关闭/@exit> \ \');
SaveList.Add('登录脚本文件位于: \');
SaveList.Add(sShowFile + '\');
SaveList.Add('脚本内容请自行按自己的要求修改。');
SaveList.SaveToFile(sScriptFile);
SaveList.Free;
end;
if FileExists(sScriptFile) then begin
g_ManageNPC:=TMerchant.Create;
g_ManageNPC.m_sMapName:='0';
g_ManageNPC.m_nCurrX:=0;
g_ManageNPC.m_nCurrY:=0;
g_ManageNPC.m_sCharName:='QManage';
g_ManageNPC.m_nFlag:=0;
g_ManageNPC.m_wAppr:=0;
g_ManageNPC.m_sFilePath:='MapQuest_def\';
g_ManageNPC.m_boIsHide:=True;
g_ManageNPC.m_boIsQuest:=False;
UserEngine.QuestNPCList.Add(g_ManageNPC);
end else begin
g_ManageNPC:=nil;
end;
except
g_ManageNPC:=nil;
end;
end;
procedure TFrmDB.RobotNPC();
var
sScriptFile:String;
sScritpDir :String;
tSaveList:TStringList;
begin
try
sScriptFile:=g_Config.sEnvirDir + 'Robot_def\' + 'RobotManage.txt';
sScritpDir:=g_Config.sEnvirDir + 'Robot_def\';
if not DirectoryExists(sScritpDir) then
mkdir(Pchar(sScritpDir));
if not FileExists(sScriptFile) then begin
tSaveList:=TStringList.Create;
tSaveList.Add(';此脚为机器人专用脚本,用于机器人处理功能用的脚本。');
tSaveList.SaveToFile(sScriptFile);
tSaveList.Free;
end;
if FileExists(sScriptFile) then begin
g_RobotNPC:=TMerchant.Create;
g_RobotNPC.m_sMapName:='0';
g_RobotNPC.m_nCurrX:=0;
g_RobotNPC.m_nCurrY:=0;
g_RobotNPC.m_sCharName:='RobotManage';
g_RobotNPC.m_nFlag:=0;
g_RobotNPC.m_wAppr:=0;
g_RobotNPC.m_sFilePath:='Robot_def\';
g_RobotNPC.m_boIsHide:=True;
g_RobotNPC.m_boIsQuest:=False;
UserEngine.QuestNPCList.Add(g_RobotNPC);
end else begin
g_RobotNPC:=nil;
end;
except
g_RobotNPC:=nil;
end;
end;
//00489414
function TFrmDB.LoadMapQuest(): Integer;
var
sFileName,tStr:String;
tMapQuestList:TStringList;
i:Integer;
s18,s1C,s20,s24,s28,s2C,s30,s34:String;
n38,n3C:Integer;
boGrouped:Boolean;
Map:TEnvirnoment;
begin
Result:=1;
sFileName:=g_Config.sEnvirDir + 'MapQuest.txt';
if FileExists(sFileName) then begin
tMapQuestList:=TStringList.Create;
tMapQuestList.LoadFromFile(sFileName);
for i:=0 to tMapQuestList.Count -1 do begin
tStr:=tMapQuestList.Strings[i];
if (tStr <> '') and (tStr[1] <> ';') then begin
tStr:=GetValidStr3(tStr, s18, [' ', #9]);
tStr:=GetValidStr3(tStr, s1C, [' ', #9]);
tStr:=GetValidStr3(tStr, s20, [' ', #9]);
tStr:=GetValidStr3(tStr, s24, [' ', #9]);
if (s24 <> '') and (s24[1] = '"') then
ArrestStringEx(s24,'"','"',s24);
tStr:=GetValidStr3(tStr, s28, [' ', #9]);
if (s28 <> '') and (s28[1] = '"') then
ArrestStringEx(s28,'"','"',s28);
tStr:=GetValidStr3(tStr, s2C, [' ', #9]);
tStr:=GetValidStr3(tStr, s30, [' ', #9]);
if (s18 <> '') and (s24 <> '') and (s2C <> '') then begin
Map:=g_MapManager.FindMap(s18);
if Map <> nil then begin
ArrestStringEx(s1C,'[',']',s34);
n38:=Str_ToInt(s34,0);
n3C:=Str_ToInt(s20,0);
if CompareLStr(s30,'GROUP',length('GROUP')) then boGrouped:=True
else boGrouped:=False;
if not Map.CreateQuest(n38,n3C,s24,s28,s2C,boGrouped) then Result:= -i;
//nFlag,boFlag,Monster,Item,Quest,boGrouped
end else Result:= -i;
end else Result:= -i;
end;
end;
tMapQuestList.Free;
end;
QMangeNPC();
QFunctionNPC();
QSHOPNPC();
RobotNPC();
end;
//0048784C
function gettopname(sname:string;var bnpc:byte;var appr:integer):string;
var rs:string;
begin
if topfile=nil then exit;
bnpc:=0;
if sname='<top1>' then begin
rs:=topfile.readString('top','1','');
if (rs<>'') then begin // (topnpcarr[1].sname='') and
rs:=GetValidStrCap(rs, topnpcarr[1].sname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[1].sguildname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[1].slevel, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[1].sdate, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[1].npcappr, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[1].job, ['/']);
bnpc:=1;
result:='天下第一男战士\'+topnpcarr[1].sname+'\';
end else
result:='天下第一男战士\暂无\';
end;
if sname='<top2>' then begin
rs:=topfile.readString('top','2','');
if (rs<>'') then begin // (topnpcarr[2].sname='') and
rs:=GetValidStrCap(rs, topnpcarr[2].sname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[2].sguildname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[2].slevel, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[2].sdate, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[2].npcappr, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[2].job, ['/']);
bnpc:=2;
result:='天下第一女战士\'+topnpcarr[2].sname+'\';
end else
result:='天下第一女战士\暂无\';
end;
if sname='<top3>' then begin
rs:=topfile.readString('top','3','');
if (rs<>'') then begin // (topnpcarr[3].sname='') and
rs:=GetValidStrCap(rs, topnpcarr[3].sname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[3].sguildname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[3].slevel, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[3].sdate, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[3].npcappr, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[3].job, ['/']);
bnpc:=3;
result:='天下第一男法师\'+topnpcarr[3].sname+'\';
end else
result:='天下第一男法师\暂无\';
end;
if sname='<top4>' then begin
rs:=topfile.readString('top','4','');
if (rs<>'') then begin // (topnpcarr[4].sname='') and
rs:=GetValidStrCap(rs, topnpcarr[4].sname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[4].sguildname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[4].slevel, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[4].sdate, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[4].npcappr, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[4].job, ['/']);
bnpc:=4;
result:='天下第一女法师\'+topnpcarr[4].sname+'\';
end else
result:='天下第一女法师\暂无\';
end;
if sname='<top5>' then begin
rs:=topfile.readString('top','5','');
if (rs<>'') then begin // (topnpcarr[5].sname='') and
rs:=GetValidStrCap(rs, topnpcarr[5].sname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[5].sguildname, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[5].slevel, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[5].sdate, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[5].npcappr, ['/']);
rs:=GetValidStrCap(rs, topnpcarr[5].job, ['/']);
bnpc:=5;
result:='天下第一男道士\'+topnpcarr[5].sname+'\';
end else
result:='天下第一男道士\暂无\';
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -