Dastyruck Posted May 27, 2009 Author Share Posted May 27, 2009 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 slotDim has Dim valueDim munDim 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 SelectEnd 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 successDim slotDim number Dim level Dim timesDim fishyDim fishynumCall PlayerMsg(index, "You did not harvest any wood.", GREEN)number = Rand(1,61)slot = 1If number < 20 Then fishy = "clam" fishynum = 20Else If number > 20 AND number < 35 Then fishy = "mackeral" fishynum = 12Else If number > 35 AND number < 50 Then fishy = "bass" fishynum = 18Else If number > 50 AND number < 60 Then fishy = "flounder" fishynum = 19Else If number > 60 AND number < 65 Then fishy = "swordfish" fishynum = 21Else If number = 61 Then fishy = "dead puppy" fishynum = 22End IfCall 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 IfElseCall 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 IfEnd IfEnd Sub``` Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now