Exemplo n.º 1
0
        public override void OnUserSay(RoomUser User, string Message)
        {
            if (base.GetRoom().TileDistance(base.GetRoomUser().X, base.GetRoomUser().Y, User.X, User.Y) > 8)
            {
                return;
            }

            BotResponse Response = base.GetBotData().GetResponse(Message);

            if (Response == null)
            {
                return;
            }

            switch (Response.ResponseType.ToLower())
            {
                case "say":
                    GetRoomUser().Chat(null, Response.ResponseText, false);
                    break;

                case "shout":
                    GetRoomUser().Chat(null, Response.ResponseText, true);
                    break;

                case "whisper":
                    ServerMessage TellMsg = new ServerMessage(25);
                    TellMsg.AppendInt32(GetRoomUser().VirtualId);
                    TellMsg.AppendStringWithBreak(Response.ResponseText);
                    TellMsg.AppendBoolean(false);

                    User.GetClient().SendMessage(TellMsg);
                    break;
            }

            if (Response.ServeId >= 1)
            {
                User.CarryItem(Response.ServeId);
            }
        }
Exemplo n.º 2
0
        public void RunPhxMagic(RoomUser User, string command, string data)
        {
            data = this.VariablePhxMagic(User, data);
            switch (command)
            {
                case "sql":
                    {
                        using (DatabaseClient client = PhoenixEnvironment.GetDatabase().GetClient())
                        {
                            client.ExecuteQuery(data);
                            break;
                        }
                    }
                case "badge":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    //User.GetClient().GetHabbo().GetBadgeComponent().GiveBadge(User.GetClient(), PhoenixEnvironment.FilterInjectionChars(data), true);
                    User.GetClient().SendMessage(User.GetClient().GetHabbo().GetBadgeComponent().Serialize());
                    return;

                case "effect":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().AddEffect(Convert.ToInt32(data), 0xe10);
                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().EnableEffect(Convert.ToInt32(data));
                    return;

                case "award":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockNextAchievement(User.GetClient(), Convert.ToUInt32(data));
                    return;

                case "dance":
                    {
                        if (User.GetClient() == null)
                        {
                            break;
                        }
                        RoomUser roomUserByHabbo = this.GetRoomUserByHabbo(User.GetClient().GetHabbo().Id);
                        roomUserByHabbo.DanceId = Convert.ToInt32(data);
                        ServerMessage message = new ServerMessage(480);
                        message.AppendInt32(roomUserByHabbo.VirtualId);
                        message.AppendInt32(Convert.ToInt32(data));
                        this.SendMessage(message, null);
                        return;
                    }
                case "send":
                    {
                        if (User.GetClient() == null)
                        {
                            break;
                        }
                        uint roomId = Convert.ToUInt32(data);
                        Room room = null;
                        if (PhoenixEnvironment.GetGame().GetRoomManager().IsRoomLoaded(roomId) || PhoenixEnvironment.GetGame().GetRoomManager().IsRoomLoading(roomId))
                        {
                            room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(roomId);
                        }
                        else
                        {
                            room = PhoenixEnvironment.GetGame().GetRoomManager().LoadRoom(roomId);
                        }
                        if (User == null)
                        {
                            break;
                        }
                        if (room == null)
                        {
                            this.RemoveUserFromRoom(User.GetClient(), true, false);
                            return;
                        }
                        ServerMessage message2 = new ServerMessage(0x11e);
                        message2.AppendBoolean(room.IsPublic);
                        message2.AppendUInt(Convert.ToUInt32(data));
                        User.GetClient().SendMessage(message2);
                        return;
                    }
                case "credits":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    User.GetClient().GetHabbo().Credits += Convert.ToInt32(data);
                    User.GetClient().GetHabbo().UpdateCreditsBalance(true);
                    return;

                case "pixels":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    User.GetClient().GetHabbo().ActivityPoints += Convert.ToInt32(data);
                    User.GetClient().GetHabbo().UpdateActivityPointsBalance(true);
                    return;

                case "points":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    User.GetClient().GetHabbo().shells += Convert.ToInt32(data);
                    User.GetClient().GetHabbo().UpdateShellsBalance(false, true);
                    return;

                case "rank":
                    if ((User.GetClient() == null) || (Convert.ToUInt16(data) >= PhoenixEnvironment.GetGame().GetRoleManager().RankCount()))
                    {
                        break;
                    }
                    using (DatabaseClient client2 = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        client2.ExecuteQuery(string.Concat(new object[] { "UPDATE users SET rank = '", Convert.ToUInt16(data), "' WHERE id = ", User.GetClient().GetHabbo().Id, " LIMIT 1;" }));
                    }
                    User.GetClient().Disconnect();
                    return;

                case "respect":
                    {
                        if (User.GetClient() == null)
                        {
                            break;
                        }
                        Habbo habbo = User.GetClient().GetHabbo();
                        habbo.Respect++;
                        using (DatabaseClient client3 = PhoenixEnvironment.GetDatabase().GetClient())
                        {
                            client3.ExecuteQuery("UPDATE user_stats SET Respect = respect + 1 WHERE id = '" + User.GetClient().GetHabbo().Id + "' LIMIT 1");
                        }
                        ServerMessage message3 = new ServerMessage(440);
                        message3.AppendUInt(User.GetClient().GetHabbo().Id);
                        message3.AppendInt32(User.GetClient().GetHabbo().Respect);
                        this.SendMessage(message3, null);
                        int num3 = User.GetClient().GetHabbo().Respect;
                        if (num3 > 0xa6)
                        {
                            switch (num3)
                            {
                                case 0x2fe:
                                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 8);
                                    return;

                                case 0x3c6:
                                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 9);
                                    return;

                                case 0x45c:
                                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 10);
                                    return;

                                case 0x16e:
                                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 6);
                                    return;

                                case 0x236:
                                    PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 7);
                                    break;
                            }
                            return;
                        }
                        switch (num3)
                        {
                            case 0x10:
                                PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 3);
                                return;

                            case 0x42:
                                PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 4);
                                return;

                            case 0xa6:
                                PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 5);
                                return;

                            case 1:
                                PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 1);
                                return;

                            case 6:
                                PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 14, 2);
                                break;
                        }
                        return;
                    }
                case "handitem":
                    if (User.GetClient() == null)
                    {
                        break;
                    }
                    this.GetRoomUserByHabbo(User.GetClient().GetHabbo().Id).CarryItem(Convert.ToInt16(data));
                    return;

                case "alert":
                    if (User.GetClient() != null)
                    {
                        User.GetClient().SendNotif(data);
                    }
                    break;

                default:
                    return;
            }
        }
Exemplo n.º 3
0
        internal void OnNewUserEnter(RoomUser user)
        {
            if ((user.GetClient() != null) && (this.mSong != null))
            {
                this.mSongQueuePosition++;
                user.GetClient().SendMessage(JukeboxDiscksComposer.ComposePlayingComposer(this.mSong.SongData.Id, this.mSongQueuePosition, this.SongSyncTimestamp));
            }

            if (HasLinkedItem)
            {
                if (this.mIsPlaying != true && this.mSong == null && this.mRoomOutputItem.ExtraData == "1" && this.mPlaylist.Count >= 1)
                {
                    this.Start(0);
                }
            }
        }
Exemplo n.º 4
0
        public void UpdateUserStatus(RoomUser User, bool bool_13, bool bool_14)
        {
            int num = 0;
            try
            {
                if (User != null)
                {
                    num = 1;
                    if (User.IsPet)
                    {
                        User.PetData.X = User.X;
                        User.PetData.Y = User.Y;
                        User.PetData.Z = User.Z;
                    }
                    else
                    {
                        if (User.IsBot)
                        {
                            User.BotData.X = User.X;
                            User.BotData.Y = User.Y;
                            User.BotData.Z = User.Z;
                        }
                        else
                        {
                            if (User.Riding != null && User.Target != null)
                            {
                                return;
                            }
                        }
                    }
                    num = 2;
                    if (!User.Visible)
                    {
                        User.UpdateNeeded = false;
                    }
                    else
                    {
                        num = 3;
                        if (bool_13)
                        {
                            num = 4;
                            if (User.byte_1 > 0)
                            {
                                num = 5;
                                if (User.IsBot)
                                {
                                    if (this.byte_1[User.X, User.Y] == 0)
                                    {
                                        User.BotData.EffectId = -1;
                                        User.byte_1 = 0;
                                    }
                                }
                                else
                                {
                                    num = 6;
                                    if ((User.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[User.X, User.Y] == 0) || (User.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[User.X, User.Y] == 0))
                                    {
                                        User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                        User.byte_1 = 0;
                                    }
                                }
                            }
                            num = 7;
                            if (User.Statusses.ContainsKey("lay") || User.Statusses.ContainsKey("sit"))
                            {
                                User.Statusses.Remove("lay");
                                User.Statusses.Remove("sit");
                                User.UpdateNeeded = true;
                            }
                            List<RoomItem> list = this.method_93(User.X, User.Y);
                            double num2 = this.method_84(User.X, User.Y, list);
                            if (num2 != User.Z)
                            {
                                User.Z = num2;
                                User.UpdateNeeded = true;
                            }
                            num = 8;
                            if (this.Model.SqState[User.X, User.Y] == SquareState.SEAT)
                            {
                                if (!User.Statusses.ContainsKey("sit"))
                                {
                                    User.Statusses.Add("sit", "1.0");
                                    if (User.byte_1 > 0)
                                    {
                                        if (!User.IsBot)
                                        {
                                            User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                        }
                                        else
                                        {
                                            User.BotData.EffectId = -1;
                                        }
                                        User.byte_1 = 0;
                                    }
                                }
                                num = 9;
                                User.Z = this.Model.SqFloorHeight[User.X, User.Y];
                                User.RotHead = this.Model.SqSeatRot[User.X, User.Y];
                                User.RotBody = this.Model.SqSeatRot[User.X, User.Y];
                                if (User.IsBot && User.BotData.Rider != null)
                                {
                                    User.BotData.Rider.Z = User.Z + 1.0;
                                    User.BotData.Rider.RotHead = User.RotHead;
                                    User.BotData.Rider.RotBody = User.RotBody;
                                }
                                User.UpdateNeeded = true;
                            }
                            if (list.Count < 1 && this.list_4.Contains(User.HabboId))
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, false);
                                this.list_4.Remove(User.HabboId);
                                User.int_14 = 0;
                                User.UpdateNeeded = true;
                            }
                            num = 10;
                            lock (list)
                            {
                                foreach (RoomItem Item in list)
                                {
                                    num = 11;
                                    if (Item.GetBaseItem().IsSeat && (!User.IsPet || User.BotData.Rider == null))
                                    {
                                        if (!User.Statusses.ContainsKey("sit"))
                                        {
                                            double num3;
                                            try
                                            {
                                                if (Item.GetBaseItem().Height_Adjustable.Count > 1)
                                                {
                                                    num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
                                                }
                                                else
                                                {
                                                    num3 = Item.GetBaseItem().Height;
                                                }
                                                goto IL_BCA;
                                            }
                                            catch
                                            {
                                                num3 = Item.GetBaseItem().Height;
                                                goto IL_BCA;
                                            }
                                        IL_51B:
                                            if (User.byte_1 > 0)
                                            {
                                                if (!User.IsBot)
                                                {
                                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                                }
                                                else
                                                {
                                                    User.BotData.EffectId = -1;
                                                }
                                                User.byte_1 = 0;
                                                goto IL_55D;
                                            }
                                            goto IL_55D;
                                        IL_BCA:
                                            if (User.Statusses.ContainsKey("sit"))
                                            {
                                                goto IL_51B;
                                            }
                                            User.Statusses.Add("sit", num3.ToString().Replace(',', '.'));
                                            goto IL_51B;
                                        }
                                    IL_55D:
                                        User.Z = Item.GetZ;
                                        User.RotHead = Item.Rot;
                                        User.RotBody = Item.Rot;
                                        if (User.IsBot && User.BotData.Rider != null)
                                        {
                                            User.BotData.Rider.Z = User.Z + 1.0;
                                            User.BotData.Rider.RotHead = User.RotHead;
                                            User.BotData.Rider.RotBody = User.RotBody;
                                        }
                                        User.UpdateNeeded = true;
                                    }
                                    num = 12;
                                    if (Item.GetBaseItem().InteractionType.ToLower() == "bed")
                                    {
                                        if (!User.Statusses.ContainsKey("lay"))
                                        {
                                            double num3;
                                            try
                                            {
                                                if (Item.GetBaseItem().Height_Adjustable.Count > 1)
                                                {
                                                    num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
                                                }
                                                else
                                                {
                                                    num3 = Item.GetBaseItem().Height;
                                                }
                                            }
                                            catch
                                            {
                                                //num3 = ;
                                            }
                                            if (!User.Statusses.ContainsKey("lay"))
                                            {
                                                User.Statusses.Add("lay", Item.GetBaseItem().Height.ToString().Replace(',', '.') + " null");
                                            }
                                            if (User.byte_1 > 0)
                                            {
                                                if (!User.IsBot)
                                                {
                                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                                }
                                                else
                                                {
                                                    User.BotData.EffectId = -1;
                                                }
                                                User.byte_1 = 0;
                                            }
                                        }
                                        User.Z = Item.GetZ;
                                        User.RotHead = Item.Rot;
                                        User.RotBody = Item.Rot;
                                        if (User.IsBot && User.BotData.Rider != null)
                                        {
                                            User.BotData.Rider.Z = User.Z + 1.0;
                                            User.BotData.Rider.RotHead = User.RotHead;
                                            User.BotData.Rider.RotBody = User.RotBody;
                                        }
                                        User.UpdateNeeded = true;
                                    }
                                    num = 13;
                                    if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("bb_") > -1 && !User.IsBot)
                                    {
                                        if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("_gate") > -1)
                                        {
                                            int num4 = 0;
                                            int num5 = 0;
                                            if (Item.GetBaseItem().InteractionType.ToLower() == "bb_yellow_gate")
                                            {
                                                num5 = 12;
                                                num4 = 36;
                                            }
                                            else
                                            {
                                                if (Item.GetBaseItem().InteractionType.ToLower() == "bb_red_gate")
                                                {
                                                    num5 = 3;
                                                    num4 = 33;
                                                }
                                                else
                                                {
                                                    if (Item.GetBaseItem().InteractionType.ToLower() == "bb_green_gate")
                                                    {
                                                        num5 = 6;
                                                        num4 = 34;
                                                    }
                                                    else
                                                    {
                                                        if (Item.GetBaseItem().InteractionType.ToLower() == "bb_blue_gate")
                                                        {
                                                            num5 = 9;
                                                            num4 = 35;
                                                        }
                                                    }
                                                }
                                            }
                                            if (!this.list_4.Contains(User.HabboId))
                                            {
                                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(num4, true);
                                                User.UpdateNeeded = true;
                                                User.int_14 = num5;
                                                this.list_4.Add(User.HabboId);
                                            }
                                            else
                                            {
                                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, false);
                                                User.UpdateNeeded = true;
                                                User.int_14 = 0;
                                                this.list_4.Remove(User.HabboId);
                                            }
                                        }
                                        if (Item.GetBaseItem().InteractionType.ToLower() == "bb_teleport")
                                        {
                                            this.method_91(Item, User);
                                        }
                                        if (Item.GetBaseItem().InteractionType.ToLower() == "bb_patch" && User.int_14 > 0 && User.IsWalking && Item.ExtraData != "14" && Item.ExtraData != "5" && Item.ExtraData != "8" && Item.ExtraData != "11" && Item.ExtraData != "1")
                                        {
                                            if (Item.ExtraData == "0" || Item.ExtraData == "")
                                            {
                                                Item.ExtraData = Convert.ToString(User.int_14);
                                            }
                                            else
                                            {
                                                if (Convert.ToInt32(Item.ExtraData) > 0)
                                                {
                                                    if (User.int_14 == 12 && (Item.ExtraData == "12" || Item.ExtraData == "13"))
                                                    {
                                                        Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                    }
                                                    else
                                                    {
                                                        if (User.int_14 == 3 && (Item.ExtraData == "3" || Item.ExtraData == "4"))
                                                        {
                                                            Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                        }
                                                        else
                                                        {
                                                            if (User.int_14 == 6 && (Item.ExtraData == "6" || Item.ExtraData == "7"))
                                                            {
                                                                Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                            }
                                                            else
                                                            {
                                                                if (User.int_14 == 9 && (Item.ExtraData == "9" || Item.ExtraData == "10"))
                                                                {
                                                                    Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                                }
                                                                else
                                                                {
                                                                    Item.ExtraData = Convert.ToString(User.int_14);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            this.method_89(User.int_14 + 2, Item, false);
                                            Item.UpdateState(true, true);
                                        }
                                    }
                                }
                                goto IL_1155;
                            }
                        }
                        num = 14;
                        List<RoomItem> list2 = this.method_93(User.SetX, User.SetY);
                        lock (list2)
                        {
                            foreach (RoomItem current in list2)
                            {
                                if (this.double_0[current.GetX, current.GetY] <= current.GetZ)
                                {
                                    if (bool_14)
                                    {
                                        this.method_11(User, current);
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
                                    {
                                        current.ExtraData = "1";
                                        current.UpdateState(false, true);
                                    }
                                    num = 15;
                                    if (current.GetBaseItem().InteractionType.ToLower() == "fbgate" && (!string.IsNullOrEmpty(current.Extra1) || !string.IsNullOrEmpty(current.Extra2)) && User != null && !User.IsBot)
                                    {
                                        if (User.ChangedClothes != "")
                                        {
                                            User.GetClient().GetHabbo().Look = User.ChangedClothes;
                                            User.ChangedClothes = "";
                                            ServerMessage Message = new ServerMessage(266u);
                                            Message.AppendInt32(User.VirtualId);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Look);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
                                            Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
                                            Message.AppendStringWithBreak("");
                                            this.SendMessage(Message, null);
                                        }
                                        else
                                        {
                                            string a = User.GetClient().GetHabbo().Gender;
                                            User.ChangedClothes = User.GetClient().GetHabbo().Look;
                                            if (a == "m")
                                            {
                                                AntiMutant.ApplyClothing(User, current.Extra1);
                                            }
                                            else
                                            {
                                                AntiMutant.ApplyClothing(User, current.Extra2);
                                            }
                                            ServerMessage Message = new ServerMessage(266u);
                                            Message.AppendInt32(User.VirtualId);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Look);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
                                            Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
                                            Message.AppendStringWithBreak("");
                                            this.SendMessage(Message, null);
                                        }
                                    }
                                    num = 16;
                                    if (current.GetBaseItem().InteractionType.ToLower() == "ball")
                                    {
                                        int num6 = current.GetX;
                                        int num7 = current.GetY;
                                        current.ExtraData = "11";
                                        if (User.RotBody == 4)
                                        {
                                            num7++;
                                            if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                            {
                                                this.method_79(null, current, num6, num7 - 2, 0, false, true, true);
                                            }
                                        }
                                        else
                                        {
                                            if (User.RotBody == 0)
                                            {
                                                num7--;
                                                if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                {
                                                    this.method_79(null, current, num6, num7 + 2, 0, false, true, true);
                                                }
                                            }
                                            else
                                            {
                                                if (User.RotBody == 6)
                                                {
                                                    num6--;
                                                    if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                    {
                                                        this.method_79(null, current, num6 + 2, num7, 0, false, true, true);
                                                    }
                                                }
                                                else
                                                {
                                                    if (User.RotBody == 2)
                                                    {
                                                        num6++;
                                                        if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                        {
                                                            this.method_79(null, current, num6 - 2, num7, 0, false, true, true);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (User.RotBody == 3)
                                                        {
                                                            num6++;
                                                            num7++;
                                                            if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                            {
                                                                this.method_79(null, current, num6 - 2, num7 - 2, 0, false, true, true);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (User.RotBody == 1)
                                                            {
                                                                num6++;
                                                                num7--;
                                                                if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                {
                                                                    this.method_79(null, current, num6 - 2, num7 + 2, 0, false, true, true);
                                                                }
                                                            }
                                                            else
                                                            {
                                                                if (User.RotBody == 7)
                                                                {
                                                                    num6--;
                                                                    num7--;
                                                                    if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                    {
                                                                        this.method_79(null, current, num6 + 2, num7 + 2, 0, false, true, true);
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    if (User.RotBody == 5)
                                                                    {
                                                                        num6--;
                                                                        num7++;
                                                                        if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                        {
                                                                            this.method_79(null, current, num6 + 2, num7 - 2, 0, false, true, true);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    IL_1155: ;
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
				{
					"Room [ID: ",
					this.RoomId,
					"] [Part: ",
					num,
					"] Update User Status"
				}));
                this.CrashRoom();
            }
        }
Exemplo n.º 5
0
        public bool IsPhxMagicAllowed(RoomUser User, string command, string data)
        {
            data = this.VariablePhxMagic(User, data);
            switch (command)
            {
                case "roomuserseq":
                    if (this.UserCount != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "roomuserslt":
                    if (this.UserCount >= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "roomusersmt":
                    if (this.UserCount <= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "roomusersmte":
                    if (this.UserCount < Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "roomuserslte":
                    if (this.UserCount > Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userhasachievement":
                    return PhoenixEnvironment.GetGame().GetAchievementManager().UserHasAchievement(User.GetClient(), Convert.ToUInt16(data), 1);

                case "userhasntachievement":
                    if (PhoenixEnvironment.GetGame().GetAchievementManager().UserHasAchievement(User.GetClient(), Convert.ToUInt16(data), 1))
                    {
                        break;
                    }
                    return true;

                case "userhasbadge":
                    return User.GetClient().GetHabbo().GetBadgeComponent().HasBadge(data);

                case "userhasntbadge":
                    if (User.GetClient().GetHabbo().GetBadgeComponent().HasBadge(data))
                    {
                        break;
                    }
                    return true;

                case "userhasvip":
                    return User.GetClient().GetHabbo().Vip;

                case "userhasntvip":
                    if (User.GetClient().GetHabbo().Vip)
                    {
                        break;
                    }
                    return true;

                case "userhaseffect":
                    if (User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().CurrentEffect != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userhasnteffect":
                    if (User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().CurrentEffect == Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userrankeq":
                    if (User.GetClient().GetHabbo().Rank != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userrankmt":
                    if (User.GetClient().GetHabbo().Rank <= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userrankmte":
                    if (User.GetClient().GetHabbo().Rank < Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userranklt":
                    if (User.GetClient().GetHabbo().Rank >= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userranklte":
                    if (User.GetClient().GetHabbo().Rank > Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usercreditseq":
                    if (User.GetClient().GetHabbo().Credits != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usercreditsmt":
                    if (User.GetClient().GetHabbo().Credits <= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usercreditsmte":
                    if (User.GetClient().GetHabbo().Credits < Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usercreditslt":
                    if (User.GetClient().GetHabbo().Credits >= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usercreditslte":
                    if (User.GetClient().GetHabbo().Credits > Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpixelseq":
                    if (User.GetClient().GetHabbo().ActivityPoints != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpixelsmt":
                    if (User.GetClient().GetHabbo().ActivityPoints <= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpixelsmte":
                    if (User.GetClient().GetHabbo().ActivityPoints < Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpixelslt":
                    if (User.GetClient().GetHabbo().ActivityPoints >= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpixelslte":
                    if (User.GetClient().GetHabbo().ActivityPoints > Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpointseq":
                    if (User.GetClient().GetHabbo().shells != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpointsmt":
                    if (User.GetClient().GetHabbo().shells <= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpointsmte":
                    if (User.GetClient().GetHabbo().shells < Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpointslt":
                    if (User.GetClient().GetHabbo().shells >= Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userpointslte":
                    if (User.GetClient().GetHabbo().shells > Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "usergroupeq":
                    if (User.GetClient().GetHabbo().GroupID != Convert.ToInt32(data))
                    {
                        break;
                    }
                    return true;

                case "userisingroup":
                    foreach (DataRow row in User.GetClient().GetHabbo().GroupMemberships.Rows)
                    {
                        if (((int)row["groupid"]) == Convert.ToInt32(data))
                        {
                            return true;
                        }
                    }
                    break;

                case "wearing":
                    if (User.GetClient().GetHabbo().Look.Contains(data))
                    {
                        return true;
                    }
                    break;

                case "notwearing":
                    if (User.GetClient().GetHabbo().Look.Contains(data))
                    {
                        break;
                    }
                    return true;

                case "carrying":
                    if (this.GetRoomUserByHabbo(User.GetClient().GetHabbo().Id).CarryItemID != Convert.ToInt16(data))
                    {
                        break;
                    }
                    return true;

                case "notcarrying":
                    if (this.GetRoomUserByHabbo(User.GetClient().GetHabbo().Id).CarryItemID == Convert.ToInt16(data))
                    {
                        break;
                    }
                    return true;
            }
            return false;
        }
Exemplo n.º 6
0
 public void TryStartTrade(RoomUser UserOne, RoomUser UserTwo)
 {
     if (UserOne != null && UserTwo != null && (!UserOne.IsBot || UserOne.BotData.Trader) && (!UserTwo.IsBot || UserTwo.BotData.Trader) && !UserOne.IsTrading && !UserTwo.IsTrading && !HasActiveTrade(UserOne) && !HasActiveTrade(UserTwo))
     {
         ActiveTrades.Add(new Trade(UserOne.GetClient().GetHabbo().Id, UserTwo.GetClient().GetHabbo().Id, RoomId));
     }
 }
Exemplo n.º 7
0
 public void method_86(RoomUser RoomUser_1)
 {
     List<RoomItem> list = this.method_93(RoomUser_1.X, RoomUser_1.Y);
     foreach (RoomItem current in list)
     {
         string text = current.GetBaseItem().InteractionType.ToLower();
         if (text != null)
         {
             if (!(text == "pressure_pad"))
             {
                 if (text == "fbgate" && (!string.IsNullOrEmpty(current.Extra1) || !string.IsNullOrEmpty(current.Extra2)))
                 {
                     RoomUser_1 = this.GetUserForSquare(current.Coordinate.X, current.Coordinate.Y);
                     if (RoomUser_1 != null && !RoomUser_1.IsBot && current.Extra1 != null && current.Extra2 != null)
                     {
                         string a = RoomUser_1.GetClient().GetHabbo().Gender;
                         if (a == "m")
                         {
                             AntiMutant.ApplyClothing(RoomUser_1, current.Extra1);
                         }
                         else
                         {
                             AntiMutant.ApplyClothing(RoomUser_1, current.Extra2);
                         }
                         ServerMessage Message = new ServerMessage(266u);
                         Message.AppendInt32(RoomUser_1.VirtualId);
                         Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Look);
                         Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Gender.ToLower());
                         Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Motto);
                         Message.AppendInt32(RoomUser_1.GetClient().GetHabbo().AchievementScore);
                         Message.AppendStringWithBreak("");
                         this.SendMessage(Message, null);
                     }
                 }
             }
             else
             {
                 current.ExtraData = "1";
                 current.UpdateState(false, true);
             }
         }
     }
 }
Exemplo n.º 8
0
 public bool HasActiveTrade(RoomUser User)
 {
     return !User.IsBot && HasActiveTrade(User.GetClient().GetHabbo().Id);
 }
Exemplo n.º 9
0
 public Trade method_75(RoomUser RoomUser_1)
 {
     if (RoomUser_1.IsBot)
     {
         return null;
     }
     else
     {
         return GetUserTrade(RoomUser_1.GetClient().GetHabbo().Id);
     }
 }
Exemplo n.º 10
0
 public void method_46(GameClient Session, bool bool_13)
 {
     RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.RoomId, this.int_7++, Session.GetHabbo().Visible);
     if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
     {
         if (bool_13 || [email protected])
         {
             @class.IsSpectator = true;
         }
         else
         {
             @class.SetPos(this.Model.DoorX, this.Model.DoorY, this.Model.DoorZ);
             @class.SetRot(this.Model.DoorOrientation);
             if (this.CheckRights(Session, true))
             {
                 @class.AddStatus("flatctrl", "useradmin");
             }
             else
             {
                 if (this.CheckRights(Session))
                 {
                     @class.AddStatus("flatctrl", "");
                 }
             }
             if ([email protected] && @class.GetClient().GetHabbo().IsTeleporting)
             {
                 RoomItem class2 = this.GetItem(@class.GetClient().GetHabbo().TeleporterId);
                 if (class2 != null)
                 {
                     @class.SetPos(class2.GetX, class2.GetY, class2.GetZ);
                     @class.SetRot(class2.Rot);
                     class2.InteractingUser2 = Session.GetHabbo().Id;
                     class2.ExtraData = "2";
                     class2.UpdateState(false, true);
                 }
             }
             @class.GetClient().GetHabbo().IsTeleporting = false;
             @class.GetClient().GetHabbo().TeleporterId = 0u;
             ServerMessage Message = new ServerMessage(28u);
             Message.AppendInt32(1);
             @class.Serialize(Message);
             this.SendMessage(Message, null);
         }
         int num = this.method_5();
         @class.CurrentFurniFX = num;
         this.UserList[num] = @class;
         if (!bool_13)
         {
             this.bool_10 = true;
         }
         Session.GetHabbo().CurrentRoomId = this.Id;
         Session.GetHabbo().GetMessenger().OnStatusChanged(false);
         Session.GetHabbo().RoomVisits++;
         int num2 = Session.GetHabbo().RoomVisits;
         if (num2 <= 500)
         {
             if (num2 <= 50)
             {
                 if (num2 != 5)
                 {
                     if (num2 == 50)
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 2);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 1);
                 }
             }
             else
             {
                 if (num2 != 100)
                 {
                     if (num2 != 200)
                     {
                         if (num2 == 500)
                         {
                             PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 5);
                         }
                     }
                     else
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 4);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 3);
                 }
             }
         }
         else
         {
             if (num2 <= 1500)
             {
                 if (num2 != 750)
                 {
                     if (num2 == 1500)
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 7);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 6);
                 }
             }
             else
             {
                 if (num2 != 2500)
                 {
                     if (num2 != 4000)
                     {
                         if (num2 == 5000)
                         {
                             PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 10);
                         }
                     }
                     else
                     {
                         PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 9);
                     }
                 }
                 else
                 {
                     PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 13u, 8);
                 }
             }
         }
         Session.GetHabbo().OnEnterRoom(this.Id);
         if (Session.GetHabbo().GroupID > 0)
         {
             Phoenix.HabboHotel.Groups.Group class3 = GroupManager.GetGroup(Session.GetHabbo().GroupID);
             if (class3 != null && !this.list_17.Contains(class3))
             {
                 this.list_17.Add(class3);
                 ServerMessage Message2 = new ServerMessage(309u);
                 Message2.AppendInt32(this.list_17.Count);
                 foreach (Phoenix.HabboHotel.Groups.Group current in this.list_17)
                 {
                     Message2.AppendInt32(current.Id);
                     Message2.AppendStringWithBreak(current.Badge);
                 }
                 this.SendMessage(Message2, null);
             }
         }
         if (!bool_13)
         {
             this.method_51();
             for (int i = 0; i < this.UserList.Length; i++)
             {
                 RoomUser class4 = this.UserList[i];
                 if (class4 != null && class4.IsBot)
                 {
                     class4.BotAI.OnUserEnterRoom(@class);
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
        public bool method_21(RoomUser RoomUser_1, RoomItem RoomItem_0, string string_10)
        {
            bool result;
            try
            {
                if (this.bool_6 || this.bool_7)
                {
                    result = false;
                }
                else
                {
                    bool flag = false;
                    int num = 0;
                    int num2 = 0;
                    bool flag2 = false;
                    string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
                    switch (text)
                    {
                        case "wf_trg_onsay":
                            if (string_10.Contains(RoomItem_0.Extra1.ToLower()))
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_enterroom":
                            if (RoomItem_0.Extra1 == "" || RoomItem_0.Extra1 == RoomUser_1.GetClient().GetHabbo().Username)
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_furnistate":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                foreach (string current in list)
                                {
                                    if (current == string_10)
                                    {
                                        flag = true;
                                    }
                                }
                            }
                            break;
                        case "wf_trg_onfurni":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                List<string> list2 = list;
                                foreach (string current in list)
                                {
                                    if (!(current != string_10))
                                    {
                                        RoomItem @class = this.GetItem(Convert.ToUInt32(string_10));
                                        if (@class != null)
                                        {
                                            flag = true;
                                        }
                                        else
                                        {
                                            list2.Remove(current);
                                        }
                                    }
                                }
                                RoomItem_0.Extra2 = string.Join(",", list2.ToArray());
                            }
                            break;
                        case "wf_trg_offfurni":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                List<string> list2 = list;
                                foreach (string current in list)
                                {
                                    if (!(current != string_10))
                                    {
                                        RoomItem @class = this.GetItem(Convert.ToUInt32(string_10));
                                        if (@class != null)
                                        {
                                            flag = true;
                                        }
                                        else
                                        {
                                            list2.Remove(current);
                                        }
                                    }
                                }
                                RoomItem_0.Extra2 = string.Join(",", list2.ToArray());
                            }
                            break;
                        case "wf_trg_gameend":
                            if (string_10 == "GameEnded")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_gamestart":
                            if (string_10 == "GameBegun")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_timer":
                            if (string_10 == "Timer")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_attime":
                            if (string_10 == "AtTime")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_atscore":
                            if (string_10 == "TheScore")
                            {
                                flag = true;
                            }
                            break;
                    }
                    try
                    {
                        List<RoomItem> list3 = this.method_93(RoomItem_0.GetX, RoomItem_0.GetY);
                        if (list3 == null)
                        {
                            result = false;
                            return result;
                        }
                        foreach (RoomItem current2 in list3)
                        {
                            text = current2.GetBaseItem().InteractionType.ToLower();
                            if (text != null)
                            {
                                int num4;
                                if (!(text == "wf_cnd_phx"))
                                {
                                    if (!(text == "wf_cnd_trggrer_on_frn"))
                                    {
                                        string[] collection;
                                        List<string> list;
                                        List<RoomItem> list4;
                                        if (!(text == "wf_cnd_furnis_hv_avtrs"))
                                        {
                                            if (!(text == "wf_cnd_has_furni_on"))
                                            {
                                                continue;
                                            }
                                            num4 = num2;
                                            num++;
                                            current2.ExtraData = "1";
                                            current2.UpdateState(false, true);
                                            current2.ReqUpdate(1);
                                            current2.method_10();
                                            if (current2.Extra2.Length <= 0)
                                            {
                                                continue;
                                            }
                                            collection = current2.Extra2.Split(new char[]
											{
												','
											});
                                            list = new List<string>(collection);
                                            list4 = new List<RoomItem>();
                                            foreach (string current3 in list)
                                            {
                                                list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                            }
                                            using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
                                            {
                                                while (enumerator3.MoveNext())
                                                {
                                                    RoomItem current4 = enumerator3.Current;
                                                    if (current4 != null)
                                                    {
                                                        Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                        if (dictionary == null)
                                                        {
                                                            dictionary = new Dictionary<int, AffectedTile>();
                                                        }
                                                        List<RoomItem> list5 = new List<RoomItem>(this.method_45(current4.GetX, current4.GetY));
                                                        if (list5.Count > 1 && num4 + 1 != num2)
                                                        {
                                                            num2++;
                                                            break;
                                                        }
                                                        foreach (AffectedTile current5 in dictionary.Values)
                                                        {
                                                            list5 = new List<RoomItem>(this.method_45(current5.X, current5.Y));
                                                            if (list5.Count > 1 && num4 + 1 != num2)
                                                            {
                                                                num2++;
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                                continue;
                                            }
                                        }
                                        num++;
                                        current2.ExtraData = "1";
                                        current2.UpdateState(false, true);
                                        current2.ReqUpdate(1);
                                        current2.method_10();
                                        if (current2.Extra2.Length <= 0)
                                        {
                                            continue;
                                        }
                                        collection = current2.Extra2.Split(new char[]
										{
											','
										});
                                        list = new List<string>(collection);
                                        list4 = new List<RoomItem>();
                                        foreach (string current3 in list)
                                        {
                                            list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                        }
                                        bool flag3 = true;
                                        foreach (RoomItem current4 in list4)
                                        {
                                            if (current4 != null)
                                            {
                                                bool flag4 = false;
                                                Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                if (dictionary == null)
                                                {
                                                    dictionary = new Dictionary<int, AffectedTile>();
                                                }
                                                if (this.SquareHasUsers(current4.GetX, current4.GetY))
                                                {
                                                    flag4 = true;
                                                }
                                                foreach (AffectedTile current5 in dictionary.Values)
                                                {
                                                    if (this.SquareHasUsers(current5.X, current5.Y))
                                                    {
                                                        flag4 = true;
                                                        break;
                                                    }
                                                }
                                                if (!flag4)
                                                {
                                                    flag3 = false;
                                                }
                                            }
                                        }
                                        if (flag3)
                                        {
                                            num2++;
                                            continue;
                                        }
                                        continue;
                                    }
                                    else
                                    {
                                        num4 = num2;
                                        num++;
                                        current2.ExtraData = "1";
                                        current2.UpdateState(false, true);
                                        current2.ReqUpdate(1);
                                        current2.method_10();
                                        if (current2.Extra2.Length <= 0)
                                        {
                                            continue;
                                        }
                                        string[] collection = current2.Extra2.Split(new char[]
										{
											','
										});
                                        List<string> list = new List<string>(collection);
                                        List<RoomItem> list4 = new List<RoomItem>();
                                        foreach (string current3 in list)
                                        {
                                            list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                        }
                                        if (RoomUser_1 == null)
                                        {
                                            continue;
                                        }
                                        using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
                                        {
                                            while (enumerator3.MoveNext())
                                            {
                                                RoomItem current4 = enumerator3.Current;
                                                if (current4 != null)
                                                {
                                                    Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                    if (dictionary == null)
                                                    {
                                                        dictionary = new Dictionary<int, AffectedTile>();
                                                    }
                                                    if (RoomUser_1.X == current4.GetX && RoomUser_1.Y == current4.GetY && num4 + 1 != num2)
                                                    {
                                                        num2++;
                                                        break;
                                                    }
                                                    foreach (AffectedTile current5 in dictionary.Values)
                                                    {
                                                        if (RoomUser_1.X == current5.X && RoomUser_1.Y == current5.Y && num4 + 1 != num2)
                                                        {
                                                            num2++;
                                                            break;
                                                        }
                                                    }
                                                }
                                            }
                                            continue;
                                        }
                                    }
                                }
                                num4 = num2;
                                num++;
                                current2.ExtraData = "1";
                                current2.UpdateState(false, true);
                                current2.ReqUpdate(1);
                                if (current2.Extra1.Length > 0)
                                {
                                    string string_11 = current2.Extra1.Split(new char[]
									{
										':'
									})[0].ToLower();
                                    string string_12 = current2.Extra1.Split(new char[]
									{
										':'
									})[1];
                                    if (RoomUser_1 != null)
                                    {
                                        if (!RoomUser_1.IsBot && this.IsPhxMagicAllowed(RoomUser_1, string_11, string_12))
                                        {
                                            num2++;
                                        }
                                    }
                                    else
                                    {
                                        RoomUser[] array = this.UserList;
                                        for (int i = 0; i < array.Length; i++)
                                        {
                                            RoomUser class2 = array[i];
                                            if (class2 != null && !class2.IsBot && this.IsPhxMagicAllowed(class2, string_11, string_12) && num4 + 1 != num2)
                                            {
                                                num2++;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        if (num != num2)
                        {
                            result = false;
                            return result;
                        }
                    }
                    catch
                    {
                    }
                    if (flag && num == num2)
                    {
                        RoomItem_0.ExtraData = "1";
                        RoomItem_0.UpdateState(false, true);
                        RoomItem_0.ReqUpdate(1);
                        List<RoomItem> list6 = this.method_93(RoomItem_0.GetX, RoomItem_0.GetY);
                        if (list6 == null)
                        {
                            result = false;
                            return result;
                        }
                        bool flag5 = false;
                        foreach (RoomItem current2 in list6)
                        {
                            if (current2.GetBaseItem().InteractionType.ToLower() == "wf_xtra_random")
                            {
                                flag5 = true;
                                break;
                            }
                        }
                        if (flag5)
                        {
                            List<RoomItem> list7 = new List<RoomItem>();
                            Random random = new Random();
                            while (list6.Count != 0)
                            {
                                int index = random.Next(0, list6.Count);
                                list7.Add(list6[index]);
                                list6.RemoveAt(index);
                            }
                            list6 = list7;
                        }
                        foreach (RoomItem current2 in list6)
                        {
                            if (flag5 && flag2)
                            {
                                break;
                            }
                            text = current2.GetBaseItem().InteractionType.ToLower();
                            switch (text)
                            {
                                case "wf_act_give_phx":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra1.Length > 0)
                                    {
                                        string string_11 = current2.Extra1.Split(new char[]
									{
										':'
									})[0].ToLower();
                                        string string_12 = current2.Extra1.Split(new char[]
									{
										':'
									})[1];
                                        if (RoomUser_1 != null)
                                        {
                                            if (!RoomUser_1.IsBot)
                                            {
                                                this.RunPhxMagic(RoomUser_1, string_11, string_12);
                                            }
                                        }
                                        else
                                        {
                                            RoomUser[] array = this.UserList;
                                            for (int i = 0; i < array.Length; i++)
                                            {
                                                RoomUser class2 = array[i];
                                                if (class2 != null && !class2.IsBot)
                                                {
                                                    this.RunPhxMagic(class2, string_11, string_12);
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_saymsg":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra1.Length > 0)
                                    {
                                        string text2 = current2.Extra1;
                                        text2 = ChatCommandHandler.ApplyWordFilter(text2);
                                        if (text2.Length > 100)
                                        {
                                            text2 = text2.Substring(0, 100);
                                        }
                                        if (RoomUser_1 != null)
                                        {
                                            if (!RoomUser_1.IsBot)
                                            {
                                                RoomUser_1.GetClient().GetHabbo().Sendselfwhisper(text2);
                                            }
                                        }
                                        else
                                        {
                                            RoomUser[] array = this.UserList;
                                            for (int i = 0; i < array.Length; i++)
                                            {
                                                RoomUser class2 = array[i];
                                                if (class2 != null && !class2.IsBot)
                                                {
                                                    class2.GetClient().GetHabbo().Sendselfwhisper(text2);
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_moveuser":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_10();
                                    if (current2.Extra2.Length > 0)
                                    {
                                        string[] collection = current2.Extra2.Split(new char[]
									{
										','
									});
                                        List<string> list = new List<string>(collection);
                                        Random random2 = new Random();
                                        int num5 = random2.Next(0, list.Count - 1);
                                        RoomItem class3 = this.GetItem(Convert.ToUInt32(list[num5]));
                                        if (class3 != null)
                                        {
                                            if (RoomUser_1 != null)
                                            {
                                                this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
                                                this.byte_0[RoomUser_1.SetX, RoomUser_1.SetY] = 1;
                                                this.byte_0[class3.GetX, class3.GetY] = 1;
                                                RoomUser_1.IsWalking = false;
                                                RoomUser_1.SetX = class3.GetX;
                                                RoomUser_1.SetY = class3.GetY;
                                                RoomUser_1.SetZ = class3.GetZ;
                                                RoomUser_1.SetPos(class3.GetX, class3.GetY, class3.GetZ);
                                                RoomUser_1.UpdateNeeded = true;
                                                if (!current2.dictionary_1.ContainsKey(RoomUser_1))
                                                {
                                                    current2.dictionary_1.Add(RoomUser_1, 10);
                                                }
                                                if (RoomUser_1.Riding != null)
                                                {
                                                    RoomUser_1.Riding.Rider = null;
                                                    RoomUser_1.Target = null;
                                                    RoomUser_1.Riding = null;
                                                }
                                                this.UpdateUserStatus(RoomUser_1, true, false);
                                            }
                                            else
                                            {
                                                RoomUser[] array = this.UserList;
                                                for (int i = 0; i < array.Length; i++)
                                                {
                                                    RoomUser class2 = array[i];
                                                    if (class2 != null)
                                                    {
                                                        this.byte_0[class2.X, class2.Y] = 1;
                                                        this.byte_0[class3.GetX, class3.GetY] = 1;
                                                        class2.SetPos(class3.GetX, class3.GetY, class3.GetZ);
                                                        class2.UpdateNeeded = true;
                                                        if (!current2.dictionary_1.ContainsKey(class2))
                                                        {
                                                            current2.dictionary_1.Add(class2, 10);
                                                        }
                                                    }
                                                }
                                            }
                                            flag2 = true;
                                        }
                                    }
                                    break;
                                case "wf_act_togglefurni":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra2.Length > 0)
                                    {
                                        string[] collection = current2.Extra2.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable = new List<string>(collection);
                                        List<string> list2 = enumerable.ToList<string>();
                                        foreach (string current in enumerable)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null)
                                            {
                                                class3.Interactor.OnTrigger(null, class3, 0, true);
                                            }
                                            else
                                            {
                                                list2.Remove(current);
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_givepoints":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (RoomUser_1 != null && current2.Extra1.Length > 0)
                                    {
                                        this.method_88(RoomUser_1.int_14 + 2, Convert.ToInt32(current2.Extra1), current2);
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_moverotate":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_9();
                                    if (current2.Extra3.Length > 0)
                                    {
                                        string[] collection = current2.Extra3.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable2 = new List<string>(collection);
                                        foreach (string current in enumerable2)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null)
                                            {
                                                if (current2.Extra1 != "0" && current2.Extra1 != "")
                                                {
                                                    Coord gstruct1_ = class3.SquareInFront;
                                                    int num5 = 0;
                                                    int num6 = 0;
                                                    int num7 = 0;
                                                    if (current2.Extra1 == "1")
                                                    {
                                                        Random random3 = new Random();
                                                        num5 = random3.Next(1, 5);
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra1 == "2")
                                                        {
                                                            Random random3 = new Random();
                                                            num6 = random3.Next(1, 3);
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra1 == "3")
                                                            {
                                                                Random random3 = new Random();
                                                                num7 = random3.Next(1, 3);
                                                            }
                                                        }
                                                    }
                                                    if (current2.Extra1 == "4" || num5 == 1 || num7 == 1)
                                                    {
                                                        gstruct1_ = class3.method_1(4);
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra1 == "5" || num5 == 2 || num6 == 1)
                                                        {
                                                            gstruct1_ = class3.method_1(6);
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra1 == "6" || num5 == 3 || num7 == 2)
                                                            {
                                                                gstruct1_ = class3.method_1(0);
                                                            }
                                                            else
                                                            {
                                                                if (current2.Extra1 == "7" || num5 == 4 || num6 == 2)
                                                                {
                                                                    gstruct1_ = class3.method_1(2);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (this.method_37(gstruct1_.X, gstruct1_.Y, true, true, false, true, false) && class3.GetBaseItem().InteractionType != "wf_trg_timer")
                                                    {
                                                        this.method_41(class3, gstruct1_, current2.Id, class3.GetZ);
                                                    }
                                                }
                                                if (current2.Extra2.Length > 0 && current2.Extra2 != "0" && current2.Extra2 != "")
                                                {
                                                    int num5 = 0;
                                                    if (current2.Extra2 == "1")
                                                    {
                                                        num5 = class3.Rot + 2;
                                                        if (num5 > 6)
                                                        {
                                                            num5 = 0;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra2 == "2")
                                                        {
                                                            num5 = class3.Rot - 2;
                                                            if (num5 < 0)
                                                            {
                                                                num5 = 6;
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra2 == "3")
                                                            {
                                                                Random random3 = new Random();
                                                                num5 = random3.Next(1, 5);
                                                                if (num5 == 1)
                                                                {
                                                                    num5 = 0;
                                                                }
                                                                else
                                                                {
                                                                    if (num5 == 2)
                                                                    {
                                                                        num5 = 2;
                                                                    }
                                                                    else
                                                                    {
                                                                        if (num5 == 3)
                                                                        {
                                                                            num5 = 4;
                                                                        }
                                                                        else
                                                                        {
                                                                            if (num5 == 4)
                                                                            {
                                                                                num5 = 6;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (current2.GetRoom().method_79(null, class3, class3.GetX, class3.GetY, num5, false, true, false))
                                                    {
                                                        flag2 = true;
                                                    }
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_matchfurni":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_9();
                                    if (current2.Extra3.Length > 0 && current2.Extra1.Length > 0)
                                    {
                                        string[] collection = current2.Extra3.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable = new List<string>(collection);
                                        string[] collection2 = current2.Extra1.Split(new char[]
									{
										';'
									});
                                        List<string> list8 = new List<string>(collection2);
                                        int num8 = 0;
                                        foreach (string current in enumerable)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null && !(class3.GetBaseItem().InteractionType.ToLower() == "dice"))
                                            {
                                                string[] collection3 = list8[num8].Split(new char[]
											{
												','
											});
                                                List<string> list9 = new List<string>(collection3);
                                                bool flag6 = false;
                                                bool flag7 = false;
                                                if (current2.Extra2 != "" && class3 != null)
                                                {
                                                    int int_ = class3.GetX;
                                                    int int_2 = class3.GetY;
                                                    if (current2.Extra2.StartsWith("I"))
                                                    {
                                                        class3.ExtraData = list9[4];
                                                        flag7 = true;
                                                    }
                                                    if (current2.Extra2.Substring(1, 1) == "I")
                                                    {
                                                        class3.Rot = Convert.ToInt32(list9[3]);
                                                        flag6 = true;
                                                    }
                                                    if (current2.Extra2.EndsWith("I"))
                                                    {
                                                        int_ = Convert.ToInt32(list9[0]);
                                                        int_2 = Convert.ToInt32(list9[1]);
                                                        flag6 = true;
                                                    }
                                                    if (flag6)
                                                    {
                                                        this.method_40(class3, int_, int_2, current2.Id, class3.GetZ);
                                                    }
                                                    if (flag7)
                                                    {
                                                        class3.UpdateState(false, true);
                                                    }
                                                    this.GenerateMaps();
                                                }
                                                num8++;
                                            }
                                        }
                                    }
                                    flag2 = true;
                                    break;
                            }
                        }
                    }
                    result = flag2;
                }
            }
            catch
            {
                result = false;
            }
            return result;
        }
Exemplo n.º 12
0
 public string VariablePhxMagic(RoomUser RoomUser_1, string string_10)
 {
     if (RoomUser_1 != null)
     {
         if (string_10.ToUpper().Contains("#USERNAME#"))
         {
             string_10 = Regex.Replace(string_10, "#USERNAME#", RoomUser_1.GetClient().GetHabbo().Username, RegexOptions.IgnoreCase);
         }
         if (string_10.ToUpper().Contains("#USERID#"))
         {
             string_10 = Regex.Replace(string_10, "#USERID#", RoomUser_1.GetClient().GetHabbo().Id.ToString(), RegexOptions.IgnoreCase);
         }
         if (string_10.ToUpper().Contains("#USERRANK#"))
         {
             string_10 = Regex.Replace(string_10, "#USERRANK#", RoomUser_1.GetClient().GetHabbo().Rank.ToString(), RegexOptions.IgnoreCase);
         }
     }
     if (string_10.ToUpper().Contains("#ROOMNAME#"))
     {
         string_10 = Regex.Replace(string_10, "#ROOMNAME#", this.Name, RegexOptions.IgnoreCase);
     }
     if (string_10.ToUpper().Contains("#ROOMID#"))
     {
         string_10 = Regex.Replace(string_10, "#ROOMID#", this.Id.ToString(), RegexOptions.IgnoreCase);
     }
     int num = PhoenixEnvironment.GetGame().GetClientManager().ClientCount + -1;
     int int32_ = PhoenixEnvironment.GetGame().GetRoomManager().LoadedRoomsCount;
     if (string_10.ToUpper().Contains("#ONLINECOUNT#"))
     {
         string_10 = Regex.Replace(string_10, "#ONLINECOUNT#", num.ToString(), RegexOptions.IgnoreCase);
     }
     if (string_10.ToUpper().Contains("#ROOMSLOADED#"))
     {
         string_10 = Regex.Replace(string_10, "#ROOMSLOADED#", int32_.ToString(), RegexOptions.IgnoreCase);
     }
     return string_10;
 }
Exemplo n.º 13
0
 public static void ApplyClothing(RoomUser User, string ToAdd)
 {
     string str;
     string str2;
     if (ToAdd.Contains("hr-"))
     {
         str2 = Regex.Split(ToAdd, "hr-")[1];
         str2 = "hr-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("hr-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "hr-")[1];
             str = "hr-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("hd-"))
     {
         str2 = Regex.Split(ToAdd, "hd-")[1];
         str2 = "hd-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("hd-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "hd-")[1];
             str = "hd-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("ch-"))
     {
         str2 = Regex.Split(ToAdd, "ch-")[1];
         str2 = "ch-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("ch-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "ch-")[1];
             str = "ch-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("lg-"))
     {
         str2 = Regex.Split(ToAdd, "lg-")[1];
         str2 = "lg-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("lg-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "lg-")[1];
             str = "lg-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("sh-"))
     {
         str2 = Regex.Split(ToAdd, "sh-")[1];
         str2 = "sh-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("sh-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "sh-")[1];
             str = "sh-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("ea-"))
     {
         str2 = Regex.Split(ToAdd, "ea-")[1];
         str2 = "ea-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("ea-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "ea-")[1];
             str = "ea-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("ca-"))
     {
         str2 = Regex.Split(ToAdd, "ca-")[1];
         str2 = "ca-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("ca-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "ca-")[1];
             str = "ca-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("ha-"))
     {
         str2 = Regex.Split(ToAdd, "ha-")[1];
         str2 = "ha-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("ha-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "ha-")[1];
             str = "ha-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("he-"))
     {
         str2 = Regex.Split(ToAdd, "he-")[1];
         str2 = "he-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("he-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "he-")[1];
             str = "he-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("wa-"))
     {
         str2 = Regex.Split(ToAdd, "wa-")[1];
         str2 = "wa-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("wa-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "wa-")[1];
             str = "wa-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("fa-"))
     {
         str2 = Regex.Split(ToAdd, "fa-")[1];
         str2 = "fa-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("fa-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "fa-")[1];
             str = "fa-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
     if (ToAdd.Contains("cc-"))
     {
         str2 = Regex.Split(ToAdd, "cc-")[1];
         str2 = "cc-" + str2.Split(new char[] { '.' })[0];
         if (User.GetClient().GetHabbo().Look.IndexOf("cc-") == -1)
         {
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look + str2;
         }
         else
         {
             str = Regex.Split(User.GetClient().GetHabbo().Look, "cc-")[1];
             str = "cc-" + str.Split(new char[] { '.' })[0];
             User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().Look.Replace(str, str2);
         }
     }
 }
Exemplo n.º 14
0
		public override void OnUserSay(RoomUser User, string Message)
		{
			RoomUser Pet = base.GetRoomUser();
			if (Pet.BotData.Rider == null)
			{
				if (Message.ToLower().Equals(Pet.PetData.Name.ToLower()))
				{
					Pet.SetRot(Rotation.Calculate(Pet.X, Pet.Y, User.X, User.Y));
				}
				else
				{
					if (Message.ToLower().StartsWith(Pet.PetData.Name.ToLower() + " ") && User.GetClient().GetHabbo().Username.ToLower() == base.GetRoomUser().PetData.OwnerName.ToLower())
					{
						string key = Message.Substring(Pet.PetData.Name.ToLower().Length + 1);
                        if ((Pet.PetData.Energy >= 10 && this.LevelStake() < 6) || Pet.PetData.Level >= 15)
                        {
                            Pet.Statusses.Clear();
                            if (!PhoenixEnvironment.GetGame().GetRoleManager().PetCommandsList.ContainsKey(key))
                            {
                                string[] array = new string[]
								{
									TextManager.GetText("pet_response_confused1"),
									TextManager.GetText("pet_response_confused2"),
									TextManager.GetText("pet_response_confused3"),
									TextManager.GetText("pet_response_confused4"),
									TextManager.GetText("pet_response_confused5"),
									TextManager.GetText("pet_response_confused6"),
									TextManager.GetText("pet_response_confused7")
								};
                                Random random = new Random();
                                Pet.Chat(null, array[random.Next(0, array.Length - 1)], false);
                            }
                            else
                            {
                                switch (PhoenixEnvironment.GetGame().GetRoleManager().PetCommandsList[key])
                                {
                                    case 1:
                                        Pet.PetData.AddExpirience(10, -25);
                                        Pet.Chat(null, TextManager.GetText("pet_response_sleep"), false);
                                        Pet.Statusses.Add("lay", Pet.Z.ToString());
                                        break;
                                    case 2:
                                        this.PetMove(0, 0, true);
                                        Pet.PetData.AddExpirience(5, 5);
                                        break;
                                    case 3:
                                        Pet.PetData.AddExpirience(5, 5);
                                        Pet.Statusses.Add("sit", Pet.Z.ToString());
                                        break;
                                    case 4:
                                        Pet.PetData.AddExpirience(5, 5);
                                        Pet.Statusses.Add("lay", Pet.Z.ToString());
                                        break;
                                    case 5:
                                        Pet.PetData.AddExpirience(10, 10);
                                        this.EnergyTimer = 60;
                                        break;
                                    case 6:
                                        {
                                            int NewX = User.X;
                                            int NewY = User.Y;
                                            if (User.RotBody == 4)
                                            {
                                                NewY = User.Y + 1;
                                            }
                                            else if (User.RotBody == 0)
                                            {
                                                NewY = User.Y - 1;
                                            }
                                            else if (User.RotBody == 6)
                                            {
                                                NewX = User.X - 1;
                                            }
                                            else if (User.RotBody == 2)
                                            {
                                                NewX = User.X + 1;
                                            }
                                            else if (User.RotBody == 3)
                                            {
                                                NewX = User.X + 1;
                                                NewY = User.Y + 1;
                                            }
                                            else if (User.RotBody == 1)
                                            {
                                                NewX = User.X + 1;
                                                NewY = User.Y - 1;
                                            }
                                            else if (User.RotBody == 7)
                                            {
                                                NewX = User.X - 1;
                                                NewY = User.Y - 1;
                                            }
                                            else if (User.RotBody == 5)
                                            {
                                                NewX = User.X - 1;
                                                NewY = User.Y + 1;
                                            }
                                            Pet.PetData.AddExpirience(15, 15);
                                            this.PetMove(NewX, NewY, false);
                                            break;
                                        }
                                    case 7:
                                        Pet.PetData.AddExpirience(20, 20);
                                        Pet.Statusses.Add("ded", Pet.Z.ToString());
                                        break;
                                    case 8:
                                        Pet.PetData.AddExpirience(10, 10);
                                        Pet.Statusses.Add("beg", Pet.Z.ToString());
                                        break;
                                    case 9:
                                        Pet.PetData.AddExpirience(15, 15);
                                        Pet.Statusses.Add("jmp", Pet.Z.ToString());
                                        break;
                                    case 10:
                                        Pet.PetData.AddExpirience(25, 25);
                                        Pet.Chat(null, TextManager.GetText("pet_response_silent"), false);
                                        this.SpeechTimer = 120;
                                        break;
                                    case 11:
                                        Pet.PetData.AddExpirience(15, 15);
                                        this.SpeechTimer = 2;
                                        break;
                                }
                            }
                        }
                        else
                        {
                            string[] array2 = new string[]
							{
								TextManager.GetText("pet_response_sleeping1"),
								TextManager.GetText("pet_response_sleeping2"),
								TextManager.GetText("pet_response_sleeping3"),
								TextManager.GetText("pet_response_sleeping4"),
								TextManager.GetText("pet_response_sleeping5")
							};
                            string[] array3 = new string[]
							{
								TextManager.GetText("pet_response_refusal1"),
								TextManager.GetText("pet_response_refusal2"),
								TextManager.GetText("pet_response_refusal3"),
								TextManager.GetText("pet_response_refusal4"),
								TextManager.GetText("pet_response_refusal5")
							};
                            Pet.GoalX = Pet.SetX;
                            Pet.GoalY = Pet.SetY;
                            Pet.Statusses.Clear();
                            if (Pet.PetData.Energy < 10)
                            {
                                Random random2 = new Random();
                                Pet.Chat(null, array2[random2.Next(0, array2.Length - 1)], false);
                                if (Pet.PetData.Type != 13)
                                {
                                    Pet.Statusses.Add("lay", Pet.Z.ToString());
                                }
                                else
                                {
                                    Pet.Statusses.Add("lay", (Pet.Z - 1.0).ToString());
                                }
                                this.SpeechTimer = 25;
                                this.EnergyTimer = 20;
                                base.GetRoomUser().PetData.PetEnergy(-25);
                            }
                            else
                            {
                                Random random2 = new Random();
                                Pet.Chat(null, array3[random2.Next(0, array3.Length - 1)], false);
                            }
                        }
						Pet.UpdateNeeded = true;
					}
				}
			}
		}