📄 localdb.pas
字号:
if sPatch = '' then sPatch:=sNpc_def;
Result:=LoadScriptFile(NPC,sPatch,sScritpName,False);
end;
function TFrmDB.LoadScriptFile(NPC: TNormNpc; sPatch, sScritpName: String;
boFlag: Boolean): Integer; //0048B684
var
nQuestIdx,I,n1C,n20,n24,nItemType,nPriceRate: Integer;
n6C,n70:Integer;
sScritpFileName,s30,s34,s38,s3C,s40,s44,s48,s4C,s50:String;
LoadList:TStringList;
DefineList:TList;
s54,s58,s5C,s74:String;
DefineInfo:pTDefineInfo;
bo8D:Boolean;
Script:pTScript;
SayingRecord:pTSayingRecord;
SayingProcedure:pTSayingProcedure;
QuestConditionInfo:pTQuestConditionInfo;
QuestActionInfo:pTQuestActionInfo;
Goods:pTGoods;
function LoadCallScript(sFileName,sLabel:String;List:TStringList):Boolean; //00489BD4
var
I: Integer;
LoadStrList:TStringList;
bo1D:Boolean;
s18:String;
begin
Result:=False;
if FileExists(sFileName) then begin
LoadStrList:=TStringList.Create;
LoadStrList.LoadFromFile(sFileName);
DeCodeStringList(LoadStrList);
sLabel:='[' + sLabel + ']';
bo1D:=False;
for I := 0 to LoadStrList.Count - 1 do begin
s18:=Trim(LoadStrList.Strings[i]);
if s18 <> '' then begin
if not bo1D then begin
if (s18[1] = '[') and (CompareText(s18,sLabel) = 0) then begin
bo1D:=True;
List.Add(s18);
end;
end else begin //00489CBF
if s18[1] <> '{' then begin
if s18[1] = '}' then begin
bo1D:=False;
Result:=True;
break;
end else begin //00489CD9
List.Add(s18);
end;
end;
end;
end; //00489CE4 if s18 <> '' then begin
end; // for I := 0 to LoadStrList.Count - 1 do begin
LoadStrList.Free;
end;
end;
procedure LoadScriptcall(LoadList:TStringList); //0048B138
var
I: Integer;
s14,s18,s1C,s20,s34:String;
begin
for I := 0 to LoadList.Count - 1 do begin
s14:=Trim(LoadList.Strings[i]);
if (s14 <> '') and (s14[1] = '#') and (CompareLStr(s14,'#CALL',length('#CALL'))) then begin
s14:=ArrestStringEx(s14,'[',']',s1C);
s20:=Trim(s1C);
s18:=Trim(s14);
s34:=g_Config.sEnvirDir + 'QuestDiary\' + s20;
if LoadCallScript(s34,s18,LoadList) then begin
LoadList.Strings[i]:='#ACT';
LoadList.Insert(i + 1,'goto ' + s18);
end else begin
MainOutMessage('script error, load fail: ' + s20 + s18);
end;
end;
end;
end;
function LoadDefineInfo(LoadList:TStringList;List:TList):String; //0048B35C
var
I: Integer;
s14,s28,s1C,s20,s24:String;
DefineInfo:pTDefineInfo;
LoadStrList:TStringList;
begin
for I := 0 to LoadList.Count - 1 do begin
s14:=Trim(LoadList.Strings[i]);
if (s14 <> '') and (s14[1] = '#') then begin
if CompareLStr(s14,'#SETHOME',length('#SETHOME')) then begin
Result:=Trim(GetValidStr3(s14,s1C,[' ',#9]));
LoadList.Strings[i]:='';
end;
if CompareLStr(s14,'#DEFINE',length('#DEFINE')) then begin
s14:=(GetValidStr3(s14,s1C,[' ',#9]));
s14:=(GetValidStr3(s14,s20,[' ',#9]));
s14:=(GetValidStr3(s14,s24,[' ',#9]));
New(DefineInfo);
DefineInfo.sName:=UpperCase(s20);
DefineInfo.sText:=s24;
List.Add(DefineInfo);
LoadList.Strings[i]:='';
end; //0048B505
if CompareLStr(s14,'#INCLUDE',length('#INCLUDE')) then begin
s28:=Trim(GetValidStr3(s14,s1C,[' ',#9]));
s28:=g_Config.sEnvirDir + 'Defines\' + s28;
if FileExists(s28) then begin
LoadStrList:=TStringList.Create;
LoadStrList.LoadFromFile(s28);
Result:=LoadDefineInfo(LoadStrList,List);
LoadStrList.Free;
end else begin
MainOutMessage('script error, load fail: ' + s28);
end;
LoadList.Strings[i]:='';
end;
end;
end;
end;
function MakeNewScript():pTScript; //00489D74
var
ScriptInfo:pTScript;
begin
New(ScriptInfo);
ScriptInfo.boQuest:=False;
FillChar(ScriptInfo.QuestInfo,SizeOf(TQuestInfo),#0);
nQuestIdx:=0;
ScriptInfo.RecordList:=TList.Create;
NPC.m_ScriptList.Add(ScriptInfo);
Result:=ScriptInfo;
end;
function QuestCondition(sText:String;QuestConditionInfo:pTQuestConditionInfo):Boolean; //00489DDC
var
sCmd,sParam1,sParam2,sParam3,sParam4,sParam5,sParam6:String;
nCMDCode:Integer;
Label L001;
begin
Result:=False;
sText:=GetValidStrCap(sText,sCmd,[' ',#9]);
sText:=GetValidStrCap(sText,sParam1,[' ',#9]);
sText:=GetValidStrCap(sText,sParam2,[' ',#9]);
sText:=GetValidStrCap(sText,sParam3,[' ',#9]);
sText:=GetValidStrCap(sText,sParam4,[' ',#9]);
sText:=GetValidStrCap(sText,sParam5,[' ',#9]);
sText:=GetValidStrCap(sText,sParam6,[' ',#9]);
sCmd:=UpperCase(sCmd);
nCMDCode:=0;
if sCmd = sCHECK then begin
nCMDCode:=nCHECK;
ArrestStringEx(sParam1,'[',']',sParam1);
if not IsStringNumber(sParam1) then nCMDCode:=0;
if not IsStringNumber(sParam2) then nCMDCode:=0;
Goto L001;
end;
if sCmd = sCHECKOPEN then begin
nCMDCode:=nCHECKOPEN;
ArrestStringEx(sParam1,'[',']',sParam1);
if not IsStringNumber(sParam1) then nCMDCode:=0;
if not IsStringNumber(sParam2) then nCMDCode:=0;
Goto L001;
end;
if sCmd = sCHECKUNIT then begin
nCMDCode:=nCHECKUNIT;
ArrestStringEx(sParam1,'[',']',sParam1);
if not IsStringNumber(sParam1) then nCMDCode:=0;
if not IsStringNumber(sParam2) then nCMDCode:=0;
Goto L001;
end;
if sCmd = sCHECKPKPOINT then begin
nCMDCode:=nCHECKPKPOINT;
Goto L001;
end;
if sCmd = sCHECKGOLD then begin
nCMDCode:=nCHECKGOLD;
Goto L001;
end;
if sCmd = sCHECKLEVEL then begin
nCMDCode:=nCHECKLEVEL;
Goto L001;
end;
if sCmd = sCHECKJOB then begin
nCMDCode:=nCHECKJOB;
Goto L001;
end;
if sCmd = sRANDOM then begin //00489FB2
nCMDCode:=nRANDOM;
Goto L001;
end;
if sCmd = sCHECKITEM then begin
nCMDCode:=nCHECKITEM;
Goto L001;
end;
if sCmd = sGENDER then begin
nCMDCode:=nGENDER;
Goto L001;
end;
if sCmd = sCHECKBAGGAGE then begin
nCMDCode:=nCHECKBAGGAGE;
Goto L001;
end;
if sCmd = sCHECKNAMELIST then begin
nCMDCode:=nCHECKNAMELIST;
Goto L001;
end;
if sCmd = sSC_HASGUILD then begin
nCMDCode:=nSC_HASGUILD;
Goto L001;
end;
if sCmd = sSC_ISGUILDMASTER then begin
nCMDCode:=nSC_ISGUILDMASTER;
Goto L001;
end;
if sCmd = sSC_CHECKCASTLEMASTER then begin
nCMDCode:=nSC_CHECKCASTLEMASTER;
Goto L001;
end;
if sCmd = sSC_ISNEWHUMAN then begin
nCMDCode:=nSC_ISNEWHUMAN;
Goto L001;
end;
if sCmd = sSC_CHECKMEMBERTYPE then begin
nCMDCode:=nSC_CHECKMEMBERTYPE;
Goto L001;
end;
if sCmd = sSC_CHECKMEMBERLEVEL then begin
nCMDCode:=nSC_CHECKMEMBERLEVEL;
Goto L001;
end;
if sCmd = sSC_CHECKGAMEGOLD then begin
nCMDCode:=nSC_CHECKGAMEGOLD;
Goto L001;
end;
if sCmd = sSC_CHECKGAMEPOINT then begin
nCMDCode:=nSC_CHECKGAMEPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKNAMELISTPOSITION then begin
nCMDCode:=nSC_CHECKNAMELISTPOSITION;
Goto L001;
end;
if sCmd = sSC_CHECKGUILDLIST then begin
nCMDCode:=nSC_CHECKGUILDLIST;
Goto L001;
end;
if sCmd = sSC_CHECKRENEWLEVEL then begin
nCMDCode:=nSC_CHECKRENEWLEVEL;
Goto L001;
end;
if sCmd = sSC_CHECKSLAVELEVEL then begin
nCMDCode:=nSC_CHECKSLAVELEVEL;
Goto L001;
end;
if sCmd = sSC_CHECKSLAVENAME then begin
nCMDCode:=nSC_CHECKSLAVENAME;
Goto L001;
end;
if sCmd = sSC_CHECKCREDITPOINT then begin
nCMDCode:=nSC_CHECKCREDITPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKOFGUILD then begin
nCMDCode:=nSC_CHECKOFGUILD;
Goto L001;
end;
if sCmd = sSC_CHECKPAYMENT then begin
nCMDCode:=nSC_CHECKPAYMENT;
Goto L001;
end;
if sCmd = sSC_CHECKUSEITEM then begin
nCMDCode:=nSC_CHECKUSEITEM;
Goto L001;
end;
if sCmd = sSC_CHECKBAGSIZE then begin
nCMDCode:=nSC_CHECKBAGSIZE;
Goto L001;
end;
if sCmd = sSC_CHECKLISTCOUNT then begin
nCMDCode:=nSC_CHECKLISTCOUNT;
Goto L001;
end;
if sCmd = sSC_CHECKDC then begin
nCMDCode:=nSC_CHECKDC;
Goto L001;
end;
if sCmd = sSC_CHECKMC then begin
nCMDCode:=nSC_CHECKMC;
Goto L001;
end;
if sCmd = sSC_CHECKSC then begin
nCMDCode:=nSC_CHECKSC;
Goto L001;
end;
if sCmd = sSC_CHECKHP then begin
nCMDCode:=nSC_CHECKHP;
Goto L001;
end;
if sCmd = sSC_CHECKMP then begin
nCMDCode:=nSC_CHECKMP;
Goto L001;
end;
if sCmd = sSC_CHECKITEMTYPE then begin
nCMDCode:=nSC_CHECKITEMTYPE;
Goto L001;
end;
if sCmd = sSC_CHECKEXP then begin
nCMDCode:=nSC_CHECKEXP;
Goto L001;
end;
if sCmd = sSC_CHECKCASTLEGOLD then begin
nCMDCode:=nSC_CHECKCASTLEGOLD;
Goto L001;
end;
if sCmd = sSC_PASSWORDERRORCOUNT then begin
nCMDCode:=nSC_PASSWORDERRORCOUNT;
Goto L001;
end;
if sCmd = sSC_ISLOCKPASSWORD then begin
nCMDCode:=nSC_ISLOCKPASSWORD;
Goto L001;
end;
if sCmd = sSC_ISLOCKSTORAGE then begin
nCMDCode:=nSC_ISLOCKSTORAGE;
Goto L001;
end;
if sCmd = sSC_CHECKBUILDPOINT then begin
nCMDCode:=nSC_CHECKBUILDPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKAURAEPOINT then begin
nCMDCode:=nSC_CHECKAURAEPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKSTABILITYPOINT then begin
nCMDCode:=nSC_CHECKSTABILITYPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKFLOURISHPOINT then begin
nCMDCode:=nSC_CHECKFLOURISHPOINT;
Goto L001;
end;
if sCmd = sSC_CHECKCONTRIBUTION then begin
nCMDCode:=nSC_CHECKCONTRIBUTION;
Goto L001;
end;
if sCmd = sSC_CHECKRANGEMONCOUNT then begin
nCMDCode:=nSC_CHECKRANGEMONCOUNT;
Goto L001;
end;
if sCmd = sSC_CHECKITEMADDVALUE then begin
nCMDCode:=nSC_CHECKITEMADDVALUE;
Goto L001;
end;
{$IF SoftVersion = VERENT}
if sCmd = sSC_CHECKINMAPRANGE then begin
nCMDCode:=nSC_CHECKINMAPRANGE;
Goto L001;
end;
{$IFEND}
if sCmd = sSC_CASTLECHANGEDAY then begin
nCMDCode:=nSC_CASTLECHANGEDAY;
Goto L001;
end;
if sCmd = sSC_CASTLEWARDAY then begin
nCMDCode:=nSC_CASTLEWARDAY;
Goto L001;
end;
if sCmd = sSC_ONLINELONGMIN then begin
nCMDCode:=nSC_ONLINELONGMIN;
Goto L001;
end;
if sCmd = sSC_CHECKGUILDCHIEFITEMCOUNT then begin
nCMDCode:=nSC_CHECKGUILDCHIEFITEMCOUNT;
Goto L001;
end;
if sCmd = sSC_CHECKNAMEDATELIST then begin
nCMDCode:=nSC_CHECKNAMEDATELIST;
Goto L001;
end;
if sCmd = sSC_CHECKMAPHUMANCOUNT then begin
nCMDCode:=nSC_CHECKMAPHUMANCOUNT;
Goto L001;
end;
if sCmd = sSC_CHECKMAPMONCOUNT then begin
nCMDCode:=nSC_CHECKMAPMONCOUNT;
Goto L001;
end;
if sCmd = sSC_CHECKVAR then begin
nCMDCode:=nSC_CHECKVAR;
Goto L001;
end;
if sCmd = sSC_CHECKSERVERNAME then begin
nCMDCode:=nSC_CHECKSERVERNAME;
Goto L001;
end;
if sCmd = sSC_ISATTACKGUILD then begin
nCMDCode:=nSC_ISATTACKGUILD;
Goto
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -