したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |

【Weiss】技術的なスレ

7064:2003/03/24(月) 12:09 ID:VjVinlSA
Delphi使って一日、参考資料はcardinalさんの書いたソースのみという状況なので
汚くて処理も無駄無駄かもしれませんが(;´Д`)とりあえずカード装着つくってみました

//--------------------------------------------------------------------------
$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;

w := tc.UseItemID;
tc.UseItemID := 0;
Dec(tc.Item[w].Amount);
WFIFOW( 0, $00a8);
WFIFOW( 2, w);
WFIFOW( 4, tc.Item[w].Amount);
WFIFOB( 6, 1);
Socket.SendBuf(buf, 7);
//030316追加 Cardinal
if tc.Item[w].Amount = 0 then tc.Item[w].ID := 0;
tc.Weight := tc.Weight - tc.Item[w].Data.Weight;
//アイテム数減少
WFIFOW( 0, $00af);
WFIFOW( 2, w);
WFIFOW( 4, 1);
//重量減少
WFIFOW( 0, $00b0);
WFIFOW( 2, $0018);
WFIFOL( 4, tc.Weight);
Socket.SendBuf(buf, 8);
end;
//--------------------------------------------------------------------------

クライアントで普通に処理する上では特に問題ないと思います


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板