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

[EO 2.0] Modifying The Experiance Rate


viciousdead
 Share

Recommended Posts

This is a very simple code that allows you to change the experiance(exp) rate of your game without going through and editting npc's. If I get the time, I'll add more.

**Everything Is Server-sided**

**First make a scroll bar on the Server Conrol Panel and name it "scrlExpRate". Then above it make a label and call it "lblExpRate", should look something like this:**

>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/94fc0e0983a1e9ca0dbfc8e6a007524f.png)
**Now double click the scroll bar, and paste in this code:**

>! ```
Private Sub scrlExpRate_Change()
Dim EXPRATE As Long
>!     lblExpRate.Caption = "Exp Rate: " & frmServer.scrlExpRate.Value
    EXPRATE = frmServer.scrlExpRate.Value

    If frmServer.scrlExpRate.Value > 1 Then
        Call GlobalMsg("Experiance Rate For The Server Is Currently: " & frmServer.scrlExpRate.Value & "x", Yellow)
    Else
    If frmServer.scrlExpRate.Value = 0 Then
        Call GlobalMsg("Experiance Rate For The Server Is Currently: Frozen", Yellow)
    Else
        Call GlobalMsg("Experiance Rate For The Server Is Currently: Normal", Yellow)
    End If
    End If
End Sub
```
**Now go to modCombat, then search for "Sub PlayerAttackNpc", add this code underneath it:**

>! ```
    Dim EXPRATE As Long
```**Last, in modCombat, search for "Calculate exp to give attacker", replace that code with:**

>! ```
        ' Check server's experaince rate
        EXPRATE = frmServer.scrlExpRate.Value
        ' Calculate exp to give attacker
        exp = (Npc(npcNum).exp * EXPRATE)
```
**Screenshots**

>! [![](http://www.freemmorpgmaker.com/files/imagehost/pics/db8394a49f6866bc495c65dbc66bd220.png)](http://www.freemmorpgmaker.com/files/imagehost/#db8394a49f6866bc495c65dbc66bd220.png)
[![](http://www.freemmorpgmaker.com/files/imagehost/pics/4b87bfd97134de0bba790dd1fd335ca7.png)](http://www.freemmorpgmaker.com/files/imagehost/#4b87bfd97134de0bba790dd1fd335ca7.png)
Link to comment
Share on other sites

May want to know, it doesn't check for a level up. I.e. you're left with 999999/400 exp. You gotta kill something else to level up, etc.
Link to comment
Share on other sites

@Sekaru:

> May want to know, it doesn't check for a level up. I.e. you're left with 999999/400 exp. You gotta kill something else to level up, etc.

~~Your right, after I finish my homework, I'll edit the code.~~

Wait, no, I was max leveled, that's why it did that, it auto detected the level, Robin made the code for that, I just edited the exp formula.

@DarkKang:

> You forgot:
>
> We need to do: "Dim EXPRATE As Long" at start of Public Sub PlayerAttackNpc
>
> (Sorry bad english I'm brazilian)
>
> Or I'm crazy? '-'

Lol, I was half awake when I did this, it looks horrible, I'm editting right now.

EDIT:I had to edit it twice, first time I changed directions, second time I changed the code to fit the directions(FAIL). It works now.
Link to comment
Share on other sites

  • 3 weeks later...
> ' in party?
>         If TempPlayer(attacker).inParty > 0 Then
>             EXPRATE = frmServer.expratescrl.Value
>             exp = (NPC(npcnum).exp * EXPRATE)
>             ' pass through party sharing function
>             Party_ShareExp TempPlayer(attacker).inParty, exp, attacker
>         Else
>             ' no party - keep exp for self
>             Call SetPlayerExp(attacker, GetPlayerExp(attacker) + exp)
>             SendEXP attacker
>             SendActionMsg GetPlayerMap(attacker), "+" & exp & " EXP", White, 1, (GetPlayerX(attacker) * 32), (GetPlayerY(attacker) * 32)
>             ' check if we've leveled
>             CheckPlayerLevelUp attacker
>             End If

This is don't work…
Link to comment
Share on other sites

Just a small note, a larger amount of functionality can be added to this by changing it to a % based system So instead of…
exp = Npc(npcNum).exp * EXPRATE
you would put...
exp = (Npc(npcNum).exp / 100) * EXPRATE)
:)

allows an easy way to get 150% etc.
Link to comment
Share on other sites

  • 2 weeks later...
Obviously it does have a default value, you are blind.
Go to the form on the server then click on the tab which shows the slider you just added, then go to it's properties and go to default value, change this to 100.
Link to comment
Share on other sites

  • 10 months later...
@Robin:

> Change the default value of the control.

i can't do :( somebody do it?
```
Private Sub scrlExpRate_Change()
Dim EXPRATE As Long

    lblExpRate.Caption = "Exp Rate: " & frmServer.scrlExpRate.Value
    EXPRATE = frmServer.scrlExpRate.Value

    If frmServer.scrlExpRate.Value > 1 Then
        Call GlobalMsg("Poziom doÅ›wiadczenia: " & frmServer.scrlExpRate.Value & "x", Yellow)
    Else
    If frmServer.scrlExpRate.Value = 0 Then
        Call GlobalMsg("Poziom doÅ›wiadczenia: Normalny", White)
    End If
    End If
End Sub
```
Link to comment
Share on other sites

@Mortal:

> When it is on 0 will gain the player the normal EXP's which are generated in the NPC Data?
> And when i put in on 2 will the player gahter the EXP which are generatet x2 or only 2 EXP?

When it is on zero no EXP will be given.
When it is on one regular EXP will be given.
When it is on two twice the EXP will be given.

@SholT:

> i can't do :( somebody do it?
> ```
> Private Sub scrlExpRate_Change()
> Dim EXPRATE As Long
>
>     lblExpRate.Caption = "Exp Rate: " & frmServer.scrlExpRate.Value
>     EXPRATE = frmServer.scrlExpRate.Value
>    
>     If frmServer.scrlExpRate.Value > 1 Then
>         Call GlobalMsg("Poziom doÅ›wiadczenia: " & frmServer.scrlExpRate.Value & "x", Yellow)
>     Else
>     If frmServer.scrlExpRate.Value = 0 Then
>         Call GlobalMsg("Poziom doÅ›wiadczenia: Normalny", White)
>     End If
>     End If
> End Sub
> ```

Go to the scrollbar and just set the value to whatever you want the default rate to be.
Link to comment
Share on other sites

  • 3 months later...
When I first put this code into my server, I set the Exp Rate to "VERY HIGH" and it work fine,  but later on (A couple Days) when I Killed monster I got 0 EXP and was Like WTF?!??!  When I check the exp rate slide bar it was set to  Zero on default … So, to help All Noobs out there (like myself), I suggest adding somewhere To change the "min. 0"  to "min:1" in property box  for the Exp Rate slide bar.... :)

*It's no big problem but you'll just have to change the Min:0 to Min: 1 Every time you open the server
which is annoying and you are very likely to forget.
Link to comment
Share on other sites

  • 2 weeks later...
Works great, took me a few tries until I noticed that in order to get the new scroll bar to appear, I needed to make a new server.exe xD  First time using VB :S

EDIT: To the comment above, I found that changing the value of the scroll box to 1 will default it to 1x exp.
Link to comment
Share on other sites

@chamster:

> When I first put this code into my server, I set the Exp Rate to "VERY HIGH" and it work fine,  but later on (A couple Days) when I Killed monster I got 0 EXP and was Like WTF?!??!  When I check the exp rate slide bar it was set to  Zero on default … So, to help All Noobs out there (like myself), I suggest adding somewhere To change the "min. 0"  to "min:1" in property box  for the Exp Rate slide bar.... :)
>
> *It's no big problem but you'll just have to change the Min:0 to Min: 1 Every time you open the server
> which is annoying and you are very likely to forget.

In```
Private Sub Form_Load()
```add```
frmServer.scrlExpRate.Value = 1
```So exp rate will be 1 all time when start server.
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...