Beispiel #1
0
    public PetInfo()
    {
        Name           = "";
        Exp            = 0;
        Level          = 1;
        PotionSettings = new();
        LootSettings   = new();

        Uid = DatabaseManager.Pets.Insert(this);
    }
Beispiel #2
0
    public PetInfo(PetInfo otherPetInfo)
    {
        Name           = otherPetInfo.Name;
        Exp            = otherPetInfo.Exp;
        Level          = otherPetInfo.Level;
        PotionSettings = otherPetInfo.PotionSettings;
        LootSettings   = otherPetInfo.LootSettings;

        Uid = DatabaseManager.Pets.Insert(this);
    }
Beispiel #3
0
    private static void HandlePetLootSettings(GameSession session, PacketReader packet)
    {
        PetLootSettings settings = packet.ReadClass <PetLootSettings>();

        Player    player      = session.Player;
        Character fieldPlayer = player.FieldPlayer;

        if (fieldPlayer.ActivePet is null || player.ActivePet is null)
        {
            return;
        }

        player.ActivePet.PetInfo.LootSettings = settings;
        fieldPlayer.ActivePet.Item            = player.ActivePet;
        session.Send(ResponsePetPacket.UpdateLoot(fieldPlayer.ActivePet));

        DatabaseManager.Pets.Update(fieldPlayer.ActivePet.Item.PetInfo);
    }