public void startKilling(GameClient Session, RoomUser RUser) { if (!Session.GetRoleplay().Dead) { Random rand = new Random(); int health = rand.Next(40, 70); if (Session.GetRoleplay().CurHealth - health > 0) { Session.GetRoleplay().CurHealth -= health; Session.GetRoleplay().UpdateStats++; } else { GameClient TargetSession = Session; Session.Shout("*Dies from lack of oxygen*"); Session.SendNotif("You died from lack of oxygen! Always wear a space suit when in space!"); TargetSession.GetRoleplay().DeadFigSet = false; TargetSession.GetRoleplay().DeadSeconds = 60; TargetSession.GetRoleplay().DeadTimer = 2; TargetSession.GetRoleplay().Dead = true; TargetSession.GetRoleplay().SaveStatusComponents("dead"); RoleplayManager.HandleDeath(TargetSession); } } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { Room R = null; if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Room.Id, out R)) { return; } if (Room.Name.ToLower().Contains("gun")) { RoleplayManager.CalledDelivery = false; RoleplayManager.DeliveryWeapon = null; } List <RoomUser> UsersToReturn = Room.GetRoomUserManager().GetRoomUsers().ToList(); PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(R, true); foreach (RoomUser User in UsersToReturn) { if (User == null || User.GetClient() == null) { continue; } RoleplayManager.SendUser(User.GetClient(), Room.Id, "Este quarto foi recarregado para correções!"); } }
public void UnloadRoom(House House) { if (House == null) { return; } Room Room = null; if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(House.RoomId, out Room)) { return; } List <RoomUser> UsersToReturn = Room.GetRoomUserManager().GetRoomUsers().ToList(); PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room, true); foreach (RoomUser User in UsersToReturn) { if (User == null || User.GetClient() == null) { continue; } RoleplayManager.SendUser(User.GetClient(), House.Sign.RoomId, "The house was just bought, so you were sent back outside!"); } }
/// <summary> /// Places the prizes ontop of tile set 2 /// </summary> public void PlaceTiles2() { try { if (timeleft == 8000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize1), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile2.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile2.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile2.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile2.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile2.RoomId); } else if (timeleft == 6000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize2), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile2.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile2.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile2.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile2.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile2.RoomId); } else if (timeleft == 4000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize3), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile2.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile2.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile2.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile2.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile2.RoomId); } else if (timeleft == 2000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize4), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile2.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile2.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile2.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile2.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile2.RoomId); } else if (timeleft == 0) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize5), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile2.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile2.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile2.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile2.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile2.RoomId); } } catch { } }
/// <summary> /// Gets the linked teleport for a target teleport /// </summary> /// <param name="EnteringTeleport"></param> /// <returns></returns> public Item GetLinkedTeleport(Item EnteringTeleport) { int LinkedTele = ItemTeleporterFinder.GetLinkedTele(EnteringTeleport.Id, this.DRoom); int TeleRoomId = ItemTeleporterFinder.GetTeleRoomId(LinkedTele, this.DRoom); if (TeleRoomId <= 0) { return(null); } Room NewRoom = RoleplayManager.GenerateRoom(TeleRoomId); if (NewRoom == null) { return(null); } if (NewRoom.GetRoomItemHandler() == null) { return(null); } Item Teleport = NewRoom.GetRoomItemHandler().GetItem(LinkedTele); return(Teleport); }
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); } }
public void BeginPlacingFoodFurni(Food.Food Food, GameClient Client, Point UserPoint) { if (Client == null) { return; } if (Client.GetRoomUser() == null) { return; } if (base.CachedBot.DRoom == null) { return; } double MaxHeight = 0.0; Item ItemInFront; if (base.CachedBot.DRoom.GetGameMap().GetHighestItemForSquare(Client.GetRoomUser().SquareInFront, out ItemInFront)) { if (ItemInFront != null) { MaxHeight = ItemInFront.TotalHeight; } } base.CachedBot.DRoomUser.SetRot(Client.GetRoomUser().RotBody, false); RoleplayManager.PlaceItemToRoom(Client, Food.ItemId, 0, Client.GetRoomUser().SquareInFront.X, Client.GetRoomUser().SquareInFront.Y, MaxHeight, Client.GetRoomUser().RotBody, false, base.CachedBot.DRoom.Id, false, Food.ExtraData); }
/// <summary> /// Creates a game based on the string gameMode /// </summary> /// <param name="gameMode"></param> /// <returns></returns> public static IGame CreateGame(string gameMode) { GameMode mode = GameList.GetGameModeType(gameMode); IGame game = GetNewGame(mode); if (game == null || RunningGames.ContainsKey(mode)) { return(null); } string EventData = RoleplayData.GetData("eventslobby", gameMode); if (EventData != null) { int EventsLobby = Convert.ToInt32(EventData); var EventsRoom = RoleplayManager.GenerateRoom(EventsLobby); if (EventsRoom != null) { EventsRoom.RoleplayEvent = game; EventsRoom.RoomData.RoleplayEvent = EventsRoom.RoleplayEvent; PlusEnvironment.GetGame().GetRoomManager().UpdateRoom(EventsRoom); } } RunningGames.Add(mode, game); if (GameTick == null || GameTick.ThreadState != ThreadState.Running) { GameTick = new Thread(TickGames); GameTick.Start(); } return(game); }
/// <summary> /// Removes old bet furni and spawns new bet furni /// </summary> public void SpawnStartingBet(int Number) { try { Room Room = RoleplayManager.GenerateRoom(this.RoomId); if (Room == null) { return; } TexasHoldEmPlayer Player = this.PlayerList[Number]; if (Player == null || Player.UserId == 0) { return; } GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Player.UserId); if (Client == null || Client.GetRoleplay() == null || Client.GetHabbo() == null) { return; } RemoveBetFurni(Number); SpawnBetFurni(Number, Player.TotalAmount); } catch (Exception e) { Logging.LogRPGamesError("Error in SpawnStartingBet() void: " + e); } }
/// <summary> /// Removes all bet furni from the pot square /// </summary> public void RemovePotFurni() { try { Room Room = RoleplayManager.GenerateRoom(this.RoomId); if (Room == null || Room.GetRoomItemHandler() == null || Room.GetGameMap() == null) { return; } int X = PotSquare.X; int Y = PotSquare.Y; List <Item> Items = Room.GetGameMap().GetRoomItemForSquare(X, Y).Where(x => x.GetBaseItem().ItemName.ToLower().Contains("cfc")).ToList(); if (Items.Count <= 0) { return; } lock (Items) { foreach (Item Item in Items) { Room.GetRoomItemHandler().RemoveFurniture(null, Item.Id); } } } catch (Exception e) { Logging.LogRPGamesError("Error in RemovePotFurni() void: " + e); } }
private bool DropCrate() { Point DeliveryDropPoint = new Point(this.InteractingBot.oX, this.InteractingBot.oY); if (this.InteractingBot.DRoomUser.Coordinate != DeliveryDropPoint) { return(false); } else { if (!this.DroppedCrate) { var SquareInFront = new Point(this.InteractingBot.DRoomUser.SquareInFront.X, this.InteractingBot.DRoomUser.SquareInFront.Y); double MaxHeight = 0.0; Item ItemInFront; if (this.InteractingBot.DRoom.GetGameMap().GetHighestItemForSquare(SquareInFront, out ItemInFront)) { if (ItemInFront != null) { MaxHeight = ItemInFront.TotalHeight; } } RoleplayManager.PlaceItemToRoom(null, 8029, 0, SquareInFront.X, SquareInFront.Y, MaxHeight, this.InteractingBot.DRoomUser.RotBody, false, this.InteractingBot.DRoom.Id, false, "0", false, "weapon"); this.DroppedCrate = true; } } return(true); }
/// <summary> /// Sends a whisper to all players in the room /// </summary> public void SendWinnerMessage(string Message) { try { Room Room = RoleplayManager.GenerateRoom(this.RoomId); if (Room != null && Room.GetRoomUserManager() != null && Room.GetRoomUserManager().GetRoomUsers() != null) { lock (Room.GetRoomUserManager().GetRoomUsers()) { foreach (var User in Room.GetRoomUserManager().GetRoomUsers()) { if (User == null || User.IsBot || User.GetClient() == null) { continue; } User.GetClient().SendWhisper(Message, 38); } } } } catch (Exception e) { Logging.LogRPGamesError("Error in SendStartMessage() void: " + e); } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { StringBuilder Message = new StringBuilder().Append("<----- Territórios de Gangue ----->\n\n"); if (TurfManager.TurfList.Count == 0) { Message.Append("Não há territórios de gangues disponíveis!\n"); } lock (TurfManager.TurfList) { foreach (Turf Turf in TurfManager.TurfList.Values) { if (Turf == null) { continue; } Room TurfRoom = RoleplayManager.GenerateRoom(Turf.RoomId, false); Groups.Group Gang = Groups.GroupManager.GetGang(Turf.GangId); if (TurfRoom != null) { Message.Append(TurfRoom.Name + " [Quarto ID: " + Turf.RoomId + "] --- Controlado por: " + Gang.Name + "\n"); Message.Append("----------\n"); } } } Session.SendMessage(new MOTDNotificationComposer(Message.ToString())); }
internal HabboHotel.Items.RoomItem retrieveItem(string item_name, bool nearUser = false, RoomUser User = null) { HabboHotel.Items.RoomItem Item = null; if (!nearUser) { foreach (HabboHotel.Items.RoomItem item in GetRoom().GetRoomItemHandler().FloorItems.Values) { if (item.GetBaseItem().Name.ToLower() == item_name.ToLower()) { // Console.WriteLine(item.GetBaseItem().Name); Item = item; } } } else { foreach (HabboHotel.Items.RoomItem item in GetRoom().GetRoomItemHandler().FloorItems.Values) { Vector2D Pos1 = new Vector2D(item.X, item.Y); Vector2D Pos2 = new Vector2D(User.X, User.Y); if (RoleplayManager.Distance(Pos1, Pos2) <= 1 && item.GetBaseItem().Name.ToLower() == item_name.ToLower()) { Item = item; } } } return(Item); }
/// <summary> /// Checks if the client is jailed, if so send the user to jail /// </summary> public void JailCheck(GameClient Client) { if (!Client.GetRoleplay().IsJailed) { return; } if (JailbreakManager.JailbreakActivated) { Client.GetRoleplay().Jailbroken = true; Client.SendNotification("Someone has initiated a jailbreak while you were offline! Better run before you get caught!"); return; } int JailRID = Convert.ToInt32(RoleplayData.GetData("jail", "insideroomid")); if (Client.GetRoleplay().IsWanted || Client.GetRoleplay().WantedLevel != 0 || Client.GetRoleplay().WantedTimeLeft != 0) { Client.GetRoleplay().IsWanted = false; Client.GetRoleplay().WantedLevel = 0; Client.GetRoleplay().WantedTimeLeft = 0; } if (Client.GetHabbo().HomeRoom != JailRID) { Client.GetHabbo().HomeRoom = JailRID; } RoleplayManager.SendUser(Client, JailRID, ""); Client.GetRoleplay().TimerManager.CreateTimer("jail", 1000, true); }
/// <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); } }
/// <summary> /// Gets the damage /// </summary> private int GetDamage(GameClient Client, GameClient TargetClient) { CryptoRandom Randomizer = new CryptoRandom(); Weapon Weapon = Client.GetRoleplay().EquippedWeapon; int MinDamage = Weapon.MinDamage; int MaxDamage = Weapon.MaxDamage; int Damage = Randomizer.Next(MinDamage, MaxDamage); if (Client.GetRoleplay().Class.ToLower() == "gunner") { Damage += Randomizer.Next(1, 3); } if (Client.GetRoleplay().GangId > 1000) { if (GroupManager.HasGangCommand(Client, "gunner")) { if (RoleplayManager.GenerateRoom(Client.GetHabbo().CurrentRoomId, false).TurfEnabled || GroupManager.HasJobCommand(TargetClient, "guide")) { Damage += Randomizer.Next(0, 2); } } } return(Damage); }
/// <summary> /// Places the prizes ontop of tile set 1 /// </summary> public void PlaceTiles1() { try { if (timeleft > 8000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize1), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile1.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile1.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile1.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile1.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 1].Tile1.RoomId); } if (timeleft > 6000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize2), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile1.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile1.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile1.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile1.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 2].Tile1.RoomId); } if (timeleft > 4000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize3), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile1.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile1.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile1.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile1.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 3].Tile1.RoomId); } if (timeleft > 2000) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize4), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile1.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile1.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile1.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile1.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 4].Tile1.RoomId); } if (timeleft > 0) { RoleplayManager.PlaceItemToRoomReturn(Convert.ToUInt32(prize5), SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile1.X, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile1.Y, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile1.Z + 0.1, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile1.Rot, false, SlotsManager.SlotsTilesData[Convert.ToInt32(slot.Id), 5].Tile1.RoomId); } } catch { } }
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 Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { #region Params if (Params.Length < 2) { Session.SendWhisper("Comando inválido, use :fazerchat <nomedochat>", 1); return; } string NewChatName = Convert.ToString(Params[1]); #endregion #region Conditions if (Session.GetRoleplay().BannedFromMakingChat) { Session.SendWhisper("Você está permanentemente banido de fazer salas de bate-papo!", 1); return; } if (!Session.GetRoleplay().PhoneApps.Contains("whatsapp")) { Session.SendWhisper("Você precisa do App WhatsApp para fazer isso!", 1); return; } if (WebSocketChatManager.RunningChatRooms.ContainsKey(NewChatName.ToLower())) { Session.SendWhisper("Esse chat (" + NewChatName.ToLower() + ") já existe! Escolha outro nome!", 1); return; } if ((WebSocketChatManager.RunningChatRooms.Values.Where(Runningchat => Runningchat != null).Where(Runningchat => Runningchat.ChatOwner == Session.GetHabbo().Id).ToList().Count > 0) && Session.GetHabbo().VIPRank < 2) { Session.SendWhisper("Você só pode criar um bate-papo por vez!", 1); return; } Regex regexItem = new Regex("^[a-zA-Z0-9]*$"); if (!regexItem.IsMatch(NewChatName)) { Session.SendWhisper("Nome do bate-papo inválido! Remova todos os caracteres especiais!", 1); return; } #endregion #region Execute WebSocketChatRoom NewChatRoom = new WebSocketChatRoom(NewChatName, Session.GetHabbo().Id, new Dictionary <object, object>() { { "password", "" }, { "gang", 0 }, { "locked", false } }, new List <int>() { }, false); if (NewChatRoom.OnUserJoin(Session)) { NewChatRoom.BeginChatJoin(Session); Session.Shout("*Cria um novo bate-papo no WhatsApp com seu " + RoleplayManager.GetPhoneName(Session) + "*", 4); } #endregion }
public void Execute(GameClients.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 (Session.GetRoleplay().TryGetCooldown("beijar")) { return; } if (TargetUser.IsAsleep) { Session.SendWhisper("Você não pode beijar alguém que está ausente!", 1); return; } #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); if (Distance <= 1) { Session.Shout("*Inclina-se em " + TargetClient.GetHabbo().Username + " e dá um pequeno beijo rápido nos lábios*", 16); Session.GetRoleplay().CooldownManager.CreateCooldown("beijar", 1000, 5); RoomUser.ApplyEffect(EffectsList.Love); TargetUser.ApplyEffect(EffectsList.Love); Session.GetRoleplay().KissTimer = 5; TargetClient.GetRoleplay().KissTimer = 5; return; } else { Session.SendWhisper("Você deve se aproximar desse cidadão para beijá-lo!", 1); return; } #endregion }
/// <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(); } }
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]*"); }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length < 3) { Session.SendWhisper("Por favor, use o comando ':uenviar (usuário) (id do quarto)'.", 1); return; } GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); if (TargetClient == null || TargetClient.GetHabbo() == null) { Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online.", 1); return; } if (TargetClient.GetHabbo().CurrentRoom != null) { if (TargetClient.GetHabbo().CurrentRoom.TutorialEnabled) { Session.SendWhisper("Você não pode enviar alguém que está em uma sala de tutorial!", 1); return; } } int RoomId; if (!int.TryParse(Params[2], out RoomId)) { Session.SendWhisper("Digite um ID válido!", 1); return; } Room TargetRoom = HabboRoleplay.Misc.RoleplayManager.GenerateRoom(RoomId); if (TargetRoom == null) { Session.SendWhisper("Desculpe, não conseguimos encontrar o ID!", 1); return; } if (TargetClient.GetRoleplay().IsDead) { TargetClient.GetRoleplay().IsDead = false; TargetClient.GetRoleplay().ReplenishStats(true); TargetClient.GetHabbo().Poof(); } if (TargetClient.GetRoleplay().IsJailed) { TargetClient.GetRoleplay().IsJailed = false; TargetClient.GetRoleplay().JailedTimeLeft = 0; } Session.Shout("*Envia imediatamente " + TargetClient.GetHabbo().Username + " para " + TargetRoom.Name + " [ID: " + RoomId + "]*", 23); RoleplayManager.SendUser(TargetClient, RoomId, "Você foi enviado para " + TargetRoom.Name + " [ID: " + RoomId + "] por " + Session.GetHabbo().Username + "!"); }
public void Start() { try { GameIsStarting = true; int UserCounter = 0; lock (Players) { foreach (int playerid in Players) { GameClient Player = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(playerid); int Counter = 11; UserCounter++; new Thread(() => { while (Counter > 0) { if (Player != null) { if (Counter == 11) { Player.SendWhisper("A [Guerra de Cores] vai começar em alguns segundos!", 1); } else { Player.SendWhisper("[ATENÇÃO] Começará em " + Counter + " segundos!", 1); } } Counter--; Thread.Sleep(1000); if (Counter == 0) { if (Player != null && Player.GetRoleplay() != null) { PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Player, "ACH_ColourWars", 1); RoleplayManager.SendUser(Player, Player.GetRoleplay().Team.SpawnRoom); Player.GetRoleplay().ReplenishStats(); } GameStarted = true; GameIsStarting = false; } } }).Start(); } } } catch (Exception e) { Logging.LogRPGamesError("Error in Start() void: " + e); } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { UInt32 RoomId = 0; if (Params.Length == 1) { Session.SendWhisper("Opa, você esqueceu de inserir um ID do quarto!", 1); return; } if (!UInt32.TryParse(Params[1].ToString(), out RoomId)) { Session.SendWhisper("Por favor insira um número válido.", 1); return; } Room TargetRoom = RoleplayManager.GenerateRoom(Convert.ToInt32(RoomId)); if (Session.GetRoleplay().IsDead) { Session.SendWhisper("Você não pode taxi enquanto está morto!", 1); return; } if (Session.GetRoleplay().IsJailed) { Session.SendWhisper("Você não pode usar táxi enquanto está preso!!", 1); return; } if (RoomId == Session.GetHabbo().CurrentRoomId) { Session.SendWhisper("Você já está nesta sala!", 1); return; } if (TargetRoom == null) { Session.SendWhisper("[RPG TAXI] Desculpe, não conseguimos encontrar esse quarto!", 1); return; } if (Session.GetRoleplay().Game != null) { Session.SendWhisper("Você não pode usar taxi enquanto está dentro de um evento!", 1); return; } if (!Session.GetHabbo().Username.Contains("Ying")) { Session.Shout("*Pega o Taxi Administrativo e vai imediatamente para o local*", 23); } RoleplayManager.SendUser(Session, (int)RoomId); }
public void Execute(GameClients.GameClient Session, Room Room, string[] Params) { #region Conditions if (Params.Length < 2) { Session.SendWhisper("Comando inválido! Use :todospet <animal>", 1); return; } int TargetPetId; if (!int.TryParse(Params[1], out TargetPetId)) { TargetPetId = RoleplayManager.GetPetIdByString(Params[1].ToString()); } if (TargetPetId == 0) { Session.SendWhisper("Opa, não existe um animal de estimação com esse nome!", 1); return; } #endregion #region Execute lock (PlusEnvironment.GetGame().GetClientManager().GetClients) { foreach (var Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (Client == null || Client.GetHabbo() == null || Client.GetRoleplay() == null || Client.GetRoomUser() == null) { continue; } if (Client.GetHabbo().PetId == TargetPetId) { continue; } //Change the Clients Pet Id. Client.GetHabbo().PetId = (TargetPetId == -1 ? 0 : TargetPetId); //Quickly remove the old Client instance. Client.GetRoomUser().GetRoom().SendMessage(new UserRemoveComposer(Client.GetRoomUser().VirtualId)); //Add the new one, they won't even notice a thing!!11 8-) Client.GetRoomUser().GetRoom().SendMessage(new UsersComposer(Client.GetRoomUser())); //Tell them a quick message. if (Client.GetHabbo().PetId > 0) { Client.SendWhisper("Um administrador transformou você em " + Params[1].ToString(), 1); } } Session.Shout("Transforma todos do hotel em " + Params[1].ToString() + "*", 23); } #endregion }
public Game() { this._clientManager = new GameClientManager(); this._clientWebManager = new WebClientManager(); this._roleManager = new RoleManager(); this._roleManager.Init(); this._itemDataManager = new ItemDataManager(); this._itemDataManager.Init(); this._catalogManager = new CatalogManager(); this._catalogManager.Init(this._itemDataManager); this._navigatorManager = new NavigatorManager(); this._navigatorManager.Init(); this._roleplayManager = new RoleplayManager(); this._roleplayManager.Init(); this._roomManager = new RoomManager(); this._roomManager.LoadModels(); this._groupManager = new GroupManager(); this._groupManager.Init(); this._moderationManager = new ModerationManager(); this._moderationManager.LoadMessageTopics(); this._moderationManager.LoadMessagePresets(); this._moderationManager.LoadPendingTickets(); this._moderationManager.LoadTicketResolution(); this._questManager = new QuestManager(); this._questManager.Initialize(); this._hotelViewManager = new HotelViewManager(); this._guideManager = new GuideManager(); this._packetManager = new PacketManager(); this._chatManager = new ChatManager(); this._effectsInventory = new EffectsInventoryManager(); this._effectsInventory.Init(); this._achievementManager = new AchievementManager(); this._animationManager = new AnimationManager(); this._animationManager.Init(); this._notiftopManager = new NotifTopManager(); this._notiftopManager.Init(); DatabaseCleanup(); LowPriorityWorker.Init(); this.moduleWatch = new Stopwatch(); }
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 { } }