Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
(Fix) Plus Edit - Pets DC (Fix)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Hangout" data-source="post: 270886" data-attributes="member: 9025"><p>Place pets in the room <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p></p><p>Go to Messages -> Requests -> Rooms.cs.</p><p>Find:</p><p>Code:</p><p>internal void PlacePet()</p><p>Replace:</p><p>Code:</p><p>internal void PlacePet() //colocar pet</p><p>{</p><p>Room Room = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);</p><p></p><p>if (Room == null || (Room.AllowPets == 0 && !Room.CheckRights(Session, true)) || !Room.CheckRights(Session, true))</p><p>{</p><p>return;</p><p>}</p><p></p><p>uint PetId = Request.PopWiredUInt();</p><p></p><p>Pet Pet = Session.GetHabbo().GetInventoryComponent().GetPet(PetId);</p><p></p><p>if (Pet == null || Pet.PlacedInRoom)</p><p>{</p><p>return;</p><p>}</p><p></p><p>int X = Request.PopWiredInt32();</p><p>int Y = Request.PopWiredInt32();</p><p></p><p>if (!Room.GetGameMap().CanWalk(X, Y, false))</p><p>{</p><p>return;</p><p>}</p><p></p><p></p><p>using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p>{</p><p>dbClient.runFastQuery("UPDATE bots SET room_id = '" + Room.RoomId + "', x = '" + X + "', y = '" + Y + "' WHERE id = '" + PetId + "'");</p><p>}</p><p></p><p>Pet.PlacedInRoom = true;</p><p>Pet.RoomId = Room.RoomId;</p><p></p><p>List<RandomSpeech> RndSpeechList = new List<RandomSpeech>();</p><p>List<BotResponse> BotResponse = new List<Silverwave.HabboHotel.RoomBots.BotResponse>();</p><p>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);</p><p></p><p>Session.GetHabbo().GetInventoryComponent().MovePetToRoom(Pet.PetId);</p><p></p><p>if (Pet.DBState != DatabaseUpdateState.NeedsInsert)</p><p>Pet.DBState = DatabaseUpdateState.NeedsUpdate;</p><p></p><p>using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p>Room.GetRoomUserManager().SavePets(dbClient);</p><p></p><p>Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializePetInventory());</p><p></p><p>}</p><p>Find:</p><p>Code:</p><p>dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId);</p><p>Replace: </p><p>Code:</p><p>dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId + " AND ai_type = 'generic'");</p><p>Go to HabboHotel -> Rooms -> RoomUser.cs</p><p>Find:</p><p>Code:</p><p>internal void Serialize(ServerMessage Message, bool gotPublicRoom)</p><p>Replace:</p><p>Code:</p><p>internal void Serialize(ServerMessage Message, bool gotPublicRoom)</p><p>{</p><p>if (Message == null)</p><p>return;</p><p></p><p>if (IsSpectator)</p><p>return;</p><p></p><p>if (IsBot)</p><p>{</p><p>Message.AppendInt32(BotAI.BaseId);</p><p>Message.AppendString(BotData.Name);</p><p>Message.AppendString(BotData.Motto);</p><p>if (BotData.AiType == AIType.Pet)</p><p>if (PetData.HaveSaddle == Convert.ToBoolean(2))</p><p>{</p><p>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 }));</p><p>}</p><p>else if (PetData.HaveSaddle == Convert.ToBoolean(1))</p><p>{</p><p>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" }));</p><p>}</p><p>else</p><p>{</p><p>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 }));</p><p>}</p><p></p><p>//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 + ""));</p><p>else</p><p>Message.AppendString(BotData.Look.ToLower());</p><p>Message.AppendInt32(VirtualId);</p><p>Message.AppendInt32(X);</p><p>Message.AppendInt32(Y);</p><p>Message.AppendString(TextHandling.GetString(Z));</p><p>Message.AppendInt32(0);</p><p>Message.AppendInt32((BotData.AiType == AIType.Generic) ? 4 : 2);</p><p></p><p>if (BotData.AiType == AIType.Pet)</p><p>{</p><p></p><p>Message.AppendInt32(PetData.Type);</p><p>Message.AppendInt32(PetData.OwnerId); // userid</p><p>Message.AppendString(PetData.OwnerName); // username</p><p>Message.AppendInt32(1);</p><p>Message.AppendBoolean(PetData.HaveSaddle);</p><p>Message.AppendBoolean(RidingHorse);</p><p>Message.AppendInt32(0);</p><p>Message.AppendInt32(0);</p><p>Message.AppendString("");</p><p>}</p><p>else</p><p>{</p><p>Message.AppendString(BotData.Gender.ToLower()); // ?</p><p>Message.AppendInt32(BotData.OwnerId); // ?</p><p>Message.AppendString(SilverwaveEnvironment.GetGame().GetClientManager().GetNameById(BotData.OwnerId)); // Owner name</p><p>Message.AppendInt32(4);</p><p>Message.AppendShort(1);</p><p>Message.AppendShort(2);</p><p>Message.AppendShort(5);</p><p>Message.AppendShort(4);</p><p>}</p><p>}</p><p>else if (!IsBot && GetClient() != null && GetClient().GetHabbo() != null)</p><p>{</p><p>Group Group = SilverwaveEnvironment.GetGame().GetGroupManager().GetGroup(GetClient().GetHabbo().FavouriteGroup);</p><p></p><p>Users.Habbo User = GetClient().GetHabbo();</p><p>Message.AppendInt32(User.Id);</p><p>Message.AppendString(User.Username);</p><p>Message.AppendString(User.Motto);</p><p>Message.AppendString(User.Look);</p><p>Message.AppendInt32(VirtualId);</p><p>Message.AppendInt32(X);</p><p>Message.AppendInt32(Y);</p><p>Message.AppendString(TextHandling.GetString(Z));</p><p>Message.AppendInt32(0);</p><p>Message.AppendInt32(1);</p><p>Message.AppendString(User.Gender.ToLower());</p><p>if (Group != null)</p><p>{</p><p>Message.AppendInt32(Group.Id);</p><p>Message.AppendInt32(0);</p><p>Message.AppendString(Group.Name);</p><p>}</p><p>else</p><p>{</p><p>Message.AppendInt32(0);</p><p>Message.AppendInt32(0);</p><p>Message.AppendString("");</p><p>}</p><p>Message.AppendString("");</p><p>//Message.AppendBoolean(false);</p><p>Message.AppendInt32(User.ActivityPoints);</p><p>Message.AppendBoolean(false);</p><p>//Message.AppendBoolean(true);</p><p></p><p>/*if (gotPublicRoom)</p><p>Message.AppendString("ch=s01/250,56,49");</p><p>else</p><p>Message.AppendString(string.Empty);</p><p>*/</p><p></p><p>}</p><p>}</p><p></p><p>Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl</p><p>Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl</p><p></p><p></p><p>Headers by Bloodraven</p><p></p><p>Credits to : <strong><a href="http://forum.*****.com/members/684165.html" target="_blank">Jeanzinh0</a> </strong>from RZ</p></blockquote><p></p>
[QUOTE="Hangout, post: 270886, member: 9025"] 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 Credits to : [B][URL='http://forum.*****.com/members/684165.html']Jeanzinh0[/URL] [/B]from RZ [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
(Fix) Plus Edit - Pets DC (Fix)
Top