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