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

Custom random experience from monsters.


Domino_
 Share

Recommended Posts

**_Easy and fast!_**

You can make random exp given from killing monsters!

**Client Side**

In **Editor_Npc** make TextBox **txtEXP_max** with empty text.

![](http://www.freemmorpgmaker.com/files/imagehost/pics/3fc8d8d675bbf3f0b0b41add90a62a8f.PNG)

In **Editor_Npc** code add this

```

Private Sub txtEXP_max_Change()

If Not Len(txtEXP_max.text) > 0 Then Exit Sub

If IsNumeric(txtEXP_max.text) Then NPC(EditorIndex).EXP_max = Val(txtEXP_max.text)

End Sub

```
In **Public Sub NpcEditorInit()**

afther

```

.txtEXP.text = NPC(EditorIndex).EXP

```
add

```

.txtEXP_max.text = NPC(EditorIndex).EXP_max

```

In **Server** and **Client** side, in **Private Type NpcRec** afther

```

EXP As Long

```
add

```

EXP_max As Long

```

And **Server** side change this

```

exp = Npc(npcNum).exp

```
to this

```

exp = rand((NPC(npcNum).exp), (NPC(npcNum).exp_max))

```

**Now you got random experience given from npc's. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)**

_Report bug's and give credits if you think its needed to. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)_

_Press Like if you like random experience from monsters! ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)_
Link to comment
Share on other sites

This is good ![:o](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/ohmy.png)! i didn't added for the moment but i like ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

(i just hope it works with all the engines EA , 3.0 etc ..)
Link to comment
Share on other sites

It should work because it doesnt affect anything except experience given from monsters what's in all engines the same.

***** Added small fix that saves and loads max npc exp. Tested code and noticed that I forgot about this. ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)
Link to comment
Share on other sites

Great! xD You're going to start a trend of new tutorials that do pretty much the same thing with different aspects of the game. I don't mean that in a bad way, because its great that this system can be applied to pretty much anything. If you're going to make more like this, i recommend putting it in one tutorial and just updating it. It would make things more convenient.
Link to comment
Share on other sites

Theese two tutorials show basically what need to change to make custom values from, to so I dont think I need to add more tutorials because people can see what I have done and do the same with damage and other things. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)

Like not only multiple drops from npc(this tut alrdy exist) but add that he drops random ammount of same item if its stackable. ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)
Link to comment
Share on other sites

In CmdSave add this before **Call NpcEditorOk**

```

If txtEXP > txtEXP_max Then

txtEXP_max.Value = txtEXP

txtEXP.Value = 0

End If

```

This will make the first txtEXp be 0 and txtEXP_max to be txtEXP if txtEXP will be bigger than txtEXP_max ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)

Also this is just for not confusing ur self because the numbers will go randomly between min and max.
Link to comment
Share on other sites

  • 11 months later...
change them to

```
If txtExp > txtEXP_max Then
txtEXP_max.Text = txtExp
txtExp.Text = 0
End If

```
you could of just read it, and relised you used a textbox for the txtEXP_max value to be defined in the item editor, thus meaning it needs to be a .text for input
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...