示例#1
0
            /// <summary>
            /// Updates player features
            /// </summary>
            public static void Update()
            {
                if (Invincible)
                {
                    Function.Call(Hash.SET_PLAYER_INVINCIBLE, Game.Player.Handle, true);
                }

                if (InfiniteStamina)
                {
                    Function.Call(Hash.RESTORE_PLAYER_STAMINA, Game.Player.Handle, 100f);
                }

                if (InfiniteAbility)
                {
                    Function.Call((Hash)GlobalConst.CustomHash.RESTORE_SPECIAL_ABILITY, Game.Player.Handle, -1, false);
                }

                if (SuperJump)
                {
                    Function.Call(Hash.SET_SUPER_JUMP_THIS_FRAME, Game.Player.Handle);
                }

                if (Noiseless)
                {
                    Function.Call(Hash.SET_PLAYER_NOISE_MULTIPLIER, Game.Player.Handle, NOISELESS_MULTIPLIER);
                    Function.Call(Hash.SET_PLAYER_SNEAKING_NOISE_MULTIPLIER, Game.Player.Handle, NOISELESS_MULTIPLIER);
                }

                Wanted.UpdateEveryoneIgnored();
                Wanted.UpdateNeverWanted();
            }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SonarrClient"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        /// <param name="apiKey">The API key.</param>
        /// <param name="urlBase">The URL base.</param>
        /// <param name="useSsl">if set to <c>true</c> [use SSL].</param>
        public SonarrClient(string host, int port, string apiKey, [Optional] string urlBase, [Optional] bool useSsl)
        {
            // Initialize properties
            Host    = host;
            Port    = port;
            ApiKey  = apiKey;
            UrlBase = urlBase;
            UseSsl  = useSsl;

            // Set API URL
            ApiUrl = $"http{(UseSsl ? "s" : "")}://{Host}:{Port}{("/" + UrlBase ?? "")}/api";

            // Initialize endpoints
            Calendar          = new Calendar(this);
            Command           = new Command(this);
            Diskspace         = new Diskspace(this);
            Episode           = new Episode(this);
            EpisodeFile       = new EpisodeFile(this);
            History           = new History(this);
            Wanted            = new Wanted(this);
            Queue             = new Queue(this);
            Parse             = new Parse(this);
            Profile           = new Profile(this);
            Release           = new Release(this);
            ReleasePush       = new ReleasePush(this);
            Rootfolder        = new Rootfolder(this);
            Series            = new Series(this);
            SeriesLookup      = new SeriesLookup(this);
            SystemStatus      = new SystemStatus(this);
            SystemBackup      = new SystemBackup(this);
            Log               = new Log(this);
            QualityDefinition = new QualityDefinition(this);
        }
示例#3
0
        /// <summary>
        /// Добавляет данные нового игрока
        /// </summary>
        public void Add(Account account)
        {
            var playerInfo = new gta_mp_data.Entity.PlayerInfo {
                AccountId = account.Id, Health = 100, Satiety = 100
            };
            var additionalInfo = new PlayerAdditionalInfo {
                AccountId = account.Id
            };
            var driverInfo = new DriverInfo {
                AccountId = account.Id
            };
            var wantedInfo = new Wanted {
                AccountId = account.Id
            };
            var settings = new Settings {
                AccountId = account.Id
            };
            var inventory = new InventoryItem {
                OwnerId = account.Id, Name = "Деньги", Type = InventoryType.Money, Count = 100, CountInHouse = 0
            };

            using (var db = new Database()) {
                db.Insert(playerInfo);
                db.Insert(additionalInfo);
                db.Insert(driverInfo);
                db.Insert(wantedInfo);
                db.Insert(settings);
                db.Insert(inventory);
            }
        }
示例#4
0
        /// <summary>
        /// Checks if the user is wanted
        /// </summary>
        /// <param name="Client"></param>
        public void WantedCheck(GameClient Client, object[] Params)
        {
            if (!Client.GetRoleplay().IsWanted)
            {
                return;
            }

            if (RoleplayManager.WantedList.ContainsKey(Client.GetHabbo().Id))
            {
                return;
            }

            Room   Room   = (Room)Params[0];
            string RoomId = Room.Id.ToString() != "0" ? Room.Id.ToString() : "Unknown";

            if (!RoleplayManager.WantedList.ContainsKey(Client.GetHabbo().Id))
            {
                Wanted Wanted = new Wanted(Convert.ToUInt32(Client.GetHabbo().Id), RoomId, Client.GetRoleplay().WantedLevel);
                RoleplayManager.WantedList.TryAdd(Client.GetHabbo().Id, Wanted);
            }

            if (!Client.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("wanted"))
            {
                Client.GetRoleplay().TimerManager.CreateTimer("wanted", 1000, false);
            }
        }
示例#5
0
 void Start()
 {
     Anim      = GetComponent <Animator>();
     Want      = GetComponent <Wanted>();
     CG        = TargetImage.GetComponent <ChangeProfile>();
     GM        = GameObject.Find("GameManager").GetComponent <GameManager>();
     AudioSour = GameObject.Find("GameManager").GetComponent <AudioSource>();
 }
示例#6
0
            static void Main()
            {
                Wanted <string> wantedString = new Wanted <string>("String");
                Wanted <int>    wantedInt    = new Wanted <int>(52273);
                Wanted <double> wantedDouble = new Wanted <double>(52.273);


                Console.WriteLine(wantedString.value);
                Console.WriteLine(wantedInt.value);
                Console.WriteLine(wantedDouble.value);
            }
        /// <summary>
        /// Initializes a new instance of the <see cref="RadarrClient" /> class.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        /// <param name="apiKey">The API key.</param>
        /// <param name="urlBase">The URL base.</param>
        /// <param name="useSsl">if set to <c>true</c> [use SSL].</param>
        public RadarrClient(string host, int port, string apiKey, [Optional] string urlBase, [Optional] bool useSsl)
        {
            // Initialize properties
            Host    = host;
            Port    = port;
            ApiKey  = apiKey;
            UrlBase = urlBase;
            UseSsl  = useSsl;

            // Set API URL
            var sb = new StringBuilder();

            sb.Append("http");
            if (UseSsl)
            {
                sb.Append("s");
            }
            sb.Append($"://{host}:{Port}");
            if (UrlBase != null)
            {
                sb.Append($"/{UrlBase}");
            }
            sb.Append("/api");
            ApiUrl = sb.ToString();

            // Initialize endpoints
            Calendar          = new Calendar(this);
            Command           = new Command(this);
            Diskspace         = new Diskspace(this);
            History           = new History(this);
            Movie             = new Movie(this);
            SystemStatus      = new SystemStatus(this);
            Profile           = new Profile(this);
            Wanted            = new Wanted(this);
            Log               = new Log(this);
            Queue             = new Queue(this);
            Release           = new Release(this);
            QualityDefinition = new QualityDefinition(this);
            Indexer           = new Indexer(this);
            Restriction       = new Restriction(this);
            Blacklist         = new Blacklist(this);
            Notification      = new Notification(this);
            RootFolder        = new RootFolder(this);
            Config            = new Config(this);
            ExtraFile         = new ExtraFile(this);
            CustomFormat      = new CustomFormat(this);
        }
示例#8
0
            /// <summary>
            /// Initialize player features
            /// </summary>
            public static void Init()
            {
                Debug.Log("Player.Init");
                Debug.Log("Player.Init.SetInvincible");
                SetInvincible(MenuStorage.MenuItems.Player.Invincible);
                Debug.Log("Player.Init.SetInfiniteAbility");
                SetInfiniteAbility(MenuStorage.MenuItems.Player.InfiniteAbility);
                Debug.Log("Player.Init.SetSuperJump");
                SetSuperJump(MenuStorage.MenuItems.Player.SuperJump);
                Debug.Log("Player.Init.SetNoiseless");
                SetNoiseless(MenuStorage.MenuItems.Player.Noiseless);

                Debug.Log("Player.Init.Wanted.SetNeverWanted");
                Wanted.SetNeverWanted(MenuStorage.MenuItems.Player.Wanted.NeverWanted);
                Debug.Log("Player.Init.Wanted.SetEveryoneIgonred");
                Wanted.SetEveryoneIgonred(MenuStorage.MenuItems.Player.Wanted.EveryoneIgnored);
            }
示例#9
0
        public IHttpActionResult PutWanted(WantedModel wantedModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var wantedExist = db.Wanteds.FirstOrDefault(w => w.Id == wantedModel.Id);
                if (wantedExist != null)
                {
                    wantedExist.WantedFrom  = Common.CreatePoint(wantedModel.Latitude, wantedModel.Longitude);
                    wantedExist.Description = wantedModel.Description;
                    wantedExist.Name        = wantedModel.Name;
                    db.SaveChanges();
                }
                else
                {
                    var wanted = new Wanted();
                    wanted.Id          = Guid.NewGuid();
                    wanted.IsActive    = true;
                    wanted.CreatedDate = DateTime.UtcNow;
                    wanted.WantedFrom  = Common.CreatePoint(wantedModel.Latitude, wantedModel.Longitude);
                    wanted.Description = wantedModel.Description;
                    wanted.Name        = wantedModel.Name;
                    wanted.OrgUserId   = Guid.Parse("5F6C19ED-2B71-4F8B-8E45-77372C4DA40A");
                    wanted.Contact     = wantedModel.Contact;
                    db.Wanteds.Add(wanted);
                    db.SaveChanges();
                    Common.Push(wantedModel.Longitude, wantedModel.Latitude, 10000, wantedModel.Name + "is wanted.", wantedModel.Id, 3);
                }
                db.SaveChanges();
                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
示例#10
0
        public void ExecuteBot(GameClient Session, RoomUser Bot, Room Room)
        {
            if (!Bot.GetBotRoleplay().Jailed)
            {
                Session.SendWhisper("Desculpe, mas " + Bot.GetBotRoleplay().Name + " não está preso!", 1);
                return;
            }

            double Distance   = RoleplayManager.GetDistanceBetweenPoints2D(Session.GetRoomUser().Coordinate, Bot.Coordinate);
            Wanted Wanted     = RoleplayManager.WantedList.ContainsKey(Bot.GetBotRoleplay().Id) ? RoleplayManager.WantedList[Bot.GetBotRoleplay().Id] : null;
            int    WantedTime = Wanted == null ? 5 : Wanted.WantedLevel * 5;

            if (Distance <= 1)
            {
                // cba rn
            }
            else
            {
                Session.SendWhisper("Você deve se aproximar de " + Bot.GetBotRoleplay().Name + "para prendê-lo!", 1);
                return;
            }
        }
示例#11
0
        public async Task <IActionResult> DidYouMean(string query)
        {
            int size = 5;

            if (String.IsNullOrEmpty(query))
            {
                return(Ok(new List <string>()));
            }
            if (size == 0)
            {
                return(Ok(new List <string>()));
            }

            try {
                var result = await mediator.Send(new CalculateDistanceCommand(query));

                IEnumerable <KeyValuePair <string, int> > Wanted;
                if (query.Length > 4)
                {
                    Wanted = result.Where(x => x.Value == 2);
                }
                else
                {
                    Wanted = result.Where(x => x.Value == 1);
                }

                var final = new List <string>();
                for (int i = 0; i < size; i++)
                {
                    final.Add(Wanted.ElementAt(i).Key);
                }

                return(Ok(final));
            } catch (Exception) {
                return(StatusCode(500));
            }
        }
示例#12
0
        public void Execute(GameClient Session, Rooms.Room Room, string[] Params)
        {
            #region Variables
            int    WantedLevel    = 1;
            int    NewWantedLevel = 1;
            bool   OnProbation    = false;
            Wanted NewWanted;
            #endregion

            #region Conditions
            if (Params.Length != 3)
            {
                Session.SendWhisper("Digite o nome do cidadão e a quantidade de estrelas (1-6)", 1);
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null || TargetClient.GetHabbo() == null || TargetClient.GetRoleplay() == null)
            {
                Session.SendWhisper("Ocorreu um erro ao tentar encontrar esse usuário, talvez ele esteja offline.", 1);
                return;
            }

            if (!GroupManager.HasJobCommand(Session, "law"))
            {
                Session.SendWhisper("Apenas um policial pode usar esse comando!", 1);
                return;
            }

            if (!Session.GetRoleplay().IsWorking)
            {
                Session.SendWhisper("Você deve estar trabalhando para usar esse comando!", 1);
                return;
            }

            if (TargetClient.GetRoleplay().Jailbroken)
            {
                Session.SendWhisper("É óbvio que esta pessoa já está livre.", 1);
                return;
            }

            if (TargetClient.GetRoleplay().IsJailed)
            {
                Session.SendWhisper("Você não pode adicionar estrelas em alguém que já está preso!", 1);
                return;
            }

            if (TargetClient.GetRoomUser() != null)
            {
                if (TargetClient.GetRoomUser().IsAsleep)
                {
                    Session.SendWhisper("Você não pode adicionar estrelas em alguém que está ausente!", 1);
                    return;
                }
            }
            #endregion

            #region Execute
            if (int.TryParse(Params[2], out WantedLevel))
            {
                if (WantedLevel > 6 || WantedLevel == 0)
                {
                    Session.SendWhisper("Por favor, insira um nível desejado entre 1 a 6!", 1);
                    return;
                }

                string RoomId = TargetClient.GetHabbo().CurrentRoomId.ToString() != "0" ? TargetClient.GetHabbo().CurrentRoomId.ToString() : "Desconhecido";

                if (TargetClient.GetRoleplay().OnProbation)
                {
                    OnProbation    = true;
                    NewWantedLevel = WantedLevel + 1;

                    if (NewWantedLevel > 6)
                    {
                        NewWantedLevel = 6;
                    }

                    NewWanted = new Wanted(Convert.ToUInt32(TargetClient.GetHabbo().Id), RoomId, NewWantedLevel);
                }
                else
                {
                    NewWanted = new Wanted(Convert.ToUInt32(TargetClient.GetHabbo().Id), RoomId, WantedLevel);
                }

                if (RoleplayManager.WantedList.ContainsKey(TargetClient.GetHabbo().Id))
                {
                    int CurrentWantedLevel = RoleplayManager.WantedList[TargetClient.GetHabbo().Id].WantedLevel;
                    if ((OnProbation && NewWantedLevel > CurrentWantedLevel) || (!OnProbation && WantedLevel > CurrentWantedLevel))
                    {
                        if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("wanted"))
                        {
                            TargetClient.GetRoleplay().TimerManager.ActiveTimers["wanted"].EndTimer();
                        }

                        if (!OnProbation)
                        {
                            if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("probation"))
                            {
                                TargetClient.GetRoleplay().TimerManager.ActiveTimers["probation"].EndTimer();
                            }

                            TargetClient.GetRoleplay().IsWanted       = true;
                            TargetClient.GetRoleplay().WantedLevel    = WantedLevel;
                            TargetClient.GetRoleplay().WantedTimeLeft = 10;

                            TargetClient.GetRoleplay().TimerManager.CreateTimer("procurado", 1000, false);
                            RoleplayManager.WantedList.TryUpdate(TargetClient.GetHabbo().Id, NewWanted, RoleplayManager.WantedList[TargetClient.GetHabbo().Id]);
                            Session.Shout("*Atualiza " + TargetClient.GetHabbo().Username + " como procurado, de " + CurrentWantedLevel + " estrela(s) para " + WantedLevel + " estrela(s)*", 37);

                            TargetClient.SendWhisper("" + Session.GetHabbo().Username + " atualizou seu nível de procurado de " + CurrentWantedLevel + " estrela(s) para " + WantedLevel + " estrela(s)!", 1);
                            if (Session.GetRoleplay().TryGetCooldown("estrelas"))
                            {
                                return;
                            }

                            PlusEnvironment.GetGame().GetClientManager().JailAlert("[Alerta RÁDIO] O nível de procurado de " + TargetClient.GetHabbo().Username + " foi atualizado de " + CurrentWantedLevel + " estrela(s) para " + WantedLevel + " estrela(s)!");
                            return;
                        }
                        else
                        {
                            if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("probation"))
                            {
                                TargetClient.GetRoleplay().TimerManager.ActiveTimers["probation"].EndTimer();
                            }

                            TargetClient.GetRoleplay().OnProbation       = false;
                            TargetClient.GetRoleplay().ProbationTimeLeft = 0;

                            TargetClient.GetRoleplay().IsWanted       = true;
                            TargetClient.GetRoleplay().WantedLevel    = NewWantedLevel;
                            TargetClient.GetRoleplay().WantedTimeLeft = 10;

                            TargetClient.GetRoleplay().TimerManager.CreateTimer("procurado", 1000, false);
                            RoleplayManager.WantedList.TryUpdate(TargetClient.GetHabbo().Id, NewWanted, RoleplayManager.WantedList[TargetClient.GetHabbo().Id]);
                            Session.Shout("*Atualiza " + TargetClient.GetHabbo().Username + " como procurado, de " + CurrentWantedLevel + " estrela(s) para " + NewWantedLevel + " estrela(s) [+1 devido à liberdade condicional]*", 37);

                            TargetClient.SendWhisper("" + Session.GetHabbo().Username + " você está sendo procurado com um nível de " + NewWantedLevel + " estrela(s) [+1 devido à liberdade condicional]*", 1);
                            if (Session.GetRoleplay().TryGetCooldown("estrelas"))
                            {
                                return;
                            }

                            PlusEnvironment.GetGame().GetClientManager().JailAlert("[Alerta RÁDIO] O nível de procurado de " + TargetClient.GetHabbo().Username + " foi atualizado de " + CurrentWantedLevel + " estrela(s) para " + WantedLevel + " estrela(s) [+1 devido à liberdade condicional]!");
                            return;
                        }
                    }
                    else
                    {
                        Session.Shout("*Tenta atualizar o nível de procurado de " + TargetClient.GetHabbo().Username + ", mas nota que o nível desejado já está em " + CurrentWantedLevel + " estrela(s)*", 37);
                        return;
                    }
                }
                else
                {
                    if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("procurado"))
                    {
                        TargetClient.GetRoleplay().TimerManager.ActiveTimers["procurado"].EndTimer();
                    }

                    if (!OnProbation)
                    {
                        TargetClient.GetRoleplay().IsWanted       = true;
                        TargetClient.GetRoleplay().WantedLevel    = WantedLevel;
                        TargetClient.GetRoleplay().WantedTimeLeft = 10;
                        TargetClient.GetRoleplay().TimerManager.CreateTimer("procurado", 1000, false);
                        RoleplayManager.WantedList.TryAdd(TargetClient.GetHabbo().Id, NewWanted);
                        Session.Shout("*Adiciona " + TargetClient.GetHabbo().Username + " para a Lista de Procurados com um Nível de " + WantedLevel + " estrela(s)*", 37);

                        TargetClient.SendWhisper("" + Session.GetHabbo().Username + " adicionou você à lista de procurados!", 1);
                        if (Session.GetRoleplay().TryGetCooldown("estrelas"))
                        {
                            return;
                        }

                        PlusEnvironment.GetGame().GetClientManager().JailAlert("[Alerta RÁDIO] " + TargetClient.GetHabbo().Username + " foi adicionado à Lista de Procurados com um Nível de " + WantedLevel + " estrela(s)!");
                        return;
                    }
                    else
                    {
                        if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("probation"))
                        {
                            TargetClient.GetRoleplay().TimerManager.ActiveTimers["probation"].EndTimer();
                        }

                        TargetClient.GetRoleplay().OnProbation       = false;
                        TargetClient.GetRoleplay().ProbationTimeLeft = 0;

                        TargetClient.GetRoleplay().IsWanted       = true;
                        TargetClient.GetRoleplay().WantedLevel    = NewWantedLevel;
                        TargetClient.GetRoleplay().WantedTimeLeft = 10;

                        TargetClient.GetRoleplay().TimerManager.CreateTimer("procurado", 1000, false);
                        RoleplayManager.WantedList.TryAdd(TargetClient.GetHabbo().Id, NewWanted);
                        Session.Shout("*Adiciona " + TargetClient.GetHabbo().Username + " para a Lista de Procurados com um Nível de " + NewWantedLevel + " estrela(s) [+1 devido à liberdade condicional]*", 37);

                        TargetClient.SendWhisper("" + Session.GetHabbo().Username + " você está sendo procurado com um nível de " + NewWantedLevel + " estrela(s) [+1 devido à liberdade condicional]*", 1);
                        if (Session.GetRoleplay().TryGetCooldown("estrelas"))
                        {
                            return;
                        }

                        PlusEnvironment.GetGame().GetClientManager().JailAlert("[Alerta RÁDIO] " + TargetClient.GetHabbo().Username + " foi adicionado à Lista de Procurados com um Nível de " + WantedLevel + " estrela(s) [+1 devido à liberdade condicional]!");
                        return;
                    }
                }
            }
            else
            {
                Session.SendWhisper("Por favor, insira um nível desejado entre 1 a 6!", 1);
                return;
            }
            #endregion
        }
示例#13
0
        /// <summary>
        /// Сконвертировать данные игрока в модель
        /// </summary>
        public static PlayerInfo ConvertToModel(gta_mp_data.Entity.PlayerInfo playerInfo, PlayerAdditionalInfo additionalInfo,
                                                DriverInfo driverInfo, IEnumerable <PlayerWork> worksInfo, Wanted wantedInfo, Settings settings, IEnumerable <PlayerClothes> clothes)
        {
            var result = new PlayerInfo {
                AccountId           = playerInfo.AccountId,
                Name                = playerInfo.Name,
                Level               = playerInfo.Level,
                Experience          = playerInfo.Experience,
                Satiety             = playerInfo.Satiety,
                Health              = playerInfo.Health,
                LastPosition        = playerInfo.LastPosition,
                Dimension           = playerInfo.Dimension,
                Driver              = DriverInfoConverter.ConvertToModel(driverInfo),
                Works               = WorksInfoConverter.ConvertToModels(worksInfo),
                Wanted              = wantedInfo,
                PhoneNumber         = additionalInfo.PhoneNumber,
                PhoneBalance        = additionalInfo.PhoneBalance,
                TagName             = additionalInfo.TagName,
                TagColor            = additionalInfo.TagColor,
                LastTeleportToHouse = additionalInfo.LastTeleportToHouse,
                Settings            = settings,
                Clothes             = PlayerClothesConverter.ConvertTModels(clothes)
            };

            return(result);
        }
示例#14
0
        public void Execute(GameClient Session, Rooms.Room Room, string[] Params)
        {
            #region Conditions
            if (Params.Length == 1)
            {
                Session.SendWhisper("Opa, você esqueceu de inserir um nome de usuário!", 1);
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("Ocorreu um erro ao tentar encontrar esse usuário, talvez ele esteja offline.", 1);
                return;
            }

            RoomUser RoomUser   = Session.GetRoomUser();
            RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Username);
            if (TargetUser == null)
            {
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            if (TargetUser == null)
            {
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            if (TargetClient.GetRoleplay().IsDead)
            {
                Session.SendWhisper("Você não pode escoltar alguém que está morto!", 1);
                return;
            }

            if (TargetClient.GetRoleplay().IsJailed&& !TargetClient.GetRoleplay().Jailbroken)
            {
                Session.SendWhisper("Você não pode escoltar alguém que já está preso!", 1);
                return;
            }

            if (!TargetClient.GetRoleplay().Cuffed)
            {
                Session.SendWhisper("Você não pode escoltar alguém que não está algemado!", 1);
                return;
            }

            if (TargetUser.IsAsleep)
            {
                Session.SendWhisper("Você não pode escoltar alguém que está ausente!", 1);
                return;
            }

            if (TargetClient == Session)
            {
                Session.SendWhisper("Você não pode se escoltar!", 1);
                return;
            }

            if (!TargetClient.GetRoleplay().Jailbroken)
            {
                if (!RoleplayManager.WantedList.ContainsKey(TargetClient.GetHabbo().Id))
                {
                    if (TargetClient.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("probation"))
                    {
                        TargetClient.GetRoleplay().TimerManager.ActiveTimers["probation"].EndTimer();
                    }

                    TargetClient.GetRoleplay().IsWanted       = true;
                    TargetClient.GetRoleplay().WantedLevel    = 1;
                    TargetClient.GetRoleplay().WantedTimeLeft = 10;

                    TargetClient.GetRoleplay().TimerManager.CreateTimer("procurado", 1000, false);
                    RoleplayManager.WantedList.TryUpdate(TargetClient.GetHabbo().Id, new Wanted(Convert.ToUInt32(TargetClient.GetHabbo().Id), Room.Id.ToString(), 1), RoleplayManager.WantedList[TargetClient.GetHabbo().Id]);
                }
            }

            #endregion

            #region Execute
            Point  ClientPos       = new Point(RoomUser.X, RoomUser.Y);
            Point  TargetClientPos = new Point(TargetUser.X, TargetUser.Y);
            double Distance        = RoleplayManager.GetDistanceBetweenPoints2D(ClientPos, TargetClientPos);
            Wanted Wanted          = RoleplayManager.WantedList.ContainsKey(TargetClient.GetHabbo().Id) ? RoleplayManager.WantedList[TargetClient.GetHabbo().Id] : null;
            int    WantedTime      = Wanted == null ? 6 : Wanted.WantedLevel * 5;

            if (Distance <= 1)
            {
                if (TargetClient.GetRoleplay().IsWorking)
                {
                    WorkManager.RemoveWorkerFromList(TargetClient);
                    TargetClient.GetRoleplay().IsWorking = false;
                    TargetClient.GetHabbo().Poof();
                }

                Session.Shout("*Algema as mãos de " + TargetClient.GetHabbo().Username + ", coloca as algemas e prende por " + WantedTime + " minutos*", (GroupManager.HasJobCommand(Session, "guide") && Session.GetRoleplay().IsWorking ? 37 : 4));
                TargetClient.GetRoleplay().Cuffed = false;
                TargetClient.GetRoomUser().ApplyEffect(0);

                if (TargetClient.GetHabbo().Look.Contains("lg-78322"))
                {
                    if (!TargetClient.GetRoleplay().WantedFor.Contains("exposição indecente"))
                    {
                        TargetClient.GetRoleplay().WantedFor = TargetClient.GetRoleplay().WantedFor + "exposição indecente, ";
                    }
                }

                if (TargetUser.Frozen)
                {
                    TargetUser.Frozen = false;
                }

                if (!TargetClient.GetRoleplay().IsJailed)
                {
                    TargetClient.GetRoleplay().IsJailed       = true;
                    TargetClient.GetRoleplay().JailedTimeLeft = WantedTime;
                    TargetClient.GetRoleplay().TimerManager.CreateTimer("jail", 1000, false);
                }

                if (TargetClient.GetRoleplay().Jailbroken&& !JailbreakManager.FenceBroken)
                {
                    TargetClient.GetRoleplay().Jailbroken = false;
                }

                int JailRID = Convert.ToInt32(RoleplayData.GetData("jail", "insideroomid"));

                if (TargetClient.GetHabbo().CurrentRoomId == JailRID)
                {
                    RoleplayManager.GetLookAndMotto(TargetClient);
                    RoleplayManager.SpawnBeds(TargetClient, "bed_silo_one");
                    TargetClient.SendMessage(new RoomNotificationComposer("room_jail_prison", "message", "Você foi escoltado por " + Session.GetHabbo().Username + " por " + WantedTime + " minutos!"));
                }
                else
                {
                    TargetClient.SendMessage(new RoomNotificationComposer("room_jail_prison", "message", "Você foi escoltado por " + Session.GetHabbo().Username + " por " + WantedTime + " minutos!"));
                    RoleplayManager.SendUser(TargetClient, JailRID);
                }

                PlusEnvironment.GetGame().GetClientManager().JailAlert("[Alerta RÁDIO] " + TargetClient.GetHabbo().Username + " acabou de ser escoltado para a prisão por " + Session.GetHabbo().Username + "!");
                PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_Arrests", 1);
                Session.GetRoleplay().Arrests++;
                PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(TargetClient, "ACH_Arrested", 1);
                TargetClient.GetRoleplay().Arrested++;
                return;
            }
            else
            {
                Session.SendWhisper("Você deve se aproximar desse cidadão para escoltá-lo!", 1);
                return;
            }
            #endregion
        }
示例#15
0
 private void ViewDetails(Wanted obj)
 {
     //SelectPwanted = $"{obj.Name}({obj.Age.ToString()}) - {obj.Nickname}";
 }