示例#1
0
 public SummonerItems(Obj_AI_Hero myHero)
 {
     _player = myHero;
     _sumBook = _player.Spellbook;
     _ignite = _player.GetSpellSlot("summonerdot");
     _smite = _player.GetSpellSlot("SummonerSmite");
 }
示例#2
0
 private void PassiveControl(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E)
     {
         ProcessSpell();
     }
 }
示例#3
0
 private void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.E)
     {
         NextCicleOn = Game.Time + 9.8f;
     }
 }
示例#4
0
 public SummonerItems(Obj_AI_Hero myHero)
 {
     player = myHero;
     sumBook = player.Spellbook;
     ignite = player.GetSpellSlot("summonerdot");
     smite = player.GetSpellSlot("SummonerSmite");
 }
示例#5
0
 private void Spellbook_OnUpdateChargedSpell(Spellbook sender, SpellbookUpdateChargedSpellEventArgs args)
 {
     if (sender.Owner.IsMe)
     {
         args.Process = !Config.Item("autoR", true).GetValue<bool>();
     }
 }
示例#6
0
 public static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (sender.Owner.IsMe && args.Slot == SpellSlot.Q && Program.Player.IsDashing())
     {
         args.Process = false;
     }
 }
示例#7
0
 protected override void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (sender.Owner.IsMe && args.Slot == SpellSlot.Q)
     {
         LastCast = myUtility.TickCount;
     }
 }
示例#8
0
        static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender == null || !sender.Owner.IsMe) {
                return;
            }
            var antiswitch = Config.Item("antiswitchenabled").GetValue<bool>();
            var useforthis = Config.Item("Spells." + args.Slot).GetValue<bool>();
            var target = args.Target as Obj_AI_Hero;
            var mindelay = Config.Item("mindelay").GetValue<Slider>().Value;

            if (antiswitch && target != null)
            {
                if (target != Player.LastCastedSpellTarget() && Utils.TickCount - Player.LastCastedSpellT() <= mindelay)
                {
                    args.Process = false;
                    return;
                }
            }

            var humanizerenabled = Config.Item("humanizerenabled").GetValue<bool>();
            var delayforthis = Config.Item(args.Slot + "delay").GetValue<Slider>().Value;
            if (humanizerenabled && useforthis)
            {
                if (Utils.TickCount - Player.LastCastedSpellT() <= delayforthis)
                {
                    args.Process = false;
                }
            }
        }
示例#9
0
 private static void OnStopCast(Spellbook sender, SpellbookStopCastEventArgs args)
 {
     if (sender?.Owner != null && sender.Owner.IsMe)
     {
         IsBusy = false;
     }
 }
示例#10
0
        public static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe)
            {
                lock (m_lock)
                {
                    if (SPredictioner.Config.Item("ENABLED").GetValue<bool>() && (SPredictioner.Config.Item("COMBOKEY").GetValue<KeyBind>().Active || SPredictioner.Config.Item("HARASSKEY").GetValue<KeyBind>().Active))
                    {
                        if (!ShineCommon.Utility.IsValidSlot(args.Slot))
                            return;

                        if (SPredictioner.Spells[(int)args.Slot] == null)
                            return;

                        if (handleEvent[(int)args.Slot])
                        {
                            args.Process = false;
                            handleEvent[(int)args.Slot] = false;
                            var enemy = args.EndPosition.GetEnemiesInRange(200f).OrderByDescending(p => ShineCommon.Utility.GetPriority(p.ChampionName)).FirstOrDefault();
                            if (enemy == null)
                                enemy = TargetSelector.GetTarget(SPredictioner.Spells[(int)args.Slot].Range, TargetSelector.DamageType.Physical);

                            if (enemy != null)
                                SPredictioner.Spells[(int)args.Slot].SPredictionCast(enemy, ShineCommon.Utility.HitchanceArray[SPredictioner.Config.Item("SPREDHITC").GetValue<StringList>().SelectedIndex]);
                        }
                    }
                }
            }
        }
示例#11
0
 private void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E)
     {
         passRdy = true;
     }
 }
示例#12
0
 protected override void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (sender.Owner.IsMe && args.Slot == SpellSlot.E && Player.IsDashing())
     {
         args.Process = false;
     }
 }
示例#13
0
 public static void OnSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q)
     {
         PortAIO.OrbwalkerManager.ResetAutoAttackTimer();
     }
 }
示例#14
0
 private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (sender.Owner.IsMe)
     {
         if (args.Slot == SpellSlot.Q)
         {
             args.Process = Orbwalker.CanMove;
             QCastSpellTime = Core.GameTickCount;
         }
         else if (args.Slot == SpellSlot.W)
         {
             args.Process = Core.GameTickCount - Champion.ShouldWaitTime > W.CastDelay && Orbwalker.CanMove;
             if (args.Process)
             {
                 WCastSpellTime = Core.GameTickCount;
             }
         }
         else if (args.Slot == SpellSlot.R)
         {
             if (args.Process)
             {
                 RCastSpellTime = Core.GameTickCount;
             }
         }
     }
 }
示例#15
0
        private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe && args.Slot == F.Slot)
            {
                var wall = SummMenu["wall"].Cast<CheckBox>().CurrentValue
                           && (NavMesh.GetCollisionFlags(args.EndPosition) == CollisionFlags.Wall
                               || NavMesh.GetCollisionFlags(args.EndPosition) == CollisionFlags.Building);

                if (wall && SummMenu["wall"].Cast<CheckBox>().CurrentValue
                    || args.EndPosition.Distance(Player.Instance) < 450 && SummMenu["extend"].Cast<CheckBox>().CurrentValue)
                {
                    args.Process = false;
                }

                if (args.EndPosition.Distance(Player.Instance) < 450 && SummMenu["extend"].Cast<CheckBox>().CurrentValue)
                {
                    if (wall && SummMenu["wall"].Cast<CheckBox>().CurrentValue)
                    {
                        args.Process = false;
                    }

                    F.Cast(Player.Instance.Position.Extend(Game.CursorPos, 450).To3D());
                }
            }
        }
示例#16
0
        void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (!IsActive() || SummonerSpells.GetFlashSlot() == args.Slot || !sender.Owner.IsMe)
                return;

            var startWall = GetStartWall();
            if (!startWall.IsZero && Game.CursorPos.IsWall() && ObjectManager.Player.Distance(startWall) < 1000)
            {
                args.Process = false;
                ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, startWall);

                return;
            }

            for (var dist = ObjectManager.Player.Distance(Game.CursorPos); dist < 800; dist += 25)
            {
                var curPos = ObjectManager.Player.Position.Extend(Game.CursorPos, dist);
                if (!curPos.IsWall())
                {
                    ObjectManager.Player.Spellbook.CastSpell(args.Slot, curPos, false);
                    return;
                }
            }

            if (ObjectManager.Player.ServerPosition.To2D().Distance(args.StartPosition) < 390f)
            {
                args.Process = false;
                ObjectManager.Player.Spellbook.CastSpell(args.Slot, ObjectManager.Player.ServerPosition.Extend(args.StartPosition, 400f));
            }
        }
示例#17
0
 public static void OnSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q)
     {
         Orbwalker.ResetAutoAttack();
     }
 }
示例#18
0
 private static void OnStopCast(Spellbook sender, SpellbookStopCastEventArgs args)
 {
     if (sender.Owner.IsMe)
     {
         IsRunning = false;
     }
 }
 private static void OnSpellbookCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (!Enabled)
     {
         return;
     }
     try
     {
         if (sender.Owner.IsMe)
         {
             var target = args.Target as Obj_AI_Hero;
             if (target != null)
             {
                 switch (args.Slot)
                 {
                     case SpellSlot.Q:
                     case SpellSlot.W:
                     case SpellSlot.E:
                     case SpellSlot.R:
                         Damages.Clean();
                         if (Damages.IsDying(target))
                         {
                             args.Process = false;
                         }
                         break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
示例#20
0
        private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe)
            {
                switch (args.Slot)
                {
                    case SpellSlot.Q:
                    case SpellSlot.W:
                    case SpellSlot.E:
                    case SpellSlot.R:

                        if (IsReady)
                        {
                            // We are safe to cast a spell
                            _sendTime = TickCount;
                        }
                        else
                        {
                            // Don't allow the spellcast
                            args.Process = false;
                        }
                        break;
                }
            }
        }
示例#21
0
 private static void OnCast(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.E)
     {
         if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && args.Target is Obj_AI_Hero) CastYoumoo();
     }
     if (args.Slot == SpellSlot.Q) Orbwalking.LastAATick = 0;
 }
示例#22
0
文件: Program.cs 项目: badao/Rengar
 private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q)
     {
         args.Process = false;
         Player.Spellbook.CastSpell(SpellSlot.Q, Player.Position.Extend(args.StartPosition, Variables.Q.Range), false);
     }
 }
示例#23
0
 private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.R || args.Slot == SpellSlot.E || args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W)
     {
         dontAtt = true;
         dontatttimer = Environment.TickCount;
     }
 }
示例#24
0
        protected override void OnSpellCast(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (Orbwalker.ActiveModesFlags != Orbwalker.ActiveModes.Combo || !_q.IsReady() || !sender.Owner.IsMe ||
                args.Slot != SpellSlot.W || args.Process == false || !sender.Owner.IsMe) return;

            var qdelay = Math.Max(0, Player.Distance(args.Target) - 365)/1.2f - 25;
            Core.DelayAction(() => _q.Cast(), (int) qdelay);
        }
示例#25
0
 /// <summary>
 ///     Called on spell cast.
 /// </summary>
 /// <param name="spellbook">The spellbook.</param>
 /// <param name="args">The <see cref="SpellbookCastSpellEventArgs" /> instance containing the event data.</param>
 public static void OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
 {
     if (spellbook.Owner.IsMe && ObjectManager.Player.Spellbook.GetSpell(args.Slot).Name.Equals("recall")
         && Variables.QMenu.Item("logical").IsActive())
     {
         Variables.Q.Cast();
     }
 }
示例#26
0
 static void SpellbookOnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
 {
     if (spellbook.Owner.IsMe)
     {
         LastCastPacketSent = new LastCastPacketSentEntry(
                 args.Slot, Utils.TickCount, (args.Target is Obj_AI_Base) ? args.Target.NetworkId : 0);
     }
 }
示例#27
0
文件: PiEvents.cs 项目: WeinerCH/EB
 private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (Orbwalker.ActiveModesFlags.Equals(Orbwalker.ActiveModes.Combo))
         if (sender.Owner.IsMe)
             if ((args.Slot == SpellSlot.W)
                 && PiSkills.Q.IsReady() && PiSkills.E.IsReady())
                 args.Process = false;
 }
示例#28
0
 private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     // Avoid stupid Q casts while jumping in mid air!
     if (sender.Owner.IsMe && args.Slot == SpellSlot.Q && Player.Instance.IsDashing())
     {
         // Don't process the packet since we are jumping!
         args.Process = false;
     }
 }
示例#29
0
 /// <summary>
 ///     Called on spell cast.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The <see cref="SpellbookCastSpellEventArgs" /> instance containing the event data.</param>
 public static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (sender.Owner.IsMe &&
         GameObjects.Player.Spellbook.GetSpell(args.Slot).Name.Equals("recall") &&
         Vars.getCheckBoxItem(Vars.QMenu, "logical"))
     {
         Vars.Q.Cast();
     }
 }
示例#30
0
 private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     if (args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E)
     {
         passive = true;
         Utility.DelayAction.Add(150, () => passive = false);
     }
    
 }
示例#31
0
 private static void OnCast(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     passive = false;
 }
示例#32
0
 protected virtual void Spellbook_OnUpdateChargedSpell(Spellbook sender, SpellbookUpdateChargedSpellEventArgs args)
 {
 }
示例#33
0
        public override void Initialize()
        {
            Aimsharp.PrintMessage("Kyber Destruction Warlock - v 1.0", Color.Blue);
            Aimsharp.PrintMessage("These macros can be used for manual control:", Color.Blue);
            Aimsharp.PrintMessage("Recommended talents: 3203012", Color.Blue);
            Aimsharp.PrintMessage("/xxxxx SaveCovenant", Color.Blue);
            Aimsharp.PrintMessage("--Toggles using Covenant abilities on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("/xxxxx SaveCooldowns", Color.Blue);
            Aimsharp.PrintMessage("--Toggles the use of big cooldowns on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("/xxxxx AOE", Color.Blue);
            Aimsharp.PrintMessage("--Toggles AOE mode on/off.", Color.Blue);
            Aimsharp.PrintMessage(" ");
            Aimsharp.PrintMessage("--Replace xxxxx with first 5 letters of your addon, lowercase.", Color.Blue);
            Aimsharp.PrintMessage("This rotation will use Havoc on your focus target, so please make a macro to set focus quickly.", Color.Blue);
            Aimsharp.PrintMessage("/focus [@mouseover,nodead,exists]; [@target,exists]", Color.Blue);

            Aimsharp.Latency    = 50;
            Aimsharp.QuickDelay = 125;
            Aimsharp.SlowDelay  = 250;

            foreach (string Spell in SpellsList)
            {
                Spellbook.Add(Spell);
            }

            foreach (string Spell in CovenantAbilities)
            {
                Spellbook.Add(Spell);
            }

            foreach (string Spell in Racials)
            {
                Spellbook.Add(Spell);
            }

            foreach (string Buff in GeneralBuffs)
            {
                Buffs.Add(Buff);
            }

            foreach (string Buff in BuffsList)
            {
                Buffs.Add(Buff);
            }

            foreach (string Buff in BloodlustEffects)
            {
                Buffs.Add(Buff);
            }

            foreach (string Debuff in DebuffsList)
            {
                Debuffs.Add(Debuff);
            }

            foreach (string Debuff in GeneralDebuffs)
            {
                Debuffs.Add(Debuff);
            }

            foreach (string Totem in TotemsList)
            {
                Totems.Add(Totem);
            }

            Items.Add(GetString("Potion name:"));

            Macros.Add("DPS Pot", "/use " + GetString("Potion name:"));
            Macros.Add("havoc focus", "/cast [@focus] Havoc");
            Macros.Add("cata cursor", "/cast [@cursor] Cataclysm");
            Macros.Add("rof cursor", "/cast [@cursor] Rain of Fire");
            Macros.Add("inf cursor", "/cast [@cursor] Summon Infernal");
            Macros.Add("TopTrink", "/use 13");
            Macros.Add("BotTrink", "/use 14");

            foreach (string MacroCommand in MacroCommands)
            {
                CustomCommands.Add(MacroCommand);
            }

            CustomFunctions.Add("GetCovenant", "local spell = 0 local i = 1 while true do local spellName, spellSub = GetSpellBookItemName(i, BOOKTYPE_SPELL) if not spellName then do break end end if spellName == 'Decimating Bolt' then spell = 4 elseif spellName == 'Soul Rot' then spell = 3 elseif spellName == 'Impending Catastrophe' then spell = 2 elseif spellName == 'Scouring Tithe' then spell = 1 end i = i + 1 end return spell");
            CustomFunctions.Add("GetLegendarySpellID", "local power = 0 for i=1,15,1 do local xcs = ItemLocation:CreateFromEquipmentSlot(i) if(C_Item.DoesItemExist(xcs)) then if(C_LegendaryCrafting.IsRuneforgeLegendary(xcs)) then local id = C_LegendaryCrafting.GetRuneforgeLegendaryComponentInfo(xcs)[\"powerID\"] power = C_LegendaryCrafting.GetRuneforgePowerInfo(id)[\"descriptionSpellID\"] end end end return power");
        }
示例#34
0
 protected virtual void SpellbookOnOnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
 }
示例#35
0
        internal static void HandleUpdateCasterLevel(UnitDescriptor unit, LevelUpState state, Spellbook spellbook)
        {
            var casterLevel = spellbook.CasterLevel;

            if (CanReplaceSpellThisLevel(spellbook))
            {
                Dictionary <int, BlueprintFeatureSelection> levelEntries;
                if (!casterProgressions.TryGetValue(spellbook.Blueprint, out levelEntries))
                {
                    Log.Write($"Error: could not find spellbook {spellbook.Blueprint.name}" +
                              $", keys are: {String.Join(", ", casterProgressions.Keys.Select(k => k.name))}");
                    return;
                }

                BlueprintFeatureSelection feat;
                if (levelEntries.TryGetValue(casterLevel, out feat))
                {
                    state.AddSelection(null, feat, feat, casterLevel);
                }
            }
        }
示例#36
0
 private static void OnLoadingComplete(EventArgs args)
 {
     if (Varus.Hero != Champion.Varus)
     {
         return;
     }
     _q = new Spell.Chargeable(SpellSlot.Q, 1000, 1600, 1300, 0, 1900, 70)
     {
         AllowedCollisionCount = int.MaxValue
     };
     _w = new Spell.Active(SpellSlot.W);
     _e = new Spell.Skillshot(SpellSlot.E, 925, SkillShotType.Circular, 250, 1500, 235);
     _r = new Spell.Skillshot(SpellSlot.R, 1250, SkillShotType.Linear, 250, 1950, 120)
     {
         AllowedCollisionCount = -1
     };
     Orbwalker.OnPreAttack          += (a, b) => IsPreAa = true;
     Orbwalker.OnPostAttack         += (a, b) => { IsPreAa = false; IsAfterAa = true; };
     Game.OnTick                    += VarusActive;
     Gapcloser.OnGapcloser          += QAndRAntiGapCloser;
     Obj_AI_Base.OnProcessSpellCast += AutoItem;
     Obj_AI_Base.OnLevelUp          += OnLevelUpR;
     Drawing.OnEndScene             += HasarGostergesi;
     Drawing.OnDraw                 += SpellDraw;
     _lvl  = Varus.Spellbook;
     _main = MainMenu.AddMenu("Super韦鲁斯", "index");
     _main.AddGroupLabel("欢迎使用 Super韦鲁斯");
     _main.AddSeparator(5);
     _main.AddLabel("祝您游戏愉快!");
     _combo = _main.AddSubMenu("连招设置");
     _combo.AddGroupLabel("韦鲁斯 连招 设置");
     _combo.AddLabel("连招使用Q (On/Off)");
     _combo.Add("q", new CheckBox("使用 Q"));
     _combo.AddSeparator(5);
     _combo.Add("qlogic", new ComboBox("Q 逻辑", 0, "正常", "Super"));
     _combo.AddSeparator(5);
     _combo.AddLabel("连招使用E (On/Off)" + "                                 " + "仅在3成W使用E (On/Off)");
     _combo.Add("e", new CheckBox("使用 E"));
     _combo.Add("stackWuseE", new CheckBox("仅在3成W使用E"));
     _combo.AddSeparator(5);
     _combo.Add("EHitChance", new Slider("E 命中率 : {0}", 60));
     _combo.AddSeparator(5);
     _combo.AddLabel("使用手动R键设置");
     _combo.Add("RKey", new KeyBind("手动R热键绑定", false, KeyBind.BindTypes.HoldActive, 'T'));
     _combo.AddSeparator(5);
     _combo.Add("rlogic", new ComboBox("R 逻辑 ", 0, "正常", "Super"));
     _combo.AddSeparator(5);
     _combo.Add("RHit", new Slider("手动R敌人数量", 1, 1, 5));
     _combo.AddSeparator(5);
     _combo.Add("RHitChance", new Slider("R 命中率 : {0}", 60));
     _harras = _main.AddSubMenu("骚扰设置");
     _harras.AddGroupLabel("韦鲁斯 骚扰 设置");
     _harras.AddLabel("使用骚扰Q键设置");
     _harras.Add("harrasQ", new KeyBind("骚扰Q热键绑定", false, KeyBind.BindTypes.HoldActive, 'C'));
     _harras.AddSeparator(5);
     _harras.Add("HmanaP", new Slider("自动骚扰Q蓝量控制百分比 ({0}%) to use Q", 50, 1));
     _harras.AddSeparator(5);
     _harras.Add("QHitChance", new Slider("Q 命中率 : {0}", 60));
     _laneclear = _main.AddSubMenu("清线设置");
     _laneclear.AddGroupLabel("韦鲁斯 清线 设置");
     _laneclear.Add("LmanaP", new Slider(" 使用Q和E清线最小蓝量控制百分比({0}%)", 70, 1));
     _laneclear.AddSeparator(5);
     _laneclear.Add("q", new CheckBox("使用Q (On/Off)"));
     _laneclear.Add("qHit", new Slider("最少{0} 小兵使用Q", 3, 1, 6));
     _laneclear.AddSeparator(5);
     _laneclear.Add("e", new CheckBox("使用 E (On/Off)"));
     _laneclear.Add("eHit", new Slider("最少 {0} 小兵使用E", 3, 1, 6));
     _jungleclear = _main.AddSubMenu("打野设置");
     _jungleclear.AddGroupLabel("韦鲁斯 打野 设置");
     _jungleclear.Add("JmanaP", new Slider("使用Q和E打野最小蓝量控制百分比 ({0}%)", 30, 1));
     _jungleclear.AddSeparator(5);
     _jungleclear.AddLabel("打野使用Q和E (On/Off)");
     _jungleclear.Add("q", new CheckBox("使用 Q"));
     _jungleclear.Add("e", new CheckBox("使用 E"));
     _drawings = _main.AddSubMenu("线圈设置");
     _drawings.AddGroupLabel("韦鲁斯 线圈 设置");
     _drawings.AddLabel("画出Q-E-R线圈 (On/Off)");
     _drawings.Add("drawQ", new CheckBox("Q线圈", false));
     _drawings.Add("drawE", new CheckBox("E线圈", false));
     _drawings.Add("drawR", new CheckBox("R线圈", false));
     _drawings.AddLabel("画出损伤指示 (On/Off)");
     _drawings.Add("damageQ", new CheckBox("损伤指示"));
     _misc = _main.AddSubMenu("其他设置");
     _misc.AddLabel("自动使用破败王者之刃和水银弯刀");
     _misc.Add("botrk", new CheckBox("使用破败王者之刃 "));
     _misc.Add("autoCutlass", new CheckBox("使用水银弯刀"));
     _drawings.AddSeparator(5);
     _misc.AddLabel("使用R反突进 ");
     //_misc.Add("Qgap", new CheckBox("Use Q Anti Gap Closer (On/Off)", false));
     _misc.Add("Rgap", new CheckBox("使用R反突进", false));
 }
示例#37
0
 private void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
 }
示例#38
0
文件: Evade.cs 项目: hehelmaoCx/Ports
        private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
        {
            if (!spellbook.Owner.IsMe)
            {
                return;
            }

            var    sData = spellbook.GetSpell(args.Slot);
            string name;

            if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name))
            {
                //Evade.isChanneling = true;
                //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D;
                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
            }

            //block spell commmands if evade spell just used
            if (EvadeSpell.lastSpellEvadeCommand != null &&
                EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount)
            {
                args.Process = false;
            }

            lastSpellCast     = args.Slot;
            lastSpellCastTime = EvadeUtils.TickCount;

            //moved from processPacket

            /*if (args.Slot == SpellSlot.Recall)
             * {
             *  lastStopPosition = myHero.ServerPosition.To2D();
             * }*/

            if (Situation.ShouldDodge())
            {
                if (isDodging && SpellDetector.spells.Any())
                {
                    foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells)
                    {
                        SpellData spellData = entry.Value;

                        if (spellData.spellKey == args.Slot) //check if it's a spell that we should block
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }

            foreach (var evadeSpell in EvadeSpell.evadeSpells)
            {
                if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot && evadeSpell.untargetable == false)
                {
                    if (evadeSpell.evadeType == EvadeType.Blink)
                    {
                        var dir = (args.StartPosition.To2D() - myHero.ServerPosition.To2D()).Normalized();

                        var end = myHero.ServerPosition.To2D() + dir * myHero.ServerPosition.To2D().Distance(Game.CursorPos.To2D());
                        if (evadeSpell.fixedRange || end.Distance(myHero.ServerPosition.To2D()) > evadeSpell.range)
                        {
                            end = myHero.ServerPosition.To2D() + dir * evadeSpell.range;
                        }

                        var posInfo = EvadeHelper.CanHeroWalkToPos(end, evadeSpell.speed, ObjectCache.gamePing, 0);
                        if (posInfo.posDangerCount < 1)
                        {
                            if (lastPosInfo != null)
                            {
                                lastPosInfo = posInfo;
                            }

                            if (lastPosInfo == null)
                            {
                                lastPosInfo = posInfo;
                            }

                            if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 250)
                            {
                                EvadeCommand.MoveTo(Game.CursorPos.To2D());
                                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                            }
                            return;
                        }
                    }

                    if (evadeSpell.evadeType == EvadeType.Dash)
                    {
                        var dashPos = args.StartPosition.To2D();

                        if (args.Target != null)
                        {
                            dashPos = args.Target.Position.To2D();
                        }

                        if (evadeSpell.fixedRange || dashPos.Distance(myHero.ServerPosition.To2D()) > evadeSpell.range)
                        {
                            var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized();
                            dashPos = myHero.ServerPosition.To2D() + dir * evadeSpell.range;
                        }

                        var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, ObjectCache.gamePing, 0);
                        if (posInfo.posDangerLevel > 0)
                        {
                            args.Process = false;
                        }
                        else
                        {
                            if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                            {
                                EvadeCommand.MoveTo(Game.CursorPos.To2D());
                                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                            }

                            return;
                        }
                    }

                    lastPosInfo = PositionInfo.SetAllUndodgeable();
                    return;
                }
            }
        }
示例#39
0
        public DummyThief()
            : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Thief
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(105, 105, 105);
            Skills[SkillName.Healing].Base    = 120;
            Skills[SkillName.Anatomy].Base    = 120;
            Skills[SkillName.Stealing].Base   = 120;
            Skills[SkillName.ArmsLore].Base   = 100;
            Skills[SkillName.Meditation].Base = 120;
            Skills[SkillName.Wrestling].Base  = 120;

            // Name
            Name = "Hybrid Thief";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ItemQuality.Normal;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ItemQuality.Normal;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ItemQuality.Normal;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ItemQuality.Normal;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            Robe robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            Bandage band = new Bandage(50);

            AddToBackpack(band);
        }
示例#40
0
        public DummyAssassin()
            : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Hybrid Assassin
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(105, 105, 105);
            Skills[SkillName.Magery].Base     = 120;
            Skills[SkillName.EvalInt].Base    = 120;
            Skills[SkillName.Swords].Base     = 120;
            Skills[SkillName.Tactics].Base    = 120;
            Skills[SkillName.Meditation].Base = 120;
            Skills[SkillName.Poisoning].Base  = 100;

            // Name
            Name = "Hybrid Assassin";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddToBackpack(book);

            Katana kat = new Katana();

            kat.Movable       = false;
            kat.LootType      = LootType.Newbied;
            kat.Crafter       = this;
            kat.Poison        = Poison.Deadly;
            kat.PoisonCharges = 12;
            kat.Quality       = ItemQuality.Normal;
            AddToBackpack(kat);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ItemQuality.Normal;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ItemQuality.Normal;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ItemQuality.Normal;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ItemQuality.Normal;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            Robe robe = new Robe();

            robe.Hue = iHue;
            AddItem(robe);

            DeadlyPoisonPotion pota = new DeadlyPoisonPotion();

            pota.LootType = LootType.Newbied;
            AddToBackpack(pota);

            DeadlyPoisonPotion potb = new DeadlyPoisonPotion();

            potb.LootType = LootType.Newbied;
            AddToBackpack(potb);

            DeadlyPoisonPotion potc = new DeadlyPoisonPotion();

            potc.LootType = LootType.Newbied;
            AddToBackpack(potc);

            DeadlyPoisonPotion potd = new DeadlyPoisonPotion();

            potd.LootType = LootType.Newbied;
            AddToBackpack(potd);

            Bandage band = new Bandage(50);

            AddToBackpack(band);
        }
示例#41
0
 private void OnUpdateChargeableSpell(Spellbook sender, SpellbookUpdateChargeableSpellEventArgs args)
 {
     Volatile_OnUpdateChargeableSpell(sender, args);
 }
示例#42
0
 protected virtual void OnSpellCast(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     //for extensions
 }
示例#43
0
        public ClonedDarkMaster(Mobile owner) : base()
        {
            Name        = "Deimos";
            Title       = "the Dark Master";
            Hue         = 22222;
            BodyValue   = 400;
            BaseSoundID = 1001;

            SetStr(500);
            SetDex(100);
            SetInt(1500);

            SetHits(500);

            SetDamage(10, 15);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 35, 45);
            SetResistance(ResistanceType.Fire, 25, 30);
            SetResistance(ResistanceType.Cold, 25, 30);
            SetResistance(ResistanceType.Poison, 10, 20);
            SetResistance(ResistanceType.Energy, 10, 20);

            SetSkill(SkillName.Anatomy, 100.0);
            SetSkill(SkillName.EvalInt, 100.0);
            SetSkill(SkillName.Magery, 115.0);
            SetSkill(SkillName.Poisoning, 100.0);
            SetSkill(SkillName.MagicResist, 150.0);
            SetSkill(SkillName.Wrestling, 105.0);
            SetSkill(SkillName.Tactics, 105.0);
            SetSkill(SkillName.Meditation, 200.0);

            Fame  = 5000;
            Karma = -5000;

            VirtualArmor = 100;

            m_Owner = owner;

            WizardsHat hat = new WizardsHat();

            hat.Hue      = 1157;
            hat.LootType = LootType.Blessed;
            AddItem(hat);

            Sandals foot = new Sandals();

            foot.Hue      = 1157;
            foot.LootType = LootType.Blessed;
            AddItem(foot);

            Robe robe = new Robe();

            robe.Hue      = 22222;
            robe.LootType = LootType.Blessed;
            AddItem(robe);

            Cloak back = new Cloak();

            back.Hue      = 1157;
            back.LootType = LootType.Blessed;
            AddItem(back);

            Spellbook book = new Spellbook();

            book.Hue     = 1157;
            book.Content = 18446744073709551615;
            book.Movable = false;
            AddItem(book);

            BodySash top = new BodySash();

            top.Hue      = 1157;
            top.Layer    = Layer.Earrings;
            top.LootType = LootType.Blessed;
            AddItem(top);
        }
示例#44
0
 protected virtual void SpellbookOnOnStopCast(Spellbook sender, SpellbookStopCastEventArgs args)
 {
 }
示例#45
0
 private void Spellbook_OnUpdateChargedSpellEvent(Spellbook sender, SpellbookUpdateChargedSpellEventArgs args)
 {
     Spellbook_OnUpdateChargedSpell(sender, args);
 }
示例#46
0
文件: Flash.cs 项目: Burbb/Portaio
        private void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender == null || !sender.Owner.IsMe || args.Slot == SpellSlot.Unknown || !ObjectManager.Player.Spellbook.GetSpell(args.Slot).Name.Equals("SummonerFlash", StringComparison.OrdinalIgnoreCase) || !getCheckBoxItem("Enabled"))
            {
                return;
            }
            var endPos   = args.StartPosition;
            var distance = ObjectManager.Player.ServerPosition.LSDistance(endPos);

            if (getCheckBoxItem("WallCheck") && endPos.LSIsWall())
            {
                var wallStart = Vector3.Zero;
                var wallEnd   = Vector3.Zero;
                for (var i = 0; 900 > i; i++)
                {
                    var pos = ObjectManager.Player.Position.LSExtend(endPos, i);
                    if (wallStart.Equals(Vector3.Zero) && pos.LSIsWall())
                    {
                        wallStart = ObjectManager.Player.Position.LSExtend(endPos, i - 1);
                    }
                    if (!wallStart.Equals(Vector3.Zero) && !pos.LSIsWall())
                    {
                        wallEnd = pos;
                        break;
                    }
                }
                if (!wallStart.Equals(Vector3.Zero))
                {
                    if (wallEnd.Equals(Vector3.Zero) || wallEnd.LSDistance(endPos) > wallStart.LSDistance(endPos))
                    {
                        args.Process = false;
                        EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, wallStart);
                    }
                }
            }
            if (getCheckBoxItem("IgniteCheck"))
            {
                var buff =
                    ObjectManager.Player.Buffs.Where(
                        b => b.Name.Equals("SummonerDot", StringComparison.OrdinalIgnoreCase))
                    .OrderByDescending(b => b.EndTime)
                    .FirstOrDefault();
                if (buff != null && buff.EndTime - Game.Time > 0f)
                {
                    var hero = buff.Caster as AIHeroClient;
                    if (hero != null)
                    {
                        var ticks  = (int)(buff.EndTime - Game.Time);
                        var damage =
                            hero.GetSummonerSpellDamage(ObjectManager.Player, Damage.SummonerSpell.Ignite) / 5f *
                            (ticks > 0 ? ticks : 1);
                        if (damage >= ObjectManager.Player.Health)
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }
            if (getCheckBoxItem("Extend"))
            {
                if (distance < 390f)
                {
                    args.Process = false;
                    ObjectManager.Player.Spellbook.CastSpell(
                        args.Slot, ObjectManager.Player.ServerPosition.LSExtend(endPos, 450f));
                }
            }
        }
示例#47
0
 /// <summary>
 ///     Levels up a spell
 /// </summary>
 public static void LevelUpSpell(this Spellbook book, SpellSlot slot, bool evolve = false)
 {
     book.LevelSpell(slot);
 }
示例#48
0
        private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
        {
            if (!spellbook.Owner.IsMe)
            {
                return;
            }

            var    sData = spellbook.GetSpell(args.Slot);
            string name;

            if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name))
            {
                //Evade.isChanneling = true;
                //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D;
                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 85;
            }

            //block spell commmands if evade spell just used
            if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 110 > EvadeUtils.TickCount)
            {
                args.Process = false;
            }

            lastSpellCast     = args.Slot;
            lastSpellCastTime = EvadeUtils.TickCount;

            //moved from processPacket

            /*if (args.Slot == SpellSlot.Recall)
             * {
             *  lastStopPosition = myHero.ServerPosition.To2D();
             * }*/

            if (Situation.ShouldDodge())
            {
                if (isDodging && SpellDetector.spells.Count() > 0)
                {
                    foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells)
                    {
                        SpellData spellData = entry.Value;

                        if (spellData.spellKey == args.Slot) //check if it's a spell that we should block
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }

            foreach (var evadeSpell in EvadeSpell.evadeSpells)
            {
                if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot &&
                    evadeSpell.untargetable == false)
                {
                    if (//evadeSpell.evadeType == EvadeType.Blink ||
                        evadeSpell.evadeType == EvadeType.Dash)
                    {
                        //Block spell cast if flashing/blinking into spells

                        /*if (args.EndPosition.To2D().CheckDangerousPos(6, true)) //for blink + dash
                         * {
                         *  args.Process = false;
                         *  return;
                         * }*/

                        if (evadeSpell.evadeType == EvadeType.Dash)
                        {
                            //var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].GetValue<Slider>().Value;
                            //var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].GetValue<Slider>().Value;

                            var dashPos = args.StartPosition.To2D(); //real pos?

                            if (args.Target != null)
                            {
                                dashPos = args.Target.Position.To2D();
                            }

                            if (evadeSpell.fixedRange ||
                                dashPos.Distance(myHero.ServerPosition.To2D()) > evadeSpell.range)
                            {
                                var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized();
                                dashPos = myHero.ServerPosition.To2D() + dir * evadeSpell.range;
                            }

                            //Draw.RenderObjects.Add(new Draw.RenderCircle(dashPos, 1000));

                            var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed,
                                                                       ObjectCache.gamePing, 0);

                            if (posInfo.posDangerLevel > 0)
                            {
                                args.Process = false;
                                return;
                            }
                        }

                        lastPosInfo = PositionInfo.SetAllUndodgeable(); //really?

                        if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                        {
                            EvadeCommand.MoveTo(Game.CursorPos.To2D()); //block moveto
                            lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 85;
                        }
                    }
                    return;
                }
            }
        }
示例#49
0
        public EthyDarkMaster() : base()
        {
            ms_Active   = true;
            Name        = "Deimos";
            Title       = "the Dark Master";
            Hue         = 22222;
            BodyValue   = 400;
            BaseSoundID = 1001;
            Team        = 2;

            SetStr(1500);
            SetDex(250);
            SetInt(50000);

            SetHits(50000);

            SetDamage(30, 30);

            SetSkill(SkillName.Anatomy, 150.0);
            SetSkill(SkillName.EvalInt, 200.0);
            SetSkill(SkillName.Magery, 220.0);
            SetSkill(SkillName.Poisoning, 200.0);
            SetSkill(SkillName.MagicResist, 250.0);
            SetSkill(SkillName.Wrestling, 150.0);
            SetSkill(SkillName.Tactics, 150.0);
            SetSkill(SkillName.Meditation, 600.0);
            SetSkill(SkillName.DetectHidden, 200.0);

            Fame  = 50000;
            Karma = -50000;

            VirtualArmor = 200;

            WizardsHat hat = new WizardsHat();

            hat.Hue      = 1150;
            hat.LootType = LootType.Blessed;
            AddItem(hat);

            Sandals foot = new Sandals();

            foot.Hue      = 1150;
            foot.LootType = LootType.Blessed;
            AddItem(foot);

            Robe robe = new Robe();

            robe.Hue      = 22222;
            robe.LootType = LootType.Blessed;
            AddItem(robe);

            Cloak back = new Cloak();

            back.Hue      = 1150;
            back.LootType = LootType.Blessed;
            AddItem(back);

            Spellbook book = new Spellbook();

            book.Hue     = 1150;
            book.Content = 18446744073709551615;
            book.Movable = false;
            AddItem(book);

            BodySash top = new BodySash();

            top.Hue      = 1150;
            top.Layer    = Layer.Earrings;
            top.LootType = LootType.Blessed;
            AddItem(top);

            m_Timer = new AppearTimer(this);
            m_Timer.Start();
        }
示例#50
0
        public static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe)
            {
                if (getCheckBoxItem(menu, "ENABLED") && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass)))
                {
                    if (!ShineCommon.Utility.IsValidSlot(args.Slot))
                    {
                        return;
                    }

                    if (SPredictioner.Spells[(int)args.Slot] == null)
                    {
                        return;
                    }

                    if (!getCheckBoxItem(menu, String.Format("{0}{1}", ObjectManager.Player.ChampionName, args.Slot)))
                    {
                        return;
                    }

                    if (handleEvent[(int)args.Slot])
                    {
                        args.Process = false;
                        handleEvent[(int)args.Slot] = false;
                        var enemy = args.EndPosition.GetEnemiesInRange(200f).OrderByDescending(p => ShineCommon.Utility.GetPriority(p.ChampionName)).FirstOrDefault();
                        if (enemy == null)
                        {
                            enemy = TargetSelector.GetTarget(SPredictioner.Spells[(int)args.Slot].Range, DamageType.Physical);
                        }

                        if (enemy != null)
                        {
                            SebbyLib.Movement.SkillshotType CoreType2 = SebbyLib.Movement.SkillshotType.SkillshotLine;
                            bool aoe2 = false;

                            if (SPredictioner.Spells[(int)args.Slot].Type == SkillshotType.SkillshotCircle)
                            {
                                //CoreType2 = SebbyLib.Movement.SkillshotType.SkillshotCircle;
                                //aoe2 = true;
                            }

                            if (SPredictioner.Spells[(int)args.Slot].Width > 80 && !SPredictioner.Spells[(int)args.Slot].Collision)
                            {
                                aoe2 = true;
                            }

                            var predInput2 = new SebbyLib.Movement.PredictionInput
                            {
                                Aoe       = aoe2,
                                Collision = SPredictioner.Spells[(int)args.Slot].Collision,
                                Speed     = SPredictioner.Spells[(int)args.Slot].Speed,
                                Delay     = SPredictioner.Spells[(int)args.Slot].Delay,
                                Range     = SPredictioner.Spells[(int)args.Slot].Range,
                                From      = Player.ServerPosition,
                                Radius    = SPredictioner.Spells[(int)args.Slot].Width,
                                Unit      = enemy,
                                Type      = CoreType2
                            };
                            var poutput2 = SebbyLib.Movement.Prediction.GetPrediction(predInput2);

                            if (SPredictioner.Spells[(int)args.Slot].Speed != float.MaxValue && OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                            {
                                return;
                            }

                            if (getBoxItem(menu, "SPREDHITC") == 0) // Very High
                            {
                                if (poutput2.Hitchance >= SebbyLib.Movement.HitChance.VeryHigh)
                                {
                                    SPredictioner.Spells[(int)args.Slot].Cast(poutput2.CastPosition);
                                }
                                else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= SebbyLib.Movement.HitChance.High)
                                {
                                    SPredictioner.Spells[(int)args.Slot].Cast(poutput2.CastPosition);
                                }
                            }
                            else if (getBoxItem(menu, "SPREDHITC") == 1)
                            {
                                if (poutput2.Hitchance >= SebbyLib.Movement.HitChance.High)
                                {
                                    SPredictioner.Spells[(int)args.Slot].Cast(poutput2.CastPosition);
                                }
                            }
                            else if (getBoxItem(menu, "SPREDHITC") == 2)
                            {
                                if (poutput2.Hitchance >= SebbyLib.Movement.HitChance.Medium)
                                {
                                    SPredictioner.Spells[(int)args.Slot].Cast(poutput2.CastPosition);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#51
0
 private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     return;
 }
示例#52
0
 public virtual void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
 }
示例#53
0
        protected override void CompileOptions(ToolbarGump toolbar, GumpButton clicked, Point loc, MenuGumpOptions opts)
        {
            if (toolbar == null)
            {
                return;
            }

            base.CompileOptions(toolbar, clicked, loc, opts);

            var user = toolbar.State.User;

            if (CanEdit || user.AccessLevel >= Toolbars.Access)
            {
                opts.Replace(
                    "Set Value",
                    new ListGumpEntry(
                        "Set Spell",
                        b =>
                {
                    toolbar.Refresh(true);
                    MenuGump menu1 = null;
                    var menuOpts1  = new MenuGumpOptions();

                    foreach (var kvp1 in SpellUtility.TreeStructure)
                    {
                        var circle = kvp1.Key;
                        var types  = kvp1.Value;

                        menuOpts1.AppendEntry(
                            new ListGumpEntry(
                                circle,
                                b2 =>
                        {
                            var menuOpts2 = new MenuGumpOptions();

                            foreach (var kvp2 in types)
                            {
                                var id   = SpellRegistry.GetRegistryNumber(kvp2.Key);
                                var si   = kvp2.Value;
                                var book = Spellbook.Find(user, id);

                                if (book != null && book.HasSpell(id))
                                {
                                    menuOpts2.AppendEntry(
                                        new ListGumpEntry(
                                            si.Name,
                                            menu2Button =>
                                    {
                                        SpellID = id;
                                        Value   = si.Name;
                                        Label   = String.Empty;
                                        toolbar.Refresh(true);
                                    },
                                            (SpellID == id) ? toolbar.HighlightHue : toolbar.TextHue));
                                }
                            }

                            if (menu1 != null)
                            {
                                SuperGump.Send(new MenuGump(user, clicked.Parent, menuOpts2, clicked));
                            }
                        }));
                    }

                    menu1 = new MenuGump(user, clicked.Parent, menuOpts1, clicked);
                    SuperGump.Send(menu1);
                },
                        toolbar.HighlightHue));
            }
        }
        public static bool HasSpell(Mobile from, int spellID)
        {
            Spellbook book = Spellbook.Find(from, spellID);

            return(book != null && book.HasSpell(spellID));
        }
示例#55
0
 protected virtual void Volatile_OnUpdateChargeableSpell(Spellbook sender,
                                                         SpellbookUpdateChargeableSpellEventArgs args)
 {
     //for extensions
 }
示例#56
0
        public static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe)
            {
                if (LSPredictioner.Config.Item("ENABLED").GetValue <bool>() && (LSPredictioner.Config.Item("COMBOKEY").GetValue <KeyBind>().Active || LSPredictioner.Config.Item("HARASSKEY").GetValue <KeyBind>().Active))
                {
                    if (!Utility.IsValidSlot(args.Slot))
                    {
                        return;
                    }

                    if (LSPredictioner.Spells[(int)args.Slot] == null)
                    {
                        return;
                    }

                    if (!LSPredictioner.Config.Item(String.Format("{0}{1}", ObjectManager.Player.ChampionName, args.Slot)).GetValue <bool>())
                    {
                        return;
                    }

                    if (handleEvent[(int)args.Slot])
                    {
                        args.Process = false;

                        var enemy = TargetSelector.GetTarget(LSPredictioner.Spells[(int)args.Slot].Range, TargetSelector.DamageType.Physical);

                        var QWER = LSPredictioner.Spells[(int)args.Slot];

                        if (enemy != null)
                        {
                            var predInput2 = new PortAIO.PredictionInput
                            {
                                Collision = QWER.Collision,
                                Speed     = QWER.Speed,
                                Delay     = QWER.Delay,
                                Range     = QWER.Range,
                                From      = Player.ServerPosition,
                                Radius    = QWER.Width,
                                Unit      = enemy,
                            };

                            var poutput2 = PortAIO.Prediction.GetPrediction(predInput2);

                            if (ShineCommon.Utility.HitchanceArray[LSPredictioner.Config.Item("SPREDHITC").GetValue <StringList>().SelectedIndex] == HitChance.VeryHigh)
                            {
                                if (poutput2.Hitchance >= PortAIO.HitChance.VeryHigh)
                                {
                                    if (QWER.Cast(poutput2.CastPosition))
                                    {
                                        handleEvent[(int)args.Slot] = false;
                                    }
                                }
                            }
                            else if (ShineCommon.Utility.HitchanceArray[LSPredictioner.Config.Item("SPREDHITC").GetValue <StringList>().SelectedIndex] == HitChance.High)
                            {
                                if (poutput2.Hitchance >= PortAIO.HitChance.High)
                                {
                                    if (QWER.Cast(poutput2.CastPosition))
                                    {
                                        handleEvent[(int)args.Slot] = false;
                                    }
                                }
                            }
                            else if (ShineCommon.Utility.HitchanceArray[LSPredictioner.Config.Item("SPREDHITC").GetValue <StringList>().SelectedIndex] == HitChance.Medium)
                            {
                                if (poutput2.Hitchance >= PortAIO.HitChance.Medium)
                                {
                                    if (QWER.Cast(poutput2.CastPosition))
                                    {
                                        handleEvent[(int)args.Slot] = false;
                                    }
                                }
                            }
                            else if (ShineCommon.Utility.HitchanceArray[LSPredictioner.Config.Item("SPREDHITC").GetValue <StringList>().SelectedIndex] == HitChance.Low)
                            {
                                if (poutput2.Hitchance >= PortAIO.HitChance.Low)
                                {
                                    if (QWER.Cast(poutput2.CastPosition))
                                    {
                                        handleEvent[(int)args.Slot] = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
示例#57
0
        public DummyStun()
            : base(AIType.AI_Mage, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Stun Mage
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(90, 90, 125);
            Skills[SkillName.Magery].Base     = 100;
            Skills[SkillName.EvalInt].Base    = 120;
            Skills[SkillName.Anatomy].Base    = 80;
            Skills[SkillName.Wrestling].Base  = 80;
            Skills[SkillName.Meditation].Base = 100;
            Skills[SkillName.Poisoning].Base  = 100;

            // Name
            Name = "Stun Mage";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ItemQuality.Normal;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ItemQuality.Normal;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ItemQuality.Normal;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ItemQuality.Normal;
            AddItem(lel);

            Boots bts = new Boots();

            bts.Hue = iHue;
            AddItem(bts);

            Cap cap = new Cap();

            cap.Hue = iHue;
            AddItem(cap);

            // Spells
            AddSpellAttack(typeof(Spells.First.MagicArrowSpell));
            AddSpellAttack(typeof(Spells.First.WeakenSpell));
            AddSpellAttack(typeof(Spells.Third.FireballSpell));
            AddSpellDefense(typeof(Spells.Third.WallOfStoneSpell));
            AddSpellDefense(typeof(Spells.First.HealSpell));
        }
示例#58
0
        public DummySuper()
            : base(AIType.AI_Mage, FightMode.Closest, 15, 1, 0.2, 0.6)
        {
            // A Dummy Super Mage
            int iHue = 20 + Team * 40;
            int jHue = 25 + Team * 40;

            // Skills and Stats
            InitStats(125, 125, 125);
            Skills[SkillName.Magery].Base     = 120;
            Skills[SkillName.EvalInt].Base    = 120;
            Skills[SkillName.Anatomy].Base    = 120;
            Skills[SkillName.Wrestling].Base  = 120;
            Skills[SkillName.Meditation].Base = 120;
            Skills[SkillName.Poisoning].Base  = 100;
            Skills[SkillName.Inscribe].Base   = 100;

            // Name
            Name = "Super Mage";

            // Equip
            Spellbook book = new Spellbook();

            book.Movable  = false;
            book.LootType = LootType.Newbied;
            book.Content  = 0xFFFFFFFFFFFFFFFF;
            AddItem(book);

            LeatherArms lea = new LeatherArms();

            lea.Movable  = false;
            lea.LootType = LootType.Newbied;
            lea.Crafter  = this;
            lea.Quality  = ItemQuality.Normal;
            AddItem(lea);

            LeatherChest lec = new LeatherChest();

            lec.Movable  = false;
            lec.LootType = LootType.Newbied;
            lec.Crafter  = this;
            lec.Quality  = ItemQuality.Normal;
            AddItem(lec);

            LeatherGorget leg = new LeatherGorget();

            leg.Movable  = false;
            leg.LootType = LootType.Newbied;
            leg.Crafter  = this;
            leg.Quality  = ItemQuality.Normal;
            AddItem(leg);

            LeatherLegs lel = new LeatherLegs();

            lel.Movable  = false;
            lel.LootType = LootType.Newbied;
            lel.Crafter  = this;
            lel.Quality  = ItemQuality.Normal;
            AddItem(lel);

            Sandals snd = new Sandals();

            snd.Hue      = iHue;
            snd.LootType = LootType.Newbied;
            AddItem(snd);

            JesterHat jhat = new JesterHat();

            jhat.Hue = iHue;
            AddItem(jhat);

            Doublet dblt = new Doublet();

            dblt.Hue = iHue;
            AddItem(dblt);

            // Spells
            AddSpellAttack(typeof(Spells.First.MagicArrowSpell));
            AddSpellAttack(typeof(Spells.First.WeakenSpell));
            AddSpellAttack(typeof(Spells.Third.FireballSpell));
            AddSpellDefense(typeof(Spells.Third.WallOfStoneSpell));
            AddSpellDefense(typeof(Spells.First.HealSpell));
        }
示例#59
0
        private void OnSpellbookCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            try
            {
                if (!sender.Owner.IsMe || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
                {
                    return;
                }

                var flash = _menu.Item(_menu.Name + ".spells.flash").GetValue <Slider>().Value;
                if (flash > 0 && Utils.GameTimeTickCount - _lastFlashCast <= flash * 1000)
                {
                    return;
                }

                var isSpell = _spells.Any(s => s.Equals(args.Slot) && IsSpellEnabled(s));
                var isItem  = _items.Any(s => s.Equals(args.Slot));
                if (!isSpell && !isItem)
                {
                    return;
                }

                if (!_randomizedSpells.ContainsKey(args.Slot))
                {
                    _randomizedSpells[args.Slot] = false;
                }
                if (_randomizedSpells[args.Slot])
                {
                    _randomizedSpells[args.Slot] = false;
                    return;
                }

                var spell = ObjectManager.Player.Spellbook.GetSpell(args.Slot);
                if (spell == null)
                {
                    return;
                }

                var position = args.Target != null
                    ? args.Target.Position
                    : (args.StartPosition.IsValid()
                        ? args.StartPosition
                        : (args.EndPosition.IsValid() ? args.EndPosition : ObjectManager.Player.Position));

                #region Screen

                if (_menu.Item(_menu.Name + ".spells.screen").GetValue <bool>() && position.IsValid() &&
                    !position.IsOnScreen())
                {
                    args.Process = false;
                    _blockedOrders++;
                    return;
                }

                #endregion Screen

                #region Checks

                if (_menu.Item(_menu.Name + ".spells.checks1").GetValue <bool>())
                {
                    if (MenuGUI.IsShopOpen || MenuGUI.IsChatOpen)
                    {
                        args.Process = false;
                        _blockedSpells++;
                        return;
                    }
                }

                if (isSpell && _menu.Item(_menu.Name + ".spells.checks2").GetValue <bool>())
                {
                    if (Utils.GameTimeTickCount - _lastSpellCast >=
                        _random.Next((int)(1000f * 0.975f), (int)(1000f * 1.025f)))
                    {
                        _isCasting = false;
                    }
                    if (_isCasting || ObjectManager.Player.Spellbook.IsCastingSpell)
                    {
                        args.Process = false;
                        _blockedSpells++;
                        return;
                    }
                }

                #endregion Checks

                #region Delay

                var defaultDelay = _menu.Item(_menu.Name + ".spells.delay").GetValue <Slider>().Value;
                var delay        = Math.Max(
                    _random.Next((int)(defaultDelay * 0.85f), (int)(defaultDelay * 1.15f)),
                    _random.Next((int)(Game.Ping * 0.45f), (int)(Game.Ping * 0.55f)));
                var type = spell.SData.TargettingType.ToString();
                if (_targetTypes.Any(t => type.Contains(t)))
                {
                    var percent = _menu.Item(_menu.Name + ".spells.range-delay").GetValue <Slider>().Value;
                    if (percent > 0)
                    {
                        delay = Math.Max(delay, GetRangeDelay(position, _lastCastPosition, percent));
                    }
                }

                if (Utils.GameTimeTickCount - (isSpell ? _lastSpellCast : _lastItemCast) <= delay)
                {
                    args.Process = false;
                    _blockedSpells++;
                    return;
                }

                #endregion Delay

                _lastCastPosition = position.IsValid() && _targetTypes.Any(t => type.Contains(t))
                    ? position
                    : Vector3.Zero;

                #region Randomize

                var randomPosition = _menu.Item(_menu.Name + ".spells.position").GetValue <Slider>().Value;
                if (randomPosition > 0 && args.Target == null && (type.Contains("Cone") || type.Contains("Location")) &&
                    !_randomizedSpells[args.Slot])
                {
                    var startPos = Vector3.Zero;
                    var endPos   = Vector3.Zero;

                    if (args.StartPosition.IsValid())
                    {
                        startPos = _random.Randomize(args.StartPosition, randomPosition);
                    }
                    if (args.EndPosition.IsValid())
                    {
                        endPos = _random.Randomize(args.EndPosition, randomPosition);
                    }
                    if (startPos.IsValid() || endPos.IsValid())
                    {
                        args.Process = false;
                        _randomizedSpells[args.Slot] = true;
                        if (startPos.IsValid() && endPos.IsValid())
                        {
                            ObjectManager.Player.Spellbook.CastSpell(args.Slot, startPos, endPos);
                        }
                        else if (startPos.IsValid())
                        {
                            ObjectManager.Player.Spellbook.CastSpell(args.Slot, startPos);
                        }
                        else if (endPos.IsValid())
                        {
                            ObjectManager.Player.Spellbook.CastSpell(args.Slot, endPos);
                        }
                    }
                }

                #endregion Randomize

                _isCasting = true;
                if (isSpell)
                {
                    _lastSpellCast = Utils.GameTimeTickCount;
                }
                else
                {
                    _lastItemCast = Utils.GameTimeTickCount;
                }
            }
            catch (Exception ex)
            {
                args.Process = true;
                Console.WriteLine(ex);
            }
        }
示例#60
0
 private void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
 {
     OnSpellCast(sender, args);
 }