Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #18  
Old 05-13-2009, 12:07 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Changes needed to implement face changing in SoF:

Code:
// eq_packet_structs.h
struct FaceChange_Struct {
/*000*/	int8	haircolor;
/*001*/	int8	beardcolor;
/*002*/	int8	eyecolor1;
/*003*/	int8	eyecolor2;
/*004*/	int8	hairstyle;
/*005*/	int8	beard;
/*006*/	int8	face;
/*007*/ int8	unknown07;
/*008*/ int32	heritage;
/*012*/ int32	tattoo;
/*016*/ int32	details;
/*020*/ int32	unknown;
};
Code:
// client_packet.cpp - Client::Handle_OP_FaceChange()
void Client::Handle_OP_FaceChange(const EQApplicationPacket *app)
{
  // [snip] ...
	
	// FaceChange sends 0xFF as code for "Field Not Applicable For This Race"
	// Except Drakkin fields, which are always 0 for non-Drakkin.
	// Better to store 0 in DB than 0xFF in case race changes,
	//   because then field may become applicable again!
	m_pp.hair = (fc->hair == 0xFF) ? 0 : fc->hair;
	m_pp.haircolor = (fc->haircolor == 0xFF) ? 0 : fc->haircolor;
	m_pp.beard = (fc->beard == 0xFF) ? 0 : fc->beard;
	m_pp.beardcolor = (fc->beardcolor == 0xFF) ? 0 : fc->beard;

	switch (m_pp.race)
	{
		case BARBARIAN:
			m_pp.tattoo = (fc->face / 10);
			m_pp.face = (fc->face % 10);
			break;
		case ERUDITE:
			m_pp.hair = (fc->face / 10);
			m_pp.face = (fc->face % 10);
			break;
		case HIGHELF:
		case DARKELF:
		case HALFELF:
			m_pp.beard = (fc->face / 10);
			m_pp.face = (fc->face % 10);
			break;
		case 
	}
}
Code:
// SoF.cpp - ENCODE(OP_ZoneSpawns)
ENCODE(OP_ZoneSpawns)
{
  // [snip] ...
	
	eq->tattoo = emu->tattoo; // Assuming Tattoo field is added to DB for Draks & Barbs
	eq->details = emu->details; // Assuming Details field is added to DB for Draks
	eq->heritage = emu->heritage; // Assuming heritage field is added to DB for Draks
	eq->face = emu->face;

	// Now adjust Face field to account for features encoded into it by client for rendering
	switch (emu->race)
	{
	  case BARBARIAN:
			eq->face += (emu->tattoo * 10); // Tattoo will be ignored by client for Barbs, Tattoo maps to Face field.
			break;
		case ERUDITE:
			eq->face += (emu->hair * 10); // Hair will be ignored by client for Eruds, Hair maps to Face field
			break;
		case HIGHELF:
		case DARKELF:
		case HALFELF:
			eq->face += (emu->beard * 10); // Beard will be ignored by client for elves, Beard maps to Face field
			break;
	}

	// ... [snip]
}
Reply With Quote
 


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 07:03 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