View Single Post
  #1  
Old 07-18-2008, 01:29 PM
CodeMephit
Fire Beetle
 
Join Date: Oct 2006
Posts: 18
Default New Character: Hunger / Thirst

One of the first things I noticed when trying EQEmu about a year ago was that newly created players would eat 2 bread cakes and drink 2 milk skins almost as soon as they were first logged in. On a Live server, it normally takes ~10-15 minutes to eat your first item.

I have never programmed in C++ nor do I have any working knowledge of the language. So, I just simply accepted the fact that my new characters were very hungry and thirsty

I decided to download the source code and Visual C++ 2008 Express. It took a good bit of reading to get everything to go in the right place, but in less than a morning's time, I was able to compile the source code and run my newly made server.

Now it was time to delve into the code..........

I had no idea what a ride I was in for. It took several hours just to get a working idea of how the files were set up and what general form the project (and C++) used.

I *finally* tracked down where characters are created and where the starting stats are defined. A few searches through the code for things like "food", "hunger", "hungry", "eat" and "consume" generated several items for me to look at (and learn from).

I tried a few different things before I finally came up with something that would work (took a few tries just to get a compile to work LOL). I have tested my changes and they seem to work without any issues.

Please keep in mind, this is my *FIRST* ever attempt at working with C++. As such, I may have overlooked some major item, and if so, simply reply and I will try to learn.

The idea is that we max out the hunger and thirst variables so the player does not need to eat or drink for a while after they are first created. This is more inline with the experience on a Live server.

In \EQEmu-0.7.0-1118\world\client.cpp (Line 957)
Change:
Code:
	//what was the point of this? zone dosent handle this:
	//pp.expAA			= 0xFFFFFFFF;

	// FIXME: FV roleplay, database goodness...
To:
Code:
	//what was the point of this? zone dosent handle this:
	//pp.expAA			= 0xFFFFFFFF;

	// Codemephit [2008.07.18] - Set the hunger / thirst values to 'full'.
	pp.hunger_level = 6000;
	pp.thirst_levlel = 6000;

	// FIXME: FV roleplay, database goodness...
It would be nice to know that I was able to give a little something back to a community that has given me so much already!

-Codemephit
Reply With Quote