Пример #1
0
        public override void Initialize()
        {
            RegisterHotkeys();
            LuaCore.PopulateSecondryStats();
            TalentManager.Init();
            TalentManager.Update();
            UpdateContext();
            // Do this now, so we ensure we update our context when needed.
            BotEvents.Player.OnMapChanged += e => UpdateContext();

            OnWoWContextChanged += (orig, ne) =>
            {
                Logging.Write("Context changed, re-creating behaviors");
                AssignBehaviors();
                Spell.GcdInitialize();
                Lists.BossList.Init();
            };
            Spell.GcdInitialize();
            Dispelling.Init();
            //testing cached units
            //CachedUnits.Initialize();
            EventHandlers.Init();
            Lists.BossList.Init();
            Instance.AssignBehaviors();
            Logging.Write("Initialization Completed");
        }
Пример #2
0
 public ActionResult UpdateTalent(Talent talent)
 {
     talentManager.Update(talent);
     return(RedirectToAction("Index"));
 }
Пример #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");
        }