/// <summary> /// Reloads the weapon /// </summary> public bool Reload(GameClient Client, GameClient TargetClient = null) { Client.GetRoleplay().GunShots = 0; if (Client.GetRoleplay().Bullets > 0 || Client.GetRoleplay().Game != null) { if (TargetClient != null) { RoleplayManager.Shout(Client, "*Tenta atirar em " + TargetClient.GetHabbo().Username + " mas estou sem balas no pente*", 4); } this.ReloadMessage(Client, this.ClipSize); return(true); } else { if (TargetClient != null) { RoleplayManager.Shout(Client, "*Tenta atirar em " + TargetClient.GetHabbo().Username + " mas percebe que acabaram completamente as balas*", 4); } else { Client.SendWhisper("Você acabou com balas para recarregar sua arma!", 1); } return(false); } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { #region Params if (Params.Length < 2) { Session.SendWhisper("Comando inválido, use :banwpp <usuário>", 1); return; } string Chatter = Params[1].ToString(); GameClient TargetSession = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Chatter); bool BanFromMaking = false; if (Params.Length == 3) { if (Convert.ToString(Params[2]).ToLower().StartsWith("sim")) { BanFromMaking = true; } } #endregion #region Conditions if (TargetSession == null) { Session.SendWhisper("Alvo não encontrado!", 1); return; } #endregion #region Execute if (TargetSession.GetRoleplay().ChatRooms.Count > 0) { foreach (WebSocketChatRoom Chat in TargetSession.GetRoleplay().ChatRooms.Values) { if (Chat == null) { continue; } WebSocketChatManager.Disconnect(TargetSession, Chat.ChatName); } } Session.Shout("*Proíbe imediatamente " + TargetSession.GetHabbo().Username + " de se juntar ou criar Grupos de WhatsApp " + ((BanFromMaking) ? "" : "") + "!*", 23); TargetSession.SendWhisper("Você foi banido de se juntar a uma sala de bate-papo por um membro da equipe!", 1); TargetSession.GetRoleplay().BannedFromChatting = true; if (BanFromMaking) { TargetSession.SendWhisper("Você foi proibido de fazer uma sala de bate-papo por um membro da equipe!", 1); TargetSession.GetRoleplay().BannedFromMakingChat = true; } RoleplayManager.Shout(TargetSession, "*Pega meu " + RoleplayManager.GetPhoneName(TargetSession) + " e deleta o Aplicativo WhatsApp*", 4); #endregion }
public void JailbreakTimerTicked(object NullObject) { if (IsAnythingNull() || !UserInPosition()) { StopJailbreak(); return; } RoleplayManager.Shout(UserJailbreaking, "*Carries on cutting the wires from the prison fence [" + GetJailbreakTimeLeft() + " minutes left]*"); }
/// <summary> /// Provides the reload text depending on bool /// </summary> /// <param name="Client"></param> public void ReloadMessage(GameClient Client, int Bullets) { string Text = this.ReloadText; Text = Text.Replace("[NAME]", PublicName); Text = Text.Replace("[BULLETS]", Bullets.ToString()); RoleplayManager.Shout(Client, Text, 4); }
public void timerDone(object info) { try { timeLeft -= 60000; #region Conditions if (Session == null) { stopTimer(); return; } if (timeLeft == 3 * 60000) { if (GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId > 0) { RoleplayManager.AlertGang("Your turf is slowly being captured in RoomID " + Session.GetHabbo().CurrentRoomId + "! They're getting close!", GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId); } } else if (timeLeft == 1 * 60000) { if (GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId > 0) { RoleplayManager.AlertGang("Your turf is nearly captured in RoomID " + Session.GetHabbo().CurrentRoomId + "! Hurry Hurry!", GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId); } } if (timeLeft > 0) { int minutesRemaining = timeLeft / 60000; Session.SendWhisper("You have " + minutesRemaining + " minute(s) left until you capture the turf!"); timer.Change(60000, Timeout.Infinite); return; } #endregion #region Execute RoleplayManager.Shout(Session, "*Successfully captures gang turf*"); GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId = Session.GetRoleplay().GangId; using (IQueryAdapter dbClient = Plus.GetDatabaseManager().GetQueryReactor()) { dbClient.RunFastQuery("UPDATE rp_gangs_turfs SET gang_id = '" + Session.GetRoleplay().GangId + "' WHERE turf_id = '" + Session.GetHabbo().CurrentRoomId + "'"); } GangManager.initTurfs(); if (GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId > 0) { RoleplayManager.AlertGang("Your turf just got captured in RoomID " + Session.GetHabbo().CurrentRoomId + "! It's too late!", GangManager.TurfData[Convert.ToInt32(Session.GetHabbo().CurrentRoomId)].GangId); } Session.GetRoleplay().GangCapturing = false; stopTimer(); #endregion } catch { stopTimer(); } }
/// <summary> /// Responds to the event /// </summary> public void Execute(object Source, object[] Params) { GameClient Client = (GameClient)Source; if (Client == null || Client.GetRoleplay() == null || Client.GetHabbo() == null) { return; } if (Client.GetRoleplay().CurHealth <= 0 && !Client.GetRoleplay().IsJailed&& !Client.GetRoleplay().IsDead) { Client.GetRoleplay().BeingHealed = false; Client.GetRoleplay().CloseInteractingUserDialogues(); Client.GetRoleplay().ClearWebSocketDialogue(true); if (Client.GetRoleplay().Game != null) { EventDeath(Client); } else { NormalDeath(Client); } return; } else { Client.GetRoleplay().UpdateInteractingUserDialogues(); } Client.GetRoleplay().RefreshStatDialogue(); if (Client.GetRoleplay().BeingHealed || Client.GetRoleplay().CurHealth <= 0 || Client.GetRoleplay().CurHealth >= Client.GetRoleplay().MaxHealth) { return; } if (Client.GetRoleplay().Hunger >= 100 && Client.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("hunger")) { int TimeCount = Client.GetRoleplay().TimerManager.ActiveTimers["hunger"].TimeCount; if (TimeCount == 0) { Client.SendWhisper("Sua vida agora está [" + Client.GetRoleplay().CurHealth + "/" + Client.GetRoleplay().MaxHealth + "]! Coma alguma coisa antes de morrer de fome!", 1); } else { RoleplayManager.Shout(Client, "*[" + Client.GetRoleplay().CurHealth + "/" + Client.GetRoleplay().MaxHealth + "]*", 3); } } else { RoleplayManager.Shout(Client, "*[" + Client.GetRoleplay().CurHealth + "/" + Client.GetRoleplay().MaxHealth + "]*", 3); } }
/// <summary> /// Fence Repair timer /// </summary> public override void Execute() { try { if (base.Client == null || base.Client.GetHabbo() == null || base.Client.GetRoleplay() == null || base.Client.GetRoomUser() == null || base.Client.GetRoomUser().GetRoom() == null || !JailbreakManager.FenceBroken) { base.EndTimer(); return; } int ItemId = (int)Params[0]; Item BTile = base.Client.GetRoomUser().GetRoom().GetRoomItemHandler().GetItem(ItemId); Room Room = RoleplayManager.GenerateRoom(base.Client.GetHabbo().CurrentRoomId); if (Room == null) { return; } if (BTile == null || BTile.Coordinate != base.Client.GetRoomUser().Coordinate || Room.RoomId != Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"))) { if (base.Client.GetRoomUser().CurrentEffect == EffectsList.SunnyD) { base.Client.GetRoomUser().ApplyEffect(EffectsList.None); } RoleplayManager.Shout(base.Client, "*Para de reparar a cerca*", 4); base.EndTimer(); return; } TimeLeft -= 1000; if (TimeLeft > 0) { return; } if (base.Client.GetRoomUser().CurrentEffect == EffectsList.SunnyD) { base.Client.GetRoomUser().ApplyEffect(EffectsList.None); } RoleplayManager.Shout(base.Client, "*Repara com sucesso a cerca*", 4); JailbreakManager.FenceBroken = false; JailbreakManager.GenerateFence(Room); base.EndTimer(); return; } catch (Exception e) { Logging.LogRPTimersError("Error in Execute() void: " + e); base.EndTimer(); } }
public void OneMinute(object info) { try { if (Me != null) { // Get the roomuser RoomUser RoomUser = Me.GetHabbo().GetRoomUser(); // Get the team Team TheTeam = ColourManager.GetTeamByBase(RoomUser); // Check if the user is not on the base point if (TheTeam == null) { Team.BeingCaptured = false; Timer = null; Timer2 = null; TheTeam = null; Me = null; return; } // If there is still more to do if (TimeLeft > 0) { // Convert the milliseconds to minutes int Minutes = TimeLeft / 60000; if (Minutes == 0) { // Inform the user of time left if (Me.GetRoleplay() != null) { Me.GetRoleplay().GiveColorWarPoints(ColourManager.CapturePoints); } RoleplayManager.Shout(Me, "*Successfully captures the " + Team.Colour.ToLower() + "'s base, knocking them out of the round [+ " + ColourManager.CapturePoints + " Color Wars Pts]*"); RoomUser.ApplyEffect(0); } else { RoleplayManager.Shout(Me, "*" + Minutes + " minutes until the base is captured!*"); } // Restart the timer! :D Timer2.Change(60000, Timeout.Infinite); // Stop proceeding return; } } } catch { } }
public override void OnDeath(GameClient Client) { bool IsBoss = (GetBotRoleplay().Motto.ToLower().Contains("boss")) ? true : false; if (IsBoss) { RoleplayManager.Shout(Client, "*Dá um soco em " + GetBotRoleplay().Name + ", matando-o e ganhando a Guerra de Máfias " + Client.GetRoleplay().Team.Name + "! [+5 Pontos de Eventos]*", 1); Client.GetHabbo().EventPoints += 5; Client.GetHabbo().UpdateEventPointsBalance(); RoleplayTeam DefeatedTeam = Client.GetRoleplay().Game.GetTeams().Values.FirstOrDefault(x => x.CaptureRoom == Client.GetRoomUser().RoomId); Client.GetRoleplay().Game.NotifyPlayers("O mestre do time" + DefeatedTeam.Name + " foi derrotado por " + Client.GetHabbo().Username + "! A vitória pertence ao Time " + Client.GetRoleplay().Team.Name + "!"); foreach (RoomUser RoleplayBot in GetRoom().GetRoomUserManager().GetBotList()) { if (RoleplayBot == null) { continue; } if (!RoleplayBot.IsRoleplayBot) { continue; } if (RoleplayBot.GetBotRoleplay() == null) { continue; } if (RoleplayBot.GetBotRoleplay().Invisible || (RoleplayBot.GetBotRoleplay().Dead)) { continue; } RoleplayBot.GetBotRoleplay().StopAllHandlers(); } new Thread(() => { Thread.Sleep(5000); Client.GetRoleplay().Game.RemoveTeamMembers(DefeatedTeam); }).Start(); } else { RoleplayManager.Shout(Client, "*Dá um soco em " + GetBotRoleplay().Name + ", matando-o*"); Client.GetHabbo().EventPoints += 10; Client.GetHabbo().UpdateEventPointsBalance(); } GetRoom().SendMessage(new UserRemoveComposer(GetRoomUser().VirtualId)); GetBotRoleplay().Invisible = true; GetBotRoleplay().Dead = true; }
public void HandleATM(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights) { RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (Item.InteractingUser2 != User.UserId) { Item.InteractingUser2 = User.UserId; } if (User == null) { return; } if (User.Coordinate != Item.SquareInFront && User.CanWalk) { User.MoveTo(Item.SquareInFront); return; } if (Session.GetRoleplay().inATM == true) { Session.SendWhisper("[ATM MSG] You are already logged in!"); return; } Session.GetRoleplay().inATM = true; Session.SendWhisper("[ATM MSG] Processing transaction please wait..."); int amount = Session.GetRoleplay().AtmSetAmount; if (amount > Session.GetRoleplay().Bank) { Session.SendWhisper("[ATM MSG] Transaction failed, insufficient funds!"); Session.GetHabbo().GetRoomUser().UnlockWalking(); Session.GetRoleplay().inATM = false; return; } else { System.Threading.Thread.Sleep(2000); Session.SendWhisper("[ATM MSG] Transaction succesful!"); RoleplayManager.Shout(Session, "*Uses the ATM to withdraw $" + amount + " from their account [+$" + amount + "]*"); Session.GetHabbo().GetRoomUser().UnlockWalking(); Session.GetRoleplay().inATM = false; Session.GetRoleplay().Bank -= amount; Session.GetRoleplay().SaveQuickStat("bank", "" + Session.GetRoleplay().Bank); RoleplayManager.GiveMoney(Session, +amount); Session.GetRoleplay().AtmSetAmount = 20; } }
public void JailbreakTimerFinished(object NullObject) { if (IsAnythingNull() || !UserInPosition()) { StopJailbreak(); return; } RoleplayManager.Shout(UserJailbreaking, "*Cuts the last wire from the prison fence, freeing all the convicts inside*"); FreeAllConvicts(); StopJailbreak(true); }
/// <summary> /// Removes the user from probation /// </summary> public override void Execute() { try { if (base.Client == null || base.Client.GetHabbo() == null || base.Client.GetRoleplay() == null) { base.EndTimer(); return; } if (!base.Client.GetRoleplay().OnProbation) { base.Client.GetRoleplay().OnProbation = false; base.Client.GetRoleplay().ProbationTimeLeft = 0; base.EndTimer(); return; } if (base.Client.GetRoomUser() == null) { return; } TimeCount++; TimeLeft -= 1000; if (TimeCount == 60) { base.Client.GetRoleplay().ProbationTimeLeft--; } if (TimeLeft > 0) { if (TimeCount == 60) { base.Client.SendWhisper("Você tem " + (TimeLeft / 60000) + " minuto(s) até que você seja removido da liberdade condicional!", 1); TimeCount = 0; } return; } base.Client.GetRoleplay().OnProbation = false; base.Client.GetRoleplay().ProbationTimeLeft = 0; RoleplayManager.Shout(base.Client, "*Completa seu tempo e é retirado da liberdade condicional*", 4); base.EndTimer(); } catch (Exception e) { Logging.LogRPTimersError("Error in Execute() void: " + e); base.EndTimer(); } }
public void timerDone(object info) { try { timeLeft -= 60000; #region Conditions if (Session == null) { stopTimer(); return; } if (timeLeft > 0) { int minutesRemaining = timeLeft / 60000; Session.GetRoleplay().SaveStatusComponents("robbery"); Session.SendWhisper("You have " + minutesRemaining + " minute(s) left until you complete your robbery!"); timer.Change(60000, Timeout.Infinite); return; } #endregion #region Execute Random rnd = new Random(); int maxrob = (RoleplayManager.VaultRobbery < 666) ? (RoleplayManager.VaultRobbery / 2) : 666; int money = rnd.Next(0, maxrob); RoleplayManager.VaultRobbery -= money; if (RoleplayManager.VaultRobbery <= 0) { Session.SendWhisper("The vault has $0 left, meaning it was completely robbed! Therefore, you didn't get any cash for robbing the vault!"); Session.GetRoleplay().Robbery = false; Session.GetRoleplay().SaveStatusComponents("robbery"); stopTimer(); return; } RoleplayManager.Shout(Session, "*Finishes robbing the bank [+$" + money + "]*"); RoleplayManager.GiveMoney(Session, +money); Session.SendWhisper("Vault cash remaining: $" + RoleplayManager.VaultRobbery + "!"); Session.GetRoleplay().Robbery = false; Session.GetRoleplay().SaveStatusComponents("robbery"); stopTimer(); #endregion } catch { stopTimer(); } }
/// <summary> /// Method is call when timer is finished /// </summary> /// <param name="info">The information</param> public void Ticked(object info) { try { if (Me != null && Me.GetHabbo() != null && Me.GetRoleplay() != null) { // Take away 2 seconds from the time left TimeLeft -= 2000; // Get the roomuser RoomUser RoomUser = Me.GetHabbo().GetRoomUser(); // Get the team Team TheTeam = ColourManager.GetTeamByBase(RoomUser); // Check if the user is not on the base point if (TheTeam == null || Team.KnockedOut) { RoleplayManager.Shout(Me, "*Stops capturing the base*"); Team.BeingCaptured = false; Timer = null; Timer2 = null; TheTeam = null; Me = null; RoomUser.ApplyEffect(0); return; } // If there is still more to do if (TimeLeft > 0) { Timer.Change(2000, Timeout.Infinite); // Stop proceeding return; } Team.BeingCaptured = false; RoomUser.ApplyEffect(0); ColourManager.EliminateTeam(Team); } else { Team.BeingCaptured = false; } } catch { Team.BeingCaptured = false; } }
public void StopJailbreak(bool Success = false) { CoordCheckTimer.StopFlexTimer(); JailbreakTimer.StopFlexTimer(); ChangeItemState("0"); Plus.GetGame().JailBreak = null; if (IsAnythingNull() || Success) { return; } RoleplayManager.Shout(UserJailbreaking, "*Stops cutting the wires on the fence*"); }
/// <summary> /// Executes shower tick /// </summary> public override void Execute() { try { if (base.Client == null || base.Client.GetHabbo() == null || base.Client.GetRoleplay() == null) { base.EndTimer(); return; } if (base.Client.GetRoomUser() == null || base.Client.GetRoomUser().GetRoom() == null) { base.Client.GetRoleplay().InShower = false; base.EndTimer(); return; } int ItemId = (int)Params[0]; Item Shower = base.Client.GetRoomUser().GetRoom().GetRoomItemHandler().GetItem(ItemId); if (Shower == null || !base.Client.GetRoleplay().InShower || Shower.Coordinate != base.Client.GetRoomUser().Coordinate) { RoleplayManager.Shout(base.Client, "*Para de tomar um banho antes de terminar*", 4); base.Client.GetRoleplay().InShower = false; base.EndTimer(); return; } TimeLeft -= 1000; base.Client.GetRoleplay().Hygiene++; if (TimeLeft > 0) { return; } Point OffShower = new Point(Shower.SquareInFront.X, Shower.SquareInFront.Y); base.Client.GetRoomUser().MoveTo(OffShower); RoleplayManager.Shout(base.Client, "*Sente-se limpo após um bom banho quente*", 4); base.Client.GetRoleplay().InShower = false; base.EndTimer(); return; } catch (Exception e) { Logging.LogRPTimersError("Error in Execute() void: " + e); base.EndTimer(); } }
public void timerDone(object info) { try { timeLeft -= 60000; #region Conditions if (Session == null) { stopTimer(); return; } if (!Session.GetHabbo().CurrentRoom.RoomData.Description.Contains("NPA_INSIDE")) { RoleplayManager.Shout(Session, "*Stops the process in nuking the hotel*"); Session.GetRoleplay().NPA = false; RoomItem Itemm = null; foreach (RoomItem Item in Session.GetHabbo().CurrentRoom.GetRoomItemHandler().FloorItems.Values) { if (1 == 1) { Itemm = Item; } } Itemm.OnNPAUsing = false; stopTimer(); return; } if (timeLeft > 0) { int minutesRemaining = timeLeft / 60000; Session.SendWhisper("You have " + minutesRemaining + " minutes until you nuke the hotel!"); timer.Change(60000, Timeout.Infinite); return; } #endregion #region Execute Roleplay.Components.ProcessNuke nukeProcess = new Roleplay.Components.ProcessNuke(Session); stopTimer(); #endregion } catch { stopTimer(); } }
/// <summary> /// Removes the cooldown /// </summary> public override void Execute() { try { if (base.Client == null || base.Client.GetRoleplay() == null || base.Client.GetHabbo() == null) { base.EndCooldown(); return; } TimeLeft -= 1000; if (Type.ToLower() == "recarregar" && TimeLeft > 0) { base.Client.SendWhisper("Recarregando: " + (TimeLeft / 1000) + "/" + Amount, 1); } if (TimeLeft > 0) { return; } if (Type.ToLower() == "maconha") { RoleplayManager.Shout(base.Client, "*Sinta o desgaste elevado da maconha*", 4); base.Client.GetRoleplay().HighOffWeed = false; } else if (Type.ToLower() == "cocaina") { RoleplayManager.Shout(base.Client, "*Parece que o consumo de cocaína é alto*", 4); base.Client.GetRoleplay().HighOffCocaine = false; } else if (Type.ToLower() == "recarregar") { base.Client.SendWhisper("Carregamento feito!", 1); } if (base.Client.GetRoleplay().SpecialCooldowns.ContainsKey(Type.ToLower())) { base.Client.GetRoleplay().SpecialCooldowns.TryUpdate(Type.ToLower(), TimeLeft, base.Client.GetRoleplay().SpecialCooldowns[Type.ToLower()]); } base.EndCooldown(); } catch (Exception e) { Logging.LogCriticalException("Error in Execute() void: " + e); } }
public override void OnDeath(GameClient Client) { int Amount = CombatManager.GetCombatType("fist").GetCoins(null, GetBotRoleplay()); Client.GetHabbo().Credits += Amount; Client.GetHabbo().UpdateCreditsBalance(); PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Client, QuestType.KILL_USER); PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Client, "ACH_Kills", 1); Client.GetRoleplay().Kills++; Client.GetRoleplay().HitKills++; CryptoRandom Random = new CryptoRandom(); int Multiplier = 1; int Chance = Random.Next(1, 101); if (Chance <= 16) { if (Chance <= 8) { Multiplier = 3; } else { Multiplier = 2; } } LevelManager.AddLevelEXP(Client, CombatManager.GetCombatType("fist").GetEXP(Client, null, GetBotRoleplay()) * Multiplier); if (Amount > 0) { RoleplayManager.Shout(Client, "*Dá um soco em " + GetBotRoleplay().Name + ", matando-o e roubando R$" + Amount + " da sua carteira*", 6); } else { RoleplayManager.Shout(Client, "*Dá um soco em " + GetBotRoleplay().Name + ", matando-o, mas não consegue roubar pois a carteira está vazia*", 6); } GetBotRoleplay().InitiateDeath(); }
public override void OnDeath(GameClient Client) { int Amount = CombatManager.GetCombatType("fist").GetCoins(null, GetBotRoleplay()); Client.GetHabbo().Credits += Amount; Client.GetHabbo().UpdateCreditsBalance(); CombatManager.GetCombatType("fist").GetRewards(Client, null, GetBotRoleplay()); if (Amount > 0) { RoleplayManager.Shout(Client, "*Dá um nocaute em " + GetBotRoleplay().Name + ", matando-o e roubando R$" + Amount + " da sua carteira*", 6); } else { RoleplayManager.Shout(Client, "*Dá um nocaute em " + GetBotRoleplay().Name + ", matando-o e não consegue roubar, pois a carteira está vazia*", 6); } GetBotRoleplay().InitiateDeath(); }
public void HandleNPA(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights) { RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (Item.InteractingUser2 != User.UserId) { Item.InteractingUser2 = User.UserId; } if (User == null) { return; } if (User.Coordinate != Item.SquareInFront && User.CanWalk) { User.MoveTo(Item.SquareInFront); return; } if (Item.OnNPAUsing) { User.GetClient().SendWhisperBubble("Someone is already using this machine to nuke the city!", 1); return; } if (RoleplayManager.NukesOccurred > 5) { User.GetClient().SendWhisperBubble("The system has reached a maximum amount of nukes per emulator reboot. Please try again later.", 1); return; } RoleplayManager.Shout(User.GetClient(), "*Starts the process in nuking the city*", 4); User.GetClient().GetRoleplay().npaTimer = new nukeTimer(User.GetClient()); User.GetClient().GetRoleplay().NPA = true; User.GetClient().SendWhisperBubble("You have " + User.GetClient().GetRoleplay().npaTimer.getTime() + " minutes until you nuke the city.", 1); Item.OnNPAUsing = true; RoleplayManager.NukesOccurred++; }
public static void addXP(GameClient Session, int amount = 15) { try { if (Session != null) { Session.GetRoleplay().WoodXP += amount; Session.GetRoleplay().UpdateStats = 10; if (levelUp(Session)) { Session.GetRoleplay().WoodLevel += 1; Session.GetRoleplay().UpdateStats = 10; RoleplayManager.Shout(Session, "*Níveis até um nível " + Session.GetRoleplay().WoodLevel + " Lenhador * "); } else { Session.SendWhisper("Você recebeu XP por corte de madeira! [" + Session.GetRoleplay().WoodXP + " / " + levels[Session.GetRoleplay().WoodLevel + 1] + "]"); } } } catch { } }
public static void addXP(GameClient Session, int amount = 15) { try { if (Session != null) { Session.GetRoleplay().FarmingXP += amount; Session.GetRoleplay().UpdateStats = 10; if (levelUp(Session)) { Session.GetRoleplay().FarmingLevel += 1; Session.GetRoleplay().UpdateStats = 10; RoleplayManager.Shout(Session, "*Níveis até um nível " + Session.GetRoleplay().FarmingLevel + " agricultura!*"); } else { Session.SendWhisper("Você recebeu XP por plantar! [" + Session.GetRoleplay().FarmingXP + " / " + levels[Session.GetRoleplay().FarmingLevel + 1] + "]"); } } } catch { } }
public static void addXP(GameClient Session, int amount = 15) { try { if (Session != null) { Session.GetRoleplay().SpaceXP += amount; Session.GetRoleplay().UpdateStats = 10; if (levelUp(Session)) { Session.GetRoleplay().SpaceLevel += 1; Session.GetRoleplay().UpdateStats = 10; RoleplayManager.Shout(Session, "*Levels up to a level " + Session.GetRoleplay().SpaceLevel + " miner*"); } else { Session.SendWhisper("You've received XP for mining! [" + Session.GetRoleplay().SpaceXP + " / " + levels[Session.GetRoleplay().SpaceLevel + 1] + "]"); } } } catch { } }
public void timerDone(object info) { try { timeLeft -= 60000; #region Conditions if (Session == null) { stopTimer(); return; } if (timeLeft > 0) { int minutesRemaining = timeLeft / 60000; Session.GetRoleplay().SaveStatusComponents("robbery"); Session.SendWhisper("You have " + minutesRemaining + " minute(s) left until you complete your robbery!"); timer.Change(60000, Timeout.Infinite); return; } #endregion #region Execute Random rnd = new Random(); int money = rnd.Next(0, 666); RoleplayManager.Shout(Session, "*Finishes robbing the bank [$" + money + "]*"); RoleplayManager.GiveMoney(Session, +money); Session.GetRoleplay().Robbery = false; Session.GetRoleplay().SaveStatusComponents("robbery"); stopTimer(); #endregion } catch { stopTimer(); } }
public void timerDone(object info) { try { timeLeft -= 60000; #region Conditions if (Session == null) { stopTimer(); return; } if (timeLeft > 0) { int minutesRemaining = timeLeft / 60000; Session.GetRoleplay().SaveStatusComponents("learning"); Session.SendWhisper("You have " + minutesRemaining + " minutes left until you learn a new subject."); timer.Change(60000, Timeout.Infinite); return; } #endregion #region Execute Session.GetRoleplay().Intelligence += 1; Session.GetRoleplay().SaveQuickStat("intelligence", "" + Session.GetRoleplay().Intelligence); RoleplayManager.Shout(Session, "*Finishes learning [+1 Intelligence]*"); Session.SendWhisper("Your intelligence is now: " + Session.GetRoleplay().Intelligence + ""); Session.GetRoleplay().Learning = false; Session.GetRoleplay().SaveStatusComponents("learning"); Session.GetHabbo().GetRoomUser().ApplyEffect(0); stopTimer(); #endregion } catch { stopTimer(); } }
/// <summary> /// Executes this type of combat /// </summary> public void Execute(GameClient Client, GameClient TargetClient, bool HitClosest = false) { if (!CanCombat(Client, TargetClient)) { return; } #region Variables RoomUser RoomUser = Client.GetRoomUser(); RoomUser TargetRoomUser = TargetClient.GetRoomUser(); int Damage = GetDamage(Client, TargetClient); Weapon Weapon = Client.GetRoleplay().EquippedWeapon; Point ClientPos = RoomUser.Coordinate; Point TargetClientPos = TargetRoomUser.Coordinate; #endregion #region Ammo Check if (Client.GetRoleplay().GunShots >= Weapon.ClipSize) { Weapon.Reload(Client, TargetClient); Client.GetRoleplay().CooldownManager.CreateCooldown("reload", 1000, Weapon.ReloadTime); return; } #endregion #region Distance Check double Distance = RoleplayManager.GetDistanceBetweenPoints2D(ClientPos, TargetClientPos); if (Distance > Weapon.Range) { RoleplayManager.Shout(Client, "*Tenta acertar o tiro em " + TargetClient.GetHabbo().Username + ", mas erra o alvo*", 4); Client.GetRoleplay().GunShots++; if (Client.GetRoleplay().Game == null) { Client.GetRoleplay().Bullets--; } return; } #endregion #region Target Death Procedure if (TargetClient.GetRoleplay().CurHealth - Damage <= 0) { Client.GetRoleplay().ClearWebSocketDialogue(); string Text = Weapon.FiringText.Split(':')[1]; string GunName = Weapon.PublicName; RoleplayManager.Shout(Client, FormatFiringText(Text, GunName, TargetClient.GetHabbo().Username, Damage, Weapon.Energy), 6); lock (PlusEnvironment.GetGame().GetClientManager().GetClients) { foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (client == null || client.GetHabbo() == null) { continue; } client.SendMessage(new RoomNotificationComposer("staff_notice", "message", "[Notícia Urgente] " + Client.GetHabbo().Username + " matou com tiros o cidadão " + TargetClient.GetHabbo().Username + ", tome cuidado pelas ruas!")); } } if (Client.GetRoleplay().LastKilled != TargetClient.GetHabbo().Id&& TargetClient.GetRoleplay().Game == null) { PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Client, QuestType.KILL_USER); PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Client, "ACH_Kills", 1); PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(TargetClient, "ACH_Death", 1); #region Player Stats Client.GetRoleplay().LastKilled = TargetClient.GetHabbo().Id; Client.GetRoleplay().Kills++; Client.GetRoleplay().GunKills++; if (GroupManager.HasJobCommand(TargetClient, "guide") && TargetClient.GetRoleplay().IsWorking) { TargetClient.GetRoleplay().CopDeaths++; } else { TargetClient.GetRoleplay().Deaths++; } if (!Client.GetRoleplay().WantedFor.Contains("cometer assassinato")) { Client.GetRoleplay().WantedFor = Client.GetRoleplay().WantedFor + "cometer assassinato, "; } #endregion #region Exp Calculator CryptoRandom Random = new CryptoRandom(); int Multiplier = 1; int Chance = Random.Next(1, 101); if (Chance <= 16) { if (Chance <= 8) { Multiplier = 3; } else { Multiplier = 2; } } LevelManager.AddLevelEXP(Client, GetEXP(Client, TargetClient) * Multiplier); #endregion #region Gang Stats Group Gang = GroupManager.GetGang(Client.GetRoleplay().GangId); Group TarGetGang = GroupManager.GetGang(TargetClient.GetRoleplay().GangId); using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { if (Gang != null) { if (Gang.Id > 1000) { int ScoreIncrease = Random.Next(1, 11); Gang.GangKills++; Gang.GangScore += ScoreIncrease; dbClient.RunQuery("UPDATE `rp_gangs` SET `gang_kills` = '" + Gang.GangKills + "', `gang_score` = '" + Gang.GangScore + "' WHERE `id` = '" + Gang.Id + "'"); } } if (TarGetGang != null) { if (TarGetGang.Id > 1000) { TarGetGang.GangDeaths++; dbClient.RunQuery("UPDATE `rp_gangs` SET `gang_deaths` = '" + TarGetGang.GangDeaths + "' WHERE `id` = '" + TarGetGang.Id + "'"); } } } #endregion BountyManager.CheckBounty(Client, TargetClient.GetHabbo().Id); if ((TargetClient.GetRoleplay().CurHealth - Damage) <= 0) { TargetClient.GetRoleplay().CurHealth = 0; } } } #endregion #region Target Damage Procedure (Did not die) else { string Text = Weapon.FiringText.Split(':')[0]; string GunName = Weapon.PublicName; Client.GetRoleplay().OpenUsersDialogue(TargetClient); TargetClient.GetRoleplay().OpenUsersDialogue(Client); PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Client, QuestType.SHOOT_USER); RoleplayManager.Shout(Client, FormatFiringText(Text, GunName, TargetClient.GetHabbo().Username, Damage, Weapon.Energy), 6); } #endregion TargetClient.GetRoleplay().CurHealth -= Damage; if (Client.GetRoleplay().Game == null) { Client.GetRoleplay().Bullets--; } if (Client.GetRoleplay().Game == null) { Client.GetRoleplay().CurEnergy -= Weapon.Energy; } Client.GetRoleplay().GunShots++; if (!Client.GetRoleplay().WantedFor.Contains("tentativa de assaltSo + tentativa/assassinato")) { Client.GetRoleplay().WantedFor = Client.GetRoleplay().WantedFor + "tentativa de assalto + tentativa/assassinato "; } }
/// <summary> /// Ends the jailbreak /// </summary> public override void Execute() { try { if (!JailbreakManager.JailbreakActivated) { base.EndTimer(); return; } List <GameClient> CurrentJailbrokenUsers = PlusEnvironment.GetGame().GetClientManager().GetClients.Where(x => x != null && x.GetHabbo() != null && x.GetRoleplay() != null && x.GetRoleplay().Jailbroken).ToList(); GameClient UserJailbreaking = JailbreakManager.UserJailbreaking; if (CurrentJailbrokenUsers.Count <= 0) { JailbreakManager.JailbreakActivated = false; if (JailbreakManager.FenceBroken) { Room Room = RoleplayManager.GenerateRoom(Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"))); if (Room != null) { JailbreakManager.GenerateFence(Room); } JailbreakManager.FenceBroken = false; } MessagePoliceOfficers(); base.EndTimer(); return; } if (UserJailbreaking != null || UserJailbreaking.GetHabbo().CurrentRoom != null || UserJailbreaking.GetRoomUser() != null) { if (UserJailbreaking.GetHabbo().CurrentRoomId != Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"))) { JailbreakManager.JailbreakActivated = false; if (JailbreakManager.FenceBroken) { Room Room = RoleplayManager.GenerateRoom(Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"))); if (Room != null) { JailbreakManager.GenerateFence(Room); } JailbreakManager.FenceBroken = false; } foreach (GameClient Client in CurrentJailbrokenUsers) { if (Client == null || Client.GetRoleplay() == null || Client.GetHabbo() == null) { continue; } if (Client.GetRoleplay().Jailbroken&& !JailbreakManager.FenceBroken) { Client.GetRoleplay().Jailbroken = false; } if (Client.GetHabbo().CurrentRoomId == Convert.ToInt32(RoleplayData.GetData("jail", "insideroomid"))) { RoleplayManager.GetLookAndMotto(Client); RoleplayManager.SpawnBeds(Client, "bed_silo_one"); Client.SendNotification("O processo para fuga da prisão parou, então você voltou para ela!"); } else { Client.SendNotification("O processo para fuga da prisão parou, então você voltou para ela!"); RoleplayManager.SendUser(Client, Convert.ToInt32(RoleplayData.GetData("jail", "insideroomid"))); } } MessagePoliceOfficers(); RoleplayManager.Shout(UserJailbreaking, "*Para a fuga*", 4); base.EndTimer(); return; } } TimeCount++; TimeLeft -= 1000; if (TimeLeft > 0) { if (TimeCount == 60) { if (UserJailbreaking != null || UserJailbreaking.GetHabbo().CurrentRoom != null || UserJailbreaking.GetRoomUser() != null) { RoleplayManager.Shout(UserJailbreaking, "*Estou mais perto de terminar a fuga dos prisioneiros [" + (TimeLeft / 60000) + " minutos restantes]*", 4); } TimeCount = 0; } return; } foreach (GameClient Client in CurrentJailbrokenUsers) { if (Client == null || Client.GetRoleplay() == null || Client.GetHabbo() == null) { continue; } RoleplayManager.Shout(Client, "*Escapa completamente da prisão graças a um parceiro*", 4); PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Client, "ACH_Jailbreak", 1); Client.GetRoleplay().Jailbroken = false; Client.GetRoleplay().IsWanted = false; Client.GetRoleplay().IsJailed = false; Client.GetHabbo().Poof(); } if (JailbreakManager.FenceBroken) { Room Room = RoleplayManager.GenerateRoom(Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"))); if (Room != null) { JailbreakManager.GenerateFence(Room); } JailbreakManager.FenceBroken = false; } JailbreakManager.JailbreakActivated = false; JailbreakManager.UserJailbreaking = null; base.EndTimer(); return; } catch (Exception e) { Logging.LogRPTimersError("Error in Execute() void: " + e); base.EndTimer(); } }
/// <summary> /// Kills the user normally, sends them to the hospital /// </summary> /// <param name="Client"></param> private void NormalDeath(GameClient Client) { RoleplayManager.Shout(Client, "*Cai no chão desmaiado e morre*", 32); if (Client.GetRoomUser() != null) { Client.GetRoomUser().ApplyEffect(0); } #region Lays User Down if (Client.GetRoomUser() != null) { var User = Client.GetRoomUser(); if (User.isLying) { User.RemoveStatus("lay"); User.isLying = false; } if (User.isSitting) { User.RemoveStatus("sit"); User.isSitting = false; } if ((User.RotBody % 2) == 0) { if (User == null) { return; } try { User.Statusses.Add("lay", "1.0 null"); User.Z -= 0.35; User.isLying = true; User.UpdateNeeded = true; } catch { } } else { User.RotBody--; User.Statusses.Add("lay", "1.0 null"); User.Z -= 0.35; User.isLying = true; User.UpdateNeeded = true; } } #endregion if (Client.GetRoleplay().IsWorking) { WorkManager.RemoveWorkerFromList(Client); Client.GetRoleplay().IsWorking = false; } Client.GetRoleplay().IsDead = true; Client.GetRoleplay().DeadTimeLeft = RoleplayManager.DeathTime; if (Client.GetRoleplay() != null && Client.GetRoleplay().TimerManager != null && Client.GetRoleplay().TimerManager.ActiveTimers != null) { if (Client.GetRoleplay().TimerManager.ActiveTimers.ContainsKey("death")) { Client.GetRoleplay().TimerManager.ActiveTimers["death"].EndTimer(); } Client.GetRoleplay().TimerManager.CreateTimer("death", 1000, true); } PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Client, QuestType.DEATH); int HospitalRID = Convert.ToInt32(RoleplayData.GetData("hospital", "insideroomid")); RoomData roomData = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(HospitalRID); if (Client != null && Client.GetHabbo() != null) { if (Client.GetHabbo().CurrentRoomId == HospitalRID) { RoleplayManager.GetLookAndMotto(Client); RoleplayManager.SpawnBeds(Client, "hosptl_bed"); Client.SendMessage(new RoomNotificationComposer("room_death_axe", "message", "Você morreu! Você está sendo levado ao Hospital.")); } else { Client.SendMessage(new RoomNotificationComposer("room_death_axe", "message", "Você morreu! Você está sendo levado ao Hospital.")); RoleplayManager.SendUser(Client, HospitalRID); } } }
/// <summary> /// Kills the user normally, depends on the event mode /// </summary> /// <param name="Client"></param> private void EventDeath(GameClient Client) { if (Client.GetRoleplay().Game == null) { NormalDeath(Client); } #region Brawl else if (Client.GetRoleplay().Game == Games.RoleplayGameManager.GetGame(Games.GameMode.Brawl)) { Client.GetRoleplay().ReplenishStats(); RoleplayManager.Shout(Client, "*Nocauteado e expulso da briga*", 32); RoleplayManager.SpawnChairs(Client, "es_bench"); Client.SendMessage(new RoomNotificationComposer("room_kick_cannonball", "message", "Você foi nocauteado e perdeu a briga!")); Client.GetRoleplay().Game.RemovePlayerFromGame(Client); } #endregion #region Team Brawl else if (Client.GetRoleplay().Game == Games.RoleplayGameManager.GetGame(Games.GameMode.TeamBrawl)) { Client.GetRoleplay().ReplenishStats(); RoleplayManager.Shout(Client, "*Sai da briga por ser nocauteado*", 32); #region Graveyard Spawn if (Client.GetRoomUser() != null) { int ArenaStartX = Convert.ToInt32(RoleplayData.GetData("teambrawl", "graveyardstartx")); int ArenaStartY = Convert.ToInt32(RoleplayData.GetData("teambrawl", "graveyardstarty")); int ArenaFinishX = Convert.ToInt32(RoleplayData.GetData("teambrawl", "graveyardfinishx")); int ArenaFinishY = Convert.ToInt32(RoleplayData.GetData("teambrawl", "graveyardfinishy")); CryptoRandom Random = new CryptoRandom(); List <ThreeDCoord> Squares = RoleplayManager.GenerateMap(ArenaStartX, ArenaStartY, ArenaFinishX, ArenaFinishY); ThreeDCoord RandomSquare = Squares[Random.Next(0, Squares.Count)] == null?Squares.FirstOrDefault() : Squares[Random.Next(0, Squares.Count)]; Client.GetRoomUser().ClearMovement(true); var Room = RoleplayManager.GenerateRoom(Client.GetRoomUser().RoomId); if (Room != null) { Room.GetGameMap().UpdateUserMovement(new Point(Client.GetRoomUser().X, Client.GetRoomUser().Y), new Point(RandomSquare.X, RandomSquare.Y), Client.GetRoomUser()); } Client.GetRoomUser().X = RandomSquare.X; Client.GetRoomUser().Y = RandomSquare.Y; Client.GetRoomUser().UpdateNeeded = true; } #endregion Client.SendMessage(new RoomNotificationComposer("room_kick_cannonball", "message", "Você foi nocauteado da Briga de Times!")); if (!Client.GetRoleplay().Team.LostMembers.Contains(Client.GetHabbo().Id)) { Client.GetRoleplay().Team.LostMembers.Add(Client.GetHabbo().Id); } if (Client.GetRoleplay().Team.LostMembers.Count == Client.GetRoleplay().Team.Members.Count) { Client.GetRoleplay().Team.InGame = false; } } #endregion #region SoloQueue else if (Client.GetRoleplay().Game.GetGameMode() == Games.GameMode.SoloQueue || Client.GetRoleplay().Game.GetGameMode() == Games.GameMode.SoloQueueGuns) { Client.GetRoleplay().ReplenishStats(); RoleplayManager.Shout(Client, "*Sai do Soloqueue por ser nocauteado*", 32); RoleplayManager.SpawnChairs(Client, "es_bench"); Client.SendMessage(new RoomNotificationComposer("room_kick_cannonball", "message", "Você foi nocauteado do Soloqueue!")); Client.GetRoleplay().Game.RemovePlayerFromGame(Client); } #endregion #region Colour Wars else if (Client.GetRoleplay().Game == Games.RoleplayGameManager.GetGame(Games.GameMode.ColourWars)) { Client.GetRoleplay().ReplenishStats(); Client.GetRoleplay().NeedsRespawn = true; RoleplayManager.Shout(Client, "*Nocauteado! Você está sendo levado para sala de revivência*", 32); RoleplayManager.SendUser(Client, Client.GetRoleplay().Team.SpawnRoom); Client.SendMessage(new RoomNotificationComposer("room_kick_cannonball", "message", "Você foi nocauteado. Vai demorar dois minutos para recuperar.")); new Thread(() => { Thread.Sleep(2000); int Counter = 0; while (Counter < 200) { if (Client == null || Client.GetRoleplay() == null || Client.GetRoleplay().Game == null || Client.GetRoleplay().Team == null || Client.GetRoleplay().Game.GetGameMode() != Games.GameMode.ColourWars) { if (Client.GetRoomUser() != null) { Client.GetRoomUser().CanWalk = true; } if (Client.GetRoleplay() != null) { Client.GetRoleplay().NeedsRespawn = false; } break; } Counter++; Thread.Sleep(1000); if (Counter == 30) { Client.SendWhisper("Você tem 1 minuto, 30 segundos restantes até que você possa se mover novamente!", 1); } else if (Counter == 60) { Client.SendWhisper("Você tem 1 minuto restante até que você possa se mover novamente!", 1); } else if (Counter == 90) { Client.SendWhisper("Você tem 30 segundos restantes até que você possa se mover novamente!", 1); } else if (Counter == 110) { Client.SendWhisper("Você tem 10 segundos restantes até que você possa se mover novament!", 1); } else if (Counter == 120) { Client.SendWhisper("Você agora está consciente e pode se mover!", 1); } else if (Counter >= 121) { if (Client.GetRoomUser() != null) { Client.GetRoomUser().CanWalk = true; } if (Client.GetRoleplay() != null) { Client.GetRoleplay().NeedsRespawn = false; } break; } } }).Start(); } #endregion #region Mafia Wars else if (Client.GetRoleplay().Game == Games.RoleplayGameManager.GetGame(Games.GameMode.MafiaWars)) { Client.GetRoleplay().ReplenishStats(); Client.GetRoleplay().NeedsRespawn = true; RoleplayManager.Shout(Client, "*Nocauteado! Você está sendo levado para sala de revivência*", 32); RoleplayManager.SendUser(Client, Client.GetRoleplay().Team.SpawnRoom); Client.SendMessage(new RoomNotificationComposer("room_kick_cannonball", "message", "Você foi nocauteado! Levará 35 segundos para recuperar.")); new Thread(() => { Thread.Sleep(2000); if (Client.GetRoomUser() != null) { Client.GetRoomUser().ApplyEffect(EffectsList.Ghost); Client.GetRoomUser().Frozen = true; } Thread.Sleep(4000); int Counter = 0; while (Counter < 30) { if (Client == null) { break; } if (Client.GetRoomUser() == null) { break; } Counter++; Thread.Sleep(1000); if (Counter == 30) { Client.SendWhisper("Agora você pode se mover novamente!", 1); if (Client.GetRoomUser() != null) { Client.GetRoomUser().ApplyEffect(EffectsList.None); Client.GetRoomUser().CanWalk = true; Client.GetRoomUser().Frozen = false; } if (Client.GetRoleplay() != null) { Client.GetRoleplay().NeedsRespawn = false; } break; } } }).Start(); } #endregion }