Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3