public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
 {
     foreach (var enemyTarget in ApiFunctionManager.GetChampionsInRange(owner, 20000, true)
              .Where(x => x.Team == CustomConvert.GetEnemyTeam(owner.Team)))
     {
         ApiFunctionManager.AddParticleTarget(owner, "KarthusFallenOne", enemyTarget);
     }
 }
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var ap     = owner.GetStats().AbilityPower.Total;
            var damage = 100 + spell.Level * 150 + ap * 0.6f;

            foreach (var enemyTarget in ApiFunctionManager.GetChampionsInRange(owner, 20000, true)
                     .Where(x => x.Team == CustomConvert.GetEnemyTeam(owner.Team)))
            {
                enemyTarget.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                       false);
            }
        }
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var      units                = ApiFunctionManager.GetChampionsInRange(owner, 600, true);
            Champion nearbychampion       = null;
            float    lowestManaPercentage = 100;
            float    maxMana;
            float    newMana;

            for (var i = 0; i <= units.Count - 1; i++)
            {
                var value = units[i];
                if (owner.Team == value.Team && i != 0)
                {
                    var currentMana = value.GetStats().CurrentMana;
                    maxMana = value.GetStats().ManaPoints.Total;
                    if (currentMana * 100 / maxMana < lowestManaPercentage && owner != value)
                    {
                        lowestManaPercentage = currentMana * 100 / maxMana;
                        nearbychampion       = value;
                    }
                }
            }

            if (nearbychampion != null)
            {
                var mp2    = nearbychampion.GetStats().CurrentMana;
                var maxMp2 = nearbychampion.GetStats().ManaPoints.Total;
                if (mp2 + maxMp2 * PERCENT_MAX_MANA_HEAL < maxMp2)
                {
                    nearbychampion.GetStats().CurrentMana = mp2 + maxMp2 * PERCENT_MAX_MANA_HEAL;
                }
                else
                {
                    nearbychampion.GetStats().CurrentMana = maxMp2;
                }
                ApiFunctionManager.AddParticleTarget(nearbychampion, "global_ss_clarity_02.troy", nearbychampion);
            }

            var mp    = owner.GetStats().CurrentMana;
            var maxMp = owner.GetStats().ManaPoints.Total;

            if (mp + maxMp * PERCENT_MAX_MANA_HEAL < maxMp)
            {
                owner.GetStats().CurrentMana = mp + maxMp * PERCENT_MAX_MANA_HEAL;
            }
            else
            {
                owner.GetStats().CurrentMana = maxMp;
            }
            ApiFunctionManager.AddParticleTarget(owner, "global_ss_clarity_02.troy", owner);
        }
Exemple #4
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var      units = ApiFunctionManager.GetChampionsInRange(owner, 850, true);
            Champion mostWoundedAlliedChampion = null;
            float    lowestHealthPercentage    = 100;
            float    maxHealth;
            float    newHealth;

            for (var i = 0; i <= units.Count - 1; i++)
            {
                var value = units[i];
                if (owner.Team == value.Team && i != 0)
                {
                    var currentHealth = value.GetStats().CurrentHealth;
                    maxHealth = value.GetStats().HealthPoints.Total;
                    if (currentHealth * 100 / maxHealth < lowestHealthPercentage && owner != value)
                    {
                        lowestHealthPercentage    = currentHealth * 100 / maxHealth;
                        mostWoundedAlliedChampion = value;
                    }
                }
            }

            if (mostWoundedAlliedChampion != null)
            {
                newHealth = mostWoundedAlliedChampion.GetStats().CurrentHealth + 75 + owner.GetStats().GetLevel() * 15;
                maxHealth = mostWoundedAlliedChampion.GetStats().HealthPoints.Total;
                if (newHealth >= maxHealth)
                {
                    mostWoundedAlliedChampion.GetStats().CurrentHealth = maxHealth;
                }
                else
                {
                    mostWoundedAlliedChampion.GetStats().CurrentHealth = newHealth;
                }

                ApiFunctionManager.AddBuffHUDVisual("SummonerHeal", 1.0f, 1, mostWoundedAlliedChampion, 1.0f);
                ChampionStatModifier statMod2 = new ChampionStatModifier();
                statMod2.MoveSpeed.PercentBonus = 30 / 100.0f;
                mostWoundedAlliedChampion.AddStatModifier(statMod2);
                ApiFunctionManager.CreateTimer(1.0f, () => { mostWoundedAlliedChampion.RemoveStatModifier(statMod2); });
                ApiFunctionManager.AddParticleTarget(mostWoundedAlliedChampion, "global_ss_heal_02.troy",
                                                     mostWoundedAlliedChampion);
                ApiFunctionManager.AddParticleTarget(mostWoundedAlliedChampion, "global_ss_heal_speedboost.troy",
                                                     mostWoundedAlliedChampion);
            }

            newHealth = owner.GetStats().CurrentHealth + 75 + owner.GetStats().GetLevel() * 15;
            maxHealth = owner.GetStats().HealthPoints.Total;
            if (newHealth >= maxHealth)
            {
                owner.GetStats().CurrentHealth = maxHealth;
            }
            else
            {
                owner.GetStats().CurrentHealth = newHealth;
            }

            ApiFunctionManager.AddBuffHUDVisual("SummonerHeal", 1.0f, 1, owner, 1.0f);
            ChampionStatModifier statMod = new ChampionStatModifier();

            statMod.MoveSpeed.PercentBonus = 30 / 100.0f;
            owner.AddStatModifier(statMod);
            ApiFunctionManager.CreateTimer(1.0f, () => { owner.RemoveStatModifier(statMod); });
            ApiFunctionManager.AddParticleTarget(owner, "global_ss_heal.troy", owner);
            ApiFunctionManager.AddParticleTarget(owner, "global_ss_heal_speedboost.troy", owner);
        }