示例#1
0
        /// <summary>
        /// Handler for chat log parser
        /// </summary>
        public override void ParseChat(AutoKillerScript.clsAutoKillerScript.AutokillerRegExEventParams e)
        {
            string logline = e.Logline;

//			_ak.AddString(7, "You prepare your shot");
//			_ak.AddString(8, "You miss");
//			_ak.AddString(9, "You move and interrupt");
//			_ak.AddString(10, "You shoot");
            if (logline.IndexOf("You prepare to perform") > -1)
            {
                playerSwinging = true;
            }
            if (logline.IndexOf("You miss") > -1 ||
                logline.IndexOf("You hit ") > -1 ||
                logline.IndexOf("You attack ") > -1 ||
                logline.IndexOf("You fumble ") > -1 ||
                logline.IndexOf("You move and interrupt") > -1 ||
                logline.IndexOf("You shoot") > -1
                )
            {
                playerShooting = false;
                playerSwinging = false;
            }

            //Did we block, and if so is there a block style to use?
            if (logline.IndexOf("you block the blow") > -1 &&
                profile.GetString("Scout.SlashBlockQ") != "" &&
                profile.GetString("Scout.SlashBlockKey") != "")
            {
                nextMelee = eMeleeFights.Blocked;
            }


            base.ParseChat(e);
        }
示例#2
0
        public override void DoMeleeFight()
        {
            if (_ak.TargetIndex < 1 || _ak.get_IsMobDead(_ak.TargetIndex))
            {
                AddMessage("Target Dead");
                // Target is lost, check for agro
                Action = BotAction.CheckAgro;

                ActionQueue.Clear();
                ActionQueue.Enqueue(BotAction.Loot);
                ActionQueue.Enqueue(BotAction.CheckAgro);

                playerShooting = false;
                playerSwinging = false;
                NumKilled++;
                AddMessage(string.Format("==> Number Killed {0} <==", NumKilled));
                nextRanged    = eRangedFights.Crit;
                nCountFight   = 0;
                currentTarget = 0;
                Thread.Sleep(500);

                //select bow
                AddMessage("selecting bow");
                UseQbar(profile.GetString("Scout.FightRangedBowQ"), profile.GetString("Scout.FightRangedBowKey"));

                return;
            }

            //just in case
            _ak.StopRunning();

            Action = BotAction.CheckFlee;
            ActionQueue.Clear();
            ActionQueue.Enqueue(BotAction.MeleeFight);

            //are we still doing the last style?
            if (playerSwinging || !cooldowns.IsReady("FightDelay"))
            {
                return;
            }

            //did we start with a melee range fight so currentTarget never got set?
            if (currentTarget < 1 && _ak.TargetIndex > 0)
            {
                //switch to melee weapon
                UseQbar(profile.GetString("Scout.FightMeleeWeaponQ"), profile.GetString("Scout.FightMeleeWeaponKey"));
                currentTarget = _ak.TargetIndex;
//				playerShooting = false;
//				playerSwinging = false;
            }

            //do repeated melee range spell
            if (_ak.TargetIndex > 0)
            {
                AddMessage("Close Range Style " + nextMelee.ToString());

                switch (nextMelee)
                {
                case eMeleeFights.Normal:
                    UseQbar(profile.GetString("Scout.SlashNormalQ"), profile.GetString("Scout.SlashNormalKey"));
                    if (profile.GetString("Scout.SlashNormalChainQ") != "" &&
                        profile.GetString("Scout.SlashNormalChainKey") != "")
                    {
                        nextMelee = eMeleeFights.NormalChain;
                    }
                    break;

                case eMeleeFights.NormalChain:
                    UseQbar(profile.GetString("Scout.SlashNormalChainQ"), profile.GetString("Scout.SlashNormalChainKey"));
                    //done with chain, back to normal fight
                    nextMelee = eMeleeFights.Normal;
                    break;

                case eMeleeFights.Blocked:
                    UseQbar(profile.GetString("Scout.SlashBlockQ"), profile.GetString("Scout.SlashBlockKey"));
                    //if user has set up a chain for blocked styles, do it next time
                    if (profile.GetString("Scout.SlashBlockChainQ") != "" &&
                        profile.GetString("Scout.SlashBlockChainKey") != "")
                    {
                        nextMelee = eMeleeFights.NormalChain;
                    }
                    else
                    {
                        nextMelee = eMeleeFights.Normal;
                    }
                    break;

                case eMeleeFights.BlockedChain:
                    UseQbar(profile.GetString("Scout.SlashBlockChainQ"), profile.GetString("Scout.SlashBlockChainKey"));
                    //done with chain, back to normal fight
                    nextMelee = eMeleeFights.Normal;
                    break;
                }
                //make sure we give the game time to send the chat string "you prepare"
                cooldowns.SetTime("FightDelay");
                playerSwinging = true;

                nCountFight++;
            }
        }