private static void GameObject_OnCreate(GameObject sender, EventArgs args) { if (!sender.IsValid || !sender.Name.Contains("Baron")) return; if (sender.Name.Contains("Minion") || sender.Name.Contains("_Turret_Cas.troy") || sender.Name.Contains("SRU") || sender.GetType().Name == "MissileClient" || sender.Name.Contains("FeelNoPain") || sender.Name.Contains("crystal_beam")) return; Console.WriteLine("Add\tType: {0} | Name: {1} | NetID: {2} | objectName: {3}", sender.GetType().Name, sender.Name, sender.NetworkId, sender.BaseObjectName()); }
private static void GameObject_OnCreate(GameObject sender, EventArgs args) { try { if (!sender.IsValid) return; WardDetector(sender, args); var database = SpellDatabase.Database.FirstOrDefault(d => d.GameObject && d.SpellType != SpellType.Ward && (d.ObjectName != null ? d.Name == sender.Name && d.ObjectName == sender.BaseObjectName() : sender.Name.Contains(d.Name))); if (database != null) { if ((database.SpellType == SpellType.Spell && !Config.Menu.CheckboxValue("sTimer")) || (database.SpellType == SpellType.SummonerSpell && !Config.Menu.CheckboxValue("ssTimer")) || (database.SpellType == SpellType.Item && !Config.Menu.CheckboxValue("itemTimer")) || (database.SpellType == SpellType.Trap && !Config.Menu.CheckboxValue("trapTimer"))) return; var caster = sender.FIndCaster(database); Program.SpellList.Add(new Spell { SpellType = database.SpellType, Team = caster.IsAlly ? Team.Ally : caster.IsEnemy ? Team.Enemy : Team.None, Slot = database.Slot, DrawType = database.DrawType, Importance = database.Importance, Caster = caster, Object = sender, CastPosition = sender.Position, ChampionName = database.ChampionName != null ? database.ChampionName : caster.BaseSkinName, Name = database.Name, ObjectName = database.ObjectName, MenuCode = database.MenuCode, FullTime = database.EndTime, EndTime = database.EndTime + Utility.TickCount, NetworkID = sender.NetworkId, GameObject = database.GameObject, OnlyMe = database.OnlyMe, Teleport = database.Teleport, Color = database.Color, SpriteName = database.SpriteName, }); return; } } catch (Exception e) { e.ErrorMessage("ON_CREATE", sender.Name); } }
private static void WardDetector(GameObject sender, EventArgs args) { try { if (!Config.Menu.CheckboxValue("wardTimer")) return; var database = SpellDatabase.Database.FirstOrDefault(d => d.GameObject && d.SpellType == SpellType.Ward && d.ObjectName == sender.BaseObjectName()); if (database != null) { var caster = sender.FindCasterWard(database); bool limited = (sender.BaseObjectName() == "YellowTrinket" || sender.BaseObjectName() == "SightWard"); Core.DelayAction(() => Program.SpellList.Add(new Spell { SpellType = database.SpellType, Team = caster.IsAlly ? Team.Ally : caster.IsEnemy ? Team.Enemy : Team.None, //sender.Team.IsAlly() ? Team.Ally : sender.Team.IsEnemy() ? Team.Enemy : Team.None, Object = sender, DrawType = database.DrawType, Caster = caster, StartPosition = caster.Position, CastPosition = sender.Position, ChampionName = caster.BaseSkinName, Name = database.Name, ObjectName = database.ObjectName, MenuCode = database.MenuCode, FullTime = limited ? (sender as Obj_AI_Base).Mana * 1000f : database.EndTime, EndTime = limited ? (sender as Obj_AI_Base).Mana * 1000f + Utility.TickCount - 500 : database.EndTime + Utility.TickCount - 500, NetworkID = sender.NetworkId, GameObject = database.GameObject, Color = database.Color, SpriteName = database.SpriteName, }) , database.ObjectName == "YellowTrinket" ? 500 : 0); return; } } catch (Exception e) { e.ErrorMessage("WARD_DETECTOR"); } }