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

Im baffled…


Dastyruck
 Share

Recommended Posts

I made a carbon copy of my woodcut skill but with different names…

Here is my scripted tile sub, case 3 is what im using for fishing.

```
'********************************
Sub ScriptedTile(Index, Script)
'********************************
Dim number
Dim slot
Dim has
Dim value
Dim mun
Dim need

Select Case Script
Case 1 
    number = 7
slot=1
has = 0
need = 1           
                  Do While slot < 25   
                      If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                        slot=25
                        has = 1                             
                      End If 
                  slot=slot+1
                  Loop
                  If Int(has) <> Int(need) Then
                  Call PlayerMsg(Index, "You do not have the proper item.", RED)
                  Else
                  Call WoodCut(Index)
                  End If
Exit Sub
Case 2
    number = 1
    value = 25
    slot=1
has = 0
need = 1           
                  Do While slot < 25   
                      If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                        If Int(value) <= Int(getplayerinvitemvalue(index,slot)) Then

                            has = 1
                            mun = Int(getplayerinvitemvalue(index,slot) )
                            slot=25
                        End If                           
                      End If 
                  slot=slot+1
                  Loop

                  If Int(has) <> Int(need) Then
                  Call PlayerMsg(Index, "You need 25 gold to be healed", WHITE)
                  Else 
                        Call PlayerMsg(Index, "You have been fully restored of your health.", WHITE)
                        Call quest_Take_Item(index, number, value)
                        Call Regain(Index)

                  End If
Exit Sub
Case 3 
number = 13
slot=1
has = 0
need = 1           
                  Do While slot < 25   
                      If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                        slot=25
                        has = 1                             
                      End If 
                  slot=slot+1
                  Loop
                  If Int(has) >= Int(need) Then
                  Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
                              Call Fishing(Index)
                    Call PlayerMsg(index, "You did not harvest any wood.", GREEN)

                  Else
                      Call PlayerMsg(Index, "You do not have the proper item.", RED)
                  End If
Exit Sub
Case Else
Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub
```
And here is my Fishing sub which is just like my woodcut sub but not working…

```
'********************************
Sub Fishing(index)
'********************************
Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
Dim success
Dim slot
Dim number 
Dim level 
Dim times
Dim fishy
Dim fishynum
Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
number = Rand(1,61)
slot = 1
If number < 20 Then
    fishy = "clam"
    fishynum = 20
Else If number > 20 AND number < 35 Then
    fishy = "mackeral"
    fishynum = 12
Else If number > 35 AND number < 50 Then
    fishy = "bass"
    fishynum = 18
Else If number > 50 AND number < 60 Then
    fishy = "flounder"
    fishynum = 19
Else If number > 60 AND number < 65 Then
    fishy = "swordfish"
    fishynum = 21
Else If number = 61 Then
    fishy = "dead puppy"
    fishynum = 22
End If
Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
If Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level") <> "" Then 
Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
level = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level")
success = Rand(Int(level), 5)
times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times")
    If success = 1 Then
        Do While slot < 25
        If Getplayerinvitemnum( index, Int( slot ) ) = 0  Then
            Call SetPlayerInvItemNum(index, Int( slot ), Int( fishynum ) )
            Call SetPlayerInvItemValue(index, Int( slot ), Int(1) )
            Call SendInventoryUpdate(index, Int(slot) )
            slot = 25
        End If
        slot = slot + 1
        Loop 
        Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times",Int( times ) + 1)
        If times = 50 Then
            If level < 4 Then
                Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level",Int( level) + 1)
                Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times",0)
            End If
        End If   
        Call PlayerMsg(index, "You caught 1 " & fishy & "!", GREEN) 

    Else
    Call PlayerMsg(index, "You did not catch anything.", GREEN)
    End If

Else
Call PlayerMsg(index, "You did not harvest any wood.", GREEN)
    times = 0
    level = 1
    Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level",Int(level)+0)
    Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times",Int(times)+0)

    number = Rand(1,99)
    slot = 0
    level = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level")
    success = Rand(Int(level), 5)
    times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times")

    If success = 1 Then
        Do While slot < 25
        If Getplayerinvitemnum( index, Int( slot ) ) = 0 Then
            Call SetPlayerInvItemNum(index, Int( slot ), Int( fishynum ) )
            Call SetPlayerInvItemValue(index, Int( slot ), Int(1) )
            Call SendInventoryUpdate(index, Int(slot) )
            slot = 25
        End If
        slot = slot + 1
        Loop 
        Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times",Int( times ) + 1)
        If times = 50 Then
            If level < 4 Then
                Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","level",Int( level) + 1)
                Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","fishing","times",0)
            End If
        End If

        Call PlayerMsg(index, "You caught 1 " & fishy & "!", GREEN) 

    Else
    Call PlayerMsg(index, "You did not catch anything.", GREEN)
    End If

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