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

Scripted items not working?


Dastyruck
 Share

Recommended Posts

So, I was putting in some scripted spells and when I finally got it working, scripted items dont work at all…

Here is the scripted item sub.

```
'********************************
Sub ScriptedItem(Index, Script)
'********************************
Dim level
Dim needs
Dim number 
Dim numbers
Dim slot
Dim has
Dim value
Dim mun
Dim need
Select Case Script
Case 0
    needs = 6
    number = 14
    numbers = 2
    value = 1
    slot=1
has = 0
need = 1
    level = GetPlayerMAGI(Index)
If level < needs Then
    Call PlayerMsg(Index, "Your magic is too low to use this.", WHITE)
Else

                  Do While slot.
                  0 < 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
                  slot=1
                  If Int(has) <> Int(need) Then
                  Else 
                        Call quest_Take_Item(index, number, value)
                        Do While slot < 25
                        If Getplayerinvitemnum( index, Int( slot ) ) = 0 Then
                            Call SetPlayerInvItemNum(index, Int( slot ), Int( numbers ) )
                            Call SetPlayerInvItemValue(index, Int( slot ), Int(1) )
                            Call SendInventoryUpdate(index, Int(slot) )
                            slot = 25
                        End If
                        slot = slot + 1
                        Loop
                  End If
End If
Exit Sub

Case Else
Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
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...