private void GameObject_OnCreate(GameObject sender, EventArgs args) { #region Visible wards if (sender.Type == GameObjectType.obj_AI_Minion) { Obj_AI_Minion ward = sender as Obj_AI_Minion; if (ward == null || !ward.IsEnemy) { return; } if (wards.ContainsKey(ward.NetworkId)) { Core.DelayAction(() => { Obj_AI_Minion tempWard = ObjectManager.GetUnitByNetworkId((uint)ward.NetworkId) as Obj_AI_Minion; wards[ward.NetworkId].Expires = Game.Time + (tempWard.GetBuff("sharedwardbuff").EndTime - Game.Time); wards[ward.NetworkId].Position = tempWard.ServerPosition; }, 1); return; } switch (ward.Name) { case "SightWard": Core.DelayAction(() => { Obj_AI_Minion tempWard = ObjectManager.GetUnitByNetworkId((uint)ward.NetworkId) as Obj_AI_Minion; BuffInstance buff = tempWard.GetBuff("sharedwardbuff"); if (buff != null) { wards.Add(ward.NetworkId, new WardObject(false, ((AIHeroClient)buff.Caster).ChampionName, Game.Time + (buff.EndTime - Game.Time), ward.Position)); } }, 1); break; case "VisionWard": Core.DelayAction(() => { Obj_AI_Minion tempWard = ObjectManager.GetUnitByNetworkId((uint)ward.NetworkId) as Obj_AI_Minion; BuffInstance buff = tempWard.GetBuff("sharedwardbuff"); if (buff != null) { wards.Add(ward.NetworkId, new WardObject(false, ((AIHeroClient)buff.Caster).ChampionName, Game.Time + (buff.EndTime - Game.Time), ward.Position)); } else { buff = tempWard.GetBuff("sharedvisionwardbuff"); if (buff == null) { return; } wards.Add(ward.NetworkId, new WardObject(true, ((AIHeroClient)buff.Caster).ChampionName, float.MaxValue, ward.Position)); } }, 1); break; } } #endregion }