Example #1
0
            public WardObject(
                WardStruct data,
                Vector3 position,
                int startT,
                Obj_AI_Base wardObject = null,
                bool isFromMissile     = false,
                Vector3 startPosition  = default(Vector3), Obj_AI_Base spellCaster = null)
            {
                try
                {
                    var pos = position;
                    if (isFromMissile)
                    {
                        var newPos = this.GuessPosition(startPosition, position);
                        if (!position.X.Equals(newPos.X) || !position.Y.Equals(newPos.Y))
                        {
                            pos            = newPos;
                            this.Corrected = true;
                        }
                        if (!this.Corrected)
                        {
                            pos = startPosition;
                        }
                    }

                    this.IsFromMissile = isFromMissile;
                    this.Data          = data;
                    this.Position      = this.RealPosition(pos);
                    this.EndPosition   = this.Position.Equals(position) || this.Corrected
                                           ? position
                                           : this.RealPosition(position);
                    this.MinimapPosition = Drawing.WorldToMinimap(this.Position).To3D();
                    this.StartT          = startT;
                    this.StartPosition   = startPosition.Equals(default(Vector3)) || this.Corrected
                                             ? startPosition
                                             : this.RealPosition(startPosition);
                    this.Object = wardObject;
                    if (data.ObjectBaseSkinName.ToLower().Contains("yellowtrinket"))
                    {
                        var caster = spellCaster as AIHeroClient;
                        this.OverrideDuration = data.Duration +
                                                (int)Math.Ceiling(caster != null && caster.IsValid
                                               ? caster.Level
                                               : Math.Min(18,
                                                          GameObjects.EnemyHeroes.Select(e => e.Level).Average() + 1) * 3.5f);
                    }
                }
                catch (Exception e)
                {
                    Logging.AddEntry(LoggingEntryType.Error, "@WardTracker.cs: An error occurred: {0}", e);
                }
            }
Example #2
0
 public WardObject(WardStruct data, Vector3 position, int startT, Obj_AI_Base wardObject = null,
                   bool isFromMissile = false, Vector3 startPosition = default(Vector3), Obj_AI_Base spellCaster = null)
 {
     try
     {
         var pos = position;
         if (isFromMissile)
         {
             var newPos = GuessPosition(startPosition, position);
             if (!position.X.Equals(newPos.X) || !position.Y.Equals(newPos.Y))
             {
                 pos       = newPos;
                 Corrected = true;
             }
             if (!Corrected)
             {
                 pos = startPosition;
             }
         }
         IsFromMissile   = isFromMissile;
         Data            = data;
         Position        = RealPosition(pos);
         EndPosition     = Position.Equals(position) || Corrected ? position : RealPosition(position);
         MinimapPosition = Drawing.WorldToMinimap(Position).To3D();
         StartT          = startT;
         StartPosition   = startPosition.Equals(default(Vector3)) || Corrected
             ? startPosition
             : RealPosition(startPosition);
         Object = wardObject;
         if (data.ObjectBaseSkinName.Contains("YellowTrinket", StringComparison.OrdinalIgnoreCase))
         {
             var caster = spellCaster as Obj_AI_Hero;
             OverrideDuration = data.Duration +
                                (int)Math.Ceiling(caster != null && caster.IsValid
                                    ? caster.Level
                                    : Math.Min(18,
                                               GameObjects.EnemyHeroes.Select(e => e.Level).Average() + 1) * 3.5f);
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Example #3
0
 public WardObject(
     WardStruct data,
     Vector3 position,
     int startT,
     Obj_AI_Base wardObject = null,
     bool isFromMissile     = false,
     Vector3 startPosition  = default(Vector3))
 {
     try
     {
         var pos = position;
         if (isFromMissile)
         {
             var newPos = this.GuessPosition(startPosition, position);
             if (!position.X.Equals(newPos.X) || !position.Y.Equals(newPos.Y))
             {
                 pos            = newPos;
                 this.Corrected = true;
             }
             if (!this.Corrected)
             {
                 pos = startPosition;
             }
         }
         this.IsFromMissile = isFromMissile;
         this.Data          = data;
         this.Position      = this.RealPosition(pos);
         this.EndPosition   = this.Position.Equals(position) || this.Corrected
                                ? position
                                : this.RealPosition(position);
         this.MinimapPosition = Drawing.WorldToMinimap(this.Position).To3D();
         this.StartT          = startT;
         this.StartPosition   = startPosition.Equals(default(Vector3)) || this.Corrected
                                  ? startPosition
                                  : this.RealPosition(startPosition);
         this.Object = wardObject;
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Example #4
0
 public WardObject(WardStruct data,
                   Vector3 position,
                   int startT,
                   Obj_AI_Base wardObject = null,
                   bool isFromMissile     = false,
                   Vector3 startPosition  = default(Vector3))
 {
     try
     {
         var pos = position;
         if (isFromMissile)
         {
             var newPos = GuessPosition(startPosition, position);
             if (!position.X.Equals(newPos.X) || !position.Y.Equals(newPos.Y))
             {
                 pos       = newPos;
                 Corrected = true;
             }
             if (!Corrected)
             {
                 pos = startPosition;
             }
         }
         IsFromMissile   = isFromMissile;
         Data            = data;
         Position        = RealPosition(pos);
         EndPosition     = Position.Equals(position) || Corrected ? position : RealPosition(position);
         MinimapPosition = Drawing.WorldToMinimap(Position).To3D();
         StartT          = startT;
         StartPosition   = startPosition.Equals(default(Vector3)) || Corrected
             ? startPosition
             : RealPosition(startPosition);
         Object = wardObject;
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }