Example #1
0
        private static float ComboDamage(Obj_AI_Hero src, Obj_AI_Hero dsc)
        {
            if (!src.IsValid || !dsc.IsValid) return 0f;
            float basicDmg = 0;
            int attacks = (int)Math.Floor(src.AttackSpeedMod*5);
            if (src.Crit>0)
            {

                basicDmg += (float)src.GetAutoAttackDamage(dsc) * attacks * (1 + src.Crit);
            }
            else
            {

                basicDmg += (float)src.GetAutoAttackDamage(dsc) * attacks;
            }
            float damage = basicDmg;
            var spells = src.Spellbook.Spells;

            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (spell.Level > 0 && t < 0.5 && Damage.GetSpellDamage(src, dsc, spell.Slot) > 0)
                {
                    switch (src.SkinName)
                    {
                                case "Ahri":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot));
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot,1));
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Akali":
                                    if (spell.Slot == SpellSlot.R)
                                    {
                                        damage += (float) (Damage.GetSpellDamage(src, dsc, spell.Slot)*spell.Ammo);
                                    }
                                    else if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot));
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot, 1));
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Amumu":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 5);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Cassiopeia":
                                    if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 2);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Fiddlesticks":
                                    if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot)*5);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Garen":
                                    if (spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 3);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Irelia":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * attacks);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Karthus":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * 4);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "KogMaw":
                                    if (spell.Slot == SpellSlot.W)
                                    {
                                        damage += (float)(Damage.GetSpellDamage(src, dsc, spell.Slot) * attacks);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "LeeSin":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot,1);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Lucian":
                                    if (spell.Slot == SpellSlot.R)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot)*4;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Nunu":
                                    if (spell.Slot != SpellSlot.R && spell.Slot != SpellSlot.Q)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "MasterYi":
                                    if (spell.Slot != SpellSlot.E)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot)*attacks;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "MonkeyKing":
                                    if (spell.Slot != SpellSlot.R)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot) * 4;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Pantheon":
                                    if (spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot)*3;
                                    }
                                    else if (spell.Slot == SpellSlot.R)
                                    {
                                        damage +=0;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);

                                    break;
                                case "Rammus":
                                    if (spell.Slot == SpellSlot.R)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot)*6;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Riven":
                                    if (spell.Slot == SpellSlot.Q)
                                    {
                                        damage += RivenDamageQ(spell, src, dsc);
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Viktor":
                                    if (spell.Slot == SpellSlot.R)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot,1) * 5;
                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                case "Vladimir":
                                    if (spell.Slot == SpellSlot.E)
                                    {
                                        damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot) * 2;

                                    }
                                    else damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                    break;
                                default:
                                damage += (float)Damage.GetSpellDamage(src, dsc, spell.Slot);
                                break;
                    }

                }
            }

            if (src.Spellbook.CanUseSpell(src.GetSpellSlot("summonerdot")) == SpellState.Ready)
            {
                damage += (float)src.GetSummonerSpellDamage(dsc, Damage.SummonerSpell.Ignite);
            }
            return damage;
        }
Example #2
0
        public static float GetChampDmgToMe(Obj_AI_Hero enemy)
        {
            double result = 0;
            double basicDmg = 0;
            int attacks = (int) Math.Floor(enemy.AttackSpeedMod * 5);
            for (int i = 0; i < attacks; i++)
            {
                if (enemy.Crit > 0)
                {
                    basicDmg += enemy.GetAutoAttackDamage(player) * (1 + enemy.Crit / attacks);
                }
                else
                {
                    basicDmg += enemy.GetAutoAttackDamage(player);
                }
            }
            result += basicDmg;
            var spells = enemy.Spellbook.Spells;
            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (t < 0.5)
                {
                    switch (enemy.SkinName)
                    {
                        case "Ahri":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot));
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Akali":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * spell.Ammo);
                            }
                            else if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot));
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Amumu":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Cassiopeia":
                            if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 2);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Fiddlesticks":
                            if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Garen":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 3);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Irelia":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Karthus":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * 4);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "KogMaw":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(enemy, player, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "LeeSin":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot, 1);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Lucian":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * 4;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Nunu":
                            if (spell.Slot != SpellSlot.R && spell.Slot != SpellSlot.Q)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "MasterYi":
                            if (spell.Slot != SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * attacks;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "MonkeyKing":
                            if (spell.Slot != SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * 4;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Pantheon":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * 3;
                            }
                            else if (spell.Slot == SpellSlot.R)
                            {
                                result += 0;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }

                            break;
                        case "Rammus":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * 6;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Riven":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += RivenDamageQ(spell, enemy, player);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Viktor":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot, 1) * 5;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        case "Vladimir":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot) * 2;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            }
                            break;
                        default:
                            result += Damage.GetSpellDamage(enemy, player, spell.Slot);
                            break;
                    }
                }
            }
            if (enemy.Spellbook.CanUseSpell(player.GetSpellSlot("summonerdot")) == SpellState.Ready)
            {
                result += enemy.GetSummonerSpellDamage(player, Damage.SummonerSpell.Ignite);
            }
            foreach (var minions in
                ObjectManager.Get<Obj_AI_Minion>()
                    .Where(i => i.Distance(player.Position) < 750 && i.IsMinion && !i.IsAlly && !i.IsDead))
            {
                result += minions.GetAutoAttackDamage(player, false);
            }
            return (float) result;
        }
Example #3
0
        public static float GetComboDMG(Obj_AI_Hero source, Obj_AI_Hero target)
        {
            double result = 0;
            double basicDmg = 0;
            int attacks = (int) Math.Floor(source.AttackSpeedMod * 5);
            for (int i = 0; i < attacks; i++)
            {
                if (source.Crit > 0)
                {
                    basicDmg += source.GetAutoAttackDamage(target, true) * (1f + source.Crit / attacks);
                }
                else
                {
                    basicDmg += source.GetAutoAttackDamage(target, true);
                }
            }
            result += basicDmg;
            var spells = source.Spellbook.Spells;
            foreach (var spell in spells)
            {
                var t = spell.CooldownExpires - Game.Time;
                if (t < 0.5)
                {
                    switch (source.SkinName)
                    {
                        case "Ahri":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot));
                                result += (Damage.GetSpellDamage(source, target, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Akali":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * spell.Ammo);
                            }
                            else if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot));
                                result += (Damage.GetSpellDamage(source, target, spell.Slot, 1));
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Amumu":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Cassiopeia":
                            if (spell.Slot == SpellSlot.Q || spell.Slot == SpellSlot.E || spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 2);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Fiddlesticks":
                            if (spell.Slot == SpellSlot.W || spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 5);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Garen":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 3);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Irelia":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Karthus":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * 4);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "KogMaw":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += (Damage.GetSpellDamage(source, target, spell.Slot) * attacks);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "LeeSin":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                                result += Damage.GetSpellDamage(source, target, spell.Slot, 1);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Lucian":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 4;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Nunu":
                            if (spell.Slot != SpellSlot.R && spell.Slot != SpellSlot.Q)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "MasterYi":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * attacks;
                            }
                            else if (spell.Slot == SpellSlot.R)
                            {
                                result += basicDmg * 0.6f;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "MonkeyKing":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 4;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Pantheon":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 3;
                            }
                            else if (spell.Slot == SpellSlot.R)
                            {
                                result += 0;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }

                            break;
                        case "Rammus":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 6;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Riven":
                            if (spell.Slot == SpellSlot.Q)
                            {
                                result += RivenDamageQ(spell, source, target);
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Shyvana":
                            if (spell.Slot == SpellSlot.W)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 4;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Viktor":
                            if (spell.Slot == SpellSlot.R)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                                result += Damage.GetSpellDamage(source, target, spell.Slot, 1) * 5;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        case "Vladimir":
                            if (spell.Slot == SpellSlot.E)
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot) * 2;
                            }
                            else
                            {
                                result += Damage.GetSpellDamage(source, target, spell.Slot);
                            }
                            break;
                        default:
                            result += Damage.GetSpellDamage(source, target, spell.Slot);
                            break;
                    }
                }
            }
            if (source.Spellbook.CanUseSpell(target.GetSpellSlot("summonerdot")) == SpellState.Ready)
            {
                result += source.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            }
            return (float) result;
        }