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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-24-2003, 04:50 PM
r2d2atemyhomework
Fire Beetle
 
Join Date: Dec 2003
Posts: 10
Default Here's a fix for 5.3DR2 Mob Healthbar not updating in client

The problem with the mob healthbar was that, the SpawnHPUpdate packets are no longer different. The mob packet is the same as the client packet now. Replace the Mob::CreateHPPacket in mob.cpp with the code below and it will work:

Code:
void Mob::CreateHPPacket(APPLAYER* app)
{
	this->IsFullHP=(cur_hp>=max_hp);

	app->opcode = OP_HPUpdate;
	app->size = sizeof(SpawnHPUpdate_Struct);
	app->pBuffer = new uchar[app->size];
	memset(app->pBuffer, 0, sizeof(SpawnHPUpdate_Struct));
	SpawnHPUpdate_Struct* ds = (SpawnHPUpdate_Struct*)app->pBuffer;
	ds->spawn_id = GetID();
	
	if(IsClient())
	{
		ds->max_hp=max_hp;
		ds->cur_hp=GetHP()-itembonuses->HP;
		ds->cur_hp=ds->cur_hp>30000?30000:ds->cur_hp;
	}
	else
	{
		ds->cur_hp=IsNPC()?(sint32)GetHPRatio():cur_hp;
		ds->max_hp=100;
	}
}
I haven't extensively tested this, but the healthbar was working on all the mobs I attacked. Merry Christmas.
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 11:40 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