Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Visual bank


unnown
 Share

Recommended Posts

tired of that boring bank?
want to see what you actually have in it?

wellll…..now you can with this code :)

all client side:

in modgamelogic find gameloop()

and just above

> ' Visual Inventory

add this

```
                'visual bank
                If GetTickCount > IT + 500 And frmMirage.picBankBox.Visible = True Then
                    For Q = 0 To MAX_BANK
                        Qq = GetPlayerBankItemNum(MyIndex, Q + 1)

                        If frmMirage.picBank(Q).Picture <> LoadPicture() Then
                            frmMirage.picBank(Q).Picture = LoadPicture()
                        Else
                            If Qq = 0 Then
                                frmMirage.picBank(Q).Picture = LoadPicture()
                            Else
                                Call BitBlt(frmMirage.picBank(Q).hDC, 0, 0, PIC_X, PIC_Y, frmMirage.picItems.hDC, (Item(Qq).Pic - Int(Item(Qq).Pic / 6) * 6) * PIC_X, Int(Item(Qq).Pic / 6) * PIC_Y, SRCCOPY)
                            End If
                        End If
                    Next Q

                    For Q = 0 To MAX_INV - 1
                        Qq = Player(MyIndex).Inv(Q + 1).num

                        If frmMirage.picInvB(Q).Picture <> LoadPicture() Then
                            frmMirage.picInvB(Q).Picture = LoadPicture()
                        Else
                            If Qq = 0 Then
                                frmMirage.picInvB(Q).Picture = LoadPicture()
                            Else
                                Call BitBlt(frmMirage.picInvB(Q).hDC, 0, 0, PIC_X, PIC_Y, frmMirage.picItems.hDC, (Item(Qq).Pic - Int(Item(Qq).Pic / 6) * 6) * PIC_X, Int(Item(Qq).Pic / 6) * PIC_Y, SRCCOPY)
                            End If
                        End If
                    Next Q
                End If
```

in modclienttcp find the folowing

```
    ' :::::::::::::::::::::::::::::::
    ' :: Player bank update packet ::
    ' :::::::::::::::::::::::::::::::
    If casestring = "playerbankupdate" Then
        n = Val(parse(1))

        Call SetPlayerBankItemNum(MyIndex, n, Val(parse(2)))
        Call SetPlayerBankItemValue(MyIndex, n, Val(parse(3)))
        Call SetPlayerBankItemDur(MyIndex, n, Val(parse(4)))
        If frmBank.Visible = True Then
            Call UpdateBank
        End If
        Exit Sub
    End If

' :::::::::::::::::::::::::::::::
' :: Player bank open packet ::
' :::::::::::::::::::::::::::::::

    If casestring = "openbank" Then
        ' frmBank.lblBank.Caption = Trim$(Map(GetPlayerMap(MyIndex)).Name)
        frmBank.lstInventory.Clear
        frmBank.lstBank.Clear
        For i = 1 To MAX_INV
            If GetPlayerInvItemNum(MyIndex, i) > 0 Then
                If Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Or Item(GetPlayerInvItemNum(MyIndex, i)).Stackable = 1 Then
                    frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (" & GetPlayerInvItemValue(MyIndex, i) & ")"
                Else
                    If GetPlayerWeaponSlot(MyIndex) = i Or GetPlayerArmorSlot(MyIndex) = i Or GetPlayerHelmetSlot(MyIndex) = i Or GetPlayerShieldSlot(MyIndex) = i Or GetPlayerLegsSlot(MyIndex) = i Or GetPlayerRingSlot(MyIndex) = i Or GetPlayerNecklaceSlot(MyIndex) = i Then
                        frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (worn)"
                    Else
                        frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name)
                    End If
                End If
            Else
                frmBank.lstInventory.addItem i & "> Empty"
            End If

        Next i

        For i = 1 To MAX_BANK
            If GetPlayerBankItemNum(MyIndex, i) > 0 Then
                If Item(GetPlayerBankItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Or Item(GetPlayerBankItemNum(MyIndex, i)).Stackable = 1 Then
                    frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name) & " (" & GetPlayerBankItemValue(MyIndex, i) & ")"
                Else
                    If GetPlayerWeaponSlot(MyIndex) = i Or GetPlayerArmorSlot(MyIndex) = i Or GetPlayerHelmetSlot(MyIndex) = i Or GetPlayerShieldSlot(MyIndex) = i Or GetPlayerLegsSlot(MyIndex) = i Or GetPlayerRingSlot(MyIndex) = i Or GetPlayerNecklaceSlot(MyIndex) = i Then
                        frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name) & " (worn)"
                    Else
                        frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name)
                    End If
                End If
            Else
                frmBank.lstBank.addItem i & "> Empty"
            End If

        Next i
        frmBank.lstBank.ListIndex = 0
        frmBank.lstInventory.ListIndex = 0

        frmBank.Show vbModal
        Exit Sub
    End If

    If LCase$(parse(0)) = "bankmsg" Then
        frmBank.lblMsg.Caption = Trim$(parse(1))
        Exit Sub
    End If

```

and replace it with this

```
    ' :::::::::::::::::::::::::::::::
    ' :: Player bank update packet ::
    ' :::::::::::::::::::::::::::::::
    If casestring = "playerbankupdate" Then
        n = Val(parse(1))

        Call SetPlayerBankItemNum(MyIndex, n, Val(parse(2)))
        Call SetPlayerBankItemValue(MyIndex, n, Val(parse(3)))
        Call SetPlayerBankItemDur(MyIndex, n, Val(parse(4)))
        Exit Sub
    End If

' :::::::::::::::::::::::::::::::
' :: Player bank open packet ::
' :::::::::::::::::::::::::::::::

    If casestring = "openbank" Then
        frmMirage.picBankBox.Visible = True
        Exit Sub
    End If

    If LCase$(parse(0)) = "bankmsg" Then
        frmMirage.lblMsg.Caption = Trim$(parse(1))
        Exit Sub
    End If

```

and last thing

take everything from this form and put it in frmmirage (in the black part of it)
(also don't forget the code of this form)
Link to comment
Share on other sites

Remove this:

```
For Q = 0 To MAX_BANK
                        Qq = GetPlayerBankItemNum(MyIndex, Q + 1)

                        If frmMirage.picBank(Q).Picture <> LoadPicture() Then
                            frmMirage.picBank(Q).Picture = LoadPicture()
                        Else
                            If Qq = 0 Then
                                frmMirage.picBank(Q).Picture = LoadPicture()
                            Else
                                Call BitBlt(frmMirage.picBank(Q).hDC, 0, 0, PIC_X, PIC_Y, frmMirage.picItems.hDC, (Item(Qq).Pic - Int(Item(Qq).Pic / 6) * 6) * PIC_X, Int(Item(Qq).Pic / 6) * PIC_Y, SRCCOPY)
                            End If
                        End If
                    Next Q

```
Then call 'BltBank' everytime the client has a change of variables.

Then add this:

```
Sub BltBank
dim i as long
For i = 1 To MAX_BANK

With rec_pos
.top = Int(Item(GetPlayerBankItemNum(MyIndex, i)).Pic / 6) * PIC_Y
.left = (Item(GetPlayerBankItemNum(MyIndex, i)).Pic - Int(Item(GetPlayerBankItemNum(MyIndex, i)).Pic / 6) * 6) * PIC_X
.right = .left + PIC_X
.bottom = .top + PIC_Y
end with

  If DD_ItemSurf Is Nothing Then
  Else
  DD_ItemSurf.BltToDC frmMirage.picBank(i).hDC, rec, rec_pos
  End If
frmMirage.picBank(i).Refresh
next

```
Link to comment
Share on other sites

Doesn't mean it's a good way of doing it ;D

You should use BltToDC for the Inventory too.

If you do, it'll mean you won't be loading the graphics in twice, which you are doing at the moment, and you aren't raping the user's computer with looped rendering.
Link to comment
Share on other sites

  • 4 weeks later...
> ' :::::::::::::::::::::::::::::::
>     ' :: Player bank update packet ::
>     ' :::::::::::::::::::::::::::::::
>     If casestring = "playerbankupdate" Then
>         n = Val(parse(1))
>
>         Call SetPlayerBankItemNum(MyIndex, n, Val(parse(2)))
>         Call SetPlayerBankItemValue(MyIndex, n, Val(parse(3)))
>         Call SetPlayerBankItemDur(MyIndex, n, Val(parse(4)))
>         If frmBank.Visible = True Then
>             Call UpdateBank
>         End If
>         Exit Sub
>     End If
>
> ' :::::::::::::::::::::::::::::::
> ' :: Player bank open packet ::
> ' :::::::::::::::::::::::::::::::
>
>     If casestring = "openbank" Then
>         ' frmBank.lblBank.Caption = Trim$(Map(GetPlayerMap(MyIndex)).Name)
>         frmBank.lstInventory.Clear
>         frmBank.lstBank.Clear
>         For i = 1 To MAX_INV
>             If GetPlayerInvItemNum(MyIndex, i) > 0 Then
>                 If Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Or Item(GetPlayerInvItemNum(MyIndex, i)).Stackable = 1 Then
>                     frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (" & GetPlayerInvItemValue(MyIndex, i) & ")"
>                 Else
>                     If GetPlayerWeaponSlot(MyIndex) = i Or GetPlayerArmorSlot(MyIndex) = i Or GetPlayerHelmetSlot(MyIndex) = i Or GetPlayerShieldSlot(MyIndex) = i Or GetPlayerLegsSlot(MyIndex) = i Or GetPlayerRingSlot(MyIndex) = i Or GetPlayerNecklaceSlot(MyIndex) = i Then
>                         frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (worn)"
>                     Else
>                         frmBank.lstInventory.addItem i & "> " & Trim$(Item(GetPlayerInvItemNum(MyIndex, i)).Name)
>                     End If
>                 End If
>             Else
>                 frmBank.lstInventory.addItem i & "> Empty"
>             End If
>
>         Next i
>
>         For i = 1 To MAX_BANK
>             If GetPlayerBankItemNum(MyIndex, i) > 0 Then
>                 If Item(GetPlayerBankItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Or Item(GetPlayerBankItemNum(MyIndex, i)).Stackable = 1 Then
>                     frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name) & " (" & GetPlayerBankItemValue(MyIndex, i) & ")"
>                 Else
>                     If GetPlayerWeaponSlot(MyIndex) = i Or GetPlayerArmorSlot(MyIndex) = i Or GetPlayerHelmetSlot(MyIndex) = i Or GetPlayerShieldSlot(MyIndex) = i Or GetPlayerLegsSlot(MyIndex) = i Or GetPlayerRingSlot(MyIndex) = i Or GetPlayerNecklaceSlot(MyIndex) = i Then
>                         frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name) & " (worn)"
>                     Else
>                         frmBank.lstBank.addItem i & "> " & Trim$(Item(GetPlayerBankItemNum(MyIndex, i)).Name)
>                     End If
>                 End If
>             Else
>                 frmBank.lstBank.addItem i & "> Empty"
>             End If
>
>         Next i
>         frmBank.lstBank.ListIndex = 0
>         frmBank.lstInventory.ListIndex = 0
>
>         frmBank.Show vbModal
>         Exit Sub
>     End If
>
>     If LCase$(parse(0)) = "bankmsg" Then
>         frmBank.lblMsg.Caption = Trim$(parse(1))
>         Exit Sub
>     End If

This code isn't even in ModClientTCP
It's in ModHandlerData.
On top of that the variable IT isn't declared, it can't compile.
Link to comment
Share on other sites

WickedSix, he made this tutorial to help people. If you're too fucking retarded to _change_ the tutorial a bit to match your source, then it's _your_ problem, not his.

Each and every source code is different. Stop acting like an absolute dick when people help you out, or your stay here will be severely shortened.
Link to comment
Share on other sites

@Robin:

> WickedSix, he made this tutorial to help people. If you're too Ducking retarded to _change_ the tutorial a bit to match your source, then it's _your_ problem, not his.
>
> Each and every source code is different. Stop acting like an absolute dick when people help you out, or your stay here will be severely shortened.

Agreed.

You release a new device on the market with a open-source driver.

If Microsoft wants it, they need to add it themselves, they just can't copy and paste the driver.

It's the task of Microsoft doing so, not yours. So don't go blame unnown.

Regards,
  Goddie, the Irresistible.
Link to comment
Share on other sites

I got this to work actually. My little bro was making me mad cause he was throwing a fit about scripts. I wasn't trying to be a jerk when I said it was ridiculous. It's a dope tut and works well, although I only had a chance to try it out, I Ran without compile to test it, then I started redoing the UI of frmMirage and my computer beeped then froze.
Link to comment
Share on other sites

@Tyr:

> lol, funny dude -_-
> anyhow, godlord or asksgsgsg changed name again? ^^

Highly irrelevant. Some might even consider this spam. If you're to make remakes as such, then I consider you add something in your post that relates to the topic or Mods might get on your case. You can look at me as the bad guy or you can see me as a helpful team player trying to help you from future mutes and such.

[On topic]This is a very ingenious piece of work here! I'm going to test it out, if it works (after some minor altercations) I will make sure to add you to my list of credits for Lostica, what does this piece of code do exactly? I mean, does it show money only or any items you store in the bank? I haven't used the bank so would you mind informing me please?

Sincerely, MrMiguu
Link to comment
Share on other sites

@MrMiguu:

> Highly irrelevant. Some might even consider this spam. If you're to make remakes as such, then I consider you add something in your post that relates to the topic or Mods might get on your case. You can look at me as the bad guy or you can see me as a helpful team player trying to help you from future mutes and such.
>
> [On topic]This is a very ingenious piece of work here! I'm going to test it out, if it works (after some minor altercations) I will make sure to add you to my list of credits for Lostica, what does this piece of code do exactly? I mean, does it show money only or any items you store in the bank? I haven't used the bank so would you mind informing me please?
>
> Sincerely, MrMiguu

it shows all the items every single one of them :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...