This should fix the bug where you buy a pet and it wont show up in your inventory right away.
Find
And replace that method with this one.PHP Code:internal static Pet CreatePet(uint UserId, string Name, int Type, string Race, string Color)
PHP Code:internal static Pet CreatePet(uint UserId, string Name, int Type, string Race, string Color)
{
GameClient clientByUserID = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
Pet pet = new Pet(0x194, UserId, 0, Name, (uint) Type, Race, Color, 0, 100, 100, 0, (double) ButterflyEnvironment.GetUnixTimestamp(), 0, 0, 0.0, 0, 0, -1, false) {
DBState = DatabaseUpdateState.NeedsUpdate
};
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
if (adapter.dbType == DatabaseType.MSSQL)
{
adapter.setQuery(string.Concat(new object[] { "INSERT INTO user_pets (user_id,name,type,race,color,expirience,energy,createstamp,nutrition,respect,x,y,z) OUTPUT INSERTED.* VALUES (", pet.OwnerId, ",@name,", pet.Type, ",@race,@color,0,100,'", pet.CreationStamp, "',0,0,0,0,0)" }));
}
else
{
adapter.setQuery(string.Concat(new object[] { "INSERT INTO user_pets (user_id,name,type,race,color,expirience,energy,createstamp) VALUES (", pet.OwnerId, ",@name,", pet.Type, ",@race,@color,0,100,'", pet.CreationStamp, "')" }));
}
adapter.addParameter("name", pet.Name);
adapter.addParameter("race", pet.Race);
adapter.addParameter("color", pet.Color);
pet.PetId = (uint) adapter.insertQuery();
}
clientByUserID.GetHabbo().GetInventoryComponent().AddPet(pet);
ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(clientByUserID, "ACH_PetLover", 1);
clientByUserID.SendMessage(clientByUserID.GetHabbo().GetInventoryComponent().SerializePetInventory());
return pet;
}
That should fix it.

