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.method_3(true);
             @class.bool_1 = false;
             @class.bool_0 = true;
         }
         RoomItem_0.InteractingUser = 0u;
     }
     if (RoomItem_0.uint_4 != 0u)
     {
         RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(RoomItem_0.uint_4);
         if (@class != null)
         {
             @class.method_3(true);
             @class.bool_1 = false;
             @class.bool_0 = true;
         }
         RoomItem_0.uint_4 = 0u;
     }
 }
        public override void OnRemove(GameClient Session, RoomItem Item)
        {
            DataRow dataRow2;
            using (DatabaseClient @class = Essential.GetDatabase().GetClient())
            {
                dataRow2 = @class.ReadDataRow("SELECT fw_count FROM items_firework WHERE item_id = '" + Item.uint_0 + "'");

                if (dataRow2 != null)
                {
                    Item.FireWorkCount = (int)dataRow2["fw_count"];
                }
                else
                {
                    @class.ExecuteQuery("INSERT INTO items_firework(item_id, fw_count) VALUES ( '" + Item.uint_0 + "', '0')");
                }
            }

            if (Item.FireWorkCount > 0)
            {
                Item.ExtraData = "1";
                Item.UpdateState(true, true);
            }

            else if (Item.FireWorkCount <= 0)
            {
                Item.ExtraData = "0";
                Item.UpdateState(true, true);
            }
        }
示例#3
0
 internal void RemoveFreezeBlock(RoomItem item)
 {
     if (this.freezeBlocks.ContainsKey(item.uint_0))
     {
         this.freezeBlocks.Remove(item.uint_0);
     }
 }
 public override void OnPlace(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(Item);
     roomMusicController.Stop();
     Session.GetHabbo().CurrentRoom.LoadMusic();
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
     if (@class != null && @class.class34_1 == null)
     {
         if (ThreeDCoord.Equals(@class.Position, RoomItem_0.GStruct1_0) || ThreeDCoord.Equals(@class.Position, RoomItem_0.GStruct1_1))
         {
             if (RoomItem_0.InteractingUser == 0u)
             {
                 @class.int_19 = -1;
                 RoomItem_0.InteractingUser = @class.GetClient().GetHabbo().Id;
                 @class.RoomItem_0 = RoomItem_0;
             }
         }
         else
         {
             if (@class.bool_0)
             {
                 try
                 {
                     @class.MoveTo(RoomItem_0.GStruct1_1);
                 }
                 catch
                 {
                 }
             }
         }
     }
 }
示例#6
0
 internal void RemoveFreezeGate(RoomItem item)
 {
     if (this.freezeGates.Contains(item.uint_0))
     {
         this.freezeGates.Remove(item.uint_0);
     }
 }
示例#7
0
 internal void RemoveFreezeScoreboard(RoomItem item)
 {
     if (this.freezeScoreboards.Contains(item.uint_0))
     {
         this.freezeScoreboards.Remove(item.uint_0);
     }
 }
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
                ServerMessage message = new ServerMessage(Outgoing.WiredFurniTrigger);
                message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                    message.AppendInt32(1000000);
                else
                    message.AppendInt32(5);
                message.AppendInt32(0);
                message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                message.AppendInt32(RoomItem_0.uint_0);
                if (RoomItem_0.string_3.Length > 0)
                {
                    message.AppendString(RoomItem_0.string_3);
                }
                else
                {
                    message.AppendString("I");
                }
                message.AppendInt32(1);
                message.AppendInt32(1);
                message.AppendInt32(1);
                message.AppendInt32(3);
                message.AppendInt32(0);
                message.AppendInt32(0);
                Session.SendMessage(message);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
            if (bool_0)
            {
                ServerMessage message = new ServerMessage(Outgoing.WiredEffect); // Updated
                message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                    message.AppendInt32(1000000);
                else
                    message.AppendInt32(5);
                message.AppendInt32(0);
                message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                message.AppendInt32(RoomItem_0.uint_0);
                message.AppendString("");
                message.AppendInt32(2);
                if (RoomItem_0.string_2 != "")
                    message.AppendInt32(int.Parse(RoomItem_0.string_2));
                else
                    message.AppendInt32(5);
                if (RoomItem_0.string_3 != "")
                    message.AppendInt32(int.Parse(RoomItem_0.string_3));
                else
                    message.AppendInt32(1);
                message.AppendInt32(0);
                message.AppendInt32(6);
                message.AppendInt32(0);
                message.AppendInt32(0);
                message.AppendInt32(0);
                Session.SendMessage(message);
            }
		}
示例#10
0
 public override void OnRemove(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.Stop();
     roomMusicController.UnLinkRoomOutputItem();
     Item.UpdateState(true, true);
 }
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
			if (@class != null && (RoomItem_0.GStruct1_2.x < RoomItem_0.GetRoom().RoomModel.int_4 && RoomItem_0.GStruct1_2.y < RoomItem_0.GetRoom().RoomModel.int_5))
			{
                if (ThreeDCoord.IsNot(@class.Position, RoomItem_0.GStruct1_1) && @class.bool_0)
				{
					@class.MoveTo(RoomItem_0.GStruct1_1);
				}
				else
				{
                    if (RoomItem_0.GetRoom().method_30(RoomItem_0.GStruct1_2.x, RoomItem_0.GStruct1_2.y, RoomItem_0.Double_0, true, false) && RoomItem_0.InteractingUser == 0)
					{
                        RoomItem_0.InteractingUser = @class.UId;
						@class.bool_0 = false;
						if (@class.bool_6 && (@class.int_10 != RoomItem_0.GStruct1_1.x || @class.int_11 != RoomItem_0.GStruct1_1.y))
						{
							@class.method_3(true);
						}
						@class.bool_1 = true;
						@class.MoveTo(RoomItem_0.GStruct1_0);
						RoomItem_0.ReqUpdate(3);
					}
				}
			}
		}
示例#12
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
                ServerMessage Message = new ServerMessage(Outgoing.WiredCondition); // Updated
                Message.AppendBoolean(false);
                Message.AppendInt32(5);
                if (RoomItem_0.string_3 != "")
                {
                    Message.AppendInt32(RoomItem_0.string_3.Split(',').Length);

                    foreach (string ItemId in RoomItem_0.string_3.Split(','))
                    {
                        Message.AppendInt32(int.Parse(ItemId));
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                }
                Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                Message.AppendUInt(RoomItem_0.uint_0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(1);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
			}
		}
示例#13
0
 internal void AddFreezeGate(RoomItem item)
 {
     if (this.freezeGates.Contains(item.uint_0))
     {
         this.freezeGates.Remove(item.uint_0);
     }
     this.freezeGates.Add(item.uint_0, item);
 }
示例#14
0
 public WalkUnderElement(double Height, double FullHeight, bool Walkable, uint Id, RoomItem itm)
 {
     this.Id = Id;
     this.Height = Height;
     this.FullHeight = FullHeight;
     this.Walkable = Walkable;
     this.Item = itm;
 }
示例#15
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int int_0, bool bool_0)
		{
			if (bool_0 && Item.ExtraData == "0")
			{
				Item.ExtraData = "1";
				Item.UpdateState(false, true);
				Item.ReqUpdate(4);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0 && RoomItem_0.ExtraData != "-1")
			{
				RoomItem_0.ExtraData = "-1";
				RoomItem_0.UpdateState();
				RoomItem_0.ReqUpdate(10);
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			try
			{
				Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
				if (@class != null)
				{
					if (@class.method_72("stickiepole") > 0 || @class.method_26(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().GetItemById(uint_);
						if (class2 != null)
						{
							if (array[0].StartsWith(":"))
							{
								string text2 = @class.method_98(text);
								if (text2 == null)
								{
                                    ServerMessage Message = new ServerMessage(Outgoing.Item1); // Update
									Message.AppendInt32(11);
									Session.SendMessage(Message);
									return;
								}
								RoomItem RoomItem_ = new RoomItem(class2.uint_0, @class.Id, class2.uint_1, class2.string_0, 0, 0, 0.0, 0, text2, @class,0 , 0, class2.GuildData);
								if (@class.method_82(Session, RoomItem_, true, null))
								{
                                    Session.GetHabbo().GetInventoryComponent().method_12(uint_, 1u, false);
								}
							}
							using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
							{
								class3.ExecuteQuery(string.Concat(new object[]
								{
									"UPDATE items SET room_id = '",
									@class.Id,
									"' WHERE Id = '",
									class2.uint_0,
									"' LIMIT 1"
								}));
							}
						}
					}
				}
			}
			catch
			{
			}
		}
示例#18
0
 public Freeze(Room room)
 {
     this.room = room;
     this.freezeTiles = new Hashtable();
     this.freezeBlocks = new Hashtable();
     this.exitTeleport = null;
     this.rnd = new Random();
     this.gameStarted = false;
 }
示例#19
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_1, bool bool_0)
		{
			if (bool_0)
			{
				if (this.Modes == 0)
				{
					RoomItem_0.UpdateState(false, true);
				}
				int num = 0;
				int num2 = 0;
				if (RoomItem_0.ExtraData.Length > 0)
				{
					num = int.Parse(RoomItem_0.ExtraData);
				}
				if (num <= 0)
				{
					num2 = 1;
				}
				else
				{
					if (num >= this.Modes)
					{
						num2 = 0;
					}
					else
					{
						num2 = num + 1;
					}
				}
				if (num2 == 0)
				{
					if (RoomItem_0.GetRoom().method_97(RoomItem_0.GetX, RoomItem_0.Int32_1))
					{
						return;
					}
					Dictionary<int, AffectedTile> dictionary = RoomItem_0.GetRoom().method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.Int32_1, RoomItem_0.int_3);
					if (dictionary == null)
					{
						dictionary = new Dictionary<int, AffectedTile>();
					}
					foreach (AffectedTile current in dictionary.Values)
					{
						if (RoomItem_0.GetRoom().method_97(current.Int32_0, current.Int32_1))
						{
							return;
						}
					}
				}
				RoomItem_0.ExtraData = num2.ToString();
				RoomItem_0.UpdateState();
				RoomItem_0.GetRoom().method_22();
			}
		}
示例#20
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.bool_0 = true;
				}
			}
		}
		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();
			}
		}
		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.method_3(true);
					@class.method_6();
				}
                RoomItem_0.InteractingUser = 0u;
			}
		}
 public override void OnRemove(GameClient Session, RoomItem RoomItem_0)
 {
     for (int i = 0; i < RoomItem_0.GetRoom().RoomUsers.Length; i++)
     {
         RoomUser user = RoomItem_0.GetRoom().RoomUsers[i];
         if (user != null)
         {
             if (user.onPrivateTile && user.privateTileID == RoomItem_0.uint_0)
             {
                 user.privateTileID = 0;
                 user.onPrivateTile = false;
             }
         }
     }
 }
示例#24
0
        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomMusicController roomMusicController = Essential.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);
                }
            }
        }
        public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
        {
            if (RoomItem_0.ExtraData != "")
            {
                Session.GetHabbo().Figure = RoomItem_0.ExtraData + "." + GetHair(Session.GetHabbo().Figure);
                ServerMessage response = new ServerMessage(Outgoing.UpdateUserInformation);
                response.AppendInt32(-1);
                response.AppendString(Session.GetHabbo().Figure);
                response.AppendString(Session.GetHabbo().Gender.ToLower());
                response.AppendString(Session.GetHabbo().Motto);
                response.AppendInt32(Session.GetHabbo().AchievementScore);
                Session.SendMessage(response);
                if (Session.GetHabbo().InRoom)
                {
                    Room Room = Session.GetHabbo().CurrentRoom;


                    if (Room == null)
                    {
                        return;
                    }


                    RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);


                    if (User == null)
                    {
                        return;
                    }

                    ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                    RoomUpdate.AppendInt32(User.VirtualId);
                    RoomUpdate.AppendString(Session.GetHabbo().Figure);
                    RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
                    RoomUpdate.AppendString(Session.GetHabbo().Motto);
                    RoomUpdate.AppendInt32(Session.GetHabbo().AchievementScore);
                    Room.SendMessage(RoomUpdate, null);
                }
            }
            else
            {

            }
        }
示例#26
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().method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.Int32_1, RoomItem_0.int_3);
				RoomItem_0.GetRoom().method_22();
				RoomItem_0.GetRoom().method_87(RoomItem_0.GetRoom().method_43(RoomItem_0.GetX, RoomItem_0.Int32_1), true, true);
				foreach (AffectedTile current in dictionary.Values)
				{
					RoomItem_0.GetRoom().method_87(RoomItem_0.GetRoom().method_43(current.Int32_0, current.Int32_1), 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 RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0 && Session != null)
			{
				RoomItem_0.CheckExtraData3();
				ServerMessage Message = new ServerMessage(Outgoing.WiredEffect); // Update
                Message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                {
                    Message.AppendInt32(1000000);
                }
                else
                {
                    Message.AppendInt32(5);
                }
                if (RoomItem_0.string_3 != "")
                {
                    Message.AppendInt32(RoomItem_0.string_3.Split(',').Length);
                    foreach (string ItemId in RoomItem_0.string_3.Split(','))
                    {
                        Message.AppendInt32(int.Parse(ItemId));
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                }
				Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
				Message.AppendUInt(RoomItem_0.uint_0);
				Message.AppendStringWithBreak("");
				Message.AppendInt32(0);
				Message.AppendInt32(8);
				Message.AppendInt32(0);
                double value = 0;
                if (RoomItem_0.string_2 != "" && double.TryParse(RoomItem_0.string_2, out value))
                    Message.AppendInt32(Convert.ToInt32(value * 2));
                else
                    Message.AppendInt32(0);
				Message.AppendInt32(0);
				Session.SendMessage(Message);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
                ServerMessage Message = new ServerMessage(Outgoing.WiredFurniTrigger); // Updated
                Message.AppendBoolean(false);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
				Message.AppendUInt(RoomItem_0.uint_0);
				Message.AppendStringWithBreak(RoomItem_0.string_2);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(7);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
				Session.SendMessage(Message);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0 && Session != null)
			{
				RoomItem_0.CheckExtraData3();
                ServerMessage Message = new ServerMessage(Outgoing.WiredCondition); // Updated
                Message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                    Message.AppendInt32(1000000);
                else
                    Message.AppendInt32(5);
                if (RoomItem_0.string_3 != "")
                {
                    Message.AppendInt32(RoomItem_0.string_3.Split(',').Length);

                    foreach (string ItemId in RoomItem_0.string_3.Split(','))
                    {
                        Message.AppendInt32(int.Parse(ItemId));
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                }
				Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
				Message.AppendUInt(RoomItem_0.uint_0);
                Message.AppendString("");
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                /*Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendBoolean(false);
                Message.AppendBoolean(true);*/
				Session.SendMessage(Message);
			}
		}
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     Essential.getWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("4|Bancomat");
     /*  if (!Session.GetHabbo().bankingModeEnabled)
        {
            if (Session.GetHabbo().PIN != "NOACCOUNT")
            {
                Session.Whisper(Essential.GetBankingConfig().getData("text.welcome"));
                Session.Whisper(Essential.GetBankingConfig().getData("text.pincode").Replace("%leave%", Essential.GetBankingConfig().getData("cmd.leave")));
                Session.GetHabbo().bankingModeEnabled = true;
                Session.GetHabbo().nextStep = "PIN";
                RoomUser class4 = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (class4 != null)
                {
                    class4.bool_5 = true;
                }
            }
            else
            {
                Session.Whisper(Essential.GetBankingConfig().getData("text.noaccount"));
            }
        }*/
 }