Exemplo n.º 1
0
        public override void OnTimerTick()
        {
            if (this.SpeechTimer <= 0)
            {
                if (base.GetBotData() != null && base.GetBotData().RandomSpeech.Count > 0)
                {
                    RandomSpeech Speech = base.GetBotData().GetRandomSpeech();
                    GetRoomUser().Chat(null, Speech.Message, Speech.Shout);
                }
                this.SpeechTimer = PhoenixEnvironment.GetRandomNumber(0, 150);
            }
            else
            {
                this.SpeechTimer--;
            }

            if (this.ActionTimer <= 0)
            {
                int randomX = PhoenixEnvironment.GetRandomNumber(0, base.GetRoom().Model.MapSizeX);
                int randomY = PhoenixEnvironment.GetRandomNumber(0, base.GetRoom().Model.MapSizeY);
                base.GetRoomUser().MoveTo(randomX, randomY);
                this.ActionTimer = PhoenixEnvironment.GetRandomNumber(0, 30);
            }
            else
            {
                this.ActionTimer--;
            }
        }
Exemplo n.º 2
0
        public override void OnTimerTick()
        {
            if (this.SpeechTimer <= 0)
            {
                if (base.GetBotData().RandomSpeech.Count > 0)
                {
                    RandomSpeech Speech = base.GetBotData().GetRandomSpeech();
                    base.GetRoomUser().Chat(null, Speech.Message, Speech.Shout);
                }
                this.SpeechTimer = PhoenixEnvironment.GetRandomNumber(10, 300);
            }
            else
            {
                this.SpeechTimer--;
            }

            if (this.ActionTimer <= 0)
            {
                int randomX = 0;
                int randomY = 0;

                switch (GetBotData().WalkingMode.ToLower())
                {
                default:
                case "stand":
                    // (8) Why is my life so boring?
                    break;

                case "freeroam":
                    randomX = PhoenixEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeX);
                    randomY = PhoenixEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeY);
                    GetRoomUser().MoveTo(randomX, randomY);
                    break;

                case "specified_range":
                    randomX = PhoenixEnvironment.GetRandomNumber(GetBotData().minX, GetBotData().maxX);
                    randomY = PhoenixEnvironment.GetRandomNumber(GetBotData().minY, GetBotData().maxY);
                    GetRoomUser().MoveTo(randomX, randomY);
                    break;
                }
                ActionTimer = PhoenixEnvironment.GetRandomNumber(1, 30);
            }
            else
            {
                this.ActionTimer--;
            }
        }