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

Expected sub, function or property


kapsel598
 Share

Recommended Posts

it is edited http://www.touchofdeathforums.com/smf2/index.php/topic,64806.msg694102.html#msg694102
if you used fish item(recipe) (you must have tool and 1 item)

>! If Item(GetPlayerEquipment(Index, Weapon)).FTool = Item(GetPlayerInvItemNum(Index, invNum)).FToolReq Then
                    ' Give the resulting item
                        If HasItem(Index, FItem1) Then
                            FishRand = rand(1, 3)
                                If FishRand = 1 Then
                                    If GetPlayerLevel(Index) = 10 Then
                                        Call PlayerMsg(Index, "1", Red)
                                    Else
                                        Call FishRand
                                    End If
                                End If
                                If FishRand = 2 Then
                                    If GetPlayerLevel(Index) = 15 Then
                                        Call PlayerMsg(Index, "2", Red)
                                    Else
                                        Call FishRand
                                    End If
                                End If
                                If FishRand = 3 Then
                                    If GetPlayerLevel(Index) = 20 Then
                                        Call PlayerMsg(Index, "3", Red)
                                    Else
                                        Call FishRand
                                    End If
                                End If
Link to comment
Share on other sites

Question, why do you want to to re-randomize? Because the way you explain it you might as well do it this way:

```
If HasItem(Index, FItem1) Then
                            Select Case GetPlayerLevel(Index)

                                Case 10
                                    ' Hand out the item

                                Case 15
                                    ' Hand out the Item

                                Case 20
                                    ' Hand out the Item

                            End Select
                        End If
```because your intended code would always end up giving the level appropriate item anyway. (Note that this will NOT allow you to catch fish when your level is anything other than those levels, which is another weird thing I don't get with your idea?)

or the following if you want it to hand out the items between levels as well:

```
                        If HasItem(Index, FItem1) Then
                            Select Case GetPlayerLevel(Index)

                                Case 1 To 9
                                    ' Hand out the item

                                Case 10 To 14
                                    ' Hand out the Item

                                Case 15 To 20
                                    ' Hand out the Item

                            End Select
                        End If
```
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...