EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Here's a fix for 5.3DR2 Mob Healthbar not updating in client (https://www.eqemulator.org/forums/showthread.php?t=11003)

r2d2atemyhomework 12-24-2003 04:50 PM

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. :)

voetsek 12-27-2003 09:13 AM

I have this on the Dynasty server, its working great.

Shawn319 12-30-2003 09:03 PM

This fix works great for mobs.. it'll be in the next release of EQEmu.. also we've made some fixes to client HP as well.. to be a little more accurate.

xxsupamanxx5 01-20-2004 04:10 PM

:x This didnt work for me i dont knwo what you guys are talking about i did what u said to do it didnt work. So i reinstalled everything and tried agian and agian and agian I even had my cousin try it and my dad!!! it didnt work pls somone help me fix this health bar stuff


All times are GMT -4. The time now is 01:15 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.