Greendude120 Posted December 9, 2009 Author Share Posted December 9, 2009 **IMPORTANT: Before you read on, go to part ONE. This is only optional and is only intended for those who have added the Sadscript fix first. (The fix[part1]: http://www.touchofdeathforums.com/smf/index.php/topic,55126.msg583582.html#msg583582)**Okay so its been requested that I post how to remove the exp gain when your at the max level. Just a quick explanation: The MAX_LEVEL Fix you've added stops you from leveling above your level cap (if you use quests and such that give exp). Thing is, if your max level is 100, and your level 100, you might not be able to reach level 101, but u can still gain exp. which is useless. So if you want to stop the exp gain on your maximum level cap, your in the right place :)-The Fix-Open the Source to your server. In ModDatabase, look for Sub SetPlayerExp.You can use CTRL + F to search for it. It looks like this:```Sub SetPlayerExp(ByVal index As Long, ByVal Exp As Long) Player(index).Char(Player(index).CharNum).Exp = ExpEnd Sub```_thanks to Erztel for sending me the sub above so i can work on it(too lazy to go on my other pc)_Replace the Sub with this:```Sub SetPlayerExp(ByVal index As Long, ByVal Exp As Long)If GetPlayerLevel(Index) < 100 Then Player(index).Char(Player(index).CharNum).Exp = Exp Else Call SetPlayerLevel(Index, 100)End IfEnd Sub```Simple as that. Short explanation: If your below level 100, give the exp like usual, if your not (which means ur above level 100) then set the player back to level 100 and dont give exp. [Damian suggested that I set the player back to 100\. At first i made it so nothing happens if he isnt below 100.**NOTE: IF YOU DO NOT WANT YOUR MAX LEVEL CAP TO BE 100, JUST CHANGE ALL THE 100s TO W/E YOU WANT IT.**If you did not do part one, you are doing all this for nothing. The first part is in sadscript btw and does not require this fix. This is an add-on to the other fix. Link to comment Share on other sites More sharing options...
Ertzel Posted December 9, 2009 Share Posted December 9, 2009 Ok I tested this and it works.I made my char lvl 99, then gave him more exp then needed till 100 and it just set him at lvl 100 with 0/100000 exp. Then when I do Mass Experience or any form of giving experience it stays at 0/100000 like its suppose to. Link to comment Share on other sites More sharing options...
Greendude120 Posted December 9, 2009 Author Share Posted December 9, 2009 Yeah i didnt test it but i knew it would work. Its very simple codes.Glad i could help ツ Link to comment Share on other sites More sharing options...
Zamin Posted January 8, 2010 Share Posted January 8, 2010 What can I do to change the 100 and read the number from the data.ini? As in Max_Level? I know how to in sad script, but how in VB6?-Thanks Link to comment Share on other sites More sharing options...
damian666 Posted January 8, 2010 Share Posted January 8, 2010 thats exactly the same mate xDDamian666 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