From 59ab7071b7a1525ffc9e8057818683b5b9fcb8ff Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 2 May 2015 07:00:52 -0400 Subject: [PATCH] Beginnings of fix to SendBuffDuration. --- zone/spells.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 891ad64f6..72c659271 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5259,8 +5259,31 @@ void Client::SendBuffDurationPacket(Buffs_Struct &buff) sbf->slot = 2; sbf->spellid = buff.spellid; sbf->slotid = 0; - sbf->effect = 255; sbf->level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel(); + + if (IsEffectInSpell(buff.spellid, SE_TotalHP)) + { + // If any of the lower 6 bits are set, the GUI changes MAX_HP AGAIN. + // If its set to 0 the effect is cancelled. + // 128 seems to work (ie: change only duration). + sbf->effect = 128; + } + else if (IsEffectInSpell(buff.spellid, SE_CurrentHP)) + { + // This is mostly a problem when we try and update duration on a + // dot or a hp->mana conversion. Zero cancels the effect, any + // other value has the GUI doing that value at the same time server + // is doing theirs. This makes the two match. + int index = GetSpellEffectIndex(buff.spellid, SE_CurrentHP); + sbf->effect = abs(spells[buff.spellid].base[index]); + } + else + { + // Default to what old code did until we find a better fix for + // other spell lines. + sbf->effect=sbf->level; + } + sbf->bufffade = 0; sbf->duration = buff.ticsremaining; sbf->num_hits = buff.numhits;