Beispiel #1
0
        private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (!sender.Owner.IsMe)
            {
                return;
            }

            if (args.Slot == SpellSlot.Recall)
            {
                evadePoint2 = Vector2.Zero;
            }

            if (!Evading)
            {
                return;
            }

            var blockLvl = Configs.CheckBlock;

            if (blockLvl == 0)
            {
                return;
            }

            var isDangerous = false;

            foreach (var spell in Spells.Where(i => !i.IsSafePoint(PlayerPosition)))
            {
                isDangerous = spell.GetValue <bool>("IsDangerous");

                if (isDangerous)
                {
                    break;
                }
            }

            if (blockLvl == 1 && !isDangerous)
            {
                return;
            }

            args.Process = !SpellBlocker.CanBlock(args.Slot);
        }
Beispiel #2
0
        private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (!sender.Owner.IsMe)
            {
                return;
            }

            if (args.Slot == SpellSlot.Recall)
            {
                evadePoint2 = Vector2.Zero;
            }

            if (!Evading)
            {
                return;
            }

            var blockLvl = Configs.Menu.Item("CheckBlock").GetValue <StringList>().SelectedIndex;

            if (blockLvl == 0)
            {
                return;
            }

            var isDangerous = false;

            foreach (var spell in DetectedSpells.Values.Where(i => i.Enable && i.IsDanger(PlayerPosition)))
            {
                isDangerous = spell.GetValue <bool>("IsDangerous");

                if (isDangerous)
                {
                    break;
                }
            }

            if (blockLvl == 1 && !isDangerous)
            {
                return;
            }

            args.Process = !SpellBlocker.CanBlock(args.Slot);
        }