public void OnFinishCasting(IChampion owner, ISpell spell, IAttackableUnit target) { var visualBuff = AddBuffHudVisual("Recall", 8.0f, 1, BuffType.COUNTER, owner, 8.0f); var addParticle = AddParticleTarget(owner, "TeleportHome.troy", owner); CreateTimer(8.0f, owner.Recall); }
public void OnFinishCasting(IChampion owner, ISpell spell, IAttackableUnit target) { var current = new Vector2(owner.X, owner.Y); var to = Vector2.Normalize(new Vector2(spell.X, spell.Y) - current); var range = to * 300; var trueCoords = current + range; DashToLocation(owner, trueCoords.X, trueCoords.Y, 1200, false, "Spell1"); if (!_listenerAdded) { //ApiEventManager.OnHitUnit.AddListener(this, owner, OnAutoAttack); _listenerAdded = true; } if (_owningChampion != owner) { _owningChampion = owner; } if (_owningSpell != spell) { _owningSpell = spell; } _nextAutoBonusDamage = true; _tumbleBuff = AddBuffHudVisual("VayneTumble", 6.0f, 1, BuffType.COMBAT_ENCHANCER, owner); CreateTimer(6.0f, () => { // If auto has not yet been consumed if (_nextAutoBonusDamage == true) { RemoveBuffHudVisual(_tumbleBuff); _nextAutoBonusDamage = false; } }); }
public void ApplyEffects(IChampion owner, IAttackableUnit target, ISpell spell, IProjectile projectile) { var damage = owner.Stats.AttackDamage.Total * (0.45f + spell.Level * 0.15f) + (50 + spell.Level * 30); target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false); }
public void ApplyEffects(IChampion owner, IAttackableUnit target, ISpell spell, IProjectile projectile) { var ap = owner.Stats.AbilityPower.Total * 0.8f; var damage = 45 + spell.Level * 35 + ap; if (target != null && !target.IsDead) { target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false); if (target.IsDead) { spell.LowerCooldown(spell.GetCooldown()); float manaToRecover = 55 + spell.Level * 5; var newMana = owner.Stats.CurrentMana + manaToRecover; var maxMana = owner.Stats.ManaPoints.Total; if (newMana >= maxMana) { owner.Stats.CurrentMana = maxMana; } else { owner.Stats.CurrentMana = newMana; } } } projectile.SetToRemove(); }
public void ApplyEffects(IChampion owner, IAttackableUnit target, ISpell spell, IProjectile projectile) { var damage = target.Stats.HealthPoints.Total * 0.15f; target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SUMMONER_SPELL, false); projectile.SetToRemove(); }
public void ApplyEffects(IChampion owner, IAttackableUnit target, ISpell spell, IProjectile projectile) { var isCrit = new Random().Next(0, 100) < owner.Stats.CriticalChance.Total; var baseDamage = new[] { 20, 45, 70, 95, 120 }[spell.Level - 1] +owner.Stats.AttackDamage.Total; var damage = isCrit ? baseDamage * owner.Stats.CriticalDamage.Total / 100 : baseDamage; var goldIncome = new[] { 4, 5, 6, 7, 8 }[spell.Level - 1]; if (target != null && !target.IsDead) { target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK, false); if (target.IsDead) { owner.Stats.Gold += goldIncome; var manaCost = new float[] { 50, 55, 60, 65, 70 }[spell.Level - 1]; var newMana = owner.Stats.CurrentMana + manaCost / 2; var maxMana = owner.Stats.ManaPoints.Total; if (newMana >= maxMana) { owner.Stats.CurrentMana = maxMana; } else { owner.Stats.CurrentMana = newMana; } } projectile.SetToRemove(); } }
public override bool HandlePacket(int userId, UnpauseRequest req) { if (!_game.IsPaused) { return(false); } IChampion unpauser = null; unpauser = _playerManager.GetPeerInfo((ulong)userId).Champion; _game.PacketNotifier.NotifyResumeGame(unpauser, true); var timer = new Timer { AutoReset = false, Enabled = true, Interval = 5000 }; timer.Elapsed += (sender, args) => { _game.PacketNotifier.NotifyResumeGame(unpauser, false); _game.Unpause(); }; return(true); }
public SetCooldownResponse(IChampion c, byte slotId, float currentCd, float totalCd) { Champ = c; SlotId = slotId; CurrentCd = currentCd; TotalCd = totalCd; }
public ChampionRespawn(IChampion c) : base(PacketCmd.PKT_S2C_CHAMPION_RESPAWN, c.NetId) { Write((float)c.X); Write((float)c.Y); Write((float)c.GetZ()); }
public void OnStartCasting(IChampion owner, ISpell spell, IAttackableUnit target) { _owningSpell = spell; spell.AddProjectileTarget("KatarinaQ", target); if (!_listenerAdded) { ApiEventManager.OnHitUnit.AddListener(this, _owningChampion, OnProc); _listenerAdded = true; } foreach (var enemyTarget in GetUnitsInRange(target, 625, true)) { if (enemyTarget != null && enemyTarget.Team == CustomConvert.GetEnemyTeam(owner.Team) && enemyTarget != target && enemyTarget != owner && target.GetDistanceTo(enemyTarget) < 100 && !UnitIsTurret((AttackableUnit)enemyTarget)) { CreateTimer(3.0f, () => { if (!(enemyTarget.IsDead)) { AddParticle(owner, "katarina_bouncingBlades_mis.troy", enemyTarget.X, enemyTarget.Y); } spell.AddProjectileTarget("KatarinaQMark", enemyTarget); }); } } //WE NEED A TIMER ON THE Q TO BE FIXED }
public void AddChampion(IChampion champion) { lock (_championsLock) { _champions.Add(champion.NetId, champion); } }
public AddGold(IChampion richMan, IAttackableUnit died, float gold) : base(PacketCmd.PKT_S2C_ADD_GOLD, richMan.NetId) { WriteNetId(richMan); WriteNetId(died); Write(gold); }
public void NotifyPlayerStats(IChampion champion) { var response = new PlayerStats(champion); // TODO: research how to send the packet _packetHandlerManager.BroadcastPacket(response, Channel.CHL_S2C); }
public static void Init() { try { GameObjects.Initialize(); try { _champion = LoadChampion(); if (_champion != null) { Global.Champion = _champion; if (Global.Reset.Enabled) { Reset.Force( Global.Name, Global.Reset.MaxAge, TargetSelector.Weights.RestoreDefaultWeights); } LeagueSharp.Common.Utility.DelayAction.Add(1000, () => Conflicts.Check(ObjectManager.Player.ChampionName)); Update.Check( Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000); Core.Init(_champion, 50); Core.Boot(); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public void OnActivate(IObjAiBase owner) { CurrentCastTime = MaxCastTime; adder = false; _owner = owner as IChampion; // here's nothing }
public void HandleSurrender(int userId, IChampion who, bool vote) { if (_surrenders.ContainsKey(who.Team)) { _surrenders[who.Team].HandleSurrender(userId, who, vote); } }
public void ApplyEffects(IChampion owner, IAttackableUnit target, ISpell spell, IProjectile projectile) { var ap = owner.Stats.AbilityPower.Total * 0.8f; var damage = 70 + spell.Level * 45 + ap; target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false); }
public void NotifySurrender(IChampion starter, byte flag, byte yesVotes, byte noVotes, byte maxVotes, TeamId team, float timeOut) { var surrender = new Surrender(starter, flag, yesVotes, noVotes, maxVotes, team, timeOut); _packetHandlerManager.BroadcastPacketTeam(team, surrender, Channel.CHL_S2C); }
public void RemoveChampion(IChampion champion) { lock (_championsLock) { _champions.Remove(champion.NetId); } }
public void Construct(IChampion champion) { this.champion = champion; champion.Damaged += OnDamaged; OnDamaged(0f); }
public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target) { var units = GetChampionsInRange(owner, 850, true); IChampion mostWoundedAlliedIChampion = null; float lowestHealthPercentage = 100; float maxHealth; foreach (var value in units) { if (value != owner && owner.Team == value.Team) { var currentHealth = value.Stats.CurrentHealth; maxHealth = value.Stats.HealthPoints.Total; if (currentHealth * 100 / maxHealth < lowestHealthPercentage && owner != value) { lowestHealthPercentage = currentHealth * 100 / maxHealth; mostWoundedAlliedIChampion = value; } } } if (mostWoundedAlliedIChampion != null) { PerformHeal(owner, spell, mostWoundedAlliedIChampion); } PerformHeal(owner, spell, (IChampion)owner); }
public static Particle AddParticleTarget(IChampion champion, string particle, ITarget target, float size = 1.0f, string bone = "") { var p = new Particle(_game, champion, target, particle, size, bone); _game.PacketNotifier.NotifyParticleSpawn(p); return(p); }
public SetCameraPosition(IChampion champ, float x, float y, float z) : base(PacketCmd.PKT_S2C_SET_CAMERA_POSITION, champ.NetId) { Write(x); Write(z); // Doesn't seem to matter Write(y); }
public void NotifyChampionDie(IChampion die, IAttackableUnit killer, int goldFromKill) { var cd = new ChampionDie(die, killer, goldFromKill); _packetHandlerManager.BroadcastPacket(cd, Channel.CHL_S2C); NotifyChampionDeathTimer(die); }
public void OnStartCasting(IChampion owner, ISpell spell, IAttackableUnit target) { foreach (var enemyTarget in GetChampionsInRange(owner, 20000, true) .Where(x => x.Team == CustomConvert.GetEnemyTeam(owner.Team))) { AddParticleTarget(owner, "KarthusFallenOne", enemyTarget); } }
public void OnStartCasting(IChampion owner, ISpell spell, IAttackableUnit target) { var current = new Vector2(owner.X, owner.Y); AddParticle(owner, "Rengar_Base_W_Roar.troy", owner.X, owner.Y); AddParticle(owner, "Rengar_Base_W_Buf.troy", owner.X, owner.Y); spell.SpellAnimation("SPELL2", owner); }
public void OnActivate(IChampion owner) { _owningChampion = owner; _markTarget = new List <IAttackableUnit>(); _owningSpell = null; _listenerAdded = false; _mark = null; }
public static Minion AddMinionTarget(IChampion champion, string model, string name, ITarget target, int visionRadius = 0) { var m = new Minion(_game, champion, target.X, target.Y, model, name, visionRadius); _game.ObjectManager.AddObject(m); m.SetVisibleByTeam(champion.Team, true); return(m); }
public void OnStartCasting(IChampion owner, ISpell spell, IAttackableUnit target) { AddParticleTarget(owner, "Global_SS_Smite.troy", target, 1); var damage = new float[] { 390, 410, 430, 450, 480, 510, 540, 570, 600, 640, 680, 420, 760, 800, 850, 900, 950, 1000 }[owner.Stats.Level - 1]; target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL, false); }
public void OnActivate(IObjAiBase owner) { CurrentCastTime = MaxCastTime; casting = false; adder = false; _owner = owner as IChampion; //empty }
public static void Init() { try { var upvoteItem = Upvote.Initialize(Global.Name, 7); AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs) { try { var ex = sender as Exception; if (ex != null) { Global.Logger.AddItem(new LogItem(ex)); } } catch (Exception ex) { Console.WriteLine(ex); } }; SetupLanguage(); GameObjects.Initialize(); CustomEvents.Game.OnGameLoad += delegate { try { _champion = LoadChampion(); if (_champion != null) { Update.Check( Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000); Core.Init(_champion, 50); Core.Boot(); if (_champion.SFXMenu != null && upvoteItem != null) { _champion.SFXMenu.AddItem(upvoteItem); } } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }; } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public static void Init() { try { AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs) { try { var ex = sender as Exception; if (ex != null) { Global.Logger.AddItem(new LogItem(ex)); } } catch (Exception ex) { Console.WriteLine(ex); } }; GameObjects.Initialize(); CustomEvents.Game.OnGameLoad += delegate { try { _champion = LoadChampion(); if (_champion != null) { if (Global.Reset.Enabled) { Reset.Force(Global.Name, Global.Reset.MaxAge, Weights.RestoreDefaultWeights); } Update.Check( Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000); Core.Init(_champion, 50); Core.Boot(); } else { Console.WriteLine("No champion for: " + ObjectManager.Player.ChampionName); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }; } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public string Fight(IChampion champion) { //Vayne wint in dit geval altijd. switch (champion.Name) { case "Vayne" : return "Tie"; default: return Name; } }
public static void Init() { CustomEvents.Game.OnGameLoad += delegate { _champion = LoadChampion(); if (_champion != null) { // Start and initialize the core which is responsible for calling the different modes such as Combo, Harass, LaneClear etc. Core.Init(_champion, 50); Core.Boot(); } }; }
/// <summary> /// Constructs a Riot Client with given implemented service for each Riot service group. /// </summary> /// <param name="champion">The champion.</param> /// <param name="currentGame">The current game.</param> /// <param name="featuredGames">The featured games.</param> /// <param name="game">The game.</param> /// <param name="league">The league.</param> /// <param name="lolStaticData">The lol static data.</param> /// <param name="lolStatus">The lol status.</param> /// <param name="match">The match.</param> /// <param name="matchHistory">The match history.</param> /// <param name="matchList">The match list.</param> /// <param name="stats">The stats.</param> /// <param name="summoner">The summoner.</param> /// <param name="team">The team.</param> public RiotClient(IChampion champion, ICurrentGame currentGame, IFeaturedGames featuredGames, IGame game, ILeague league, ILolStaticData lolStaticData, ILolStatus lolStatus, IMatch match, IMatchHistory matchHistory, IMatchList matchList, IStats stats, ISummoner summoner, ITeam team) { this.Champion = champion; this.CurrentGame = currentGame; this.FeaturedGames = featuredGames; this.Game = game; this.League = league; this.LolStaticData = lolStaticData; this.LolStatus = lolStatus; this.Match = match; this.MatchHistory = matchHistory; this.MatchList = matchList; this.Stats = stats; this.Summoner = summoner; this.Team = team; }
/// <summary> /// Constructs a Riot Client with given implemented service for each Riot service group. /// </summary> /// <param name="champion">The champion.</param> /// <param name="currentGame">The current game.</param> /// <param name="featuredGames">The featured games.</param> /// <param name="game">The game.</param> /// <param name="league">The league.</param> /// <param name="lolStaticData">The lol static data.</param> /// <param name="lolStatus">The lol status.</param> /// <param name="match">The match.</param> /// <param name="matchHistory">The match history.</param> /// <param name="matchList">The match list.</param> /// <param name="stats">The stats.</param> /// <param name="summoner">The summoner.</param> /// <param name="team">The team.</param> public RiotClient(IChampion champion, ICurrentGame currentGame, IFeaturedGames featuredGames, IGame game, ILeague league, ILolStaticData lolStaticData, ILolStatus lolStatus, IMatch match, IMatchHistory matchHistory, IMatchList matchList, IStats stats, ISummoner summoner, ITeam team) { //we need to let Ninject know which concrete type to use to satisfy the interface. this.Champion = champion; this.CurrentGame = currentGame; this.FeaturedGames = featuredGames; this.Game = game; this.League = league; this.LolStaticData = lolStaticData; this.LolStatus = lolStatus; this.Match = match; this.MatchHistory = matchHistory; this.MatchList = matchList; this.Stats = stats; this.Summoner = summoner; this.Team = team; }
public static void OnLoad(EventArgs args) { Player = ObjectManager.Player; Config = new Menu("DZAIO", "dzaio", true); TargetSelector.AddToMenu(Config.SubMenu("Target selector")); Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking")); Game.PrintChat("<b><font color='#FF0000'>[DZAIO]</font></b><font color='#FFFFFF'> DZAIO Loaded!</font> v{0}", Assembly.GetExecutingAssembly().GetName().Version); if (ChampList.ContainsKey(Player.ChampionName)) { CurrentChampion = ChampList[Player.ChampionName].Invoke(); CurrentChampion.OnLoad(Config); CurrentChampion.SetUpSpells(); CurrentChampion.RegisterEvents(); ItemManager.OnLoad(Config); Game.PrintChat("<b><font color='#FF0000'>[DZAIO] </font></b><font color='#FFFFFF'>Loaded</font> <b><font color='#FF0000'>{0}</font></b> plugin! <font color='#FFFFFF'> Have fun! </font>", Player.ChampionName); } Game.PrintChat("<b><font color='#FF0000'>[DZAIO] </font></b><font color='#FFFFFF'>Special credits to:</font> <b><font color='#FF0000'>Hellsing</font></b>, <b><font color='#FF0000'>ChewyMoon</font></b> "); Cleanser.OnLoad(); ChatHook.OnLoad(); DebugHelper.OnLoad(); NotificationDrawing.OnLoad(); PotionManager.OnLoad(Config); Config.AddItem(new MenuItem("dzaio.hpdraw.disable", "Disable HP Bar Drawing").SetValue(false)); var aboutMenu = new Menu(Player.ChampionName + " - About", "dzaio.about"); { aboutMenu.AddItem(new MenuItem("dzaio.about.line1", "DZAIO By Asuna/DZ191")); aboutMenu.AddItem(new MenuItem("dzaio.about.line2", "v." + Assembly.GetExecutingAssembly().GetName().Version)); aboutMenu.AddItem(new MenuItem("dzaio.about.line3", " ")); aboutMenu.AddItem(new MenuItem("dzaio.about.line4", "If you liked/appreciated the assembly")); aboutMenu.AddItem(new MenuItem("dzaio.about.line5", "Feel free to donate at:")); aboutMenu.AddItem(new MenuItem("dzaio.about.line6", "*****@*****.**")); } Config.AddSubMenu(aboutMenu); Config.AddToMainMenu(); }
public static void Init(IChampion champion, int interval) { _champion = champion; _interval = interval; _init = true; }