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

📄 skills.pas

📁 RO模拟器!!适合玩仙境传说的玩家们呦~
💻 PAS
📖 第 1 页 / 共 3 页
字号:
									with tm.Block[xy.X div 8][xy.Y div 8].Mob do begin
										assert(IndexOf(ts.ID) <> -1, 'MobBlockDelete Error');
										Delete(IndexOf(ts.ID));
									end;
									tm.Block[ts.Point.X div 8][ts.Point.Y div 8].Mob.AddObject(ts.ID, ts);
								end;
								ts.pcnt := 0;

								//Update Coordinates of Monster
								UpdateMonsterLocation(tm, ts);
							end;

							if not frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick) then
								frmMain.StatCalc1(tc, ts, Tick);

						end else begin
							SendSkillError(tc, 6);
							MMode := 4;
							Exit;
						end;
					end;

				59: {Spear_Boomerang}
					begin
						if (tc.Weapon = 4) or (tc.Weapon = 5) then begin
							frmMain.DamageCalc1(tm, tc, ts, Tick, 0, tl.Data1[MUseLV], tl.Element, tl.Data1[MUseLV]);
							if dmg[0] < 0 then dmg[0] := 0; //懏惈峌寕偱偺夞暅偼枹幚憰
							//僷働憲怣
							SendCSkillAtk1(tm, tc, ts, Tick, dmg[0], 1, 6);
							if not frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick) then
								frmMain.StatCalc1(tc, ts, Tick);
							tc.MTick := Tick + 1000
						end else begin
							SendSkillError(tc, 6);
							MMode := 4;
							Exit;
						end;
					end;

				KN_BOWLINGBASH: {Bowling_Bash - 62}
					begin
						//偲偽偡曽岦寛掕張棟
						//FW偐傜偺僷僋儕
						xy.X := ts.Point.X - Point.X;
						xy.Y := ts.Point.Y - Point.Y;
						if abs(xy.X) > abs(xy.Y) * 3 then begin
							//墶岦偒
							if xy.X > 0 then b := 6 else b := 2;
						end else if abs(xy.Y) > abs(xy.X) * 3 then begin
							//廲岦偒
							if xy.Y > 0 then b := 0 else b := 4;
						end else begin
							if xy.X > 0 then begin
								if xy.Y > 0 then b := 7 else b := 5;
							end else begin
								if xy.Y > 0 then b := 1 else b := 3;
							end;
						end;

						//抏偒旘偽偡懳徾偵懳偡傞僟儊乕僕偺寁嶼
						frmMain.DamageCalc1(tm, tc, ts, Tick, 0, tl.Data1[MUseLV], tl.Element, tl.Data1[MUseLV]);
						if dmg[0] < 0 then dmg[0] := 0; //懏惈峌寕偱偺夞暅偼枹幚憰
						//僷働憲怣
						SendCSkillAtk1(tm, tc, ts, Tick, dmg[0], 1, 6);

						//僲僢僋僶僢僋張棟
						if (dmg[0] > 0) then begin
							SetLength(bb, 3);
							bb[0] := 4;
							xy := ts.Point;
							DirMove(tm, ts.Point, b, bb);
							//僽儘僢僋堏摦
							if (xy.X div 8 <> ts.Point.X div 8) or (xy.Y div 8 <> ts.Point.Y div 8) then begin
								with tm.Block[xy.X div 8][xy.Y div 8].Mob do begin
									assert(IndexOf(ts.ID) <> -1, 'MobBlockDelete Error');
									Delete(IndexOf(ts.ID));
								end;
								tm.Block[ts.Point.X div 8][ts.Point.Y div 8].Mob.AddObject(ts.ID, ts);
							end;
							ts.pcnt := 0;

							UpdateMonsterLocation(tm, ts);

							xy := ts.Point;
							//姫偒偙傒斖埻峌寕
							sl.Clear;
							for j1 := (xy.Y - tl.Range2) div 8 to (xy.Y + tl.Range2) div 8 do begin
								for i1 := (xy.X - tl.Range2) div 8 to (xy.X + tl.Range2) div 8 do begin
									for k1 := 0 to tm.Block[i1][j1].Mob.Count - 1 do begin
										if ((tm.Block[i1][j1].Mob.Objects[k1] is TMob) = false) then Continue;
										ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
										//NotTargetMonster
										//NotYourGuildMonster
										if (ts = ts1) or ((tc.GuildID <> 0) and (ts1.isGuardian = tc.GuildID)) or ((tc.GuildID <> 0) and (ts1.GID = tc.GuildID)) then Continue;
										if (abs(ts1.Point.X - xy.X) <= tl.Range2) and (abs(ts1.Point.Y - xy.Y) <= tl.Range2) then
											sl.AddObject(IntToStr(ts1.ID),ts1);
									end;
								end;
							end;
							if sl.Count <> 0 then begin
								for k1 := 0 to sl.Count - 1 do begin
									ts1 := sl.Objects[k1] as TMob;
									frmMain.DamageCalc1(tm, tc, ts1, Tick, 0, tl.Data1[MUseLV], tl.Element, tl.Data2[MUseLV]);
									if dmg[0] < 0 then dmg[0] := 0; //懏惈峌寕偱偺夞暅偼枹幚憰
									//僷働憲怣
									SendCSkillAtk1(tm, tc, ts1, Tick, dmg[0], 1, 5);
									//僟儊乕僕張棟
									if not frmMain.DamageProcess1(tm, tc, ts1, dmg[0], Tick) then
      							frmMain.StatCalc1(tc, ts1, Tick);
								end;
							end;
						end;
						if not frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick) then begin
							frmMain.StatCalc1(tc, ts, Tick);
						end;

					end;
          {Knight skills player vs monster end}

          {Priest skills player vs monster begin}

          72: // Status Recovery vs. Mob (undead)
					begin
						ts.ATarget := 0;
						if ts.Element mod 20 = 9 then begin
							//僷働憲怣
							WFIFOW( 0, $011a);
							WFIFOW( 2, MSkill);
							WFIFOW( 4, MUseLV);
							WFIFOL( 6, MTarget);
							WFIFOL(10, ID);
							WFIFOB(14, 1);
							SendBCmd(tm, ts.Point, 15);
							//懳傾儞僨僢僪
							if Boolean((1 shl 4) and ts.Stat2) then begin
								ts.HealthTick[4] := ts.HealthTick[4] + 30000; //墑挿
							end else begin
								ts.HealthTick[4] := Tick + tc.aMotion;
							end;
						end;
					end;
				76: // Lex Divina vs. Mob
					begin
						//僷働憲怣
						WFIFOW( 0, $011a);
						WFIFOW( 2, MSkill);
						WFIFOW( 4, MUseLV);
						WFIFOL( 6, MTarget);
						WFIFOL(10, ID);
						WFIFOB(14, 1);
						SendBCmd(tm, ts.Point, 15);
						//懳傾儞僨僢僪
						if Boolean((1 shl 2) and ts.Stat2) then begin
							ts.HealthTick[2] := ts.HealthTick[2] + 30000; //墑挿
						end else begin
							ts.HealthTick[2] := Tick + tc.aMotion;
						end;
					end;

				77: // Turn Undead Damage vs. Mob
					begin
						if (ts.Data.Race = 1) or (ts.Element mod 20 = 9) then begin
							m := MUseLV * 20 + Param[3] + Param[5] + BaseLV + (200 - 200 * Cardinal(ts.HP) div ts.Data.HP) div 200;
							if (Random(1000) < m) and (ts.Data.MEXP = 0) then begin
								dmg[0] := ts.HP;
							end else begin
								dmg[0] := (BaseLV + Param[3] + (MUseLV * 10)) * ElementTable[6][ts.Element] div 100;
								if dmg[0] < 0 then dmg[0] := 0; //杺朄峌寕偱偺夞暅偼枹幚憰
							end;
							//懳傾儞僨僢僪
							//if (dmg[0] div $010000) <> 0 then dmg[0] := $07FFF; //曐尟
							// Lex Aeterna effect
							if (ts.EffectTick[0] > Tick) then dmg[0] := dmg[0] * 2;
							SendCSkillAtk1(tm, tc, ts, Tick, dmg[0], 1);
							frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick);
							tc.MTick := Tick + 3000;
						end else begin
							tc.MMode := 4;
							Exit;
						end;
					end;

				78: // Lex Aeterna
					begin
						//僷働憲怣
						WFIFOW( 0, $011a);
						WFIFOW( 2, MSkill);
						WFIFOW( 4, MUseLV);
						WFIFOL( 6, MTarget);
						WFIFOL(10, ID);
						WFIFOB(14, 1);
						SendBCmd(tm, ts.Point, 15);

						// Colus, 20040126: Can't use Stat1 for Lex.  Those effects stop the
						// monster.  Instead we set an effect tick, which (currently) isn't
						// being used for anything!  Convenient!

						if ((ts.Stat1 < 1) or (ts.Stat1 > 2)) then
							ts.EffectTick[0] := $FFFFFFFF;

						tc.MTick := Tick + 3000;
						{if (ts.Stat1 = 0) or (ts.Stat1 = 3) or (ts.Stat1 = 4) then begin
							ts.nStat := 5;
							ts.BodyTick := Tick + tc.aMotion;
						end else if (ts.Stat1 = 5) then ts.BodyTick := ts.BodyTick + 30000;}
				end;

        {Priest skills player vs monster end}
        {Wizard skills player vs monster begin}
        84: //JT
					begin
						if tc.ID = ts.ID then Exit;

						xy.X := ts.Point.X - Point.X;
						xy.Y := ts.Point.Y - Point.Y;
						if abs(xy.X) > abs(xy.Y) * 3 then begin
							//墶岦偒
							if xy.X > 0 then   b := 6 else b := 2;
						end else if abs(xy.Y) > abs(xy.X) * 3 then begin
							//廲岦偒
							if xy.Y > 0 then   b := 0 else b := 4;
						end else begin
							if xy.X > 0 then begin
								if xy.Y > 0 then b := 7 else b := 5;
							end else begin
								if xy.Y > 0 then b := 1 else b := 3;
							end;
						end;

						//僟儊乕僕嶼弌
						dmg[0] := MATK1 + Random(MATK2 - MATK1 + 1) * MATKFix div 100 * tl.Data1[MUseLV] div 100;
						dmg[0] := dmg[0] * (100 - ts.Data.MDEF) div 100; //MDEF%
						dmg[0] := dmg[0] - ts.Data.Param[3]; //MDEF-
						if dmg[0] < 1 then dmg[0] := 1;
						dmg[0] := dmg[0] * ElementTable[tl.Element][ts.Element] div 100;
						dmg[0] := dmg[0] * tl.Data2[MUseLV];
						if dmg[0] < 0 then dmg[0] := 0; //杺朄峌寕偱偺夞暅偼枹幚憰
						//僷働憲怣
						if (ts.EffectTick[0] > Tick) then dmg[0] := dmg[0] * 2;
						SendCSkillAtk1(tm, tc, ts, Tick, dmg[0], tl.Data2[MUseLV]);
						//僲僢僋僶僢僋張棟
						if (dmg[0] > 0) then begin
							SetLength(bb, tl.Data2[MUseLV] div 2);
							bb[0] := 4;
							xy.X := ts.Point.X;
							xy.Y := ts.Point.Y;
							DirMove(tm, ts.Point, b, bb);
							//僽儘僢僋堏摦
							if (xy.X div 8 <> ts.Point.X div 8) or (xy.Y div 8 <> ts.Point.Y div 8) then begin
								with tm.Block[xy.X div 8][xy.Y div 8].Mob do begin
									assert(IndexOf(ts.ID) <> -1, 'MobBlockDelete Error');
									Delete(IndexOf(ts.ID));
								end;
								tm.Block[ts.Point.X div 8][ts.Point.Y div 8].Mob.AddObject(ts.ID, ts);
							end;
							ts.pcnt := 0;
						//Update Monster Location
						UpdateMonsterLocation(tm, ts);
						end;
						frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick);
					end;

				88: // Frost Nova
					begin
						dmg[0] := MATK1 + Random(MATK2 - MATK1 + 1) * MATKFix div 100;
						dmg[0] := dmg[0] * (100 - ts.Data.MDEF) div 100; //MDEF%
						dmg[0] := dmg[0] - ts.Data.Param[3]; //MDEF-
						if dmg[0] < 1 then
							dmg[0] := 1;

						dmg[0] := dmg[0] * ElementTable[tl.Element][ts.Element] div 100;
						if dmg[0] < 0 then
							dmg[0] := 0;

						if (ts.EffectTick[0] > Tick) then dmg[0] := dmg[0] * 2;
						SendCSkillAtk1(tm, tc, ts, Tick, dmg[0], 1 , 5);

						if (ts.Data.race <> 1) and (ts.Data.MEXP = 0) and (dmg[0] <> 0) then begin
							if Random(1000) < tl.Data1[MUseLV] * 10 then begin
								ts.nStat := 2;
								ts.BodyTick := Tick + tc.aMotion;
							end;
						end;
						frmMain.DamageProcess1(tm, tc, ts, dmg[0], Tick);
						tc.MTick := Tick + 1000;
					end;

				86: // Water Ball
					begin
						k := tl.Data2[MUseLV];
						b := 0;
						for j1 := (tc.Point.Y - k)  to (tc.Point.Y + k) do begin
							for i1 := (tc.Point.X - k) to (tc.Point.X + k) do begin
								if (tm.gat[i1][j1] = 3) then b := 1;
							end;
						end;

						if (b = 0) then begin
							SendSkillError(tc, 0);
							tc.MMode := 4;
							tc.MPoint.X := 0;
							tc.MPoint.Y := 0;
							exit;
						end;

						tc.Skill[86].Tick := Tick;
																								k := tl.Data1[MUseLV];
						tc.Skill[86].EffectLV := k;
						tc.Skill[86].Effect1 := tc.MUseLV;
						frmMain.DamageOverTime(tm, tc, Tick, 86, MUseLV, k);
					end;

          93: //Sense
					begin
						ts := AData;
						WFIFOW(0, $018c);
						WFIFOW(2, ts.Data.ID);//ID
						WFIFOW(4, ts.Data.LV);//儗儀儖
						WFIFOW(6, ts.Data.Scale);//僒僀僘
						WFIFOL(8, ts.HP);//HP
						//WFIFOW(10, 0);//
						WFIFOW(12, ts.Data.DEF);//DEF
						WFIFOW(14, ts.Data.Race);//庬懓
						WFIFOW(16, ts.Data.MDEF);//MDEF
						WFIFOW(18, ts.Element);//懏惈
						for j := 0 to 8 do begin
							if (ElementTable[j+1][ts.Element] < 0) then begin
								WFIFOB(20+j, 0);//儅僀僫僗偩偲斖埻僄儔乕弌偡偺偱0偵偡傞
							end else begin
								WFIFOB(20+j, ElementTable[j+1][ts.Element]);//杺朄憡惈懏惈
							end;
						end;
						Socket.SendBuf(buf,29);//巇條偲偟偰偼偙偭偪偺曽偑傓偟傠偄偄偺偱偼丠杮恖偺傒偵尒偣傞
						WFIFOW( 0, $011a);
						WFIFOW( 2, MSkill);
						WFIFOW( 4, dmg[0]);
						WFIFOL( 6, MTarget);
						WFIFOL(10, ID);
						WFIFOB(14, 1);
						SendBCmd(tm, ts.Point, 15);
					end;
        {Wizard skills player vs monster end}

        {Hunter skills player vs monster begin}
        129://129 Blitz beat
					begin
						xy := ts.Point;
						//僟儊乕僕嶼

⌨️ 快捷键说明

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