/// <summary>
        /// Registers a given buff's ability and buff modifiers.
        /// </summary>
        public void RegisterGeneralBuff(NewBuff buff)
        {
            #region PreCast
            if (AbilityMgr.HasPreCastModifiers(buff.Entry))
            {
                List <AbilityModifier> abilityPreCastModifiers = AbilityMgr.GetAbilityPreCastModifiers(buff.Entry);

                foreach (AbilityModifier mod in abilityPreCastModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalPreCastModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclinePreCastModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclinePreCastModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclinePreCastModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_abilityPreCastModifiers.ContainsKey(mod.Affecting))
                        {
                            _abilityPreCastModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _abilityPreCastModifiers[mod.Affecting].Add(mod);
                    }

                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        buff.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }
            }

            #endregion

            #region Cast

            if (AbilityMgr.HasModifiers(buff.Entry))
            {
                List <AbilityModifier> abilityModifiers = AbilityMgr.GetAbilityModifiers(buff.Entry);

                foreach (AbilityModifier mod in abilityModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclineModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclineModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclineModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_abilityModifiers.ContainsKey(mod.Affecting))
                        {
                            _abilityModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _abilityModifiers[mod.Affecting].Add(mod);
                    }


                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        buff.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }
            }

            #endregion

            #region Buff
            if (AbilityMgr.HasBuffModifiers(buff.Entry))
            {
                List <AbilityModifier> buffModifiers = AbilityMgr.GetBuffModifiers(buff.Entry);

                foreach (AbilityModifier mod in buffModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalBuffModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclineBuffModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclineBuffModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclineBuffModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_buffModifiers.ContainsKey(mod.Affecting))
                        {
                            _buffModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _buffModifiers[mod.Affecting].Add(mod);
                    }


                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        buff.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }
            }

            #endregion
        }
        /// <summary>
        /// Registers the tactic's ability and buff modifiers.
        /// </summary>
        public void RegisterTacticBuff(NewBuff b)
        {
            bool bAdded = false;

            _activeBuffs.Add(b);

            #region PreCast
            if (AbilityMgr.HasPreCastModifiers(b.Entry))
            {
                List <AbilityModifier> tacPrecastModifiers = AbilityMgr.GetAbilityPreCastModifiers(b.Entry);

                foreach (AbilityModifier mod in tacPrecastModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalPreCastModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclinePreCastModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclinePreCastModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclinePreCastModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_abilityPreCastModifiers.ContainsKey(mod.Affecting))
                        {
                            _abilityPreCastModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _abilityPreCastModifiers[mod.Affecting].Add(mod);
                    }

                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        b.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }

                bAdded = true;
            }

            #endregion

            #region Cast

            if (AbilityMgr.HasModifiers(b.Entry))
            {
                List <AbilityModifier> tacModifiers = AbilityMgr.GetAbilityModifiers(b.Entry);

                foreach (AbilityModifier mod in tacModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclineModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclineModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclineModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_abilityModifiers.ContainsKey(mod.Affecting))
                        {
                            _abilityModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _abilityModifiers[mod.Affecting].Add(mod);
                    }

                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        b.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }

                bAdded = true;
            }

            #endregion

            #region Buff
            if (AbilityMgr.HasBuffModifiers(b.Entry))
            {
                List <AbilityModifier> tacBuffModifiers = AbilityMgr.GetBuffModifiers(b.Entry);

                foreach (AbilityModifier mod in tacBuffModifiers)
                {
                    if (mod.Affecting == 0)
                    {
                        _generalBuffModifiers.Add(mod);
                    }

                    else if (mod.Affecting <= 3)
                    {
                        if (!_speclineBuffModifiers.ContainsKey((ushort)(mod.Affecting - 1)))
                        {
                            _speclineBuffModifiers.Add((ushort)(mod.Affecting - 1), new List <AbilityModifier>());
                        }
                        _speclineBuffModifiers[(byte)(mod.Affecting - 1)].Add(mod);
                    }

                    else
                    {
                        if (!_buffModifiers.ContainsKey(mod.Affecting))
                        {
                            _buffModifiers.Add(mod.Affecting, new List <AbilityModifier>());
                        }

                        _buffModifiers[mod.Affecting].Add(mod);
                    }

                    for (AbilityModifierEffect effect = mod.Effect; effect != null; effect = effect.nextMod)
                    {
                        b.AddBuffParameter(effect.BuffLine, effect.PrimaryValue);
                    }
                }

                bAdded = true;
            }

            #endregion

            if (bAdded)
            {
                _modifyingTactics.Add(b.Entry);
            }
        }