public bool AddPlayerToGame(GameClient player, RoleplayTeam team) { try { if (player == null || player.GetHabbo() == null) { return(false); } if (team.Members.Contains(player.GetHabbo().Id)) { return(false); } player.GetHabbo().Look = RoleplayManager.SplitFigure(player.GetHabbo().Look, team.Uniform); player.GetHabbo().Motto = "[JOGOS VORAZES] - [Time: " + team.Name + "] "; player.GetHabbo().Poof(false); Players.Add(player.GetHabbo().Id); team.Members.Add(player.GetHabbo().Id); return(true); } catch (Exception e) { Logging.LogRPGamesError("Error in AddPlayerToGame() void: " + e); return(false); } }
/// <summary> /// Gets the bots outfit /// </summary> /// <returns></returns> public string[] GetOutFit() { string[] Outfit = new string[2]; Outfit[0] = this.Figure; Outfit[1] = this.Motto; RoomUser User = RoleplayBotManager.GetDeployedBotById(this.Id); if (this.Dead) { if (this.Gender.ToLower() == "m") { Outfit[0] = RoleplayManager.SplitFigure(this.Figure, "lg-280-83.ch-215-83"); } if (this.Gender.ToLower() == "f") { Outfit[0] = RoleplayManager.SplitFigure(this.Figure, "lg-710-83.ch-635-83"); } Outfit[1] = "[MORTO] Paciente do Hospital"; } else if (this.Jailed) { Random Random = new Random(); int PrisonNumber = Random.Next(10000, 100000); if (Gender.ToLower() == "m") { Outfit[0] = RoleplayManager.SplitFigure(this.Figure, "lg-280-1323.sh-3016-92.ch-220-1323"); } if (Gender.ToLower() == "f") { Outfit[0] = RoleplayManager.SplitFigure(this.Figure, "lg-710-1323.sh-3016-92.ch-3067-1323"); } Outfit[1] = "[PRESO] ID do Criminoso [#" + PrisonNumber + "]"; } else if (User != null && User.GetBotRoleplayAI() != null && User.GetBotRoleplayAI().OnDuty) { if (this.WorkUniform != "Nenhum") { Outfit[0] = RoleplayManager.SplitFigure(this.Figure, this.WorkUniform); } Outfit[1] = "[TRABALHANDO] [" + GroupManager.GetJob(this.Corporation).Name + "]"; } return(Outfit); }
/// <summary> /// Adds user to a MWTeam /// </summary> public bool AddUserToGame(GameClient User, string TeamString) { if (User == null || User.GetHabbo() == null || User.GetRoleplay() == null) { return(false); } if (User.GetRoleplay().InMafiaWars == true) { return(false); } // Gets the MWTeam the user requested to join via the dictionary MWTeam MWTeamRequested = MWTeams[TeamString]; if (MWTeamRequested == null) { return(false); } if (MWTeamRequested.WaitingAreaPOS == null) { return(false); } RoomUser RUser = User.GetHabbo().GetRoomUser(); if (RUser == null) { return(false); } User.GetRoleplay().TeamString = TeamString; User.GetRoleplay().InMafiaWars = true; MWTeamRequested.Players.Add(User, 0); User.GetRoleplay().figBeforeWar = User.GetHabbo().Look; User.GetHabbo().Look = RoleplayManager.SplitFigure(User.GetHabbo().Look) + MWTeamRequested.Look; User.GetRoleplay().RefreshVals(); RUser.SetPos(MWTeamRequested.WaitingAreaPOS.X, MWTeamRequested.WaitingAreaPOS.Y, 0); RUser.ClearMovement(); // Attempt to start the game StartGame(); return(true); }
/// <summary> /// Add a boxer /// </summary> public void AddBoxer(GameClient Session) { if (Session == null || this.MyRoom == null || this.Boxers == null) { return; } if (this.Boxers.Count >= 2 || this.Boxers.ContainsKey(Session)) { return; } string Colour = this.GetColour(); string Figure = this.GetFigure(); var Habbo = Session.GetHabbo(); var Roleplay = Session.GetRoleplay(); if (Habbo == null || Roleplay == null) { return; } this.Boxers.Add(Session, Colour); Roleplay.IsBoxing = true; Roleplay.BoxingRoom = MyRoom; Roleplay.figBeforeWar = Habbo.Look; Roleplay.CurHealth = Roleplay.MaxHealth; Roleplay.Energy = 100; Habbo.Look = RoleplayManager.SplitFigure(Habbo.Look) + Figure; Roleplay.RefreshVals(); if (this.Boxers.Count < 2) { return; } StartMatch(); }
/// <summary> /// Opens the guide tool. /// </summary> internal void OpenGuideTool() { if (Session.GetRoleplay().JobId == 3) { var guideManager = Plus.GetGame().GetGuideManager(); var onDuty = Request.GetBool(); Request.GetBool(); // guide Request.GetBool(); // helper Request.GetBool(); // guardian if (onDuty) { if (Session.GetRoleplay().JobHasRights("police") || Session.GetRoleplay().JobHasRights("swat")) { if (RoleplayManager.PurgeTime) { Session.SendWhisperBubble("Você não pode trabalhar como oficial durante a purga!", 1); onDuty = false; return; } if (Session.GetRoleplay().IsNoob) { Session.SendWhisperBubble("Você não pode cumprir seus deveres na Aplicação da Lei com a Proteção de Deus Habilitada!", 1); onDuty = false; return; } if (Session.GetHabbo().CurrentRoom.RoomData.Description.Contains("NOCOP")) { Session.SendWhisperBubble("Desculpe, mas esta é uma zona de territorio", 1); onDuty = false; return; } } if (Session.GetRoleplay().SentHome) { Session.SendWhisperBubble("Você foi mandado para casa por um gerente. Você deve esperar " + Session.GetRoleplay().SendHomeTimer + " minutos para começar a trabalhar novamente", 1); onDuty = false; return; } if (Session.GetRoleplay().Working) { Session.SendWhisperBubble("Você já está trabalhando!", 1); onDuty = false; return; } if (Session.GetRoleplay().ATMRobbery) { Session.SendWhisperBubble("Você não pode trabalhar enquanto rouba um caixa eletrônico!", 1); onDuty = false; return; } if (Session.GetRoleplay().Robbery) { Session.SendWhisperBubble("Você não pode trabalhar enquanto rouba o cofre!", 1); onDuty = false; return; } if (Session.GetRoleplay().Learning) { Session.SendWhisperBubble("Você não pode trabalhar enquanto está lendo!", 1); onDuty = false; return; } if (Session.GetRoleplay().WeightLifting) { Session.SendWhisperBubble("Você não pode trabalhar enquanto está malhando!", 1); onDuty = false; return; } if (Session.GetRoleplay().WorkingOut) { Session.SendWhisperBubble("Você não pode trabalhar enquanto trabalha fora!", 1); onDuty = false; return; } if (Session.GetRoleplay().Dead) { Session.SendWhisperBubble("Você não pode trabalhar enquanto estiver morto!", 1); onDuty = false; return; } if (Session.GetRoleplay().Jailed) { Session.SendWhisperBubble("Você não pode trabalhar enquanto estiver preso!", 1); onDuty = false; return; } if (Session.GetRoleplay().JobRank == 1 || Session.GetRoleplay().JobRank == 2 && Session.GetRoleplay().JobId == 3) { guideManager.AddGuide(Session); } Session.GetHabbo().GetRoomUser().ApplyEffect(178); if (Session.GetRoleplay().JobRank > 2 && Session.GetRoleplay().JobRank < 8 && Session.GetRoleplay().JobId == 3) { guideManager.AddOfficer(Session); } Session.GetHabbo().GetRoomUser().ApplyEffect(178); if (Session.GetRoleplay().JobRank == 8 || Session.GetRoleplay().JobRank == 9 && Session.GetRoleplay().JobId == 3) { guideManager.AddChief(Session); } Session.GetHabbo().GetRoomUser().ApplyEffect(178); int JobId = Session.GetRoleplay().JobId; int JobRank = Session.GetRoleplay().JobRank; string JobName = JobManager.JobData[JobId].Name; string RankName = JobManager.JobRankData[JobId, JobRank].Name; Session.GetRoleplay().FigBeforeWork = Session.GetHabbo().Look; Session.GetRoleplay().MottBeforeWork = Session.GetHabbo().Motto; if (Session.GetRoleplay().JobId != 1 && !JobManager.JobRankData[JobId, JobRank].MaleFig.Contains("*") && !JobManager.JobRankData[JobId, JobRank].FemaleFig.Contains("*")) // Set Figure if not Unemployed { if (!JobManager.JobRankData[JobId, JobRank].MaleFig.ToLower().Contains("none") && !JobManager.JobRankData[JobId, JobRank].FemaleFig.ToLower().Contains("none")) { if (Session.GetHabbo().Gender.ToLower().StartsWith("m")) { Session.GetHabbo().Look = RoleplayManager.SplitFigure(Session.GetHabbo().Look) + JobManager.JobRankData[JobId, JobRank].MaleFig; Session.GetRoleplay().FigWork = RoleplayManager.SplitFigure(Session.GetHabbo().Look) + JobManager.JobRankData[JobId, JobRank].MaleFig; } else { Session.GetHabbo().Look = RoleplayManager.SplitFigure(Session.GetHabbo().Look) + JobManager.JobRankData[JobId, JobRank].FemaleFig; Session.GetRoleplay().FigWork = RoleplayManager.SplitFigure(Session.GetHabbo().Look) + JobManager.JobRankData[JobId, JobRank].FemaleFig; } } } Session.GetHabbo().Motto = "[Trabalhando] " + JobName + " " + RankName; Session.GetRoleplay().RefreshVals(); Session.GetRoleplay().Working = true; Session.GetRoleplay().workingTimer = new workingTimer(Session); Session.GetRoleplay().SaveJobComponents(); RoleplayManager.Shout(Session, "*Começa a trabalhar*"); Session.SendWhisperBubble("Você tem " + Session.GetRoleplay().workingTimer.getTime() + " minuto(s) até que você receba seu próximo salário", 1); Session.GetRoleplay().MultiCoolDown["work_cooldown"] = 5; Session.GetRoleplay().CheckingMultiCooldown = true; } else { if (Session.GetRoleplay().Working) { Session.GetRoleplay().StopWork(true); if (Session.GetRoleplay().Equiped != null) { if (Session.GetRoleplay().Equiped.ToLower().Equals("npa")) { Session.GetHabbo().GetRoomUser().ApplyEffect(0); Session.GetRoleplay().Equiped = null; onDuty = false; Session.GetRoleplay().Working = false; } } } guideManager.RemoveGuide(Session); guideManager.RemoveOfficer(Session); guideManager.RemoveChief(Session); Session.GetHabbo().GetRoomUser().ApplyEffect(0); } Session.GetHabbo().OnDuty = onDuty; Response.Init(LibraryParser.OutgoingRequest("HelperToolConfigurationMessageComposer")); Response.AppendBool(onDuty); // on duty Response.AppendInteger(guideManager.GuidesCount); // guides Response.AppendInteger(guideManager.OfficerCount); // helpers Response.AppendInteger(guideManager.ChiefCount); // guardians SendResponse(); } else { Session.SendWhisper("Você deve ser polícia para usar as ferramentas da polícia"); } }