I recall most food/drink stuff being in bonuses.cpp, so you might check there.
For stamina, I would need to know exactly what to look for to find it. I know ShowEQ has an opcode listed as Stamina, so I assume it is the same thing. I am not really sure what that even means anymore, since Stamina was replaced by Endurance. Is food supposed to help regain Endurance?
I doubt that structure changes much/often, so we can probable get it from EQLive easily.
Here is an example I have from a Live collect I did recently:
Code:
Feb 16 2009 04:50:17:123 [Decoded] [Server->Client] [Size: 10]
[OPCode: 0x02d6]
[Name: OP_Stamina][Updated: 10/21/08]
000 | 96 02 00 00 96 02 00 00 3d 55 | ........=U
I can easily figure out the SoF Opcode that relates to whatever this actually is (if it isn't actually stamina like it is labeled). With a struct size of 10, it shouldn't be too tough to figure this out.
Without even looking at the struct, this is how I would break it down:
Code:
96 02 00 00 - int32
96 02 00 00 - int32
3d 55 - int16
Now, lemme look at the struct that is set in SoF:
Code:
struct Stamina_Struct {
/*00*/ int32 food; // (low more hungry 127-0)
/*02*/ int32 water; // (low more hungry 127-0)
};
So, since the struct is size 8 and the packet in Live is 10, then most likely, we just need to adjust the structure and do an encode.
SoF_structs.h
Code:
struct Stamina_Struct {
/*00*/ int32 food; // seen 96 02 00 00
/*04*/ int32 water; // seen 96 02 00 00
/*08*/ int16 unknown08; // seen 3d 55
};
SoF_ops.h
SoF.cpp
Code:
ENCODE(OP_Stamina) {
ENCODE_LENGTH_EXACT(Stamina_Struct);
SETUP_DIRECT_ENCODE(Stamina_Struct, structs::Stamina_Struct);
OUT(food);
OUT(water);
//eq->unknown08 = 21821;
FINISH_ENCODE();
}
Then try that and see if that seems to work. It may be that the last 2 bytes are actually 2 int8s for food/drink hunger/thirst level. I don't know why they would use int32s if the value doesn't exceed 127 as noted in the comments of the struct in Titanium. But, it wouldn't be the first time that things would work that didn't seem to be accurately documented. I think the problem is that often things will change and people don't update the comments, so it is hard to know what to trust sometimes.
Either way, I read through my logs from Live and had quite a few of these stamina packets over the 6 minutes or so that I logged. But, oddly, every packet was exactly the same values as I posted above. It never changed once.