public static void ApplyFireground(Fireground ability) { KeyValuePair <ushort, Hero>[] enemyheroes = heroes.Where(f => f.Value.GetFaction() != ability.GetFaction() && !f.Value.IsDead()).ToArray(); foreach (KeyValuePair <ushort, Hero> enemy in enemyheroes) { if (ServerMath.Distance(ability, enemy.Value) <= 0) { ability.Attack(enemy.Value, 5); } } KeyValuePair <ushort, Minion>[] enemyminions = minions.Where(f => f.Value.GetFaction() != ability.GetFaction() && !f.Value.IsDead()).ToArray(); foreach (KeyValuePair <ushort, Minion> enemy in enemyminions) { if (ServerMath.Distance(ability, enemy.Value) <= 0) { ability.Attack(enemy.Value, 5); } } foreach (KeyValuePair <ushort, Monster> enemy in monsters) { if (!enemy.Value.IsDead()) { if (ServerMath.Distance(ability, enemy.Value) <= 0) { ability.Attack(enemy.Value, 5); } } } }
public static void AddFireground(NetConnection connect, float xPos, float zPos) { Hero hero = GetHero(connect); if (hero.GetMP() >= 20) { Fireground ability = new Fireground(hero, xPos, zPos); abilities.Add(ability.GetObjID(), ability); hero.SetMP((ushort)(hero.GetMP() - 20)); } }