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

Problem With MaxVital


Prince
 Share

Recommended Posts

Hi , I got problem with this, I change its formula. But the its only effect 5 value only. I mean when i equip something it just rise up ta 5 more value , ex : before i have 200HP after equip i got 205Hp. also the MP too.

Even when i change the formula to default , it also like this.

>! Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long
    Dim i As Long
    If Index > MAX_PLAYERS Then Exit Function
    Select Case Vital
        Case HP
            Select Case GetPlayerClass(Index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = (GetPlayerStat(Index, Endurance)) * 15 + 350
                    GetPlayerMaxVital = (GetPlayerStat(Index, Strength) / 2) * 5 + 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 + 500
            End Select
        For i = 1 To 10
                If TempPlayer(Index).Buffs(i) = BUFF_ADD_HP Then
                    GetPlayerMaxVital = GetPlayerMaxVital + TempPlayer(Index).BuffValue(i)
>!                 End If
                If TempPlayer(Index).Buffs(i) = BUFF_SUB_HP Then
                    GetPlayerMaxVital = GetPlayerMaxVital - TempPlayer(Index).BuffValue(i)
                End If
            Next
        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, Endurance) / 2)) * 15 + 70
                    GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 150
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25
            End Select
        For i = 1 To 10
                If TempPlayer(Index).Buffs(i) = BUFF_ADD_MP Then
                    GetPlayerMaxVital = GetPlayerMaxVital + TempPlayer(Index).BuffValue(i)
                End If
                If TempPlayer(Index).Buffs(i) = BUFF_SUB_MP Then
                    GetPlayerMaxVital = GetPlayerMaxVital - TempPlayer(Index).BuffValue(i)
                End If
            Next
    End Select
End Function

Please help  :sad:
Link to comment
Share on other sites

My My , My mistake. I fixed it Sorry. This is the fix  :cheesy:

>! Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long
    Dim i As Long
    If Index > MAX_PLAYERS Then Exit Function
    Select Case Vital
        Case HP
            Select Case GetPlayerClass(Index)
                Case 1 ' Warrior
                    GetPlayerMaxVital = (GetPlayerStat(Index, Endurance)) * 15 + 350
                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 + 500
            End Select
        For i = 1 To 10
                If TempPlayer(Index).Buffs(i) = BUFF_ADD_HP Then
                    GetPlayerMaxVital = GetPlayerMaxVital + TempPlayer(Index).BuffValue(i)
>!                 End If
                If TempPlayer(Index).Buffs(i) = BUFF_SUB_HP Then
                    GetPlayerMaxVital = GetPlayerMaxVital - TempPlayer(Index).BuffValue(i)
                End If
            Next
        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, Endurance) / 2)) * 15 + 70
                    GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 150
                Case Else ' Anything else - Warrior by default
                    GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25
            End Select
        For i = 1 To 10
                If TempPlayer(Index).Buffs(i) = BUFF_ADD_MP Then
                    GetPlayerMaxVital = GetPlayerMaxVital + TempPlayer(Index).BuffValue(i)
                End If
                If TempPlayer(Index).Buffs(i) = BUFF_SUB_MP Then
                    GetPlayerMaxVital = GetPlayerMaxVital - TempPlayer(Index).BuffValue(i)
                End If
            Next
    End Select
End Function
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...