public void UpdatePolygon() { switch (SpellData.Type) { case SkillShotType.SkillshotCircle: Circle.UpdatePolygon(); Polygon = Circle; break; case SkillShotType.SkillshotLine: Rectangle.UpdatePolygon(); Polygon = Rectangle; break; case SkillShotType.SkillshotMissileLine: Rectangle.UpdatePolygon(); Polygon = Rectangle; break; case SkillShotType.SkillshotCone: Sector.UpdatePolygon(); Polygon = Sector; break; case SkillShotType.SkillshotRing: Ring.UpdatePolygon(); Polygon = Ring; break; case SkillShotType.SkillshotArc: Arc.UpdatePolygon(); Polygon = Arc; break; } }
private static void DrawingOnOnDraw(EventArgs args) { if (!Menu.Item("DrawSpell").IsActive()) { return; } var rectangle = new Geometry.Polygon.Rectangle(new Vector3(), new Vector3(), 0); foreach (var missile in ObjectManager.Get <Obj_SpellMissile>().Where(x => x.SpellCaster.IsMe /*&& CastedSpellsNames.Any(y => y == x.SData.Name)*/)) { var missilePosition = missile.Position.To2D(); var unitPosition = missile.StartPosition.To2D(); var endPos = missile.EndPosition.To2D(); //Calculate the real end Point: var direction = (endPos - unitPosition).Normalized(); if (unitPosition.Distance(endPos) > missile.SData.CastRange) { endPos = unitPosition + direction * missile.SData.CastRange; } rectangle.Start = unitPosition; rectangle.End = endPos; rectangle.Width = missile.SData.LineWidth; rectangle.UpdatePolygon(); rectangle.Draw(Color.LightYellow); // Draw Line var start = missilePosition + missile.SData.LineWidth * rectangle.Direction.Perpendicular(); var end = missilePosition - missile.SData.LineWidth * rectangle.Direction.Perpendicular(); Drawing.DrawLine(Drawing.WorldToScreen(start.To3D()), Drawing.WorldToScreen(end.To3D()), 3, Color.Chartreuse); } }
static void OnUpdate(EventArgs args) { if (Player.Instance.IsDead || Player.Instance.IsRecalling()) { return; } var target = TargetSelector.SelectedTarget; if (target == null || !target.IsValidTarget()) { target = TargetSelector.GetTarget(SpellManager.R.Range, DamageType.Magical); } if (target != null && target.IsValidTarget(SpellManager.R.Range)) { if (Player.Instance.Distance(target) <= SpellManager.R.Range + SpellManager.Q.Range + 100) { RRectangle.Start = Player.Instance.Position.Shorten(target.Position, -250).To2D(); RRectangle.End = SpellManager.R.GetPrediction(target).CastPosition.Extend(Player.Instance.Position, -330); RRectangle.UpdatePolygon(); } } if (SpellManager.R.IsReady()) { doOnce = true; } if (Player.Instance.LastCastedSpellT() >= 1) { if (doOnce && Player.Instance.LastCastedspell().Name == "FizzMarinerDoom") { RCooldownTimer = Game.Time; doOnce = false; } } if (Game.Time - RCooldownTimer <= 5.0f) { CanCastZhonyaOnDash = true; } else { CanCastZhonyaOnDash = false; } if (ComboSettings.UseEFlashZhonyasCombo) { Combo.EFlashCombo(); } if (ComboSettings.UseLateGameZhonyasCombo) { Combo.LateGameZhonyasCombo(); } if (ComboSettings.UseQminionREWCombo) { Combo.QminionREWCombo(); } }