Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] xprate command

Newbie Spellweaver
Joined
Apr 6, 2008
Messages
15
Reaction score
0
In Mobs.cpp add the following at the top, directly under the #includes:

Code:
int EXPRATE = 100;

You can change the 100 to whatever you want... that will be the initial rate of the server when it boots up. 100 would be 100x rates.

Now, find the following line:

Code:
Levels::giveEXP(player, mobinfo[mob->getMobID()].exp);

Change it to:

Code:
Levels::giveEXP(player, mobinfo[mob->getMobID()].exp * EXPRATE);

If there was anything after "mobinfo[mob->getMobID()].exp" to begin with, remove it. You want it to be identical to the line above.

Now, at the bottom of that file, add this:

Code:
void Mobs::setEXP(int rate){
	EXPRATE = rate;
}

------------

In Mobs.h, under

Code:
static void dieMob(Player* player, Mob* mob, int n);

add

Code:
static void setEXP(int rate);

----------------

In Players.cpp, add the following code with the rest of the commands:

Code:
else if(strcmp(command, "xprate") == 0){
            char *rate = strtok_s(NULL, " ",&next_token);
			Mobs::setEXP(strval(rate));
            char expcat[100] = "";
			strcat_s(expcat, 100, "The EXP rate is now ");
			strcat_s(expcat, 100, rate);
			strcat_s(expcat, 100, "x!");

			PlayersPacket::showMassage(expcat, 0);
			}

-----------------------------

Then, in game, simply do "!exprate NUMBER" to change the rate. For example, if you wish to change the rate to 100x, you would type "!exprate 100"
 
Last edited:
Initiate Mage
Joined
Aug 11, 2007
Messages
3
Reaction score
0
Re: [Release] !exprate command

if this works then thanks
 
Master Summoner
Joined
Apr 2, 2008
Messages
538
Reaction score
0
Re: [Release] !exprate command

dont see whyd u want to change exp rate al lthe time, lol
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
7
Reaction score
0
Re: [Release] !exprate command

You would change it. Like when you have an event and want the exp like 25x when your server is 20x ect...(Without restarting the server.) And once you restart the serer the exp goes back to normal too.
 
Newbie Spellweaver
Joined
Nov 13, 2006
Messages
17
Reaction score
0
Re: [Release] !exprate command

I did something similar, though I used the MySQL database to store the information. That way, the value doesn't need to be changed every time the server is started up. You wouldn't even need a new function, just the getInt and setInt in MySQLM.cpp. I did the same thing for meso drop rates.
 
Junior Spellweaver
Joined
Apr 7, 2008
Messages
190
Reaction score
0
Re: [Release] !exprate command

Wow this is very nice...But I don't use that method to change rates... I just do * number... can you make something that can change it if you do that please?
 
Newbie Spellweaver
Joined
Apr 4, 2008
Messages
9
Reaction score
0
Re: [Release] !exprate command

I get this when compiling

1>------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
1>Compiling...
1>Players.cpp
1>Mobs.cpp
1>.\Mobs.cpp(257) : error C2065: 'EXPRATE' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\farhan.MILANO\Desktop\serv\MapleStoryServer\Release\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
15
Reaction score
0
Re: [Release] !exprate command

I get this when compiling

1>------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
1>Compiling...
1>Players.cpp
1>Mobs.cpp
1>.\Mobs.cpp(257) : error C2065: 'EXPRATE' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\farhan.MILANO\Desktop\serv\MapleStoryServer\Release\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

You have to do your EXP rates using the method in the link at the top of the first post.
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
55
Reaction score
0
Re: [Release] !exprate command

I tried this, I did it ingame, and when I changed the ExpRate, the monsters gave the same as the previous rate.
 
Newbie Spellweaver
Joined
Apr 3, 2008
Messages
22
Reaction score
0
Re: [Release] !exprate command

you have to restart the server after doing !exprate for it to work >_<
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
15
Reaction score
0
Re: [Release] !exprate command

You must be doing something wrong... I've tested it several times in different situations, and it works fine.
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
55
Reaction score
0
Re: [Release] !exprate command

You must be doing something wrong... I've tested it several times in different situations, and it works fine.

Would it be possible that you forgotten a step? Can you recheck everythign just to make sure? like, try it with new files.
 
Initiate Mage
Joined
Apr 4, 2008
Messages
4
Reaction score
0
Re: [Release] !exprate command

i am getting the same results. I type anything ad it teles me i changed the rate fut the rate is still the same.
 
Newbie Spellweaver
Joined
Mar 21, 2008
Messages
97
Reaction score
0
Re: [Release] !exprate command

works fine, i also made mesos. and drop changers :p
 
Newbie Spellweaver
Joined
Sep 25, 2007
Messages
83
Reaction score
1
Re: [Release] !exprate command

1>Compiling...
1>Mobs.cpp
1>c:\maplestoryserver april 14 2008\maplestoryserver\mobs.cpp(256) : error C2065: 'EXPRATE' : undeclared identifier
1>Build log was saved at "file://c:\MapleStoryServer April 14 2008\MapleStoryServer\Debug\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
 
Newbie Spellweaver
Joined
Oct 17, 2007
Messages
17
Reaction score
0
Re: [Release] !exprate command

You must declare the variable EXPRATE... else it will not work.
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
98
Reaction score
0
Re: [Release] !exprate command

Weird. I had it working the other day, now its not working xD
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
15
Reaction score
0
Re: [Release] !exprate command

The only things I didn't show were the steps in the linked tutorial. I guess I'll remove the link, and just type out those steps too, exactly how I did it.

Edit: Okay, I edited it. Please read over the first post again, and ensure that you did exactly what all the steps say.
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
98
Reaction score
0
Re: [Release] !exprate command

If i get the command to show:
"The Exp Rate has been changed to ___x!"

I ll post it.
 
Back
Top