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

📄 script.pas

📁 仙境传说(RO)私人服务器端源代码。第一次上传。
💻 PAS
📖 第 1 页 / 共 4 页
字号:
{NPC僀儀儞僩捛壛僐僐傑偱}						i := ConvFlagValue(tc, str);					end;					j := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[1]);{NPC僀儀儞僩捛壛僐僐傑偱}					case tn.Script[tc.ScriptStep].Data3[2] of					0: flag := boolean(i >= j);					1: flag := boolean(i <= j);					2: flag := boolean(i  = j);					3: flag := boolean(i <> j);					4: flag := boolean(i >  j);					5: flag := boolean(i <  j);					else						begin							DebugOut.Lines.Add(Format('s-check: invalid formula "%s"', [tn.Script[tc.ScriptStep].Data1[2]]));							tc.ScriptStep := $FFFF;							break;						end;					end;					DebugOut.Lines.Add(Format('s-check: %s %s(%d) %s = %d', [tn.Script[tc.ScriptStep].Data1[0], tn.Script[tc.ScriptStep].Data1[2], tn.Script[tc.ScriptStep].Data3[2], tn.Script[tc.ScriptStep].Data1[1], byte(flag)]));					if flag then begin						tc.ScriptStep := tn.Script[tc.ScriptStep].Data3[0];					end else begin						tc.ScriptStep := tn.Script[tc.ScriptStep].Data3[1];					end;				end;			16: //checkadditem				begin{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);					j := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[1]);{NPC僀儀儞僩捛壛僐僐傑偱}					td := ItemDB.IndexOfObject(i) as TItemDB;					if tc.MaxWeight >= tc.Weight + cardinal(td.Weight) * cardinal(j) then begin						k := SearchCInventory(tc, i, td.IEquip);						if k <> 0 then begin							tc.ScriptStep := tn.Script[tc.ScriptStep].Data3[0];						end else begin							//傾僀僥儉庬椶悢僆乕僶乕							tc.ScriptStep := tn.Script[tc.ScriptStep].Data3[1];						end;					end else begin						//廳検僆乕僶乕						tc.ScriptStep := tn.Script[tc.ScriptStep].Data3[1];					end;				end;			17: //jobchange				begin                                   {僶僌曬崘657}                                        //憰旛夝彍					for i := 1 to 100 do begin					        if tc.Item[i].Equip = 32768 then                                                begin					                tc.Item[i].Equip := 0;					                WFIFOW(0, $013c);				                	WFIFOW(2, 0);					                tc.Socket.SendBuf(buf, 4);					        end else                                                if tc.Item[i].Equip <> 0 then                                                begin					                WFIFOW(0, $00ac);					                WFIFOW(2, i);					                WFIFOW(4, tc.Item[i].Equip);					                tc.Item[i].Equip := 0;					                WFIFOB(6, 1);					                tc.Socket.SendBuf(buf, 7);					        end;					end;                                        //僕儑僽曄峏					tc.JID := tn.Script[tc.ScriptStep].Data3[0];					tc.JobEXP := 0;					tc.ClothesColor := 0;					tc.JobLV := 1;					SendCStat1(tc, 0, $0037, tc.JobLV);					CalcStat(tc);					tc.SkillPoint := 0;                                        //僗僥乕僞僗嵞寁嶼					CalcStat(tc);					SendCStat(tc, true);					SendCSkillList(tc);					WFIFOW(0, $00c3);					WFIFOL(2, tc.ID);					WFIFOB(6, 0);					WFIFOB(7, tc.JID);					SendBCmd(tc.MData, tc.Point, 8); //偙偙傑偱                                   {僶僌曬崘 657}					Inc(tc.ScriptStep);				end;			18: //viewpoint				begin					WFIFOW( 0, $0144);					WFIFOL( 2, tn.ID);					WFIFOL( 6, tn.Script[tc.ScriptStep].Data3[0]);					WFIFOL(10, tn.Script[tc.ScriptStep].Data3[1]);					WFIFOL(14, tn.Script[tc.ScriptStep].Data3[2]);					WFIFOB(18, tn.Script[tc.ScriptStep].Data3[3]);					WFIFOL(19, tn.Script[tc.ScriptStep].Data3[4]);					tc.Socket.SendBuf(buf, 23);					Inc(tc.ScriptStep);				end;			19: //input				begin					if value = 0 then begin						WFIFOW( 0, $0142);						WFIFOL( 2, tn.ID);						tc.Socket.SendBuf(buf, 6);						break;					end else begin						//僼儔僌僙僢僩{NPC僀儀儞僩捛壛}						if (Copy(tn.Script[tc.ScriptStep].Data1[0], 1, 1) <> '\') then begin							tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[0]] := IntToStr(value - 1);						end else begin							ServerFlag.Values[tn.Script[tc.ScriptStep].Data1[0]] := IntToStr(value - 1);						end;{NPC僀儀儞僩捛壛僐僐傑偱}						Inc(tc.ScriptStep);					end;				end;			20: //random				begin{NPC僀儀儞僩捛壛}					if (Copy(tn.Script[tc.ScriptStep].Data1[0], 1, 1) <> '\') then begin						tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[0]] := IntToStr(Random(tn.Script[tc.ScriptStep].Data3[0]));					end else begin						ServerFlag.Values[tn.Script[tc.ScriptStep].Data1[0]] := IntToStr(Random(tn.Script[tc.ScriptStep].Data3[0]));					end;{NPC僀儀儞僩捛壛僐僐傑偱}					Inc(tc.ScriptStep);				end;			21: //option				begin					if tn.Script[tc.ScriptStep].Data3[1] = 1 then begin						case tn.Script[tc.ScriptStep].Data3[0] of						0:            begin            tc.Option := (tc.Option and $F877) or $0008;            SendCart(tc);            end; //僇乕僩1						1: tc.Option := tc.Option or $0010; //偨偐						2: tc.Option := tc.Option or $0020; //傌偙						3: tc.Option := (tc.Option and $F877) or $0008; //僇乕僩1						4: tc.Option := (tc.Option and $F877) or $0080; //僇乕僩2						5: tc.Option := (tc.Option and $F877) or $0100; //僇乕僩3						6: tc.Option := (tc.Option and $F877) or $0200; //僇乕僩4						7: tc.Option := (tc.Option and $F877) or $0400; //僇乕僩5    						end;					end else begin						case tn.Script[tc.ScriptStep].Data3[0] of						0: tc.Option := tc.Option and $F877; //僇乕僩慡夝彍  F847=慡夝彍						1: tc.Option := tc.Option and $FFEF; //偨偐						2: tc.Option := tc.Option and $FFDF; //傌偙						end;					end;					CalcStat(tc);					//尒偨栚曄峏					WFIFOW(0, $0119);					WFIFOL(2, tc.ID);					WFIFOW(6, 0);					WFIFOW(8, 0);					WFIFOW(10, tc.Option);					WFIFOB(12, 0);					SendBCmd(tc.MData, tc.Point, 13);					Inc(tc.ScriptStep);				end;			22: //speed				begin					//僷働憲怣{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0], true);{NPC僀儀儞僩捛壛僐僐傑偱}					//僗僺乕僪曄峏					if (i >= 25) and (i <= 1000) then begin						tc.Speed := i;						tc.DefaultSpeed := i; 						CalcStat(tc);						WFIFOW(0, $00b0);						WFIFOW(2, $0000);						WFIFOL(4, tc.Speed);						tc.Socket.SendBuf(buf, 8); 						Inc(tc.ScriptStep);					end;				end;			23: //die				begin					//僷働憲怣					//僾儗乕儎乕懄巰					CalcStat(tc);					tc.HP := 0;					tc.Sit := 1;					SendCStat1(tc, 0, 5, tc.HP);					WFIFOW(0, $0080);					WFIFOL(2, tc.ID);					WFIFOB(6, 1);					tc.Socket.SendBuf(buf, 7);					Inc(tc.ScriptStep);				end;			24: //ccolor				begin					//僷働憲怣{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0], true);{NPC僀儀儞僩捛壛僐僐傑偱}					//怓曄峏					if (i >= 1) and (i <= 78) then begin						CalcStat(tc);						tc.ClothesColor := i - 1;						WFIFOW(0, $00c3);						WFIFOL(2, tc.ID);						WFIFOB(6, 7);						WFIFOB(7, i-1);						tc.Socket.SendBuf(buf, 8);						SendBCmd(tc.MData, tc.Point, 8, tc);					end;					Inc(tc.ScriptStep);				end;			25: //refine		refine[itemID][fail][+val]				begin{NPC僀儀儞僩捛壛}					j := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);					k := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[1]);					l := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[2]);{NPC僀儀儞僩捛壛僐僐傑偱}					//惛楤					if (j >= 0) and (j <= 10) then begin						for i := 1 to 100 do begin							if (tc.Item[i].ID <> 0) and (tc.Item[i].Amount <> 0) and tc.Item[i].Data.IEquip and								 (tc.Item[i].Equip <> 0) and (tc.Item[i].Card[0] <> $00ff) then begin								tc.Item[i].Refine := byte(l);								WFIFOW(0, $0188);								WFIFOW(2, k);								WFIFOW(4, i);								WFIFOW(6, word(l));								tc.Socket.SendBuf(buf, 8);							end;						end;						CalcStat(tc);						WFIFOW(0, $019b);						WFIFOL(2, tc.ID);						WFIFOL(6, 3);						//僷働憲怣						SendBCmd(tc.MData, tc.Point, 10, tc);						SendCStat(tc);					end;					Inc(tc.ScriptStep);				end;			26: //getitemamount				begin{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);{NPC僀儀儞僩捛壛僐僐傑偱}					k := SearchCInventory(tc, i, false);					if k <> 0 then begin						tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[1]] := IntToStr(tc.Item[k].Amount);					end else begin						tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[1]] := '0';					end;					Inc(tc.ScriptStep);				end;{捛壛:僗僋儕僾僩144}			27: //getskilllevel //S144 addstart				begin{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);					if (Copy(tn.Script[tc.ScriptStep].Data1[0], 1, 1) <> '\') then begin						if i = 0 then begin							tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[0]] := '0';						end else begin							tc.Flag.Values[tn.Script[tc.ScriptStep].Data1[1]] := IntToStr(tc.Skill[i].Lv);						end;					end else begin						if i = 0 then begin							ServerFlag.Values[tn.Script[tc.ScriptStep].Data1[0]] := '0';						end else begin							ServerFlag.Values[tn.Script[tc.ScriptStep].Data1[1]] := IntToStr(tc.Skill[i].Lv);						end;					end;{NPC僀儀儞僩捛壛僐僐傑偱}					Inc(tc.ScriptStep);				end;			28: //setskilllevel				begin{NPC僀儀儞僩捛壛}					i := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);					if i <> 0 then begin						l := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[1]);{NPC僀儀儞僩捛壛僐僐傑偱}						if ((0 <= l) and (l <= 10)) then tc.Skill[i].Lv := l;						SendCSKillList(tc);					end;					Inc(tc.ScriptStep);				end; //S144 addend{捛壛:僗僋儕僾僩144僐僐傑偱}{惛楤NPC婡擻捛壛}			29: //refinery				begin{NPC僀儀儞僩捛壛}					j := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[0]);					k := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[1]);{NPC僀儀儞僩捛壛僐僐傑偱}					case j of						1:  l := $100; //摢忋抜						2:  l := $10;  //奪						3:  l := $20;  //嵍庤						4:  l := $2;   //塃庤						5:  l := $4;   //尐						6:  l := $40;  //孋						7:  l := $8;   //傾僋僙1						8:  l := $80;  //傾僋僙2						9:  l := $200; //摢忋抜						10: l := $1;   //摢壓抜						else l := 0;					end;{NPC僀儀儞僩捛壛}					j := ConvFlagValue(tc, tn.Script[tc.ScriptStep].Data1[2]);{NPC僀儀儞僩捛壛僐僐傑偱}					if (j < 0) or (j > 10) then j := 0;					if l <> 0 then begin						for i := 1 to 100 do begin							if (tc.Item[i].ID <> 0) and (tc.Item[i].Amount <> 0) and tc.Item[i].Data.IEquip and								 ((tc.Item[i].Equip and l) = l) and (tc.Item[i].Refine < 10) then begin								//憰旛夝彍								WFIFOW(0, $00ac);								WFIFOW(2, i);								WFIFOW(4, tc.Item[i].Equip);								WFIFOB(6, 1);           			tc.Socket.SendBuf(buf, 7);								//惛楤惉岟								if k = 0 then begin									tc.Item[i].Refine := j;									//僄僼僃僋僩									WFIFOW(0, $0188);									WFIFOW(2, 0);									WFIFOW(4, i);									WFIFOW(6, tc.Item[i].Refine);									tc.Socket.SendBuf(buf, 8);									//嵞憰旛									WFIFOW(0, $00aa);									WFIFOW(2, i);									WFIFOW(4, tc.Item[i].Equip);									WFIFOB(6, 1);									tc.Socket.SendBuf(buf, 7);								//惛楤幐攕								end else begin									tc.Item[i].Refine := 0;									tc.Item[i].Equip := 0;									//僄僼僃僋僩									WFIFOW(0, $0188);									WFIFOW(2, 1);									WFIFOW(4, i);									WFIFOW(6, word(tc.Item[i].Refine));									tc.Socket.SendBuf(buf, 8);									if k = 1 then begin										//傾僀僥儉尭彮										Dec(tc.Item[i].Amount, 1);										if tc.Item[i].Amount = 0 then tc.Item[i].ID := 0;										WFIFOW( 0, $00af);										WFIFOW( 2, i);										WFIFOW( 4, 1);										tc.Socket.SendBuf(buf, 6);										//廳検曄峏										tc.Weight := tc.Weight - tc.Item[i].Data.Weight * cardinal(1);										WFIFOW( 0, $00b0);										WFIFOW( 2, $0018);										WFIFOL( 4, tc.Weight);										tc.Socket.SendBuf(buf, 8);									end;					  		end;						  end;						end; 						CalcStat(tc);						WFIFOW(0, $019b);						WFIFOL(2, tc.CID);            if k = 0 then WFIFOL(6, 3) else WFIFOL(6, 2);						//僷働憲怣						SendBCmd(tc.MData, tc.Point, 10, tc);						SendCStat(tc);					end;					Inc(tc.ScriptStep);				end;      30: //equipmenu  --->Thanks goes to Melz -- for fixing the translation!! <---				begin					if value = 0 then begin						tn.Script[tc.ScriptStep].Data2[0] := '[Head - Not Equipped]';						tn.Script[tc.ScriptStep].Data2[1] := '[Body - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[2] := '[Left Hand - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[3] := '[Right Hand - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[4] := '[Robe - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[5] := '[Foot - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[6] := '[Accesory1 - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[7] := '[Accesory2 - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[8] := '[Head2 - Not Equipped]';
						tn.Script[tc.ScriptStep].Data2[9] := '[Head3 - Not Equipped]';            for i := 1 to 100 do begin	  					if (tc.Item[i].ID <> 0) and (tc.Item[i].Amount <> 0) and (tc.Item[i].Equip <> 0) then begin                if tc.Item[i].Refine > 0 then str := '(+' + IntToStr(tc.Item[i].Refine) + ')'                  else str := '';                str := tc.Item[i].Data.JName + str;                case tc.Item[i].Equip of									$1: //摢壓抜										tn.Script[tc.ScriptStep].Data2[9] := str;									$2: //塃庤										tn.Script[tc.ScriptStep].Data2[3] := str;									$4: //尐										tn.Script[tc.ScriptStep].Data2[4] := str;									$8: //傾僋僙1

⌨️ 快捷键说明

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