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

[CS:DE] Understanding the character Vitals Code? (Solved)


Mutedwar
 Share

Recommended Posts

Just had a few questions on understanding the basic calculations of the class vitals. I'm having a hard time understanding this:
**GetPlayerMaxVital = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 15 + 150**
What exactly do these lines of code do and calculate? Any help would be much appreciated and sorry if it's a dumb question just trying to get familiar with VB6 :). So far I see it gets maxvital & player level and then 15+150 for endurance were does the 15 + 150 come into play?

```
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 3 ' Rogue
                    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 3 ' Rogue
                    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
```
**Solved: Thanks Jaxx & Soul, I'm glad I started with CS:DE I love these advanced calculations (might not be advanced for you guys but It's awesome to be learning these things**
@Jaxx:

@Soul:
Link to comment
Share on other sites

@Jaxx:

> Basically all you have to know is the '15 + 150' basically what this is saying is for every 15 stat points in endurance, the change is 150.

No. That's not what it says, it says:

* Add the player's endurance and level, divide it by two.* Multiply the result by 15.* Add 150 to it.

The result is the player's HP. If you want to know for MP, read endurance as intelligence.
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...