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

Exp based on Player and Npc level difference


irvanshihap
 Share

Recommended Posts

This tutorial simple and easy.

Server side

Look in modCombat, PlayerAttackNpc for:

```
' Calculate exp to give attacker
```

The line under it should be:

```
exp = Npc(npcNum).exp
```
below add :
```
                       ' Check if npc level is bigger then 0

    If NPC(NPCNum).Level > 0 Then

        ' exp deduction

        If NPC(NPCNum).Level <= GetPlayerLevel(attacker) - 10 Then

            ' 10 levels lower, exp 0

            Call PlayerMsg(attacker, "Musuhmu 10 level di bawahmu, kamu tidak akan mendapatkan exp.", BrightRed) ' IF you want you can delete this msg cuz its only informating player

            exp = 0

        ElseIf NPC(NPCNum).Level <= GetPlayerLevel(attacker) - 5 Then

            ' half exp if enemy is 5 levels lower

            Call PlayerMsg(attacker, "Musuhmu 5 level di bawahmu, kamu mendapatkan setengah exp.", BrightRed) ' IF you want you can delete this msg cuz its only informating player

            exp = exp / 2

        ElseIf NPC(NPCNum).Level >= GetPlayerLevel(attacker) + 10 Then

Call PlayerMsg(attacker, "Musuhmu 10 level di atasmu, kamu tidak akan mendapatkan exp.", BrightRed) ' IF you want you can delete this msg cuz its only informating player

        exp = 0

        End If

    End If
```This Tutorial credit Domino but i edited a bit
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...