Player stats

How the player stats works?

I have 15 point in Int and I have 1810 mana in lv 100, but I’m not a mage

And my friend have 100+ points in Int and and have 1000- mana in lv 100, and he’s a mage

How the STR, END, AGI, INT and WILL works?

Depends on your engine. These are examples.

By default, intelligence is used only for MP. For HP/MP:

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

Endurance increases hp (as in first spoiler) as well as block chance & defence:

! ```
Function CanPlayerBlockHit(ByVal Index As Long) As Boolean
! Dim I As Long
! Dim n As Long
! Dim ShieldSlot As Long
! ShieldSlot = GetPlayerEquipment(Index, Shield)
! If ShieldSlot > 0 Then
! n = Int(Rnd * 2)
! If n = 1 Then
! I = (GetPlayerStat(Index, Stats.Endurance) \ 2) + (GetPlayerLevel(Index) \ 2)
! n = Int(Rnd * 100) + 1
! If n <= I Then
! CanPlayerBlockHit = True
! End If
! End If
! End If
! End Function

Function GetPlayerProtection(ByVal Index As Long) As Long
>!     Dim Armor As Long
>!     Dim Helm As Long
>!     GetPlayerProtection = 0
>!     ' Check for subscript out of range
>!     If isPlaying(Index) = False Or Index <= 0 Or Index > Player_HighIndex Then
>!         Exit Function
>!     End If
>!     Armor = GetPlayerEquipment(Index, Armor)
>!     Helm = GetPlayerEquipment(Index, Helmet)
>!     GetPlayerProtection = (GetPlayerStat(Index, Stats.Endurance) \ 5)
>!     If Armor > 0 Then
>!         GetPlayerProtection = GetPlayerProtection + Item(Armor).Data2
>!     End If
>!     If Helm > 0 Then
>!         GetPlayerProtection = GetPlayerProtection + Item(Helm).Data2
>!     End If
>! End Function
```

Str works to increase dmg 
>! ```
>! Function GetPlayerDamage(ByVal Index As Long) As Long
>!     Dim weaponNum As Long
>!    
>!     GetPlayerDamage = 0
>!     ' Check for subscript out of range
>!     If isPlaying(Index) = False Or Index <= 0 Or Index > MAX_PLAYERS Then
>! 	    Exit Function
>!     End If
>!     If GetPlayerEquipment(Index, weapon) > 0 Then
>! 	    weaponNum = GetPlayerEquipment(Index, weapon)
>! 	    GetPlayerDamage = 0.085 * 5 * GetPlayerStat(Index, Strength) * Item(weaponNum).Data2 + (GetPlayerLevel(Index) / 5)
>!     Else
>! 	    GetPlayerDamage = 0.085 * 5 * GetPlayerStat(Index, Strength) + (GetPlayerLevel(Index) / 5)
>!     End If
>!    
>!     For weaponNum = 1 To Equipment.Equipment_Count - 1
>! 	    If Player(Index).Equipment(weaponNum) > 0 Then
>! 		    GetPlayerDamage = GetPlayerDamage * (1 + Item(Player(Index).Equipment(weaponNum)).DMGPercent)
>! 	    End If
>!     Next
>! End Function
>! ```
and ability to parry
>! ```
>! Public Function CanPlayerParry(ByVal Index As Long) As Boolean
>! Dim rate As Long
>! Dim RndNum As Long
>!     CanPlayerParry = False
>!     rate = GetPlayerStat(Index, Strength) * 0.25
>!     RndNum = rand(1, 100)
>!     If RndNum <= rate Then
>! 	    CanPlayerParry = True
>!     End If
>! End Function
>! ```

Agility is for dodge and critical rates:

>! ```
Public Function CanPlayerCrit(ByVal Index As Long) As Boolean
>! Dim rate As Long
>! Dim RndNum As Long
>!     CanPlayerCrit = False
>!     rate = GetPlayerStat(Index, Agility) / 52.08
>!     RndNum = rand(1, 100)
>!     If RndNum <= rate Then
>!         CanPlayerCrit = True
>!     End If
>! End Function
>! Public Function CanPlayerDodge(ByVal Index As Long) As Boolean
>! Dim rate As Long
>! Dim RndNum As Long
>!     CanPlayerDodge = False
>!     rate = GetPlayerStat(Index, Agility) / 83.3
>!     RndNum = rand(1, 100)
>!     If RndNum <= rate Then
>!         CanPlayerDodge = True
>!     End If
>! End Function
```

Willpower only increases regeneration rate:
>! ```
Function GetPlayerVitalRegen(ByVal Index As Long, ByVal Vital As Vitals) As Long
>!     Dim I As Long
>!     ' Prevent subscript out of range
>!     If isPlaying(Index) = False Or Index <= 0 Or Index > MAX_PLAYERS Then
>!         GetPlayerVitalRegen = 0
>!         Exit Function
>!     End If
>!     Select Case Vital
>!         Case HP
>!             I = (GetPlayerStat(Index, Stats.Willpower) * 0.8) + 6
>!         Case MP
>!             I = (GetPlayerStat(Index, Stats.Willpower) / 4) + 12.5
>!     End Select
>!     If I < 2 Then I = 2
>!     GetPlayerVitalRegen = I
>! End Function
```

Considering your mana problem, I’m guessing your Mage class isn’t class #2 in your game. Easiest to just edit that part of the code accordingly. Those equations are all server-side, by the way, so no worries about players needing any updated clients!

(Excuse the double-post. Post edits seem to ruin code nesting for me.)

OMG! Thanks!

So, how can I make the Willpower increase the skills dmg?

Again, it depends on your engine.

Somewhere, server-side in modCombat, Sub Cast Spell, you should see a line like```

Vital = Spell(spellnum).Vital

This is the damage calculation. It's used for damaging spells as well as healing spells. If you'd like to change all spell damages, replace that with something like:```

Vital = Spell(spellnum).Vital * GetPlayerStat(Index,Willpower)/50

This example would add 2% spell damage per willpower, rounded after the calculation. You’ll have to fiddle with it to get something balanced. (IMO 2% per will is overpowered… maybe 1% from /100). You could also do something like:```

Vital = Spell(spellnum).Vital + GetPlayerStat(Index,Willpower)/4

This would add 1 dmg per 4 points of willpower and is similar to the old formula from Mirage Source.

If you'd like a different formula for each spell type, find that first vitals formula and stick something like this in right after it:

Select Case Spell(spellnum).Type

 Case SPELL_TYPE_HEALHP

	 Vital = Vital * GetPlayerStat(Index, Willpower) / 30

 Case SPELL_TYPE_HEALMP

	 Vital = Vital * GetPlayerStat(Index, Willpower) / 20

 Case SPELL_TYPE_DAMAGEHP

	 Vital = Vital * GetPlayerStat(Index, Willpower) / 70

 Case SPELL_TYPE_DAMAGEMP

	 Vital = Vital * GetPlayerStat(Index, Willpower) / 40

End Select


You'll want to double-check that the type names are correct for your engine. I'm not sure, but I think they're the same across the board.

Thanks

So, if I use


Vital = Spell(spellnum).Vital + GetPlayerStat(index, Willpower) / 7

This would add 1 dmg per 7 will points?

And if I use this in the End code


Case HP

I = (GetPlayerStat(Index, Stats.Willpower) * 0.8) + 6

This would add HP regen?

That’s correct?

Thanks

So, if I use


Vital = Spell(spellnum).Vital + GetPlayerStat(index, Willpower) / 7

This would add 1 dmg per 7 will points?

Yes, if replacing the similar line in Sub CastSpell.

My bad, this has a minor flaw. IIRC, automatic type conversions round towards the nearest even number. You won’t see your first bonus until 7 willpower, but then the second at 11, and the third at 21, fourth at 25, … A little wonky. You can use Int(GetPlayerStat(Index,Willpower)/7) to round down ( + 1 at 7, 14, 21, 28, …), or Int((GetPlayerStat(Index,Willpower)/7)+.5) to round up (+1 at 4, 11, 18, 25, …).

And if I use this in the End code


Case HP

I = (GetPlayerStat(Index, Stats.Willpower) * 0.8) + 6

This would add HP regen?

If you’re talking about spells, this wouldn’t add regen. To add hp regen in spells, you want vitals-over-time, (which is already built into EFF - the engine you’re on yeah?) All this does is change the value of the variable I. How that variable is used still depends on the context.

Thanks, this help me so much!

Resolved!

Log in to reply