private static void ChangeToDefaultHair(GameSession session)
    {
        int hairId;

        if (session.Player.Gender == Gender.Male)
        {
            hairId = 10200003; // Mega Mop-Top
        }
        else
        {
            hairId = 10200012; // Cutesy Twin Tails
        }

        BeautyHelper.ChangeHair(session, hairId, out _, out _);
    }
Ejemplo n.º 2
0
    private static void HandleRandomHair(GameSession session, PacketReader packet)
    {
        int  shopId     = packet.ReadInt();
        bool useVoucher = packet.ReadBool();

        BeautyShop            beautyShop  = DatabaseManager.BeautyShops.FindById(shopId);
        List <BeautyShopItem> beautyItems = DatabaseManager.BeautyShopItems.FindAllByShopIdAndGender(beautyShop.Id, session.Player.Gender);

        if (!HandleShopPay(session, beautyShop, useVoucher))
        {
            return;
        }

        // Grab random hair
        Random         random     = Random.Shared;
        int            indexHair  = random.Next(beautyItems.Count);
        BeautyShopItem chosenHair = beautyItems[indexHair];

        BeautyHelper.ChangeHair(session, chosenHair.ItemId, out Item previousHair, out Item newHair);

        session.FieldManager.BroadcastPacket(EquipmentPacket.EquipItem(session.Player.FieldPlayer, newHair, ItemSlot.HR));
        session.Send(BeautyPacket.RandomHairOption(previousHair, newHair));
    }