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

Change Dropchance


Kaymak
 Share

Recommended Posts

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.

![](http://fs1.directupload.net/images/141125/7xeswn8i.png)

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

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