-
Plus Edit - Revision 2 - Pets fix
Place pets in the room :)
Go to Messages -> Requests -> Rooms.cs.
Find:
Code:
internal void PlacePet()
Replace:
Code:
internal void PlacePet() //colocar pet
{
Room Room = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || (Room.AllowPets == 0 && !Room.CheckRights(Session, true)) || !Room.CheckRights(Session, true))
{
return;
}
uint PetId = Request.PopWiredUInt();
Pet Pet = Session.GetHabbo().GetInventoryComponent().GetPet(PetId);
if (Pet == null || Pet.PlacedInRoom)
{
return;
}
int X = Request.PopWiredInt32();
int Y = Request.PopWiredInt32();
if (!Room.GetGameMap().CanWalk(X, Y, false))
{
return;
}
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE bots SET room_id = '" + Room.RoomId + "', x = '" + X + "', y = '" + Y + "' WHERE id = '" + PetId + "'");
}
Pet.PlacedInRoom = true;
Pet.RoomId = Room.RoomId;
List<RandomSpeech> RndSpeechList = new List<RandomSpeech>();
List<BotResponse> BotResponse = new List<Silverwave.HabboHotel.RoomBots.BotResponse>();
RoomUser PetUser = Room.GetRoomUserManager().DeployBot(new RoomBot(Pet.PetId, Convert.ToUInt32(Pet.OwnerId), Pet.RoomId, AIType.Pet, "freeroam", Pet.Name, "", Pet.Look, X, Y, 0, 0, 0, 0, 0, 0, ref RndSpeechList, ref BotResponse, "", 0), Pet);
Session.GetHabbo().GetInventoryComponent().MovePetToRoom(Pet.PetId);
if (Pet.DBState != DatabaseUpdateState.NeedsInsert)
Pet.DBState = DatabaseUpdateState.NeedsUpdate;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
Room.GetRoomUserManager().SavePets(dbClient);
Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializePetInventory());
}
Find:
Code:
dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId);
Replace:
Code:
dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId + " AND ai_type = 'generic'");
Go to HabboHotel -> Rooms -> RoomUser.cs
Find:
Code:
internal void Serialize(ServerMessage Message, bool gotPublicRoom)
Replace:
Code:
internal void Serialize(ServerMessage Message, bool gotPublicRoom)
{
if (Message == null)
return;
if (IsSpectator)
return;
if (IsBot)
{
Message.AppendInt32(BotAI.BaseId);
Message.AppendString(BotData.Name);
Message.AppendString(BotData.Motto);
if (BotData.AiType == AIType.Pet)
if (PetData.HaveSaddle == Convert.ToBoolean(2))
{
Message.AppendString(string.Concat(new object[] { this.BotData.Look.ToLower(), " 3 4 10 0 2 ", this.PetData.PetHair, " ", this.PetData.HairDye, " 3 ", this.PetData.PetHair, " ", this.PetData.HairDye }));
}
else if (PetData.HaveSaddle == Convert.ToBoolean(1))
{
Message.AppendString(string.Concat(new object[] { this.BotData.Look.ToLower(), " 3 2 ", this.PetData.PetHair, " ", this.PetData.HairDye, " 3 ", this.PetData.PetHair, " ", this.PetData.HairDye, " 4 9 0" }));
}
else
{
Message.AppendString(string.Concat(new object[] { this.BotData.Look.ToLower(), " 2 2 ", this.PetData.PetHair, " ", this.PetData.HairDye, " 3 ", this.PetData.PetHair, " ", this.PetData.HairDye }));
}
//Message.AppendString(BotData.Look.ToLower() + ((PetData.HaveSaddle) ? " 3 2 " + PetData.PetHair + " " + PetData.HairDye + " 3 " + PetData.PetHair + " " + PetData.HairDye + " 4 9 0" : " 2 2 " + PetData.PetHair + " " + PetData.HairDye + " 3 " + PetData.PetHair + " " + PetData.HairDye + ""));
else
Message.AppendString(BotData.Look.ToLower());
Message.AppendInt32(VirtualId);
Message.AppendInt32(X);
Message.AppendInt32(Y);
Message.AppendString(TextHandling.GetString(Z));
Message.AppendInt32(0);
Message.AppendInt32((BotData.AiType == AIType.Generic) ? 4 : 2);
if (BotData.AiType == AIType.Pet)
{
Message.AppendInt32(PetData.Type);
Message.AppendInt32(PetData.OwnerId); // userid
Message.AppendString(PetData.OwnerName); // username
Message.AppendInt32(1);
Message.AppendBoolean(PetData.HaveSaddle);
Message.AppendBoolean(RidingHorse);
Message.AppendInt32(0);
Message.AppendInt32(0);
Message.AppendString("");
}
else
{
Message.AppendString(BotData.Gender.ToLower()); // ?
Message.AppendInt32(BotData.OwnerId); // ?
Message.AppendString(SilverwaveEnvironment.GetGame().GetClientManager().GetNameById(BotData.OwnerId)); // Owner name
Message.AppendInt32(4);
Message.AppendShort(1);
Message.AppendShort(2);
Message.AppendShort(5);
Message.AppendShort(4);
}
}
else if (!IsBot && GetClient() != null && GetClient().GetHabbo() != null)
{
Group Group = SilverwaveEnvironment.GetGame().GetGroupManager().GetGroup(GetClient().GetHabbo().FavouriteGroup);
Users.Habbo User = GetClient().GetHabbo();
Message.AppendInt32(User.Id);
Message.AppendString(User.Username);
Message.AppendString(User.Motto);
Message.AppendString(User.Look);
Message.AppendInt32(VirtualId);
Message.AppendInt32(X);
Message.AppendInt32(Y);
Message.AppendString(TextHandling.GetString(Z));
Message.AppendInt32(0);
Message.AppendInt32(1);
Message.AppendString(User.Gender.ToLower());
if (Group != null)
{
Message.AppendInt32(Group.Id);
Message.AppendInt32(0);
Message.AppendString(Group.Name);
}
else
{
Message.AppendInt32(0);
Message.AppendInt32(0);
Message.AppendString("");
}
Message.AppendString("");
//Message.AppendBoolean(false);
Message.AppendInt32(User.ActivityPoints);
Message.AppendBoolean(false);
//Message.AppendBoolean(true);
/*if (gotPublicRoom)
Message.AppendString("ch=s01/250,56,49");
else
Message.AppendString(string.Empty);
*/
}
}
Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl
Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl
Headers by Bloodraven
http://i.imgur.com/vy3osCW.png
-
Re: Plus Edit - Revision 2 - Pets fix
Oh Nice works! Thanks very much =)!
-
Re: Plus Edit - Revision 2 - Pets fix
Great fix. I'll be using.
Sorry my english, I'm Brazilian
-
Re: Plus Edit - Revision 2 - Pets fix
-
Re: Plus Edit - Revision 2 - Pets fix
-
Re: Plus Edit - Revision 2 - Pets fix
-
Re: Plus Edit - Revision 2 - Pets fix
Is there a fix for the modtools?
-
Re: Plus Edit - Revision 2 - Pets fix
-
Re: Plus Edit - Revision 2 - Pets fix
I've searched for "internal void PlacePet()" in the Rooms.CS but it has no record of it at all.. :S
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
MrSpooks
I've searched for "internal void PlacePet()" in the Rooms.CS but it has no record of it at all.. :S
It is there. Messages -> Requests -> Rooms.cs Line 3365
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Custom1136
MoreNoob credits?
You are kidding me, right?
EDIT:
MoreNoob probably have it fixed
http://i.imgur.com/BCxEOV7.png
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Metthew
It is there. Messages -> Requests -> Rooms.cs Line 3365
Ohhhhhh Rooms.cs no wounder I could not find it he said in Room.cs cheers buddy
-
Re: Plus Edit - Revision 2 - Pets fix
Don't you have to update the headers?
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Bloodraven
Don't you have to update the headers?
Gifts fix I updated the header
Pets no :)
-
Re: Plus Edit - Revision 2 - Pets fix
Thanks for this much appreciated!
-
Re: Plus Edit - Revision 2 - Pets fix
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Twan
I cant buy pets now...
Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl
Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl
I haven't tested because Visual Studio is still updating, it should work.
Credits to Spot Ify.
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Bloodraven
Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl
Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl
I haven't tested because Visual Studio is still updating, it should work.
hihi thanks to me and its working :P
Didnt saw this release lol xD pets are not disconnecting anymore thanks D:
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Bloodraven
Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl
Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl
I haven't tested because Visual Studio is still updating, it should work.
Work :D
http://i.imgur.com/1q30Aus.png
-
Re: Plus Edit - Revision 2 - Pets fix
Im now getting an bots speech bubble when an pet talks...
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Spot Ify
hihi thanks to me and its working :P
Didnt saw this release lol xD pets are not disconnecting anymore thanks D:
Sorry, I was asking about on Skype and someone gave those, he admitted he got them from a post by you after I had asked him. Thank you.
So use Spot Ify's headers and Jeanzinh0's fix and you have near complete pets (training has to be written)
-
Re: Plus Edit - Revision 2 - Pets fix
Well, still it has an bots speech after i did the fixes from the other thread
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Twan
Well, still it has an bots speech after i did the fixes from the other thread
Hang on I will fix it in a second.
EDIT: actually I can't, Visual Studio Update 4 just fucked up my entire installation for VS. fFSSSS
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Bloodraven
Hang on I will fix it in a second.
Im trying to fix it too but i can't get it work it picks all the time the same bubble as IsBot :L EDIT
i got it change: in RoomUser.cs
if (IsPet || IsBot)
{
InvokedChatMessage messageB;
messageB = new InvokedChatMessage(this, Message, Shout, (IsBot ? 2 : 0),count);
GetRoom().QueueChatMessage(messageB);
return;
}
to
if (IsPet || IsBot)
{
InvokedChatMessage messageB;
messageB = new InvokedChatMessage(this, Message, Shout, (IsPet ? 0 : 2),count);
GetRoom().QueueChatMessage(messageB);
return;
}
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Jeanzinh0
Jean , Tem a Furnidata funcionando os mobis staffs ae ? Agradeçe.
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Daniel Spd
Jean , Tem a Furnidata funcionando os mobis staffs ae ? Agradeçe.
This is a enlish forum....
-
Re: Plus Edit - Revision 2 - Pets fix
Quote:
Originally Posted by
Troll Hotel
Im trying to fix it too but i can't get it work it picks all the time the same bubble as IsBot :L EDIT
i got it change: in RoomUser.cs
if (IsPet || IsBot)
{
InvokedChatMessage messageB;
messageB = new InvokedChatMessage(this, Message, Shout, (IsBot ? 2 : 0),count);
GetRoom().QueueChatMessage(messageB);
return;
}
to
if (IsPet || IsBot)
{
InvokedChatMessage messageB;
messageB = new InvokedChatMessage(this, Message, Shout, (IsPet ? 0 : 2),count);
GetRoom().QueueChatMessage(messageB);
return;
}
Thanks, it works!