Exemplo n.º 1
0
 public override void OnPlace(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(Item);
     roomMusicController.Stop();
     Session.GetHabbo().CurrentRoom.LoadMusic();
 }
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(650);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(0);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (Item.Extra2.Length > 0)
				{
					Message.AppendString(Item.Extra2);
				}
				else
				{
					Message.AppendString("RB");
				}
				Message.AppendStringWithBreak("HRAH");
				Session.SendMessage(Message);
				Item.ReqUpdate(1);
			}
		}
Exemplo n.º 3
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int int_0, bool bool_0)
		{
			RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (roomUserByHabbo != null && roomUserByHabbo.Riding == null)
			{
				if ((roomUserByHabbo.Coordinate == Item.Coordinate) || (roomUserByHabbo.Coordinate == Item.SquareInFront))
				{
					if (Item.InteractingUser == 0u)
					{
						roomUserByHabbo.TeleDelay = -1;
						Item.InteractingUser = roomUserByHabbo.GetClient().GetHabbo().Id;
						roomUserByHabbo.Item = Item;
					}
				}
				else
				{
					if (roomUserByHabbo.CanWalk)
					{
						try
						{
							roomUserByHabbo.MoveTo(Item.SquareInFront);
						}
						catch
						{
						}
					}
				}
			}
		}
Exemplo n.º 4
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int int_0, bool bool_0)
		{
			RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (roomUserByHabbo != null && (Item.SquareBehind.X < Item.GetRoom().Model.MapSizeX && Item.SquareBehind.Y < Item.GetRoom().Model.MapSizeY))
			{
				if ((roomUserByHabbo.Coordinate != Item.SquareInFront) && roomUserByHabbo.CanWalk)
				{
					roomUserByHabbo.MoveTo(Item.SquareInFront);
				}
				else
				{
					if (Item.GetRoom().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, Item.GetZ, true, false) && Item.InteractingUser == 0u)
					{
						Item.InteractingUser = roomUserByHabbo.HabboId;
						roomUserByHabbo.CanWalk = false;
						if (roomUserByHabbo.IsWalking && (roomUserByHabbo.GoalX != Item.SquareInFront.X || roomUserByHabbo.GoalY != Item.SquareInFront.Y))
						{
							roomUserByHabbo.ClearMovement(true);
						}
						roomUserByHabbo.AllowOverride = true;
						roomUserByHabbo.MoveTo(Item.Coordinate);
						Item.ReqUpdate(3);
					}
				}
			}
		}
Exemplo n.º 5
0
		public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
		{
			RoomItem_0.ExtraData = "0";
			if (RoomItem_0.InteractingUser != 0u)
			{
				RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.InteractingUser);
				if (@class != null)
				{
					@class.ClearMovement(true);
					@class.AllowOverride = false;
					@class.CanWalk = true;
				}
				RoomItem_0.InteractingUser = 0u;
			}
			if (RoomItem_0.InteractingUser2 != 0u)
			{
				RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.InteractingUser2);
				if (@class != null)
				{
					@class.ClearMovement(true);
					@class.AllowOverride = false;
					@class.CanWalk = true;
				}
				RoomItem_0.InteractingUser2 = 0u;
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight && Session != null)
			{
				Item.method_10();
				ServerMessage Message = new ServerMessage(651);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				if (Item.Extra1.Length > 0)
				{
					Message.AppendString(Item.Extra1);
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendStringWithBreak("");
				Session.SendMessage(Message);
			}
		}
Exemplo n.º 7
0
 public override void OnRemove(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.Stop();
     roomMusicController.UnLinkRoomOutputItem();
     Item.UpdateState(true, true);
 }
Exemplo n.º 8
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight && Item.ExtraData == "0")
			{
				Item.ExtraData = "1";
				Item.UpdateState(false, true);
				Item.ReqUpdate(4);
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			try
			{
				Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
				if (@class != null)
				{
					if (@class.method_72("stickiepole") > 0 || @class.CheckRights(Session))
					{
						uint uint_ = Event.PopWiredUInt();
						string text = Event.PopFixedString();
						string[] array = text.Split(new char[]
						{
							' '
						});
						if (array[0].Contains("-"))
						{
							array[0] = array[0].Replace("-", "");
						}
						UserItem class2 = Session.GetHabbo().GetInventoryComponent().GetItem(uint_);
						if (class2 != null)
						{
							if (array[0].StartsWith(":"))
							{
								string text2 = @class.method_98(text);
								if (text2 == null)
								{
									ServerMessage Message = new ServerMessage(516u);
									Message.AppendInt32(11);
									Session.SendMessage(Message);
									return;
								}
								RoomItem RoomItem_ = new RoomItem(class2.Id, @class.RoomId, class2.BaseItem, class2.ExtraData, 0, 0, 0.0, 0, text2, @class);
								if (@class.method_82(Session, RoomItem_, true, null))
								{
									Session.GetHabbo().GetInventoryComponent().RemoveItem(uint_, 1u, false);
								}
							}
							using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
							{
								class3.ExecuteQuery(string.Concat(new object[]
								{
									"UPDATE items SET room_id = '",
									@class.RoomId,
									"' WHERE Id = '",
									class2.Id,
									"' LIMIT 1"
								}));
							}
						}
					}
				}
			}
			catch
			{
			}
		}
Exemplo n.º 10
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
            if (RoomItem_0.ExtraData != "-1")
			{
                RoomItem_0.ExtraData = "-1";
                RoomItem_0.UpdateState(false, true);
				RoomItem_0.ReqUpdate(3);
			}
		}
Exemplo n.º 11
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight && Item.ExtraData != "-1")
			{
				Item.ExtraData = "-1";
				Item.UpdateState();
				Item.ReqUpdate(10);
			}
		}
Exemplo n.º 12
0
		public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
		{
			RoomItem_0.ExtraData = "0";
			if (RoomItem_0.InteractingUser > 0u)
			{
				RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.InteractingUser);
				if (@class != null)
				{
					@class.CanWalk = true;
				}
			}
		}
Exemplo n.º 13
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				if (this.Modes == 0)
				{
					Item.UpdateState(false, true);
				}
				int num = 0;
				int num2 = 0;
				if (Item.ExtraData.Length > 0)
				{
					num = int.Parse(Item.ExtraData);
				}
				if (num <= 0)
				{
					num2 = 1;
				}
				else
				{
					if (num >= this.Modes)
					{
						num2 = 0;
					}
					else
					{
						num2 = num + 1;
					}
				}
				if (num2 == 0)
				{
					if (Item.GetRoom().method_97(Item.GetX, Item.GetY))
					{
						return;
					}
					Dictionary<int, AffectedTile> dictionary = Item.GetRoom().GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, Item.GetX, Item.GetY, Item.Rot);
					if (dictionary == null)
					{
						dictionary = new Dictionary<int, AffectedTile>();
					}
					foreach (AffectedTile current in dictionary.Values)
					{
						if (Item.GetRoom().method_97(current.X, current.Y))
						{
							return;
						}
					}
				}
				Item.ExtraData = num2.ToString();
				Item.UpdateState();
				Item.GetRoom().GenerateMaps();
			}
		}
Exemplo n.º 14
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
				int num = 0;
				if (RoomItem_0.ExtraData.Length > 0)
				{
					num = int.Parse(RoomItem_0.ExtraData);
				}
				if (int_0 == 0)
				{
					if (num <= -1)
					{
						num = 0;
					}
					else
					{
						if (num >= 0)
						{
							num = -1;
						}
					}
				}
				else
				{
					if (int_0 >= 1)
					{
						if (int_0 == 1)
						{
							num--;
							if (num < 0)
							{
								num = 0;
							}
						}
						else
						{
							if (int_0 == 2)
							{
								num++;
								if (num >= 100)
								{
									num = 0;
								}
							}
						}
					}
				}
				RoomItem_0.ExtraData = num.ToString();
				RoomItem_0.UpdateState();
			}
		}
Exemplo n.º 15
0
		public override void OnRemove(GameClient Session, RoomItem RoomItem_0)
		{
			RoomItem_0.ExtraData = "0";
			if (RoomItem_0.InteractingUser != 0u)
			{
				RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.InteractingUser);
				if (@class != null)
				{
					@class.ClearMovement(true);
					@class.UnlockWalking();
				}
				RoomItem_0.InteractingUser = 0u;
			}
		}
Exemplo n.º 16
0
		public override void OnPlace(GameClient Session, RoomItem Item)
		{
			Item.ExtraData = "0";
			if (Item.InteractingUser != 0u)
			{
				RoomUser @class = Item.GetRoom().GetRoomUserByHabbo(Item.InteractingUser);
				if (@class != null)
				{
					@class.ClearMovement(true);
					@class.UnlockWalking();
				}
				Item.InteractingUser = 0u;
			}
		}
Exemplo n.º 17
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(651);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(1);
				Message.AppendUInt(Item.Id);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Session.SendMessage(Message);
			}
		}
Exemplo n.º 18
0
        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomMusicController roomMusicController = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
            roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(Item);

            if ((UserHasRights && (Session != null)) && (Item != null))
            {
                if (roomMusicController.IsPlaying)
                {
                    roomMusicController.Stop();
                }
                else
                {
                    roomMusicController.Start(Request);
                }
            }
        }
Exemplo n.º 19
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (RoomItem_0.GetBaseItem().Height_Adjustable.Count > 1)
			{
				Dictionary<int, AffectedTile> dictionary = RoomItem_0.GetRoom().GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.GetY, RoomItem_0.Rot);
				RoomItem_0.GetRoom().GenerateMaps();
				RoomItem_0.GetRoom().UpdateUserStatus(RoomItem_0.GetRoom().GetUserForSquare(RoomItem_0.GetX, RoomItem_0.GetY), true, true);
				foreach (AffectedTile current in dictionary.Values)
				{
					RoomItem_0.GetRoom().UpdateUserStatus(RoomItem_0.GetRoom().GetUserForSquare(current.X, current.Y), true, true);
				}
			}
			if (Session != null)
			{
				RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
				RoomItem_0.GetRoom().method_10(RoomUser_, RoomItem_0);
			}
		}
Exemplo n.º 20
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			RoomUser @class = null;
			if (Session != null)
			{
				@class = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
				if (@class == null)
				{
					return;
				}
			}
			if (Session == null || Item.GetRoom().method_99(Item.GetX, Item.GetY, @class.X, @class.Y))
			{
				if (Item.ExtraData != "-1")
				{
					if (Request == -1)
					{
						Item.ExtraData = "0";
						Item.UpdateState();
					}
					else
					{
						Item.InteractingUser = @class.HabboId;
						Item.ExtraData = "-1";
						Item.UpdateState(false, true);
						Item.ReqUpdate(4);
					}
				}
			}
			else
			{
				if (Session != null && @class != null && @class.CanWalk)
				{
					try
					{
						@class.MoveTo(Item.SquareInFront);
					}
					catch
					{
					}
				}
			}
		}
Exemplo n.º 21
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0 && Session != null)
			{
				RoomItem_0.method_10();
				ServerMessage Message = new ServerMessage(652u);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				if (RoomItem_0.Extra1.Length > 0)
				{
					Message.AppendString(RoomItem_0.Extra1);
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendInt32(RoomItem_0.GetBaseItem().SpriteId);
				Message.AppendUInt(RoomItem_0.Id);
				Message.AppendStringWithBreak("");
				Message.AppendStringWithBreak("HH");
				Session.SendMessage(Message);
			}
		}
Exemplo n.º 22
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (RoomItem_0.ExtraData != "1" && RoomItem_0.GetBaseItem().VendingIds.Count >= 1 && RoomItem_0.InteractingUser == 0u)
			{
				if (Session != null)
				{
					RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
					if (@class == null)
					{
						return;
					}
					if (!RoomItem_0.GetRoom().method_99(@class.X, @class.Y, RoomItem_0.GetX, RoomItem_0.GetY))
					{
						if ([email protected])
						{
							return;
						}
						try
						{
							@class.MoveTo(RoomItem_0.SquareInFront);
							return;
						}
						catch
						{
							return;
						}
					}
					RoomItem_0.InteractingUser = Session.GetHabbo().Id;
					@class.CanWalk = false;
					@class.ClearMovement(true);
					@class.SetRot(Rotation.Calculate(@class.X, @class.Y, RoomItem_0.GetX, RoomItem_0.GetY));
				}
				RoomItem_0.ReqUpdate(2);
				RoomItem_0.ExtraData = "1";
				RoomItem_0.UpdateState(false, true);
			}
		}
Exemplo n.º 23
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
				ServerMessage Message = new ServerMessage(650u);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(0);
				Message.AppendInt32(RoomItem_0.GetBaseItem().SpriteId);
				Message.AppendUInt(RoomItem_0.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (RoomItem_0.Extra2.Length > 0)
				{
					Message.AppendString(RoomItem_0.Extra2);
				}
				else
				{
					Message.AppendString("PY");
				}
				Message.AppendStringWithBreak("HRBH");
				Session.SendMessage(Message);
			}
		}
 public override void OnRemove(GameClient Session, RoomItem Item) { }
Exemplo n.º 25
0
		public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
		{
		}
Exemplo n.º 26
0
		public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
		{
            RoomItem_0.ExtraData = "0";
            RoomItem_0.UpdateState(true, false);
		}
Exemplo n.º 27
0
		public override void OnRemove(GameClient Session, RoomItem RoomItem_0)
		{
            RoomItem_0.ExtraData = "0";
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				int num = 0;
				if (Item.ExtraData.Length > 0)
				{
					num = int.Parse(Item.ExtraData);
				}
				if (Request == 0)
				{
					if (num <= -1)
					{
						num = 0;
					}
					else
					{
						if (num >= 0)
						{
							num = -1;
						}
					}
				}
				else
				{
					if (Request >= 1)
					{
						if (Request == 1)
						{
							if (!Item.TimerRunning)
							{
								Item.TimerRunning = true;
								Item.ReqUpdate(1);
								if (Session != null)
								{
									RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
									Item.GetRoom().method_14(RoomUser_);
								}
							}
							else
							{
								Item.TimerRunning = false;
							}
						}
						else
						{
							if (Request == 2)
							{
								num += 60;
								if (num >= 600)
								{
									num = 0;
								}
							}
						}
					}
				}
				Item.ExtraData = num.ToString();
				Item.UpdateState(true, true);
			}
		}
Exemplo n.º 29
0
 public void UnLinkRoomOutputItem()
 {
     this.mRoomOutputItem = null;
 }
Exemplo n.º 30
0
 public void LinkRoomOutputItemIfNotAlreadyExits(RoomItem Item)
 {
     if (this.mRoomOutputItem != null)
     {
     }
     else
     {
         this.mRoomOutputItem = Item;
     }
 }