Domino_ Posted September 26, 2012 Author Share Posted September 26, 2012 **_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 SubIf 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 More sharing options...
clark Posted September 26, 2012 Share Posted September 26, 2012 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 More sharing options...
Domino_ Posted September 26, 2012 Author Share Posted September 26, 2012 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 More sharing options...
Matt Posted September 26, 2012 Share Posted September 26, 2012 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 More sharing options...
Domino_ Posted September 26, 2012 Author Share Posted September 26, 2012 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 More sharing options...
Guest Posted September 26, 2012 Share Posted September 26, 2012 yep this totaly had been used as a hp randomizer now thanks! Link to comment Share on other sites More sharing options...
Domino_ Posted September 26, 2012 Author Share Posted September 26, 2012 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 More sharing options...
Alerd Posted September 26, 2012 Share Posted September 26, 2012 Thanx Domino for very good tutorial ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
draginvoke5 Posted September 26, 2012 Share Posted September 26, 2012 Now, what would be great would be a tutorial on how to add EXP decreasing the farther away your level is from the NPC. Link to comment Share on other sites More sharing options...
Matt Posted September 26, 2012 Share Posted September 26, 2012 I believe that one was made earlier on if your level is 20 levels or higher than the NPC's, you don't get xp. Its fairly easy to do. Link to comment Share on other sites More sharing options...
Alerd Posted September 24, 2013 Share Posted September 24, 2013 Hi i have small error im add```If txtEXP > txtEXP_max ThentxtEXP_max.Value = txtEXPtxtEXP.Value = 0End If```and have error![](http://www.iv.pl/images/03364922539122689600.png) Link to comment Share on other sites More sharing options...
BeNjO Posted September 24, 2013 Share Posted September 24, 2013 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 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