なので、例えば、
until ((tm.gat[xy.X][xy.Y] and 1) <> 0) or (c = 100);
↑のようなgatのメモリを参照する式の手前で、
if (xy.X < 0) then beginxy.X := 0;end;
if (xy.Y < 0) then beginxy.Y := 0;end;
if (xy.X > tm.Size.X-1) then beginxy.X := tm.Size.X-1;end;
if (xy.Y > tm.Size.Y-1) then beginxy.Y := tm.Size.Y-1;end;
のような式を書いてやればエラー落ちしなくまりました。
私は、4376、4427、4599、4640、4645行目に修正を加えてあります。
xy.Xではなく、Point.Xなどとなっている場合もあるので適宜変更してください。
1: //sell
begin
w := 0;
for i := 1 to 100 do begin
if (tc.Item[i].Amount > 0) and (tc.Item[i].ID <> 0) then begin
w := w + 1;
end;
end;
WFIFOW(0, $00c7);
WFIFOW(2, 4 + w * 10);
j := 0;
for i := 1 to 100 do begin
if (tc.Item[i].Amount > 0) and (tc.Item[i].ID <> 0) then begin
j := j + 1;
WFIFOW(4 + (j-1)*10,j);
WFIFOL(6 + (j-1)*10,tc.Item[i].Data.Price);
WFIFOL(10+ (j-1)*10,tc.Item[i].Data.Price);//OC未対応
end;
end;
Socket.SendBuf(buf, 4 + w * 10);
end;
とやってみました まだ売るとこはつくってないんですが
Sell押したときに表示はされるとおもいます
なにぶんDelphiを始めて5日目なのでご指摘お願いします(;´д`)
WFIFOW(0, $00c7);
w := 0;
for i := 1 to 100 do begin
if (tc.Item[i].Amount > 0) and (tc.Item[i].ID <> 0) and (tc.Item[i].Equip = 0) then begin
WFIFOW( 4+ w*10, i);
WFIFOL( 6+ w*10, tc.Item[i].Data.Price div 2);
WFIFOL(10+ w*10, tc.Item[i].Data.Price div 2);//OC未対応
Inc(w);
end;
end;
WFIFOW(2, 4 + w * 10);
Socket.SendBuf(buf, 4 + w * 10);
k := 250 - Param[1] - (Param[4] div 4);
if (250 - Param[1] - (Param[4] div 4)) < 1 then begin
k := 1;
end else begin
k := 250 - Param[1] -(Param[4] div 4);
end;
ADelay := 20 * WeaponASPDTable[Job][WeaponType] * k div 250;
if ADelay < 200 then ADelay := 200;
if (BaseLV + Param[2]) > 203 then begin
HPDelay[0] := 150;
end else begin
HPDelay[0] := 3000 - (14 * (BaseLV + Param[2]));
end;
これで多分ダイジョウブかと
さらにクリティカルの実装
攻撃処理の直前に以下を挿入
l := integer(Critical);
atk_type := 0;
//Critical処理
if Random(100) < l then begin
if Weapon = 0 then begin
//素手
dmg[0] := ATK3;
end else begin
//素手以外
dmg[0] := ATK3 + (ATK * WeaponTypeTable[ts.Data.Scale][Weapon] div 100);
end;
atk_type := 10;
end else begin
〜省略〜
end
〜省略〜
WFIFOB(26。�ョ atk_type);
HPRTickをHPTickと同様に初期化しておく
var SM_RECOVERY:byte; //SM_RECOVERYの有無
SM_RECOVERY_LV:byte;//SM_RECOVERYのレベル
if SM_RECOVERY = 1 then begin
if HPRTick + 10000 <= Tick then begin
if HP <> MAXHP then begin
HPR := (SM_RECOVERY_LV * 5) + (MAXHP div 50);
if HP + HPR > MAXHP then HPR := MAXHP - HP;
HP := HP + HPR;
HPRTick := HPRTick + 10000;
WFIFOW( 0。�ョ $013d);
WFIFOW( 2。�ョ $0005);
WFIFOW( 4。�ョ HPR);
Socket.SendBuf(buf。�ョ 6);
end else begin
HPRTick := Tick;
end;
end;
end;
>>6
ASPDは、
i := Param[1] + (Param[4] div 4);
if i > 250 then i := 250;
ADelay := 20 * WeaponASPDTable[Job][WeaponType] * (250 - i) div 250;
if ADelay < 200 then Adelay := 200;
こんな感じにしました。
VITが高すぎるときにHP回復しない問題については、
そのままコピペさせていただきました。<(_ _)>
INTのも同様な処理を追加。
ダブルアタックはクリティカルより優先。
クリティカルはヒットより優先。
ってことで修正案作って見ました。
〜省略〜
if Random(100) < k then begin
miss := False; //命中
end else begin
miss := True; //ミス
end;
if (SkillPer = 0) and ( Random(100) < Critical ) then begin
crt := True;
end else begin
crt := False;
end;
if (SkillPer = 0) and ( Random(100) < DAPer ) then begin
//ダブルアタック
if miss = False then begin
//命中したのなら
dmg[4] := 2;
dmg[5] := 8;
end else begin
//ミス
if crt = True then begin
//クリティカル
miss := False;
dmg[4] := 1;
dmg[5] := 10;
end;
end;
end else begin
//通常攻撃
dmg[4] := 1;
if crt = True then begin
//クリティカル
miss := False;
dmg[5] := 10;
end else begin
//通常攻撃
dmg[5] := 0;
end;
end;
if miss = False then begin
〜省略〜
if not (DisableLevelLimit and (tc1.BaseLV >= 99)) then begin
l := ts.Data.MEXP * BaseExpMultiplier;
if l > tc1.BaseNextEXP then l := tc1.BaseNextEXP;
tc1.BaseEXP := tc1.BaseEXP + l;
end;
end else if Copy(str, 1, 7) = 'option ' then begin
if Copy(str, 8, 4) = 'peko' then begin
if tc.job = 7 then begin
WFIFOW(0, $0119);
WFIFOL(2, tc.PID);
WFIFOW(6, 0);
WFIFOW(8, 0);
WFIFOW(10, 15);
WFIFOB(12, 0);
Socket.SendBuf(buf, 13);
end;
end;
防具精錬は書く前に実装されたので完全回避の方を。
〜省略〜
if (SkillPer = 0) and (Random(100) < tc.Lucky) then begin
dmg[0] := 0;
dmg[5] := 11;
end else if not miss then begin
〜省略〜
コレをモンスター反撃ダメージ計算の所に入れるだけでOKです。
//--------------------------------------------------------------------------
$017a: //カードWクリック
begin
RFIFOW(2, w);
if (w >= 1) and (w <= 100) then begin
td := tc.Item[w].Data;
WFIFOW(0, $017b);
j := 4;
for i := 1 to 100 do begin
if (tc.Item[i].ID <> 0) and (tc.Item[i].Amount > 0) and (tc.Item[i].Data.Slot > 0 ) and (tc.Item[i].Card[tc.Item[i].Data.Slot - 1] = 0) then begin // スロットを持っていてスロットの最後が埋まってなければ
case td.Loc of
0: //武器
begin
if (tc.Item[i].Data.Loc = 2) or (tc.Item[i].Data.Loc = 34) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
769: //頭装備
begin
if (tc.Item[i].Data.Loc = 1) or (tc.Item[i].Data.Loc > 256) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
4,16,32,64,136: //他
begin
if (tc.Item[i].Data.Loc = td.Loc) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
end;
end;
end;
if j <> 4 then begin //挿入可能なアイテムがある場合
WFIFOW(2, j);
Socket.SendBuf(buf, j);
tc.UseItemID := w;
end;
end;
end;
//--------------------------------------------------------------------------
$017c: //カード挿入
//本来はここでも装着可能部位かチェックしないといけないんですが
//通常の操作ではありえない(WPE等を使ったチートでもなければ)ので割愛
begin
RFIFOW(4, w);
if (w < 1) or (w > 100) or (tc.Item[tc.UseItemID].Data.IType <> 6) or (tc.Item[w].Card[tc.Item[w].Data.Slot - 1] <> 0) then begin
WFIFOW(0, $017d);
WFIFOW(2, w);
WFIFOW(4, tc.UseItemID);
WFIFOB(6, 1);
Socket.SendBuf(buf, 7);
continue;
end;
for i := 0 to 3 do begin
if(tc.Item[w].Card[i] = 0) then begin
tc.Item[w].Card[i] := tc.Item[tc.UseItemID].Data.ID;
WFIFOW(0, $017d);
WFIFOW(2, w);
WFIFOW(4, tc.UseItemID);
WFIFOB(6, 0);
Socket.SendBuf(buf, 7);
break;
end;
end;
//--------------------------------------------------------------------------
$017a: //カードWクリック
begin
RFIFOW(2, w);
if (w >= 1) and (w <= 100) then begin
td := tc.Item[w].Data;
WFIFOW(0, $017b);
j := 4;
for i := 1 to 100 do begin
if (tc.Item[i].ID <> 0) and (tc.Item[i].Amount > 0) and (tc.Item[i].Data.Slot > 0 ) and (tc.Item[i].Card[tc.Item[i].Data.Slot - 1] = 0) and (tc.Item[i].Equip = 0) then begin // スロットを持っていてスロットの最後が埋まってなければ
case td.Loc of
0: //武器
begin
if (tc.Item[i].Data.Loc = 2) or (tc.Item[i].Data.Loc = 34) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
769: //頭装備
begin
if (tc.Item[i].Data.Loc = 1) or (tc.Item[i].Data.Loc >= 256) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
4,16,32,64,136: //他
begin
if (tc.Item[i].Data.Loc = td.Loc) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
end;
end;
end;
if j <> 4 then begin //挿入可能なアイテムがある場合
WFIFOW(2, j);
Socket.SendBuf(buf, j);
tc.UseItemID := w;
end;
end;
end;
//--------------------------------------------------------------------------
$017c: //カード挿入
//本来はここでも装着可能部位かチェックしないといけないんですが
//通常の操作ではありえない(WPE等を使ったチートでもなければ)ので割愛
begin
RFIFOW(4, w);
if (w < 1) or (w > 100) or (tc.Item[tc.UseItemID].Data.IType <> 6) or (tc.Item[w].Card[tc.Item[w].Data.Slot - 1] <> 0) or (tc.Item[w].Equip <> 0) then begin
WFIFOW(0, $017d);
WFIFOW(2, w);
WFIFOW(4, tc.UseItemID);
WFIFOB(6, 1);
Socket.SendBuf(buf, 7);
continue;
end;
for i := 0 to 3 do begin
if(tc.Item[w].Card[i] = 0) then begin
tc.Item[w].Card[i] := tc.Item[tc.UseItemID].Data.ID;
WFIFOW(0, $017d);
WFIFOW(2, w);
WFIFOW(4, tc.UseItemID);
WFIFOB(6, 0);
Socket.SendBuf(buf, 7);
break;
end;
end;
//--------------------------------------------------------------------------
$017a: //カードWクリック
begin
RFIFOW(2, w);
if (w = 0) or (w > 100) or (tc.Item[w].ID = 0) or
(tc.Item[w].Amount = 0) or (tc.Item[w].Data.IType <> 6) then continue;
td := tc.Item[w].Data;
j := 4;
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].Data.Slot > 0) and (tc.Item[i].Card[tc.Item[i].Data.Slot - 1] = 0) and
(tc.Item[i].Equip = 0) then begin // スロットを持っていてスロットの最後が埋まってなければ
if td.Loc = 0 then begin
//武器
if tc.Item[i].Data.IType = 4 then begin
WFIFOW(j, i);
j := j + 2;
end;
end else begin
//防具
if (tc.Item[i].Data.IType = 5) and ((tc.Item[i].Data.Loc and td.Loc) <> 0) then begin
WFIFOW(j, i);
j := j + 2;
end;
end;
end;
end;
if j <> 4 then begin //挿入可能なアイテムがある場合
WFIFOW(0, $017b);
WFIFOW(2, j);
Socket.SendBuf(buf, j);
end;
end;
//--------------------------------------------------------------------------
$017c: //カード挿入
begin
RFIFOW(2, w1); //src
RFIFOW(4, w2); //dest
if (w1 = 0) or (w1 > 100) or (tc.Item[w1].ID = 0) or (tc.Item[w1].Amount = 0) or
(tc.Item[w1].Data.IType <> 6) or
(w2 = 0) or (w2 > 100) or (tc.Item[w2].ID = 0) or (tc.Item[w2].Amount = 0) or
(not tc.Item[w2].Data.IEquip) or (tc.Item[w2].Data.Slot = 0) or
(tc.Item[w2].Card[tc.Item[w2].Data.Slot - 1] <> 0) or
(tc.Item[w2].Equip <> 0) then begin //カードをさせる状態でない場合
WFIFOW(0, $017d);
WFIFOW(2, w1);
WFIFOW(4, w2);
WFIFOB(6, 1);
Socket.SendBuf(buf, 7);
continue;
end;
ti := tc.Item[w2];
td := tc.Item[w2].Data;
if tc.Item[w1].Data.Loc = 0 then begin
if td.IType <> 4 then continue;
end else begin
if (td.IType <> 5) or ((td.Loc and tc.Item[w1].Data.Loc) = 0) then continue;
end;
for i := 0 to 3 do begin
if(ti.Card[i] = 0) then begin
ti.Card[i] := tc.Item[w1].Data.ID;
WFIFOW(0, $017d);
WFIFOW(2, w1);
WFIFOW(4, w2);
WFIFOB(6, 0);
Socket.SendBuf(buf, 7);
break;
end;
end;
if sl.IndexOfName('ItemDropMultiplier') <> -1 then begin
ItemDropMultiplier := StrToInt(sl.Values['ItemDropMultiplier']);
end else begin
ItemDropMultiplier := 1;
end;
-----------
monsDieのアイテムドロップのところを
end else begin
if Random(10000) <= ts.Data.Drop[k].Per * ItemDropMultiplier then DropFlag := true; //重力仕様
if MTargetType = 1 then begin
MMode := 0;
goto ExitSkill; //PK不可
end;
ts := AData;
if (ts = nil) or (ts.HP = 0) then begin
MMode := 0;
goto ExitSkill;
end;
//if tm.Mob.IndexOf(IntToStr(tc.MTarget)) = -1 then goto ExitSkill;
//射程チェック
if (abs(tc.Point.X - ts.Point.X) > tl.Range) or (abs(tc.Point.Y - ts.Point.Y) > tl.Range) then begin
if MTick + 500 < Tick then MMode := 0;
goto ExitSkill;
end;
pcnt := 0;
//ダメージ算出
dmg[0] := MATK1 + Random(MATK2 - MATK1 + 1) * MATKFix div 100 * tl.Data1[tc.MUseLV] div 100;
dmg[0] := dmg[0] * ElementTable[tl.Element][ts.Data.Element] div 100;
if dmg[0] < 0 then dmg[0] := 0; //魔法攻撃での回復は未実装
//パケ送信
SendCSkillAtk(tm, tc, ts, Tick, dmg[0], 1);
SkillProcessType := 1;
xy := ts.Point;
//ダメージ算出2
for j1 := xy.Y div 8 - 2 to xy.Y div 8 + 2 do begin
for i1 := xy.X div 8 - 2 to xy.X div 8 + 2 do begin
//for k1 := 0 to tm.Block[i1][j1].Mob.Count - 1 do begin
k1 := 0;
while (k1 >= 0) and (k1 < tm.Block[i1][j1].Mob.Count) do begin
ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
if (ts <> ts1) and (abs(ts1.Point.X - xy.X) <= 2) and (abs(ts1.Point.Y - xy.Y) <= 2) then begin
dmg[0] := MATK1 + Random(MATK2 - MATK1 + 1) * MATKFix div 100 * tl.Data1[tc.MUseLV] div 100;
dmg[0] := dmg[0] * ElementTable[tl.Element][ts.Data.Element] div 100;
129://Blitz beat
begin
if MTargetType = 1 then begin
MMode := 0;
goto ExitSkill; //PK不可
end;
ts := AData;
if (ts = nil) or (ts.HP = 0) then begin
MMode := 0;
goto ExitSkill;
end;
//if tm.Mob.IndexOf(IntToStr(tc.MTarget)) = -1 then goto ExitSkill;
//射程チェック
if (abs(tc.Point.X - ts.Point.X) > tl.Range) or (abs(tc.Point.Y - ts.Point.Y) > tl.Range) then begin
if MTick + 500 < Tick then MMode := 0;
goto ExitSkill;
end;
pcnt := 0;
//ダメージ算出
if tc.Skill[128].Lv <> 0 then begin
dmg[0] := tc.Skill[128].Data.Data1[Skill[128].Lv] ;
end else begin
dmg[0] := 0
end;
dmg[0] := dmg[0] + (((tc.param[4]) div 10) + ((tc.param[3]) div 2)) * 2 + 80;
dmg[0] := dmg[0] * tc.MUseLV;
//属性相性補正入れて(´ロ`;)
if dmg[0] < 0 then dmg[0] := 0; //魔法攻撃での回復は未実装
//パケ送信
SendCSkillAtk(tm, tc, ts, Tick, dmg[0], tc.MUseLV);
SkillProcessType := 1;
xy := ts.Point;
//ダメージ算出2
for j1 := xy.Y div 8 - 2 to xy.Y div 8 + 2 do begin
for i1 := xy.X div 8 - 2 to xy.X div 8 + 2 do begin
//for k1 := 0 to tm.Block[i1][j1].Mob.Count - 1 do begin
k1 := 0;
while (k1 >= 0) and (k1 < tm.Block[i1][j1].Mob.Count) do begin
ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
if (ts <> ts1) and (abs(ts1.Point.X - xy.X) <= 1) and (abs(ts1.Point.Y - xy.Y) <= 1) then begin
if tc.Skill[128].Lv <> 0 then begin
dmg[0] := tc.Skill[128].Data.Data1[Skill[128].Lv] ;
end else begin
dmg[0] := 0
end;
dmg[0] := dmg[0] + (((tc.param[4]) div 10) + ((tc.param[3]) div 2)) * 2 + 80;
dmg[0] := dmg[0] * tc.MUseLV;
したがって、chara.txtのスキル部分を書きかえるか
Database.pasの
//***スキルデバッグ用***
if sl.Count = 1 then begin
for i := 1 to 53 do begin
を
//***スキルデバッグ用***
if sl.Count = 1 then begin
for i := 1 to 141 do begin
//--------------------------------------------------------------------------
$0197: //GMコマンド /resetstate /resetskill(将来的にはGMチェックを入れる)
begin
RFIFOW(2, w);
if w = 0 then begin// Resetstate(ステータス再分配)の処理
//パラメータ6個を全て1にする
for i := 0 to 5 do begin
tc.ParamBase[i] := 1;
end;
// + 激 し く 自 動 鷹 + ここで鷹が付いているかチェックするべき
if random(1000) <= tc.Param[5] * 3 then begin //確率チェック
if (tc.JobLV + 9) div 10 >= tc.Skill[129].Lv then begin
dmg[0] := (JobLV + 9) div 10;
end else begin
dmg[0] := Skill[129].lv;
end;
//一時的にdmg[0]を段数変数に使用
if tc.Skill[128].Lv <> 0 then begin //スチールクロウ補正
dmg[7] := tc.Skill[128].Data.Data1[Skill[128].Lv] * 2;
end else begin
dmg[7] := 0;
end;
tc.MSkill := 129;
tc.MMode :=0;
dmg[7] := dmg[7] + (tc.Param[4] div 10 + tc.Param[3] div 2) * 2 + 80;
dmg[7] := dmg[7] * dmg[0];
dmg[7] := dmg[7]; //属性相性補正
//無属性吸収はあり得ないので鷹ダメージ保持
SendCSkillAtk(tm, tc, ts, Tick, dmg[7] * ElementTable[0][ts.Data.Element] div 100, dmg[0]);
xy := ts.Point;
//ダメージ算出2@巻き込みダメージ
for j1 := xy.Y div 8 - 2 to xy.Y div 8 + 2 do begin
for i1 := xy.X div 8 - 2 to xy.X div 8 + 2 do begin
k1 := 0;
while (k1 >= 0) and (k1 < tm.Block[i1][j1].Mob.Count) do begin
ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
if (ts <> ts1) and (abs(ts1.Point.X - xy.X) <= 1) and (abs(ts1.Point.Y - xy.Y) <= 1) then begin
//無属性吸収はあり得ないので鷹ダメージ保持
SendCSkillAtk(tm, tc, ts1, Tick, dmg[7] * ElementTable[0][ts1.Data.Element] div 100, dmg[0]);
//ダメージ処理
DamageProcess1(tm, tc, ts1, dmg[7] * ElementTable[0][ts1.Data.Element], Tick);
end;
if ts1.HP <> 0 then Inc(k1);
end;
end;
end;
dmg[7] := dmg[7] * ElementTable[0][ts.Data.Element] div 100; //実ダメージに戻す
end;
//自動鷹終わり
//ダメージ算出
for j1 := xy.Y div 8 - 2 to xy.Y div 8 + 2 do begin
for i1 := xy.X div 8 - 2 to xy.X div 8 + 2 do begin
//for k1 := 0 to tm.Block[i1][j1].Mob.Count - 1 do begin
k1 := 0;
while (k1 >= 0) and (k1 < tm.Block[i1][j1].Mob.Count) do begin
ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
if (abs(ts1.Point.X - xy.X) <= tl.Range2) and (abs(ts1.Point.Y - xy.Y) <= tl.Range2) then begin
dmg[0] := MATK1 + Random(MATK2 - MATK1 + 1) * MATKFix div 100 * tl.Data1[tc.MUseLV] div 100;
dmg[0] := dmg[0] * (100 - ts1.Data.MDEF) div 100; //MDEF%
dmg[0] := dmg[0] - ts1.Data.Param[3]; //MDEF-
if dmg[0] < 1 then dmg[0] := 1;
dmg[0] := dmg[0] * ElementTable[tl.Element][ts1.Data.Element] div 100;
dmg[0] := dmg[0] * tl.Data2[tc.MUseLV];
if dmg[0] < 0 then dmg[0] := 0; //魔法攻撃での回復は未実装
//パケ送信
SendCSkillAtk(tm, tc, ts1, Tick, dmg[0], tl.Data2[tc.MUseLV]);
//ダメージ処理
DamageProcess1(tm, tc, ts1, dmg[0], Tick);
end;
if ts1.HP <> 0 then Inc(k1);
end;
end;
end;
SkillProcessType := 0;
end;
begin
i :=0; <--追加 〜〜
xy := tc.Point;
for j1 := xy.Y div 8 - 2 to xy.Y div 8 + 2 do begin
for i1 := xy.X div 8 - 2 to xy.X div 8 + 2 do begin
k1 := 0;
while (k1 >= 0) and (k1 < tm.Block[i1][j1].Mob.Count) and (i < 11) do begin
ts1 := tm.Block[i1][j1].Mob.Objects[k1] as TMob;
if (tc.PID = ts1.ATarget) and (abs(ts1.Point.X - tc.Point.X) <= ts1.Data.Range1) and (abs(ts1.Point.Y - tc.Point.Y) <= ts1.Data.Range1) then begin
Inc(i);
end;
Inc(k1);
end;
end;
end; <-- 〜〜ここまで
with ts.Data do begin
//debugout.Lines.Add(inttostr(i)); <-- 追加〜〜
if i > 1 then begin
i := (i - 1) * tc.FLEE1 div 10; <-- ここの1を2に変えればコモド仕様にできます
end else begin
i := 0;
end; <-- 〜〜ここまで
i := i + HIT + HITFix - (tc.FLEE1 + tc.FLEE2) + 80; <--変更 ここで i + を消せば囲まれ補正を消せます
if i < 5 then i := 5;
if i > 100 then i := 100;
■procedure DataLoad();
//------------------------------------------------------------------------------
-//***スキルデバッグ用***
-if sl.Count = 1 then begin
-for i := 1 to 65 do begin
-tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
-end;
-for i := 90 to 91 do begin
-tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
-end;
-tc.Skill[93].Lv := tc.Skill[93].Data.MasterLV;
-for i := 126 to 141 do begin
-tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
-end;
-{
-for i := 142 to 157 do begin //韓国桜井専用
-tc.Skill[i].Lv := tc.Skill[i].Data.MasterLV;
-end;
-}
-end;
//------------------------------------------------------------------------------
Common.pas
----------
【implementation 節】
//--------------------------------------------------------------------------
// 関数定義
+procedure CalcSkill(Socket: TCustomWinSocket; tc:TChara; Tick:cardinal = 0);
//--------------------------------------------------------------------------
+procedure CalcSkill(Socket: TCustomWinSocket; tc:TChara; Tick:cardinal = 0);
+var
+i, j, k:integer;
+b:byte;
+begin
+//スキル送信
+WFIFOW( 0, $010f);
+j := 0;
+for i := 1 to 157 do begin
+WFIFOW( 0+37*j+4, i);
+WFIFOW( 2+37*j+4, tc.Skill[i].Data.SType);
+WFIFOW( 4+37*j+4, 0);
+WFIFOW( 6+37*j+4, tc.Skill[i].Lv);
+if tc.Skill[i].Lv <> 0 then
+WFIFOW( 8+37*j+4, tc.Skill[i].Data.SP[tc.Skill[i].Lv])
+else
+WFIFOW( 8+37*j+4, tc.Skill[i].Data.SP[1]);
+WFIFOW(10+37*j+4, tc.Skill[i].Data.Range);
+WFIFOS(12+37*j+4, tc.Skill[i].Data.IDC, 24);
+b:= 0;
+if (tc.SkillPoint = 0) or (tc.Skill[i].Lv = tc.Skill[i].Data.MasterLV) then begin
+b := 0;
+end else if (((i>=1)and(i<=65)) or (i=90) or (i=91) or (i=93) or ((i>=126)and(i<=141))) then begin
+b := 1;
+for k := 0 to 4 do begin
+if (tc.Skill[i].Data.ReqSkill[k] <> 0) and (tc.Skill[tc.Skill[i].Data.ReqSkill[k]].Lv < tc.Skill[i].Data.ReqLV[k]) then begin
+b := 0;
+continue;
+end;
+end;
+end;
+WFIFOB(36+37*j+4, b);
+Inc(j);
+end;
+WFIFOW( 2, 4+37*j);
+Socket.SendBuf(buf, 4+37*j);
+
+//スキルポイント送信
+WFIFOW( 0, $00b0);
+WFIFOW( 2, $000c);
+WFIFOL( 4, tc.SkillPoint);
+Socket.SendBuf(buf, 8);
+end;
//--------------------------------------------------------------------------
■グローバル
//------------------------------------------------------------------------------
var
+DefaultServerIP:String;
//------------------------------------------------------------------------------
■procedure TfrmMain.FormCreate(Sender: TObject);
//------------------------------------------------------------------------------
var
+wVersionRequired: Word;
+WSData: TWSAData;
+Status: Integer;
+Name: array[0..255] of Char;
+HostEnt: PHostEnt;
+IP: PChar;
//------------------------------------------------------------------------------
【implementation 節】
■procedure TfrmMain.FormCreate(Sender: TObject);
//------------------------------------------------------------------------------
begin
+wVersionRequired := MAKEWORD(1, 1);
+Status := WSAStartup(wVersionRequired, WSData);
+if Status <> 0 then begin
+MessageDlg('This version of WinSock does not support Host->IP feature!!', mterror, [mbOK], 0);
+exit;
+end;
//------------------------------------------------------------------------------
ini := TIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
sl.Clear;
ini.ReadSectionValues('Server', sl);
//$01:石化 $02:凍結 $03:ピヨ $04:眠り $06:石化中
for i:=0 to 5 do begin
if Random(100) < tc.SFixPer1[i] then begin
ts.View1 := i+1;
end;
end;
k := 1;
//i: 00:毒 01:呪い 02:沈黙 03:混乱 04:暗闇
//k: $01:毒 $02:呪い $04:沈黙 $08:混乱 $10:暗闇
for i:=0 to 4 do begin
if Random(100) < tc.SFixPer2[i] then begin
ts.View2 := ts.View2 or k;
end;
k := k*2;
end;
外見だけ変えるならこんな感じでいいのかな?
状態1の優先順位ってどうなってんでしょうね。
//追加変数
DamageFixR :array[0..8] of Integer; //種族
DamageFixE :array[0..9] of Integer; //属性
DamageFixS :array[0..2] of Integer; //サイズ
SFixPer1 :array[0..5] of Integer; //状態1
SFixPer2 :array[0..4] of Integer; //状態2
DrainFix :array[0..1] of Integer; //吸収
SplashAttack :boolean; //スプラッシュ
NoJamstone :boolean;
//読み込み部分
for i :=0 to 3 do begin
//XYZZ
j := StrToInt(sl.Strings[36+i]);
//X = 1:種族 2:属性 3:サイズ
case ( j div 1000 ) of
//種族 Y = 0:無, 1:人間, 2:動物, 3:昆虫, 4:植物, 5:魚類, 6:悪魔, 7:竜族, 8:不死
1: DamageFixR[( j mod 1000 ) div 100] := j mod 100;
//属性 Y = 0:無, 1:水, 2:地, 3:火, 4:風, 5:毒, 6:聖, 7:闇, 8:念, 9:不死
2: DamageFixE[( j mod 1000 ) div 100] := j mod 100;
//サイズ Y = 0:小, 1:中, 2:大
3: DamageFixS[( j mod 1000 ) div 100] := j mod 100;
//状態1 Y = 01:石化 02:凍結 03:スタン 04:睡眠 05:LexA? 06:石化前の移行状態
4: SFixPer1[( j mod 1000 ) div 100 -1] := j mod 100;
//状態2 Y = 01:毒 02:呪い 03:沈黙 04:混乱? 05:暗闇
5: SFixPer2[( j mod 1000 ) div 100 -1 ] := j mod 100;
//吸収 Y = 0:HP 1:SP
6: DrainFix[( j mod 1000 ) div 100] := j mod 100;
7: begin //その他
case ( ( j mod 1000 ) div 100 ) of
0: SplashAttack := true;
1: NoJamstone := true;
else //何もしない
end;
end;
else //何もしない
end; // 'case ( j div 1000 )'
end; // 'for i :=0 to 3 do'
j := StrToInt(sl.Strings[36+i]);
//X = 1:種族 2:属性 3:サイズ
if j > 10000 then begin //スキル追加の効果
j := j - 10000;
AddSkill[j div 10] := j mod 10 + 1;
end else begin
case ( j div 1000 ) of
>>206
main.pasのベースExp加算部の
l := ts.Data.EXP * (ts.EXPDist[i].Dmg) div total;
を
l := ts.Data.EXP * cardinal(cardinal(ts.EXPDist[i].Dmg) div total);
って直したらエラーでなくなった気がします・・・
間違ってたらごめんなさい
l := ts.Data.EXP * (ts.EXPDist[i].Dmg) div total;
式の計算は左から行われます。
つまり、まず、敵の経験値に各自の与えたダメージが掛けられ、
その後に全員の与えたダメージの合計(ほんとはMAXHPなんだけど、
途中で死んだ人が与えた分のダメージは除外しないといけないため)
で割られます。
ここで、HPとEXPの高い敵を倒した場合、かけ算が発生した瞬間、
数値が32ビット整数値の限界(4Gか2Gくらい)を超えてエラーになります。
つまり、経験値とMVP経験値の部分をそれぞれ
l := 100 * (ts.EXPDist[i].Dmg) div total;
l := ts.Data.EXP * l div 100;
これに置き換えればエラーがでないはずです。
>>231
取り込んだあとにアドバイスというのも変ですが、そのままのコードであってますよ。
if Skill[112].Tick > Tick the begin
の後にでも、武器による条件分岐をつければいいかと。
使用者の継続時間減少は、SkillEffect()の4,5: //対パーティ時間制限有りスキル の最後の方に追加するしかないかな。
main.pasに
112: //ウェポンパーフェクション
begin
if ((WeaponType[0] = 7) or (WeaponType[0] = 8)) then begin tc1 := tc;
SkillProcessType := 5;
end else begin
WFIFOW( 0, $0110);
WFIFOW( 2, tc.MSkill);
WFIFOW( 4, 0);
WFIFOW( 6, 0);
WFIFOB( 8, 0);
WFIFOB( 9, 6);
Socket.SendBuf(buf, 10);
MMode := 0;
end;
end;
common.pasに
//ウェポンパーフェクション使用時
if Skill[112].Tick > Tick then begin
if ((WeaponType[0] = 7) or (WeaponType[0] = 8)) then begin
ATKFix[0][0] := 100;
ATKFix[0][1] := 100;
ATKFix[0][2] := 100;
end;
end;
common.pasの
if Skill[60].Tick > Tick then ADelay := ADelay * 70 div 100; //ツーハンドクイックン
の下に
if Skill[111].Tick > Tick then begin
if ((WeaponType[0] = 7) or (WeaponType[0] = 8)) then
ADelay := ADelay * 70 div 100; //AR
end;
を追加すればARが使用できます。
攻撃速度のディレイ減少の部分は間違ってるかもしれませんが…
すいません。
if ((WeaponType[0] = 7) or (WeaponType[0] = 8)) then は
if ((WeaponType[0] = 6) or (WeaponType[0] = 7) or (WeaponType[0] = 8)) then
です^^;
片手斧の存在を忘れてました。
end else if Copy(str, 1, 5) = 'icon ' then begin
sl := TStringList.Create;
sl.DelimitedText := Copy(str, 6, 256);
try
if sl.Count <> 2 then Continue;
Val(sl.Strings[0], i, k);
if (k <> 0) or (i < 0) then Continue;
Val(sl.Strings[1], j, k);
if (k <> 0) or (j < 0) then Continue;
WFIFOW(0, $0196);
WFIFOW(2, i);
WFIFOL(4, tc.ID);
WFIFOB(8, j);
Socket.SendBuf(buf, 9);
finally
sl.Free();
end;
end;