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

📄 game.pas

📁 仙境传说(RO)私人服务器端源代码。第一次上传。
💻 PAS
📖 第 1 页 / 共 5 页
字号:
					if (tc.Item[i].ID <> 0) and (tc.Item[i].Equip = 32768) then begin						j := i;						break;					end;				end;				WFIFOW(0, $013c);				WFIFOW(2, j);				Socket.SendBuf(buf, 4);				//僇乕僩僨乕僞憲怣{捛壛}	SendCart(tc);				tc.HPTick := timeGetTime();				tc.SPTick := timeGetTime();				tc.HPRTick := timeGetTime() - 500;				tc.SPRTick := timeGetTime();				tc.Sit := 3;				tc.AMode := 0;				tc.DmgTick := 0;				tc.Login := 2;{僷乕僥傿乕婡擻捛壛}				SendPartyList(tc);{僷乕僥傿乕婡擻僐僐傑偱}{僉儏乕儁僢僩}                                j := 0;                                for i := 1 to 100 do begin                                        if ( tc.Item[i].ID <> 0 ) and ( tc.Item[i].Amount > 0 ) and                                        ( tc.Item[i].Card[0] = $FF00 ) and ( tc.Item[i].Attr <> 0 ) then begin                                                j := i;                                                break;                                        end;                                end;                                if j > 0 then begin                                        i := PetList.IndexOf( tc.Item[j].Card[2] + tc.Item[j].Card[3] * $10000 );                                        if i <> -1 then begin                                                tpe := PetList.Objects[i] as TPet;                                                tn := TNPC.Create;                                                tn.ID := NowNPCID;                                                Inc(NowNPCID);                                                tn.Name := tpe.Name;                                                tn.JID := tpe.JID;                                                tn.Map := tc.Map;                                                repeat                                                        tn.Point.X := tc.Point.X + Random(5) - 2;                                                        tn.Point.Y := tc.Point.Y + Random(5) - 2;                                                until ( tn.Point.X <> tc.Point.X ) or ( tn.Point.Y <> tc.Point.Y );                                                tn.Dir := Random(8);                                                tn.CType := 2;                                                tn.HungryTick := timeGettime();                                                tm.NPC.AddObject(tn.ID, tn);                                                tm.Block[tn.Point.X div 8][tn.Point.Y div 8].NPC.AddObject(tn.ID, tn);                                                SendNData(tc.Socket, tn, tc.ver2 );                                                SendBCmd(tm, tn.Point, 41, tc, False);                                                tc.PetData := tpe;                                                tc.PetNPC := tn;                                                WFIFOW( 0, $01a4 );                                                WFIFOB( 2, 0 );                                                WFIFOL( 3, tn.ID );                                                WFIFOL( 7, 0 );                                                Socket.SendBuf( buf, 11 );                                                if tpe.Accessory <> 0 then begin                                                        WFIFOB( 2, 3 );                                                        WFIFOL( 7, tpe.Accessory );                                                        Socket.SendBuf( buf, 11 );                                                end;                                                WFIFOB( 2, 5 );                                                WFIFOL( 7, 20 ); // 撲                                                Socket.SendBuf( buf, 11 );                                                WFIFOW( 0, $01a2 );                                                WFIFOS( 2, tpe.Name, 24 );                                                WFIFOB( 26, tpe.Renamed );                                                WFIFOW( 27, tpe.LV );                                                WFIFOW( 29, tpe.Fullness );                                                WFIFOW( 31, tpe.Relation );                                                WFIFOW( 33, tpe.Accessory );                                                Socket.SendBuf( buf, 35 );                                        end;                                end;{僉儏乕儁僢僩偙偙傑偱}{僊儖僪婡擻捛壛}				j := GuildList.IndexOf(tc.GuildID);				if (j <> -1) then begin					tg := GuildList.Objects[j] as TGuild;					//崘抦憲怣					WFIFOW( 0, $016f);					WFIFOS( 2, tg.Notice[0], 60);					WFIFOS(62, tg.Notice[1], 120);					Socket.SendBuf(buf, 182);				end;                    if (mi.Pvp = true) then begin              for j := 0 to tm.CList.Count - 1 do begin
              tc1 := tm.CList.Objects[j] as TChara;
              WFIFOW( 0, $0199);
							WFIFOW( 2, 1);
							tc1.Socket.SendBuf(buf, 4);
              k := j + 1;
              i := tm.CList.Count;
              WFIFOW( 0, $019a);
              WFIFOL( 2, tc1.ID);
              WFIFOL( 6, k);
              WFIFOL( 10, i);
              tc1.Socket.SendBuf(buf, 14);
              end;
          end;

          if (mi.PvPG = true) then begin
              for j := 0 to tm.CList.Count - 1 do begin
              tc1 := tm.CList.Objects[j] as TChara;
              WFIFOW( 0, $0199);
							WFIFOW( 2, 1);
							tc1.Socket.SendBuf(buf, 4);
              end;
          end;
{僊儖僪婡擻捛壛僐僐傑偱}			end;		//--------------------------------------------------------------------------		$007e: //tick			begin				WFIFOW(0, $007f);				WFIFOL(2, timeGetTime());				Socket.SendBuf(buf, 6);			end;		//--------------------------------------------------------------------------		$0085: //堏摦梫媮 (嵗偭偰傞偲偒傗僠儍僢僩側偳偱偼堏摦偱偒側偄傛偆偵偡傞偙偲)			begin{僠儍僢僩儖乕儉婡擻捛壛}        if tc.Sit = 1 then continue;				if tc.ChatRoomID <> 0 then continue; //僠儍僢僩拞偺堏摦嬛巭{僠儍僢僩儖乕儉婡擻捛壛僐僐傑偱}{業揦僗僉儖捛壛}				if tc.VenderID <> 0 then continue; //業揦拞偺堏摦嬛巭{業揦僗僉儖捛壛僐僐傑偱}				RFIFOM1(2, xy);				tc.NextFlag := true;				tc.NextPoint := xy;{僷乕僥傿乕婡擻捛壛}				//摨堦儅僢僾撪PTM偵強嵼傪抦傜偣傞				if tc.PartyName <> '' then begin					WFIFOW( 0, $0107);					WFIFOL( 2, tc.ID);					WFIFOW( 6, tc.NextPoint.X);					WFIFOW( 8, tc.NextPoint.Y);					SendPCmd(tc,10,true,true);				end;{僷乕僥傿乕婡擻捛壛僐僐傑偱}			end;		//--------------------------------------------------------------------------		$0089: //峌寕丄嵗傝			begin        //DebugOut.Lines.Add(IntToStr(tc.ID));        //DebugOut.Lines.Add(IntToStr(tc.AMode));				if tc.AMode > 2 then continue;				if (tc.MMode <> 0) then continue;				RFIFOB(6, b);				//DebugOut.Lines.Add('Inside Attack Command');				if (b = 0) or (b = 7) then begin        //DebugOut.Lines.Add(IntToStr(b));					//峌寕					RFIFOL(2, l);					tm := tc.MData;          //DebugOut.Lines.Add(IntToStr(l));//////////////////////////////////////////////////////////////////////																				//儌儞僗僞乕宆NPC乮峌寕偟傛偆偲偡傞偲奐巒乯if tm.NPC.IndexOf(l) <> -1 then begintn := tm.NPC.IndexOfObject(l) as TNPC;									//嫍棧僠僃僢僋if (tc.Map <> tn.Map) or (abs(tc.Point.X - tn.Point.X) > 15) or (abs(tc.Point.Y - tn.Point.Y) > 15) then begincontinue;end;					        case tn.CType of					        1:	//shop				        		begin				        			WFIFOW(0, $00c4);				        			WFIFOL(2, l);											Socket.SendBuf(buf, 6);				        		end;				        	2:	//script				        		begin				        			tc.TalkNPCID := tn.ID;					        		tc.ScriptStep := 0;						        	tc.AMode := 3;							//僆僾僔儑儞弶婜壔							if (tc.Option <> 0) then begin								tc.Option := 0;								//尒偨栚曄峏								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);							end;							        tc.AData := tn;					        		NPCScript(tc);					        	end;					        end;			        	end;                                        //儌儞僗僞乕宆NPC丂偙偙傑偱//////////////////////////////////////////////////////////////////////					if tm.Mob.IndexOf(l) <> -1 then begin						//懳儌儞僗僞乕						ts := tm.Mob.IndexOfObject(l) as TMob;						if tc.pcnt <> 0 then xy := tc.tgtPoint else xy := tc.Point;						if (abs(xy.X - ts.Point.X) > tc.Range) or (abs(xy.Y - ts.Point.Y) > tc.Range) then begin							//嫍棧偑墦偡偓傞							WFIFOW( 0, $0139);							WFIFOL( 2, ts.ID);							WFIFOW( 6, ts.Point.X);							WFIFOW( 8, ts.Point.Y);							WFIFOW(10, tc.Point.X);							WFIFOW(12, tc.Point.Y);							WFIFOW(14, tc.Range); //幩掱							Socket.SendBuf(buf, 16);						end else begin							//峌寕壜擻							if b = 7 then tc.AMode := 2 else tc.AMode := 1;							tc.ATarget := ts.ID;							tc.AData := ts;							if tc.ATick + tc.ADelay - 200 < timeGetTime() then								tc.ATick := timeGetTime() - tc.ADelay + 200;						end;					end else begin                                            //儌儞僗僞乕偱側偄          end;          if tm.CList.IndexOf(l) <> -1 then begin						tc1 := tm.CList.IndexOfObject(l) as TChara;						if tc.pcnt <> 0 then xy := tc.tgtPoint else xy := tc.Point;						if (abs(xy.X - tc1.Point.X) > tc.Range) or (abs(xy.Y - tc1.Point.Y) > tc.Range) then begin							//嫍棧偑墦偡偓傞							WFIFOW( 0, $0139);							WFIFOL( 2, tc1.ID);							WFIFOW( 6, tc1.Point.X);							WFIFOW( 8, tc1.Point.Y);							WFIFOW(10, tc.Point.X);							WFIFOW(12, tc.Point.Y);							WFIFOW(14, tc.Range); //幩掱							Socket.SendBuf(buf, 16);						end else begin							//峌寕壜擻							if b = 7 then tc.AMode := 2 else tc.AMode := 1;							tc.ATarget := tc1.ID;							tc.AData := tc1;							if tc.ATick + tc.ADelay - 200 < timeGetTime() then								tc.ATick := timeGetTime() - tc.ADelay + 200;						end;           end;				end else if (b = 2) or (b = 3) then begin        if (tc.Skill[1].Lv >= 3) then begin					//嵗傝					tc.Sit := b;					tm := tc.MData;					WFIFOW(0, $008a);					WFIFOL(2, tc.ID);					WFIFOB(26, b);					SendBCmd(tm, tc.Point, 29);        end;				end;			end;		//--------------------------------------------------------------------------		$008c: //偟傖傋傞			begin        tm := tc.MData;        h := IDTableDB.IndexOf(tc.ID);				RFIFOW(2, w);				str := RFIFOS(4, w - 4);{Edit - Miyuki}       if (h <> - 1) and (Pos(' : ', str) <> 0) and (Copy(str, Pos(' : ', str) + 3, 1) = '#') then begin					str := Copy(str, Pos(' : ', str) + 4, 256);					//#偱巒傑傞僐儅儞僪(庡偵偱偽偖梡)          tid := IDTableDB.Objects[h] as TIDTbl;					if (Copy(str, 1, 4) = 'save') and ((DebugCMD and $0001) <> 0) and (tid.SaveReturn = 1) then begin						//尰嵼抧傪僙乕僽偡傞						tc.SaveMap := tc.Map;						tc.SavePoint.X := tc.Point.X;						tc.SavePoint.Y := tc.Point.Y;					end else if (Copy(str, 1, 6) = 'return') and ((DebugCMD and $0002) <> 0) and (tid.SaveReturn = 1) then begin						//僙乕僽億僀儞僩傑偱栠傞						SendCLeave(Socket.Data, 2);						tc.Map := tc.SaveMap;						tc.Point := tc.SavePoint;						MapMove(Socket, tc.Map, tc.Point);					end else if (Copy(str, 1, 7) = 'blevel ') and ((DebugCMD and $0008) <> 0) and (tid.ChangeLevel = 1) then begin						Val(Copy(str, 8, 256), i, k);						if (k = 0) and (i >= 1) and (i <= 999) and (i <> tc.BaseLV) then begin              //if (i >= 100) and (tc.ParamBase[2] >= 111) then begin              //tc.ParamBase[2] := 110;              //end;              if tc.BaseLV > i then begin							tc.BaseLV := i;              for i := 0 to 5 do begin						  tc.ParamBase[i] := 1;					    end;					    tc.StatusPoint := 48;					    for i := 1 to tc.BaseLV - 1 do begin						  tc.StatusPoint := tc.StatusPoint + i div 5 + 3;				      end;              end else begin              w3 := tc.BaseLV;              tc.BaseLV := i;					    for i := w3 to tc.BaseLV - 1 do begin						  tc.StatusPoint := tc.StatusPoint + i div 5 + 3;				      end;              end;              tc.BaseEXP := tc.BaseNextEXP - 1;              tc.BaseNextEXP := ExpTable[0][tc.BaseLV];              CalcStat(tc);              SendCStat(tc);              SendCStat1(tc, 0, $000b, tc.BaseLV);              SendCStat1(tc, 0, $0009, tc.StatusPoint);              SendCStat1(tc, 1, $0001, tc.BaseEXP);						end;            end else if (Copy(str, 1, 7) = 'jlevel ') and ((DebugCMD and $0008) <> 0) and (tid.ChangeLevel = 1) then begin						//僗僺乕僪曄峏						Val(Copy(str, 8, 256), i, k);						if (k = 0) and (i >= 1) and (i <= 999) then begin							tc.JobLV := i;              for i := 2 to 330 do begin              if not tc.Skill[i].Card then							tc.Skill[i].Lv := 0;					    end;					    if tc.JID = 0 then begin					    end else if tc.JID < 7 then tc.SkillPoint := tc.JobLV -1					    else tc.SkillPoint := tc.JobLV -1 + 49;              SendCSkillList(tc);              tc.JobEXP := tc.JobNextEXP - 1;              if tc.JID < 13 then begin				      j := (tc.JID + 5) div 6 + 1;			        end else begin				      j := 3;			        end;              tc.JobNextEXP := ExpTable[j][tc.JobLV];              CalcStat(tc);              SendCStat(tc);              SendCStat1(tc, 0, $0037, tc.JobLV);              SendCStat1(tc, 0, $000c, tc.SkillPoint);              SendCStat1(tc, 1, $0002, tc.JobEXP);						end;					end else if (Copy(str, 1, 5) = 'warp ') and ((DebugCMD and $0004) <> 0) and (tid.Warp = 1) then begin						//擟堄偺応強偵儚乕僾						sl := TStringList.Create;						sl.DelimitedText := Copy(str, 6, 256);						try							if sl.Count <> 3 then continue;							Val(sl.Strings[1], i, k);							if k <> 0 then continue;							Val(sl.Strings[2], j, k);							if k <> 0 then continue;							//儅僢僾懚嵼僠僃僢僋							if MapList.IndexOf(sl.Strings[0]) = -1 then continue;							//嵗昗僠僃僢僋							ta := MapList.Objects[MapList.IndexOf(sl.Strings[0])] as TMapList;							if (i < 0) or (i >= ta.Size.X) or (j < 0) or (j >= ta.Size.Y) then continue;							//儚乕僾奐巒							if (tc.Hidden = false) then SendCLeave(tc, 2);							tc.tmpMap := sl.Strings[0];							tc.Point := Point(i,j);							MapMove(Socket, sl.Strings[0], Point(i,j));						finally							sl.Free();						end;

⌨️ 快捷键说明

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