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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2008, 08:34 PM
CodeMephit
Fire Beetle
 
Join Date: Oct 2006
Posts: 18
Default

You make a very good point. I did not know about the hunger rule variable. But if I had, I may never have been motivated to look at C++

Anyhow, I found where food is consumed. True to what you said, it is about 1 item every 10 minutes.

I created a new character on a Live server and deleted all but 10 each of his bread / milk. I then used my logs to determine how long the food lasted and timed the 'you are low on food', 'you are out of food', 'you are hungry' messages.

I found that 1 item is eaten / drank about once per hour, give or take a little. This was on a human by the way. If I recall correctly, small races ate slower and large races ate faster. Also, I remember something about eating more if you had a mount summoned. I will see what I can dig up on that.

For now though, this will bring normal eating / drinking habits more inline with Live.

In \EQEmu-0.7.0-1118\zone\client_packet.cpp (Line 1291)
Change:
Code:
		m_pp.hunger_level += eat_item->CastTime*cons_mod; //roughly 1 item per 10 minutes
		DeleteItemInInventory(pcs->slot, 1, false);
		
		if(pcs->auto_consumed != 0xffffffff) //no message if the client consumed for us
			entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), eat_item->Name);
	}
	else if (pcs->type == 0x02) {
#if EQDEBUG >= 1
		LogFile->write(EQEMuLog::Debug, "Drinking from slot:%i", (int)pcs->slot);
#endif
		// 6000 is the max. value
		//m_pp.thirst_level += 1000;
		m_pp.thirst_level += eat_item->CastTime*cons_mod; //roughly 1 item per 10 minutes
		DeleteItemInInventory(pcs->slot, 1, false);
To:
Code:
	// Codemephit [2008.07.18] - Added a multiplier of  '6'.  This makes food last about as long as on Live.
		m_pp.hunger_level += eat_item->CastTime*cons_mod*6; //roughly 1 item per 60 minutes
		DeleteItemInInventory(pcs->slot, 1, false);
		
		if(pcs->auto_consumed != 0xffffffff) //no message if the client consumed for us
			entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), eat_item->Name);
	}
	else if (pcs->type == 0x02) {
#if EQDEBUG >= 1
		LogFile->write(EQEMuLog::Debug, "Drinking from slot:%i", (int)pcs->slot);
#endif
		// 6000 is the max. value
		//m_pp.thirst_level += 1000;
		m_pp.thirst_level += eat_item->CastTime*cons_mod*6; //roughly 1 item per 60 minutes
		DeleteItemInInventory(pcs->slot, 1, false);
Again, today is my first day working with / writing C++ code. I have tested my changes, and they seem to work fine. However if anyone sees any major issues, please let me know. Thanks.

-Codemephit
Reply With Quote
  #2  
Old 07-18-2008, 08:53 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

you do realize that with the Rule variable you can allready set consumtipion to ANY level? every 5 min or every 5 days? no C coding requred

personaly i PREFER than char eats faster - cuase this makes them spend more money of food
Reply With Quote
  #3  
Old 07-19-2008, 01:12 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I've thought about upping the base consumption before the rule several times before honestly. I also don't see a problem with setting a character to having eaten something on character creation.
Reply With Quote
  #4  
Old 07-19-2008, 12:08 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

I think trying to find the most live-like starting point only makes the variable setting more accurate. If it's twice 'normal', then we have to be sure that 'normal' is 'normal' (as far as Live goes) before we modify it one way or the other =P

Good work, Mephit =)
Reply With Quote
  #5  
Old 07-20-2008, 03:00 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

the variable that curently in rules allready VERY flexiable - ANYONE can set it to his liking to be more or less. there is absolutly no need for exact live-like hard coding
Reply With Quote
Reply


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 08:21 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3