public static void AddPositioningScript(this WeakAura weak)
        {
            _sb.Length--;

            // icon = 629054

            // Script
            var script = PositionAurasLua;

            script = script.Replace("-- %auras%", _sb.ToString());

            var scriptAura = AuraIcon.Generate("positioning_script");

            scriptAura.Conditions.Add(new Condition
            {
                Check = new Check
                {
                    Trigger  = -1,
                    Variable = "customcheck",
                    Op       = "PLAYER_TALENT_UPDATE",
                    Value    = script
                },
                Changes = new List <Change>()
            });

            scriptAura.DisplayIcon = 629054;
            scriptAura.IconSource  = 0;

            weak.Table.Children.Add(scriptAura);
        }
        public static List <Aura> AddSpell(this WeakAura weak, Spell spell, ClassSpec classSpec, int x, int y)
        {
            // todo: Use_Icon
            var addedAuras = new List <Aura>();
            var auraId     = GenerateAuraId(classSpec, spell);

            if (spell.Type.HasFlag(SpellType.Cooldown))
            {
                var aura = AuraIcon.Generate(auraId);
                aura.WatchAbilityCooldown(spell.Name, spell.SpellIds);
                addedAuras.Add(aura);
            }

            if (spell.Type.HasFlag(SpellType.DoT))
            {
                var onTarget = AuraIcon.Generate($"{auraId}_is_on_target");
                onTarget.WatchForDebuffOnTarget(spell.Name);

                var notOnTarget = AuraIcon.Generate($"{auraId}_not_on_target");
                notOnTarget.WatchForDebuffNotOnTarget(spell.Name, spell.SpellIds);
                notOnTarget.AddGlow(new Color(1, 0.04, 0.3));

                var refreshable = spell.Durations.Count == 0 ? 0 : (int)Math.Floor(spell.Durations.Max() * 0.3);
                if (refreshable < 1)
                {
                    Console.WriteLine($"WARN: {spell.Name} refreshable very low: {refreshable};");
                }

                var canRefresh = AuraIcon.Generate($"{auraId}_refreshable");
                canRefresh.AddGlow();
                canRefresh.WatchForDebuffOnTargetLow(spell.Name, refreshable);

                addedAuras.Add(onTarget, notOnTarget, canRefresh);
            }
            // DoT types already include a debuff on target tracker
            else if (spell.Type.HasFlag(SpellType.DebuffOnTarget))
            {
                var onTarget = AuraIcon.Generate($"{auraId}_is_on_target");
                onTarget.AddGlow();

                if (spell.AssociatedAuras.Count != 0)
                {
                    spell.AssociatedAuras.ForEach(s => onTarget.WatchForDebuffOnTarget(s.Name));
                }
                else
                {
                    onTarget.WatchForDebuffOnTarget(spell.Name);
                }

                addedAuras.Add(onTarget);
            }

            if (spell.Type.HasFlag(SpellType.BuffOnPlayer))
            {
                var onPlayer = AuraIcon.Generate($"{auraId}_buff_on_me");
                onPlayer.AddGlow();

                if (spell.AssociatedAuras.Count != 0)
                {
                    spell.AssociatedAuras.ForEach(s =>
                    {
                        if (s.Invert)
                        {
                            onPlayer.WatchForBuffNotOnPlayer(s.Name);
                        }
                        else
                        {
                            onPlayer.WatchForBuffOnPlayer(s.Name);
                        }
                    });
                }
                else
                {
                    if (spell.Invert)
                    {
                        onPlayer.WatchForBuffNotOnPlayer(spell.Name);
                    }
                    else
                    {
                        onPlayer.WatchForBuffOnPlayer(spell.Name);
                    }
                }

                addedAuras.Add(onPlayer);
            }

            foreach (var aura in addedAuras)
            {
                weak.Table.Children.Add(aura);

                aura.LoadIf(classSpec);
                aura.LoadIfTalent(spell.Talent);
                aura.AddVisibilityToggle();
                aura.XOffset = x;
                aura.YOffset = y;

                if (spell.BigStacks)
                {
                    // First SubRegion is always a TextRegion
                    aura.SubRegions.First().TextFontSize = 30;
                }
            }

            return(addedAuras);
        }