public void OnUpdate()
{
if (this.SpellData.CollisionObjects.Count() > 0 && this.SpellData.CollisionObjects != null
&& Extensions.GameTimeTickCount - this.lastCollisionCalc > 50)
{
this.lastCollisionCalc = Extensions.GameTimeTickCount;
this.collisionEnd = this.GetCollisionPoint();
}
if (this.SpellData.Type == SkillShotType.SkillshotMissileLine)
{
this.Rectangle = new Geometry.Polygon.Rectangle(
this.GetMissilePosition(0),
this.CollisionEnd,
this.SpellData.Radius);
this.UpdatePolygon();
}
if (this.SpellData.MissileFollowsUnit && this.Unit.IsVisible)
{
this.End = this.Unit.ServerPosition.To2D();
this.Direction = (this.End - this.Start).Normalized();
this.UpdatePolygon();
}
if (this.SpellData.SpellName == "SionR")
{
if (this.helperTick == 0)
{
this.helperTick = this.StartTick;
}
this.SpellData.MissileSpeed = (int)this.Unit.MoveSpeed;
if (this.Unit.IsValidTarget(float.MaxValue, false))
{
if (!this.Unit.HasBuff("SionR") && Extensions.GameTimeTickCount - this.helperTick > 600)
{
this.StartTick = 0;
}
else
{
this.StartTick = Extensions.GameTimeTickCount - this.SpellData.Delay;
this.Start = this.Unit.ServerPosition.To2D();
this.End = this.Unit.ServerPosition.To2D() + 1000 * this.Unit.Direction.To2D().Perpendicular();
this.Direction = (this.End - this.Start).Normalized();
this.UpdatePolygon();
}
}
else
{
this.StartTick = 0;
}
}
if (this.SpellData.FollowCaster)
{
this.Circle.Center = this.Unit.ServerPosition.To2D();
this.UpdatePolygon();
}
}