private bool CanUseFlaskAsInstant(ExtensionParameter extensionParameter, PlayerFlask playerFlask)
 {
     // If the flask is instant, no special logic needed
     return(playerFlask.InstantType == FlaskInstantType.Partial ||
            playerFlask.InstantType == FlaskInstantType.Full ||
            playerFlask.InstantType == FlaskInstantType.LowLife && extensionParameter.Plugin.PlayerHelper.isHealthBelowPercentage(35));
 }
Exemplo n.º 2
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Vaal Skills");

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            useVaalHaste = ImGuiExtension.Checkbox("Vaal Haste", useVaalHaste);
            Parameters[useHasteString] = useVaalHaste.ToString();
            ImGui.SameLine();

            useVaalGrace = ImGuiExtension.Checkbox("Vaal Grace", useVaalGrace);
            Parameters[useDodgeString] = useVaalGrace.ToString();
            ImGui.SameLine();

            useVaalClarity = ImGuiExtension.Checkbox("Vaal Clarity", useVaalClarity);
            Parameters[useNoManaString] = useVaalClarity.ToString();
            ImGui.SameLine();

            useVaalClarity = ImGuiExtension.Checkbox("Vaal Reave", useVaalReave);
            Parameters[useAoeExtenderString] = useVaalReave.ToString();
            ImGui.SameLine();


            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();
            ImGuiExtension.ToolTip("This action is used to configure Vaal Skills");
            Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
            ImGuiExtension.ToolTip("Hotkey to press for the first Vaal Skill.");
            Parameters[keyString] = Key.ToString();
            return(true);
        }
Exemplo n.º 3
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition is used to determine if we can use a specific flask.\nIt will ensure that health/hybrid/mana potions are not used when we are at full health/mana.\nThis will also ensure that we do not use up reserved uses.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            TimerName = ImGuiExtension.InputText("Timer Name", TimerName, 30, InputTextFlags.Default);
            ImGuiExtension.ToolTip("Name for this timer");
            Parameters[TimerNameString] = TimerName.ToString();

            var tempTimerLength = ImGuiExtension.InputText("Time Elapsed (ms)", TimeElapsed.ToString(), 30, InputTextFlags.Default);

            if (Int32.TryParse(tempTimerLength, out int convertedTimerLength))
            {
                TimeElapsed = convertedTimerLength;
            }
            ImGuiExtension.ToolTip("True if timer has run longer than specified time\n1000 ms = 1 sec");
            Parameters[TimeElapsedString] = TimeElapsed.ToString();

            TrueIfStopped = ImGuiExtension.Checkbox("True if stopped", TrueIfStopped);
            ImGuiExtension.ToolTip("When enabled, returns true if timer is stopped (or never started)");
            Parameters[TrueIfStoppedString] = TrueIfStopped.ToString();

            return(true);
        }
Exemplo n.º 4
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if any of the selected player's resistances\nare reduced by more than or equal to the specified amount.\nReduced max resistance modifiers are taken into effect automatically (e.g. -res map mods).");


            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            CheckCold = ImGuiExtension.Checkbox("Cold", CheckCold);
            Parameters[CheckColdString] = CheckCold.ToString();

            CheckFire = ImGuiExtension.Checkbox("Fire", CheckFire);
            Parameters[CheckFireString] = CheckFire.ToString();

            CheckLightning = ImGuiExtension.Checkbox("Lightning", CheckLightning);
            Parameters[CheckLightningString] = CheckLightning.ToString();

            CheckChaos = ImGuiExtension.Checkbox("Chaos", CheckChaos);
            Parameters[CheckChaosString] = CheckChaos.ToString();

            ResistanceThreshold = ImGuiExtension.IntSlider("Resistance Threshold", ResistanceThreshold, 0, 125);
            Parameters[ResistanceThresholdString] = ResistanceThreshold.ToString();

            return(true);
        }
Exemplo n.º 5
0
        public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
        {
            return(() =>
            {
                bool finalResult = true;

                if (finalResult && CheckCold)
                {
                    finalResult = CheckResistance(extensionParameter, "Cold");
                }
                if (finalResult && CheckFire)
                {
                    finalResult = CheckResistance(extensionParameter, "Fire");
                }
                if (finalResult && CheckLightning)
                {
                    finalResult = CheckResistance(extensionParameter, "Lightning");
                }
                if (finalResult && CheckChaos)
                {
                    finalResult = CheckResistance(extensionParameter, "Chaos");
                }

                return finalResult;
            });
        }
        public bool CreateAndStartTreeFromLoadedProfile()
        {
            if (Settings.LoadedProfile == null)
            {
                return(false);
            }

            if (Settings.LoadedProfile.Composite == null)
            {
                LogMessage(PluginName + ": Profile " + Settings.LoadedProfile.Name + " was loaded, but it had no composite.", 5);
                return(true);
            }

            if (TreeCoroutine != null)
            {
                TreeCoroutine.Done(true);
            }
            var extensionParameter = new ExtensionParameter(this);

            Tree = new ProfileTreeBuilder(ExtensionCache, extensionParameter).BuildTreeFromTriggerComposite(Settings.LoadedProfile.Composite);

            // Append the cache action to the built tree
            Tree = new Sequence(
                new TreeSharp.Action(x => ExtensionCache.LoadedExtensions.ForEach(ext => ext.UpdateCache(extensionParameter, ExtensionCache.Cache))),
                Tree);

            // Add this as a coroutine for this plugin
            TreeCoroutine = (new Coroutine(() => TickTree(Tree)
                                           , new WaitTime(1000 / Settings.TicksPerSecond), nameof(BuildYourOwnRoutineCore), "Tree"))
                            .AutoRestart(GameController.CoroutineRunner).Run();

            LogMessage(PluginName + ": Profile " + Settings.LoadedProfile.Name + " was loaded successfully!", 5);

            return(true);
        }
Exemplo n.º 7
0
        private bool CheckResistance(ExtensionParameter profileParameter, string key)
        {
            // Initialize to 0
            int?current = 0;
            int?maximum = 0;

            Tuple <string, string> playerStat;

            if (resistanceTypes.TryGetValue(key, out playerStat))
            {
                // Get the stats
                current = profileParameter.Plugin.PlayerHelper.getPlayerStat(playerStat.Item1) ?? 0;
                maximum = profileParameter.Plugin.PlayerHelper.getPlayerStat(playerStat.Item2) ?? current;
                if (maximum < current)
                {
                    maximum = current;
                }
            }

            // Adjust the Resistance Threshold by any reduced res mods (such as on a map)
            if (current >= ResistanceThreshold - (maximum - current))
            {
                return(false);
            }
            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has any of the selected ailments or a minimum of the specified corrupted blood stacks.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            RemFrozen = ImGuiExtension.Checkbox("Frozen", RemFrozen);
            Parameters[RemFrozenString] = RemFrozen.ToString();

            RemBurning = ImGuiExtension.Checkbox("Burning", RemBurning);
            Parameters[RemBurningString] = RemBurning.ToString();

            RemShocked = ImGuiExtension.Checkbox("Shocked", RemShocked);
            Parameters[RemShockedString] = RemShocked.ToString();

            RemCurse = ImGuiExtension.Checkbox("Curse", RemCurse);
            Parameters[RemCurseString] = RemCurse.ToString();

            RemPoison = ImGuiExtension.Checkbox("Poison", RemPoison);
            Parameters[RemPoisonString] = RemPoison.ToString();

            RemBleed = ImGuiExtension.Checkbox("Bleed", RemBleed);
            Parameters[RemBleedString] = RemBleed.ToString();

            CorruptCount = ImGuiExtension.IntSlider("Corruption Count", CorruptCount, 0, 20);
            Parameters[CorruptCountString] = CorruptCount.ToString();
            return(true);
        }
Exemplo n.º 9
0
        public override void UpdateCache(ExtensionParameter extensionParameter, Dictionary <string, Dictionary <string, object> > cache)
        {
            // First, get the dictionary out
            if (!cache.TryGetValue(Name, out Dictionary <string, object> myCache))
            {
                myCache     = new Dictionary <string, object>();
                cache[Name] = myCache;
            }

            // Add cache values
            long elapsedMovingTime = 0;
            var  player            = extensionParameter.Plugin.GameController.Player.GetComponent <Actor>();

            if (player != null && player.Address != 0 && player.isMoving)
            {
                if (!MovingStopwatch.IsRunning)
                {
                    MovingStopwatch.Start();
                }
                elapsedMovingTime = MovingStopwatch.ElapsedMilliseconds;
            }
            else
            {
                MovingStopwatch.Reset();
            }

            myCache[CacheStartedMoving] = elapsedMovingTime;
        }
Exemplo n.º 10
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTipWithText("(?)", "This condition will return true if the player's energy shield percentage is above/below the specified amount.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            int radioTarget = IsAbove ? 0 : 1;

            if (ImGui.RadioButton("Above Percentage", ref radioTarget, 0))
            {
                IsAbove = true;
            }
            if (ImGui.RadioButton("Below Percentage", ref radioTarget, 1))
            {
                IsAbove = false;
            }

            Parameters[IsAboveString] = IsAbove.ToString();

            Percentage = ImGuiExtension.IntSlider("Energy Shield Percentage", Percentage, 1, 100);
            Parameters[PercentageString] = Percentage.ToString();

            return(true);
        }
Exemplo n.º 11
0
        public override Composite GetComposite(ExtensionParameter profileParameter)
        {
            return(new TreeSharp.Action((x) =>
            {
                if (profileParameter.Plugin.ExtensionCache.Cache.TryGetValue(Owner, out Dictionary <string, object> MyCache))
                {
                    var timerCacheString = DefaultExtension.CustomerTimerPrefix + TimerName;
                    Stopwatch stopWatch = null;
                    if (!MyCache.TryGetValue(timerCacheString, out object value))
                    {
                        stopWatch = new Stopwatch();
                        MyCache[timerCacheString] = stopWatch;
                    }
                    else
                    {
                        stopWatch = (Stopwatch)value;
                    }

                    if (ForceStop)
                    {
                        // We need to start the timer, and it isn't in the cache already
                        stopWatch.Stop();
                    }
                    else
                    {
                        stopWatch.Restart();
                    }
                }
                else
                {
                    profileParameter.Plugin.LogErr(Name + " is unable to get cache!", 5);
                }
            }));
        }
Exemplo n.º 12
0
        public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
        {
            return(() =>
            {
                if (extensionParameter.Plugin.ExtensionCache.Cache.TryGetValue(Owner, out Dictionary <string, object> MyCache))
                {
                    var timerCacheString = DefaultExtension.CustomerTimerPrefix + TimerNameString;
                    if (MyCache.TryGetValue(timerCacheString, out object value))
                    {
                        Stopwatch stopWatch = (Stopwatch)value;
                        return stopWatch.ElapsedMilliseconds >= TimeElapsed;
                    }
                    else
                    {
                        return TrueIfStopped;
                    }
                }
                else
                {
                    extensionParameter.Plugin.LogErr(Name + " is unable to get cache!", 5);
                }

                return false;
            });
        }
Exemplo n.º 13
0
        public TriggerMenu(ExtensionParameter extensionParameter, TriggerComposite parent)
        {
            ExtensionParameter = extensionParameter;
            Parent             = parent;

            ActiveWorkingTriggerCondition = null;
            TriggerComposite = new TriggerComposite();
        }
Exemplo n.º 14
0
 private bool MissingFlaskBuff(ExtensionParameter extensionParameter, PlayerFlask playerFlask)
 {
     return(!extensionParameter.Plugin.PlayerHelper.playerHasBuffs(new List <string> {
         playerFlask.BuffString1
     }) || !extensionParameter.Plugin.PlayerHelper.playerHasBuffs(new List <string> {
         playerFlask.BuffString2
     }));
 }
Exemplo n.º 15
0
 public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
 {
     ImGui.TextDisabled("Action Info");
     ImGuiExtension.ToolTipWithText("(?)", "This action is used to send a hotkey to the game.");
     Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
     ImGuiExtension.ToolTipWithText("(?)", "Hotkey to press for this action.");
     Parameters[keyString] = Key.ToString();
     return(true);
 }
 public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
 {
     return(() =>
     {
         bool retVal = WinApi.IsKeyDown((Keys)Key);
         ///extensionParameter.Plugin.Log($"Evaluated condition: {retVal}", 3);
         return retVal;
     });
 }
 public override Func<bool> GetCondition(ExtensionParameter extensionParameter)
 {
     return () =>
     {
         //extensionParameter.Plugin.LogMessage($"Key: {Key}");
         bool retVal = Input.GetKeyState((Keys)Key);
         ///extensionParameter.Plugin.Log($"Evaluated condition: {retVal}", 3);
         return retVal;
     };
 }
Exemplo n.º 18
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Action Info");
            ImGuiExtension.ToolTip("This action is used to use a specific flask.\nFlask Hotkey will be pulled from plugin settings.");

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            ImGuiExtension.ToolTip("Index for flask to be used (1= farthest left, 5 = farthest right)");
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            return(true);
        }
Exemplo n.º 19
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTipWithText("(?)", "This condition is used to determine if we have the flask buff up already.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            return(true);
        }
Exemplo n.º 20
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTipWithText("(?)", "This condition will return true if the player has been moving longer than the specified time.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            MsMoving = ImGuiExtension.IntSlider("Time spent moving (ms)", (int)MsMoving, 0, 10000);
            ImGuiExtension.ToolTipWithText("(?)", "Player must remain moving for this configured number of milliseconds (1000ms = 1 sec) before this condition returns true");
            Parameters[msMovingString] = MsMoving.ToString();
            return(true);
        }
Exemplo n.º 21
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTipWithText("(?)", "This condition is used to determine if we can use a specific skill.\nSkill name can be obtained through DevTree by looking through the player's actor component, then actor skills list.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            SkillName = ImGuiExtension.InputText("Skill Name", SkillName, 100, ImGuiInputTextFlags.AllowTabInput);
            Parameters[skillNameString] = SkillName.ToString();

            return(true);
        }
Exemplo n.º 22
0
        public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
        {
            return(() =>
            {
                //  if (RemFrozen && hasAilment(extensionParameter, extensionParameter.Plugin.Cache.DebuffPanelConfig.Frozen))
                //        return true;
                //   if (CorruptCount > 0 && hasAilment(extensionParameter, extensionParameter.Plugin.Cache.DebuffPanelConfig.Corruption, () => CorruptCount))
                //       return true;

                return false;
            });
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("Hotkey to check for pressed down state");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
            ImGuiExtension.ToolTip("Hotkey to press for this action.");
            Parameters[keyString] = Key.ToString();

            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition is used to determine if we can use a specific flask.\nIt will ensure that health/hybrid/mana potions are not used when we are at full health/mana.\nThis will also ensure that we do not use up reserved uses.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            ReservedUses = ImGuiExtension.IntSlider("Reserved Uses", ReservedUses, 0, 5);
            Parameters[flaskIndexString] = ReservedUses.ToString();
            return(true);
        }
Exemplo n.º 25
0
 public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
 {
     return(() =>
     {
         var flaskInfo = extensionParameter.Plugin.FlaskHelper.GetFlaskInfo(FlaskIndex - 1);
         if (flaskInfo == null)
         {
             return false;
         }
         return !extensionParameter.Plugin.PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List <string> {
             flaskInfo.BuffString1, flaskInfo.BuffString2
         });
     });
 }
Exemplo n.º 26
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has any of the selected ailments or a minimum of the specified corrupted blood stacks.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);
            var buffList       = GetEnumList <BuffEnums>().ToList();
            var buffListSearch = buffList.Where(x => x.Contains(SearchString)).ToList();

            HasBuffReady = ImGuiExtension.ComboBox("Buff List", HasBuffReady, buffListSearch);
            Parameters[SearchingBuff] = HasBuffReady.ToString();

            SearchString = ImGuiExtension.InputText("Filter Buffs", SearchString, 32, InputTextFlags.AllowTabInput);
            Parameters[SearchStringString] = SearchString.ToString();
            return(true);
        }
Exemplo n.º 27
0
        private PlayerFlask findFlaskMatchingAnyAction(ExtensionParameter extensionParameter, List <FlaskActions> flaskActions, Boolean?instant, Boolean ignoreBuffs, Func <List <FlaskActions> > ignoreFlasksWithAction)
        {
            var allFlasks = extensionParameter.Plugin.FlaskHelper.GetAllFlaskInfo();

            // We have no flasks or settings for flasks?
            if (allFlasks == null || extensionParameter.Plugin.Settings.FlaskSettings == null)
            {
                extensionParameter.Plugin.Log("No flasks or no settings.", 5);
                return(null);
            }

            if (extensionParameter.Plugin.Settings.Debug)
            {
                foreach (var flask in allFlasks)
                {
                    extensionParameter.Plugin.Log("Flask: " + flask.Name + " Instant: " + flask.Instant + " A1: " + flask.Action1 + " A2: " + flask.Action2, 5);
                }
            }

            List <FlaskActions> ignoreFlaskActions = ignoreFlasksWithAction == null ? null : ignoreFlasksWithAction();

            var flaskList = allFlasks
                            .Where(x =>
                                   //extensionParameter.Plugin.Settings.FlaskSettings[x.Index].Enabled &&
                                   flaskHasAvailableAction(flaskActions, ignoreFlaskActions, x) &&
                                   extensionParameter.Plugin.FlaskHelper.CanUsePotion(x, reserveFlaskCharges, instant == null) &&
                                   FlaskMatchesInstant(extensionParameter, x, instant) &&
                                   (ignoreBuffs || MissingFlaskBuff(extensionParameter, x))
                                   ).OrderByDescending(x => flaskActions.Contains(x.Action1)).ThenByDescending(x => x.TotalUses).ToList();


            if (flaskList == null || !flaskList.Any())
            {
                if (extensionParameter.Plugin.Settings.Debug)
                {
                    extensionParameter.Plugin.Log("No flasks found for requested actions: " + String.Concat(flaskActions?.Select(x => x.ToString() + ",")), 5);
                }
                return(null);
            }
            else if (extensionParameter.Plugin.Settings.Debug)
            {
                extensionParameter.Plugin.Log("Using flask " + flaskList.FirstOrDefault()?.Name + " for actions: " + String.Concat(flaskActions?.Select(x => x.ToString() + ",")), 5);
            }


            return(flaskList.FirstOrDefault());
        }
Exemplo n.º 28
0
    /// <summary>
    /// Add Parameter
    /// </summary>
    /// <param name="name">Parameter Name</param>
    /// <param name="label">Parameter Label</param>
    /// <param name="maxLength">Maximum Length</param>
    /// <param name="required">Set if value in the parameter required when added/apdated</param>
    /// <param name="keyfield">Mark field as primary key, unique and required</param>
    /// <param name="parType">Parameter type (integer, string, boolean etc.)</param>
    public void AddParameter(string name, string label, int maxLength, bool required, bool keyfield, ParameterType parType)
    {
        if (_params == null)
        {
            _params = new List <ExtensionParameter>();
        }

        ExtensionParameter par = new ExtensionParameter(name);

        par.Label     = label;
        par.MaxLength = maxLength;
        par.Required  = required;
        par.KeyField  = keyfield;
        par.ParamType = parType;

        _params.Add(par);
    }
Exemplo n.º 29
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Action Info");
            ImGuiExtension.ToolTipWithText("(?)", "This timer is used to begin or end a specific timer");
            TimerName = ImGuiExtension.InputText("Timer Name", TimerName, 30, ImGuiInputTextFlags.AlwaysInsertMode);
            ImGuiExtension.ToolTipWithText("(?)", "Name for this timer");
            Parameters[TimerNameString] = TimerName.ToString();

            var selectedOption = ForceStop ? 1 : 0;

            ImGui.RadioButton("Start Timer", ref selectedOption, 0);
            ImGui.RadioButton("End Timer", ref selectedOption, 1);
            ForceStop = selectedOption == 1;
            Parameters[ForceStopString] = ForceStop.ToString();

            return(true);
        }
Exemplo n.º 30
0
        public override Func <bool> GetCondition(ExtensionParameter extensionParameter)
        {
            return(() =>
            {
                var playerBuff = GameController.Instance.Game.IngameState.Data.LocalPlayer.GetComponent <Life>();
                var player = extensionParameter.Plugin.PlayerHelper;
                var localPlayer = GameController.Instance.Game.IngameState.Data.LocalPlayer;
                var playeraccess = localPlayer.GetComponent <Actor>().ActorSkills;
                var playerhasBuff = playerBuff.Buffs.Any(x => x.Name == HasBuffReady && (x.Timer >= RemainingDuration * 1000));

                if (playerhasBuff)
                {
                    return true;
                }

                return false;
            });
        }
Exemplo n.º 31
0
    /// <summary>
    /// Add Parameter
    /// </summary>
    /// <param name="name">Parameter Name</param>
    /// <param name="label">Parameter Label</param>
    /// <param name="maxLength">Maximum Length</param>
    /// <param name="required">Set if value in the parameter required when added/apdated</param>
    /// <param name="keyfield">Mark field as primary key, unique and required</param>
    /// <param name="parType">Parameter type (integer, string, boolean etc.)</param>
    public void AddParameter(string name, string label, int maxLength, bool required, bool keyfield, ParameterType parType)
    {
        if (_params == null)
          _params = new List<ExtensionParameter>();

        ExtensionParameter par = new ExtensionParameter(name);
        par.Label = label;
        par.MaxLength = maxLength;
        par.Required = required;
        par.KeyField = keyfield;
        par.ParamType = parType;

        _params.Add(par);
    }