コード例 #1
0
        private static void RemovePetLevel(ref Mate mate, Guid idToRemove)
        {
            if (mate == null || mate.Level <= 1)
            {
                return;
            }

            mate.Level     -= 1;
            mate.Experience = 0;
            mate.Hp         = mate.HpLoad();
            mate.Mp         = mate.MpLoad();
            mate.Owner?.Session.SendPacket(mate.GenerateCond());
            mate.Owner?.Session.SendPacket(mate.GenerateScPacket());
            mate.Owner?.Session.CurrentMapInstance?.Broadcast(StaticPacketHelper.GenerateEff(UserType.Npc, mate.MateTransportId, 8), mate.PositionX, mate.PositionY);
            mate.Owner?.Session.CurrentMapInstance?.Broadcast(StaticPacketHelper.GenerateEff(UserType.Npc, mate.MateTransportId, 198), mate.PositionX, mate.PositionY);
            mate.Owner?.Session.Character.Inventory.RemoveItemFromInventory(idToRemove);
        }