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

Resources With Level Requirements.


JohnPony
 Share

Recommended Posts

Wrote this tutorial cause i was bored, not sure if it was done before, and seen someone in the Q&A board asking for it.

Client Side:
In frmEditor_Resource your going to want to add two new controls:
#1: A Label control, name it```
lblLevelNeeded
```#2: A Horizontal scroll bar, name it```
scrlLvlReq
```
Now go into code view of frmEditor_Resource and add this at the bottom:
```
Private Sub scrlLvlReq_Change()
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If EditorIndex = 0 Or EditorIndex > MAX_RESOURCES Then Exit Sub
    lblLevelNeeded.Caption = "Level req: " & scrlLvlReq
    Resource(EditorIndex).LevelReq = scrlLvlReq.value

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlLvlReq_Change", "frmEditor_Resource", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
Now in modGameEditors search for:
```
.scrlAnimation.value = Resource(EditorIndex).Animation
```Right below it add:
```
.scrlLvlReq.value = Resource(EditorIndex).LevelReq
```
Now in modTypes search for:
```
Private Type ResourceRec
```Right below:```
Animation As Long
```Add:
```
LevelReq As Long
```
That finishes up client sided work… Lets move on to the server stuff.
in modTypes once again search for:```
Private Type ResourceRec
```And Right below:```
Animation As Long
```Add:
```
LevelReq As Long
```
Now in modPlayer search for:```
If Item(GetPlayerEquipment(Index, Weapon)).data3 = Resource(Resource_index).ToolRequired Then
```Right below that add:
```
  ' level requirement
                If GetPlayerLevel(Index) < Resource(Resource_index).LevelReq Then
                    PlayerMsg Index, "You do not meet the level requirement for this resource!", BrightRed
                    Exit Sub
                End If
```And that should be it! Enjoy ;)
*If i forgot anything just tell me
Link to comment
Share on other sites

@John:

> This is pretty useless in my view, but some people see a use for it.

Well I guess it gives people things to work on, so the game isn't just battles and quests, some people like leveling and skilling(usually girls :P).

But anyways…yeah it is kind of useless..
Link to comment
Share on other sites

If you added the weapons profiencies tutorial all ya need to do to make  it use you woodcutting level or whatever other skill u want is use this in the server side check resource sub :0```
If Resource(Resource_index).resourcetype = 1 Then
                      ' level requirement
                If GetPlayerWoodcutting(index) < Resource(Resource_index).LevelReq Then
                    PlayerMsg index, "You do not meet the level requirement for this resource!", BrightRed
                    Exit Sub
                  End If
              End If
```Thanks you very much for this tutorial tho!  I like this way better than having to make a buncha different tools with different tool powers and such. And  i love skilling! (Im totally not a girl.(I think.))
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...