예제 #1
0
파일: TeleHandler.cs 프로젝트: habb0/Bfly
        internal static UInt32 GetTeleRoomId(UInt32 TeleId, Room pRoom)
        {
            if (pRoom.GetRoomItemHandler().GetItem(TeleId) != null)
                return pRoom.RoomId;

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT room_id FROM items_rooms WHERE item_id = " + TeleId);
                DataRow Row = dbClient.getRow();

                if (Row == null)
                {
                    return 0;
                }

                return Convert.ToUInt32(Row[0]);
            }
        }
예제 #2
0
파일: TeleHandler.cs 프로젝트: habb0/Bfly
        internal static bool IsTeleLinked(UInt32 TeleId, Room pRoom)
        {
            uint LinkId = GetLinkedTele(TeleId, pRoom);

            if (LinkId == 0)
            {
                return false;
            }

            RoomItem item = pRoom.GetRoomItemHandler().GetItem(LinkId);
            if (item != null && item.GetBaseItem().InteractionType == Butterfly.HabboHotel.Items.InteractionType.teleport)
                return true;

            uint RoomId = GetTeleRoomId(LinkId, pRoom);

            if (RoomId == 0)
            {
                return false;
            }

            return true;
        }
예제 #3
0
파일: Rooms.cs 프로젝트: BjkGkh/R106
        private void HandleFloorItemPlace(UserItem item, Room room, int X, int Y, int Rot)
        {

            if (Session.GetHabbo().forceRot > -1)
                Rot = Session.GetHabbo().forceRot;

            RoomItem roomItem = new RoomItem(item.itemID, room.RoomId, item.BaseItemID,room.OwnerId, item.extraData, X, Y, 0, Rot, room);

            if (room.GetRoomItemHandler().SetFloorItem(Session, roomItem, X, Y, Rot, true, false, true))
                Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(item.itemID, true);

            if (WiredUtillity.TypeIsWired(item.GetBaseItem().InteractionType))
                WiredSaver.HandleDefaultSave(item.itemID, room);

            ButterflyEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.FURNI_PLACE);

        }
예제 #4
0
파일: Rooms.cs 프로젝트: BjkGkh/R106
        private void HandleWallItemPlace(UserItem item, string placementData, Room room)
        {
            string[] dataBits = placementData.Split(' ');
            if (!dataBits[1].StartsWith(":")) //Is wallitem
                return;

            switch (item.GetBaseItem().InteractionType)
            {
                case Butterfly.HabboHotel.Items.InteractionType.dimmer:
                    {
                        MoodlightData moodData = room.MoodlightData;
                        if (moodData != null && room.GetRoomItemHandler().GetItem(moodData.ItemId) != null)
                        {
                            Session.SendChatMessage("Je kunt maar 1 sfeerverlichter per kamer plaatsen.", 0);
                            return;
                        }
                    }
                    break;
            }

            try
            {
                WallCoordinate coordinate = new WallCoordinate(":" + placementData.Split(':')[1]);
                RoomItem roomItem = new RoomItem(item.itemID, room.RoomId, item.BaseItemID, item.extraData, coordinate, room);

                if (room.GetRoomItemHandler().SetWallItem(Session, roomItem))
                {
                    Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(item.itemID, true);
                }
            }
            catch
            {
                return;
            }
        }