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

【Weiss】技術的なスレ

73cardinal:2003/03/24(月) 23:10 ID:uVAXZP/c
//--------------------------------------------------------------------------
$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;

    //カードを消す
    Dec(tc.Item[w1].Amount);
    WFIFOW( 0, $00a8);
    WFIFOW( 2, w1);
    WFIFOW( 4, tc.Item[w1].Amount);
    WFIFOB( 6, 1);
    Socket.SendBuf(buf, 7);
    //
    if tc.Item[w1].Amount = 0 then tc.Item[w1].ID := 0;
    tc.Weight := tc.Weight - tc.Item[w1].Data.Weight;
    //アイテム数減少
    WFIFOW( 0, $00af);
    WFIFOW( 2, w1);
    WFIFOW( 4, 1);
    //重量減少
    WFIFOW( 0, $00b0);
    WFIFOW( 2, $0018);
    WFIFOL( 4, tc.Weight);
    Socket.SendBuf(buf, 8);

    //スロット指したアイテムを再入手
    SendCGetItem(tc, w2, 1);
  end;
//--------------------------------------------------------------------------


新着レスの表示


名前: E-mail(省略可)

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

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

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

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