PlusEMU Pets Not saving

Status
Not open for further replies.
Jan 7, 2016
194
15
Hello everyone sooo I have done everything to fix this and tried every fix, using 6078 SWF's, variables are right, client loads. The SQL import, altering the tables, pickuppetevent.cs as well. this is the emu im using. Here is me about to purchase the bear, ect. here is the aftermath and bear.swf all that do exist. So what else could be causing this? here is my bots_petdata my commands: my responses
I've done this:
Code:
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='10' WHERE (`id`='755');
UPDATE `furniture` SET `interaction_type`='exchange' WHERE (`id`='756');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='20' WHERE (`id`='757');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='50' WHERE (`id`='758');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='5' WHERE (`id`='759');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='500' WHERE (`id`='1145');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='200' WHERE (`id`='1146');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='100' WHERE (`id`='1148');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='50' WHERE (`id`='1149');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='25000' WHERE (`id`='5045');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='1000' WHERE (`id`='5046');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='500' WHERE (`id`='5047');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='250' WHERE (`id`='5048');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='100' WHERE (`id`='5049');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='5000' WHERE (`id`='72021');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='200' WHERE (`id`='445457');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='75' WHERE (`id`='445458');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='300' WHERE (`id`='532591');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='750' WHERE (`id`='540019');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='350' WHERE (`id`='540020');
UPDATE `furniture` SET `interaction_type`='exchange', `behaviour_data`='500' WHERE (`id`='1000000010');

UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet0';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet1';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet2';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet3';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet4';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet5';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet6';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet7';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet8';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet9';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet10';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet11';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet12';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet13';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet14';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet15';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet16';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet17';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet18';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet19';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet20';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet21';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet22';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet23';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet24';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet25';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet26';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet27';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet28';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet29';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet30';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet31';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet32';
UPDATE `furniture` SET `interaction_type` = 'pet' WHERE `interaction_type` = 'pet33';

UPDATE `furniture` SET `behaviour_data`='5' WHERE (`id`='20220');
UPDATE `furniture` SET `behaviour_data`='3' WHERE (`id`='20301');
UPDATE `furniture` SET `behaviour_data`='4' WHERE (`id`='20302');
UPDATE `furniture` SET `behaviour_data`='1' WHERE (`id`='20304');
UPDATE `furniture` SET `behaviour_data`='1' WHERE (`id`='20304');
UPDATE `furniture` SET `behaviour_data`='2' WHERE (`id`='20306');
UPDATE `furniture` SET `behaviour_data`='8' WHERE (`id`='20600');
UPDATE `furniture` SET `behaviour_data`='11' WHERE (`id`='20601');
UPDATE `furniture` SET `behaviour_data`='10' WHERE (`id`='20602');
UPDATE `furniture` SET `behaviour_data`='12' WHERE (`id`='20603');
UPDATE `furniture` SET `behaviour_data`='14' WHERE (`id`='30000');
UPDATE `furniture` SET `behaviour_data`='15' WHERE (`id`='30001');
UPDATE `furniture` SET `behaviour_data`='9' WHERE (`id`='30002');
UPDATE `furniture` SET `behaviour_data`='28' WHERE (`id`='30003');
UPDATE `furniture` SET `behaviour_data`='29' WHERE (`id`='30004');
UPDATE `furniture` SET `behaviour_data`='30' WHERE (`id`='30005');
UPDATE `furniture` SET `behaviour_data`='7' WHERE (`id`='83545');
UPDATE `furniture` SET `behaviour_data`='6' WHERE (`id`='84586');
This
Code:
ALTER TABLE `furniture`
ADD COLUMN `behaviour_data`  int(11) NOT NULL DEFAULT 0 AFTER `interaction_type`;
 

jasoks

New Member
Aug 27, 2016
21
5
Hello, replace your PickUpPetEvent.cs with:
PHP:
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.SendPacket(new UserRemoveComposer(TargetUser.VirtualId));

                //Add the new one, they won't even notice a thing!!11 8-)
                Room.SendPacket(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.SendPacket(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.SendPacket(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
                    Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);

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

            Session.SendPacket(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
            Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);
        }
    }
}

Should work.
 
Jan 7, 2016
194
15
Hello, replace your PickUpPetEvent.cs with:
PHP:
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.SendPacket(new UserRemoveComposer(TargetUser.VirtualId));

                //Add the new one, they won't even notice a thing!!11 8-)
                Room.SendPacket(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.SendPacket(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.SendPacket(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
                    Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);

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

            Session.SendPacket(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
            Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);
        }
    }
}

Should work.
Yeah, I tried that and didn't work but it seemed since I tried doing behavour_data as it is V1 messed up the furniture table so now it's all good but thanks bud!
 
Status
Not open for further replies.

Users who are viewing this thread

Top