noudess
04-20-2015, 02:56 PM
I continue to battle with the function Client::SendBuffDurationPacket.
My previous skirmish had to do with the shielding line of hp spells (minor, lesser, and shielding). If a focus item like Bear-hide boots was worn, the max HP would get all messed up when the server sent the SpellBuffFade struct up to increase the duration.
I found that the 'effect' field seems to be unknown. They were setting that to level (I guess they thought effective level was the correct value). I experimented with a bunch of theories, but only setting it to 255 got rid of the problem (which obviously sucks, since we still dont know whats going on).
Now, with the necro spell Allure of Death (and some others), the SpellBuffFade struct is sent up when wearing the boots again, and bam, the # of HP the GUI starts deducting is insanely high, causing the character to lose like 200 hp and then the server fixes it. That loop continues, but based on HP values the client can go unconscious, recover, etc based on these bad values. If I comment out the call to fix the duration, the spell works correctly, but not for the correct length.
Anyone have any ideas on how we can better update the spell duration without hosing up some spells, or what the effect field should be set to? Perhaps one of the unknown fields plays a role?
Here's the existing function. Again, the 255 was me, fixing the shielding line.
void Client::SendBuffDurationPacket(Buffs_Struct &buff)
{
EQApplicationPacket* outapp;
outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;
sbf->entityid = GetID();
sbf->slot = 2;
sbf->spellid = buff.spellid;
sbf->slotid = 0;
sbf->effect = 255;
sbf->level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel();
sbf->bufffade = 0;
sbf->duration = buff.ticsremaining;
sbf->num_hits = buff.numhits;
FastQueuePacket(&outapp);
}
My previous skirmish had to do with the shielding line of hp spells (minor, lesser, and shielding). If a focus item like Bear-hide boots was worn, the max HP would get all messed up when the server sent the SpellBuffFade struct up to increase the duration.
I found that the 'effect' field seems to be unknown. They were setting that to level (I guess they thought effective level was the correct value). I experimented with a bunch of theories, but only setting it to 255 got rid of the problem (which obviously sucks, since we still dont know whats going on).
Now, with the necro spell Allure of Death (and some others), the SpellBuffFade struct is sent up when wearing the boots again, and bam, the # of HP the GUI starts deducting is insanely high, causing the character to lose like 200 hp and then the server fixes it. That loop continues, but based on HP values the client can go unconscious, recover, etc based on these bad values. If I comment out the call to fix the duration, the spell works correctly, but not for the correct length.
Anyone have any ideas on how we can better update the spell duration without hosing up some spells, or what the effect field should be set to? Perhaps one of the unknown fields plays a role?
Here's the existing function. Again, the 255 was me, fixing the shielding line.
void Client::SendBuffDurationPacket(Buffs_Struct &buff)
{
EQApplicationPacket* outapp;
outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;
sbf->entityid = GetID();
sbf->slot = 2;
sbf->spellid = buff.spellid;
sbf->slotid = 0;
sbf->effect = 255;
sbf->level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel();
sbf->bufffade = 0;
sbf->duration = buff.ticsremaining;
sbf->num_hits = buff.numhits;
FastQueuePacket(&outapp);
}