Page 1 of 1
Buffs that stack with themselves
PostPosted: Wed Mar 21, 2012 1:26 am
by Enzd
I did a quick search and didn't find anything related to this. Say I made a buff that increases strength by 20, but I want the same spell to stack with itself when cast again by the same player instead of being overwritten, so the total increase is by 40, and so on. Is this possible?
Re: Buffs that stack with themselves
PostPosted: Wed Mar 21, 2012 4:01 am
by mattress
Spells in the database have an EffectGroup, spells in the same effect group overwrite each other and don't stack, this will be a tough one to set up as you'll have to take a look at all the buff spells and decide which ones to change to a different EffectGroup so they'll stack with any other buff.
Take a look at SingleStatBuff.cs:
- Code: Select all
/// <summary>
/// Determines wether this spell is compatible with given spell
/// and therefore overwritable by better versions
/// spells that are overwritable cannot stack
/// </summary>
/// <param name="compare"></param>
/// <returns></returns>
public override bool IsOverwritable(GameSpellEffect compare)
{
if (Spell.EffectGroup != 0)
return Spell.EffectGroup == compare.Spell.EffectGroup;
if (base.IsOverwritable(compare) == false) return false;
if (Spell.Duration > 0 && compare.Concentration > 0)
return compare.Spell.Value >= Spell.Value;
return compare.SpellHandler.SpellLine.IsBaseLine ==
SpellLine.IsBaseLine;
}
Re: Buffs that stack with themselves
PostPosted: Wed Mar 21, 2012 12:22 pm
by Tolakram
Matt is correct, but I wanted to add a warning:
There are two columns, effectgroup and spellgroup. Spellgroup effect how spells are grouped on the quickbar for hybrid classes and should not be changed.

Re: Buffs that stack with themselves
PostPosted: Wed Mar 21, 2012 8:39 pm
by Enzd
That makes sense, thanks.
Re: Buffs that stack with themselves
PostPosted: Mon Apr 16, 2012 8:02 am
by Dinberg
Enzd - you may have to make a custom handler for this, because a spell by default cant be applied twice (even if no effect group AFAIK it will overwrite other instances of itself)