Exemple #1
0
        internal override void OnTimerTick()
        {
            if (SpeechTimer <= 0)
            {
                if (GetBotData() != null)
                {
                    if (GetBotData().RandomSpeech.Count > 0)
                    {
                        RandomSpeech Speech = GetBotData().GetRandomSpeech();
                        GetRoomUser().Chat(null, Speech.Message, Speech.Shout);
                    }
                }

                SpeechTimer = FirewindEnvironment.GetRandomNumber(0, 150);
            }
            else
            {
                SpeechTimer--;
            }

            if (ActionTimer <= 0)
            {
                Point nextCoord = GetRoom().GetGameMap().getRandomWalkableSquare();
                //int randomX = FirewindEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeX);
                //int randomY = FirewindEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeY);

                GetRoomUser().MoveTo(nextCoord.X, nextCoord.Y);

                ActionTimer = FirewindEnvironment.GetRandomNumber(0, 30);
            }
            else
            {
                ActionTimer--;
            }
        }
Exemple #2
0
        internal override void OnTimerTick()
        {
            if (GetBotData() == null)
            {
                return;
            }
            if (SpeechTimer <= 0)
            {
                if (GetBotData().RandomSpeech.Count > 0)
                {
                    RandomSpeech Speech = GetBotData().GetRandomSpeech();
                    GetRoomUser().Chat(null, Speech.Message, Speech.Shout);
                }

                SpeechTimer = FirewindEnvironment.GetRandomNumber(10, 300);
            }
            else
            {
                SpeechTimer--;
            }

            if (ActionTimer <= 0)
            {
                switch (GetBotData().WalkingMode.ToLower())
                {
                default:
                case "stand":

                    // (8) Why is my life so boring?

                    break;

                case "freeroam":
                    Point nextCoord = GetRoom().GetGameMap().getRandomWalkableSquare();
                    GetRoomUser().MoveTo(nextCoord.X, nextCoord.Y);

                    break;

                case "specified_range":
                    Point nextCoord2 = GetRoom().GetGameMap().getRandomWalkableSquare();
                    GetRoomUser().MoveTo(nextCoord2.X, nextCoord2.Y);

                    break;
                }

                ActionTimer = FirewindEnvironment.GetRandomNumber(1, 30);
            }
            else
            {
                ActionTimer--;
            }
        }