public override void OnStart()
        {
            if (!ZetaDia.IsInGame || ZetaDia.IsLoadingWorld || !ZetaDia.Me.IsValid)
            {
                return;
            }

            if (InteractRange == 0)
            {
                InteractRange = 10;
            }
            if (InteractAttempts == 0)
            {
                InteractAttempts = 5;
            }
            if (pathPointLimit == 0)
            {
                pathPointLimit = 250;
            }
            if (Timeout == 0)
            {
                Timeout = 180;
            }


            startingWorldId = ZetaDia.CurrentWorldId;
            tagStartTime    = DateTime.UtcNow;

            if (!String.IsNullOrEmpty(EndAnimation))
            {
                try
                {
                    Enum.TryParse <Zeta.Game.SNOAnim>(EndAnimation, out endAnimation);
                }
                catch
                {
                    endAnimation = SNOAnim.Invalid;
                }
            }

            Navigator.Clear();

            verbose = true;

            completedInteractions = 0;
            startingWorldId       = 0;
            lastInteract          = DateTime.MinValue;
            actor = null;
            startInteractPosition = Vector3.Zero;
            lastPosition          = ZetaDia.Me.Position;
            lastPositionUpdate    = DateTime.UtcNow;

            Logger.Debug("Initialized {0}", Status());
        }
        /// <summary>
        /// Initializes variable set for single object refresh
        /// </summary>
        private static void RefreshStepInit(out bool AddTocache)
        {
            CurrentCacheObject = new TrinityCacheObject();
            AddTocache         = true;
            // Start this object as off as unknown type
            CurrentCacheObject.Type = GObjectType.Unknown;

            CurrentCacheObject.Distance = 0f;
            CurrentCacheObject.Radius   = 0f;
            c_ZDiff           = 0f;
            c_ItemDisplayName = "";
            c_ItemLink        = "";
            CurrentCacheObject.InternalName = "";
            c_IgnoreReason                   = "";
            c_IgnoreSubStep                  = "";
            CurrentCacheObject.ACDGuid       = -1;
            CurrentCacheObject.RActorGuid    = -1;
            CurrentCacheObject.DynamicID     = -1;
            CurrentCacheObject.GameBalanceID = -1;
            CurrentCacheObject.ActorSNO      = -1;
            c_ItemLevel             = -1;
            c_GoldStackSize         = -1;
            c_HitPointsPct          = -1;
            c_HitPoints             = -1;
            c_IsOneHandedItem       = false;
            c_IsTwoHandedItem       = false;
            c_unit_IsElite          = false;
            c_unit_IsRare           = false;
            c_unit_IsUnique         = false;
            c_unit_IsMinion         = false;
            c_unit_IsTreasureGoblin = false;
            c_unit_IsAttackable     = false;
            c_unit_HasShieldAffix   = false;
            c_IsEliteRareUnique     = false;
            c_IsObstacle            = false;
            c_HasBeenNavigable      = false;
            c_HasBeenRaycastable    = false;
            c_HasBeenInLoS          = false;
            c_ItemMd5Hash           = string.Empty;
            c_ItemQuality           = ItemQuality.Invalid;
            c_DBItemBaseType        = ItemBaseType.None;
            c_DBItemType            = ItemType.Unknown;
            c_item_tFollowerType    = FollowerType.None;
            c_item_GItemType        = GItemType.Unknown;
            c_unit_MonsterSize      = MonsterSize.Unknown;
            c_diaObject             = null;
            c_CurrentAnimation      = SNOAnim.Invalid;
            c_HasDotDPS             = false;
            c_MonsterAffixes        = MonsterAffixes.None;
            c_IsFacingPlayer        = false;
            c_Rotation        = 0f;
            c_DirectionVector = Vector2.Zero;
        }
Example #3
0
 public void UpdateSNOAnim()
 {
     //Return live data.
     using (ZetaDia.Memory.AcquireFrame())
     {
         try
         {
             _snoAnim = ref_DiaObject.CommonData.CurrentAnimation;
         }
         catch (Exception)
         {
             _snoAnim = SNOAnim.Invalid;
         }
     }
 }
Example #4
0
 public static AvoidancePart GetAvoidancePart(SNOAnim actorAnimation)
 {
     return(LookupPartByAnimation.Contains(actorAnimation) ? LookupPartByAnimation[actorAnimation].FirstOrDefault() : null);
 }
 public AvoidancePart GetPart(SNOAnim actorAnimation)
 {
     return(Parts.FirstOrDefault(p => p.Animation == actorAnimation));
 }
Example #6
0
 /// <summary>
 /// Initializes variable set for single object refresh
 /// </summary>
 private static void RefreshStepInit()
 {
     CurrentCacheObject = new TrinityCacheObject();
     // Start this object as off as unknown type
     CurrentCacheObject.Type = TrinityObjectType.Unknown;
     CurrentCacheObject.GizmoType = GizmoType.None;
     CurrentCacheObject.Distance = 0f;
     CurrentCacheObject.Radius = 0f;
     c_ZDiff = 0f;
     c_ItemDisplayName = "";
     c_ItemLink = "";
     CurrentCacheObject.InternalName = "";
     c_IgnoreReason = "";
     c_IgnoreSubStep = "";
     CurrentCacheObject.ACDGuid = -1;
     CurrentCacheObject.RActorGuid = -1;
     CurrentCacheObject.DynamicID = -1;
     CurrentCacheObject.GameBalanceID = -1;
     CurrentCacheObject.ActorSNO = -1;
     c_ItemLevel = -1;
     c_GoldStackSize = -1;
     c_HitPointsPct = -1;
     c_HitPoints = -1;
     c_IsOneHandedItem = false;
     c_IsTwoHandedItem = false;
     c_unit_IsElite = false;
     c_unit_IsRare = false;
     c_unit_IsUnique = false;
     c_unit_IsMinion = false;
     c_unit_IsTreasureGoblin = false;
     c_unit_IsAttackable = false;
     c_unit_HasShieldAffix = false;
     c_IsEliteRareUnique = false;
     c_IsObstacle = false;
     c_HasBeenNavigable = false;
     c_HasBeenRaycastable = false;
     c_HasBeenInLoS = false;
     c_ItemMd5Hash = string.Empty;
     c_ItemQuality = ItemQuality.Invalid;
     c_DBItemBaseType = ItemBaseType.None;
     c_DBItemType = ItemType.Unknown;
     c_item_tFollowerType = FollowerType.None;
     _cItemTinityItemType = TrinityItemType.Unknown;
     c_unit_MonsterSize = MonsterSize.Unknown;
     c_diaObject = null;
     c_diaGizmo = null;
     c_CurrentAnimation = SNOAnim.Invalid;
     c_HasDotDPS = false;
     c_MonsterAffixes = MonsterAffixes.None;
 }
Example #7
0
 public void UpdateSNOAnim()
 {
     //Return live data.
     using (ZetaDia.Memory.AcquireFrame())
     {
         try
         {
             _snoAnim = ref_DiaObject.CommonData.CurrentAnimation;
         }
         catch (Exception)
         {
             _snoAnim = SNOAnim.Invalid;
         }
     }
 }
Example #8
0
        public override void OnStart()
        {
            if (!ZetaDia.IsInGame || ZetaDia.IsLoadingWorld || !ZetaDia.Me.IsValid)
                return;

            if (InteractRange == 0)
                InteractRange = 10;
            if (InteractAttempts == 0)
                InteractAttempts = 5;
            if (PathPointLimit == 0)
                PathPointLimit = 250;
            if (Timeout == 0)
                Timeout = 180;


            _startingWorldId = ZetaDia.CurrentWorldId;
            _tagStartTime = DateTime.UtcNow;

            if (!String.IsNullOrEmpty(EndAnimation))
            {
                try
                {
                    Enum.TryParse(EndAnimation, out _endAnimation);
                }
                catch
                {
                    _endAnimation = SNOAnim.Invalid;
                }
            }

            Navigator.Clear();

            _verbose = true;

            _completedInteractions = 0;
            _startingWorldId = 0;
            _lastInteract = DateTime.MinValue;
            _startInteractPosition = Vector3.Zero;
            _lastPosition = ZetaDia.Me.Position;
            _lastPositionUpdate = DateTime.UtcNow;

            Logger.Debug("Initialized {0}", Status());
        }