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

📄 database.pas

📁 仙境传说(RO)私人服务器端源代码。第一次上传。
💻 PAS
📖 第 1 页 / 共 5 页
字号:
			sl.Add('0');		for i := 0 to 54 do			if (i <> 1) and (i <> 2) and (sl.Strings[i] = '') then sl.Strings[i] := '0';		tb := TMobDB.Create;//ID,Name,JName,LV,HP,SP,EXP,JEXP,Range1,ATK1,ATK2,DEF,MDEF,STR,AGI,VIT,INT,DEX,LUK,//Range2,Range3,Scale,Race,Element,Mode,Speed,ADelay,aMotion,dMotion,//Drop1id,Drop1per,Drop2id,Drop2per,Drop3id,Drop3per,Drop4id,Drop4per,//Drop5id,Drop5per,Drop6id,Drop6per,Drop7id,Drop7per,Drop8id,Drop8per,//Item1,Item2,MEXP,MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per		with tb do begin			ID := StrToInt(sl.Strings[0]);			Name := sl.Strings[1];			JName := sl.Strings[2];			LV := StrToInt(sl.Strings[3]);			HP := StrToInt(sl.Strings[4]);			SP := StrToInt(sl.Strings[5]);			EXP := StrToInt(sl.Strings[6]);			JEXP := StrToInt(sl.Strings[7]);			Range1 := StrToInt(sl.Strings[8]);			ATK1 := StrToInt(sl.Strings[9]);			ATK2 := StrToInt(sl.Strings[10]);			DEF := StrToInt(sl.Strings[11]);			MDEF := StrToInt(sl.Strings[12]);			for j := 0 to 4 do Param[j] := StrToInt(sl.Strings[13+j]);      LUK := StrToInt(sl.Strings[18]);			Range2 := StrToInt(sl.Strings[19]);			Range3 := StrToInt(sl.Strings[20]);			Scale := StrToInt(sl.Strings[21]);			Race := StrToInt(sl.Strings[22]);			Element := StrToInt(sl.Strings[23]);			Mode := StrToInt(sl.Strings[24]);			Speed := StrToInt(sl.Strings[25]);			ADelay := StrToInt(sl.Strings[26]);			aMotion := StrToInt(sl.Strings[27]);			dMotion := StrToInt(sl.Strings[28]);			for j := 0 to 7 do begin				Drop[j].ID := StrToInt(sl.Strings[29+j*2]);				Drop[j].Per := StrToInt(sl.Strings[30+j*2]);				k := ItemDB.IndexOf(Drop[j].ID);				if k <> -1 then begin					Drop[j].Data := ItemDB.Objects[k] as TItemDB;				end else begin					k := ItemDB.IndexOf(512);					Drop[j].Data := ItemDB.Objects[k] as TItemDB;					Drop[j].ID := 512;					Drop[j].Per := 0;				end;			end;			Item1 := StrToInt(sl.Strings[45]);			Item2 := StrToInt(sl.Strings[46]);			MEXP := StrToInt(sl.Strings[47]);			MEXPPer := StrToInt(sl.Strings[48]);			for j := 0 to 2 do begin				MVPItem[j].ID := StrToInt(sl.Strings[49+j*2]);				MVPItem[j].Per := StrToInt(sl.Strings[50+j*2]);			end;			HIT := LV + Param[4];			FLEE := Lv + Param[2];			isDontMove := boolean((Mode and 1) = 0);			isActive := boolean(((Mode and 4) <> 0) and not DisableMonsterActive);			isLoot := boolean((Mode and 2) <> 0);			isLink := boolean((Mode and 8) <> 0);		end;		MobDB.AddObject(tb.ID, tb);		MobDBName.AddObject(tb.Name, tb);	end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d monster(s) database loaded.', [MobDB.Count]));	Application.ProcessMessages;{巵{敔捛壛}	//巬僨乕僞儀乕僗撉傒崬傒	DebugOut.Lines.Add('Summon Monster List loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\summon_mob.txt');	Reset(txt);	j := 0;	sl.Clear;	while not eof(txt) do begin		Readln(txt, str);		sl.DelimitedText := str;		k := StrToInt(sl.Strings[1]);		if (MobDBName.IndexOf(sl.Strings[0]) <> -1) and (k > 0) then begin			tsmn := TSummon.Create;			tsmn.Name := sl.Strings[0];			for i := 1 to k do begin				SummonMobList.AddObject(j, tsmn);				j := j + 1;			end;		end;	end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d Summon Monster List loaded.', [j]));	Application.ProcessMessages;	//敔僨乕僞儀乕僗撉傒崬傒	DebugOut.Lines.Add('Summon Item List loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\summon_item.txt');	Reset(txt);	sl.Clear;	while not eof(txt) do begin		Readln(txt, str);		sl.DelimitedText := str;		k := StrToInt(sl.Strings[2]);		if (ItemDBName.IndexOf(sl.Strings[0]) = -1) or			(ItemDBName.IndexOf(sl.Strings[1]) = -1) or (k = 0) then continue;		tsmn := TSummon.Create;		tsmn.Name := sl.Strings[1];		for i := 1 to k do begin			if (sl.Strings[0] = 'Old_Blue_Box') then begin				j := SummonIOBList.Count;				SummonIOBList.AddObject(j, tsmn);			end else if (sl.Strings[0] = 'Old_Violet_Box') then begin				j := SummonIOVList.Count;				SummonIOVList.AddObject(j, tsmn);			end else if (sl.Strings[0] = 'Old_Card_Album') then begin				j := SummonICAList.Count;				SummonICAList.AddObject(j, tsmn);			end else if (sl.Strings[0] = 'Gift_Box') then begin				j := SummonIGBList.Count;				SummonIGBList.AddObject(j, tsmn);			end;		end;	end;	CloseFile(txt);	j := SummonIOBList.Count + SummonIOVList.Count + SummonICAList.Count + SummonIGBList.Count;	DebugOut.Lines.Add(Format('-> Total %d Summon Item List loaded.', [j]));	Application.ProcessMessages;{巵{敔捛壛僐僐傑偱}{僉儏乕儁僢僩}        DebugOut.Lines.Add( 'Pet database loading...' );        Application.ProcessMessages;        AssignFile(txt, AppPath + 'database\pet_db.txt' );        Reset(txt);        Readln( txt, str );        while not eof(txt) do begin                sl.Clear;                Readln(txt, str);                sl.DelimitedText := str;                tp := TPetDB.Create;                with tp do begin                        MobID := StrToInt( sl.Strings[0] );                        ItemID := StrToInt( sl.Strings[1] );                        EggID := StrToInt( sl.Strings[2] );                        AcceID := StrToInt( sl.Strings[3] );                        FoodID := StrToInt( sl.Strings[4] );                        Fullness := StrToInt( sl.Strings[5] );                        HungryDelay := StrToInt( sl.Strings[6] );                        Hungry  := StrToInt( sl.Strings[7] );                        Full := StrToInt( sl.Strings[8] );                        Reserved := StrToInt( sl.Strings[9] );                        Die := StrToInt( sl.Strings[10] );                        Capture := StrToInt( sl.Strings[11] );                end;                PetDB.AddObject( tp.MobID, tp );        end;        CloseFile(txt);        DebugOut.Lines.Add( Format( '-> Total %d pet(s) database loaded.', [PetDB.Count] ) );        Application.ProcessMessages;{僉儏乕儁僢僩偙偙傑偱}{NPC僀儀儞僩捛壛}	//mapinfo_db撉傒崬傒	DebugOut.Lines.Add('Mapinfo database loading...');	Application.ProcessMessages;	if FileExists(AppPath + 'database\mapinfo_db.txt') then begin		AssignFile(txt, AppPath + 'database\mapinfo_db.txt');		Reset(txt);		Readln(txt, str);		k := 0;		while not eof(txt) do begin			sl.Clear;			Readln(txt, str);			sl.DelimitedText := str;			if (sl.Count < 2) then continue;      sl[0] := LowerCase(sl[0]);      if (ExtractFileExt(sl[0]) <> '.dwm') then begin				MessageBox(Handle, PChar('mapinfo_db File Format Error : ' + sl[0] + ' : This Is Not A Valid Map Format'), 'darkWeiss', MB_OK or MB_ICONSTOP);				Application.Terminate;				exit;			end;			sl[0] := ChangeFileExt(sl[0], '');			if (MapInfo.IndexOf(sl[0]) = -1) then begin				mi := MapTbl.Create;				j := 1;			end else begin				mi := MapInfo.Objects[MapInfo.IndexOf(sl[0])] as MapTbl;				j := 0;			end;			for i := 1 to sl.Count - 1 do begin				if (sl[i] = 'nomemo') then mi.noMemo := true				else if (sl[i] = 'nosave') then mi.noSave := true				else if (sl[i] = 'noteleport') then mi.noTele := true        else if (sl[i] = 'pvp') then mi.PvP := true        else if (sl[i] = 'pvpg') then mi.PvPG := true			end;			if (j = 1) then begin				MapInfo.AddObject(sl[0], mi);			end;			Inc(k);		end;		CloseFile(txt);		DebugOut.Lines.Add(Format('-> Total %d MapInfo database loaded.', [k]));		Application.ProcessMessages;	end else begin		DebugOut.Lines.Add('-> Mapinfo database Not Find.');		Application.ProcessMessages;	end;{NPC僀儀儞僩捛壛僐僐傑偱}	//僗僉儖僨乕僞儀乕僗撉傒崬傒	DebugOut.Lines.Add('Skill database loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\skill_db.txt');	Reset(txt);	Readln(txt, str);	while not eof(txt) do begin		sl.Clear;		Readln(txt, str);		sl.DelimitedText := str;		for i := sl.Count to 74 do			sl.Add('0');		for i := 0 to 74 do			if (i <> 1) and (i <> 2) and (sl.Strings[i] = '') then sl.Strings[i] := '0';		tl := TSkillDB.Create;		with tl do begin			ID := StrToInt(sl.Strings[0]);			IDC := sl.Strings[1];			Name := sl.Strings[2];			SType := StrToInt(sl.Strings[3]);			MasterLV := StrToInt(sl.Strings[4]);			for i := 0 to 9 do				SP[i+1] := StrToInt(sl.Strings[5+i]);			HP := StrToInt(sl.Strings[15]);			UseItem := StrToInt(sl.Strings[16]);			CastTime1 := StrToInt(sl.Strings[17]);			CastTime2 := StrToInt(sl.Strings[18]);			CastTime3 := StrToInt(sl.Strings[19]);			Range := StrToInt(sl.Strings[20]);			Element := StrToInt(sl.Strings[21]);			for i := 0 to 9 do				Data1[i+1] := StrToInt(sl.Strings[22+i]);			for i := 0 to 9 do      Data2[i+1] := StrToInt(sl.Strings[32+i]);			Range2 := StrToInt(sl.Strings[42]);			Icon := StrToInt(sl.Strings[43]);			wj := StrToInt64(sl.Strings[44]);{廋惓}			for i := 0 to 23 do begin				Job[i] := boolean((wj and (1 shl i)) <> 0);			end;{廋惓僐僐傑偱}			for i := 0 to 9 do begin				ReqSkill1[i] := StrToInt(sl.Strings[45+i*2]);				ReqLV1[i] := StrToInt(sl.Strings[46+i*2]);			end;      for i := 0 to 9 do begin				ReqSkill2[i] := StrToInt(sl.Strings[55+i*2]);				ReqLV2[i] := StrToInt(sl.Strings[56+i*2]);			end;		end;		SkillDB.AddObject(tl.ID, tl);	end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d skill(s) database loaded.', [SkillDB.Count]));	Application.ProcessMessages;	//宱尡抣僥乕僽儖撉傒崬傒{僊儖僪婡擻捛壛}	//僊儖僪僗僉儖僨乕僞儀乕僗撉傒崬傒	DebugOut.Lines.Add('Guild Skill database loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\skill_guild_db.txt');	Reset(txt);	Readln(txt, str);	while not eof(txt) do begin		sl.Clear;		Readln(txt, str);		sl.DelimitedText := str;		for i := sl.Count to 74 do			sl.Add('0');		for i := 0 to 74 do			if (i <> 1) and (i <> 2) and (sl.Strings[i] = '') then sl.Strings[i] := '0';		tl := TSkillDB.Create;		with tl do begin			ID := StrToInt(sl.Strings[0]);			IDC := sl.Strings[1];			Name := sl.Strings[2];			SType := StrToInt(sl.Strings[3]);			MasterLV := StrToInt(sl.Strings[4]);			for i := 0 to 9 do				SP[i+1] := StrToInt(sl.Strings[5+i]);			HP := StrToInt(sl.Strings[15]);			UseItem := StrToInt(sl.Strings[16]);			CastTime1 := StrToInt(sl.Strings[17]);			CastTime2 := StrToInt(sl.Strings[18]);			CastTime3 := StrToInt(sl.Strings[19]);			Range := StrToInt(sl.Strings[20]);			Element := StrToInt(sl.Strings[21]);			for i := 0 to 9 do				Data1[i+1] := StrToInt(sl.Strings[22+i]);			for i := 0 to 9 do				Data2[i+1] := StrToInt(sl.Strings[32+i]);			Range2 := StrToInt(sl.Strings[42]);			Icon := StrToInt(sl.Strings[43]);			wj := StrToInt64(sl.Strings[44]);			for i := 0 to 20 do begin				Job[i] := boolean((wj and (1 shl i)) <> 0);			end;			for i := 0 to 9 do begin				ReqSkill1[i] := StrToInt(sl.Strings[45+i*2]);				ReqLV1[i] := StrToInt(sl.Strings[46+i*2]);			end;      for i := 0 to 9 do begin				ReqSkill2[i] := StrToInt(sl.Strings[55+i*2]);				ReqLV2[i] := StrToInt(sl.Strings[56+i*2]);			end;		end;		GSkillDB.AddObject(tl.ID, tl);	end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d guild skill(s) database loaded.', [GSkillDB.Count]));	Application.ProcessMessages;  DebugOut.Lines.Add('Slave Summon Mobs List loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\summon_slave.txt');	Reset(txt);  Readln(txt, str);		while not eof(txt) do begin		sl.Clear;		Readln(txt, str);		sl.DelimitedText := str;		//for i := sl.Count to 6 do			//sl.Add('0');		//for i := 0 to 6 do			//if (i <> 0) and (sl.Strings[i] = '') then sl.Strings[i] := '0';    if (sl.Count = 7) then begin		tss := TSlaveDB.Create;		with tss do begin			Name := sl.Strings[0];      Slaves[0] := MobDBName.IndexOf(sl.Strings[1]);      Slaves[1] := MobDBName.IndexOf(sl.Strings[2]);      Slaves[2] := MobDBName.IndexOf(sl.Strings[3]);      Slaves[3] := MobDBName.IndexOf(sl.Strings[4]);      Slaves[4] := MobDBName.IndexOf(sl.Strings[5]);      TotalSlaves := StrToInt(sl.Strings[6]);    end;		SlaveDBName.AddObject(tss.Name,tss);    end;    end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d Slave Summon Mobs List loaded.', [j]));	Application.ProcessMessages;  DebugOut.Lines.Add('Make Arrow List loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\make_arrow.txt');	Reset(txt);  Readln(txt, str);		while not eof(txt) do begin		sl.Clear;		Readln(txt, str);		sl.DelimitedText := str;    for i := sl.Count to 7 do			sl.Add('0');		for i := 0 to 7 do			if (i <> 1) and (i <> 2) and (sl.Strings[i] = '') then sl.Strings[i] := '0';		ma := TMArrowDB.Create;		with ma do begin			ID := StrToInt(sl.Strings[0]);      if (sl.Strings[1] <> '') then CID[0] := StrToInt(sl.Strings[1]);      if (sl.Strings[2] <> '') then CNum[0] := StrToInt(sl.Strings[2]);      if (sl.Strings[3] <> '') then CID[1] := StrToInt(sl.Strings[3]);      if (sl.Strings[4] <> '') then CNum[1] := StrToInt(sl.Strings[4]);      if (sl.Strings[5] <> '') then CID[2] := StrToInt(sl.Strings[5]);      if (sl.Strings[6] <> '') then CNum[2] := StrToInt(sl.Strings[6]);    end;		MArrowDB.AddObject(ma.ID,ma);    end;	CloseFile(txt);	DebugOut.Lines.Add(Format('-> Total %d Make Arrow List loaded.', [j]));	Application.ProcessMessages;  DebugOut.Lines.Add('ID Table List loading...');	Application.ProcessMessages;	AssignFile(txt, AppPath + 'database\id_table.txt');	Reset(txt);  Readln(txt, str);		while not eof(txt) do begin		sl.Clear;		Readln(txt, str);		sl.DelimitedText := str;    for i := sl.Count to 16 do			sl.Add('0');		for i := 0 to 16 do			if (i <> 1) and (i <> 2) and (sl.Strings[i] = '') then sl.Strings[i] := '0';

⌨️ 快捷键说明

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