/// <summary> /// Initializes a new instance of the <see cref="Pet" /> class. /// </summary> /// <param name="petId">The pet identifier.</param> /// <param name="ownerId">The owner identifier.</param> /// <param name="roomId">The room identifier.</param> /// <param name="name">The name.</param> /// <param name="type">The type.</param> /// <param name="race">The race.</param> /// <param name="experience">The experience.</param> /// <param name="energy">The energy.</param> /// <param name="nutrition">The nutrition.</param> /// <param name="respect">The respect.</param> /// <param name="creationStamp">The creation stamp.</param> /// <param name="x">The x.</param> /// <param name="y">The y.</param> /// <param name="z">The z.</param> /// <param name="havesaddle">if set to <c>true</c> [havesaddle].</param> /// <param name="anyoneCanRide">The anyone can ride.</param> /// <param name="dye">The dye.</param> /// <param name="petHer">The pet her.</param> /// <param name="rarity">The rarity.</param> /// <param name="lastHealth">The last health.</param> /// <param name="untilGrown">The until grown.</param> /// <param name="moplaBreed">The mopla breed.</param> /// <param name="color"></param> internal Pet(uint petId, uint ownerId, uint roomId, string name, string type, uint race, uint experience, uint energy, uint nutrition, uint respect, double creationStamp, int x, int y, double z, bool havesaddle, int anyoneCanRide, int dye, int petHer, int rarity, DateTime lastHealth, DateTime untilGrown, MoplaBreed moplaBreed, string color) { PetId = petId; OwnerId = ownerId; RoomId = roomId; Name = name; Type = type; Race = race; Experience = experience; Energy = energy; Nutrition = nutrition; Respect = respect; CreationStamp = creationStamp; X = x; Y = y; Z = z; PlacedInRoom = false; DbState = DatabaseUpdateState.Updated; HaveSaddle = havesaddle; AnyoneCanRide = anyoneCanRide; PetHair = petHer; HairDye = dye; Rarity = rarity; LastHealth = lastHealth; UntilGrown = untilGrown; MoplaBreed = moplaBreed; WaitingForBreading = 0; RaceId = PetTypeManager.GetPetRaceIdByType(Type); Color = color; }
/// <summary> /// Gets the message. /// </summary> /// <param name="furniId">The furni identifier.</param> /// <param name="pet1">The pet1.</param> /// <param name="pet2">The pet2.</param> /// <returns>ServerMessage.</returns> internal static ServerMessage GetMessage(uint furniId, Pet pet1, Pet pet2) { ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("PetBreedMessageComposer")); message.AppendInteger(furniId); message.AppendInteger(pet1.PetId); message.AppendString(pet1.Name); message.AppendInteger(pet1.Level); message.AppendString(pet1.Look); message.AppendString(pet1.OwnerName); message.AppendInteger(pet2.PetId); message.AppendString(pet2.Name); message.AppendInteger(pet2.Level); message.AppendString(pet2.Look); message.AppendString(pet2.OwnerName); message.AppendInteger(4); message.AppendInteger(1); switch (pet1.Type) { case "pet_terrier": message.AppendInteger(TerrierEpicRace.Length); foreach (int value in TerrierEpicRace) { message.AppendInteger(value); } break; case "pet_bear": message.AppendInteger(BearEpicRace.Length); foreach (int value in BearEpicRace) { message.AppendInteger(value); } break; } message.AppendInteger(2); switch (pet1.Type) { case "pet_terrier": message.AppendInteger(TerrierRareRace.Length); foreach (int value in TerrierRareRace) { message.AppendInteger(value); } break; case "pet_bear": message.AppendInteger(BearRareRace.Length); foreach (int value in BearRareRace) { message.AppendInteger(value); } break; } message.AppendInteger(3); switch (pet1.Type) { case "pet_terrier": message.AppendInteger(TerrierNoRareRace.Length); foreach (int value in TerrierNoRareRace) { message.AppendInteger(value); } break; case "pet_bear": message.AppendInteger(BearNoRareRace.Length); foreach (int value in BearNoRareRace) { message.AppendInteger(value); } break; } message.AppendInteger(94); switch (pet1.Type) { case "pet_terrier": message.AppendInteger(TerrierNormalRace.Length); foreach (int value in TerrierNormalRace) { message.AppendInteger(value); } break; case "pet_bear": message.AppendInteger(BearNormalRace.Length); foreach (int value in BearNormalRace) { message.AppendInteger(value); } break; } message.AppendInteger(pet1.Type == "pet_terrier" ? PetTypeManager.GetPetRaceIdByType("pet_terrierbaby") : PetTypeManager.GetPetRaceIdByType("pet_bearbaby")); return(message); }