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

More lives


We9mak
 Share

Recommended Posts

  • 2 weeks later...
I'm not quite sure what you mean, but I'd assume you want to reduce the Max HP of players… If this is the case, and you're running EO 2.0, I'll proudly share what little knowledge of sourcing I have.

Start off by opening server.vbp. When it has loaded, view the code of modCombat. In there you'll find the following code:

```
Function GetPlayerMaxVital(ByVal index As Long, ByVal Vital As Vitals) As Long
    If index > MAX_PLAYERS Then Exit Function
    Select Case Vital
        Case HP
            Select Case GetPlayerClass(index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 15 + 150
                Case 2 ' Mage
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 5 + 65
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 15 + 150
            End Select
        Case MP
            Select Case GetPlayerClass(index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 5 + 25
                Case 2 ' Mage
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 30 + 85
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 5 + 25
            End Select
    End Select
End Function
```Editing the different cases would change the health of your different classes. Change them to something like

```
                Case 1 ' Warrior
                    GetPlayerMaxVital = (GetPlayerLevel(index) * 10) + (GetPlayerStat(index, Endurance) * 5) + 150
                Case 2 ' Mage
                    GetPlayerMaxVital = (GetPlayerLevel(index) * 10) + (GetPlayerStat(index, Endurance) * 5) + 150
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = (GetPlayerLevel(index) * 10) + (GetPlayerStat(index, Endurance) * 5) + 150
```If a level 100 player has 500 Endurance, they would have 3650 HP.

Edit: Right, the topic says "More lives", so just change it to something else.

```
                Case 1 ' Warrior
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 30 + 150
                Case 2 ' Mage
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 10 + 65
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 30 + 150
```This would almost double their health at higher levels.
Link to comment
Share on other sites

@Xlithan:

> I think he's trying to say that he wants a feature where if you die a maximum amount of times your character is unplayable. Like Hardcore Diablo 2 perhaps?

He said when people get to level 100 they have 40,000 lives. Unless he already has a feature in place this would make no sense at all.
Link to comment
Share on other sites

@Grim:

> good job but is there a way to make the max hp 999?

Try this, it might not be optimized, but it does the trick. ;)

Add the following right before End Function in GetPlayerMaxVital in modCombat. The comments explain the code.
```
    If GetPlayerMaxVital > 999 Then ' This says that if the player has more than 999 HP
        GetPlayerMaxVital = 999 ' It sets the HP to 999.
    End If ' This ends the If-command.
```

It should look like this:
```
Function GetPlayerMaxVital(ByVal index As Long, ByVal Vital As Vitals) As Long
    If index > MAX_PLAYERS Then Exit Function
    Select Case Vital
        Case HP
            Select Case GetPlayerClass(index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 999 + 150
                Case 2 ' Mage
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 5 + 65
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 15 + 150
            End Select
        Case MP
            Select Case GetPlayerClass(index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 5 + 25
                Case 2 ' Mage
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 30 + 85
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 5 + 25
            End Select
    End Select
    If GetPlayerMaxVital > 999 Then ' This says that if the player has more than 999 HP
        GetPlayerMaxVital = 999 ' It sets the HP to 999.
    End If ' This ends the If-command.

End Function
```

Sorry if I'm not allowed to make code for others and just give it to them, but I did add comments explaining the code so that people can learn.
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...