Example #1
0
 /// <summary>
 /// Initializes bots AI
 /// </summary>
 /// <param name="BaseId"></param>
 /// <param name="RoomUserId"></param>
 /// <param name="RoomId"></param>
 /// <param name="RoomUser"></param>
 /// <param name="Room"></param>
 public void Init(int BaseId, RoleplayBot Bot, int RoomUserId, int RoomId, RoomUser RoomUser, Room Room)
 {
     this.BaseId     = BaseId;
     this.RoomUserId = RoomUserId;
     this.RoomId     = RoomId;
     this.RoomUser   = RoomUser;
     this.Room       = Room;
 }
Example #2
0
        /// <summary>
        /// Handles teleporting
        /// </summary>
        /// <param name="Self">Bot's roomuser instance</param>
        /// <param name="Room">Bot's room</param>
        public void HandleTeleporting(RoomUser Self, Room Room)
        {
            if (Self == null || Room == null)
            {
                return;
            }

            RoleplayBot Bot = Self.GetBotRoleplay();

            if (!Bot.Teleported)
            {
                if (Bot.TeleporterEntering == null)
                {
                    Bot.Teleporting = false;
                    return;
                }

                if (Self.Coordinate == Bot.TeleporterEntering.Coordinate)
                {
                    // Lets teleport the bot!
                    Self.GetBotRoleplayAI().GetRoom().SendMessage(new UserRemoveComposer(Self.VirtualId));
                    Bot.Teleported   = true;
                    Bot.X            = Bot.TeleporterExiting.GetX;
                    Bot.Y            = Bot.TeleporterExiting.GetY;
                    Bot.SpawnId      = Bot.TeleporterExiting.RoomId;
                    Bot.LastTeleport = Bot.TeleporterExiting;
                    Room TeleRoom = RoleplayManager.GenerateRoom(Bot.TeleporterExiting.RoomId);
                    RoleplayBotManager.TransportDeployedBot(Self, TeleRoom.Id, true);

                    if (Bot != null && Bot.TimerManager != null && Bot.TimerManager.ActiveTimers != null && Bot.TimerManager.ActiveTimers.ContainsKey("teleport"))
                    {
                        Bot.TimerManager.ActiveTimers["teleport"].EndTimer();

                        if (Bot.UserAttacking != null && Bot.UserAttacking.GetHabbo() != null)
                        {
                            Bot.TimerManager.CreateTimer("attack", this, 10, true, Bot.UserAttacking.GetHabbo().Id);
                        }
                        else
                        {
                            Bot.MoveRandomly();
                        }
                    }
                }
                else
                {
                    // Lets make the bot walk to the teleport!
                    Self.MoveTo(Bot.TeleporterEntering.GetX, Bot.TeleporterEntering.GetY);
                }
            }
            return;
        }
Example #3
0
        /// <summary>
        /// Handles the court trial case
        /// </summary>
        /// <param name="Self">Bot's roomuser instance</param>
        /// <param name="Room">Bot's room</param>
        public void HandleJuryCase(RoomUser Self, Room Room)
        {
            if (Self == null || Room == null)
            {
                return;
            }

            RoleplayBot Bot = Self.GetBotRoleplay();

            if (Bot != null && Bot.TimerManager != null && Bot.TimerManager.ActiveTimers != null && !Bot.TimerManager.ActiveTimers.ContainsKey("jury"))
            {
                Bot.TimerManager.CreateTimer("jury", this, 1000, true);
            }
            return;
        }