Пример #1
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);
					}
				}
			}
		}
Пример #2
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;
			}
		}
Пример #3
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();
			}
		}
Пример #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 && 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
						{
						}
					}
				}
			}
		}
Пример #5
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
					{
					}
				}
			}
		}
Пример #6
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;
				}
			}
		}
Пример #7
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.UnlockWalking();
				}
				RoomItem_0.InteractingUser = 0u;
			}
			if (RoomItem_0.InteractingUser2 != 0u)
			{
				RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.InteractingUser2);
				if (@class != null)
				{
					@class.UnlockWalking();
				}
				RoomItem_0.InteractingUser2 = 0u;
			}
		}
Пример #8
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;
			}
		}
Пример #9
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);
			}
		}
Пример #10
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);
			}
		}
		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);
			}
		}
Пример #12
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
		{
			Room room = Item.GetRoom();
			RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (roomUserByHabbo != null && room != null)
			{
				Coord coord = new Coord(Item.GetX + 1, Item.GetY);
				Coord coord2 = new Coord(Item.GetX - 1, Item.GetY);
				Coord coord3 = new Coord(Item.GetX, Item.GetY + 1);
				Coord coord4 = new Coord(Item.GetX, Item.GetY - 1);
				if ((roomUserByHabbo.Coordinate != coord) && (roomUserByHabbo.Coordinate != coord2) && (roomUserByHabbo.Coordinate != coord3) && (roomUserByHabbo.Coordinate != coord4))
				{
					if (roomUserByHabbo.CanWalk)
					{
						roomUserByHabbo.MoveTo(Item.Coordinate);
					}
				}
				else
				{
					int num = Item.GetX;
					int num2 = Item.GetY;
					if (roomUserByHabbo.Coordinate == coord)
					{
						num = Item.GetX - 1;
						num2 = Item.GetY;
					}
					else
					{
						if (roomUserByHabbo.Coordinate == coord2)
						{
							num = Item.GetX + 1;
							num2 = Item.GetY;
						}
						else
						{
							if (roomUserByHabbo.Coordinate == coord3)
							{
								num = Item.GetX;
								num2 = Item.GetY - 1;
							}
							else
							{
								if (roomUserByHabbo.Coordinate == coord4)
								{
									num = Item.GetX;
									num2 = Item.GetY + 1;
								}
							}
						}
					}
					if (room.method_37(num, num2, true, true, true, true, false))
					{
						List<RoomItem> list_ = new List<RoomItem>();
						list_ = room.method_93(num, num2);
						double double_ = room.method_84(num, num2, list_);
						ServerMessage Message = new ServerMessage(230u);
						Message.AppendInt32(Item.GetX);
						Message.AppendInt32(Item.GetY);
						Message.AppendInt32(num);
						Message.AppendInt32(num2);
						Message.AppendInt32(1);
						Message.AppendUInt(Item.Id);
						Message.AppendByte(2);
						Message.AppendStringWithBreak(double_.ToString());
						Message.AppendString("M");
						room.SendMessage(Message, null);
						room.method_81(Item, num, num2, double_);
					}
				}
			}
		}
Пример #13
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (this.Modes != 0 && (UserHasRight || Item.GetBaseItem().InteractionType.ToLower() == "switch"))
			{
				if (Item.GetBaseItem().InteractionType.ToLower() == "switch" && Session != null)
				{
					RoomUser @class = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
					if (@class.Coordinate.X - Item.SquareInFront.X > 1 || @class.Coordinate.Y - Item.SquareInFront.Y > 1)
					{
						if (@class.CanWalk)
						{
							@class.MoveTo(Item.Coordinate);
							return;
						}
						return;
					}
				}
				int num = 0;
				if (Item.ExtraData.Length > 0)
				{
					num = int.Parse(Item.ExtraData);
				}
				int num2;
				if (num <= 0)
				{
					num2 = 1;
				}
				else
				{
					if (num >= this.Modes)
					{
						num2 = 0;
					}
					else
					{
						num2 = num + 1;
					}
				}
				if (Item.GetBaseItem().Name.Contains("jukebox"))
				{
					ServerMessage Message = new ServerMessage(327u);
					if (num2 == 1)
					{
						Message.AppendInt32(7);
						Message.AppendInt32(6);
						Message.AppendInt32(7);
						Message.AppendInt32(0);
						Message.AppendInt32(0);
						Item.int_0 = 1;
						Item.TimerRunning = true;
						Item.UpdateNeeded = true;
					}
					else
					{
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(0);
						Item.int_0 = 0;
						Item.TimerRunning = false;
						Item.GetRoom().int_13 = 0;
					}
					Item.GetRoom().SendMessage(Message, null);
				}
				double double_ = Item.TotalHeight;
				Item.ExtraData = num2.ToString();
				Item.UpdateState();
				if (double_ != Item.TotalHeight)
				{
					Dictionary<int, AffectedTile> dictionary = Item.GetAffectedTiles;
					if (dictionary == null)
					{
						dictionary = new Dictionary<int, AffectedTile>();
					}
					Item.GetRoom().UpdateUserStatus(Item.GetRoom().GetUserForSquare(Item.GetX, Item.GetY), true, false);
					foreach (AffectedTile current in dictionary.Values)
					{
						Item.GetRoom().UpdateUserStatus(Item.GetRoom().GetUserForSquare(current.X, current.Y), true, false);
					}
				}
				if (Session != null)
				{
					RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
					Item.GetRoom().method_10(RoomUser_, Item);
				}
			}
		}
Пример #14
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (Session != null)
			{
				RoomUser roomUserByHabbo = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
				Room room = Item.GetRoom();
				if (Item.GetRoom().method_99(Item.GetX, Item.GetY, roomUserByHabbo.X, roomUserByHabbo.Y))
				{
					Item.GetRoom().method_10(roomUserByHabbo, Item);
					int num = Item.GetX;
					int num2 = Item.GetY;
					Item.ExtraData = "11";
					if (roomUserByHabbo.RotBody == 4)
					{
						num2--;
					}
					else
					{
						if (roomUserByHabbo.RotBody == 0)
						{
							num2++;
						}
						else
						{
							if (roomUserByHabbo.RotBody == 6)
							{
								num++;
							}
							else
							{
								if (roomUserByHabbo.RotBody == 2)
								{
									num--;
								}
								else
								{
									if (roomUserByHabbo.RotBody == 3)
									{
										num--;
										num2--;
									}
									else
									{
										if (roomUserByHabbo.RotBody == 1)
										{
											num--;
											num2++;
										}
										else
										{
											if (roomUserByHabbo.RotBody == 7)
											{
												num++;
												num2++;
											}
											else
											{
												if (roomUserByHabbo.RotBody == 5)
												{
													num++;
													num2--;
												}
											}
										}
									}
								}
							}
						}
					}
					roomUserByHabbo.MoveTo(Item.GetX, Item.GetY);
					room.method_79(null, Item, num, num2, 0, false, true, true);
				}
			}
		}