Exemple #1
0
    public void MakeSpellObjects()
    {
        m_PlayerSpellDamage = new SpellDamage();
        m_PlayerSpellHeal   = new SpellHeal();
        m_AISpellDamage     = new SpellDamage();
        m_AISpellHeal       = new SpellHeal();

        m_AmountOfSpells = 4;
        m_Spells         = new SpellHolder[4];

        for (int i = 0; i < m_AmountOfSpells; i++)
        {
            GameObject spell = GameObject.CreatePrimitive(PrimitiveType.Cube);;
            spell.AddComponent <SpellHolder>();
            BoxCollider collider = spell.GetComponent <BoxCollider>();
            collider.isTrigger = true;
            collider.size      = new Vector2(2f, collider.size.y);
            spell.gameObject.SetActive(false);
            m_Spells[i] = (spell.GetComponent <SpellHolder>());
        }

        m_Spells[0].SetSpell(m_PlayerSpellDamage, m_SpellsValue);
        m_Spells[0].gameObject.name = "PlayerSpellDamage";
        m_Spells[1].SetSpell(m_PlayerSpellHeal, m_SpellsValue);
        m_Spells[1].gameObject.name = "PlayerSpellHeal";
        m_Spells[2].SetSpell(m_AISpellDamage, m_SpellsValue);
        m_Spells[2].gameObject.name = "AISpellDamage";
        m_Spells[3].SetSpell(m_AISpellHeal, m_SpellsValue);
        m_Spells[3].gameObject.name = "AISpellHeal";
    }
Exemple #2
0
        public override void Execute()
        {
            var minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(m => m.IsValidTarget(Q.Range));

            if (minion == null)
            {
                return;
            }

            if (Settings.UseQ && Q.IsReady())
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .FirstOrDefault(
                        m =>
                        m.IsValidTarget(Q.Range) && m.IsEnemy &&
                        m.Health < SpellDamage.GetRealDamage(SpellSlot.Q, m));
                if (minionQ != null)
                {
                    Q.Cast(minionQ);
                }
            }
        }
Exemple #3
0
        public override void Execute()
        {
            if (Q.IsReady() && Settings.UseQ && Player.Instance.ManaPercent >= Settings.ManaLane)
            {
                var minionq =
                    EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                        m => m.IsValidTarget(Q.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));

                if (minionq != null)
                {
                    Q.Cast(minionq);
                }
            }

            if (EventsManager.CanW && Settings.UseW && Player.Instance.ManaPercent >= Settings.ManaLane)
            {
                var minionw =
                    EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                        m => m.IsValidTarget(Player.Instance.GetAutoAttackRange()));

                if (minionw != null)
                {
                    W.Cast();
                }
            }
        }
Exemple #4
0
        static void DrawHPBarDamage()
        {
            const int XOffset = 10;
            const int YOffset = 20;
            const int Width   = 103;
            const int Height  = 8;

            foreach (var unit in ObjectManager.Get <Obj_AI_Hero>().Where(h => h.IsValid && h.IsHPBarRendered && h.IsEnemy))
            {
                var   barPos = unit.HPBarPosition;
                float damage = SpellDamage.getComboDamage(unit);
                float percentHealthAfterDamage = Math.Max(0, unit.Health - damage) / unit.MaxHealth;
                float yPos          = barPos.Y + YOffset;
                float xPosDamage    = barPos.X + XOffset + Width * percentHealthAfterDamage;
                float xPosCurrentHp = barPos.X + XOffset + Width * unit.Health / unit.MaxHealth;

                if (damage > unit.Health)
                {
                    text.X    = (int)barPos.X + XOffset;
                    text.Y    = (int)barPos.Y + YOffset - 13;
                    text.text = ((int)(unit.Health - damage)).ToString();
                    text.OnEndScene();
                }
                Drawing.DrawLine(xPosDamage, yPos, xPosDamage, yPos + Height, 2, System.Drawing.Color.Yellow);
            }
        }
Exemple #5
0
        public override void Execute()
        {
            var minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(m => m.IsValidTarget(E.Range));

            if (minion == null)
            {
                return;
            }

            if (E.IsReady() && minion.IsValidTarget(E.Range) && Settings.UseE)
            {
                var minionE =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.E, m));

                if (minionE != null)
                {
                    E.Cast(minionE);
                }
            }
        }
    public void DealSpellDamage(SpellDamage damageInfo)
    {
        if (damageInfo == null)
        {
            return;
        }

        Unit victim = damageInfo.Target;

        if (victim == null)
        {
            return;
        }

        if (!victim.IsAlive())
        {
            return;
        }

        TrinitySpellInfo spellProto = WarcraftDatabase.SpellInfos.ContainsKey(damageInfo.SpellID) ? WarcraftDatabase.SpellInfos[damageInfo.SpellID] : null;

        if (spellProto == null)
        {
            Debug.LogErrorFormat("Unit.DealSpellDamage has wrong damageInfo->SpellID: {0}", damageInfo.SpellID);
            return;
        }

        // Call default DealDamage
        CleanDamage cleanDamage = new CleanDamage(damageInfo.Absorb, damageInfo.Damage);

        DealDamage(victim, damageInfo.Damage, cleanDamage, DamageEffectType.SPELL_DIRECT_DAMAGE, damageInfo.SchoolMask, spellProto);

        SpellManager.SpellDamageEvent(this, victim, damageInfo.Damage, damageInfo.Crit);
    }
Exemple #7
0
        private static void KillSteal()
        {
            var enemies = EntityManager.Heroes.Enemies.OrderByDescending
                              (a => a.HealthPercent)
                          .Where(
                a =>
                !a.IsMe && a.IsValidTarget() && a.Distance(Player) <= Q.Range && !a.IsDead && !a.IsZombie &&
                a.HealthPercent <= 35);

            foreach (
                var target in
                enemies)
            {
                if (!target.IsValidTarget())
                {
                    return;
                }

                if (GravesTheTrollMeNu.KillstealQ() && Q.IsReady() &&
                    target.Health + target.AttackShield < SpellDamage.RDamage(target))
                {
                    Q.Cast(target.Position);
                }
                if (GravesTheTrollMeNu.KillstealR() && R.IsReady() &&
                    target.Health + target.AttackShield < Player.GetSpellDamage(target, SpellSlot.R))
                {
                    var predRKs = R.GetPrediction(target);
                    if (predRKs.HitChance >= HitChance.High)
                    {
                        R.Cast(target.Position);
                    }
                }
            }
        }
Exemple #8
0
        //static getter
        public static Spell GetSpell(string type, int targets, bool team, int power, object[] specialEffects)
        {
            switch (type)
            {
            case "heal":
            {
                Spell s = new SpellHeal(targets, team, power);
                return(s);
            }

            case "damage":
            {
                Spell s = new SpellDamage(targets, team, power);
                return(s);
            }

            case "periodic":
            {
                Spell s = new PeriodicDamageSpell(targets, team, power, specialEffects);
                return(s);
            }

            case "physical damage":
            {
                Spell s = new PhysicalSpell(targets, team, power);
                return(s);
            }

            default:
            {
                return(null);
            }
            }
        }
Exemple #9
0
        private static void KillSteal()
        {
            foreach (
                var enemy in
                EntityManager.Heroes.Enemies.Where(
                    e => e.Distance(Player) <= Q.Range && e.IsValidTarget() && !e.IsInvulnerable))

            {
                if (IreliaTheTrollMenu.KillstealQ() && Q.IsReady() && SpellDamage.QDamage(enemy) >= enemy.Health &&
                    enemy.Distance(Player) <= Q.Range)
                {
                    Q.Cast(enemy);
                }
                if (IreliaTheTrollMenu.KillstealE() && E.IsReady() && SpellDamage.EDamage(enemy) >= enemy.Health &&
                    enemy.Distance(Player) <= E.Range)
                {
                    E.Cast(enemy);
                }
                if (IreliaTheTrollMenu.killstealR() && R.IsReady() && SpellDamage.RDamage(enemy) >= enemy.Health &&
                    enemy.Distance(Player) <= R.Range)
                {
                    R.Cast(enemy);
                }
            }
        }
Exemple #10
0
        public override void Execute()
        {
            var target = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (target == null || target.IsZombie)
            {
                return;
            }

            if (E.IsReady() && target.IsValidTarget(E.Range) && Settings.UseE)
            {
                E.Cast(target);
            }

            if (Q.IsReady() && target.IsValidTarget(Q.Range) && Settings.UseQ && !E.IsReady())
            {
                Q.Cast(target);
            }

            if (R.IsReady() && Settings.UseR)
            {
                var targetR = TargetSelector.GetTarget(Q.Range + R.Range + 50, DamageType.Magical);

                if (target.IsValidTarget(R.Range + Q.Range - 50) && targetR.CountEnemiesInRange(800) <= 2 &&
                    Player.Instance.HealthPercent > targetR.HealthPercent && targetR.HealthPercent <= 50 ||
                    targetR.Health < SpellDamage.GetTotalDamage(targetR))
                {
                    R.Cast(Player.Instance.Position.Extend(target.Position, R.Range + 250).To3D());
                }
            }
        }
Exemple #11
0
        internal static float GetRawDamage(Obj_AI_Base target)
        {
            float damage = 0;

            if (target != null)
            {
                if (_q.IsReady())
                {
                    damage += Player.Instance.GetSpellDamage(target, SpellSlot.Q);
                    damage += Player.Instance.GetAutoAttackDamage(target);
                    damage += SpellDamage.LucianPassive();
                }
                if (_w.IsReady())
                {
                    damage += Player.Instance.GetSpellDamage(target, SpellSlot.W);
                    damage += Player.Instance.GetAutoAttackDamage(target);
                    damage += SpellDamage.LucianPassive();
                }
                if (_e.IsReady())
                {
                    damage += Player.Instance.GetAutoAttackDamage(target);
                    damage += SpellDamage.LucianPassive();
                }
            }
            return(damage);
        }
Exemple #12
0
        public override void Execute()
        {
            var minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(m => m.IsValidTarget(Q.Range));

            //if (minion == null || Settings.ManaLast >= Player.Instance.ManaPercent) return;

            if (E.IsReady() && minion.IsValidTarget(E.Range) && Settings.UseE && Settings.LastMana < Player.Instance.ManaPercent)
            {
                var minionE =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.E, m));
                if (minionE != null)
                {
                    E.Cast(minion);
                }
            }

            if (Q.IsReady() && minion.IsValidTarget(Q.Range) && Settings.UseQ && Settings.LastMana < Player.Instance.ManaPercent)
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));
                if (minionQ != null)
                {
                    Q.Cast(minion);
                }
            }
        }
        public override void Execute()
        {
            var jgminion =
                EntityManager.MinionsAndMonsters.GetJungleMonsters()
                .OrderByDescending(j => j.Health)
                .FirstOrDefault(j => j.IsValidTarget(E.Range));

            if (jgminion == null)
            {
                return;
            }

            var minionE =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(
                    m =>
                    m.IsValidTarget(E.Range) &&
                    Prediction.Health.GetPrediction(m, E.CastDelay) <= SpellDamage.GetRealDamage(SpellSlot.E, m) &&
                    Prediction.Health.GetPrediction(m, E.CastDelay) > 10);

            if (minionE != null)
            {
                E.Cast(minionE);
            }

            if (Q.IsReady() && jgminion.IsValidTarget(Q.Range) && Settings.UseQ && Player.Instance.IsFacing(jgminion) &&
                Player.Instance.Mana <= 60)
            {
                Q.Cast();
            }
        }
    public void CalculateSpellDamageTaken(SpellDamage damageInfo, int damage, TrinitySpellInfo spellInfo, bool crit)
    {
        if (damage < 0)
        {
            return;
        }

        Unit victim = damageInfo.Target;

        if (victim == null || !victim.IsAlive())
        {
            return;
        }

        SpellSchoolMask damageSchoolMask = damageInfo.SchoolMask;

        // Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
        //sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage);

        // Calculate absorb resist

        /*if (damage > 0)
         * {
         *  CalcAbsorbResist(victim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo);
         *  damage -= damageInfo->absorb + damageInfo->resist;
         * }
         * else
         *  damage = 0;*/

        damageInfo.Damage = damage;
        damageInfo.Crit   = crit;
    }
Exemple #15
0
        public override void Execute()
        {
            var minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(m => m.IsValidTarget(Q.Range));

            if (minion == null)
            {
                return;
            }


            //TODO TEST THIS CODE
            if (E.IsReady() && minion.IsValidTarget(E.Range) && Settings.UseE)
            {
                var minions =
                    EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                    Player.Instance.ServerPosition, E.Range, false).ToArray();
                if (minions.Length == 0)
                {
                    return;
                }

                var farmLocation = EntityManager.MinionsAndMonsters.GetCircularFarmLocation(minions, W.Range,
                                                                                            (int)E.Range);

                if (farmLocation.HitNumber >= 3)
                {
                    E.Cast(farmLocation.CastPosition);
                }
            }

            if (W.IsReady() && minion.IsValidTarget(W.Range) && Settings.UseW)
            {
                var minionW =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.W, m));
                if (minionW != null)
                {
                    W.Cast();
                }
            }

            if (Q.IsReady() && minion.IsValidTarget(Q.Range) && Settings.UseQ)
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));
                if (minionQ != null)
                {
                    Q.Cast(minion);
                }
            }
        }
Exemple #16
0
        public override void Execute()
        {
            if (Settings.UseR && R.IsReady())
            {
                var hero =
                    EntityManager.Heroes.Enemies.OrderByDescending(e => e.Distance(Player.Instance)).FirstOrDefault(
                        e => e.IsVisible && e.HasBuffOfType(BuffType.Stun) || e.HasBuffOfType(BuffType.Knockup) ||
                        e.HasBuffOfType(BuffType.Snare));

                if (hero != null)
                {
                    R.Cast(hero);
                }

                var target = TargetSelector.GetTarget(Settings.maxR, DamageType.Physical);
                if (target == null || target.IsZombie)
                {
                    return;
                }

                if (!target.IsInRange(Player.Instance, Settings.minR) &&
                    target.Health <= SpellDamage.GetRealDamage(SpellSlot.R, target) &&
                    target.Health >= Settings.MinHealthR)
                {
                    R.Cast(target);
                }
            }

            if (Configs.UseQ && Q.IsReady() && Configs.ManaAutoHarass <= Player.Instance.ManaPercent)
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
                if (target == null || target.IsZombie)
                {
                    return;
                }

                if (target.IsValidTarget(Q.Range))
                {
                    Q.Cast(target);
                }
            }

            if (Configs.UseW && W.IsReady() && Configs.ManaAutoHarass <= Player.Instance.ManaPercent)
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (target == null || target.IsZombie)
                {
                    return;
                }

                if (target.IsValidTarget(W.Range))
                {
                    W.Cast(target);
                }
            }
        }
Exemple #17
0
        public override void Execute()
        {
            if (Player.Instance.CanAttack && Settings.UseAA)
            {
                var targetAutoAttack = TargetSelector.GetTarget(Player.Instance.AttackRange * 2, DamageType.Physical);
                if (targetAutoAttack != null)
                {
                    if (targetAutoAttack.HasBuff("caitlynyordletrapinternal"))
                    {
                        Player.IssueOrder(GameObjectOrder.AttackUnit, targetAutoAttack);
                    }
                }
            }

            if (Settings.UseQCC && Q.IsReady())
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);

                if (target != null)
                {
                    if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) ||
                        target.HasBuffOfType(BuffType.Knockup))
                    {
                        Q.Cast(target);
                    }
                }
            }

            if (Settings.UseWCC && _lastW + 1500 > Environment.TickCount && W.IsReady())
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (target != null)
                {
                    if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) ||
                        target.HasBuffOfType(BuffType.Knockup))
                    {
                        W.Cast(target);
                        _lastW = Environment.TickCount;
                    }
                }
            }

            if (R.IsReady() && Settings.KeyR)
            {
                var targetR = TargetSelector.GetTarget(SpellManager.R.Range, DamageType.Physical);
                if (targetR != null)
                {
                    if (targetR.IsValidTarget(R.Range) &&
                        targetR.Health < SpellDamage.GetRealDamage(SpellSlot.R, targetR))
                    {
                        R.Cast(targetR);
                    }
                }
            }
        }
Exemple #18
0
        public override void Execute()
        {
            var target = TargetSelector.GetTarget(E.Range, DamageType.Magical);

            if (target != null && !target.IsZombie && !target.HasUndyingBuff())
            {
                if (E.IsReady() && target.IsValidTarget(E.Range) && Settings.UseE &&
                    (Functions.ShouldOverload(SpellSlot.E) || Player.Instance.Mana < 80))
                {
                    var pred = E.GetPrediction(target);
                    if (pred.HitChance >= HitChance.Medium)
                    {
                        E.Cast(E.GetPrediction(target).CastPosition);
                    }
                }

                if (Player.Instance.Spellbook.GetSpell(SpellSlot.E).ToggleState == 1)
                {
                    var pred = E.GetPrediction(target);
                    if (pred.HitChance >= HitChance.Medium)
                    {
                        E.Cast(E.GetPrediction(target).CastPosition);
                    }
                }

                if (Q.IsReady() && target.IsValidTarget(Q.Range) && Settings.UseQ && Player.Instance.IsFacing(target) &&
                    (Functions.ShouldOverload(SpellSlot.Q) || Player.Instance.Mana < 80))
                {
                    Q.Cast();
                }
            }


            var targetR = TargetSelector.GetTarget(R.Range, DamageType.Magical);

            if (targetR == null || targetR.IsZombie || targetR.HasUndyingBuff())
            {
                return;
            }

            if (R.IsReady() && targetR.IsValidTarget(R.Range) && Settings.UseR &&
                !targetR.IsInRange(Player.Instance, E.Range) && !targetR.IsFacing(Player.Instance))
            {
                if (Settings.UseRKillable &&
                    Prediction.Health.GetPrediction(targetR, R.CastDelay) <=
                    SpellDamage.GetRealDamage(SpellSlot.R, targetR))
                {
                    Functions.CastR(targetR, Settings.MinR);
                }
                else
                {
                    Functions.CastR(targetR, Settings.MinR);
                }
            }
        }
Exemple #19
0
        public override void Execute()
        {
            var target = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (target == null || target.IsZombie || target.HasUndyingBuff())
            {
                return;
            }
            //RKS
            if (SpellManager.R.IsReady() && target.IsValidTarget(R.Range) &&
                Prediction.Health.GetPrediction(target, R.CastDelay) <= SpellDamage.GetRealDamage(SpellSlot.R, target) && Prediction.Health.GetPrediction(target, R.CastDelay) > Misc.OverkillR)
            {
                R.Cast(target);
            }
            //RKS
            //AutoHarass
            var tower = EntityManager.Turrets.Allies.FirstOrDefault(t => t.IsInRange(Player.Instance, 920));

            if (tower == null && Settings.KeyAutoHarass)
            {
                if (Q.IsReady() && E.IsReady() && target.IsValidTarget(QE.Range) && Settings.UseAutoQ && Settings.UseAutoE && Player.Instance.ManaPercent > Settings.ManaAutoHarass)
                {
                    Functions.QE(QE.GetPrediction(target).CastPosition);
                }
                else
                {
                    if (Q.IsReady() && target.IsValidTarget(Q.Range) && Settings.UseAutoQ && Player.Instance.ManaPercent > Settings.ManaAutoHarass)
                    {
                        Q.Cast(target);
                    }

                    if (E.IsReady() && target.IsValidTarget(E.Range) && Settings.UseAutoE && Player.Instance.ManaPercent > Settings.ManaAutoHarass)
                    {
                        E.Cast(target);
                    }
                }

                if (W.IsReady() && target.IsValidTarget(W.Range) && Settings.UseAutoE && Player.Instance.ManaPercent > Settings.ManaAutoHarass)
                {
                    if (Player.Instance.Spellbook.GetSpell(SpellSlot.W).ToggleState != 2 && lastWCast + 1000 < Environment.TickCount)
                    {
                        W.Cast(Functions.GrabWPost(false));
                        lastWCast = Environment.TickCount;
                    }
                    if (Player.Instance.Spellbook.GetSpell(SpellSlot.W).ToggleState == 2 &&
                        lastWCast + 500 < Environment.TickCount)
                    {
                        W.Cast(W.GetPrediction(target).CastPosition);
                    }
                }
            }
        }
        public override void Execute()
        {
            var target = TargetSelector.GetTarget(R.Range, DamageType.Magical);

            if (target == null || target.IsZombie)
            {
                return;
            }

            if (R.IsReady() && target.IsValidTarget(R.Range) && target.Health <= SpellDamage.GetRealDamage(SpellSlot.R, target))
            {
                R.Cast(target);
            }
        }
Exemple #21
0
        public override void Execute()
        {
            if (Q.IsReady() && Settings.UseQ && Player.Instance.ManaPercent >= Settings.LastMana)
            {
                var minionq =
                    EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                        m => m.IsValidTarget(Q.Range) && m.Health < SpellDamage.GetRealDamage(SpellSlot.Q, m));

                if (minionq != null)
                {
                    Q.Cast(minionq);
                }
            }
        }
        public override void Execute()
        {
            var enemy =
                EntityManager.Heroes.Enemies.FirstOrDefault(
                    e =>
                    e.Health <=
                    SpellDamage.GetRealDamage(SpellSlot.Q, e) + SpellDamage.GetRealDamage(SpellSlot.W, e));

            if (W.IsReady() && Q.IsReady() && Settings.QWKillSteal &&
                Player.Instance.ManaPercent >= Settings.KillStealMana && enemy.IsValidTarget(Q.Range))
            {
                W.Cast();
                Q.Cast(enemy);
            }
        }
Exemple #23
0
        private static void Lasthit()
        {
            var qminion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Position, Q.Range)
                .FirstOrDefault(
                    m =>
                    m.Distance(Player) <= Q.Range &&
                    m.Health <= SpellDamage.QDamage(m) &&
                    m.IsValidTarget());

            if (Q.IsReady() && VladimirTheTrollMeNu.LastHitQ() && qminion != null)
            {
                Q.Cast(qminion);
            }
        }
Exemple #24
0
        void FarmQ()
        {
            var useQ    = ZyraTheTrollMeNu.FarmMeNu["qFarm"].Cast <CheckBox>().CurrentValue;
            var qminion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Position, Q.Range)
                .FirstOrDefault(
                    m =>
                    m.Distance(Player) <= Q.Range &&
                    m.Health <= SpellDamage.QDamage(m) - 20 &&
                    m.IsValidTarget());

            if (Q.IsReady() && useQ && qminion != null && !Orbwalker.IsAutoAttacking)
            {
                Q.Cast(qminion);
            }
        }
Exemple #25
0
        private static void OnLaneClear()
        {
            var qminion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Position, Q.Range)
                .FirstOrDefault(
                    m =>
                    m.Distance(Player) <= Q.Range &&
                    m.Health <= SpellDamage.QDamage(m) + SpellDamage.ExtraWDamage() - 10 &&
                    m.IsValidTarget());

            if (Q.IsReady() && IreliaTheTrollMenu.LaneQ() && Player.ManaPercent > IreliaTheTrollMenu.LaneMana() &&
                qminion != null)
            {
                Q.Cast(qminion);
            }
        }
Exemple #26
0
        public override void Execute()
        {
            if (Q.IsReady() && Settings.UseQ)
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(Q.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));

                if (minionQ != null && !Player.Instance.IsInAutoAttackRange(minionQ) && Player.Instance.ManaPercent > Settings.LastMana)
                {
                    Q.Cast(minionQ);
                }
            }
        }
Exemple #27
0
        public override void Execute()
        {
            var laneMinion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .FirstOrDefault(m => m.IsValidTarget(Q.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));

            if (laneMinion == null)
            {
                return;
            }

            if (Settings.UseQ && Q.IsReady() && Settings.LastMana <= Player.Instance.ManaPercent && !Player.Instance.IsInAutoAttackRange(laneMinion))
            {
                Q.Cast(laneMinion);
            }
        }
Exemple #28
0
        public override void Execute()
        {
            var target = TargetSelector.GetTarget(QE.Range, DamageType.Magical);

            if (target == null || target.IsZombie || target.HasUndyingBuff())
            {
                return;
            }

            if (R.IsReady() && target.IsValidTarget(R.Range) && Settings.UseR &&
                target.Health <= SpellDamage.GetRealDamage(SpellSlot.R, target) && target.Health > Misc.OverkillR)
            {
                R.Cast(target);
            }

            if (Q.IsReady() && E.IsReady() && target.IsValidTarget(QE.Range) && Settings.UseQ && Settings.UseE)
            {
                Functions.QE(QE.GetPrediction(target).CastPosition);
            }
            else
            {
                if (Q.IsReady() && target.IsValidTarget(Q.Range) && Settings.UseQ)
                {
                    Q.Cast(target);
                }

                if (E.IsReady() && target.IsValidTarget(E.Range) && Settings.UseE)
                {
                    E.Cast(target);
                }
            }

            if (W.IsReady() && target.IsValidTarget(W.Range) && Settings.UseW)
            {
                if (Player.Instance.Spellbook.GetSpell(SpellSlot.W).ToggleState != 2 &&
                    lastWCast + 650 < Environment.TickCount)
                {
                    W.Cast(Functions.GrabWPost(false));
                    lastWCast = Environment.TickCount;
                }
                if (Player.Instance.Spellbook.GetSpell(SpellSlot.W).ToggleState == 2 &&
                    lastWCast + 300 < Environment.TickCount)
                {
                    W.Cast(W.GetPrediction(target).CastPosition);
                }
            }
        }
Exemple #29
0
 private static void Killsteal()
 {
     if (KsTarget() == null)
     {
         return;
     }
     if (Value.Use("killsteal.e") && _e.IsReady())
     {
         if (Prediction.Health.GetPrediction(KsTarget(), Game.Ping + _e.CastDelay) <
             Player.Instance.GetAutoAttackDamage(KsTarget()) + SpellDamage.LucianPassive())
         {
             var safeE = OKTRGeometry.SafeDashPosRework(200, KsTarget(), 120);
             if (safeE != Vector3.Zero)
             {
                 _e.Cast(safeE);
             }
         }
     }
     if (Value.Use("killsteal.q") & _q.IsReady())
     {
         if (Prediction.Health.GetPrediction(KsTarget(), Game.Ping + _q.CastDelay) <
             Player.Instance.GetSpellDamage(KsTarget(), SpellSlot.Q))
         {
             QExtendLogic(KsTarget());
         }
     }
     if (KsTarget().Distance(Player.Instance) < Player.Instance.GetAutoAttackRange())
     {
         if (!Orbwalker.IsAutoAttacking && _passive &&
             Prediction.Health.GetPrediction(KsTarget(), Game.Ping + _e.CastDelay) <
             Player.Instance.GetAutoAttackDamage(KsTarget()) + SpellDamage.LucianPassive())
         {
             ToggleOrb();
             Player.IssueOrder(GameObjectOrder.AttackUnit, KsTarget());
             Core.DelayAction(ToggleOrb, (int)(Player.Instance.AttackCastDelay * 1000));
         }
         else if (!Orbwalker.IsAutoAttacking &&
                  Prediction.Health.GetPrediction(KsTarget(), Game.Ping + _e.CastDelay) <
                  Player.Instance.GetAutoAttackDamage(KsTarget()))
         {
             ToggleOrb();
             Player.IssueOrder(GameObjectOrder.AttackUnit, KsTarget(), true);
             Core.DelayAction(ToggleOrb, (int)(Player.Instance.AttackCastDelay * 1000));
         }
     }
 }
Exemple #30
0
        public override void Execute()
        {
            var minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .OrderByDescending(m => m.Health)
                .FirstOrDefault(m => m.IsValidTarget(Q.Range));

            if (minion == null)
            {
                return;
            }

            if (W.IsReady() && Settings.UseW)
            {
                W.Cast(Player.Instance.Position.Extend(minion.Position, W.Range).To3D());
            }

            if (E.IsReady() && minion.IsValidTarget(E.Range) && Settings.UseE)
            {
                var minionE =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(E.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.E, m));

                if (minionE != null)
                {
                    E.Cast(minionE);
                }
            }

            if (Q.IsReady() && minion.IsValidTarget(Q.Range) && Settings.UseQ)
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions()
                    .OrderByDescending(m => m.Health)
                    .FirstOrDefault(
                        m => m.IsValidTarget(Q.Range) && m.Health <= SpellDamage.GetRealDamage(SpellSlot.Q, m));

                if (minionQ != null)
                {
                    Q.Cast(minionQ);
                }
            }
        }
Exemple #31
0
        public void DrainMana( Mobile src, Mobile target, SpellDamage sd )
        {
            int heal = MakeManaDamage( src, target, sd );
            float damage = 0f;
            if ( src.HaveTalent( Talents.ImprovedDrainMana ) )
            {
                AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedDrainMana );
                if(src.TalentLevel(Talents.ImprovedDrainMana) == 1)
                    damage = (float)(heal*0.15);
                else damage = (float)(heal*0.30);

            }
            if (damage > 0) this.MakeDamage(src,target,damage);
            src.GainMana( target, heal );
        }
Exemple #32
0
 public void Heal( Mobile src, Mobile target, SpellDamage d )
 {
     int basedmg = 1;
     int amount = 1;
     switch( d )
     {
         case SpellDamage.TypeS1:
             basedmg = s1;
             amount = this.bonus1;
             break;
         case SpellDamage.TypeS2:
             basedmg = s2;
             amount = bonus2;
             break;
     }
     float dmg = (float)( basedmg + Utility.Random( 1, amount ) );
     Heal( src,target,dmg );
 }
Exemple #33
0
 public ArrayList MakeAreaDamage( Mobile src, SpellDamage sd, float area, float X, float Y, float Z )
 {
     ArrayList targets = new ArrayList();
     float a = area * area;
     if ( src is Character )
     {
         foreach( Object o in ( src as Character ).KnownObjects )
         {
             if ( o is Mobile && o != src )
             {
                 Mobile t = ( o as Mobile );
                 //Console.WriteLine("Distance {0}", t.Distance( X, Y, Z ) );
                 if ( t.Distance( X, Y, Z ) < area )
                     targets.Add( t );
             }
         }
     }
     else
     {
         foreach( Mobile t in World.allMobiles )
         {
             if ( t.Distance( X, Y, Z ) < area )
                 targets.Add( t );
         }
     }
     foreach( Mobile m in targets )
         MakeDamage( src, m, sd );
     return targets;
 }
Exemple #34
0
 public int MakeDamage( Mobile src, Mobile target, SpellDamage sd )
 {
     return MakeDamage( false, src, target, sd );
 }
Exemple #35
0
 public int MakeManaDamage( Mobile src, Mobile target, SpellDamage sd )
 {
     int basedmg = 1;
     int amount = 1;
     switch( sd )
     {
         case SpellDamage.TypeS1:
             basedmg = s1;
             amount = this.bonus1;
             break;
         case SpellDamage.TypeS2:
             basedmg = s2;
             amount = bonus2;
             break;
     }
     float dmg = (float)( basedmg + Utility.Random( 1, amount ) );
     return MakeManaDamage( src, target, dmg );
 }
Exemple #36
0
        public void ComboHit( Mobile from, Mobile target, SpellDamage typedamage )
        {
            float bonus = 1f;
            switch( typedamage )
            {
                case SpellDamage.TypeS1:
                    bonus = (float)Bonus1;
                    break;
                case SpellDamage.TypeS2:
                    bonus = (float)Bonus2;
                    break;
            }
            float dmg = from.Hit( target, bonus + from.ComboPoints * comboModifier );
            if ( dmg > 0f )
            {
                from.ResetCombo( target );
                target.LooseHits( from, (int)dmg, true );

            //01 00 00 00
            //43 02 00 00 00 00 00 00
            //FF 01 00 00 00 00 00 00
            //00 00 00 00
            //01 00 00 00
            //00 00 00 00
            //00 00 00 00
            //00 00 00 00
            //00
            //01 00 00 00
            //E8 03 00 00
            //00 00 00 00
            //00 00 00 00
            //00 00 00 00

                    int offset = 4;
                    Converter.ToBytes( target.Guid, from.tempBuff, ref offset );
                    Converter.ToBytes( from.Guid, from.tempBuff, ref offset );
                    Converter.ToBytes( (int)Id, from.tempBuff, ref offset );
                    Converter.ToBytes( (int)dmg, from.tempBuff, ref offset );
                    Converter.ToBytes( 0x2, from.tempBuff, ref offset );
                    Converter.ToBytes( target.Guid, from.tempBuff, ref offset );
                    Converter.ToBytes( 0, from.tempBuff, ref offset );
                    from.ToAllPlayerNear( OpCodes.SMSG_SPELLNONMELEEDAMAGELOG, from.tempBuff, offset );
            /*
                int offset = 4;
                byte []tempBuff = from.tempBuff;
                if ( (int)dmg <= 0 )
                    Converter.ToBytes( 1, tempBuff, ref offset );
                else
                    Converter.ToBytes( 4, tempBuff, ref offset );

                Converter.ToBytes( from.Guid, tempBuff, ref offset );
                Converter.ToBytes( target.Guid, tempBuff, ref offset );
                Converter.ToBytes( (int)dmg, tempBuff, ref offset );
                Converter.ToBytes( 0x1, tempBuff, ref offset );
                Converter.ToBytes( (byte)0, tempBuff, ref offset );
            //	float ang = (float)Math.Atan2( target.Y - from.Y, target.X - from.X );
                Converter.ToBytes( (float)dmg, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );
                Converter.ToBytes( 1, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );
                Converter.ToBytes( 0, tempBuff, ref offset );

                from.ToAllPlayerNear( OpCodes.SMSG_ATTACKERSTATEUPDATE, tempBuff, offset );
                */
            /*		data.Initialize(SMSG_ATTACKERSTATEUPDATE);
                data << (uint32)hit_status;   // Attack flags
                data << GetGUID();
                data << pVictim->GetGUID();
                data << (uint32)damage;
                data << (uint8)1;       // Damage type counter

                // for each...
                data << damageType;      // Damage type, // 0 - white font, 1 - yellow
                data << (uint32)0;      // damage float
                data << (uint32)damage; // Damage amount
                data << (uint32)0;      // damage absorbed

                data << (uint32)1;      // new victim state
                data << (uint32)0;      // victim round duraction
                data << (uint32)0;      // additional spell damage amount
                data << (uint32)0;      // additional spell damage id
                data << (uint32)0;      // Damage amount blocked*/
            }
        }
Exemple #37
0
        public void DrainLife( Mobile src, Mobile target, SpellDamage sd )
        {
            int basedmg = 1;
            int amount = 1;
            switch( sd )
            {
                case SpellDamage.TypeS1:
                    basedmg = s1;
                    amount = this.bonus1;
                    break;
                case SpellDamage.TypeS2:
                    basedmg = s2;
                    amount = bonus2;
                    break;
            }

            float dmg = (float)( basedmg + Utility.Random( 1, amount ) );
            if (dmg <= 0) dmg = 1;
            this.DrainLife(  src, target, dmg );
        }