コード例 #1
0
ファイル: DrawApi.cs プロジェクト: nopriest/LuaPlugin
 public void Circle(Vector3 center, float radius, Color color, bool filled = false, int alpha = 255)
 {
     Radar3D.DrawCircle(center, radius, color, filled, alpha);
 }
コード例 #2
0
ファイル: DrawApi.cs プロジェクト: nopriest/LuaPlugin
        public void Circle(float x1, float y1, float z1, float radius, Color color, bool filled = false, int alpha = 255)
        {
            var center = new Vector3(x1, y1, z1);

            Radar3D.DrawCircle(center, radius, color, filled, alpha);
        }
コード例 #3
0
    public static void Initialize()
    {
        Main.Log("Initialized");
        _petPulseThread.DoWork += PetThread;
        _petPulseThread.RunWorkerAsync();
        ZEBMHunterSettings.Load();
        _settings = ZEBMHunterSettings.CurrentSetting;
        Talents.InitTalents(_settings.AssignTalents, _settings.UseDefaultTalents, _settings.TalentCodes);

        // Set Steady Shot delay
        if (_settings.RangedWeaponSpeed > 2000)
        {
            _steadyShotSleep = _settings.RangedWeaponSpeed - 1600;
        }
        else
        {
            _steadyShotSleep = 500;
        }
        Main.LogDebug("Steady Shot delay set to : " + _steadyShotSleep.ToString() + "ms");

        FightEvents.OnFightStart += (WoWUnit unit, CancelEventArgs cancelable) =>
        {
            if (ObjectManager.Target.GetDistance >= 13f && !AutoShot.IsSpellUsable && !_isBackingUp)
            {
                _canOnlyMelee = true;
            }
            else
            {
                _canOnlyMelee = false;
            }
        };

        FightEvents.OnFightEnd += (ulong guid) =>
        {
            _isBackingUp       = false;
            _backupAttempts    = 0;
            _autoshotRepeating = false;
            _canOnlyMelee      = false;
        };

        Radar3D.OnDrawEvent += () =>
        {
            if (ObjectManager.Me.TargetObject != null)
            {
                Radar3D.DrawCircle(ToolBox.BackofVector3(Me.Position, Me, 20f), 1f, Color.Cyan);
            }
        };

        FightEvents.OnFightLoop += (WoWUnit unit, CancelEventArgs cancelable) =>
        {
            if (ObjectManager.Target.GetDistance < 13f && ObjectManager.Target.IsTargetingMyPet && _backupAttempts < _settings.MaxBackupAttempts &&
                !MovementManager.InMovement && Me.IsAlive && !ObjectManager.Pet.HaveBuff("Pacifying Dust") && !_canOnlyMelee &&
                !ObjectManager.Pet.IsStunned && !_isBackingUp && !Me.IsCast && _settings.BackupFromMelee)
            {
                _isBackingUp = true;
                var pos = 1;
                if (ObjectManager.Me.IsAlive && ObjectManager.Target.IsAlive && pos == 1)
                {
                    Vector3 position = ToolBox.BackofVector3(Me.Position, Me, 20f);
                    MovementManager.Go(PathFinder.FindPath(position), false);

                    while (MovementManager.InMovement && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause &&
                           ObjectManager.Target.GetDistance < 13f && _backupAttempts < _settings.MaxBackupAttempts && !_canOnlyMelee)
                    {
                        // Wait follow path
                        Thread.Sleep(2000);
                        pos = 0;
                        _backupAttempts++;
                    }
                }
                ReenableAutoshot();
                Main.LogDebug("Backup attempt : " + _backupAttempts);
                _isBackingUp = false;
                if (_backupAttempts >= _settings.MaxBackupAttempts)
                {
                    _canOnlyMelee = true;
                }
            }
        };

        Rotation();
    }