troglodite Posted April 20, 2013 Author Share Posted April 20, 2013 Not a tutorial at all, but a guide for change the HP & MP that classes gets for each levelSo I was looking around the codes because my character class 2# haves more MP than my 7# ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) and its annoying because I want all my characters to have the same HP and MP (I have my reasons lol)So I search and find this:```' ################################' ## Basic Calculations ##' ################################Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As LongIf Index > MAX_PLAYERS Then Exit FunctionSelect 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 SelectEnd SelectEnd Function```Here is where each class gets HP & MP for each levelTo change it, change the values of the cases**Example:**From original```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```To all classes gains the same HP for each level(Under Case HP):``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150```So now each class will gain the same Hp as the 1st class (Warrior)And for MP (Under Case MP):``` Case 1 ' Warrior 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)) * 30 + 85```**Tested** ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
boyesjs03 Posted April 20, 2013 Share Posted April 20, 2013 If you wanted all the classes to be the same you could just remove the Case Select altogether and save the tiniest amount of memory ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
troglodite Posted April 20, 2013 Author Share Posted April 20, 2013 > If you wanted all the classes to be the same you could just remove the Case Select altogether and save the tiniest amount of memory ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)Like that?```' ################################' ## Basic Calculations ##' ################################Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As LongIf Index > MAX_PLAYERS Then Exit FunctionSelect Case VitalCase HPGetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150Case mpGetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85End SelectEnd Function```Is it Ok?? (I am newbie to coding ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)) Link to comment Share on other sites More sharing options...
boyesjs03 Posted April 20, 2013 Share Posted April 20, 2013 Test it and find out xD Link to comment Share on other sites More sharing options...
troglodite Posted April 20, 2013 Author Share Posted April 20, 2013 Tested & Works ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) thx! Link to comment Share on other sites More sharing options...
boyesjs03 Posted April 20, 2013 Share Posted April 20, 2013 No Problem ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Saves a lot of code being used repetively ;P Link to comment Share on other sites More sharing options...
DMF Posted June 2, 2013 Share Posted June 2, 2013 well not good idea peace b/c what if for example(using .hack class's) if it all used same a wavemaster(mage) would have same hp/sp as a Blademaster(swordsman/jackof all trades/warrior)would be dumb and make each class too dumb and game boring, Link to comment Share on other sites More sharing options...
blackvampyre Posted October 14, 2013 Share Posted October 14, 2013 Where do you find this code ? in "mod database" ? EDIT: alright … server side. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now