Ejemplo n.º 1
0
        /// <summary>
        /// sets the character's active rotation.
        /// Print the help located in the specific rotation
        /// </summary>
        /// <param name="rb">an instance of the rotationbase</param>
        private void SetActiveRotation(RotationBase rb)
        {
            CLULogger.Log(" Greetings, level {0} user!", Me.Level);
            CLULogger.Log(" I am CLU.");
            CLULogger.Log(" I will create the perfect system for you.");
            CLULogger.Log(" I suggest we use the " + rb.Name + " rotation. Revision: " + rb.Revision);
            CLULogger.Log(" as I know you have " + rb.KeySpell);
            CLULogger.Log(" BotBase: {0}  ({1})", BotManager.Current.Name, BotChecker.SupportedBotBase() ? "Supported" : "Currently Not Supported");
            CLULogger.Log(rb.Help);
            CLULogger.Log(" You can Access CLU's Settings by clicking the CLASS CONFIG button");
            CLULogger.Log(" Let's execute the plan!");

            this._rotationBase = rb;

            this.PulseEvent  = null;
            this.PulseEvent += rb.OnPulse;

            // Check for Instancebuddy and warn user that healing is not supported.
            if (BotChecker.BotBaseInUse("Instancebuddy") && this.ActiveRotation.GetType().BaseType == typeof(HealerRotationBase))
            {
                CLULogger.Log(" [BotChecker] Instancebuddy Detected. *UNABLE TO HEAL WITH CLU*");
                StopBot("You cannot use CLU with InstanceBuddy as Healer");
            }

            if (this.ActiveRotation.GetType().BaseType == typeof(HealerRotationBase))
            {
                CLULogger.TroubleshootLog(" [HealingChecker] HealerRotationBase Detected. *Activating Automatic HealableUnit refresh*");
                IsHealerRotationActive = true;
            }
        }
Ejemplo n.º 2
0
 public void BotBaseChange(object o)
 {
     BotChecker.Initialize();
 }
Ejemplo n.º 3
0
        public override void Initialize()
        {
            CLULogger.TroubleshootLog("Attatching BotEvents");
            BotEvents.OnBotStarted        += CombatLogEvents.Instance.CombatLogEventsOnStarted;
            BotEvents.OnBotStopped        += CombatLogEvents.Instance.CombatLogEventsOnStopped;
            BotEvents.OnBotChanged        += CombatLogEvents.Instance.BotBaseChange;
            BotEvents.Player.OnMapChanged += CombatLogEvents.Instance.Player_OnMapChanged;
            RoutineManager.Reloaded       += RoutineManagerReloaded;

            ///////////////////////////////////////////////////////////////////
            // Start non invasive user information
            ///////////////////////////////////////////////////////////////////
            CLULogger.TroubleshootLog("Character level: {0}", Me.Level);
            CLULogger.TroubleshootLog("Character Faction: {0}", Me.IsAlliance ? "Alliance" : "Horde");
            CLULogger.TroubleshootLog("Character Race: {0}", Me.Race);
            CLULogger.TroubleshootLog("Character Mapname: {0}", Me.MapName);
            CLULogger.TroubleshootLog("GroupType: {0}", GroupType.ToString());
            CLULogger.TroubleshootLog("LocationContext: {0}", LocationContext.ToString());

            // Talents
            CLULogger.TroubleshootLog("Retrieving Talent Spec");
            try
            {
                TalentManager.Update();
            }
            catch (Exception e)
            {
                StopBot(e.ToString());
            }
            CLULogger.TroubleshootLog(" Character Current Build: {0}", TalentManager.CurrentSpec.ToString());

            // Intialize Behaviors....TODO: Change this ?
            if (_combatBehavior == null)
            {
                _combatBehavior = new PrioritySelector();
            }

            if (_combatBuffBehavior == null)
            {
                _combatBuffBehavior = new PrioritySelector();
            }

            if (_preCombatBuffBehavior == null)
            {
                _preCombatBuffBehavior = new PrioritySelector();
            }

            if (_pullBehavior == null)
            {
                _pullBehavior = new PrioritySelector();
            }

            if (_restBehavior == null)
            {
                _restBehavior = new PrioritySelector();
            }

            // Behaviors
            if (!CreateBehaviors())
            {
                return;
            }
            CLULogger.TroubleshootLog(" Behaviors created!");

            // Racials
            CLULogger.TroubleshootLog("Retrieving Racial Abilities");
            foreach (WoWSpell racial in Racials.CurrentRacials)
            {
                CLULogger.TroubleshootLog(" Character Racial Abilitie: {0} ", racial.Name);
            }
            CLULogger.TroubleshootLog(" {0}", Me.IsInInstance ? "Character is currently in an Instance" : "Character seems to be outside an Instance");
            CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsArena ? "Character is currently in an Arena" : "Character seems to be outside an Arena");
            CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsBattleground ? "Character is currently in a Battleground  " : "Character seems to be outside a Battleground");
            CLULogger.TroubleshootLog(" {0}", StyxWoW.Me.CurrentMap.IsDungeon ? "Character is currently in a Dungeon  " : "Character seems to be outside a Dungeon");
            CLULogger.TroubleshootLog("Character HB Pull Range: {0}", Targeting.PullDistance);
            ///////////////////////////////////////////////////////////////////
            // END non invasive user information
            ///////////////////////////////////////////////////////////////////

            // Create the new List of HealableUnit type.
            CLULogger.TroubleshootLog("Initializing list of HealableUnits");
            switch (CLUSettings.Instance.SelectedHealingAquisition)
            {
            case HealingAquisitionMethod.Proximity:
                HealableUnit.HealableUnitsByProximity();
                break;

            case HealingAquisitionMethod.RaidParty:
                HealableUnit.HealableUnitsByPartyorRaid();
                break;
            }
            CLULogger.TroubleshootLog(" {0}", IsHealerRotationActive ? "Healer Base Detected" : "No Healer Base Detectected");

            // Initialize Botchecks
            CLULogger.TroubleshootLog("Initializing Bot Checker");
            BotChecker.Initialize();

            CLULogger.TroubleshootLog("Initializing Sound Player");
            SoundManager.Initialize();

            CLULogger.TroubleshootLog("Initializing Keybinds");
            this._clupulsetimer.Interval  = 1000;                 // 1second
            this._clupulsetimer.Elapsed  += ClupulsetimerElapsed; // Attatch
            this._clupulsetimer.Enabled   = true;                 // Enable
            this._clupulsetimer.AutoReset = true;                 // To keep raising the Elapsed event

            GC.KeepAlive(this._clupulsetimer);

            //TroubleshootLog("Initializing DpsMeter");
            //DpsMeter.Initialize();
            CLULogger.TroubleshootLog("Initialization Complete");
        }