diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 9072a2c9b..a316c4b3b 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2762,19 +2762,23 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne break; case SE_AStacker: - newbon->AStacker = true; + newbon->AStacker[0] = 1; + newbon->AStacker[1] = effect_value; break; case SE_BStacker: - newbon->BStacker = true; + newbon->BStacker[0] = 1; + newbon->BStacker[1] = effect_value; break; case SE_CStacker: - newbon->CStacker = true; + newbon->CStacker[0] = 1; + newbon->CStacker[1] = effect_value; break; case SE_DStacker: - newbon->DStacker = true; + newbon->DStacker[0] = 1; + newbon->DStacker[1] = effect_value; break; case SE_Berserk: diff --git a/zone/common.h b/zone/common.h index d9b0d53d3..88600492e 100644 --- a/zone/common.h +++ b/zone/common.h @@ -366,10 +366,10 @@ struct StatBonuses { bool NegateIfCombat; // Bool Drop buff if cast or melee int8 Screech; // -1 = Will be blocked if another Screech is +(1) int16 AlterNPCLevel; // amount of lvls +/- - bool AStacker; // For buff stack blocking - bool BStacker; // For buff stack blocking - bool CStacker; // For buff stack blocking - bool DStacker; // For buff stack blocking + int16 AStacker[1]; // For buff stack blocking 0=Exists 1=Effect_value + int16 BStacker[1]; // For buff stack blocking 0=Exists 1=Effect_value + int16 CStacker[1]; // For buff stack blocking 0=Exists 1=Effect_value + int16 DStacker[1]; // For buff stack blocking 0=Exists 1=Effect_value bool BerserkSPA; // berserk effect int16 Metabolism; // Food/drink consumption rates. diff --git a/zone/spells.cpp b/zone/spells.cpp index 78dce3379..59dbb6625 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2622,19 +2622,31 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, } /*Buff stacking prevention spell effects (446 - 449) works as follows... If B prevent A, if C prevent B, if D prevent C. + If checking same type ie A vs A, which ever effect base value is higher will take hold. Special check is added to make sure the buffs stack properly when applied from fade on duration effect, since the buff is not fully removed at the time of the trgger*/ - if (spellbonuses.BStacker) { + if (spellbonuses.AStacker[0]) { + if ((effect2 == SE_AStacker) && (sp2.effectid[i] <= spellbonuses.AStacker[1])) + return -1; + } + + if (spellbonuses.BStacker[0]) { + if ((effect2 == SE_BStacker) && (sp2.effectid[i] <= spellbonuses.BStacker[1])) + return -1; if ((effect2 == SE_AStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_BStacker))) return -1; } - if (spellbonuses.CStacker) { + if (spellbonuses.CStacker[0]) { + if ((effect2 == SE_CStacker) && (sp2.effectid[i] <= spellbonuses.CStacker[1])) + return -1; if ((effect2 == SE_BStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_CStacker))) return -1; } - if (spellbonuses.DStacker) { + if (spellbonuses.DStacker[0]) { + if ((effect2 == SE_DStacker) && (sp2.effectid[i] <= spellbonuses.DStacker[1])) + return -1; if ((effect2 == SE_CStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_DStacker))) return -1; }