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

[EO] Pvp system addition (not tested)


fuinharlz
 Share

Recommended Posts

_edit: tested it, works fine. If a player is 10 lvls lower or 10 lvls higher than other player, he's not able to attack. If he's 9 lvls lower or higher, he's still able to attack!

Tested it with version 1…_

I was thinking on pvp to start my game, but something ALWAYS gets on my mind… if I make a pvp game, with a min pvp lvl, even having a pk system, where u turn into a bad player and can't enter town anymore untill u redeem yourself, there'll still be people getting to high lvl and running to low lvl areas to freely kill newbies and ruin theyr play experience.

So I came up in mind with something simple, that would prevent this: a pvp level range!

I planed this to work like this: after all checks if the pk attack is possible (map, players in same map, if it's an admin trying to attack a player, if both have the min pvp lvl, etc), the game will check the players lvl (booth attacker and victim), and if the attacker is 10 lvls+ higher or 10 lvls- lower then the victim, it just won't let him attack! So, players need to be in difference range of 10 lvls to attack each other, making things "better".

I didn't tested it yet (I just started editing the code), so, I'm not sure wich "version" to use, but I'll post both here!
All changes are made on server source.

In both, go to modules - modCombat and search fo player attacking player, and just after

```
' Make sure victim is high enough level
    If GetPlayerLevel(victim) < 10 Then
        Call PlayerMsg(attacker, GetPlayerName(victim) & " is below level 10, you cannot attack this player yet!", BrightRed)
        Exit Function
    End If
```
insert ONE of the versions.

**version one**

```
' Make sure attacker and victim are in range
If GetPlayerLevel(attacker) >= GetPlayerLevel(victim) + 9 or GetPlayerLevel(attacker) <= GetPlayerLevel(victim) - 9 Then
    Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed)
    Exit Function
End If
```
**Version 2**

```
' Make sure attacker and victim are in range
If GetPlayerLevel(attacker) >= GetPlayerLevel(victim) + 9 Then
    Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed)
    Exit Function
End If

' Make sure attacker and victim are in range
If GetPlayerLevel(attacker) <= GetPlayerLevel(victim) - 9 Then
    Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed)
    Exit Function
End If
```

I think the first version is simplier but not sure it'll work checking both if lvl is lower or higher, this is Y I made "version 2". I'm going to try  to find some "friends" and check if they can help me testing both version, but if anybody test it before, post ur comments here.

Thanks, and sorry for anything, this was my first changes and "tutorial" on Eclipse ever  :P

how it works:

player A is lvl 12 and player b is lvl 15… they can fight.

Player A is lvl 12, player b is lvl 23: they CAN'T fight.

simple addition, but I think it'll help ppl to develop games with pvp without high lvl players abuse!
Link to comment
Share on other sites

@Sekaru:

> .. Uhh. So you added level requirements for PvP.. which were already in there.. yeah, great.

Actually there's a MINIMUM lvl requirement for pvp, but, after u get in the min pvp lvl, you can attack anybody from "min pvp lvl" to max lvl (and be attacked by).

This code prevents someone 10 lvls higher/lower than you to attack you, or you to attack someone 10 lvls loweer/higher.
Link to comment
Share on other sites

  • 3 months later...

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...