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

Exp based on npc lvl.


Domino_
 Share

Recommended Posts

> Now, what would be great would be a tutorial on how to add EXP decreasing the farther away your level is from the NPC.

Actually this is very easy and modifyable code, I'v took tkis from my old project, with this code player wont get experience if npc will be 5 levels lower than him or wil get halp exp if npc will be 3 lvl's lower. You can also make if npc is 5 or more lvl's higher he gives more exp.

In **Server side** **ModGameLogic** in **Public Sub GivePlayerEXP** afther

```

If Not GetPlayerLevel(index) >= MAX_LEVELS Then

```
add

```

' Check if npc level is bigger then 0

If enemyLevel > 0 Then

' exp deduction

If enemyLevel <= GetPlayerLevel(index) - 5 Then

' 5 levels lower, exit out

Call PlayerMsg(index, "Enemy is 5 levels lower, you wont get experience.", BrightRed) ' IF you want you can delete this msg cuz its only informating player

Exit Sub

ElseIf enemyLevel <= GetPlayerLevel(index) - 3 Then

' half exp if enemy is 3 levels lower

Call PlayerMsg(index, "Enemy was 3 levels lower, you got half of experience.", BrightRed) ' IF you want you can delete this msg cuz its only informating player

exp = exp / 2

ElseIf enemyLevel >= GetPlayerLevel(index) + 5 Then

Exit Sub

End If

End If

```
Link to comment
Share on other sites

  • 1 month later...
> Good, but simple, edit. I know its modifiable, but you would need a game that has a wide variety of monsters to kill to have the number at 5 levels. Anyways, keep up the good work!

It might even work with eo 1.0 because I dont think that someone is messing mutch with experience in eo.
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...