Mirage Engine
Raising Stats (HP, MP, SP) - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Raising Stats (HP, MP, SP) (/showthread.php?tid=514)



Raising Stats (HP, MP, SP) - Elmrok - 21-12-2006

Can someone tell me what I have to do to make the class max hp raise up. right now it is like 1 + class str / 2 + class str * 2 or something like that. i want them to be class str * class def can anyone tell me how to do this?


- Leighland - 23-12-2006

in your server code, in mod gamelogic

replace this:
Code:
Function GetClassMaxHP(ByVal ClassNum As Long) As Long
    GetClassMaxHP = (1 + Int(Class(ClassNum).STR / 2) + Class(ClassNum).STR) * 2
End Function

with this:
Code:
Function GetClassMaxHP(ByVal ClassNum As Long) As Long
    GetClassMaxHP = Class(ClassNum).STR * Class(ClassNum).DEF
End Function

I think thats what you're trying to achieve, if not, post again.


- Elmrok - 23-12-2006

That helped some, but the characters stats don't save correctly. My stats are 10 each so the HP and MP shoud be 100 but the character stats are like 32 - 36. Do you know whats wrong with that?


- Leighland - 23-12-2006

You probably need to change it in the GetPlayerMaxHP Sub as well, so change this:

Code:
Function GetPlayerMaxHP(ByVal index As Long) As Long
Dim Charnum As Long
Dim i As Long

    Charnum = Player(index).Charnum
    GetPlayerMaxHP = (Player(index).Char(Charnum).Level + Int(GetPlayerSTR(index) / 2) + Class(Player(index).Char(Charnum).Class).STR) * 2
End Function
To this:
Code:
Function GetPlayerMaxHP(ByVal index As Long) As Long
    GetPlayerMaxHP = GetPlayerSTR(index) * GetPlayerDEF(Index)
End Function



- Elmrok - 24-12-2006

Thanks, this helped me a lot. I got it working now.