Habbo SWF (PRODUCTION-201602082203-712976078)
SWF pack for Plus EMU Habboon edit









PlusEMU (Support Ticket 4/4) Fix

Support Ticket 4/4 fix

Emulator\Communication\Packets\Outgoing\Moderation
SupportTicket.cs

Code:
Spoiler:
using System;
using Plus.Communication.Packets.Incoming;
using System.Collections.Generic;
using Plus.Database.Interfaces;

namespace Plus.HabboHotel.Support
{
    /// 
    /// TODO: Utilize ModerationTicket.cs
    /// 
    public class SupportTicket
    {
        public readonly int Id;
        public readonly string ReportedName;
        public readonly string SenderName;

        public string Message;
        public string ModName;
        public int ModeratorId;
        public int ReportedId;

        public int RoomId;
        public string RoomName;
        public int Score;
        public int SenderId;
        public TicketStatus Status;

        public int Type;
        public int Category;
        public double Timestamp;
        public List ReportedChats;


        public SupportTicket(int Id, int Score, int Type, int Category, int SenderId, int ReportedId, String Message, int RoomId, String RoomName, Double Timestamp, List ReportedChats)
        {
            this.Id = Id;
            this.Score = Score;
            this.Type = Type;
            this.Category = Category;
            this.Status = TicketStatus.OPEN;
            this.SenderId = SenderId;
            this.ReportedId = ReportedId;
            ModeratorId = 0;
            this.Message = Message;
            this.RoomId = RoomId;
            this.RoomName = RoomName;
            this.Timestamp = Timestamp;
            this.ReportedChats = ReportedChats;


            SenderName = PlusEnvironment.GetGame().GetClientManager().GetNameById(SenderId);
            ReportedName = PlusEnvironment.GetGame().GetClientManager().GetNameById(ReportedId);
            ModName = PlusEnvironment.GetGame().GetClientManager().GetNameById(ModeratorId);
        }

        public int TabId
        {
            get
            {
                if (Status == TicketStatus.OPEN)
                {
                    return 1;
                }

                if (Status == TicketStatus.PICKED)
                {
                    return 2;
                }

                if (Status == TicketStatus.ABUSIVE || Status == TicketStatus.INVALID || Status == TicketStatus.RESOLVED)
                    return 0;

                if (Status == TicketStatus.DELETED)
                    return 0;

                return 0;
            }
        }

        public int TicketId
        {
            get { return Id; }
        }

        public void Pick(int pModeratorId, Boolean UpdateInDb)
        {
            Status = TicketStatus.PICKED;
            ModeratorId = pModeratorId;
            ModName = PlusEnvironment.GetHabboById(pModeratorId).Username;
            if (UpdateInDb)
            {
                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.RunQuery("UPDATE moderation_tickets SET status = 'picked', moderator_id = " + pModeratorId + ", timestamp = '" + PlusEnvironment.GetUnixTimestamp() + "' WHERE id = " + Id + "");
                }
            }
        }

        public void Close(TicketStatus NewStatus)
        {
            Status = NewStatus;

            String dbType = "";

            switch (NewStatus)
            {
                case TicketStatus.ABUSIVE:

                    dbType = "abusive";
                    break;

                case TicketStatus.INVALID:

                    dbType = "invalid";
                    break;

                case TicketStatus.RESOLVED:
                default:

                    dbType = "resolved";
                    break;
            }

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE moderation_tickets SET status = '" + dbType + "' WHERE id = " + Id + " LIMIT 1");
            }

        }

        public void Release()
        {
            Status = TicketStatus.OPEN;


            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE moderation_tickets SET status = 'open' WHERE id = " + Id + " LIMIT 1");
            }

        }
    }
}
PlusEMU (Support Ticket 3/4) Fix

Support Ticket 3/4 fix

Emulator\Communication\Packets\Outgoing\Moderation
ModerationTool.cs

Code:
Spoiler:
using System;
using System.Collections.Generic;

using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;

using Plus.Database.Interfaces;

using Plus.Communication.Packets.Outgoing.Moderation;

namespace Plus.HabboHotel.Support
{   
    /// 
    /// TODO: Utilize ModerationTicket.cs
    /// 
    public class ModerationTool
    {
        public List Tickets;

        public ModerationTool()
        {
            Tickets = new List();
        }

        public ICollection GetTickets
        {
            get { return this.Tickets; }
        }


        #region Support Tickets
        public void SendNewTicket(GameClient Session, int Category, int ReportedUser, String Message, List Messages)
        {
            int TicketId = 0;
            SupportTicket Ticket;

            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'" + Category + "','open','" + Session.GetHabbo().Id + "','" + ReportedUser + "','0' @message,'0','','" + PlusEnvironment.GetUnixTimestamp() + "')");
                    dbClient.AddParameter("message", Message);
                    TicketId = Convert.ToInt32(dbClient.InsertQuery());

                    dbClient.RunQuery("UPDATE `user_info` SET `cfhs` = `cfhs` + '1' WHERE `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                }

                Ticket = new SupportTicket(TicketId, 1, 7, Category, Session.GetHabbo().Id, ReportedUser, Message, 0, "", PlusEnvironment.GetUnixTimestamp(), Messages);

                Tickets.Add(Ticket);

                SendTicketToModerators(Ticket);
                return;
            }

            RoomData Data = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().CurrentRoomId);

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'" + Category + "','open','" + Session.GetHabbo().Id + "','" + ReportedUser + "','0' @message,'" + Data.Id + "' @name,'" + PlusEnvironment.GetUnixTimestamp() + "')");
                dbClient.AddParameter("message", Message);
                dbClient.AddParameter("name", Data.Name);
                TicketId = Convert.ToInt32(dbClient.InsertQuery());

                dbClient.RunQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }

            Ticket = new SupportTicket(TicketId, 1, 7, Category, Session.GetHabbo().Id, ReportedUser, Message, Data.Id, Data.Name, PlusEnvironment.GetUnixTimestamp(), Messages);
            Tickets.Add(Ticket);
            SendTicketToModerators(Ticket);
        }

        public SupportTicket GetTicket(int TicketId)
        {
            foreach (SupportTicket Ticket in Tickets)
            {
                if (Ticket.TicketId == TicketId)
                {
                    return Ticket;
                }
            }
            return null;
        }

        public void PickTicket(GameClient Session, int TicketId)
        {
            SupportTicket Ticket = GetTicket(TicketId);

            if (Ticket == null || Ticket.Status != TicketStatus.OPEN)
            {
                return;
            }

            Ticket.Pick(Session.GetHabbo().Id, true);
            SendTicketToModerators(Ticket);
        }

        public void ReleaseTicket(GameClient Session, int TicketId)
        {
            SupportTicket Ticket = GetTicket(TicketId);

            if (Ticket == null || Ticket.Status != TicketStatus.PICKED || Ticket.ModeratorId != Session.GetHabbo().Id)
            {
                return;
            }

            Ticket.Release();
            SendTicketToModerators(Ticket);
        }

        public void CloseTicket(GameClient Session, int TicketId, int Result)
        {
            SupportTicket Ticket = GetTicket(TicketId);

            if (Ticket == null || Ticket.Status != TicketStatus.PICKED || Ticket.ModeratorId != Session.GetHabbo().Id)
            {
                return;
            }

            GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Ticket.SenderId);

            TicketStatus NewStatus;
            int ResultCode = 0;
            switch (Result)
            {
                case 1:
                    {
                        ResultCode = 1;
                        NewStatus = TicketStatus.INVALID;
                    }
                    break;

                case 2:
                    {
                        ResultCode = 2;
                        NewStatus = TicketStatus.ABUSIVE;

                        using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                        {
                            dbClient.RunQuery("UPDATE `user_info` SET `cfhs_abusive` = `cfhs_abusive` + 1 WHERE `user_id` = '" + Ticket.SenderId + "' LIMIT 1");
                        }
                    }
                    break;

                case 3:
                default:
                    {
                        ResultCode = 0;
                        NewStatus = TicketStatus.RESOLVED;
                    }
                    break;
            }

            if (Client != null)
                Client.SendMessage(new ModeratorSupportTicketResponseComposer(ResultCode));

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `user_stats` SET `tickets_answered` = `tickets_answered` + '1' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }
            Ticket.Close(NewStatus);
            SendTicketToModerators(Ticket);
        }

        public bool UsersHasPendingTicket(int Id)
        {
            foreach (SupportTicket Ticket in Tickets)
            {
                if (Ticket.SenderId == Id && Ticket.Status == TicketStatus.OPEN)
                {
                    return true;
                }
            }
            return false;
        }


        public static void SendTicketToModerators(SupportTicket Ticket)
        {
            PlusEnvironment.GetGame().GetClientManager().SendMessage(new ModeratorSupportTicketComposer(Ticket), "mod_tool");
        }

        #endregion
    } }
PlusEMU (Support Ticket 2/4) Fix

Support Ticket 2/4 fix

Emulator\Communication\Packets\Outgoing\Moderation
ModeratorSupportTicketComposer.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.Support;

namespace Plus.Communication.Packets.Outgoing.Moderation
{
    class ModeratorSupportTicketComposer : ServerPacket
    {
        public ModeratorSupportTicketComposer(SupportTicket Ticket)
            : base(ServerPacketHeader.ModeratorSupportTicketMessageComposer)
        {
            base.WriteInteger(Ticket.Id);
            base.WriteInteger(Ticket.TabId);
            base.WriteInteger(1); // Type
            base.WriteInteger(Ticket.Category); // Category
            base.WriteInteger(((int)PlusEnvironment.GetUnixTimestamp() - (int)Ticket.Timestamp) * 1000);
            base.WriteInteger(Ticket.Score);
            base.WriteInteger(0);
            base.WriteInteger(Ticket.SenderId);
           base.WriteString(Ticket.SenderName);
            base.WriteInteger(Ticket.ReportedId);
           base.WriteString(Ticket.ReportedName);
            base.WriteInteger((Ticket.Status == TicketStatus.PICKED) ? Ticket.ModeratorId : 0);
           base.WriteString(Ticket.ModName);
           base.WriteString(Ticket.Message);
            base.WriteInteger(0);//No idea?
            base.WriteInteger(0);//String, int, int - this is the "matched to" a string
            {
               base.WriteString("fresh-hotel.org");
                base.WriteInteger(-1);
                base.WriteInteger(-1);

            }
        }
    }
}
PlusEMU (Support Ticket 1/4) Fix

Support Ticket 1/4 fix

Emulator\Communication\Packets\Outgoing\Moderation
ModeratorInitComposer.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.Moderation;
using Plus.HabboHotel.Support;

namespace Plus.Communication.Packets.Outgoing.Moderation
{
    class ModeratorInitComposer : ServerPacket
    {
        public ModeratorInitComposer(ICollection UserPresets, ICollection RoomPresets, Dictionary> UserActionPresets, ICollection Tickets)
            : base(ServerPacketHeader.ModeratorInitMessageComposer)
        {
            base.WriteInteger(Tickets.Count);
            foreach (SupportTicket ticket in Tickets.ToList())
            {
                base.WriteInteger(ticket.Id);
                base.WriteInteger(ticket.TabId);
                base.WriteInteger(1); // Type
                base.WriteInteger(ticket.Category); // Category
                base.WriteInteger(((int)PlusEnvironment.GetUnixTimestamp() - Convert.ToInt32(ticket.Timestamp)) * 1000);
                base.WriteInteger(ticket.Score);
                base.WriteInteger(0);
                base.WriteInteger(ticket.SenderId);
               base.WriteString(ticket.SenderName);
                base.WriteInteger(ticket.ReportedId);
               base.WriteString(ticket.ReportedName);
                base.WriteInteger((ticket.Status == TicketStatus.PICKED) ? ticket.ModeratorId : 0);
               base.WriteString(ticket.ModName);
               base.WriteString(ticket.Message);
                base.WriteInteger(0);
                base.WriteInteger(0);
            }

            base.WriteInteger(UserPresets.Count);
            foreach (string pre in UserPresets)
            {
               base.WriteString(pre);
            }

            base.WriteInteger(UserActionPresets.Count);
            foreach (KeyValuePair> Cat in UserActionPresets.ToList())
            {
               base.WriteString(Cat.Key);
                base.WriteBoolean(true);
                base.WriteInteger(Cat.Value.Count);
                foreach (ModerationPresetActionMessages Preset in Cat.Value.ToList())
                {
                   base.WriteString(Preset.Caption);
                   base.WriteString(Preset.MessageText);
                    base.WriteInteger(Preset.BanTime); // Account Ban Hours
                    base.WriteInteger(Preset.IPBanTime); // IP Ban Hours
                    base.WriteInteger(Preset.MuteTime); // Mute in Hours
                    base.WriteInteger(0);//Trading lock duration
                   base.WriteString(Preset.Notice + "\n\nPlease Note: Avatar ban is an IP ban!");
                    base.WriteBoolean(false);//Show HabboWay
                }
            }

            base.WriteBoolean(true); // Ticket right
            base.WriteBoolean(true); // Chatlogs
            base.WriteBoolean(true); // User actions alert etc
            base.WriteBoolean(true); // Kick users
            base.WriteBoolean(true); // Ban users
            base.WriteBoolean(true); // Caution etc
            base.WriteBoolean(true); // Love you, Tom

            base.WriteInteger(RoomPresets.Count);
            foreach (string pre in RoomPresets)
            {
               base.WriteString(pre);
            }
        }
    }
}
PlusEMU (Horse energy zero) Fix

Horse energy zero fix

Emulator\HabboHotel\Rooms\AI\Types
PetBot.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Drawing;
using Plus.Core;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Pathfinding;
using Plus.HabboHotel.Rooms.AI;
using Plus.HabboHotel.Rooms;
using Plus.Utilities;
using System.Collections.Generic;

namespace Plus.HabboHotel.Rooms.AI.Types
{
    public class PetBot : BotAI
    {
        private int ActionTimer;
        private int EnergyTimer;
        private int SpeechTimer;

        public PetBot(int VirtualId)
        {
            SpeechTimer = new Random((VirtualId ^ 2) + DateTime.Now.Millisecond).Next(10, 60);
            ActionTimer = new Random((VirtualId ^ 2) + DateTime.Now.Millisecond).Next(10, 30 + VirtualId);
            EnergyTimer = new Random((VirtualId ^ 2) + DateTime.Now.Millisecond).Next(10, 60);
        }

        private void RemovePetStatus()
        {
            RoomUser Pet = GetRoomUser();
            if (Pet != null)
            {
                foreach (KeyValuePair KVP in Pet.Statusses.ToList())
                {
                    if (Pet.Statusses.ContainsKey(KVP.Key))
                        Pet.Statusses.Remove(KVP.Key);
                }
            }
        }

        public override void OnSelfEnterRoom()
        {
            Point nextCoord = GetRoom().GetGameMap().getRandomWalkableSquare();
            //int randomX = PlusEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeX);
            //int randomY = PlusEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeY);
            if (GetRoomUser() != null)
                GetRoomUser().MoveTo(nextCoord.X, nextCoord.Y);
        }

        public override void OnSelfLeaveRoom(bool Kicked)
        {
        }


        public override void OnUserEnterRoom(RoomUser User)
        {
            if (User.GetClient() != null && User.GetClient().GetHabbo() != null)
            {
                RoomUser Pet = GetRoomUser();
                if (Pet != null)
                {
                    if (User.GetClient().GetHabbo().Username == Pet.PetData.OwnerName)
                    {
                        string[] Speech = PlusEnvironment.GetGame().GetChatManager().GetPetLocale().GetValue("welcome.speech.pet" + Pet.PetData.Type);
                        string rSpeech = Speech[RandomNumber.GenerateRandom(0, Speech.Length - 1)];
                        Pet.Chat(rSpeech, false);
                    }
                }
            }
        }

        public override void OnUserLeaveRoom(GameClient Client)
        {
        }

        public override void OnUserShout(RoomUser User, string Message)
        {
        }

        public override void OnTimerTick()
        {
            RoomUser Pet = GetRoomUser();
            if (Pet == null)
                return;


            #region Speech

            if (SpeechTimer <= 0)
            {
                if (Pet.PetData.DBState != DatabaseUpdateState.NeedsInsert)
                    Pet.PetData.DBState = DatabaseUpdateState.NeedsUpdate;

                if (Pet != null)
                {
                    var RandomSpeech = new Random();
                    RemovePetStatus();

                    string[] Speech = PlusEnvironment.GetGame().GetChatManager().GetPetLocale().GetValue("speech.pet" + Pet.PetData.Type);
                    string rSpeech = Speech[RandomNumber.GenerateRandom(0, Speech.Length - 1)];

                    if (rSpeech.Length != 3)
                    {
                        Pet.Chat(rSpeech, false);
                    }
                    else
                        Pet.Statusses.Add(rSpeech, TextHandling.GetString(Pet.Z));
                }
                SpeechTimer = PlusEnvironment.GetRandomNumber(20, 120);
            }
            else
            {
                SpeechTimer--;
            }

            #endregion

            #region Actions

            if (ActionTimer <= 0)
            {
                try
                {
                    RemovePetStatus();
                    ActionTimer = RandomNumber.GenerateRandom(15, 40 + GetRoomUser().PetData.VirtualId);
                    if (!GetRoomUser().RidingHorse)
                    {
                        // Remove Status
                        RemovePetStatus();

                        Point nextCoord = GetRoom().GetGameMap().getRandomWalkableSquare();
                        if (GetRoomUser().CanWalk)
                            GetRoomUser().MoveTo(nextCoord.X, nextCoord.Y);
                    }
                }
                catch (Exception e)
                {
                    Logging.HandleException(e, "PetBot.OnTimerTick");
                }
            }
            else
            {
                ActionTimer--;
            }

            #endregion

            #region Energy

            if (EnergyTimer <= 0)
            {
                RemovePetStatus(); // Remove Status

                Pet.PetData.PetEnergy(true); // Add Energy

                EnergyTimer = RandomNumber.GenerateRandom(30, 120); // 2 Min Max
            }
            else
            {
                EnergyTimer--;
            }

            #endregion
        }

        #region Commands

        public override void OnUserSay(RoomUser User, string Message)
        {
            if (User == null)
                return;

            RoomUser Pet = GetRoomUser();
            if (Pet == null)
                return;

            if (Pet.PetData.DBState != DatabaseUpdateState.NeedsInsert)
                Pet.PetData.DBState = DatabaseUpdateState.NeedsUpdate;
       
            if (Message.ToLower().Equals(Pet.PetData.Name.ToLower()))
            {
                Pet.SetRot(Rotation.Calculate(Pet.X, Pet.Y, User.X, User.Y), false);
                return;
            }

            //if (!Pet.Statusses.ContainsKey("gst thr"))
            //    Pet.Statusses.Add("gst thr", TextHandling.GetString(Pet.Z));

            if ((Message.ToLower().StartsWith(Pet.PetData.Name.ToLower() + " ") && User.GetClient().GetHabbo().Username.ToLower() == Pet.PetData.OwnerName.ToLower()) || (Message.ToLower().StartsWith(Pet.PetData.Name.ToLower() + " ") && PlusEnvironment.GetGame().GetChatManager().GetPetCommands().TryInvoke(Message.Substring(Pet.PetData.Name.ToLower().Length + 1)) == 8))
            {
                string Command = Message.Substring(Pet.PetData.Name.ToLower().Length + 1);

                int r = RandomNumber.GenerateRandom(1, 8); // Made Random
                if (Pet.PetData.Energy > 10 && r < 6 || Pet.PetData.Level > 15 || PlusEnvironment.GetGame().GetChatManager().GetPetCommands().TryInvoke(Command) == 8)
                {
                    RemovePetStatus(); // Remove Status

                    switch (PlusEnvironment.GetGame().GetChatManager().GetPetCommands().TryInvoke(Command))
                    {
                        // TODO - Level you can use the commands at...



                        #region free

                        case 1:
                            RemovePetStatus();

                            //int randomX = PlusEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeX);
                            //int randomY = PlusEnvironment.GetRandomNumber(0, GetRoom().Model.MapSizeY);
                            Point nextCoord = GetRoom().GetGameMap().getRandomWalkableSquare();
                            Pet.MoveTo(nextCoord.X, nextCoord.Y);

                            Pet.PetData.Addexperience(10); // Give XP

                            break;

                        #endregion

                        #region here

                        case 2:

                            RemovePetStatus();

                            int NewX = User.X;
                            int NewY = User.Y;

                            ActionTimer = 30; // Reset ActionTimer

                            #region Rotation

                            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;
                            }

                            #endregion

                            Pet.PetData.Addexperience(10); // Give XP

                            Pet.MoveTo(NewX, NewY);
                            break;

                        #endregion

                        #region sit

                        case 3:
                            // Remove Status
                            RemovePetStatus();

                            Pet.PetData.Addexperience(10); // Give XP

                            // Add Status
                            Pet.Statusses.Add("sit", TextHandling.GetString(Pet.Z));
                            Pet.UpdateNeeded = true;

                            ActionTimer = 25;
                            EnergyTimer = 10;
                            break;

                        #endregion

                        #region lay

                        case 4:
                            // Remove Status
                            RemovePetStatus();

                            // Add Status
                            Pet.Statusses.Add("lay", TextHandling.GetString(Pet.Z));
                            Pet.UpdateNeeded = true;

                            Pet.PetData.Addexperience(10); // Give XP

                            ActionTimer = 30;
                            EnergyTimer = 5;
                            break;

                        #endregion

                        #region dead

                        case 5:
                            // Remove Status
                            RemovePetStatus();

                            // Add Status 
                            Pet.Statusses.Add("ded", TextHandling.GetString(Pet.Z));
                            Pet.UpdateNeeded = true;

                            Pet.PetData.Addexperience(10); // Give XP

                            // Don't move to speak for a set amount of time.
                            SpeechTimer = 45;
                            ActionTimer = 30;

                            break;

                        #endregion

                        #region sleep

                        case 6:
                            // Remove Status
                            RemovePetStatus();

                            Pet.Chat("ZzzZZZzzzzZzz", false);
                            Pet.Statusses.Add("lay", TextHandling.GetString(Pet.Z));
                            Pet.UpdateNeeded = true;

                            Pet.PetData.Addexperience(10); // Give XP

                            // Don't move to speak for a set amount of time.
                            EnergyTimer = 5;
                            SpeechTimer = 30;
                            ActionTimer = 45;
                            break;

                        #endregion

                        #region jump

                        case 7:
                            // Remove Status
                            RemovePetStatus();

                            // Add Status 
                            Pet.Statusses.Add("jmp", TextHandling.GetString(Pet.Z));
                            Pet.UpdateNeeded = true;

                            Pet.PetData.Addexperience(10); // Give XP

                            // Don't move to speak for a set amount of time.
                            EnergyTimer = 5;
                            SpeechTimer = 10;
                            ActionTimer = 5;
                            break;

                        #endregion

                        #region breed
                        case 46:

                            break;
                        #endregion

                        default:
                            string[] Speech = PlusEnvironment.GetGame().GetChatManager().GetPetLocale().GetValue("pet.unknowncommand");

                            Pet.Chat(Speech[RandomNumber.GenerateRandom(0, Speech.Length - 1)], false);
                            break;
                    }
                    Pet.PetData.PetEnergy(false); // Remove Energy
                }
                else
                {
                    RemovePetStatus(); // Remove Status

                    if (Pet.PetData.Energy < 10)
                    {
                        string[] Speech = PlusEnvironment.GetGame().GetChatManager().GetPetLocale().GetValue("pet.tired");

                        var RandomSpeech = new Random();
                        Pet.Chat(Speech[RandomNumber.GenerateRandom(0, Speech.Length - 1)], false);

                        Pet.Statusses.Add("lay", TextHandling.GetString(Pet.Z));
                        Pet.UpdateNeeded = true;

                        SpeechTimer = 50;
                        ActionTimer = 45;
                        EnergyTimer = 5;
                    }
                    else
                    {
                        string[] Speech = PlusEnvironment.GetGame().GetChatManager().GetPetLocale().GetValue("pet.lazy");

                        var RandomSpeech = new Random();
                        Pet.Chat(Speech[RandomNumber.GenerateRandom(0, Speech.Length - 1)], false);

                        Pet.PetData.PetEnergy(false); // Remove Energy
                    }
                }
            }
            //Pet = null;
        }

        #endregion
    }
}
PlusEMU (StringCharFilter) Fix

StringCharFilter fix

Emulator\Utilities
StringCharFilter.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Plus.Utilities
{
    static class StringCharFilter
    {
        /// 
        /// Escapes the characters used for injecting special chars from a user input.
        /// 
        /// The string/text to escape.
        /// Allow line breaks to be used (\r\n).
        /// 
        public static string Escape(string str, bool allowBreaks = false)
        {
            str = str.Trim();
            str = str.Replace(Convert.ToChar(1), ' ');
            str = str.Replace(Convert.ToChar(2), ' ');
            str = str.Replace(Convert.ToChar(3), ' ');
            str = str.Replace(Convert.ToChar(9), ' ');

            if (!allowBreaks)
            {
                str = str.Replace(Convert.ToChar(10), ' ');
                str = str.Replace(Convert.ToChar(13), ' ');
            }

           str = Regex.Replace(str, "<(.|\\n)*?>", string.Empty);

            return str;
        }
    }
}
PlusEMU (Saving Saddle) Fix

Saving Saddle fix

Emulator\HabboHotel\Catalog\Utilities
ItemUtility.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.Items;
using Plus.HabboHotel.Items.Utilities;

namespace Plus.HabboHotel.Catalog.Utilities
{
    public static class ItemUtility
    {
        public static bool CanGiftItem(CatalogItem Item)
        {
            if (!Item.Data.AllowGift || Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_ Item.Data.ItemName.ToLower().StartsWith("cfc_
                Item.Data.InteractionType == InteractionType.BADGE || (Item.Data.Type != 's' && Item.Data.Type != 'i') || Item.CostDiamonds > 0 ||
                Item.Data.InteractionType == InteractionType.TELEPORT || Item.Data.InteractionType == InteractionType.DEAL)
                return false;

            if (Item.Data.IsRare)
                return false;

            if (PetUtility.IsPet(Item.Data.InteractionType))
                return false;
            return true;
        }

        public static bool CanSelectAmount(CatalogItem Item)
        {
            if (Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_ Item.Data.ItemName.ToLower().StartsWith("cfc_ !Item.HaveOffer || Item.Data.InteractionType == InteractionType.BADGE || Item.Data.InteractionType == InteractionType.DEAL)
                return false;
            return true;
        }

        public static int GetSaddleId(int Saddle)
        {
            switch (Saddle)
            {
                default:
                case 9:
                    return 7100; //4221 Changed to the right BaseItem, so it can be saved.
                case 10:
                    return 4450;
            }
        }

        public static bool IsRare(Item Item)
        {
            if (Item.LimitedNo > 0)
                return true;

            if (Item.Data.IsRare)
                return true;

            return false;
        }
    }
}
PlusEMU (Remove Saddle From Horse) Fix

Remove Saddle From Horse fix

Emulator\Communication\Packets\Incoming\Rooms\AI\Pets\Horse
RemoveSaddleFromHorseEvent.cs

Code:
Spoiler:
using System;using System.Linq;
using System.Text;
using System.Collections.Generic;


using Plus.HabboHotel.Rooms;


using Plus.Communication.Packets.Outgoing.Rooms.Engine;
using Plus.Communication.Packets.Outgoing.Rooms.AI.Pets;


using Plus.HabboHotel.Catalog.Utilities;
using Plus.HabboHotel.Items;
using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.Communication.Packets.Outgoing.Catalog;
using Plus.Database.Interfaces;
using System.Drawing;


namespace Plus.Communication.Packets.Incoming.Rooms.AI.Pets.Horse
{
    class RemoveSaddleFromHorseEvent : IPacketEvent
    {
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (!Session.GetHabbo().InRoom)
                return;


            Room Room = null;


            if(!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
                return;


            RoomUser PetUser = null;


            if (!Room.GetRoomUserManager().TryGetPet(Packet.PopInt(), out PetUser))
                return;


            //Fetch the furniture Id for the pets current saddle.
            int SaddleId = ItemUtility.GetSaddleId(PetUser.PetData.Saddle);


            //Remove the saddle from the pet.
            PetUser.PetData.Saddle = 0;


            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `bots_petdata` SET `have_saddle` = 0 WHERE `id` = '" + PetUser.PetData.PetId + "' LIMIT 1");
            }




            //When removing Saddle From Horse the user gets down the horse
            if (PetUser.RidingHorse)
            {
                RoomUser UserRiding = Room.GetRoomUserManager().GetRoomUserByVirtualId(PetUser.HorseID);
                if (UserRiding != null)
                {
                    UserRiding.RidingHorse = false;
                    PetUser.RidingHorse = false;
                    UserRiding.ApplyEffect(-1);
                    UserRiding.MoveTo(new Point(UserRiding.X + 1, UserRiding.Y + 1));
                }
                else
                    PetUser.RidingHorse = false;
            }


            ItemData ItemData = null;


            if (!PlusEnvironment.GetGame().GetItemManager().GetItem(SaddleId, out ItemData))
                return;


            //Creates the item for the user
            Item Item = ItemFactory.CreateSingleItemNullable(ItemData, Session.GetHabbo(), "", "", 0, 0, 0);


            if(Item != null)
            {
                Session.GetHabbo().GetInventoryComponent().TryAddItem(Item);
                Session.SendMessage(new FurniListNotificationComposer(Item.Id, 1));
                Session.SendMessage(new PurchaseOKComposer());
                Session.SendMessage(new FurniListAddComposer(Item));
                Session.SendMessage(new FurniListUpdateComposer());
            }


            Room.SendMessage(new UsersComposer(PetUser));
            Room.SendMessage(new PetHorseFigureInformationComposer(PetUser));
        }
    }
}
PlusEMU (Group badges) Fix

Group badges fix




Code:
Spoiler:

IIS

<rule name="Habbo Imaging Group Badges"> <match url="^habbo-imaging/badge/([^/]+)" ignoreCase="false" /> <action type="Rewrite" url="/habbo-imaging/badge.php?badge={R:1}" appendQueryString="false" /> </rule> <rule name="Habbo Imaging Avatarimage 1"> <match url="^habbo-imaging/avatar/([^/]+)" ignoreCase="false" /> <action type="Rewrite" url="habbo-imaging/avatarimage.php?figure={R:1}" appendQueryString="false" /> </rule> <rule name="Habbo Imaging Avatar Image 2"> <match url="^habbo-imaging/avatarimage/([^/]+)" ignoreCase="false" /> <action type="Rewrite" url="habbo-imaging/avatarimage.php?username={R:1}" appendQueryString="false" /> </rule> <rule name="Habbo Imaging Avatar Head"> <match url="^habbo-imaging/head/([^/]+)" ignoreCase="false" /> <action type="Rewrite" url="habbo-imaging/head.php?figure={R:1}" appendQueryString="false" /> </rule>

Xampp

RewriteEngine On RewriteRule ^habbo-imaging/badge/(.*).gif$ ./habbo-imaging/badge.php?badge=$1

Nginx

location /habbo-imaging { rewrite ^/habbo-imaging/badge/(.*).gif$ /habbo-imaging/badge.php?badge=$1; }
PlusEMU (Avatar room) Fix

Avatar room fix

Spoiler:



PlusEMU (WhisperEvent) Fix

WhisperEvent fix

Emulator\Communication\Packets\Incoming\Rooms\Chat
WhisperEvent.cs

Code:
Spoiler:
using System;
using System.Collections.Generic;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Core;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Quests;
using Plus.HabboHotel.Rooms;
using Plus.Communication.Packets.Incoming;
using Plus.Communication.Packets.Outgoing.Moderation;
using Plus.Utilities;
using Plus.HabboHotel.Rooms.Chat.Styles;

namespace Plus.Communication.Packets.Incoming.Rooms.Chat
{ 
    public class WhisperEvent : IPacketEvent 
    { 
        public void Parse(GameClient Session, ClientPacket Packet) 
        { 
            if (!Session.GetHabbo().InRoom) 
                return; 

            Room Room = Session.GetHabbo().CurrentRoom; 
            if (Room == null) 
                return; 

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool") && Room.CheckMute(Session)) 
            { 
                Session.SendWhisper("Oops, you're currently muted."); 
                return; 
            } 

            if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0) 
                return; 

            string Params = Packet.PopString(); 
            string ToUser = Params.Split(' ')[0]; 
            string Message = Params.Substring(ToUser.Length + 1); 
            int Colour = Packet.PopInt(); 

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); 
            if (User == null) 
                return; 

            RoomUser User2 = Room.GetRoomUserManager().GetRoomUserByHabbo(ToUser); 
            if (User2 == null) 
                return; 

            if (Session.GetHabbo().TimeMuted > 0) 
            { 
                Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted)); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override")) 
                Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message); 

            ChatStyle Style = null; 
            if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight))) 
                Colour = 0; 

            User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId; 

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) 
            { 
                int MuteTime; 
                if (User.IncrementAndCheckFlood(out MuteTime)) 
                { 
                    Session.SendMessage(new FloodControlComposer(MuteTime)); 
                    return; 
                } 
            } 

            if (!User2.GetClient().GetHabbo().ReceiveWhispers && !Session.GetHabbo().GetPermissions().HasRight("room_whisper_override")) 
            { 
                Session.SendWhisper("Oops, this user has their whispers disabled!"); 
                return; 
            } 

            PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new Plus.HabboHotel.Rooms.Chat.Logs.ChatlogEntry(Session.GetHabbo().Id, Room.Id, ": " + Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room)); 

            Room.AddChatlog(Session.GetHabbo().Id, ": " + Message); 

            if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message)) 
            { 
                Session.GetHabbo().BannedPhraseCount++; 
                if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount) 
                { 
                    PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200)); 
                    Session.Disconnect(); 
                    return; 
                } 
                Session.SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble)); 
                return; 
            } 


            PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT); 

            User.UnIdle(); 
            User.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble)); 

            if (User2 != null && !User2.IsBot && User2.UserId != User.UserId) 
            { 
                if (!User2.GetClient().GetHabbo().MutedUsers.Contains(Session.GetHabbo().Id)) 
                { 
                    User2.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, User.LastBubble)); 
                } 
            } 
  
            List ToNotify = Room.GetRoomUserManager().GetRoomUserByRank(2); 
            if (ToNotify.Count > 0) 
            { 
                foreach (RoomUser user in ToNotify) 
                { 
                    if (user != null && user.HabboId != User2.HabboId && user.HabboId != User.HabboId) 
                    { 
                        if (user.GetClient() != null && user.GetClient().GetHabbo() != null && !user.GetClient().GetHabbo().IgnorePublicWhispers) 
                        { 
                            user.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "[Whisper to " + ToUser + "] " + Message, 0, User.LastBubble)); 
                        } 
                    } 
                } 
            } 
        } 
    } 
}  
PlusEMU (Shout Event) Fix

Shout Event fix

Emulator\Communication\Packets\Incoming\Rooms\Chat
ShoutEvent.cs

Code:
Spoiler:
using System;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Core;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Global;
using Plus.HabboHotel.Quests;
using Plus.HabboHotel.Rooms;
using Plus.Communication.Packets.Incoming;
using Plus.Utilities;
using Plus.Communication.Packets.Outgoing.Moderation;
using Plus.HabboHotel.Rooms.Chat.Styles;

namespace Plus.Communication.Packets.Incoming.Rooms.Chat
{
       public class ShoutEvent : IPacketEvent 
    { 
        public void Parse(GameClient Session, ClientPacket Packet) 
        { 
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom) 
                return; 

            Room Room = Session.GetHabbo().CurrentRoom; 
            if (Room == null) 
                return; 

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); 
            if (User == null) 
                return; 

            string Message = StringCharFilter.Escape(Packet.PopString()); 
            if (Message.Length > 100) 
                Message = Message.Substring(0, 100); 

            int Colour = Packet.PopInt(); 

            ChatStyle Style = null; 
            if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight))) 
                Colour = 0; 

            User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId; 

            if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0) 
                return; 

            if (Session.GetHabbo().TimeMuted > 0) 
            { 
                Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted)); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("room_ignore_mute") && Room.CheckMute(Session)) 
            { 
                Session.SendWhisper("Oops, you're currently muted."); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) 
            { 
                int MuteTime; 
                if (User.IncrementAndCheckFlood(out MuteTime)) 
                { 
                    Session.SendMessage(new FloodControlComposer(MuteTime)); 
                    return; 
                } 
            } 
             
            if (Message.StartsWith(":", StringComparison.CurrentCulture) && PlusEnvironment.GetGame().GetChatManager().GetCommands().Parse(Session, Message)) 
                return; 

            PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new Plus.HabboHotel.Rooms.Chat.Logs.ChatlogEntry(Session.GetHabbo().Id, Room.Id, Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room)); 

            if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message)) 
            { 
                Session.GetHabbo().BannedPhraseCount++; 
                if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount) 
                { 
                    PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200)); 
                    Session.Disconnect(); 
                    return; 
                } 
                Session.SendMessage(new ShoutComposer(User.VirtualId, Message, 0, Colour)); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override")) 
                Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message); 

            PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT); 

            User.UnIdle(); 
            User.OnChat(User.LastBubble, Message, true); 
        } 
    } 
}  
PlusEMU (Chat Event) Fix

Chat Event fix

Emulator\Communication\Packets\Incoming\Rooms\Chat
ChatEvent.cs

Code:
Spoiler:
using System;

using Plus.Core;
using Plus.Communication.Packets.Incoming;
using Plus.Utilities;
using Plus.HabboHotel.Global;
using Plus.HabboHotel.Quests;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Rooms.Chat.Logs;
using Plus.Communication.Packets.Outgoing.Messenger;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Communication.Packets.Outgoing.Moderation;
using Plus.HabboHotel.Rooms.Chat.Styles;

namespace Plus.Communication.Packets.Incoming.Rooms.Chat
{ 
    public class ChatEvent : IPacketEvent 
    { 
        public void Parse(GameClient Session, ClientPacket Packet) 
        { 
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom) 
                return; 

            Room Room = Session.GetHabbo().CurrentRoom; 
            if (Room == null) 
                return; 

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); 
            if (User == null) 
                return; 

            string Message = StringCharFilter.Escape(Packet.PopString()); 
            if (Message.Length > 100) 
                Message = Message.Substring(0, 100); 

            int Colour = Packet.PopInt(); 

            ChatStyle Style = null; 
            if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight))) 
                Colour = 0; 

            User.UnIdle(); 

            if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0) 
                return; 

            if (Session.GetHabbo().TimeMuted > 0) 
            { 
                Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted)); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("room_ignore_mute") && Room.CheckMute(Session)) 
            { 
                Session.SendWhisper("Oops, you're currently muted."); 
                return; 
            } 

            User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId; 

            if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) 
            { 
                int MuteTime; 
                if (User.IncrementAndCheckFlood(out MuteTime)) 
                { 
                    Session.SendMessage(new FloodControlComposer(MuteTime)); 
                    return; 
                } 
            } 

            if (Message.StartsWith(":", StringComparison.CurrentCulture) && PlusEnvironment.GetGame().GetChatManager().GetCommands().Parse(Session, Message)) 
                return; 

            PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new ChatlogEntry(Session.GetHabbo().Id, Room.Id, Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room)); 

            if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message)) 
            { 
                Session.GetHabbo().BannedPhraseCount++; 
                if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount) 
                { 
                    PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200)); 
                    Session.Disconnect(); 
                    return; 
                } 

                Session.SendMessage(new ChatComposer(User.VirtualId, Message, 0, Colour)); 
                return; 
            } 

            if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override")) 
                Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message); 


            PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT); 

            User.OnChat(User.LastBubble, Message, false); 
        }
    }
}
PlusEMU (Saving Pets) Fix

Saving Pets fix

Emulator\Communication\Packets\Incoming\Rooms\AI\Pets
PickUpPetEvent.cs

Code:
Spoiler:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.Rooms.AI;
using Plus.HabboHotel.Rooms;
using Plus.Communication.Packets.Outgoing.Inventory.Pets;

using System.Drawing;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Engine;
using Plus.Database.Interfaces;

namespace Plus.Communication.Packets.Incoming.Rooms.AI.Pets
{
    class PickUpPetEvent : IPacketEvent
    {
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (!Session.GetHabbo().InRoom)
                return;

            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetInventoryComponent() == null)
                return;

            Room Room;

            if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
                return;

            int PetId = Packet.PopInt();

            RoomUser Pet = null;
            if (!Room.GetRoomUserManager().TryGetPet(PetId, out Pet))
            {
                //Check kick rights, just because it seems most appropriate.
                if ((!Room.CheckRights(Session) && Room.WhoCanKick != 2 && Room.Group == null) || (Room.Group != null && !Room.CheckRights(Session, false, true)))
                    return;

                //Okay so, we've established we have no pets in this room by this virtual Id, let us check out users, maybe they're creeping as a pet?!
                RoomUser TargetUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(PetId);
                if (TargetUser == null)
                    return;

                //Check some values first, please!
                if (TargetUser.GetClient() == null || TargetUser.GetClient().GetHabbo() == null)
                    return;

                //Update the targets PetId.
                TargetUser.GetClient().GetHabbo().PetId = 0;

                //Quickly remove the old user instance.
                Room.SendMessage(new UserRemoveComposer(TargetUser.VirtualId));

                //Add the new one, they won't even notice a thing!!11 8-)
                Room.SendMessage(new UsersComposer(TargetUser));
                return;
            }

            if (Session.GetHabbo().Id != Pet.PetData.OwnerId && !Room.CheckRights(Session, true, false))
            {
                Session.SendWhisper("You can only pickup your own pets, to kick a pet you must have room rights.");
                return;
            }

            //Only if user is riding horse duuuh
            if (Pet.RidingHorse)
            {
                RoomUser UserRiding = Room.GetRoomUserManager().GetRoomUserByVirtualId(Pet.HorseID);
                if (UserRiding != null)
                {
                    //Set user is not longer riding a horse
                    UserRiding.RidingHorse = false;
                    //Set user effect to normal
                    UserRiding.ApplyEffect(-1);
                    UserRiding.MoveTo(new Point(UserRiding.X + 1, UserRiding.Y + 1));
                }
                else
                    Pet.RidingHorse = false;
            }

            Pet.PetData.RoomId = 0;
            Pet.PetData.PlacedInRoom = false;

            Pet pet = Pet.PetData;
            if (pet != null)
            {
                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.RunQuery("UPDATE `bots` SET `room_id` = '0', `x` = '0', `Y` = '0', `Z` = '0' WHERE `id` = '" + pet.PetId + "' LIMIT 1");
                    dbClient.RunQuery("UPDATE `bots_petdata` SET `experience` = '" + pet.experience + "', `energy` = '" + pet.Energy + "', `nutrition` = '" + pet.Nutrition + "', `respect` = '" + pet.Respect + "' WHERE `id` = '" + pet.PetId + "' LIMIT 1");
                }

                Session.GetHabbo().GetInventoryComponent().TryAddPet(Pet.PetData);
                Session.SendMessage(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
            }

            if (pet.OwnerId != Session.GetHabbo().Id)
            {
                GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(pet.OwnerId);
                if (Target != null)
                {
                    Target.GetHabbo().GetInventoryComponent().TryAddPet(Pet.PetData);
                    Session.SendMessage(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
                    Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);

                    Target.SendMessage(new PetInventoryComposer(Target.GetHabbo().GetInventoryComponent().GetPets()));
                    return;
                }
            }

            Session.SendMessage(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
            Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);
        }
    }
}
Online users: There aren't users online at the moment!
2013 - 2017 © || Made by Tom Lammers & Tim M. - Design by Tom Lammers || Version V4.3 || Contact us here