Buffs that stack with themselves

Discussions on various DOL development features

Moderator: Support Team

Buffs that stack with themselves

Postby Enzd » Wed Mar 21, 2012 1:26 am

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?
Enzd
DOL Guest
 
Posts: 2
Joined: Wed Apr 27, 2011 7:49 pm

Re: Buffs that stack with themselves

Postby mattress » Wed Mar 21, 2012 4:01 am

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;
}
Matt450/Variations of "Matt"
User avatar
mattress
Server Team
 
Posts: 277
Joined: Mon Jul 05, 2010 3:30 am
Location: Oceanside, California

Re: Buffs that stack with themselves

Postby Tolakram » Wed Mar 21, 2012 12:22 pm

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. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Buffs that stack with themselves

Postby Enzd » Wed Mar 21, 2012 8:39 pm

That makes sense, thanks.
Enzd
DOL Guest
 
Posts: 2
Joined: Wed Apr 27, 2011 7:49 pm

Re: Buffs that stack with themselves

Postby Dinberg » Mon Apr 16, 2012 8:02 am

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)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 0 guests