From 3ad7ab625d21de81cc1c7aa3d51b6646f99e2860 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 5 Oct 2014 14:45:26 -0400 Subject: [PATCH] Add temp hack for num hits and UF Not sure what I screwed up, could of sworn it was working right before, but that was also 3 AM or something Rewrote UF's OP_BuffCreate to use the Write* functions which are a bit more straight forward --- common/patches/underfoot.cpp | 28 ++++++++++------------------ zone/spell_effects.cpp | 3 +++ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 6291d3077..34ef61f6e 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -345,14 +345,10 @@ namespace Underfoot __packet->pBuffer = new unsigned char[sz]; memset(__packet->pBuffer, 0, sz); - uchar *ptr = __packet->pBuffer; - *((uint32*)ptr) = emu->entity_id; - ptr += sizeof(uint32); - ptr += sizeof(uint32); - *((uint8*)ptr) = emu->all_buffs; - ptr += sizeof(uchar); - *((uint16*)ptr) = emu->count; - ptr += sizeof(uint16); + __packet->WriteUInt32(emu->entity_id); + __packet->WriteUInt32(0); + __packet->WriteUInt8(emu->all_buffs); // 1 = all buffs, 0 = 1 buff + __packet->WriteUInt16(emu->count); for (uint16 i = 0; i < emu->count; ++i) { @@ -366,17 +362,13 @@ namespace Underfoot buffslot += 14; } - *((uint32*)ptr) = buffslot; - ptr += sizeof(uint32); - *((uint32*)ptr) = emu->entries[i].spell_id; - ptr += sizeof(uint32); - *((uint32*)ptr) = emu->entries[i].tics_remaining; - ptr += sizeof(uint32); - *((uint32*)ptr) = emu->entries[i].num_hits; - ptr += sizeof(uint32); - *((uint8*)ptr) = !emu->all_buffs; - ptr += 1; + __packet->WriteUInt32(buffslot); + __packet->WriteUInt32(emu->entries[i].spell_id); + __packet->WriteUInt32(emu->entries[i].tics_remaining); + __packet->WriteUInt32(emu->entries[i].num_hits); + __packet->WriteString(""); } + __packet->WriteUInt8(!emu->all_buffs); FINISH_ENCODE(); /* diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index f86f43bf4..0ce0c8834 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -3396,6 +3396,9 @@ void Mob::BuffProcess() if(buffs[buffs_i].UpdateClient == true) { CastToClient()->SendBuffDurationPacket(buffs[buffs_i]); + // Hack to get UF to play nicer, RoF seems fine without it + if (CastToClient()->GetClientVersion() == EQClientUnderfoot) + CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i); buffs[buffs_i].UpdateClient = false; } }