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

Speed item price


Qazek
 Share

Recommended Posts

I create this for my game in eclipse.

When you click the button automatically determines the price of item.

All in client side.

Go to the frmItemEditor and create the command button anywhere.

Past in to the button code:

```
txtPrice.Text = scrlAddHP.Value * 10 + scrlAddMP.Value * 10 + scrlAddSP.Value * 10 + scrlAddStr.Value * 10 + scrlAddDef.Value * 10 + scrlAddMagi.Value * 10 + scrlAddSpeed * 10 + scrlAddEXP.Value * 10

```
1 item point (str, def, mp…) cost 10
Link to comment
Share on other sites

  • 2 months later...
Here the same thing with AttackSpeed

```
Dim AttackSpeed
Dim Price
Dim pperstat
Dim pperhpmp
AttackSpeed = 0

pperstat = 15
pperhpmp = 15

    If cmbType.ListIndex = ITEM_TYPE_WEAPON Or cmbType.ListIndex = ITEM_TYPE_TWO_HAND Then

        AttackSpeed = (10000 / scrlAttackSpeed.Value)
        If AttackSpeed > 10 Then
            AttackSpeed = AttackSpeed * 100
        ElseIf AttackSpeed > 8 Then
            AttackSpeed = AttackSpeed * 75
        ElseIf AttackSpeed > 6 Then
            AttackSpeed = AttackSpeed * 50
        ElseIf AttackSpeed > 4 Then
            AttackSpeed = AttackSpeed * 25
        Else
            AttackSpeed = AttackSpeed * (-10)
        End If

        AttackSpeed = Round(AttackSpeed)
    End If

    Price = scrlAddHP.Value * pperhpmp + scrlAddMP.Value * pperhpmp + scrlAddSP.Value * pperstat + scrlAddStr.Value * pperstat + scrlAddDef.Value * pperstat + scrlAddMagi.Value * pperstat + scrlAddSpeed * pperstat + scrlAddEXP.Value * pperstat

    If AttackSpeed < 0 Then
        If Price > AttackSpeed * (-1) Then
            Price = 0
        Else
            Price = Price + AttackSpeed
        End If
    Else
        Price = Price + AttackSpeed
    End If

    txtPrice.Text = Price

```
Link to comment
Share on other sites

Here the same thing with AttackSpeed

```
Dim AttackSpeed
Dim Price
Dim pperstat
Dim pperhpmp
AttackSpeed = 0

pperstat = 15
pperhpmp = 15

    If cmbType.ListIndex = ITEM_TYPE_WEAPON Or cmbType.ListIndex = ITEM_TYPE_TWO_HAND Then

        AttackSpeed = (10000 / scrlAttackSpeed.Value)
        If AttackSpeed > 10 Then
            AttackSpeed = AttackSpeed * 100
        ElseIf AttackSpeed > 8 Then
            AttackSpeed = AttackSpeed * 75
        ElseIf AttackSpeed > 6 Then
            AttackSpeed = AttackSpeed * 50
        ElseIf AttackSpeed > 4 Then
            AttackSpeed = AttackSpeed * 25
        Else
            AttackSpeed = AttackSpeed * (-10)
        End If

        AttackSpeed = Round(AttackSpeed)
    End If

    Price = scrlAddHP.Value * pperhpmp + scrlAddMP.Value * pperhpmp + scrlAddSP.Value * pperstat + scrlAddStr.Value * pperstat + scrlAddDef.Value * pperstat + scrlAddMagi.Value * pperstat + scrlAddSpeed * pperstat + scrlAddEXP.Value * pperstat

    If AttackSpeed < 0 Then
        If Price > AttackSpeed * (-1) Then
            Price = 0
        Else
            Price = Price + AttackSpeed
        End If
    Else
        Price = Price + AttackSpeed
    End If

    txtPrice.Text = Price

```
Link to comment
Share on other sites

@Draothgorin:

> not smart to client side it….........

It's a button for a client side form…where else would it go? You can't exactly place an editor's button NOT in the editor, y'know.

This is a nice idea. Personally, I'd do a bit more with the formula if I used this, but since everyone will want different prices, each person will make their own tweaks, I suppose.
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...