Пример #1
0
        protected MobKillInfo GetCurrentInActive()
        {
            List <MobKillInfo> mobQueue = this.MobQueue;
            UOCharacter        lastCh   = new UOCharacter(Serial.Invalid);

            MobKillInfo current = null;
            MobKillInfo last    = null;

            int startIndex = 0;

            for (int i = 0; i < mobQueue.Count; i++)
            {
                MobKillInfo k = mobQueue[i];
                if (lastInactiveMob.IsValid && lastInactiveMob == k.Mob.Serial)
                {
                    if (i < mobQueue.Count - 1)
                    {
                        startIndex      = i + 1;
                        lastInactiveMob = Serial.Invalid;
                    }
                    else
                    {
                        last = new MobKillInfo(new UOCharacter(lastInactiveMob), ResetTimerDefault);
                    }
                }

                if (!k.Enemy.ExistCust())
                {
                    current = mobQueue[i];
                    break;
                }
            }

            if (current == null)
            {
                for (int i = startIndex; i < mobQueue.Count; i++)
                {
                    MobKillInfo k = mobQueue[i];
                    if (!k.Enemy.ExistCust())
                    {
                        current = k;
                        break;
                    }
                }
            }

            if (current == null && last != null && last.NeedCommand())
            {
                current = last;
            }

            if (current != null)
            {
                lastInactiveMob = current.Mob.Serial;
            }

            return(current);
        }
Пример #2
0
        public void MobComeInActive()
        {
            MobKillInfo current = GetCurrentInActive();

            if (current != null && current.Mob.ExistCust())
            {
                UO.Say(Game.Val_GreenBlue, current.Mob.Name + " come");
            }
            else
            {
                MobCome();
            }
        }
Пример #3
0
        public void MobKill(int resetTimer)
        {
            ResetTimerDefault = resetTimer;
            Game.CurrentGame.CurrentPlayer.EnsureWarMode();

            List <MobKillInfo> mobQueue = this.MobQueue;

            MobKillInfo current = null;
            MobKillInfo last    = null;

            int startIndex = 0;

            for (int i = 0; i < mobQueue.Count; i++)
            {
                MobKillInfo k = mobQueue[i];
                if (lastMob.IsValid && lastMob == k.Mob.Serial)
                {
                    //Game.PrintMessage("startIndex " + startIndex + " / " + Game.RenameSufix(k.Mob.Name), Game.Val_GreenBlue);
                    if (i < mobQueue.Count - 1)
                    {
                        startIndex = i + 1;
                        lastMob    = Serial.Invalid;
                    }
                    else
                    {
                        last = k;//new MobKillInfo(new UOCharacter(lastMob), resetTimer);
                    }
                }

                if (k.CommandCount == 0 && k.Mob.Serial != k.GetEnemyOrDefault().Serial)
                {
                    //Game.PrintMessage("New FOUND " + k.Mob.Name + " / " + i, Game.Val_GreenBlue);
                    current = mobQueue[i];
                    break;
                }
            }

            if (current == null)
            {
                for (int i = startIndex; i < mobQueue.Count; i++)
                {
                    MobKillInfo k = mobQueue[i];
                    if (k.NeedCommand())
                    {
                        //Game.PrintMessage("New OLD " + k.Mob.Name + " / " + i, Game.Val_GreenBlue);
                        current = k;
                        break;
                    }
                }
            }

            if (current == null && last != null && last.NeedCommand())
            {
                current = last;
            }

            //Game.PrintMessage("Mobs [" + mobQueue.Count + "]", Game.Val_GreenBlue);

            string  command  = null;
            UOColor sayColor = Game.Val_LightGreen;

            UOCharacter finalEnemy = new UOCharacter(Serial.Invalid);

            if (current != null)
            {
                command = current.Mob.Name + " kill";
                current.CommandCount++;
                current.LastCommandTime = DateTime.Now;
                sayColor = Game.GetAlieColorByHits(current.Mob.Serial);
                current.Mob.PrintMessage(Game.RenameSufix(current.Mob.Name) + (!String.IsNullOrEmpty(current.CommandReasonCode) && Game.Debug ? " [" + current.CommandReasonCode + "]" : ""), sayColor);//zatim pro debug

                if (!current.Enemy.ExistCust())
                {
                    current.Enemy = current.GetEnemy();
                }

                finalEnemy = current.Enemy;

                lastMob = current.Mob.Serial;
            }
            else if (mobQueue.Count == 0)
            {
                command = "all kill";
            }

            if (!String.IsNullOrEmpty(command) && finalEnemy.ExistCust() && finalEnemy.Distance < 22)
            {
                Targeting.ResetTarget();
                Game.RunScriptCheck(250);
                Game.Wait(50);
                UO.WaitTargetObject(finalEnemy);

                UO.Say(sayColor, command);
            }

            if (finalEnemy.ExistCust())
            {
                if (finalEnemy.Hits < 0)
                {
                    finalEnemy.RequestStatus(150);
                }



                finalEnemy.PrintMessage(String.Format(">>{0}/{1}<<", finalEnemy.Hits, finalEnemy.MaxHits), Game.GetEnemyColorByHits(finalEnemy.Serial));
                new StatusBar().Show(finalEnemy.Serial);
            }
        }