Exemplo n.º 1
0
        public static void DisplayOverheadDebuff(BuffIcon debuffIcon)
        {
            if (Config.GetBool("ShowBuffDebuffOverhead"))
            {
                BuffDebuff debuff = World.Player.BuffsDebuffs.FirstOrDefault(b => b.BuffIcon == debuffIcon);

                if (debuff == null)
                {
                    return;
                }

                if (IsFiltered(debuff.ClilocMessage1))
                {
                    return;
                }

                if (Config.GetBool("OverrideBuffDebuffFormat"))
                {
                    string format = Config.GetString("BuffDebuffFormat");

                    if (string.IsNullOrEmpty(format))
                    {
                        format = "[{action}{name} {duration}]";
                    }

                    World.Player.OverheadMessage(Config.GetInt("DebuffHue"),
                                                 format.Replace("{action}", "-").Replace("{name}", debuff.ClilocMessage1)
                                                 .Replace("{duration}", string.Empty));
                }
                else
                {
                    World.Player.OverheadMessage(Config.GetInt("DebuffHue"), $"[-{debuff.ClilocMessage1}]");
                }
            }
        }
Exemplo n.º 2
0
        public static void DisplayOverheadBuff(BuffDebuff buff, bool ignoreAction = false)
        {
            if (Config.GetBool("ShowBuffDebuffOverhead") && !IsFiltered(buff.ClilocMessage1))
            {
                TimeSpan diff     = DateTime.UtcNow - buff.Timestamp;
                int      timeLeft = buff.Duration - (int)diff.TotalSeconds;

                if (Config.GetBool("OverrideBuffDebuffFormat"))
                {
                    string format = Config.GetString("BuffDebuffFormat");

                    if (string.IsNullOrEmpty(format))
                    {
                        format = "[{action}{name} {duration}]";
                    }

                    World.Player.OverheadMessage(Config.GetInt("BuffHue"), format.Replace("{action}", ignoreAction ? string.Empty : "+").Replace("{name}", buff.ClilocMessage1)
                                                 .Replace("{duration}", timeLeft < 1 ? string.Empty : $"({timeLeft}s)"));
                }
                else
                {
                    World.Player.OverheadMessage(Config.GetInt("BuffHue"), timeLeft < 1 ? $"[+{buff.ClilocMessage1}]" : $"[+{buff.ClilocMessage1} ({timeLeft}s)]");
                }
            }
        }