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

Crafting System Help


Dastyruck
 Share

Recommended Posts

K, so I am making my own crafting system for my game and this is the Craft sub.

> '********************************
> Sub Craft(index, Item, Matone, Valone, Mattwo, Valtwo, Matthree, Valthree, Matfour, Valfour, Matfive, Valfive, Matsix, Valsix, Matseven, Valseven)
> '********************************
> Call PlayerMsg(Index, "4", RED)
> Dim matnum
> Dim slot
> Dim has
> Dim need
> Dim mathas
>
> matnum = 0
> mathas = 0
>
> If Matone = 0 Then
> Else
>     matnum += 1
> End If
> If Mattwo = 0 Then
> Else
>     matnum += 1
> End If
> If Matthree = 0 Then
> Else
>     matnum += 1
> End If
> If Matfour = 0 Then
> Else
>     matnum += 1
> End If
> If Matfive = 0 Then
> Else
>     matnum += 1
> End If
> If Matsix = 0 Then
> Else
>     matnum += 1
> End If
> If Matseven = 0 Then
> Else
>     matnum += 1
> End If
>
> If matnum >= 1 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matone) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valone) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 2 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Mattwo) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valtwo) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 3 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matthree) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valthree) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 4 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matfour) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valfour) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 5 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matfive) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valfive) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 6 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matsix) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valsix) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
>    
> End If
> End If
>
> If matnum >= 7 Then
> slot=1
> has = 0
> need = 1           
>
> Do While slot < 25 
> If Int(getplayerinvitemnum(index,slot))=Int(Matseven) Then
>     If Int(getplayerinvitemval(index,slot))=Int(Valseven) Then
>     slot=25
>     has = 1
>     End If                             
> End If 
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
>     Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
>     Exit Sub
> Else
>     mathas += 1
> End If
> End If
>
> If mathas = matneed Then
>     If mathas >= 1 Then
>         Call quest_Take_Item(index, Matone, Valone)
>     End If
>     If mathas >= 2 Then
>         Call quest_Take_Item(index, Mattwo, Valtwo)
>     End If
>     If mathas >= 3 Then
>         Call quest_Take_Item(index, Matthree, Valthree)
>     End If
>     If mathas >= 4 Then
>         Call quest_Take_Item(index, Matfour, Valfour)
>     End If
>     If mathas >= 5 Then
>         Call quest_Take_Item(index, Matfive, Valfive)
>     End If
>     If mathas >= 6 Then
>         Call quest_Take_Item(index, Matsix, Valsix)
>     End If
>     If mathas >= 7 Then
>         Call quest_Take_Item(index, Matseven, Valseven)
>     End If
>     Call quest_give_item(index, Item, 1)
> End If
>
> End Sub

This is the Call that initiates it, So far it gets thorugh PlayerMsg 1,2, and 3 but is halting at 4, couldnt find a problem and need help.

> '********************************
> Sub MenuScripts(Index, Clicked_Index, Menu_Type)
> '********************************
> Dim MenuTitle
> Dim FieldMessage
>
> MenuTitle = getplayermenuclicktitle(Index)
> FieldMessage = getplayermenuclickmsg(Index)
>
> Select Case Menu_Type
> Case 1
>          
>
> Case 2
>
> Case 3
> Call PlayerMsg(Index, "1", RED)
>             Call PlayerMsg(Index, "2", RED)
>                       If Clicked_Index = 1 Then
>                       Call PlayerMsg(Index, "3", RED)
>                             Call Craft(Index, 3, 8, 2, 45, 3, 44, 1, 46, 1, 0,0,0,0,0,0) 
>                       End If
> End Select
> End Sub

Thanks in advance.
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...