Player specific max attributes

See post later down.

Here’s where you went wrong:


Call SetPlayerMaxBSkill(index, GetPlayerMaxBSkill(index) + 3)

Change it to this:


Call SetPlayerMaxBSkill(index, GetPlayerMaxBSkill(index), GetPlayerMaxBSkill(index) + 3)

You were missing an argument.

/Removed


Public Sub SetPlayerMaxBAtt(ByVal index As Long, ByVal Stat As Long, ByVal Value As Byte)

Player(index).MaxBAtt(Stat) = GetPlayerMaxBAtt(index, Stat) + Value

End Sub

Public Function GetPlayerMaxBAtt(ByVal index As Long, ByVal Stat As Long)

GetPlayerMaxBAtt = Player(index).MaxBAtt(Stat)

Exit Function

End Function


Sub CheckPlayerLevelUp(ByVal index As Long)

Dim i As Long

Dim expRollover As Long

Dim level_count As Long

Dim n 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) + 4)

Call SetPlayerBPOINTS(index, GetPlayerBPOINTS(index) + (16 + ((GetPlayerLevel(index) - 1) * 4)))

Call SetPlayerMaxBSkill(index, GetPlayerMaxBSkill(index) + 3)

If GetPlayerLevel(index) Mod 2 = 0 Then

For n = 1 To (MaxBAtts.MaxBAtt_count - 1)

Call SetPlayerMaxBAtt(index, n, 2)

next

Else

For n = 1 to (MaxBAtts.MaxBAtt_count - 1)

Call SetPlayerMaxBAtt(index, n, 3)

Next

End If

Call SetPlayerExp(index, expRollover)

level_count = level_count + 1

Loop

If level_count > 0 Then

If level_count = 1 Then

'singular

GlobalMsg GetPlayerName(index) & " is now Level " & GetPlayerLevel(index) & " !", Brown

Else

'plural

GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown

End If

For i = 1 To Vitals.Vital_Count - 1

SendVital index, i

Next

SendEXP index

SendPlayerData index

End If

End Sub

Richy is God.

Richy is God.

Log in to reply