Example #1
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "xeratharcanopulse2")
     {
         //SpellDetector.OnProcessSpecialSpell += ProcessSpell_XerathArcanopulse2;
     }
 }
Example #2
0
        private static void ProcessSpell_SionE(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "SionE")
            {
                var objList = new List<Obj_AI_Minion>();
                foreach (var obj in ObjectManager.Get<Obj_AI_Minion>())
                {
                    if (obj != null && obj.IsValid && !obj.IsDead && obj.IsAlly)
                    {
                        objList.Add(obj);
                    }
                }

                objList.OrderBy(o => o.Distance(hero.ServerPosition));

                var spellStart = args.Start.To2D();
                var dir = (args.End.To2D() - spellStart).Normalized();
                var spellEnd = spellStart + dir * spellData.Range;

                foreach (var obj in objList)
                {
                    var objProjection = obj.ServerPosition.To2D().ProjectOn(spellStart, spellEnd);

                    if (objProjection.IsOnSegment && objProjection.SegmentPoint.Distance(obj.ServerPosition.To2D()) < obj.BoundingRadius + spellData.Radius)
                    {
                        //sth happens
                    }
                }

                //specialSpellArgs.noProcess = true;
            }
        }
Example #3
0
        private static void DamagePrediction_OnTargettedSpellWillKill(
            Obj_AI_Hero sender,
            Obj_AI_Hero target,
            SpellData sData)
        {
            var targetName = target.ChampionName;
            if (sender.IsAlly || Entry.Player.IsDead)
            {
                return;
            }

            /* if (targetName != Entry.Player.ChampionName && InitializeMenu.Menu.Item("Heal." + Entry.Player.ChampionName.ToLowerInvariant() + ".noult." + targetName).GetValue<bool>())
            {
                return;
            }*/

            if (InitializeMenu.Menu.Item("Heal.Activated").GetValue<bool>()
                && InitializeMenu.Menu.Item("Heal.Predicted").GetValue<bool>())
            {
                if (!Entry.Player.InFountain() || !Entry.Player.IsRecalling())
                {
                    Console.WriteLine("HEAL");
                    Entry.Player.Spellbook.CastSpell(summonerHeal);
                }
            }
        }
Example #4
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.SpellName == "ViktorDeathRay3")
     {
         GameObject.OnCreate += OnCreateObj_ViktorDeathRay3;
     }
 }
Example #5
0
        private static void OnCreateObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            if (!obj.IsValid<MissileClient>())
                return;

            MissileClient missile = (MissileClient)obj;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name == "FizzMarinerDoomMissile")
            {
                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
                spellData, null, 500, true, SpellType.Circular, false, spellData.secondaryRadius);

                /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                {
                    var spell = entry.Value;

                    if (spell.info.spellName == "FizzMarinerDoom" &&
                        spell.spellObject != null && spell.spellObject.NetworkId == missile.NetworkId)
                    {
                        if (spell.spellType == SpellType.Circular)
                        {                            
                            spell.spellObject = null;
                        }
                    }
                }*/
            }
        }
Example #6
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "ZiggsQ")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_ZiggsQ;
     }
 }
Example #7
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "AlZaharCalloftheVoid")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_AlZaharCalloftheVoid;
     }
 }
Example #8
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.SpellName == "LucianQ")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_LucianQ;
     }
 }
Example #9
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "TaricE")
     {
         SpellDetector.OnProcessSpecialSpell += SpellDetector_OnProcessSpecialSpell;
     }
 }
Example #10
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "JarvanIVDragonStrike")
            {
                if (SpellDetector.onProcessSpells.TryGetValue("JarvanIVDragonStrike2", out spellData))
                {
                    foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.obj.Name == "Beacon")
                        {
                            if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                            {
                                DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(info.obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.usePosition ? info.position.LSTo2D() : info.obj.Position.LSTo2D();

                            if (args.End.LSTo2D().LSDistance(objPosition) < 300)
                            {
                                var dir = (objPosition - args.Start.LSTo2D()).LSNormalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.noProcess = true;
                                return;
                            }
                        }
                    }

                }
            }
        }
Example #11
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "TaricE")
            {
                var sdata = new SpellData();
                sdata.charName = "Taric";
                sdata.name = "TaricE2";
                sdata.spellName = "TaricE";
                sdata.range = 750;
                sdata.radius = 100;
                sdata.fixedRange = true;
                sdata.spellDelay = 1000;
                sdata.projectileSpeed = int.MaxValue;
                sdata.dangerlevel = 3;

                var partner = HeroManager.Enemies.FirstOrDefault(x => x.HasBuff("taricwleashactive"));
                if (partner != null && partner.ChampionName != "Taric")
                {
                    var start = partner.ServerPosition.LSTo2D();
                    var direction = (args.End.LSTo2D() - start).LSNormalized();
                    var end = start + direction * spellData.range;

                    SpellDetector.CreateSpellData(partner, start.To3D(), end.To3D(), sdata);
                }
            }
        }
Example #12
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "ViktorDeathRay3")
     {
         Obj_AI_Minion.OnCreate += OnCreateObj_ViktorDeathRay3;
     }
 }
Example #13
0
        private static void ProcessSpell_ZedShuriken(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "ZedQ")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.ObjTracker)
                {
                    var info = entry.Value;

                    if (info.Obj.Name == "Shadow" || info.Name == "Shadow")
                    {
                        if (info.UsePosition == false && (info.Obj == null || !info.Obj.IsValid || info.Obj.IsDead))
                        {
                            DelayAction.Add(1, () => ObjectTracker.ObjTracker.Remove(info.Obj.NetworkId));
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2;
                            if (info.UsePosition == false)
                            {
                                endPos2 = info.Obj.Position.Extend(args.End, spellData.Range).To3DWorld();
                                SpellDetector.CreateSpellData(hero, info.Obj.Position, endPos2, spellData, null, 0, false);
                            }
                            else
                            {
                                endPos2 = info.Position.Extend(args.End, spellData.Range).To3DWorld();
                                SpellDetector.CreateSpellData(hero, info.Position, endPos2, spellData, null, 0, false);
                            }

                        }
                    }
                }
            }
        }
Example #14
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "Volley")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_AsheVolley;
     }
 }
Example #15
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     /*if (spellData.spellName == "SionE")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_SionE;
     }*/
 }
Example #16
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "TwitchSprayandPrayAttack")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_TwitchSprayandPrayAttack;
     }
 }
Example #17
0
 private void ProcessSpell_TwitchSprayandPrayAttack(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "TwitchSprayandPrayAttack")
     {
         spellData.spellDelay = hero.AttackCastDelay * 1000;
     }
 }
Example #18
0
 private static bool dangerousSpell(SpellData spellData, AIHeroClient sender)
 {
     var slot = sender.GetSpellSlotFromName(spellData.Name);
     var enemies = EntityManager.Heroes.Enemies;
     int j2 = 0;
     for (int j = 0; j < enemies.Count(); j++)
     {
         if (sender.NetworkId == enemies[j].NetworkId)
         {
             j2 = j;
             break;
         }
     }
     int i = 0;
     switch (slot)
     {
         case SpellSlot.Q:
             i = 0;
             break;
         case SpellSlot.W:
             i = 1;
             break;
         case SpellSlot.E:
             i = 2;
             break;
         case SpellSlot.R:
             i = 3;
             break;
     }
     if (Settings._skills[j2 * 4 + i].CurrentValue)
         return true;
     return false;
 }
Example #19
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.SpellName == "EkkoR")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_EkkoR;
     }
 }
Example #20
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.isThreeWay && !pDict.ContainsKey("ProcessSpell_ProcessThreeWay"))
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_ThreeWay;
         pDict["ProcessSpell_ProcessThreeWay"] = true;
     }
 }
Example #21
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.SpellName == "LuluQ")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_LuluQ;
         GetLuluPix();
     }
 }
Example #22
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "OrianaIzunaCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                                return;

                            SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 0);
                        }

                        info.position = args.End;
                        info.usePosition = true;
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "OrianaDetonateCommand" || spellData.spellName == "OrianaDissonanceCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            Vector3 endPos2 = info.position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                                return;

                            Vector3 endPos2 = info.obj.Position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Example #23
0
        private static void ProcessSpell_HeimerdingerTurretEnergyBlast(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "HeimerdingerTurretEnergyBlast" || spellData.spellName == "HeimerdingerTurretBigEnergyBlast")
            {
                SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData);

                specialSpellArgs.noProcess = true;
            }
        }
Example #24
0
        private void ProcessSpell_HeimerdingerW(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "HeimerdingerW")
            {
                //SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData);

                specialSpellArgs.noProcess = true;
            }
        }
Example #25
0
 internal static double HealAmount(SpellData spell)
 {
     var me = Core.Player.Stats;
     var Me = Core.Player;
     var weaponDamage = InventoryManager.EquippedItems.Where(x => x.Slot == (ushort)EquipmentSlot.MainHand).Select(z => z.Item).First().Attributes[ItemAttribute.Magic_Damage];
     var spellPotency = Spells[spell.Id];
     var multiplier = Me.ClassLevel < 20 ? 1 : Me.ClassLevel < 40 ? 1.1 : 1.3;
     return ((spellPotency / 300D) * ((weaponDamage) * (0.0114 * me.Mind + 0.00145 * me.Determination + 0.3736) + (0.156 * me.Mind) + (0.11 * me.Determination) + (0.00018316 * me.Mind * me.Determination)));
 }
Example #26
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "ZedShuriken")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_ZedShuriken;
         MissileClient.OnCreate += SpellMissile_ZedShadowDash;
         Obj_AI_Minion.OnCreate += OnCreateObj_ZedShuriken;
         Obj_AI_Minion.OnDelete += OnDeleteObj_ZedShuriken;
     }
 }
Example #27
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.SpellName == "ZedQ")
     {
         SpellDetector.OnProcessSpecialSpell += ProcessSpell_ZedShuriken;
         GameObject.OnCreate += SpellMissile_ZedShadowDash;
         GameObject.OnCreate += OnCreateObj_ZedShuriken;
         GameObject.OnDelete += OnDeleteObj_ZedShuriken;
     }
 }
Example #28
0
 public void Add(string s, SpellData data)
 {
     if (_damageItems.ContainsKey(s))
     {
         Logger.Log(LogLevel.Error,
             "Damage Indicator: Cannot Add '{0}', already added. Please Use Update to change the values.", s);
         return;
     }
     _damageItems.Add(s, data);
 }
Example #29
0
 private void DamagePrediction_OnSpellWillKill(Obj_AI_Hero sender, Obj_AI_Hero target, SpellData sData)
 {
     if (target.IsMe && sender.IsEnemy)
     {
         if (ShouldRun() && MenuExtensions.GetItemValue<bool>("dz191.vhr.activator.spells.heal.ls"))
         {
             CastSpell();
         }
     }
 }
Example #30
0
 public void LoadSpecialSpell(SpellData spellData)
 {
     if (spellData.spellName == "LuxMaliceCannon")
     {
         var hero = HeroManager.Enemies.FirstOrDefault(h => h.ChampionName == "Lux");
         if (hero != null)
         {
             GameObject.OnCreate += (obj, args) => OnCreateObj_LuxMaliceCannon(obj, args, hero, spellData);
         }
     }
 }
Example #31
0
        private static void ProcessSpell_ZedShuriken(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                                     SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "ZedShuriken")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (info.obj.Name == "Shadow" || info.Name == "Shadow")
                    {
                        if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                        {
                            DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(info.obj.NetworkId));
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2;
                            if (info.usePosition == false)
                            {
                                endPos2 = info.obj.Position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.obj.Position, endPos2, spellData, null, 0, false);
                            }
                            else
                            {
                                endPos2 = info.position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.position, endPos2, spellData, null, 0, false);
                            }
                        }
                    }
                }
            }
        }
Example #32
0
 public override void Initialize(SpellData data, Transform caster)
 {
     _data = (PointTargetSpellData)data;
 }
Example #33
0
            public DamageMaker(Obj_AI_Base sourceIn, Obj_AI_Base targetIn, GameObject missleIn, SpellData dataIn, bool meleeIn = false)
            {
                source      = sourceIn;
                target      = targetIn;
                missle      = missleIn;
                sData       = dataIn;
                melee       = !meleeIn;
                createdTick = now;
                isAutoAtack = sData.IsAutoAttack();

                if (isAutoAtack)
                {
                    dealDamage = (float)source.GetAutoAttackDamage(target, true);
                    if (source.IsMelee)
                    {
                        cycle = (int)(source.AttackDelay * 1000);
                    }
                    else
                    {
                        //var dist = source.Distance(target);
                        cycle = (int)((source.AttackDelay * 1000)) /*+ (dist*1000)/sData.MissileSpeed)*/;
                        //Console.WriteLine("cycle: " + cycle);
                    }
                    //Console.WriteLine("cycle: " + source.AttackSpeedMod);
                }
                else
                {
                    cycle = 0;
                    if (source is AIHeroClient)
                    {
                        var tSpell = TargetSpellDatabase.GetByName(sData.Name);
                        if (tSpell == null)
                        {
                            //Console.WriteLine("Unknown targeted spell: " + sData.Name);
                            dealDamage = 0;
                        }
                        else
                        {
                            try
                            {
                                dealDamage = (float)((AIHeroClient)source).GetSpellDamage(target, tSpell.Spellslot);
                            }
                            catch (Exception)
                            {
                                dealDamage = 0;
                            }
                        }
                    }
                    else
                    {
                        dealDamage = 0;
                    }
                }
            }
Example #34
0
        private static void OnCreateObj_jayceshockblast(GameObject obj, EventArgs args, Obj_AI_Hero hero,
                                                        SpellData spellData)
        {
            if (obj.Type == GameObjectType.obj_GeneralParticleEmitter &&
                obj.Name.Contains("Jayce") &&
                obj.Name.Contains("accel_gate_end") &&
                obj.Name.Contains("RED"))
            {
                foreach (var tracker in ObjectTracker.objTracker)
                {
                    var gateObj = tracker.Value;

                    if (gateObj.Name == "AccelGate")
                    {
                        DelayAction.Add(0, () => ObjectTracker.objTracker.Remove(tracker.Key));
                    }
                }
            }

            if (obj.Type == GameObjectType.obj_GeneralParticleEmitter &&
                obj.Name.Contains("Jayce") &&
                obj.Name.Contains("accel_gate_start") &&
                obj.Name.Contains("RED"))
            {
                //var particle = obj as Obj_GeneralParticleEmitter;

                /*var dir = obj.Orientation.To2D();
                 * var pos1 = obj.Position.To2D() - dir * 470;
                 * var pos2 = obj.Position.To2D() + dir * 470;
                 *
                 * //Draw.RenderObjects.Add(new Draw.RenderLine(pos1, pos2, 3500));
                 * Draw.RenderObjects.Add(new Draw.RenderCircle(pos1, 3500));*/

                var gateTracker = new ObjectTrackerInfo(obj, "AccelGate");
                //gateTracker.Orientation = dir.To3D();

                ObjectTracker.objTracker.Add(obj.NetworkId, gateTracker);

                foreach (var entry in SpellDetector.spells) //check currently moving skillshot
                {
                    var spell = entry.Value;

                    if (spell.info.spellName == "JayceShockBlast")
                    {
                        var tHero = spell.heroID;

                        Vector2 int1, int2;
                        var     intersection =
                            MathUtils.FindLineCircleIntersections(obj.Position.To2D(), 470, spell.startPos,
                                                                  spell.endPos,
                                                                  out int1, out int2);
                        var projection = obj.Position.To2D().ProjectOn(spell.startPos, spell.endPos);

                        //var intersection = spell.startPos.Intersection(spell.endPos, pos1, pos2);
                        //var projection = intersection.Point.ProjectOn(spell.startPos, spell.endPos);

                        //if (intersection.Intersects && projection.IsOnSegment)
                        if (intersection > 0 && projection.IsOnSegment)
                        {
                            SpellDetector.CreateSpellData(hero, projection.SegmentPoint.To3D(), spell.endPos.To3D(),
                                                          spellData, spell.spellObject);

                            DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key));
                            break;
                        }
                    }
                }

                //SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0);
            }
        }
Example #35
0
 /// <summary>
 /// Adds a <see cref="SpellData"/>.
 /// </summary>
 public void AddSpellData(short spellId, SpellData spellData)
 {
     this.spellCache.Add(spellId, spellData);
 }
Example #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpellShopItem"/> class.
 /// </summary>
 public SpellShopItem(int ShopIndex, int Cost, ResourceData BuyResourceData, SpellData SpellData, int Amount, int RarityIndex) : base(ShopIndex, Cost, BuyResourceData)
 {
     this.Amount      = Amount;
     this.RarityIndex = RarityIndex;
     this.SpellData   = SpellData;
 }
Example #37
0
        private static void ProcessSpell_XerathArcanopulse2(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "XerathArcanopulseChargeUp")// || spellData.spellName == "xeratharcanopulse2")
            {
                var castTime = -1 * (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0)
                {
                    var dir    = (args.End.To2D() - args.Start.To2D()).Normalized();
                    var endPos = args.Start.To2D() + dir * Math.Min(spellData.range, 750 + castTime / 2);
                    SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData);
                }

                specialSpellArgs.noProcess = true;
            }
        }
 public void Cast(SpellData spell, Tile target, CastFinishedDelegate finishedCallback = null)
 {
     spellBox.Cast(spell, target, finishedCallback);
 }
Example #39
0
        private static void ProcessSpell_AlZaharCalloftheVoid(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                                              SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "MalzaharQ")
            {
                var direction   = (args.End.To2D() - args.Start.To2D()).Normalized();
                var pDirection  = direction.Perpendicular();
                var targetPoint = args.End.To2D();

                var pos1 = targetPoint - pDirection * spellData.sideRadius;
                var pos2 = targetPoint + pDirection * spellData.sideRadius;

                SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0, false);
                SpellDetector.CreateSpellData(hero, pos2.To3D(), pos1.To3D(), spellData, null, 0);

                specialSpellArgs.noProcess = true;
            }
        }
Example #40
0
 /// <summary>
 /// Tries to retrieve a <see cref="SpellData"/>.
 /// </summary>
 public bool TryGetSpellData(short spellId, out SpellData spellData)
 {
     return(this.spellCache.TryGetValue(spellId, out spellData));
 }
Example #41
0
        private static void OnCreateObj_LuxMaliceCannon(GameObject obj, EventArgs args, AIHeroClient hero, SpellData spellData)
        {
            if (obj.IsEnemy && !hero.IsVisible &&
                obj.Name.Contains("Lux") && obj.Name.Contains("R_mis_beam_middle"))
            {
                var objList = ObjectTracker.objTracker.Values.Where(o => o.Name == "hiu");
                if (objList.Count() > 3)
                {
                    var dir  = ObjectTracker.GetLastHiuOrientation();
                    var pos1 = obj.Position.To2D() - dir * 1750;
                    var pos2 = obj.Position.To2D() + dir * 1750;

                    SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0);

                    foreach (ObjectTrackerInfo gameObj in objList)
                    {
                        DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(gameObj.obj.NetworkId));
                    }
                }
            }
        }
Example #42
0
        private static void OnDeleteObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            //need to track where bait is attached to

            if (!obj.IsValid <MissileClient>())
            {
                return;
            }

            MissileClient missile = (MissileClient)obj;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name == "FizzMarinerDoomMissile")
            {
                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
                                              spellData, null, 1000, true, SpellType.Circular, false, 350);
            }
        }
Example #43
0
        private static void ProcessSpell_FizzPiercingStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "FizzPiercingStrike")
            {
                if (args.Target != null && args.Target.IsMe)
                {
                    SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData, null, 0);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Example #44
0
File: Syndra.cs Project: hama1/Port
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName.ToLower() == "syndrae")
            {
                var estart = args.Start;
                var eend   = args.Start + (args.End - args.Start).Normalized() * 700;

                foreach (var sphere in _spheres.Where(s => s.IsValid && !s.IsDead))
                {
                    // check if e whill hit the sphere
                    var proj = sphere.Position.To2D().ProjectOn(estart.To2D(), eend.To2D());
                    if (proj.IsOnSegment && sphere.Position.To2D().Distance(proj.SegmentPoint) <= sphere.BoundingRadius + 155)
                    {
                        var start = sphere.Position;
                        var end   = hero.ServerPosition + (sphere.Position - hero.ServerPosition).Normalized() * spellData.range;
                        var data  = spellData.CopyData();
                        data.spellDelay = sphere.Distance(hero.ServerPosition) / spellData.projectileSpeed * 1000;
                        SpellDetector.CreateSpellData(hero, start, end, data, sphere);
                    }
                }

                foreach (var entry in _qSpots)
                {
                    var spherePosition = entry.Value;

                    // check if e whill hit the sphere
                    var proj = spherePosition.To2D().ProjectOn(estart.To2D(), eend.To2D());
                    if (proj.IsOnSegment && spherePosition.To2D().Distance(proj.SegmentPoint) <= 155)
                    {
                        var start = spherePosition;
                        var end   = hero.ServerPosition + (spherePosition - hero.ServerPosition).Normalized() * spellData.range;
                        var data  = spellData.CopyData();
                        data.spellDelay = spherePosition.Distance(hero.ServerPosition) / spellData.projectileSpeed * 1000;
                        SpellDetector.CreateSpellData(hero, start, end, data, null);
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName.ToLower() == "syndraq")
            {
                var end = args.End;
                if (args.Start.Distance(end) > spellData.range)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * spellData.range;
                }

                _qSpots.Add(Game.Time, end);
            }

            if (spellData.spellName.ToLower() == "syndrawcast")
            {
                var end = args.End;
                if (args.Start.Distance(end) > spellData.range)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * spellData.range;
                }

                _qSpots.Add(Game.Time, end);
            }
        }
Example #45
0
 public static bool IsAutoAttack(this SpellData spellData)
 {
     return(Orbwalking.IsAutoAttack(spellData.Name));
 }
Example #46
0
        private static void ProcessSpell_LuluQ(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                               SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "LuluQ")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "RobotBuddy")
                    {
                        if (info.obj == null || !info.obj.IsValid || info.obj.IsDead || info.obj.IsVisible)
                        {
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2 = info.obj.Position.Extend(args.End, spellData.range).To3DWorld();
                            SpellDetector.CreateSpellData(hero, info.obj.Position, endPos2, spellData, null, 0, false);
                        }
                    }
                }
            }
        }
Example #47
0
        private async Task <bool> HandleCordial()
        {
            if (CordialType == CordialType.None)
            {
                // Not using cordials, skip method.
                return(false);
            }

            if (FishingManager.State >= FishingState.Bite)
            {
                // Need to wait till we are in the correct state
                return(false);
            }

            CordialSpellData = CordialSpellData ?? Cordial.GetSpellData();

            if (CordialSpellData == null)
            {
                CordialType = CordialType.None;
                return(false);
            }

            if (!CanUseCordial(8))
            {
                // has a buff or cordial cooldown not ready or we have no cordials.
                return(false);
            }

            var missingGp = ExProfileBehavior.Me.MaxGP - ExProfileBehavior.Me.CurrentGP;

            if (missingGp < 300 && !ForceCordial)
            {
                // Not forcing cordial and less than 300gp missing from max.
                return(false);
            }

            await Coroutine.Wait(10000, () => CanDoAbility(Abilities.Quit));

            DoAbility(Abilities.Quit);
            isSitting = false;

            await Coroutine.Wait(5000, () => FishingManager.State == FishingState.None);

            if (missingGp >= 380 && (CordialType == CordialType.HiCordial || CordialType == CordialType.Auto))
            {
                if (await UseCordial(CordialType.HiCordial))
                {
                    return(true);
                }
            }

            if (missingGp >= 280 && (CordialType == CordialType.Cordial || CordialType == CordialType.Auto))
            {
                if (await UseCordial(CordialType.Cordial))
                {
                    return(true);
                }
            }

            if (await UseCordial(CordialType.WateredCordial))
            {
                return(true);
            }

            return(false);
        }
Example #48
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                                            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "OrianaIzunaCommand")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 0, false);
                            SpellDetector.CreateSpellData(hero, info.position, args.End,
                                                          spellData, null, 150, true, SpellType.Circular, false, false, spellData.secondaryRadius);
                        }
                        else
                        {
                            if (info.obj == null || !info.obj.IsValid || info.obj.IsDead)
                            {
                                return;
                            }

                            SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 0, false);
                            SpellDetector.CreateSpellData(hero, info.obj.Position, args.End,
                                                          spellData, null, 150, true, SpellType.Circular, false, false, spellData.secondaryRadius);
                        }

                        info.position    = args.End;
                        info.usePosition = true;
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "OrianaDetonateCommand" || spellData.spellName == "OrianaDissonanceCommand")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            Vector3 endPos2 = info.position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null || !info.obj.IsValid || info.obj.IsDead)
                            {
                                return;
                            }

                            Vector3 endPos2 = info.obj.Position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Example #49
0
        protected override void OnStart()
        {
            BaitDelay = BaitDelay.Clamp(0, 5000);

            Item baitItem = null;

            if (BaitId > 0)
            {
                baitItem = DataManager.ItemCache[BaitId];
            }
            else if (!string.IsNullOrWhiteSpace(Bait))
            {
                baitItem =
                    DataManager.ItemCache.Values.Find(
                        i =>
                        string.Equals(i.EnglishName, Bait, StringComparison.InvariantCultureIgnoreCase) ||
                        string.Equals(i.CurrentLocaleName, Bait, StringComparison.InvariantCultureIgnoreCase));

                if (baitItem == null)
                {
                    isDone = true;
                    Logger.Error(Localization.Localization.ExFish_CannotFindBait + Bait);
                    return;
                }
            }

            if (baitItem != null)
            {
                if (Baits == null)
                {
                    Baits = new List <Bait>();
                }

                Baits.Insert(0, new Bait {
                    Id = baitItem.Id, Name = baitItem.EnglishName, BaitItem = baitItem, Condition = "True"
                });
            }

            if (baitItem != null && baitItem.Affinity != 19)
            {
                isDone = true;
                Logger.Error(Localization.Localization.ExFish_IsNotBait, baitItem.EnglishName);
                return;
            }

            if (Keepers == null)
            {
                Keepers = new List <Keeper>();
            }

            if (Collect && Collectables == null)
            {
                Collectables = new List <Collectable> {
                    new Collectable {
                        Name = string.Empty, Value = (int)CollectabilityValue
                    }
                };
            }

            GamelogManager.MessageRecevied += ReceiveMessage;
            FishSpots.IsCyclic              = true;
            isFishing           = false;
            isSitting           = false;
            initialMountSetting = CharacterSettings.Instance.UseMount;
            ShuffleFishSpots();

            sitRoll = SitRng.NextDouble();

            if (CanDoAbility(Abilities.Quit))
            {
                DoAbility(Abilities.Quit);
            }

            CordialSpellData = DataManager.GetItem((uint)CordialType.Cordial).BackingAction;

            cleanup = bot =>
            {
                DoCleanup();
                TreeRoot.OnStop -= cleanup;
            };

            TreeRoot.OnStop += cleanup;
        }
Example #50
0
        private static void ProcessSpell_YasuoQW(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData)
        {
            if (hero.IsEnemy && args.SData.Name == "yasuoq")
            {
                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0)
                {
                    spellData.spellDelay = castTime;
                }
            }
        }
 public bool CanCastOnTarget(SpellData spell, Tile target)
 {
     return(spellBox.CanCastOnTarget(spell, target));
 }
Example #52
0
 /// <summary>
 /// Returns if the specified spell position is valid.
 /// </summary>
 public bool CheckSpellPosition(int X, int Y, SpellData SpellData)
 {
     return(true);
 }
Example #53
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "TaricE")
            {
                var sdata = new SpellData();
                sdata.charName        = "Taric";
                sdata.name            = "TaricE2";
                sdata.spellName       = "TaricE";
                sdata.range           = 750;
                sdata.radius          = 100;
                sdata.fixedRange      = true;
                sdata.spellDelay      = 1000;
                sdata.projectileSpeed = int.MaxValue;
                sdata.dangerlevel     = 3;

                var partner = HeroManager.Enemies.FirstOrDefault(x => x.HasBuff("taricwleashactive"));
                if (partner != null && partner.ChampionName != "Taric")
                {
                    var start     = partner.ServerPosition.LSTo2D();
                    var direction = (args.End.LSTo2D() - start).LSNormalized();
                    var end       = start + direction * spellData.range;

                    SpellDetector.CreateSpellData(partner, start.To3D(), end.To3D(), sdata);
                }
            }
        }
Example #54
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "JarvanIVDragonStrike")
            {
                if (SpellDetector.onProcessSpells.TryGetValue("JarvanIVDragonStrike2", out spellData))
                {
                    foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.obj.Name == "Beacon")
                        {
                            if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                            {
                                DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(info.obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.usePosition ? info.position.To2D() : info.obj.Position.To2D();

                            if (args.End.To2D().Distance(objPosition) < 300)
                            {
                                var dir         = (objPosition - args.Start.To2D()).Normalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.noProcess = true;
                                return;
                            }
                        }
                    }
                }
            }
        }
Example #55
0
        private static void ProcessSpell_LucianQ(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "LucianQ")
            {
                if (args.Target.IsValid <Obj_AI_Base>())
                {
                    var target = args.Target as Obj_AI_Base;

                    float spellDelay       = ((float)(350 - ObjectCache.gamePing)) / 1000;
                    var   heroWalkDir      = (target.ServerPosition - target.Position).LSNormalized();
                    var   predictedHeroPos = target.Position + heroWalkDir * target.MoveSpeed * (spellDelay);


                    SpellDetector.CreateSpellData(hero, args.Start, predictedHeroPos, spellData, null, 0);

                    specialSpellArgs.noProcess = true;
                }
            }
        }
Example #56
0
 private static void ProcessSpell_AsheVolley(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "Volley")
     {
         for (int i = -4; i < 5; i++)
         {
             Vector3 endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), i * spellData.angle).To3D();
             if (i != 0)
             {
                 SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);
             }
         }
     }
 }
Example #57
0
        private static void OnCreateObj_JinxWMissile(GameObject obj, EventArgs args, AIHeroClient hero, SpellData spellData)
        {
            if (hero != null && !hero.IsVisible &&
                obj.IsEnemy && obj.Name.Contains("Jinx") && obj.Name.Contains("W_Cas"))
            {
                var pos1 = hero.Position;
                var dir  = (obj.Position - ObjectManager.Player.Position).Normalized();
                var pos2 = pos1 + dir * 500;

                SpellDetector.CreateSpellData(hero, pos1, pos2, spellData, null, 0);
            }
        }
Example #58
0
        private static void ProcessSpell_EkkoR(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                               SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "EkkoR")
            {
                foreach (var obj in ObjectManager.Get <Obj_AI_Minion>())
                {
                    if (obj != null && obj.IsValid && !obj.IsDead && obj.Name == "Ekko" && obj.IsEnemy)
                    {
                        var blinkPos = obj.ServerPosition.To2D();

                        SpellDetector.CreateSpellData(hero, args.Start, blinkPos.To3D(), spellData);
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Example #59
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FuseSpellsCommand"/> class.
 /// </summary>
 public FuseSpellsCommand(SpellData Data)
 {
     this.SpellData = Data;
 }
Example #60
0
        /// <summary>
        /// Decodes this instance.
        /// </summary>
        internal override void Decode(ByteStream Packet)
        {
            base.Decode(Packet);

            this.SpellData = Packet.DecodeData <SpellData>();
        }