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

PicItemDesc Show DMG,ATS,Stats and Price v3 ! (Item requirement)


xppxdd
 Share

Recommended Posts

Very very very easy edit for you who want to make the PicItemDesc More detailed and don't know how.

Words of motivation- Well, I am just like most of you; no extreme knowledge in programming, or have a bit of orientation in the source, but still iv'e mange to make my own add-on! How?
First, Youtube(vb6 tut)
Second, I read most of the source to gain more experience with it.
Last, Iv'e applied everything that I know and FOCUS on making that feature.
LOL If it will make even just one of you motivated it's worth it:D

V3!
Show Items Requirement Stats and mark with red when player doesn't have enough of them.
Show level (Mark as well)

V2
Showing DMG, ATS, Stats to Weapons, Armors, Helmet and Shield only.
Show Item Type.
Cancel the Window on Currency.

known-bugs:
None

Client-Side only and EO 2.0 OFC…

First, find you PicItemDesc, you can do that by expanding the frmMain borders.
In default is on the bottom left.

Next, add 11 labels,
lblItemspeed
lblItemStat
lblItemPrice
lblItemDMG
lblItemType
Update:

lbllvl_req
lblstr_req
lblend_req
lblint_req
lblagi_req
lblwill_req

Edit the properties as you like and position it as you want.

Now search for:
```
Public Sub UpdateDescWindow
```
Replace the whole Sub with:

```

Public Sub UpdateDescWindow(ByVal itemnum As Long, ByVal x As Long, ByVal y As Long)
Dim i As Long
Dim FirstLetter As String * 1
Dim Name As String
Dim ATS As Double
ATS = Trim$(Item(itemnum).Speed) / 1000
Dim DMG As Long
DMG = Trim$(Item(itemnum).Data2)
'stat add
Dim STR As Long
STR = Trim$(Item(itemnum).Add_Stat(1))
Dim ENDu As Long
ENDu = Trim$(Item(itemnum).Add_Stat(2))
Dim AGI As Long
AGI = Trim$(Item(itemnum).Add_Stat(4))
Dim INTe As Long
INTe = Trim$(Item(itemnum).Add_Stat(3))
Dim WILL As Long
WILL = Trim$(Item(itemnum).Add_Stat(5))
'stat req
Dim STRq As Long
STRq = Trim$(Item(itemnum).Stat_Req(1))
Dim ENDuq As Long
ENDuq = Trim$(Item(itemnum).Stat_Req(2))
Dim AGIq As Long
AGIq = Trim$(Item(itemnum).Stat_Req(4))
Dim INTeq As Long
INTeq = Trim$(Item(itemnum).Stat_Req(3))
Dim WILLq As Long
WILLq = Trim$(Item(itemnum).Stat_Req(5))
Dim LVLq As Long
LVLq = Trim$(Item(itemnum).LevelReq)
Dim CLASSq As Long
CLASSq = Trim$(Item(itemnum).ClassReq)
'player stats
Dim Index As Long
Dim plvl As Long
Dim pstr As Long
Dim pend As Long
Dim pint As Long
Dim pagi As Long
Dim pwill As Long
Dim pclass As Long

pclass = Player(MyIndex).Class

plvl = Player(MyIndex).Level
pstr = Player(MyIndex).Stat(1)
pend = Player(MyIndex).Stat(2)
pint = Player(MyIndex).Stat(3)
pagi = Player(MyIndex).Stat(4)
pwill = Player(MyIndex).Stat(5)

'no DescWindow for currency
  If Trim$(Item(itemnum).Type) = 7 Then
    Exit Sub
  End If

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    FirstLetter = LCase$(Left$(Trim$(Item(itemnum).Name), 1))

    If FirstLetter = "$" Then
        Name = (Mid$(Trim$(Item(itemnum).Name), 2, Len(Trim$(Item(itemnum).Name)) - 1))
    Else
        Name = Trim$(Item(itemnum).Name)
    End If

    ' check for off-screen
    If y + frmMain.picItemDesc.height > frmMain.ScaleHeight Then
        y = frmMain.ScaleHeight - frmMain.picItemDesc.height
    End If

    ' set z-order
    frmMain.picItemDesc.ZOrder (0)

    With frmMain
        .picItemDesc.top = y
        .picItemDesc.Left = x
        .picItemDesc.Visible = True

        If LastItemDesc = itemnum Then Exit Sub ' exit out after setting x + y so we don't reset values

        ' set the name
        Select Case Item(itemnum).Rarity
            Case 0 ' white
                .lblItemName.ForeColor = RGB(255, 255, 255)
            Case 1 ' green
                .lblItemName.ForeColor = RGB(117, 198, 92)
            Case 2 ' blue
                .lblItemName.ForeColor = RGB(103, 140, 224)
            Case 3 ' maroon
                .lblItemName.ForeColor = RGB(205, 34, 0)
            Case 4 ' purple
                .lblItemName.ForeColor = RGB(193, 104, 204)
            Case 5 ' orange
                .lblItemName.ForeColor = RGB(217, 150, 64)
        End Select

                ' set captions
        .lblItemName.Caption = Name
        .lblItemDesc.Caption = Trim$(Item(itemnum).Desc)
        .lblprice.Caption = "Price: " & Trim$(Item(itemnum).Price)
        .lblstat.Caption = "No Stats."
        .lblDMG = "Have no damage."
        .lblItemSpeed.Caption = ""

        'to do class ----> .lblclass_req.Caption = Class(MyClass).Name

                ' Item Type
        Select Case Item(itemnum).Type
            Case 0 ' None
                .lblItemType.Caption = "ETC"
            Case 1 ' Weapon
                .lblItemType.Caption = "Weapon"
                .lblItemSpeed.Caption = ATS & "s"
                .lblstat.Caption = "STR: +" & STR & vbCrLf & "END: +" & ENDu & vbCrLf & "INT: +" & INTe & vbCrLf & "AGI: +" & AGI & vbCrLf & "WILL: +" & WILL
                .lblDMG = "Damage: " & DMG
            Case 2 ' Armor
                .lblItemType.Caption = "Armor"
                .lblItemSpeed.Caption = ""
                .lblstat.Caption = "STR: +" & STR & vbCrLf & "END: +" & ENDu & vbCrLf & "INT: +" & INTe & vbCrLf & "AGI: +" & AGI & vbCrLf & "WILL: +" & WILL
                .lblDMG = "" 'show armor
            Case 3 ' Helmet
                .lblItemType.Caption = "Helmet"
                .lblItemSpeed.Caption = ""
                .lblstat.Caption = "STR: +" & STR & vbCrLf & "END: +" & ENDu & vbCrLf & "INT: +" & INTe & vbCrLf & "AGI: +" & AGI & vbCrLf & "WILL: +" & WILL
                .lblDMG = "" 'show armor
            Case 4 ' Shield
                .lblItemType.Caption = "Shield"
                .lblItemSpeed.Caption = ""
                .lblstat.Caption = "STR: +" & STR & vbCrLf & "END: +" & ENDu & vbCrLf & "INT: +" & INTe & vbCrLf & "AGI: +" & AGI & vbCrLf & "WILL: +" & WILL
                .lblDMG = "" 'show armor
            Case 5 ' orange
                .lblItemType.Caption = "Consume"
            Case 6 ' orange
                .lblItemType.Caption = "Key"
            Case 7 ' orange
                .lblItemType.Caption = "Currency"
            Case 8 ' orange
                .lblItemType.Caption = "Spell Scroll"
            End Select

        'is player meets REq:

        If plvl < LVLq Then
            .lbllvl_req.ForeColor = RGB(255, 0, 0)
            .lbllvl_req.Caption = "Level: " & LVLq
        Else
            .lbllvl_req.ForeColor = RGB(255, 255, 255)
            .lbllvl_req.Caption = "Level: " & LVLq
        End If

        If pstr < STRq Then
            .lblSTR_req.ForeColor = RGB(255, 0, 0)
            .lblSTR_req.Caption = "Str: " & STRq
        Else
            .lblSTR_req.ForeColor = RGB(255, 255, 255)
            .lblSTR_req.Caption = "Str: " & STRq
        End If

        If pend < ENDuq Then
            .lblEND_req.ForeColor = RGB(255, 0, 0)
            .lblEND_req.Caption = "End: " & ENDuq
        Else
            .lblEND_req.ForeColor = RGB(255, 255, 255)
            .lblEND_req.Caption = "End: " & ENDuq
        End If

        If pagi < AGIq Then
          .lblagi_req.ForeColor = RGB(255, 0, 0)
          .lblagi_req.Caption = "Agi: " & AGIq
        Else
          .lblagi_req.ForeColor = RGB(255, 255, 255)
          .lblagi_req.Caption = "Agi: " & AGIq
          End If

        If pint < INTeq Then
          .lblINT_req.ForeColor = RGB(255, 0, 0)
          .lblINT_req.Caption = "Int: " & INTeq
        Else
          .lblINT_req.ForeColor = RGB(255, 255, 255)
          .lblINT_req.Caption = "Int: " & INTeq
          End If

        If pwill < WILLq Then
          .lblWILL_req.ForeColor = RGB(255, 0, 0)
          .lblWILL_req.Caption = "Will: " & WILLq
        Else
          .lblWILL_req.ForeColor = RGB(255, 255, 255)
          .lblWILL_req.Caption = "Will: " & WILLq
          End If

  '      If pclass = CLASSq Then
  '        .lblclass_req.ForeColor = RGB(255, 255, 255)

      '  Else
      '    .lblclass_req.ForeColor = RGB(255, 0, 0)
    '      End If

        'Trim$(Item(itemnum).data1)
        'to do spell Details

        ' render the item
        BltItemDesc itemnum
    End With

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "UpdateDescWindow", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

```

(The code is a one big mess i know… soz!)

And sample as that compile and you done :)

To do:(v4)
Class Requirement.
Show Consume and spell details.

Final result:
[![](http://img825.imageshack.us/img825/7391/screenyv3.png)](http://imageshack.us/photo/my-images/825/screenyv3.png/)

Uploaded with [ImageShack.us](http://imageshack.us)

here is the GUI:
[![](http://img11.imageshack.us/img11/8382/descriptionitem.jpg)](http://imageshack.us/photo/my-images/11/descriptionitem.jpg/)

Uploaded with [ImageShack.us](http://imageshack.us)
Link to comment
Share on other sites

@Taegan:

> This question probably doesn't even make sense, but do we by any chance need to delete our existing items to implement this? o.o

I don't think so since it only makes the stats visible in the description, so it's really just a visual changing…
Link to comment
Share on other sites

good day not my first time with this engine but first post with this nickname cant remember my old one my question is.. is there a way to calculate an item and your armor to show if it would give better stats or worse stats before equiping the item/armor  like if my armor as  +4 str and the item has +6 str it will show in green a +2 great work works well
Link to comment
Share on other sites

@greendixy:

> good day not my first time with this engine but first post with this nickname cant remember my old one my question is.. is there a way to calculate an item and your armor to show if it would give better stats or worse stats before equiping the item/armor  like if my armor as  +4 str and the item has +6 str it will show in green a +2 great work works well

That easy to :)
just need to add a check whether the Equipped item Stats is grater and then "-" it and update the label:)
ill update the script if ill have time :)
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
I think I'm the dumb, but it gives me an compile error, highlighting these:lblItemSpeed ..etc (the 11 line) 

(On the right side there's MouseMove insted of Default, cause i didn't find default o.o)

And please help me how to insert the GUI..
I overwrited the Graphic–->GUI--->Character-----> item_description to your itemdescription picture, but my item is out of the "item frame" look:
Link to comment
Share on other sites

  • 2 weeks later...

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...