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

[EW]Error/bug with Endurance stat.


szkat123
 Share

Recommended Posts

In modCombat (server side)

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

```
Link to comment
Share on other sites

```
Sub CheckPlayerLevelUp(ByVal index As Long)
Dim i As Long
Dim expRollover As Long
Dim level_count As Long

level_count = 0

Do While GetPlayerExp(index) >= GetPlayerNextLevel(index)
expRollover = GetPlayerExp(index) - GetPlayerNextLevel(index)

' can level up?
If Not SetPlayerLevel(index, GetPlayerLevel(index) + 1) Then
Exit Sub
End If

Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + x) "<- change this"
Call SetPlayerExp(index, expRollover)
level_count = level_count + 1
Loop

If level_count > 0 Then
If level_count = 1 Then
'singular
GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown
Else
'plural
GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown
End If
SendEXP index
SendPlayerData index
End If
End Sub

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