Change Dropchance

Hello im using the SEB Engine and want to change the Drop Chance, i only can you use 1 out of 1 so basicly 100% dropchance but i want to change it that i can get less drop chance on drops.

Private Sub txtChance_Change()
    On Error GoTo chanceErr

    If Not IsNumeric(txtChance.text) And Not Right$(txtChance.text, 1) = "%" And Not InStr(1, txtChance.text, "/") > 0 And Not InStr(1, txtChance.text, ".") Then
        txtChance.text = "0"
        NPC(EditorIndex).DropChance(scrlDrop.Value) = 0
        Exit Sub
    End If

    If Right$(txtChance.text, 1) = "%" Then
        txtChance.text = Left(txtChance.text, Len(txtChance.text) - 1) / 100
    ElseIf InStr(1, txtChance.text, "/") > 0 Then
        Dim i() As String
        i = Split(txtChance.text, "/")
        txtChance.text = Int(i(0) / i(1) * 1000) / 1000
    End If

    If txtChance.text > 1 Or txtChance.text < 0 Then
        Err.Description = "Value must be between 0 and 1!"
        GoTo chanceErr
    End If

    NPC(EditorIndex).DropChance(scrlDrop.Value) = txtChance.text
    Exit Sub

chanceErr:
    MsgBox "Invalid entry for chance! " & Err.Description
    txtChance.text = "0"
    NPC(EditorIndex).DropChance(scrlDrop.Value) = 0
End Sub


If txtChance.text > 1 Then
Err.Description = "Value must be between 0 and 1!"
GoTo chanceErr
End If

1 = 100%

0.5 = 50%

0.1 = 10%

and so on…

well doesnt matter how i chance the chance its still 100% drop even tho i type in Chance 1 out of 5

Edit: didnt saw slasher post, thank you i messed it up…

Yes, thanks Slash, as he said, it’s decimals, 1 = 100% and 0 = 0%

,…,<>" data-cid=“930962” data-time=“1416950473”>

1 = 100%

0.5 = 50%

0.1 = 10%

and so on…

That’s my Slasher! 😄

Log in to reply